@aspire-ui/element-component-pro 1.0.16 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/CollapseContainer/CollapseContainer.vue.d.ts +101 -0
- package/dist/CollapseContainer/index.d.ts +4 -0
- package/dist/ProDescriptions/ProDescriptions.vue.d.ts +1 -1
- package/dist/ProForm/ProForm.vue.d.ts +1 -1
- package/dist/ProTable/ProTable.vue.d.ts +1 -1
- package/dist/element-component-pro.es.js +931 -853
- 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 +529 -94
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +25 -0
- package/package.json +1 -1
- package/src/CollapseContainer/CollapseContainer.vue +284 -0
- package/src/CollapseContainer/index.ts +4 -0
- package/src/ProForm/ApiSelect.vue +25 -4
- package/src/index.ts +4 -0
- package/src/types/index.ts +26 -0
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { reactive as
|
|
2
|
-
import { MessageBox as
|
|
3
|
-
const fe =
|
|
4
|
-
function
|
|
1
|
+
import { reactive as Ze, defineComponent as oe, h as ue, useSlots as Fe, ref as z, computed as C, onMounted as me, nextTick as Ke, onUnmounted as ke, watch as U, unref as pe } from "vue";
|
|
2
|
+
import { MessageBox as Qe } from "element-ui";
|
|
3
|
+
const fe = Ze({});
|
|
4
|
+
function $e(c, e) {
|
|
5
5
|
if (!e)
|
|
6
6
|
return c;
|
|
7
7
|
for (const n in e)
|
|
8
8
|
if (Object.prototype.hasOwnProperty.call(e, n)) {
|
|
9
9
|
const t = c[n], o = e[n];
|
|
10
|
-
|
|
10
|
+
Ee(o) ? Ee(t) ? c[n] = $e(
|
|
11
11
|
t,
|
|
12
12
|
o
|
|
13
13
|
) : c[n] = { ...o } : c[n] = o;
|
|
14
14
|
}
|
|
15
15
|
return c;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function Ee(c) {
|
|
18
18
|
if (!c || typeof c != "object")
|
|
19
19
|
return !1;
|
|
20
20
|
const e = Object.getPrototypeOf(c);
|
|
21
21
|
return e === Object.prototype || e === null;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function Be() {
|
|
24
24
|
return {
|
|
25
25
|
getSetting: (t) => JSON.parse(JSON.stringify(t === void 0 ? fe : fe[t] ?? {})),
|
|
26
26
|
setSetting: (t, o) => {
|
|
27
|
-
const
|
|
28
|
-
|
|
27
|
+
const r = fe[t];
|
|
28
|
+
r ? fe[t] = $e({ ...r }, o) : fe[t] = { ...o };
|
|
29
29
|
},
|
|
30
30
|
mergeSettings: (t, o) => {
|
|
31
|
-
const
|
|
32
|
-
return
|
|
31
|
+
const r = fe[t] ?? {};
|
|
32
|
+
return $e({ ...r }, o);
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
const
|
|
36
|
+
const Ye = /* @__PURE__ */ oe({
|
|
37
37
|
__name: "ProTable",
|
|
38
38
|
props: {
|
|
39
39
|
columns: null,
|
|
@@ -78,7 +78,7 @@ const Qe = /* @__PURE__ */ le({
|
|
|
78
78
|
},
|
|
79
79
|
emits: ["register", "fetch-success", "fetch-error", "selection-change", "row-click", "row-dblclick", "sort-change", "expand-change"],
|
|
80
80
|
setup(c, { expose: e, emit: n }) {
|
|
81
|
-
const t = c, o =
|
|
81
|
+
const t = c, o = oe({
|
|
82
82
|
name: "EcpProTableDefaultCellRenderer",
|
|
83
83
|
props: {
|
|
84
84
|
column: { type: Object, required: !0 },
|
|
@@ -88,20 +88,20 @@ const Qe = /* @__PURE__ */ le({
|
|
|
88
88
|
},
|
|
89
89
|
setup(l) {
|
|
90
90
|
return () => {
|
|
91
|
-
var
|
|
92
|
-
const
|
|
93
|
-
if (
|
|
94
|
-
const
|
|
95
|
-
return typeof
|
|
91
|
+
var _, k;
|
|
92
|
+
const s = l.column;
|
|
93
|
+
if (s != null && s.customRender) {
|
|
94
|
+
const W = s.customRender({ text: l.value, record: l.record, index: l.index });
|
|
95
|
+
return typeof W == "string" || typeof W == "number" ? ue("span", String(W)) : W;
|
|
96
96
|
}
|
|
97
|
-
if (
|
|
98
|
-
const
|
|
99
|
-
return ue("span",
|
|
97
|
+
if (s != null && s.valueEnum) {
|
|
98
|
+
const W = ((k = (_ = s.valueEnum) == null ? void 0 : _[l.value]) == null ? void 0 : k.text) ?? l.value;
|
|
99
|
+
return ue("span", W == null ? "" : String(W));
|
|
100
100
|
}
|
|
101
101
|
return ue("span", l.value == null ? "" : String(l.value));
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
|
-
}),
|
|
104
|
+
}), r = oe({
|
|
105
105
|
name: "EcpProTableBodyCellRenderer",
|
|
106
106
|
props: {
|
|
107
107
|
slotRender: { type: Function, required: !0 },
|
|
@@ -114,198 +114,198 @@ const Qe = /* @__PURE__ */ le({
|
|
|
114
114
|
},
|
|
115
115
|
setup(l) {
|
|
116
116
|
return () => {
|
|
117
|
-
const
|
|
118
|
-
if (((
|
|
119
|
-
return
|
|
120
|
-
const
|
|
121
|
-
return l.customRender && (
|
|
117
|
+
const s = l.slotRender, _ = s == null ? void 0 : s({ column: l.column, record: l.record, index: l.index, value: l.value });
|
|
118
|
+
if (((Q) => Q == null ? [] : Array.isArray(Q) ? Q.filter((le) => le != null && le !== !1 && !le.isComment) : [Q])(_).length > 0)
|
|
119
|
+
return _;
|
|
120
|
+
const I = { ...l.column };
|
|
121
|
+
return l.customRender && (I.customRender = l.customRender), l.valueEnum && (I.valueEnum = l.valueEnum), ue(o, { props: { column: I, record: l.record, index: l.index, value: l.value } });
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
|
-
}),
|
|
125
|
-
const l =
|
|
124
|
+
}), a = Fe(), v = z(), u = z(), P = z(0), $ = z(t.loading ?? !1), m = z([]), S = z({}), p = z([]), x = z({}), g = z([]), V = z(null), { mergeSettings: O } = Be(), y = C(() => O("ProTable", { ...t, ...x.value })), q = C(() => {
|
|
125
|
+
const l = y.value.pagination;
|
|
126
126
|
return l && typeof l == "object" ? {
|
|
127
127
|
pageSize: l.pageSize ?? 10,
|
|
128
128
|
pageSizes: l.pageSizes ?? [10, 20, 50, 100]
|
|
129
129
|
} : { pageSize: 10, pageSizes: [10, 20, 50, 100] };
|
|
130
|
-
}), A =
|
|
130
|
+
}), A = z({
|
|
131
131
|
page: 1,
|
|
132
132
|
pageSize: q.value.pageSize,
|
|
133
133
|
pageSizes: q.value.pageSizes,
|
|
134
134
|
total: 0
|
|
135
|
-
}),
|
|
135
|
+
}), F = C(() => !!y.value.title || !!a.tableTitle || !!a.toolbar), f = C(() => V.value !== null ? V.value : !!t.pagination && typeof t.pagination == "object"), K = C(() => y.value.pagination && typeof y.value.pagination == "object" ? !!y.value.pagination.small : !1), M = C(() => y.value.pagination && typeof y.value.pagination == "object" ? !!y.value.pagination.background : !1), D = C(() => y.value.rowKey || "id"), j = C(() => new Set(g.value.map((l) => l[D.value]))), G = C(
|
|
136
136
|
() => p.value.filter((l) => !l.hideInTable && !l.defaultHidden)
|
|
137
|
-
), H =
|
|
138
|
-
var
|
|
137
|
+
), H = C(() => {
|
|
138
|
+
var s, _;
|
|
139
139
|
let l = 0;
|
|
140
|
-
return
|
|
141
|
-
}),
|
|
142
|
-
const
|
|
143
|
-
if (
|
|
144
|
-
const
|
|
145
|
-
let
|
|
146
|
-
const
|
|
147
|
-
return
|
|
140
|
+
return y.value.rowSelection && (l += Number(y.value.rowSelection.width) || 48), y.value.showIndexColumn && (l += Number((s = y.value.indexColumnProps) == null ? void 0 : s.width) || 60), y.value.actionColumn && (l += Number((_ = y.value.actionColumn) == null ? void 0 : _.width) || 150), l;
|
|
141
|
+
}), Y = (l) => typeof l == "number" && l > 0, X = C(() => G.value.filter((s) => ne(s) && Y(s.width)).reduce((s, _) => s + (typeof _.width == "number" ? _.width : 0), 0)), ee = C(() => G.value.filter((s) => ne(s) && typeof s.width == "string").reduce((s, _) => s + (Number(te(_)) || 80), 0)), J = (l) => l == null ? null : typeof l == "number" ? l : parseInt(String(l).replace(/px$/i, ""), 10) || null, te = (l) => {
|
|
142
|
+
const s = l.width;
|
|
143
|
+
if (Y(s) && X.value > 0 && P.value > 0 && typeof s == "number") {
|
|
144
|
+
const _ = P.value - H.value - ee.value;
|
|
145
|
+
let k = Math.floor(_ * s / X.value);
|
|
146
|
+
const W = J(l.minWidth) ?? 60, I = J(l.maxWidth);
|
|
147
|
+
return k = Math.max(W, k), I != null && (k = Math.min(I, k)), k;
|
|
148
148
|
}
|
|
149
|
-
if (typeof
|
|
150
|
-
const
|
|
151
|
-
let
|
|
152
|
-
return
|
|
149
|
+
if (typeof s == "string") {
|
|
150
|
+
const _ = J(s) ?? 80, k = J(l.minWidth), W = J(l.maxWidth);
|
|
151
|
+
let I = _;
|
|
152
|
+
return k != null && (I = Math.max(k, I)), W != null && (I = Math.min(W, I)), I;
|
|
153
153
|
}
|
|
154
154
|
return l.width;
|
|
155
|
-
}, ne = (l) => l.ifShow === !1 ? !1 : typeof l.ifShow == "function" ? l.ifShow({ column: l }) : !0,
|
|
156
|
-
var
|
|
157
|
-
const l = (
|
|
158
|
-
return l ?
|
|
159
|
-
var
|
|
160
|
-
return !((
|
|
161
|
-
}) :
|
|
162
|
-
}),
|
|
163
|
-
const l =
|
|
164
|
-
return l > 0 && l <
|
|
165
|
-
}),
|
|
166
|
-
var
|
|
167
|
-
return ((
|
|
168
|
-
},
|
|
169
|
-
var
|
|
170
|
-
return ((
|
|
171
|
-
},
|
|
172
|
-
const l =
|
|
173
|
-
n("selection-change", { keys: l, rows:
|
|
174
|
-
},
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
},
|
|
178
|
-
|
|
155
|
+
}, ne = (l) => l.ifShow === !1 ? !1 : typeof l.ifShow == "function" ? l.ifShow({ column: l }) : !0, b = C(() => {
|
|
156
|
+
var s;
|
|
157
|
+
const l = (s = y.value.rowSelection) == null ? void 0 : s.getCheckboxProps;
|
|
158
|
+
return l ? m.value.filter((_) => {
|
|
159
|
+
var k;
|
|
160
|
+
return !((k = l(_)) != null && k.disabled);
|
|
161
|
+
}) : m.value;
|
|
162
|
+
}), N = C(() => b.value.length > 0), T = C(() => b.value.length === 0 ? !1 : b.value.every((l) => j.value.has(l[D.value]))), i = C(() => {
|
|
163
|
+
const l = b.value.filter((s) => j.value.has(s[D.value])).length;
|
|
164
|
+
return l > 0 && l < b.value.length;
|
|
165
|
+
}), h = (l) => j.value.has(l[D.value]), R = (l) => {
|
|
166
|
+
var s, _, k;
|
|
167
|
+
return ((k = (_ = (s = y.value.rowSelection) == null ? void 0 : s.getCheckboxProps) == null ? void 0 : _.call(s, l)) == null ? void 0 : k.disabled) ?? !1;
|
|
168
|
+
}, L = (l) => {
|
|
169
|
+
var s, _, k;
|
|
170
|
+
return ((k = (_ = (s = y.value.rowSelection) == null ? void 0 : s.getRadioProps) == null ? void 0 : _.call(s, l)) == null ? void 0 : k.disabled) ?? !1;
|
|
171
|
+
}, E = () => {
|
|
172
|
+
const l = g.value.map((s) => s[D.value]);
|
|
173
|
+
n("selection-change", { keys: l, rows: g.value });
|
|
174
|
+
}, Z = (l, s) => {
|
|
175
|
+
const _ = l[D.value];
|
|
176
|
+
s ? g.value = [...g.value.filter((k) => k[D.value] !== _), l] : g.value = g.value.filter((k) => k[D.value] !== _), E();
|
|
177
|
+
}, re = (l) => {
|
|
178
|
+
g.value = [l], E();
|
|
179
179
|
}, he = (l) => {
|
|
180
180
|
if (l) {
|
|
181
|
-
const
|
|
182
|
-
|
|
181
|
+
const s = new Set(g.value.map((k) => k[D.value])), _ = b.value.filter((k) => !s.has(k[D.value]));
|
|
182
|
+
g.value = [...g.value, ..._];
|
|
183
183
|
} else {
|
|
184
|
-
const
|
|
185
|
-
|
|
184
|
+
const s = new Set(m.value.map((_) => _[D.value]));
|
|
185
|
+
g.value = g.value.filter((_) => !s.has(_[D.value]));
|
|
186
186
|
}
|
|
187
|
-
|
|
188
|
-
},
|
|
187
|
+
E();
|
|
188
|
+
}, se = async (l) => {
|
|
189
189
|
if (!t.api) {
|
|
190
190
|
if (t.dataSource)
|
|
191
191
|
return;
|
|
192
|
-
|
|
192
|
+
m.value = [];
|
|
193
193
|
return;
|
|
194
194
|
}
|
|
195
|
-
|
|
195
|
+
$.value = !0;
|
|
196
196
|
try {
|
|
197
|
-
const
|
|
198
|
-
[
|
|
199
|
-
[
|
|
197
|
+
const s = y.value.fetchSetting ?? {}, _ = s.pageField ?? "page", k = s.sizeField ?? "pageSize", W = s.listField ?? "list", I = s.totalField ?? "total", Q = {
|
|
198
|
+
[_]: (l == null ? void 0 : l.page) ?? A.value.page,
|
|
199
|
+
[k]: (l == null ? void 0 : l.pageSize) ?? A.value.pageSize,
|
|
200
200
|
...t.searchInfo,
|
|
201
201
|
...l == null ? void 0 : l.searchInfo
|
|
202
202
|
};
|
|
203
203
|
(l == null ? void 0 : l.page) != null && (A.value.page = l.page), (l == null ? void 0 : l.pageSize) != null && (A.value.pageSize = l.pageSize);
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
const Pe = t.afterFetch ? t.afterFetch(
|
|
207
|
-
|
|
208
|
-
} catch (
|
|
209
|
-
n("fetch-error",
|
|
204
|
+
const le = t.beforeFetch ? t.beforeFetch(Q) : Q, Me = await t.api(le);
|
|
205
|
+
S.value = Me || {};
|
|
206
|
+
const Pe = t.afterFetch ? t.afterFetch(Me) : Me, De = Pe[W] ?? Pe.items ?? Pe.list ?? [], ze = Pe[I] ?? 0;
|
|
207
|
+
m.value = De, A.value.total = ze, n("fetch-success", { items: De, total: ze });
|
|
208
|
+
} catch (s) {
|
|
209
|
+
n("fetch-error", s);
|
|
210
210
|
} finally {
|
|
211
|
-
|
|
211
|
+
$.value = !1;
|
|
212
212
|
}
|
|
213
|
-
}, _e = () =>
|
|
214
|
-
|
|
215
|
-
},
|
|
216
|
-
|
|
217
|
-
}, ye = (l,
|
|
213
|
+
}, _e = () => se(void 0), ge = (l) => {
|
|
214
|
+
y.value.clearSelectOnPageChange && (g.value = []), A.value.pageSize = l, A.value.page = 1, se(void 0);
|
|
215
|
+
}, be = (l) => {
|
|
216
|
+
y.value.clearSelectOnPageChange && (g.value = []), A.value.page = l, se(void 0);
|
|
217
|
+
}, ye = (l, s, _) => n("row-click", l, _), we = (l, s, _) => n("row-dblclick", l, _), Ce = ({ prop: l, order: s }) => n("sort-change", { prop: l, order: s }), xe = (l, s) => n("expand-change", l, s), ve = (l) => m.value.findIndex((s) => s[D.value] === l), ie = {
|
|
218
218
|
setProps: (l) => {
|
|
219
|
-
|
|
219
|
+
x.value = { ...x.value, ...l };
|
|
220
220
|
},
|
|
221
|
-
reload: (l) =>
|
|
221
|
+
reload: (l) => se(l),
|
|
222
222
|
redoHeight: () => {
|
|
223
|
-
var l,
|
|
224
|
-
(
|
|
223
|
+
var l, s;
|
|
224
|
+
(s = (l = v.value) == null ? void 0 : l.doLayout) == null || s.call(l);
|
|
225
225
|
},
|
|
226
226
|
setLoading: (l) => {
|
|
227
|
-
|
|
227
|
+
$.value = l;
|
|
228
228
|
},
|
|
229
|
-
getDataSource: () =>
|
|
230
|
-
getRawDataSource: () =>
|
|
229
|
+
getDataSource: () => m.value,
|
|
230
|
+
getRawDataSource: () => S.value,
|
|
231
231
|
setTableData: (l) => {
|
|
232
|
-
|
|
232
|
+
m.value = l ?? [];
|
|
233
233
|
},
|
|
234
234
|
getColumns: () => p.value,
|
|
235
235
|
setColumns: (l) => {
|
|
236
236
|
if (Array.isArray(l) && l.length > 0 && typeof l[0] == "string") {
|
|
237
|
-
const
|
|
238
|
-
|
|
237
|
+
const s = l, _ = (t.columns ?? []).filter((W) => s.includes(W.key ?? W.dataIndex)), k = s.map((W) => _.find((I) => (I.key ?? I.dataIndex) === W)).filter(Boolean);
|
|
238
|
+
k.length && (p.value = k);
|
|
239
239
|
} else
|
|
240
240
|
p.value = l ?? [];
|
|
241
241
|
},
|
|
242
242
|
setPagination: (l) => {
|
|
243
243
|
l != null && l.page && (A.value.page = l.page), l != null && l.pageSize && (A.value.pageSize = l.pageSize), (l == null ? void 0 : l.total) !== void 0 && (A.value.total = l.total);
|
|
244
244
|
},
|
|
245
|
-
getSelectRowKeys: () =>
|
|
246
|
-
getSelectRows: () =>
|
|
245
|
+
getSelectRowKeys: () => g.value.map((l) => l[D.value]),
|
|
246
|
+
getSelectRows: () => g.value,
|
|
247
247
|
clearSelectedRowKeys: () => {
|
|
248
|
-
|
|
248
|
+
g.value = [], E();
|
|
249
249
|
},
|
|
250
250
|
setSelectedRowKeys: (l) => {
|
|
251
|
-
const
|
|
252
|
-
l.forEach((
|
|
253
|
-
|
|
254
|
-
}),
|
|
251
|
+
const s = new Set(l), _ = m.value.filter((k) => s.has(k[D.value]));
|
|
252
|
+
l.forEach((k) => {
|
|
253
|
+
_.some((W) => W[D.value] === k) || _.push({ [D.value]: k });
|
|
254
|
+
}), g.value = _, E();
|
|
255
255
|
},
|
|
256
256
|
deleteSelectRowByKey: (l) => {
|
|
257
|
-
|
|
257
|
+
g.value = g.value.filter((s) => s[D.value] !== l), E();
|
|
258
258
|
},
|
|
259
|
-
updateTableData: (l,
|
|
260
|
-
l < 0 || l >=
|
|
259
|
+
updateTableData: (l, s, _) => {
|
|
260
|
+
l < 0 || l >= m.value.length || (m.value = [...m.value], m.value[l] = { ...m.value[l], [s]: _ });
|
|
261
261
|
},
|
|
262
|
-
updateTableDataRecord: (l,
|
|
263
|
-
const
|
|
264
|
-
if (!(
|
|
265
|
-
return
|
|
262
|
+
updateTableDataRecord: (l, s) => {
|
|
263
|
+
const _ = ve(l);
|
|
264
|
+
if (!(_ < 0))
|
|
265
|
+
return m.value = [...m.value], m.value[_] = { ...m.value[_], ...s }, m.value[_];
|
|
266
266
|
},
|
|
267
267
|
deleteTableDataRecord: (l) => {
|
|
268
|
-
const
|
|
269
|
-
|
|
268
|
+
const s = Array.isArray(l) ? l : [l], _ = new Set(s);
|
|
269
|
+
m.value = m.value.filter((k) => !_.has(k[D.value]));
|
|
270
270
|
},
|
|
271
|
-
insertTableDataRecord: (l,
|
|
272
|
-
const
|
|
273
|
-
return
|
|
271
|
+
insertTableDataRecord: (l, s) => {
|
|
272
|
+
const _ = [...m.value];
|
|
273
|
+
return s == null || s >= _.length ? _.push(l) : _.splice(s, 0, l), m.value = _, l;
|
|
274
274
|
},
|
|
275
275
|
getPaginationRef: () => f.value ? { page: A.value.page, pageSize: Number(A.value.pageSize) || 10, total: A.value.total } : !1,
|
|
276
276
|
getShowPagination: () => f.value,
|
|
277
277
|
setShowPagination: (l) => {
|
|
278
|
-
|
|
278
|
+
V.value = l;
|
|
279
279
|
},
|
|
280
|
-
getRowSelection: () =>
|
|
280
|
+
getRowSelection: () => y.value.rowSelection,
|
|
281
281
|
expandAll: () => {
|
|
282
|
-
var
|
|
283
|
-
const l = ((
|
|
284
|
-
const
|
|
285
|
-
return
|
|
286
|
-
|
|
287
|
-
const
|
|
288
|
-
Array.isArray(
|
|
289
|
-
}),
|
|
282
|
+
var k;
|
|
283
|
+
const l = ((k = y.value.treeProps) == null ? void 0 : k.children) ?? "children", s = (W) => {
|
|
284
|
+
const I = [];
|
|
285
|
+
return W.forEach((Q) => {
|
|
286
|
+
I.push(Q);
|
|
287
|
+
const le = Q[l];
|
|
288
|
+
Array.isArray(le) && le.length > 0 && I.push(...s(le));
|
|
289
|
+
}), I;
|
|
290
290
|
};
|
|
291
|
-
|
|
292
|
-
var
|
|
293
|
-
return (
|
|
291
|
+
s(m.value).forEach((W) => {
|
|
292
|
+
var I, Q;
|
|
293
|
+
return (Q = (I = v.value) == null ? void 0 : I.toggleRowExpansion) == null ? void 0 : Q.call(I, W, !0);
|
|
294
294
|
});
|
|
295
295
|
},
|
|
296
296
|
collapseAll: () => {
|
|
297
|
-
var
|
|
298
|
-
const l = ((
|
|
299
|
-
const
|
|
300
|
-
return
|
|
301
|
-
|
|
302
|
-
const
|
|
303
|
-
Array.isArray(
|
|
304
|
-
}),
|
|
297
|
+
var k;
|
|
298
|
+
const l = ((k = y.value.treeProps) == null ? void 0 : k.children) ?? "children", s = (W) => {
|
|
299
|
+
const I = [];
|
|
300
|
+
return W.forEach((Q) => {
|
|
301
|
+
I.push(Q);
|
|
302
|
+
const le = Q[l];
|
|
303
|
+
Array.isArray(le) && le.length > 0 && I.push(...s(le));
|
|
304
|
+
}), I;
|
|
305
305
|
};
|
|
306
|
-
|
|
307
|
-
var
|
|
308
|
-
return (
|
|
306
|
+
s(m.value).forEach((W) => {
|
|
307
|
+
var I, Q;
|
|
308
|
+
return (Q = (I = v.value) == null ? void 0 : I.toggleRowExpansion) == null ? void 0 : Q.call(I, W, !1);
|
|
309
309
|
});
|
|
310
310
|
}
|
|
311
311
|
};
|
|
@@ -313,102 +313,102 @@ const Qe = /* @__PURE__ */ le({
|
|
|
313
313
|
const ce = () => {
|
|
314
314
|
p.value = [...t.columns ?? []];
|
|
315
315
|
}, de = () => {
|
|
316
|
-
t.api &&
|
|
316
|
+
t.api && y.value.immediate !== !1 ? se(void 0) : t.dataSource && (m.value = [...t.dataSource], !t.api && t.pagination !== !1 && (A.value.total = t.dataSource.length));
|
|
317
317
|
}, d = () => {
|
|
318
|
-
u.value && (
|
|
318
|
+
u.value && (P.value = u.value.offsetWidth || 0);
|
|
319
319
|
};
|
|
320
|
-
let w = null,
|
|
320
|
+
let w = null, B = null;
|
|
321
321
|
return me(() => {
|
|
322
|
-
ce(), n("register", ie), de(), typeof window < "u" && (window.addEventListener("resize", d), w = new ResizeObserver(d),
|
|
323
|
-
d(),
|
|
322
|
+
ce(), n("register", ie), de(), typeof window < "u" && (window.addEventListener("resize", d), w = new ResizeObserver(d), Ke(() => {
|
|
323
|
+
d(), B = u.value, B && (w == null || w.observe(B));
|
|
324
324
|
}));
|
|
325
|
-
}),
|
|
326
|
-
typeof window < "u" && (window.removeEventListener("resize", d), w &&
|
|
327
|
-
}),
|
|
328
|
-
!t.api && t.dataSource && (
|
|
329
|
-
}, { deep: !0 }),
|
|
330
|
-
|
|
331
|
-
}), { __sfc: !0, DefaultCellRenderer: o, BodyCellRenderer:
|
|
325
|
+
}), ke(() => {
|
|
326
|
+
typeof window < "u" && (window.removeEventListener("resize", d), w && B && (w.unobserve(B), B = null));
|
|
327
|
+
}), U(() => t.columns, ce, { deep: !0 }), U(() => t.dataSource, () => {
|
|
328
|
+
!t.api && t.dataSource && (m.value = [...t.dataSource]);
|
|
329
|
+
}, { deep: !0 }), U(() => t.loading, (l) => {
|
|
330
|
+
$.value = l ?? !1;
|
|
331
|
+
}), { __sfc: !0, DefaultCellRenderer: o, BodyCellRenderer: r, props: t, emit: n, slots: a, tableRef: v, tableWrapRef: u, containerWidth: P, loading: $, innerData: m, rawDataSource: S, innerColumns: p, innerProps: x, selectedRows: g, showPaginationRef: V, mergeSettings: O, effectiveProps: y, defaultPagination: q, pagination: A, showTitleBar: F, showPagination: f, paginationSmall: K, paginationBackground: M, rowKeyField: D, selectedKeysSet: j, displayColumns: G, fixedColumnsWidth: H, isRatioWidth: Y, totalRatio: X, fixedDataColumnsWidth: ee, parseWidthPx: J, getColumnWidth: te, shouldShowColumn: ne, selectableRows: b, hasSelectableRows: N, isAllCurrentPageSelected: T, isIndeterminate: i, isRowSelected: h, getCheckboxDisabled: R, getRadioDisabled: L, emitSelectionChange: E, handleCheckboxChange: Z, handleRadioSelect: re, handleSelectAll: he, fetchData: se, handleReload: _e, handleSizeChange: ge, handleCurrentChange: be, handleRowClick: ye, handleRowDblclick: we, handleSortChange: Ce, handleExpandChange: xe, findRowIndex: ve, tableAction: ie, syncColumns: ce, loadData: de, updateContainerWidth: d, resizeObserver: w, observedEl: B };
|
|
332
332
|
}
|
|
333
333
|
});
|
|
334
|
-
function ae(c, e, n, t, o,
|
|
334
|
+
function ae(c, e, n, t, o, r, a, v) {
|
|
335
335
|
var u = typeof c == "function" ? c.options : c;
|
|
336
|
-
e && (u.render = e, u.staticRenderFns = n, u._compiled = !0), t && (u.functional = !0),
|
|
337
|
-
var
|
|
338
|
-
if (
|
|
339
|
-
|
|
336
|
+
e && (u.render = e, u.staticRenderFns = n, u._compiled = !0), t && (u.functional = !0), r && (u._scopeId = "data-v-" + r);
|
|
337
|
+
var P;
|
|
338
|
+
if (a ? (P = function(S) {
|
|
339
|
+
S = S || // cached call
|
|
340
340
|
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
341
|
-
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !
|
|
342
|
-
}, u._ssrRegister =
|
|
341
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !S && typeof __VUE_SSR_CONTEXT__ < "u" && (S = __VUE_SSR_CONTEXT__), o && o.call(this, S), S && S._registeredComponents && S._registeredComponents.add(a);
|
|
342
|
+
}, u._ssrRegister = P) : o && (P = v ? function() {
|
|
343
343
|
o.call(
|
|
344
344
|
this,
|
|
345
345
|
(u.functional ? this.parent : this).$root.$options.shadowRoot
|
|
346
346
|
);
|
|
347
|
-
} : o),
|
|
347
|
+
} : o), P)
|
|
348
348
|
if (u.functional) {
|
|
349
|
-
u._injectStyles =
|
|
350
|
-
var
|
|
351
|
-
u.render = function(p,
|
|
352
|
-
return
|
|
349
|
+
u._injectStyles = P;
|
|
350
|
+
var $ = u.render;
|
|
351
|
+
u.render = function(p, x) {
|
|
352
|
+
return P.call(x), $(p, x);
|
|
353
353
|
};
|
|
354
354
|
} else {
|
|
355
|
-
var
|
|
356
|
-
u.beforeCreate =
|
|
355
|
+
var m = u.beforeCreate;
|
|
356
|
+
u.beforeCreate = m ? [].concat(m, P) : [P];
|
|
357
357
|
}
|
|
358
358
|
return {
|
|
359
359
|
exports: c,
|
|
360
360
|
options: u
|
|
361
361
|
};
|
|
362
362
|
}
|
|
363
|
-
var
|
|
364
|
-
var o,
|
|
363
|
+
var et = function() {
|
|
364
|
+
var o, r, a, v;
|
|
365
365
|
var e = this, n = e._self._c, t = e._self._setupProxy;
|
|
366
|
-
return n("div", { staticClass: "ecp-pro-table" }, [t.showTitleBar ? n("div", { staticClass: "ecp-pro-table__header" }, [n("div", { staticClass: "ecp-pro-table__title-wrapper" }, [n("span", { staticClass: "ecp-pro-table__title" }, [e._v(e._s(t.effectiveProps.title))]), t.effectiveProps.titleHelpMessage ? n("el-tooltip", { staticClass: "ecp-pro-table__help", attrs: { placement: "top" } }, [n("template", { slot: "content" }, [Array.isArray(t.effectiveProps.titleHelpMessage) ? n("span", e._l(t.effectiveProps.titleHelpMessage, function(u,
|
|
367
|
-
return n("div", { key:
|
|
366
|
+
return n("div", { staticClass: "ecp-pro-table" }, [t.showTitleBar ? n("div", { staticClass: "ecp-pro-table__header" }, [n("div", { staticClass: "ecp-pro-table__title-wrapper" }, [n("span", { staticClass: "ecp-pro-table__title" }, [e._v(e._s(t.effectiveProps.title))]), t.effectiveProps.titleHelpMessage ? n("el-tooltip", { staticClass: "ecp-pro-table__help", attrs: { placement: "top" } }, [n("template", { slot: "content" }, [Array.isArray(t.effectiveProps.titleHelpMessage) ? n("span", e._l(t.effectiveProps.titleHelpMessage, function(u, P) {
|
|
367
|
+
return n("div", { key: P }, [e._v(e._s(u))]);
|
|
368
368
|
}), 0) : n("span", [e._v(e._s(t.effectiveProps.titleHelpMessage))])]), n("i", { staticClass: "el-icon-question" })], 2) : e._e()], 1), n("div", { staticClass: "ecp-pro-table__toolbar" }, [e._t("tableTitle"), e._t("toolbar"), e._t("toolbar-right", function() {
|
|
369
369
|
var u;
|
|
370
370
|
return [((u = t.effectiveProps.tableSetting) == null ? void 0 : u.redo) !== !1 ? n("el-button", { attrs: { type: "text", icon: "el-icon-refresh", size: "small" }, on: { click: t.handleReload } }, [e._v(" 刷新 ")]) : e._e()];
|
|
371
371
|
})], 2)]) : e._e(), n("div", { directives: [{ name: "loading", rawName: "v-loading", value: t.loading, expression: "loading" }], ref: "tableWrapRef", staticClass: "ecp-pro-table__body" }, [n("el-table", e._b({ ref: "tableRef", attrs: { data: t.innerData, "row-key": t.effectiveProps.rowKey, border: t.effectiveProps.bordered, stripe: t.effectiveProps.striped, size: t.effectiveProps.size, "max-height": t.effectiveProps.maxHeight, height: t.effectiveProps.height, "default-sort": t.effectiveProps.defaultSort, "span-method": t.effectiveProps.spanMethod, "tree-props": t.effectiveProps.treeProps, "default-expand-all": t.effectiveProps.defaultExpandAll, "expand-row-keys": t.effectiveProps.expandRowKeys || [], lazy: t.effectiveProps.lazy, load: t.effectiveProps.load, "row-class-name": t.effectiveProps.rowClassName }, on: { "row-click": t.handleRowClick, "row-dblclick": t.handleRowDblclick, "sort-change": t.handleSortChange, "expand-change": t.handleExpandChange } }, "el-table", t.effectiveProps.tableProps, !1), [t.effectiveProps.rowSelection ? n("el-table-column", { attrs: { width: t.effectiveProps.rowSelection.width || 48, fixed: t.effectiveProps.rowSelection.fixed, align: "center" }, scopedSlots: e._u([{ key: "header", fn: function(u) {
|
|
372
372
|
return [t.effectiveProps.rowSelection.type !== "radio" ? n("el-checkbox", { attrs: { value: t.isAllCurrentPageSelected, indeterminate: t.isIndeterminate, disabled: !t.hasSelectableRows }, on: { change: t.handleSelectAll } }) : n("span")];
|
|
373
373
|
} }, { key: "default", fn: function(u) {
|
|
374
|
-
var
|
|
375
|
-
return [t.effectiveProps.rowSelection.type !== "radio" ? n("el-checkbox", { attrs: { value: t.isRowSelected(u.row), disabled: t.getCheckboxDisabled(u.row) }, on: { change: (
|
|
376
|
-
|
|
377
|
-
} } }) : n("el-radio", { attrs: { value: (
|
|
374
|
+
var P;
|
|
375
|
+
return [t.effectiveProps.rowSelection.type !== "radio" ? n("el-checkbox", { attrs: { value: t.isRowSelected(u.row), disabled: t.getCheckboxDisabled(u.row) }, on: { change: ($) => t.handleCheckboxChange(u.row, $) }, nativeOn: { click: function($) {
|
|
376
|
+
$.stopPropagation();
|
|
377
|
+
} } }) : n("el-radio", { attrs: { value: (P = t.selectedRows[0]) == null ? void 0 : P[t.rowKeyField], label: u.row[t.rowKeyField], disabled: t.getRadioDisabled(u.row) }, on: { change: function($) {
|
|
378
378
|
return t.handleRadioSelect(u.row);
|
|
379
|
-
} }, nativeOn: { click: function(
|
|
380
|
-
|
|
379
|
+
} }, nativeOn: { click: function($) {
|
|
380
|
+
$.stopPropagation();
|
|
381
381
|
} } }, [n("span")])];
|
|
382
|
-
} }], null, !1, 983730649) }) : e._e(), t.effectiveProps.showIndexColumn ? n("el-table-column", { attrs: { type: "index", label: ((o = t.effectiveProps.indexColumnProps) == null ? void 0 : o.title) || "序号", width: ((
|
|
383
|
-
return [t.shouldShowColumn(u) ? n("el-table-column", { key: u.dataIndex || u.key || u.title, attrs: { prop: u.dataIndex, label: u.title, width: t.getColumnWidth(u), "min-width": t.isRatioWidth(u.width) ? void 0 : u.minWidth, fixed: u.fixed, align: u.align || "left", sortable: u.sortable, formatter: u.formatter, "show-overflow-tooltip": u.ellipsis !== !1 && t.effectiveProps.ellipsis !== !1 }, scopedSlots: e._u([{ key: "header", fn: function(
|
|
384
|
-
return [u.dataIndex && e.$scopedSlots[`header-${u.dataIndex}`] ? e._t(`header-${u.dataIndex}`, null, { column: u }) : e.$scopedSlots.headerCell ? e._t("headerCell", null, { column: u }) : [n("span", [e._v(e._s(u.title))]), u.helpMessage ? n("el-tooltip", { staticClass: "ecp-pro-table__col-help", attrs: { placement: "top", effect: "dark" } }, [n("template", { slot: "content" }, [Array.isArray(u.helpMessage) ? n("span", e._l(u.helpMessage, function(
|
|
385
|
-
return n("div", { key:
|
|
382
|
+
} }], null, !1, 983730649) }) : e._e(), t.effectiveProps.showIndexColumn ? n("el-table-column", { attrs: { type: "index", label: ((o = t.effectiveProps.indexColumnProps) == null ? void 0 : o.title) || "序号", width: ((r = t.effectiveProps.indexColumnProps) == null ? void 0 : r.width) || 60, fixed: (a = t.effectiveProps.indexColumnProps) == null ? void 0 : a.fixed, align: ((v = t.effectiveProps.indexColumnProps) == null ? void 0 : v.align) || "center" } }) : e._e(), e._l(t.displayColumns, function(u) {
|
|
383
|
+
return [t.shouldShowColumn(u) ? n("el-table-column", { key: u.dataIndex || u.key || u.title, attrs: { prop: u.dataIndex, label: u.title, width: t.getColumnWidth(u), "min-width": t.isRatioWidth(u.width) ? void 0 : u.minWidth, fixed: u.fixed, align: u.align || "left", sortable: u.sortable, formatter: u.formatter, "show-overflow-tooltip": u.ellipsis !== !1 && t.effectiveProps.ellipsis !== !1 }, scopedSlots: e._u([{ key: "header", fn: function(P) {
|
|
384
|
+
return [u.dataIndex && e.$scopedSlots[`header-${u.dataIndex}`] ? e._t(`header-${u.dataIndex}`, null, { column: u }) : e.$scopedSlots.headerCell ? e._t("headerCell", null, { column: u }) : [n("span", [e._v(e._s(u.title))]), u.helpMessage ? n("el-tooltip", { staticClass: "ecp-pro-table__col-help", attrs: { placement: "top", effect: "dark" } }, [n("template", { slot: "content" }, [Array.isArray(u.helpMessage) ? n("span", e._l(u.helpMessage, function($, m) {
|
|
385
|
+
return n("div", { key: m }, [e._v(e._s($))]);
|
|
386
386
|
}), 0) : n("span", [e._v(e._s(u.helpMessage))])]), n("i", { staticClass: "el-icon-question" })], 2) : e._e()]];
|
|
387
|
-
} }, { key: "default", fn: function(
|
|
388
|
-
return [u.dataIndex && e.$scopedSlots[u.dataIndex] ? e._t(u.dataIndex, null, { row:
|
|
387
|
+
} }, { key: "default", fn: function(P) {
|
|
388
|
+
return [u.dataIndex && e.$scopedSlots[u.dataIndex] ? e._t(u.dataIndex, null, { row: P.row, column: u, index: P.$index, value: P.row[u.dataIndex] }) : e.$scopedSlots.bodyCell ? n(t.BodyCellRenderer, { attrs: { "slot-render": e.$scopedSlots.bodyCell, column: u, record: P.row, index: P.$index, value: P.row[u.dataIndex], "custom-render": u.customRender, "value-enum": u.valueEnum } }) : n(t.DefaultCellRenderer, { attrs: { column: u, record: P.row, index: P.$index, value: P.row[u.dataIndex] } })];
|
|
389
389
|
} }], null, !0) }) : e._e()];
|
|
390
390
|
}), t.effectiveProps.actionColumn ? n("el-table-column", { attrs: { label: t.effectiveProps.actionColumn.title || "操作", width: t.effectiveProps.actionColumn.width || 150, fixed: t.effectiveProps.actionColumn.fixed || "right", align: t.effectiveProps.actionColumn.align || "center" }, scopedSlots: e._u([{ key: "default", fn: function(u) {
|
|
391
391
|
return [e.$scopedSlots.action ? e._t("action", null, { record: u.row, column: t.effectiveProps.actionColumn, index: u.$index }) : e.$scopedSlots.bodyCell ? n(t.BodyCellRenderer, { attrs: { "slot-render": e.$scopedSlots.bodyCell, column: t.effectiveProps.actionColumn, record: u.row, index: u.$index, value: void 0, "custom-render": t.effectiveProps.actionColumn.customRender, "value-enum": t.effectiveProps.actionColumn.valueEnum } }) : e._e()];
|
|
392
392
|
} }], 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()]);
|
|
393
|
-
},
|
|
394
|
-
Qe,
|
|
393
|
+
}, tt = [], nt = /* @__PURE__ */ ae(
|
|
395
394
|
Ye,
|
|
396
395
|
et,
|
|
396
|
+
tt,
|
|
397
397
|
!1,
|
|
398
398
|
null,
|
|
399
399
|
"f3d27813",
|
|
400
400
|
null,
|
|
401
401
|
null
|
|
402
402
|
);
|
|
403
|
-
const
|
|
403
|
+
const Le = nt.exports, Oe = (c) => Array.isArray(c) ? c.length > 0 : c != null && String(c).trim() !== "", Ne = (c) => Array.isArray(c) ? c.map((e) => String(e)).join(", ") : c == null ? "" : typeof c == "object" ? JSON.stringify(c) : String(c), Te = (c, e) => {
|
|
404
404
|
if (!c)
|
|
405
405
|
return null;
|
|
406
406
|
if (c === !0)
|
|
407
407
|
return {
|
|
408
|
-
content:
|
|
408
|
+
content: Ne(e),
|
|
409
409
|
placement: "top",
|
|
410
410
|
effect: "dark",
|
|
411
|
-
disabled: !
|
|
411
|
+
disabled: !Oe(e)
|
|
412
412
|
};
|
|
413
413
|
if (typeof c == "string")
|
|
414
414
|
return {
|
|
@@ -417,8 +417,8 @@ const Ke = tt.exports, Ne = (c) => Array.isArray(c) ? c.length > 0 : c != null &
|
|
|
417
417
|
effect: "dark"
|
|
418
418
|
};
|
|
419
419
|
const n = { ...c };
|
|
420
|
-
return Object.prototype.hasOwnProperty.call(n, "content") || (n.content =
|
|
421
|
-
},
|
|
420
|
+
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;
|
|
421
|
+
}, ot = /* @__PURE__ */ oe({
|
|
422
422
|
__name: "TableAction",
|
|
423
423
|
props: {
|
|
424
424
|
actions: { default: () => [] },
|
|
@@ -426,124 +426,124 @@ const Ke = tt.exports, Ne = (c) => Array.isArray(c) ? c.length > 0 : c != null &
|
|
|
426
426
|
stopButtonPropagation: { type: Boolean, default: !1 }
|
|
427
427
|
},
|
|
428
428
|
setup(c) {
|
|
429
|
-
const e = c, n = (p) => Te(p) || {}, t = (p) => p.type ? p.type : p.color === "error" ? "danger" : p.color === "success" ? "success" : p.color === "warning" ? "warning" : "text", o = (p) => p.filter((
|
|
430
|
-
const { ifShow:
|
|
431
|
-
return typeof
|
|
432
|
-
}),
|
|
433
|
-
var
|
|
434
|
-
e.stopButtonPropagation &&
|
|
435
|
-
}, u = (p,
|
|
436
|
-
|
|
437
|
-
},
|
|
438
|
-
var
|
|
439
|
-
e.stopButtonPropagation &&
|
|
429
|
+
const e = c, n = (p) => Te(p) || {}, t = (p) => p.type ? p.type : p.color === "error" ? "danger" : p.color === "success" ? "success" : p.color === "warning" ? "warning" : "text", o = (p) => p.filter((x) => {
|
|
430
|
+
const { ifShow: g } = x;
|
|
431
|
+
return typeof g == "boolean" ? g : typeof g == "function" ? g(x) : !0;
|
|
432
|
+
}), r = C(() => o(e.actions || [])), a = C(() => o(e.dropDownActions || [])), v = (p, x) => {
|
|
433
|
+
var g;
|
|
434
|
+
e.stopButtonPropagation && x.stopPropagation(), (g = p.onClick) == null || g.call(p, x);
|
|
435
|
+
}, u = (p, x) => {
|
|
436
|
+
v(p, x);
|
|
437
|
+
}, P = (p, x, g) => {
|
|
438
|
+
var V, O, y, q;
|
|
439
|
+
e.stopButtonPropagation && g.stopPropagation(), p.popConfirm && (x === "confirm" ? (O = (V = p.popConfirm).confirm) == null || O.call(V) : (q = (y = p.popConfirm).cancel) == null || q.call(y));
|
|
440
440
|
};
|
|
441
|
-
return { __sfc: !0, props: e, normalizeTooltip: n, getButtonType: t, filterVisible: o, visibleActions:
|
|
442
|
-
|
|
443
|
-
}, handlePopConfirmCancel: (p,
|
|
444
|
-
|
|
441
|
+
return { __sfc: !0, props: e, normalizeTooltip: n, getButtonType: t, filterVisible: o, visibleActions: r, visibleDropDownActions: a, handleClick: v, handleActionClick: u, handlePopConfirm: P, handlePopConfirmConfirm: (p, x) => {
|
|
442
|
+
P(p, "confirm", x);
|
|
443
|
+
}, handlePopConfirmCancel: (p, x) => {
|
|
444
|
+
P(p, "cancel", x);
|
|
445
445
|
}, handleDropdownCommand: (p) => {
|
|
446
|
-
var
|
|
447
|
-
const
|
|
448
|
-
if (!(!
|
|
449
|
-
if (
|
|
450
|
-
const
|
|
451
|
-
|
|
452
|
-
confirmButtonText:
|
|
446
|
+
var V;
|
|
447
|
+
const x = Number(p), g = a.value[x];
|
|
448
|
+
if (!(!g || g.disabled)) {
|
|
449
|
+
if (g.popConfirm) {
|
|
450
|
+
const O = g.popConfirm.title, y = g.popConfirm.okText || "确定", q = g.popConfirm.cancelText || "取消";
|
|
451
|
+
Qe.confirm(O, "提示", {
|
|
452
|
+
confirmButtonText: y,
|
|
453
453
|
cancelButtonText: q,
|
|
454
454
|
type: "warning"
|
|
455
455
|
}).then(() => {
|
|
456
|
-
var A,
|
|
457
|
-
return (
|
|
456
|
+
var A, F;
|
|
457
|
+
return (F = (A = g.popConfirm) == null ? void 0 : A.confirm) == null ? void 0 : F.call(A);
|
|
458
458
|
}).catch(() => {
|
|
459
|
-
var A,
|
|
460
|
-
return (
|
|
459
|
+
var A, F;
|
|
460
|
+
return (F = (A = g.popConfirm) == null ? void 0 : A.cancel) == null ? void 0 : F.call(A);
|
|
461
461
|
});
|
|
462
462
|
return;
|
|
463
463
|
}
|
|
464
|
-
(
|
|
464
|
+
(V = g.onClick) == null || V.call(g, {});
|
|
465
465
|
}
|
|
466
466
|
} };
|
|
467
467
|
}
|
|
468
468
|
});
|
|
469
|
-
var
|
|
469
|
+
var lt = function() {
|
|
470
470
|
var e = this, n = e._self._c, t = e._self._setupProxy;
|
|
471
|
-
return n("div", { staticClass: "ecp-table-action" }, [e._l(t.visibleActions, function(o,
|
|
472
|
-
return n("span", { key: `action-${
|
|
473
|
-
return t.handlePopConfirmConfirm(o,
|
|
474
|
-
}, cancel: function(
|
|
475
|
-
return t.handlePopConfirmCancel(o,
|
|
476
|
-
} } }, [n("span", { attrs: { slot: "reference" }, slot: "reference" }, [n(o.tooltip ? "el-tooltip" : "span", e._b({ tag: "component" }, "component", o.tooltip ? t.normalizeTooltip(o.tooltip) : {}, !1), [n("el-button", e._b({ attrs: { type: t.getButtonType(o), size: "small", disabled: o.disabled }, on: { click: function(
|
|
477
|
-
return t.handleActionClick(o,
|
|
478
|
-
} } }, "el-button", o.props, !1), [o.icon ? n("i", { class: ["ecp-table-action__icon", o.icon] }) : e._e(), n("span", [e._v(e._s(o.label))])])], 1)], 1)]) : n(o.tooltip ? "el-tooltip" : "span", e._b({ tag: "component" }, "component", o.tooltip ? t.normalizeTooltip(o.tooltip) : {}, !1), [n("el-button", e._b({ attrs: { type: t.getButtonType(o), size: "small", disabled: o.disabled }, on: { click: function(
|
|
479
|
-
return t.handleActionClick(o,
|
|
471
|
+
return n("div", { staticClass: "ecp-table-action" }, [e._l(t.visibleActions, function(o, r) {
|
|
472
|
+
return n("span", { key: `action-${r}`, staticClass: "ecp-table-action__item" }, [o.popConfirm ? n("el-popconfirm", { attrs: { title: o.popConfirm.title, "confirm-button-text": o.popConfirm.okText || "确定", "cancel-button-text": o.popConfirm.cancelText || "取消" }, on: { confirm: function(a) {
|
|
473
|
+
return t.handlePopConfirmConfirm(o, a);
|
|
474
|
+
}, cancel: function(a) {
|
|
475
|
+
return t.handlePopConfirmCancel(o, a);
|
|
476
|
+
} } }, [n("span", { attrs: { slot: "reference" }, slot: "reference" }, [n(o.tooltip ? "el-tooltip" : "span", e._b({ tag: "component" }, "component", o.tooltip ? t.normalizeTooltip(o.tooltip) : {}, !1), [n("el-button", e._b({ attrs: { type: t.getButtonType(o), size: "small", disabled: o.disabled }, on: { click: function(a) {
|
|
477
|
+
return t.handleActionClick(o, a);
|
|
478
|
+
} } }, "el-button", o.props, !1), [o.icon ? n("i", { class: ["ecp-table-action__icon", o.icon] }) : e._e(), n("span", [e._v(e._s(o.label))])])], 1)], 1)]) : n(o.tooltip ? "el-tooltip" : "span", e._b({ tag: "component" }, "component", o.tooltip ? t.normalizeTooltip(o.tooltip) : {}, !1), [n("el-button", e._b({ attrs: { type: t.getButtonType(o), size: "small", disabled: o.disabled }, on: { click: function(a) {
|
|
479
|
+
return t.handleActionClick(o, a);
|
|
480
480
|
} } }, "el-button", o.props, !1), [o.icon ? n("i", { class: ["ecp-table-action__icon", o.icon] }) : e._e(), n("span", [e._v(e._s(o.label))])])], 1), o.divider ? n("el-divider", { attrs: { direction: "vertical" } }) : e._e()], 1);
|
|
481
|
-
}), t.visibleDropDownActions.length ? n("el-dropdown", { attrs: { trigger: "click" }, on: { command: t.handleDropdownCommand } }, [n("span", { staticClass: "ecp-table-action__more" }, [n("el-button", { attrs: { type: "text", size: "small" } }, [e._v(" 更多"), n("i", { staticClass: "el-icon-arrow-down el-icon--right" })])], 1), n("el-dropdown-menu", { attrs: { slot: "dropdown" }, slot: "dropdown" }, e._l(t.visibleDropDownActions, function(o,
|
|
482
|
-
return n("el-dropdown-item", { key: `dropdown-${
|
|
481
|
+
}), t.visibleDropDownActions.length ? n("el-dropdown", { attrs: { trigger: "click" }, on: { command: t.handleDropdownCommand } }, [n("span", { staticClass: "ecp-table-action__more" }, [n("el-button", { attrs: { type: "text", size: "small" } }, [e._v(" 更多"), n("i", { staticClass: "el-icon-arrow-down el-icon--right" })])], 1), n("el-dropdown-menu", { attrs: { slot: "dropdown" }, slot: "dropdown" }, e._l(t.visibleDropDownActions, function(o, r) {
|
|
482
|
+
return n("el-dropdown-item", { key: `dropdown-${r}`, attrs: { command: r, disabled: o.disabled, divided: !!o.divider } }, [n("span", { staticClass: "ecp-table-action__dropdown-item" }, [o.icon ? n("i", { class: ["ecp-table-action__icon", o.icon] }) : e._e(), n("span", [e._v(e._s(o.label))])])]);
|
|
483
483
|
}), 1)], 1) : e._e()], 2);
|
|
484
|
-
},
|
|
485
|
-
nt,
|
|
484
|
+
}, at = [], st = /* @__PURE__ */ ae(
|
|
486
485
|
ot,
|
|
487
486
|
lt,
|
|
487
|
+
at,
|
|
488
488
|
!1,
|
|
489
489
|
null,
|
|
490
490
|
"45a58e7c",
|
|
491
491
|
null,
|
|
492
492
|
null
|
|
493
493
|
);
|
|
494
|
-
const je =
|
|
495
|
-
function
|
|
496
|
-
const e =
|
|
497
|
-
const
|
|
498
|
-
if (!
|
|
494
|
+
const je = st.exports;
|
|
495
|
+
function tn(c) {
|
|
496
|
+
const e = z(null), n = () => c ? pe(c) : void 0, t = () => {
|
|
497
|
+
const a = pe(e);
|
|
498
|
+
if (!a)
|
|
499
499
|
throw new Error("ProTable instance has not been registered");
|
|
500
|
-
return
|
|
501
|
-
}, o = (
|
|
502
|
-
e.value =
|
|
503
|
-
const
|
|
504
|
-
|
|
500
|
+
return a;
|
|
501
|
+
}, o = (a) => {
|
|
502
|
+
e.value = a;
|
|
503
|
+
const v = n();
|
|
504
|
+
v && Object.keys(v).length > 0 && a.setProps(v);
|
|
505
505
|
};
|
|
506
|
-
return c &&
|
|
506
|
+
return c && U(
|
|
507
507
|
() => n(),
|
|
508
|
-
(
|
|
509
|
-
|
|
508
|
+
(a) => {
|
|
509
|
+
a && e.value && e.value.setProps(a);
|
|
510
510
|
},
|
|
511
511
|
{ deep: !0 }
|
|
512
512
|
), [o, {
|
|
513
|
-
setProps: (
|
|
514
|
-
reload: (
|
|
513
|
+
setProps: (a) => t().setProps(a),
|
|
514
|
+
reload: (a) => t().reload(a),
|
|
515
515
|
redoHeight: () => t().redoHeight(),
|
|
516
|
-
setLoading: (
|
|
516
|
+
setLoading: (a) => t().setLoading(a),
|
|
517
517
|
getDataSource: () => t().getDataSource(),
|
|
518
518
|
getRawDataSource: () => t().getRawDataSource(),
|
|
519
|
-
setTableData: (
|
|
519
|
+
setTableData: (a) => t().setTableData(a),
|
|
520
520
|
getColumns: () => t().getColumns(),
|
|
521
|
-
setColumns: (
|
|
522
|
-
setPagination: (
|
|
521
|
+
setColumns: (a) => t().setColumns(a),
|
|
522
|
+
setPagination: (a) => t().setPagination(a),
|
|
523
523
|
getSelectRowKeys: () => t().getSelectRowKeys(),
|
|
524
524
|
getSelectRows: () => t().getSelectRows(),
|
|
525
525
|
clearSelectedRowKeys: () => t().clearSelectedRowKeys(),
|
|
526
|
-
setSelectedRowKeys: (
|
|
527
|
-
deleteSelectRowByKey: (
|
|
528
|
-
updateTableData: (
|
|
529
|
-
updateTableDataRecord: (
|
|
530
|
-
deleteTableDataRecord: (
|
|
531
|
-
insertTableDataRecord: (
|
|
526
|
+
setSelectedRowKeys: (a) => t().setSelectedRowKeys(a),
|
|
527
|
+
deleteSelectRowByKey: (a) => t().deleteSelectRowByKey(a),
|
|
528
|
+
updateTableData: (a, v, u) => t().updateTableData(a, v, u),
|
|
529
|
+
updateTableDataRecord: (a, v) => t().updateTableDataRecord(a, v),
|
|
530
|
+
deleteTableDataRecord: (a) => t().deleteTableDataRecord(a),
|
|
531
|
+
insertTableDataRecord: (a, v) => t().insertTableDataRecord(a, v),
|
|
532
532
|
getPaginationRef: () => t().getPaginationRef(),
|
|
533
533
|
getShowPagination: () => t().getShowPagination(),
|
|
534
|
-
setShowPagination: (
|
|
534
|
+
setShowPagination: (a) => t().setShowPagination(a),
|
|
535
535
|
getRowSelection: () => t().getRowSelection(),
|
|
536
536
|
expandAll: () => {
|
|
537
|
-
var
|
|
538
|
-
return (
|
|
537
|
+
var a, v;
|
|
538
|
+
return (v = (a = t()).expandAll) == null ? void 0 : v.call(a);
|
|
539
539
|
},
|
|
540
540
|
collapseAll: () => {
|
|
541
|
-
var
|
|
542
|
-
return (
|
|
541
|
+
var a, v;
|
|
542
|
+
return (v = (a = t()).collapseAll) == null ? void 0 : v.call(a);
|
|
543
543
|
}
|
|
544
544
|
}];
|
|
545
545
|
}
|
|
546
|
-
const rt = /* @__PURE__ */
|
|
546
|
+
const rt = /* @__PURE__ */ oe({
|
|
547
547
|
__name: "ApiSelect",
|
|
548
548
|
props: {
|
|
549
549
|
value: null,
|
|
@@ -560,22 +560,22 @@ const rt = /* @__PURE__ */ le({
|
|
|
560
560
|
},
|
|
561
561
|
emits: ["input", "change"],
|
|
562
562
|
setup(c, { expose: e }) {
|
|
563
|
-
const n = c, t =
|
|
564
|
-
n.lazy &&
|
|
565
|
-
},
|
|
563
|
+
const n = c, t = z(!1), o = z([]), r = z([]), a = (m) => m == null ? "null" : JSON.stringify(v(m)), v = (m) => Array.isArray(m) ? m.map(v) : m !== null && typeof m == "object" ? Object.keys(m).sort().reduce((S, p) => (S[p] = v(m[p]), S), {}) : m, u = z(a(n.params ?? null)), P = (m) => {
|
|
564
|
+
n.lazy && m && (a(n.params ?? null) !== u.value || o.value.length === 0) && $();
|
|
565
|
+
}, $ = async () => {
|
|
566
566
|
if (n.api) {
|
|
567
567
|
t.value = !0;
|
|
568
568
|
try {
|
|
569
|
-
const
|
|
570
|
-
|
|
571
|
-
const
|
|
572
|
-
o.value =
|
|
573
|
-
const
|
|
569
|
+
const m = await n.api(n.params), S = Array.isArray(m) ? m : (m == null ? void 0 : m.list) ?? (m == null ? void 0 : m.data) ?? [];
|
|
570
|
+
r.value = S;
|
|
571
|
+
const p = n.labelField ?? "label", x = n.valueField ?? "value";
|
|
572
|
+
o.value = S.map((g) => {
|
|
573
|
+
const V = g;
|
|
574
574
|
return {
|
|
575
|
-
label: String(
|
|
576
|
-
value:
|
|
575
|
+
label: String(V[p] ?? V.label ?? ""),
|
|
576
|
+
value: V[x] ?? V.value
|
|
577
577
|
};
|
|
578
|
-
}),
|
|
578
|
+
}), u.value = a(n.params ?? null);
|
|
579
579
|
} finally {
|
|
580
580
|
t.value = !1;
|
|
581
581
|
}
|
|
@@ -583,23 +583,23 @@ const rt = /* @__PURE__ */ le({
|
|
|
583
583
|
};
|
|
584
584
|
return e({
|
|
585
585
|
options: o,
|
|
586
|
-
rawOptions:
|
|
586
|
+
rawOptions: r,
|
|
587
587
|
loading: t,
|
|
588
|
-
fetchOptions:
|
|
588
|
+
fetchOptions: $
|
|
589
589
|
}), me(() => {
|
|
590
|
-
n.lazy ||
|
|
591
|
-
}),
|
|
590
|
+
n.lazy || $();
|
|
591
|
+
}), U(
|
|
592
592
|
() => n.api,
|
|
593
593
|
() => {
|
|
594
|
-
n.lazy ? (o.value = [],
|
|
594
|
+
n.lazy ? (o.value = [], r.value = []) : $();
|
|
595
595
|
},
|
|
596
596
|
{ deep: !0 }
|
|
597
|
-
),
|
|
598
|
-
n.lazy ? (o.value = [],
|
|
599
|
-
}, { deep: !0 }), { __sfc: !0, props: n, loading: t, options: o, rawOptions:
|
|
597
|
+
), U(() => n.params, () => {
|
|
598
|
+
a(n.params ?? null) !== u.value && (n.lazy ? (o.value = [], r.value = []) : $());
|
|
599
|
+
}, { deep: !0 }), { __sfc: !0, props: n, loading: t, options: o, rawOptions: r, sortStringify: a, sortKeys: v, lastFetchedParamsKey: u, onVisibleChange: P, fetchOptions: $ };
|
|
600
600
|
}
|
|
601
601
|
});
|
|
602
|
-
var
|
|
602
|
+
var it = function() {
|
|
603
603
|
var e = this, n = e._self._c, t = e._self._setupProxy;
|
|
604
604
|
return n("el-select", e._b({ on: { input: function(o) {
|
|
605
605
|
return e.$emit("input", o);
|
|
@@ -608,18 +608,18 @@ var st = function() {
|
|
|
608
608
|
}, "visible-change": t.onVisibleChange } }, "el-select", { ...e.$attrs, value: e.value, placeholder: e.placeholder, disabled: e.disabled, loading: t.loading, clearable: e.clearable, filterable: e.filterable, multiple: e.multiple }, !1), e._l(t.options, function(o) {
|
|
609
609
|
return n("el-option", { key: String(o.value), attrs: { label: o.label, value: o.value } });
|
|
610
610
|
}), 1);
|
|
611
|
-
},
|
|
611
|
+
}, ct = [], ut = /* @__PURE__ */ ae(
|
|
612
612
|
rt,
|
|
613
|
-
st,
|
|
614
613
|
it,
|
|
614
|
+
ct,
|
|
615
615
|
!1,
|
|
616
616
|
null,
|
|
617
617
|
null,
|
|
618
618
|
null,
|
|
619
619
|
null
|
|
620
620
|
);
|
|
621
|
-
const
|
|
622
|
-
function
|
|
621
|
+
const dt = ut.exports;
|
|
622
|
+
function Ie(c) {
|
|
623
623
|
const e = c.trim();
|
|
624
624
|
if (!e)
|
|
625
625
|
return "";
|
|
@@ -627,47 +627,47 @@ function Ve(c) {
|
|
|
627
627
|
e[0] === "-" && (t = "-", n = 1);
|
|
628
628
|
let o = !1;
|
|
629
629
|
for (; n < e.length; n++) {
|
|
630
|
-
const
|
|
631
|
-
if (
|
|
632
|
-
t +=
|
|
630
|
+
const r = e[n];
|
|
631
|
+
if (r >= "0" && r <= "9") {
|
|
632
|
+
t += r;
|
|
633
633
|
continue;
|
|
634
634
|
}
|
|
635
|
-
|
|
635
|
+
r === "." && !o && (o = !0, (t === "" || t === "-") && (t += "0"), t += ".");
|
|
636
636
|
}
|
|
637
637
|
return t;
|
|
638
638
|
}
|
|
639
|
-
function
|
|
639
|
+
function Ae(c) {
|
|
640
640
|
return c.replace(/,/g, "").trim();
|
|
641
641
|
}
|
|
642
|
-
function
|
|
642
|
+
function ft(c, e, n) {
|
|
643
643
|
if (!c || c === "-")
|
|
644
644
|
return c;
|
|
645
645
|
const t = c[0] === "-";
|
|
646
646
|
let o = t ? c.slice(1) : c;
|
|
647
|
-
const
|
|
648
|
-
if (
|
|
649
|
-
const
|
|
650
|
-
return o =
|
|
647
|
+
const r = o.indexOf(".");
|
|
648
|
+
if (r === -1) {
|
|
649
|
+
const $ = Math.max(0, e);
|
|
650
|
+
return o = $ > 0 ? o.slice(0, $) : o, t ? "-" + o : o;
|
|
651
651
|
}
|
|
652
|
-
let
|
|
653
|
-
e > 0 && (
|
|
654
|
-
const
|
|
652
|
+
let a = o.slice(0, r);
|
|
653
|
+
e > 0 && (a = a.slice(0, e));
|
|
654
|
+
const v = o.slice(r + 1), u = v === "" && o.endsWith(".");
|
|
655
655
|
if (n <= 0)
|
|
656
|
-
return t ? "-" +
|
|
656
|
+
return t ? "-" + a : a;
|
|
657
657
|
if (u)
|
|
658
|
-
return (t ? "-" : "") +
|
|
659
|
-
const
|
|
660
|
-
return (t ? "-" : "") +
|
|
658
|
+
return (t ? "-" : "") + a + ".";
|
|
659
|
+
const P = v.slice(0, n);
|
|
660
|
+
return (t ? "-" : "") + a + "." + P;
|
|
661
661
|
}
|
|
662
|
-
function
|
|
662
|
+
function pt(c, e) {
|
|
663
663
|
const n = Math.pow(10, c) - 1;
|
|
664
664
|
return e <= 0 ? n : n + (1 - Math.pow(10, -e));
|
|
665
665
|
}
|
|
666
|
-
function
|
|
667
|
-
const t =
|
|
666
|
+
function Ve(c, e, n) {
|
|
667
|
+
const t = pt(e, n), o = c < 0 ? -1 : 1;
|
|
668
668
|
return Math.abs(c) <= t ? c : o * t;
|
|
669
669
|
}
|
|
670
|
-
function
|
|
670
|
+
function mt(c, e, n) {
|
|
671
671
|
if (e <= 0)
|
|
672
672
|
switch (n) {
|
|
673
673
|
case "floor":
|
|
@@ -678,39 +678,39 @@ function pt(c, e, n) {
|
|
|
678
678
|
return Math.round(c);
|
|
679
679
|
}
|
|
680
680
|
const t = Math.pow(10, e), o = c * t;
|
|
681
|
-
let
|
|
681
|
+
let r;
|
|
682
682
|
switch (n) {
|
|
683
683
|
case "floor":
|
|
684
|
-
|
|
684
|
+
r = Math.floor(o);
|
|
685
685
|
break;
|
|
686
686
|
case "ceil":
|
|
687
|
-
|
|
687
|
+
r = Math.ceil(o);
|
|
688
688
|
break;
|
|
689
689
|
default:
|
|
690
|
-
|
|
690
|
+
r = Math.round(o);
|
|
691
691
|
}
|
|
692
|
-
return
|
|
692
|
+
return r / t;
|
|
693
693
|
}
|
|
694
694
|
function Se(c, e, n, t) {
|
|
695
|
-
let o =
|
|
696
|
-
return o =
|
|
695
|
+
let o = Ve(c, e, n);
|
|
696
|
+
return o = mt(o, n, t), o = Ve(o, e, n), o;
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function vt(c, e) {
|
|
699
699
|
return Number.isNaN(c) || !Number.isFinite(c) ? "" : c.toFixed(Math.max(0, e));
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function We(c, e) {
|
|
702
702
|
if (Number.isNaN(c) || !Number.isFinite(c))
|
|
703
703
|
return "";
|
|
704
|
-
const n = c.toFixed(Math.max(0, e)), t = n.startsWith("-"), o = t ? n.slice(1) : n, [
|
|
705
|
-
return e <= 0 ||
|
|
704
|
+
const n = c.toFixed(Math.max(0, e)), t = n.startsWith("-"), o = t ? n.slice(1) : n, [r, a] = o.split("."), v = r.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
705
|
+
return e <= 0 || a === void 0 ? (t ? "-" : "") + v : (t ? "-" : "") + v + "." + a;
|
|
706
706
|
}
|
|
707
|
-
function
|
|
707
|
+
function ht(c, e) {
|
|
708
708
|
if (Number.isNaN(c) || !Number.isFinite(c))
|
|
709
709
|
return "";
|
|
710
710
|
let n = c.toFixed(Math.max(0, e));
|
|
711
711
|
return n = n.replace(/(\.\d*?)0+$/, "$1"), n = n.replace(/\.$/, ""), n;
|
|
712
712
|
}
|
|
713
|
-
const
|
|
713
|
+
const _t = /* @__PURE__ */ oe({
|
|
714
714
|
__name: "FormattedNumberInput",
|
|
715
715
|
props: {
|
|
716
716
|
value: null,
|
|
@@ -723,85 +723,85 @@ const ht = /* @__PURE__ */ le({
|
|
|
723
723
|
},
|
|
724
724
|
emits: ["input"],
|
|
725
725
|
setup(c, { emit: e }) {
|
|
726
|
-
const n = c, t =
|
|
727
|
-
function
|
|
726
|
+
const n = c, t = z(!1), o = z(""), r = () => Math.max(0, Math.floor(n.integerDigits ?? 6)), a = () => Math.max(0, Math.floor(n.decimalPlaces ?? 6));
|
|
727
|
+
function v(p) {
|
|
728
728
|
if (p == null || p === "")
|
|
729
729
|
return null;
|
|
730
730
|
if (typeof p == "number")
|
|
731
731
|
return Number.isFinite(p) ? p : null;
|
|
732
|
-
const
|
|
733
|
-
if (
|
|
732
|
+
const x = Ae(String(p));
|
|
733
|
+
if (x === "" || x === "-")
|
|
734
734
|
return null;
|
|
735
|
-
const
|
|
736
|
-
return Number.isFinite(
|
|
735
|
+
const g = Number(x);
|
|
736
|
+
return Number.isFinite(g) ? g : null;
|
|
737
737
|
}
|
|
738
738
|
function u() {
|
|
739
739
|
if (t.value)
|
|
740
740
|
return;
|
|
741
|
-
const p =
|
|
741
|
+
const p = v(n.value);
|
|
742
742
|
if (p === null) {
|
|
743
743
|
o.value = "";
|
|
744
744
|
return;
|
|
745
745
|
}
|
|
746
|
-
o.value =
|
|
747
|
-
Se(p,
|
|
748
|
-
|
|
746
|
+
o.value = We(
|
|
747
|
+
Se(p, r(), a(), n.rounding),
|
|
748
|
+
a()
|
|
749
749
|
);
|
|
750
750
|
}
|
|
751
|
-
|
|
751
|
+
U(
|
|
752
752
|
() => [n.value, n.integerDigits, n.decimalPlaces, n.rounding],
|
|
753
753
|
() => u(),
|
|
754
754
|
{ immediate: !0, deep: !0 }
|
|
755
755
|
);
|
|
756
|
-
function
|
|
757
|
-
e("input",
|
|
756
|
+
function P(p) {
|
|
757
|
+
e("input", vt(p, a()));
|
|
758
758
|
}
|
|
759
|
-
function
|
|
760
|
-
let
|
|
761
|
-
if (n.inputLimit !== !1 && (
|
|
759
|
+
function $(p) {
|
|
760
|
+
let x = Ie(p);
|
|
761
|
+
if (n.inputLimit !== !1 && (x = ft(x, r(), a())), o.value = x, x === "" || x === "-")
|
|
762
762
|
return;
|
|
763
|
-
const
|
|
764
|
-
if (!Number.isFinite(
|
|
763
|
+
const g = Number(x);
|
|
764
|
+
if (!Number.isFinite(g))
|
|
765
765
|
return;
|
|
766
|
-
const
|
|
767
|
-
|
|
766
|
+
const V = Se(g, r(), a(), n.rounding);
|
|
767
|
+
P(V);
|
|
768
768
|
}
|
|
769
|
-
function
|
|
769
|
+
function m() {
|
|
770
770
|
t.value = !0;
|
|
771
|
-
const p =
|
|
772
|
-
if (
|
|
771
|
+
const p = Ae(o.value), x = v(p === "" ? n.value : p);
|
|
772
|
+
if (x === null) {
|
|
773
773
|
o.value = "";
|
|
774
774
|
return;
|
|
775
775
|
}
|
|
776
|
-
o.value =
|
|
777
|
-
Se(
|
|
778
|
-
|
|
776
|
+
o.value = ht(
|
|
777
|
+
Se(x, r(), a(), n.rounding),
|
|
778
|
+
a()
|
|
779
779
|
);
|
|
780
780
|
}
|
|
781
|
-
function
|
|
781
|
+
function S() {
|
|
782
782
|
t.value = !1;
|
|
783
|
-
const p =
|
|
783
|
+
const p = Ae(o.value);
|
|
784
784
|
if (p === "" || p === "-") {
|
|
785
785
|
o.value = "", e("input", void 0);
|
|
786
786
|
return;
|
|
787
787
|
}
|
|
788
|
-
const
|
|
789
|
-
if (!Number.isFinite(
|
|
788
|
+
const x = Number(Ie(p));
|
|
789
|
+
if (!Number.isFinite(x)) {
|
|
790
790
|
o.value = "", e("input", void 0);
|
|
791
791
|
return;
|
|
792
792
|
}
|
|
793
|
-
const
|
|
794
|
-
o.value =
|
|
793
|
+
const g = Se(x, r(), a(), n.rounding);
|
|
794
|
+
o.value = We(g, a()), P(g);
|
|
795
795
|
}
|
|
796
|
-
return { __sfc: !0, props: n, emit: e, focused: t, displayText: o, intN:
|
|
796
|
+
return { __sfc: !0, props: n, emit: e, focused: t, displayText: o, intN: r, decM: a, parseExternalToNumber: v, syncDisplayFromValue: u, emitStoredValue: P, onInput: $, onFocus: m, onBlur: S };
|
|
797
797
|
}
|
|
798
798
|
});
|
|
799
|
-
var
|
|
799
|
+
var gt = function() {
|
|
800
800
|
var e = this, n = e._self._c, t = e._self._setupProxy;
|
|
801
801
|
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));
|
|
802
|
-
}, bt = [],
|
|
803
|
-
ht,
|
|
802
|
+
}, bt = [], yt = /* @__PURE__ */ ae(
|
|
804
803
|
_t,
|
|
804
|
+
gt,
|
|
805
805
|
bt,
|
|
806
806
|
!1,
|
|
807
807
|
null,
|
|
@@ -809,7 +809,7 @@ var _t = function() {
|
|
|
809
809
|
null,
|
|
810
810
|
null
|
|
811
811
|
);
|
|
812
|
-
const
|
|
812
|
+
const Re = yt.exports, wt = /* @__PURE__ */ oe({
|
|
813
813
|
__name: "TreeSelect",
|
|
814
814
|
props: {
|
|
815
815
|
value: null,
|
|
@@ -827,106 +827,106 @@ const ke = gt.exports, yt = /* @__PURE__ */ le({
|
|
|
827
827
|
},
|
|
828
828
|
emits: ["input"],
|
|
829
829
|
setup(c, { emit: e }) {
|
|
830
|
-
const n = c, t =
|
|
830
|
+
const n = c, t = z(), o = z(), r = z(!1), a = z(!1), v = z(""), u = z([]), P = z({}), $ = C(() => ({
|
|
831
831
|
label: n.labelField,
|
|
832
832
|
children: n.childrenField
|
|
833
833
|
}));
|
|
834
|
-
function
|
|
835
|
-
const
|
|
836
|
-
return
|
|
834
|
+
function m(M) {
|
|
835
|
+
const D = n.labelField ?? "label", j = n.valueField ?? "value", G = n.childrenField ?? "children", H = M[G], Y = {};
|
|
836
|
+
return Y[n.labelField ?? "label"] = M[D] ?? M.label, Y[n.valueField ?? "value"] = M[j] ?? M.value, Array.isArray(H) && H.length && (Y[n.childrenField ?? "children"] = H.map((X) => m(X))), Y;
|
|
837
837
|
}
|
|
838
|
-
function
|
|
839
|
-
const
|
|
840
|
-
for (const
|
|
841
|
-
const ee = String(G
|
|
842
|
-
J != null && (
|
|
843
|
-
const te =
|
|
844
|
-
Array.isArray(te) && te.length && Object.assign(
|
|
838
|
+
function S(M, D = "") {
|
|
839
|
+
const j = {}, G = n.labelField ?? "label", H = n.valueField ?? "value", Y = n.childrenField ?? "children";
|
|
840
|
+
for (const X of M) {
|
|
841
|
+
const ee = String(X[G] ?? X.label ?? ""), J = X[H] ?? X.value;
|
|
842
|
+
J != null && (j[String(J)] = D ? D + " / " + ee : ee);
|
|
843
|
+
const te = X[Y] ?? X.children;
|
|
844
|
+
Array.isArray(te) && te.length && Object.assign(j, S(te, ee));
|
|
845
845
|
}
|
|
846
|
-
return
|
|
846
|
+
return j;
|
|
847
847
|
}
|
|
848
848
|
function p() {
|
|
849
849
|
const M = n.treeData;
|
|
850
850
|
return Array.isArray(M) && M.length > 0;
|
|
851
851
|
}
|
|
852
|
-
function
|
|
853
|
-
u.value = M,
|
|
852
|
+
function x(M) {
|
|
853
|
+
u.value = M, P.value = S(M);
|
|
854
854
|
}
|
|
855
|
-
function
|
|
855
|
+
function g() {
|
|
856
856
|
const M = n.treeData;
|
|
857
857
|
if (!Array.isArray(M) || M.length === 0)
|
|
858
858
|
return;
|
|
859
|
-
const
|
|
860
|
-
|
|
859
|
+
const D = M.map((j) => m(j));
|
|
860
|
+
x(D);
|
|
861
861
|
}
|
|
862
|
-
const
|
|
862
|
+
const V = C(() => n.value == null || n.value === "" ? "" : P.value[String(n.value)] ?? String(n.value)), O = (M, D) => {
|
|
863
863
|
if (!M)
|
|
864
864
|
return !0;
|
|
865
|
-
const
|
|
866
|
-
return String(
|
|
865
|
+
const j = n.labelField ?? "label";
|
|
866
|
+
return String(D[j] ?? D.label ?? "").toLowerCase().includes(M.toLowerCase());
|
|
867
867
|
};
|
|
868
|
-
|
|
869
|
-
var
|
|
870
|
-
(
|
|
868
|
+
U(v, (M) => {
|
|
869
|
+
var D;
|
|
870
|
+
(D = o.value) == null || D.filter(M);
|
|
871
871
|
});
|
|
872
|
-
let
|
|
872
|
+
let y = null;
|
|
873
873
|
function q() {
|
|
874
|
-
n.disabled || (
|
|
875
|
-
|
|
874
|
+
n.disabled || (r.value = !0, n.lazy && !p() && K(), Ke(() => {
|
|
875
|
+
y = (M) => {
|
|
876
876
|
t.value && !t.value.contains(M.target) && A();
|
|
877
|
-
}, document.addEventListener("click",
|
|
877
|
+
}, document.addEventListener("click", y);
|
|
878
878
|
}));
|
|
879
879
|
}
|
|
880
880
|
function A() {
|
|
881
|
-
|
|
881
|
+
r.value = !1, v.value = "", y && (document.removeEventListener("click", y), y = null);
|
|
882
882
|
}
|
|
883
|
-
function
|
|
883
|
+
function F() {
|
|
884
884
|
e("input", void 0);
|
|
885
885
|
}
|
|
886
886
|
function f(M) {
|
|
887
|
-
const
|
|
888
|
-
e("input",
|
|
887
|
+
const D = n.valueField ?? "value", j = M[D] ?? M.value;
|
|
888
|
+
e("input", j), A();
|
|
889
889
|
}
|
|
890
|
-
async function
|
|
890
|
+
async function K() {
|
|
891
891
|
if (!(!n.api || p())) {
|
|
892
|
-
|
|
892
|
+
a.value = !0;
|
|
893
893
|
try {
|
|
894
|
-
const M = await n.api(n.params),
|
|
895
|
-
u.value =
|
|
894
|
+
const M = await n.api(n.params), D = Array.isArray(M) ? M : (M == null ? void 0 : M.list) ?? (M == null ? void 0 : M.data) ?? [];
|
|
895
|
+
u.value = D.map((j) => m(j)), P.value = S(u.value);
|
|
896
896
|
} finally {
|
|
897
|
-
|
|
897
|
+
a.value = !1;
|
|
898
898
|
}
|
|
899
899
|
}
|
|
900
900
|
}
|
|
901
901
|
return me(() => {
|
|
902
|
-
p() ?
|
|
903
|
-
}),
|
|
904
|
-
p() ?
|
|
905
|
-
}, { deep: !0 }),
|
|
906
|
-
p() || (n.lazy ? (u.value = [],
|
|
907
|
-
}, { deep: !0 }),
|
|
908
|
-
p() || (n.lazy ? (u.value = [],
|
|
909
|
-
}, { deep: !0 }), { __sfc: !0, props: n, emit: e, rootRef: t, treeRef: o, dropdownVisible:
|
|
902
|
+
p() ? g() : n.lazy || K();
|
|
903
|
+
}), U(() => n.treeData, () => {
|
|
904
|
+
p() ? g() : (u.value = [], P.value = {}, !n.lazy && n.api && K());
|
|
905
|
+
}, { deep: !0 }), U(() => n.api, () => {
|
|
906
|
+
p() || (n.lazy ? (u.value = [], P.value = {}) : K());
|
|
907
|
+
}, { deep: !0 }), U(() => n.params, () => {
|
|
908
|
+
p() || (n.lazy ? (u.value = [], P.value = {}) : K());
|
|
909
|
+
}, { deep: !0 }), { __sfc: !0, props: n, emit: e, rootRef: t, treeRef: o, dropdownVisible: r, loading: a, filterText: v, treeData: u, flatLabelMap: P, treeProps: $, normalizeNode: m, buildFlatLabelMap: S, hasTreeDataProp: p, applyTreeData: x, syncFromTreeDataProp: g, displayText: V, filterNodeMethod: O, clickOutsideHandler: y, openDropdown: q, closeDropdown: A, clearValue: F, onNodeClick: f, fetchData: K };
|
|
910
910
|
}
|
|
911
911
|
});
|
|
912
|
-
var
|
|
912
|
+
var Ct = function() {
|
|
913
913
|
var e = this, n = e._self._c, t = e._self._setupProxy;
|
|
914
914
|
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(o) {
|
|
915
915
|
o.stopPropagation();
|
|
916
916
|
} }, model: { value: t.filterText, callback: function(o) {
|
|
917
917
|
t.filterText = o;
|
|
918
918
|
}, 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);
|
|
919
|
-
},
|
|
920
|
-
yt,
|
|
919
|
+
}, xt = [], Pt = /* @__PURE__ */ ae(
|
|
921
920
|
wt,
|
|
922
921
|
Ct,
|
|
922
|
+
xt,
|
|
923
923
|
!1,
|
|
924
924
|
null,
|
|
925
925
|
"f30bba11",
|
|
926
926
|
null,
|
|
927
927
|
null
|
|
928
928
|
);
|
|
929
|
-
const
|
|
929
|
+
const St = Pt.exports, Ft = /* @__PURE__ */ oe({
|
|
930
930
|
__name: "ProFormItem",
|
|
931
931
|
props: {
|
|
932
932
|
schema: null,
|
|
@@ -953,79 +953,79 @@ const Pt = xt.exports, St = /* @__PURE__ */ le({
|
|
|
953
953
|
"cascader",
|
|
954
954
|
"checkbox",
|
|
955
955
|
"radio"
|
|
956
|
-
]), t =
|
|
956
|
+
]), t = z(null);
|
|
957
957
|
me(() => {
|
|
958
958
|
var f;
|
|
959
959
|
e.schema.component === "api-select" && ((f = e.registerFieldInstance) == null || f.call(e, e.schema.field, t.value));
|
|
960
|
-
}),
|
|
960
|
+
}), ke(() => {
|
|
961
961
|
var f;
|
|
962
962
|
e.schema.component === "api-select" && ((f = e.registerFieldInstance) == null || f.call(e, e.schema.field, null));
|
|
963
963
|
});
|
|
964
|
-
const o =
|
|
964
|
+
const o = Fe(), r = C(() => ({
|
|
965
965
|
schema: e.schema,
|
|
966
966
|
values: e.formModel,
|
|
967
967
|
model: e.formModel,
|
|
968
968
|
field: e.schema.field
|
|
969
|
-
})),
|
|
969
|
+
})), a = C(() => {
|
|
970
970
|
const f = e.schema.ifShow;
|
|
971
|
-
return f === void 0 ? !0 : typeof f == "boolean" ? f : f(
|
|
972
|
-
}),
|
|
971
|
+
return f === void 0 ? !0 : typeof f == "boolean" ? f : f(r.value);
|
|
972
|
+
}), v = C(() => {
|
|
973
973
|
const f = e.schema.show;
|
|
974
|
-
return f === void 0 ? !0 : typeof f == "boolean" ? f : f(
|
|
975
|
-
}), u =
|
|
974
|
+
return f === void 0 ? !0 : typeof f == "boolean" ? f : f(r.value);
|
|
975
|
+
}), u = C(() => {
|
|
976
976
|
if (e.formDisabled)
|
|
977
977
|
return !0;
|
|
978
978
|
const f = e.schema.dynamicDisabled;
|
|
979
|
-
return f === void 0 ? !1 : typeof f == "boolean" ? f : f(
|
|
980
|
-
}),
|
|
979
|
+
return f === void 0 ? !1 : typeof f == "boolean" ? f : f(r.value);
|
|
980
|
+
}), P = C(() => {
|
|
981
981
|
const f = e.schema.dynamicRules;
|
|
982
|
-
return f ? Array.isArray(f) ? f : f(
|
|
983
|
-
}),
|
|
982
|
+
return f ? Array.isArray(f) ? f : f(r.value) : e.schema.rules;
|
|
983
|
+
}), $ = C(() => {
|
|
984
984
|
const f = e.schema.componentProps;
|
|
985
985
|
if (!f)
|
|
986
986
|
return { props: {}, listeners: {} };
|
|
987
|
-
const
|
|
988
|
-
...
|
|
987
|
+
const K = typeof f == "function" ? f({
|
|
988
|
+
...r.value,
|
|
989
989
|
formActionType: e.formActionType
|
|
990
|
-
}) : { ...f }, M = {},
|
|
991
|
-
for (const [
|
|
992
|
-
if (
|
|
993
|
-
const H =
|
|
994
|
-
|
|
990
|
+
}) : { ...f }, M = {}, D = {};
|
|
991
|
+
for (const [j, G] of Object.entries(K))
|
|
992
|
+
if (j.length > 2 && /^on[A-Za-z]/.test(j) && typeof G == "function") {
|
|
993
|
+
const H = j.slice(2).charAt(0).toLowerCase() + j.slice(3);
|
|
994
|
+
D[H] = G;
|
|
995
995
|
} else
|
|
996
|
-
M[
|
|
997
|
-
return { props: M, listeners:
|
|
998
|
-
}),
|
|
996
|
+
M[j] = G;
|
|
997
|
+
return { props: M, listeners: D };
|
|
998
|
+
}), m = C(() => $.value.props), S = C(() => $.value.listeners), p = C(() => e.schema.colon ?? e.colon ?? !1), x = C(() => {
|
|
999
999
|
const f = e.schema.tooltip;
|
|
1000
1000
|
if (!f)
|
|
1001
1001
|
return null;
|
|
1002
|
-
const
|
|
1003
|
-
return Te(
|
|
1004
|
-
}),
|
|
1005
|
-
const
|
|
1006
|
-
return Array.isArray(
|
|
1007
|
-
}, q =
|
|
1002
|
+
const K = typeof f == "function" ? f(r.value) : f;
|
|
1003
|
+
return Te(K, e.formModel[e.schema.field]);
|
|
1004
|
+
}), g = C(() => x.value ? "el-tooltip" : "span"), V = C(() => x.value || {}), O = C(() => !!o.default), y = (f) => {
|
|
1005
|
+
const K = f == null ? void 0 : f.options;
|
|
1006
|
+
return Array.isArray(K) ? K : void 0;
|
|
1007
|
+
}, q = C(() => {
|
|
1008
1008
|
const f = e.schema.component;
|
|
1009
1009
|
return f == null ? null : typeof f == "string" ? n.has(f) ? null : e.customComponents && e.customComponents[f] || f : f;
|
|
1010
1010
|
}), A = (f) => {
|
|
1011
|
-
var
|
|
1012
|
-
(
|
|
1013
|
-
},
|
|
1011
|
+
var K;
|
|
1012
|
+
(K = e.onFieldChange) == null || K.call(e, e.schema.field, f);
|
|
1013
|
+
}, F = C(() => {
|
|
1014
1014
|
const f = e.schema.render;
|
|
1015
1015
|
return f ? {
|
|
1016
1016
|
render() {
|
|
1017
|
-
const
|
|
1018
|
-
return Array.isArray(
|
|
1017
|
+
const K = f(r.value);
|
|
1018
|
+
return Array.isArray(K) ? ue("span", K) : K;
|
|
1019
1019
|
}
|
|
1020
1020
|
} : null;
|
|
1021
1021
|
});
|
|
1022
|
-
return { __sfc: !0, BUILT_IN_COMPONENTS: n, props: e, apiSelectRef: t, slots: o, renderParams:
|
|
1022
|
+
return { __sfc: !0, BUILT_IN_COMPONENTS: n, props: e, apiSelectRef: t, slots: o, renderParams: r, shouldRender: a, shouldShow: v, effectiveDisabled: u, effectiveRules: P, effectiveComponentPropsAndListeners: $, effectiveComponentProps: m, effectiveComponentListeners: S, showColon: p, normalizedTooltip: x, fieldWrapperComponent: g, fieldWrapperProps: V, hasSlot: O, getOptions: y, resolvedCustomComponent: q, setFieldValue: A, renderComponent: F, ApiSelect: dt, FormattedNumberInput: Re, TreeSelect: St };
|
|
1023
1023
|
}
|
|
1024
1024
|
});
|
|
1025
|
-
var
|
|
1025
|
+
var kt = function() {
|
|
1026
1026
|
var e = this, n = e._self._c, t = e._self._setupProxy;
|
|
1027
|
-
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(o,
|
|
1028
|
-
return n("div", { key:
|
|
1027
|
+
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(o, r) {
|
|
1028
|
+
return n("div", { key: r, staticClass: "ecp-pro-form-item__help-item" }, [e._v(" " + e._s(o) + " ")]);
|
|
1029
1029
|
}) : n("span", [e._v(e._s(e.schema.helpMessage))])], 2), n("i", { staticClass: "el-icon-question ecp-pro-form-item__help-icon" })], 2) : e._e()], 1), e.schema.render ? [n(t.renderComponent, { tag: "component" })] : t.hasSlot ? e._t("default", null, { model: e.formModel, schema: e.schema, field: e.schema.field, values: e.formModel }) : [n(t.fieldWrapperComponent, e._b({ tag: "component" }, "component", t.fieldWrapperProps, !1), [t.resolvedCustomComponent ? n(t.resolvedCustomComponent, e._g(e._b({ tag: "component", attrs: { value: e.formModel[e.schema.field], placeholder: e.schema.placeholder || (e.autoPlaceholder ? `请输入${e.schema.label}` : void 0), disabled: t.effectiveDisabled }, on: { input: t.setFieldValue } }, "component", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "input" || !e.schema.component ? n("el-input", e._g(e._b({ attrs: { placeholder: e.schema.placeholder || (e.autoPlaceholder ? `请输入${e.schema.label}` : void 0), disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(o) {
|
|
1030
1030
|
e.$set(e.formModel, e.schema.field, o);
|
|
1031
1031
|
}, expression: "formModel[schema.field]" } }, "el-input", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "input-number" ? n("el-input-number", e._g(e._b({ attrs: { placeholder: e.schema.placeholder, disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(o) {
|
|
@@ -1051,17 +1051,17 @@ var Ft = function() {
|
|
|
1051
1051
|
}, expression: "formModel[schema.field]" } }, "el-radio-group", t.effectiveComponentProps, !1), t.effectiveComponentListeners), e._l(t.getOptions(t.effectiveComponentProps) || [], function(o) {
|
|
1052
1052
|
return n("el-radio", { key: String(o.value), attrs: { label: o.value } }, [e._v(" " + e._s(o.label) + " ")]);
|
|
1053
1053
|
}), 1) : e._e()], 1)]], 2) : e._e();
|
|
1054
|
-
},
|
|
1055
|
-
St,
|
|
1054
|
+
}, Bt = [], Rt = /* @__PURE__ */ ae(
|
|
1056
1055
|
Ft,
|
|
1057
1056
|
kt,
|
|
1057
|
+
Bt,
|
|
1058
1058
|
!1,
|
|
1059
1059
|
null,
|
|
1060
1060
|
"48d7960b",
|
|
1061
1061
|
null,
|
|
1062
1062
|
null
|
|
1063
1063
|
);
|
|
1064
|
-
const qe = Rt.exports,
|
|
1064
|
+
const qe = Rt.exports, Mt = /* @__PURE__ */ oe({
|
|
1065
1065
|
__name: "FormActions",
|
|
1066
1066
|
props: {
|
|
1067
1067
|
showActionButtonGroup: { type: Boolean, default: !0 },
|
|
@@ -1082,24 +1082,24 @@ const qe = Rt.exports, Bt = /* @__PURE__ */ le({
|
|
|
1082
1082
|
return { __sfc: !0 };
|
|
1083
1083
|
}
|
|
1084
1084
|
});
|
|
1085
|
-
var
|
|
1085
|
+
var At = function() {
|
|
1086
1086
|
var e = this, n = e._self._c;
|
|
1087
1087
|
return e._self._setupProxy, n("div", { staticClass: "ecp-form-actions" }, [e._t("submitBefore"), e.showSubmitButton ? n("el-button", { attrs: { type: "primary", icon: e.submitButtonIcon, loading: e.submitLoading }, on: { click: function(t) {
|
|
1088
1088
|
return e.$emit("submit");
|
|
1089
1089
|
} } }, [e._v(" " + e._s(e.submitButtonText) + " ")]) : e._e(), e._t("resetBefore"), e.showResetButton ? n("el-button", { attrs: { icon: e.resetButtonIcon }, on: { click: function(t) {
|
|
1090
1090
|
return e.$emit("reset");
|
|
1091
1091
|
} } }, [e._v(" " + e._s(e.resetButtonText) + " ")]) : e._e(), e._t("actions")], 2);
|
|
1092
|
-
},
|
|
1093
|
-
Bt,
|
|
1092
|
+
}, $t = [], Tt = /* @__PURE__ */ ae(
|
|
1094
1093
|
Mt,
|
|
1095
1094
|
At,
|
|
1095
|
+
$t,
|
|
1096
1096
|
!1,
|
|
1097
1097
|
null,
|
|
1098
1098
|
"489c88d2",
|
|
1099
1099
|
null,
|
|
1100
1100
|
null
|
|
1101
1101
|
);
|
|
1102
|
-
const He =
|
|
1102
|
+
const He = Tt.exports, Dt = /* @__PURE__ */ oe({
|
|
1103
1103
|
__name: "ProForm",
|
|
1104
1104
|
props: {
|
|
1105
1105
|
schemas: null,
|
|
@@ -1133,156 +1133,156 @@ const He = $t.exports, Tt = /* @__PURE__ */ le({
|
|
|
1133
1133
|
},
|
|
1134
1134
|
emits: ["submit", "reset", "register", "update:modelValue"],
|
|
1135
1135
|
setup(c, { expose: e, emit: n }) {
|
|
1136
|
-
const t = c, o =
|
|
1137
|
-
const l =
|
|
1138
|
-
return l >=
|
|
1139
|
-
}, { getSetting:
|
|
1140
|
-
...
|
|
1141
|
-
...
|
|
1142
|
-
...
|
|
1143
|
-
})), f =
|
|
1144
|
-
let
|
|
1145
|
-
for (const
|
|
1146
|
-
const
|
|
1147
|
-
if (
|
|
1148
|
-
if (
|
|
1136
|
+
const t = c, o = Fe(), r = z(), a = z(), v = z(!1), u = z(!0), P = z({}), $ = z({}), m = z([]), S = z({}), p = z(/* @__PURE__ */ new Map()), x = { xl: 1920, lg: 1200, md: 992, sm: 768 }, g = (d, w, B) => {
|
|
1137
|
+
const l = B ?? (typeof window < "u" ? window.innerWidth : 1920), s = d ?? {}, _ = w ?? {}, k = _.span ?? 8;
|
|
1138
|
+
return l >= x.xl ? s.xl ?? _.xl ?? s.lg ?? _.lg ?? s.md ?? _.md ?? s.sm ?? _.sm ?? s.xs ?? _.xs ?? s.span ?? k : l >= x.lg ? s.lg ?? _.lg ?? s.md ?? _.md ?? s.sm ?? _.sm ?? s.xs ?? _.xs ?? s.span ?? k : l >= x.md ? s.md ?? _.md ?? s.sm ?? _.sm ?? s.xs ?? _.xs ?? s.span ?? k : l >= x.sm ? s.sm ?? _.sm ?? s.xs ?? _.xs ?? s.span ?? k : s.xs ?? _.xs ?? s.span ?? k;
|
|
1139
|
+
}, { getSetting: V } = Be(), O = C(() => ({ ...V("ProForm"), ...t, ...S.value })), y = C(() => O.value.modelValue), q = C(() => y.value !== void 0), A = C(() => q.value ? y.value ?? {} : P.value), F = C(() => ({
|
|
1140
|
+
...V("ProForm").components ?? {},
|
|
1141
|
+
...O.value.components ?? {},
|
|
1142
|
+
...S.value.components ?? {}
|
|
1143
|
+
})), f = C(() => O.value.actionColOptions ?? { span: 24 }), K = z(typeof window < "u" ? window.innerWidth : 1920), M = (d, w, B, l) => {
|
|
1144
|
+
let s = 24, _ = 1, k = 0;
|
|
1145
|
+
for (const W of d) {
|
|
1146
|
+
const I = g(W.colProps, w, l);
|
|
1147
|
+
if (I > s) {
|
|
1148
|
+
if (_++, _ > B)
|
|
1149
1149
|
break;
|
|
1150
|
-
|
|
1150
|
+
s = 24 - I;
|
|
1151
1151
|
} else
|
|
1152
|
-
|
|
1153
|
-
|
|
1152
|
+
s -= I;
|
|
1153
|
+
k++;
|
|
1154
1154
|
}
|
|
1155
|
-
return
|
|
1156
|
-
},
|
|
1157
|
-
const d =
|
|
1158
|
-
if (!
|
|
1155
|
+
return k;
|
|
1156
|
+
}, D = C(() => {
|
|
1157
|
+
const d = m.value.filter((s) => H(s));
|
|
1158
|
+
if (!O.value.showAdvancedButton)
|
|
1159
1159
|
return !1;
|
|
1160
|
-
const w =
|
|
1160
|
+
const w = O.value.alwaysShowLines ?? 1, B = O.value.baseColProps, l = M(d, B, w, K.value);
|
|
1161
1161
|
return d.length > l;
|
|
1162
|
-
}),
|
|
1163
|
-
const d =
|
|
1164
|
-
if (!
|
|
1162
|
+
}), j = C(() => O.value.formListeners ?? {}), G = C(() => {
|
|
1163
|
+
const d = m.value.filter((s) => H(s));
|
|
1164
|
+
if (!O.value.showAdvancedButton || !u.value)
|
|
1165
1165
|
return d;
|
|
1166
|
-
const w =
|
|
1166
|
+
const w = O.value.alwaysShowLines ?? 1, B = O.value.baseColProps, l = M(d, B, w, K.value);
|
|
1167
1167
|
return d.slice(0, l);
|
|
1168
1168
|
}), H = (d) => {
|
|
1169
|
-
let w = !0,
|
|
1170
|
-
return typeof d.ifShow == "function" && (w = d.ifShow({ schema: d, values: A.value, model: A.value, field: d.field })), typeof d.ifShow == "boolean" && (w = d.ifShow), typeof d.show == "function" && (
|
|
1171
|
-
},
|
|
1172
|
-
const
|
|
1173
|
-
return
|
|
1174
|
-
if (!(w && Object.prototype.hasOwnProperty.call(
|
|
1175
|
-
if (
|
|
1176
|
-
|
|
1169
|
+
let w = !0, B = !0;
|
|
1170
|
+
return typeof d.ifShow == "function" && (w = d.ifShow({ schema: d, values: A.value, model: A.value, field: d.field })), typeof d.ifShow == "boolean" && (w = d.ifShow), typeof d.show == "function" && (B = d.show({ schema: d, values: A.value, model: A.value, field: d.field })), typeof d.show == "boolean" && (B = d.show), w && B;
|
|
1171
|
+
}, Y = (d) => d.colProps ?? O.value.baseColProps ?? {}, X = (d) => d.slot || d.field, ee = (d, w = !0) => {
|
|
1172
|
+
const B = w ? { ...d ?? {} } : {}, l = O.value.initialValues ?? t.initialValues;
|
|
1173
|
+
return m.value.forEach((s) => {
|
|
1174
|
+
if (!(w && Object.prototype.hasOwnProperty.call(B, s.field))) {
|
|
1175
|
+
if (s.defaultValue !== void 0) {
|
|
1176
|
+
B[s.field] = s.defaultValue;
|
|
1177
1177
|
return;
|
|
1178
1178
|
}
|
|
1179
|
-
l && Object.prototype.hasOwnProperty.call(l,
|
|
1179
|
+
l && Object.prototype.hasOwnProperty.call(l, s.field) && (B[s.field] = l[s.field]);
|
|
1180
1180
|
}
|
|
1181
|
-
}),
|
|
1181
|
+
}), B;
|
|
1182
1182
|
}, J = (d, w = !0) => {
|
|
1183
|
-
|
|
1183
|
+
P.value = d, w && n("update:modelValue", d);
|
|
1184
1184
|
}, te = (d) => {
|
|
1185
1185
|
const w = ee({ ...A.value, ...d });
|
|
1186
1186
|
return J(w), w;
|
|
1187
1187
|
}, ne = () => {
|
|
1188
1188
|
const d = {};
|
|
1189
|
-
|
|
1190
|
-
var
|
|
1191
|
-
(
|
|
1192
|
-
}), J(ee(A.value), !1),
|
|
1193
|
-
},
|
|
1189
|
+
m.value.forEach((w) => {
|
|
1190
|
+
var B;
|
|
1191
|
+
(B = w.rules) != null && B.length && (d[w.field] = w.rules);
|
|
1192
|
+
}), J(ee(A.value), !1), $.value = d;
|
|
1193
|
+
}, b = (d) => {
|
|
1194
1194
|
const w = { ...d };
|
|
1195
|
-
return
|
|
1196
|
-
const l =
|
|
1195
|
+
return m.value.forEach((B) => {
|
|
1196
|
+
const l = B.ifShow;
|
|
1197
1197
|
if (l === void 0)
|
|
1198
1198
|
return;
|
|
1199
|
-
(typeof l == "boolean" ? l : l({ schema:
|
|
1199
|
+
(typeof l == "boolean" ? l : l({ schema: B, values: d, model: d, field: B.field })) || delete w[B.field];
|
|
1200
1200
|
}), w;
|
|
1201
|
-
},
|
|
1202
|
-
const w =
|
|
1203
|
-
if (!(
|
|
1201
|
+
}, N = (d) => {
|
|
1202
|
+
const w = b(d), B = S.value.fieldMapToTime;
|
|
1203
|
+
if (!(B != null && B.length))
|
|
1204
1204
|
return w;
|
|
1205
1205
|
const l = { ...w };
|
|
1206
|
-
return
|
|
1207
|
-
const
|
|
1208
|
-
Array.isArray(
|
|
1206
|
+
return B.forEach(([s, [_, k]]) => {
|
|
1207
|
+
const W = l[s];
|
|
1208
|
+
Array.isArray(W) && W.length === 2 && (delete l[s], l[_] = W[0], l[k] = W[1]);
|
|
1209
1209
|
}), l;
|
|
1210
|
-
},
|
|
1210
|
+
}, T = async () => {
|
|
1211
1211
|
var d;
|
|
1212
1212
|
try {
|
|
1213
|
-
await ((d =
|
|
1213
|
+
await ((d = r.value) == null ? void 0 : d.validate()), O.value.submitFunc ? await O.value.submitFunc() : (v.value = !0, n("submit", N({ ...A.value })));
|
|
1214
1214
|
} catch (w) {
|
|
1215
1215
|
console.error("Form validation failed:", w);
|
|
1216
1216
|
} finally {
|
|
1217
|
-
|
|
1217
|
+
v.value = !1;
|
|
1218
1218
|
}
|
|
1219
1219
|
}, i = async () => {
|
|
1220
1220
|
var d;
|
|
1221
|
-
|
|
1222
|
-
},
|
|
1221
|
+
O.value.resetFunc ? await O.value.resetFunc() : ((d = r.value) == null || d.resetFields(), ne(), n("reset"), O.value.submitOnReset && await T());
|
|
1222
|
+
}, h = (d) => (te(d), Promise.resolve()), R = () => N({ ...A.value }), L = async () => {
|
|
1223
1223
|
var d;
|
|
1224
|
-
(d =
|
|
1225
|
-
},
|
|
1224
|
+
(d = r.value) == null || d.resetFields(), J(ee(void 0, !1));
|
|
1225
|
+
}, E = (d, w) => {
|
|
1226
1226
|
te({ [d]: w });
|
|
1227
|
-
},
|
|
1227
|
+
}, Z = (d) => {
|
|
1228
1228
|
var w;
|
|
1229
|
-
return ((w =
|
|
1230
|
-
},
|
|
1231
|
-
|
|
1232
|
-
}))) :
|
|
1229
|
+
return ((w = r.value) == null ? void 0 : w.validate(d)) ?? Promise.resolve();
|
|
1230
|
+
}, re = (d) => r.value ? d != null && d.length ? Promise.all(d.map((w) => new Promise((B, l) => {
|
|
1231
|
+
r.value.validateField(w, (s) => s ? B(void 0) : l(new Error("Validation failed")));
|
|
1232
|
+
}))) : r.value.validate() : Promise.resolve(), he = async (d, w) => {
|
|
1233
1233
|
var l;
|
|
1234
|
-
const
|
|
1235
|
-
return
|
|
1236
|
-
},
|
|
1234
|
+
const B = (l = a.value) == null ? void 0 : l.querySelector(`[data-field="${d}"]`);
|
|
1235
|
+
return B && B.scrollIntoView({ behavior: (w == null ? void 0 : w.behavior) ?? "smooth", block: (w == null ? void 0 : w.block) ?? "nearest" }), Promise.resolve();
|
|
1236
|
+
}, se = (d) => {
|
|
1237
1237
|
var w;
|
|
1238
|
-
(w =
|
|
1238
|
+
(w = r.value) == null || w.clearValidate(d);
|
|
1239
1239
|
}, _e = async (d) => {
|
|
1240
|
-
(Array.isArray(d) ? d : [d]).forEach((
|
|
1241
|
-
const l =
|
|
1242
|
-
l >= 0 && (
|
|
1240
|
+
(Array.isArray(d) ? d : [d]).forEach((B) => {
|
|
1241
|
+
const l = m.value.findIndex((s) => s.field === B.field);
|
|
1242
|
+
l >= 0 && (m.value[l] = { ...m.value[l], ...B });
|
|
1243
1243
|
});
|
|
1244
|
-
},
|
|
1245
|
-
if (
|
|
1246
|
-
|
|
1244
|
+
}, ge = async (d, w, B) => {
|
|
1245
|
+
if (B)
|
|
1246
|
+
m.value.unshift(d);
|
|
1247
1247
|
else if (w) {
|
|
1248
|
-
const l =
|
|
1249
|
-
|
|
1248
|
+
const l = m.value.findIndex((s) => s.field === w);
|
|
1249
|
+
m.value.splice(l + 1, 0, d);
|
|
1250
1250
|
} else
|
|
1251
|
-
|
|
1251
|
+
m.value.push(d);
|
|
1252
1252
|
ne();
|
|
1253
|
-
},
|
|
1253
|
+
}, be = async (d) => {
|
|
1254
1254
|
const w = Array.isArray(d) ? d : [d];
|
|
1255
|
-
|
|
1255
|
+
m.value = m.value.filter((B) => !w.includes(B.field));
|
|
1256
1256
|
}, ye = async (d) => {
|
|
1257
|
-
|
|
1257
|
+
S.value = { ...S.value, ...d }, d.schemas && (m.value = [...d.schemas], ne());
|
|
1258
1258
|
}, we = (d, w) => {
|
|
1259
1259
|
w ? p.value.set(d, w) : p.value.delete(d);
|
|
1260
1260
|
}, Ce = (d) => p.value.get(d) ?? null;
|
|
1261
1261
|
function xe(d, w = !1) {
|
|
1262
|
-
const
|
|
1263
|
-
if (!
|
|
1262
|
+
const B = p.value.get(d);
|
|
1263
|
+
if (!B)
|
|
1264
1264
|
return [];
|
|
1265
|
-
const l =
|
|
1265
|
+
const l = B;
|
|
1266
1266
|
return w ? (l == null ? void 0 : l.rawOptions) ?? [] : (l == null ? void 0 : l.options) ?? [];
|
|
1267
1267
|
}
|
|
1268
1268
|
const ve = (d) => {
|
|
1269
1269
|
const w = p.value.get(d);
|
|
1270
1270
|
if (!w)
|
|
1271
1271
|
return !1;
|
|
1272
|
-
const
|
|
1273
|
-
return (
|
|
1272
|
+
const B = w;
|
|
1273
|
+
return (B == null ? void 0 : B.loading) ?? !1;
|
|
1274
1274
|
}, ie = {
|
|
1275
|
-
getFieldsValue:
|
|
1276
|
-
setFieldsValue:
|
|
1277
|
-
resetFields:
|
|
1278
|
-
validate:
|
|
1279
|
-
validateFields:
|
|
1280
|
-
submit:
|
|
1275
|
+
getFieldsValue: R,
|
|
1276
|
+
setFieldsValue: h,
|
|
1277
|
+
resetFields: L,
|
|
1278
|
+
validate: Z,
|
|
1279
|
+
validateFields: re,
|
|
1280
|
+
submit: T,
|
|
1281
1281
|
scrollToField: he,
|
|
1282
|
-
clearValidate:
|
|
1282
|
+
clearValidate: se,
|
|
1283
1283
|
updateSchema: _e,
|
|
1284
|
-
appendSchemaByField:
|
|
1285
|
-
removeSchemaByField:
|
|
1284
|
+
appendSchemaByField: ge,
|
|
1285
|
+
removeSchemaByField: be,
|
|
1286
1286
|
setProps: ye,
|
|
1287
1287
|
getComponentInstance: Ce,
|
|
1288
1288
|
getFieldOptions: xe,
|
|
@@ -1293,33 +1293,33 @@ const He = $t.exports, Tt = /* @__PURE__ */ le({
|
|
|
1293
1293
|
registerFieldInstance: we
|
|
1294
1294
|
});
|
|
1295
1295
|
const ce = () => {
|
|
1296
|
-
|
|
1296
|
+
m.value = [...t.schemas ?? []], ne();
|
|
1297
1297
|
}, de = () => {
|
|
1298
|
-
typeof window < "u" && (
|
|
1298
|
+
typeof window < "u" && (K.value = window.innerWidth);
|
|
1299
1299
|
};
|
|
1300
1300
|
return me(() => {
|
|
1301
1301
|
ce(), n("register", ie), typeof window < "u" && window.addEventListener("resize", de);
|
|
1302
|
-
}),
|
|
1302
|
+
}), ke(() => {
|
|
1303
1303
|
typeof window < "u" && window.removeEventListener("resize", de);
|
|
1304
|
-
}),
|
|
1304
|
+
}), U(() => y.value, (d) => {
|
|
1305
1305
|
!q.value || d === void 0 || J(ee(d), !1);
|
|
1306
|
-
}, { deep: !0, immediate: !0 }),
|
|
1306
|
+
}, { deep: !0, immediate: !0 }), U(() => [t.schemas, t.initialValues], ce, { deep: !0 }), { __sfc: !0, props: t, emit: n, slots: o, formRef: r, formWrapRef: a, submitLoading: v, collapsed: u, formModel: P, formRules: $, innerSchemas: m, innerProps: S, fieldInstanceMap: p, BREAKPOINTS: x, getEffectiveSpan: g, getComponentSetting: V, effectiveProps: O, controlledModelValue: y, isControlled: q, currentFormModel: A, formCustomComponents: F, effectiveActionColOptions: f, windowWidth: K, getVisibleSchemaCount: M, hasMoreFields: D, formListeners: j, displaySchemas: G, shouldShow: H, getColProps: Y, getSlotName: X, resolveSchemaModel: ee, applyFormModel: J, updateFormModel: te, initForm: ne, filterByIfShow: b, processFieldMapToTime: N, handleSubmit: T, handleReset: i, setFieldsValue: h, getFieldsValue: R, resetFields: L, handleFieldChange: E, validate: Z, validateFields: re, scrollToField: he, clearValidate: se, updateSchema: _e, appendSchemaByField: ge, removeSchemaByField: be, setProps: ye, registerFieldInstance: we, getComponentInstance: Ce, getFieldOptions: xe, isFieldLoading: ve, formActionRef: ie, syncSchemas: ce, handleResize: de, ProFormItem: qe, FormActions: He };
|
|
1307
1307
|
}
|
|
1308
1308
|
});
|
|
1309
|
-
var
|
|
1309
|
+
var zt = function() {
|
|
1310
1310
|
var e = this, n = e._self._c, t = e._self._setupProxy;
|
|
1311
1311
|
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(o) {
|
|
1312
|
-
var
|
|
1313
|
-
return [t.shouldShow(o) ? n("el-col", e._b({ key: o.field, attrs: { offset: ((
|
|
1312
|
+
var r, a;
|
|
1313
|
+
return [t.shouldShow(o) ? n("el-col", e._b({ key: o.field, attrs: { offset: ((r = o.colProps) == null ? void 0 : r.offset) ?? ((a = t.effectiveProps.baseColProps) == null ? void 0 : a.offset) ?? 0, "data-field": o.field } }, "el-col", t.getColProps(o), !1), [n(t.ProFormItem, { attrs: { schema: o, "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(o)] ? [e._t(t.getSlotName(o), null, { model: t.currentFormModel, schema: o, field: o.field, values: t.currentFormModel })] : e._e()], 2)], 1) : e._e()];
|
|
1314
1314
|
}), 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(o) {
|
|
1315
1315
|
t.collapsed = !t.collapsed;
|
|
1316
1316
|
} } }, [n("template", { slot: "submitBefore" }, [e._t("submitBefore")], 2), n("template", { slot: "resetBefore" }, [e._t("resetBefore")], 2), n("template", { slot: "advanceBefore" }, [e._t("advanceBefore")], 2), n("template", { slot: "advanceAfter" }, [e._t("advanceAfter")], 2), n("template", { slot: "actions" }, [e._t("actions")], 2)], 2)], 1) : e._e()], 2), t.effectiveProps.showAdvancedButton && t.hasMoreFields ? n("el-button", { staticClass: "ecp-form-actions__advance", attrs: { type: "text" }, on: { click: function(o) {
|
|
1317
1317
|
t.collapsed = !t.collapsed;
|
|
1318
1318
|
} } }, [n("i", { staticClass: "el-icon-d-arrow-left", class: t.collapsed ? "down" : "up" }), e._v(" " + e._s(t.collapsed ? "展开" : "收起") + " ")]) : e._e(), e._t("formFooter")], 2)], 1);
|
|
1319
|
-
},
|
|
1320
|
-
Tt,
|
|
1319
|
+
}, Et = [], Ot = /* @__PURE__ */ ae(
|
|
1321
1320
|
Dt,
|
|
1322
1321
|
zt,
|
|
1322
|
+
Et,
|
|
1323
1323
|
!1,
|
|
1324
1324
|
null,
|
|
1325
1325
|
"80bac8be",
|
|
@@ -1327,86 +1327,86 @@ var Dt = function() {
|
|
|
1327
1327
|
null
|
|
1328
1328
|
);
|
|
1329
1329
|
const Je = Ot.exports;
|
|
1330
|
-
function
|
|
1331
|
-
const e =
|
|
1332
|
-
e.value =
|
|
1330
|
+
function nn(c) {
|
|
1331
|
+
const e = z(null), n = z(c ? pe(c) : void 0), t = () => c ? pe(c) : void 0, o = (F) => {
|
|
1332
|
+
e.value = F;
|
|
1333
1333
|
const f = t();
|
|
1334
|
-
f && Object.keys(f).length > 0 &&
|
|
1334
|
+
f && Object.keys(f).length > 0 && F.setProps(f);
|
|
1335
1335
|
};
|
|
1336
|
-
c &&
|
|
1336
|
+
c && U(
|
|
1337
1337
|
() => t(),
|
|
1338
|
-
(
|
|
1339
|
-
n.value =
|
|
1338
|
+
(F) => {
|
|
1339
|
+
n.value = F, F && e.value && e.value.setProps(F);
|
|
1340
1340
|
},
|
|
1341
1341
|
{ deep: !0 }
|
|
1342
1342
|
);
|
|
1343
|
-
const
|
|
1344
|
-
var
|
|
1345
|
-
return ((
|
|
1346
|
-
},
|
|
1343
|
+
const r = () => {
|
|
1344
|
+
var F;
|
|
1345
|
+
return ((F = e.value) == null ? void 0 : F.getFieldsValue()) ?? {};
|
|
1346
|
+
}, a = async (F) => {
|
|
1347
1347
|
var f;
|
|
1348
|
-
await ((f = e.value) == null ? void 0 : f.setFieldsValue(
|
|
1349
|
-
},
|
|
1350
|
-
var
|
|
1351
|
-
await ((
|
|
1352
|
-
}, u = (
|
|
1348
|
+
await ((f = e.value) == null ? void 0 : f.setFieldsValue(F));
|
|
1349
|
+
}, v = async () => {
|
|
1350
|
+
var F;
|
|
1351
|
+
await ((F = e.value) == null ? void 0 : F.resetFields());
|
|
1352
|
+
}, u = (F) => {
|
|
1353
1353
|
var f;
|
|
1354
|
-
return ((f = e.value) == null ? void 0 : f.validate(
|
|
1355
|
-
},
|
|
1354
|
+
return ((f = e.value) == null ? void 0 : f.validate(F)) ?? Promise.resolve();
|
|
1355
|
+
}, P = (F) => {
|
|
1356
1356
|
var f;
|
|
1357
|
-
return ((f = e.value) == null ? void 0 : f.validateFields(
|
|
1358
|
-
},
|
|
1359
|
-
var
|
|
1360
|
-
return ((
|
|
1361
|
-
},
|
|
1362
|
-
var
|
|
1363
|
-
return ((
|
|
1364
|
-
},
|
|
1357
|
+
return ((f = e.value) == null ? void 0 : f.validateFields(F)) ?? Promise.resolve();
|
|
1358
|
+
}, $ = () => {
|
|
1359
|
+
var F;
|
|
1360
|
+
return ((F = e.value) == null ? void 0 : F.submit()) ?? Promise.resolve();
|
|
1361
|
+
}, m = (F, f) => {
|
|
1362
|
+
var K;
|
|
1363
|
+
return ((K = e.value) == null ? void 0 : K.scrollToField(F, f)) ?? Promise.resolve();
|
|
1364
|
+
}, S = (F) => {
|
|
1365
1365
|
var f;
|
|
1366
|
-
(f = e.value) == null || f.clearValidate(
|
|
1367
|
-
}, p = (
|
|
1366
|
+
(f = e.value) == null || f.clearValidate(F);
|
|
1367
|
+
}, p = (F) => {
|
|
1368
1368
|
var f;
|
|
1369
|
-
return ((f = e.value) == null ? void 0 : f.updateSchema(
|
|
1370
|
-
},
|
|
1369
|
+
return ((f = e.value) == null ? void 0 : f.updateSchema(F)) ?? Promise.resolve();
|
|
1370
|
+
}, x = (F, f, K) => {
|
|
1371
1371
|
var M;
|
|
1372
|
-
return ((M = e.value) == null ? void 0 : M.appendSchemaByField(
|
|
1373
|
-
},
|
|
1372
|
+
return ((M = e.value) == null ? void 0 : M.appendSchemaByField(F, f, K)) ?? Promise.resolve();
|
|
1373
|
+
}, g = (F) => {
|
|
1374
1374
|
var f;
|
|
1375
|
-
return ((f = e.value) == null ? void 0 : f.removeSchemaByField(
|
|
1376
|
-
},
|
|
1375
|
+
return ((f = e.value) == null ? void 0 : f.removeSchemaByField(F)) ?? Promise.resolve();
|
|
1376
|
+
}, V = async (F) => {
|
|
1377
1377
|
var f;
|
|
1378
|
-
n.value = { ...n.value, ...
|
|
1379
|
-
},
|
|
1378
|
+
n.value = { ...n.value, ...F }, await ((f = e.value) == null ? void 0 : f.setProps(F));
|
|
1379
|
+
}, O = (F) => {
|
|
1380
1380
|
var f;
|
|
1381
|
-
return ((f = e.value) == null ? void 0 : f.getComponentInstance(
|
|
1381
|
+
return ((f = e.value) == null ? void 0 : f.getComponentInstance(F)) ?? null;
|
|
1382
1382
|
};
|
|
1383
|
-
function
|
|
1384
|
-
return e.value ? f ? e.value.getFieldOptions(
|
|
1383
|
+
function y(F, f = !1) {
|
|
1384
|
+
return e.value ? f ? e.value.getFieldOptions(F, !0) : e.value.getFieldOptions(F) : [];
|
|
1385
1385
|
}
|
|
1386
1386
|
return [o, {
|
|
1387
1387
|
register: o,
|
|
1388
1388
|
formAction: e,
|
|
1389
|
-
getFieldsValue:
|
|
1390
|
-
setFieldsValue:
|
|
1391
|
-
resetFields:
|
|
1389
|
+
getFieldsValue: r,
|
|
1390
|
+
setFieldsValue: a,
|
|
1391
|
+
resetFields: v,
|
|
1392
1392
|
validate: u,
|
|
1393
|
-
validateFields:
|
|
1394
|
-
submit:
|
|
1395
|
-
scrollToField:
|
|
1396
|
-
clearValidate:
|
|
1393
|
+
validateFields: P,
|
|
1394
|
+
submit: $,
|
|
1395
|
+
scrollToField: m,
|
|
1396
|
+
clearValidate: S,
|
|
1397
1397
|
updateSchema: p,
|
|
1398
|
-
appendSchemaByField:
|
|
1399
|
-
removeSchemaByField:
|
|
1400
|
-
setProps:
|
|
1401
|
-
getComponentInstance:
|
|
1402
|
-
getFieldOptions:
|
|
1403
|
-
isFieldLoading: (
|
|
1398
|
+
appendSchemaByField: x,
|
|
1399
|
+
removeSchemaByField: g,
|
|
1400
|
+
setProps: V,
|
|
1401
|
+
getComponentInstance: O,
|
|
1402
|
+
getFieldOptions: y,
|
|
1403
|
+
isFieldLoading: (F) => {
|
|
1404
1404
|
var f;
|
|
1405
|
-
return ((f = e.value) == null ? void 0 : f.isFieldLoading(
|
|
1405
|
+
return ((f = e.value) == null ? void 0 : f.isFieldLoading(F)) ?? !1;
|
|
1406
1406
|
}
|
|
1407
1407
|
}];
|
|
1408
1408
|
}
|
|
1409
|
-
const Nt = /* @__PURE__ */
|
|
1409
|
+
const Nt = /* @__PURE__ */ oe({
|
|
1410
1410
|
__name: "ProDescriptions",
|
|
1411
1411
|
props: {
|
|
1412
1412
|
title: null,
|
|
@@ -1422,7 +1422,7 @@ const Nt = /* @__PURE__ */ le({
|
|
|
1422
1422
|
},
|
|
1423
1423
|
emits: ["register"],
|
|
1424
1424
|
setup(c, { expose: e, emit: n }) {
|
|
1425
|
-
const t = c, o =
|
|
1425
|
+
const t = c, o = z({}), r = z({}), a = z([]), v = z(typeof window < "u" ? window.innerWidth : 1920), u = z(!0), P = oe({
|
|
1426
1426
|
name: "EcpDescriptionValueRenderer",
|
|
1427
1427
|
props: {
|
|
1428
1428
|
schema: { type: Object, required: !0 },
|
|
@@ -1430,117 +1430,117 @@ const Nt = /* @__PURE__ */ le({
|
|
|
1430
1430
|
record: { type: Object, required: !0 },
|
|
1431
1431
|
emptyText: { type: String, default: "-" }
|
|
1432
1432
|
},
|
|
1433
|
-
setup(
|
|
1433
|
+
setup(b) {
|
|
1434
1434
|
return () => {
|
|
1435
|
-
const
|
|
1436
|
-
const
|
|
1437
|
-
return
|
|
1435
|
+
const N = b.schema, T = b.record, i = b.value, h = (R) => {
|
|
1436
|
+
const L = $(N, R === b.emptyText ? i : R, T), E = ue("span", R);
|
|
1437
|
+
return L ? ue("el-tooltip", { props: L }, [E]) : E;
|
|
1438
1438
|
};
|
|
1439
|
-
if (
|
|
1440
|
-
const
|
|
1441
|
-
return
|
|
1439
|
+
if (N.render) {
|
|
1440
|
+
const R = N.render(i, T);
|
|
1441
|
+
return R == null || R === "" ? h(b.emptyText) : typeof R == "string" || typeof R == "number" ? h(String(R)) : R;
|
|
1442
1442
|
}
|
|
1443
|
-
return Array.isArray(i) ?
|
|
1443
|
+
return Array.isArray(i) ? h(i.length ? i.join(", ") : b.emptyText) : i == null || i === "" ? h(b.emptyText) : h(typeof i == "object" ? JSON.stringify(i) : String(i));
|
|
1444
1444
|
};
|
|
1445
1445
|
}
|
|
1446
|
-
}),
|
|
1447
|
-
const i =
|
|
1446
|
+
}), $ = (b, N, T) => {
|
|
1447
|
+
const i = b.tooltip;
|
|
1448
1448
|
if (!i)
|
|
1449
1449
|
return null;
|
|
1450
|
-
const
|
|
1451
|
-
return Te(
|
|
1452
|
-
}, { mergeSettings:
|
|
1453
|
-
if (typeof
|
|
1454
|
-
return Math.max(1,
|
|
1455
|
-
const
|
|
1456
|
-
return
|
|
1457
|
-
},
|
|
1458
|
-
...
|
|
1459
|
-
dataIndex:
|
|
1460
|
-
}))),
|
|
1461
|
-
const
|
|
1462
|
-
let
|
|
1463
|
-
const i =
|
|
1464
|
-
return
|
|
1465
|
-
const
|
|
1466
|
-
|
|
1467
|
-
const
|
|
1468
|
-
|
|
1469
|
-
}),
|
|
1470
|
-
}), q =
|
|
1471
|
-
var
|
|
1450
|
+
const h = typeof i == "function" ? i({ value: N, record: T, schema: b }) : i;
|
|
1451
|
+
return Te(h, N);
|
|
1452
|
+
}, { mergeSettings: m } = Be(), S = C(() => m("ProDescriptions", { ...t, ...o.value })), p = { xxl: 1920, xl: 1200, lg: 992, md: 768, sm: 576 }, x = (b, N) => {
|
|
1453
|
+
if (typeof b == "number")
|
|
1454
|
+
return Math.max(1, b);
|
|
1455
|
+
const T = b ?? {};
|
|
1456
|
+
return N >= p.xxl ? T.xxl ?? T.xl ?? T.lg ?? T.md ?? T.sm ?? T.xs ?? 3 : N >= p.xl ? T.xl ?? T.lg ?? T.md ?? T.sm ?? T.xs ?? 3 : N >= p.lg ? T.lg ?? T.md ?? T.sm ?? T.xs ?? 3 : N >= p.md ? T.md ?? T.sm ?? T.xs ?? 3 : N >= p.sm ? T.sm ?? T.xs ?? 2 : T.xs ?? 1;
|
|
1457
|
+
}, g = C(() => x(S.value.column, v.value)), V = C(() => S.value.data ?? r.value ?? {}), O = C(() => (a.value.length ? a.value : S.value.schema ?? []).filter((b) => b.dataIndex || b.field ? typeof b.show == "function" ? b.show(V.value) : b.show !== !1 : !1).map((b) => ({
|
|
1458
|
+
...b,
|
|
1459
|
+
dataIndex: b.dataIndex || b.field || ""
|
|
1460
|
+
}))), y = C(() => {
|
|
1461
|
+
const b = [];
|
|
1462
|
+
let N = { items: [] }, T = 0;
|
|
1463
|
+
const i = g.value;
|
|
1464
|
+
return O.value.forEach((h, R) => {
|
|
1465
|
+
const L = O.value.length - R, E = Math.max(1, Math.min(h.span ?? 1, i)), Z = L === 1 ? i - T || i : E;
|
|
1466
|
+
T + Z > i && (b.push(N), N = { items: [] }, T = 0);
|
|
1467
|
+
const re = L === 1 && T < i ? Math.max(1, i - T) : Z;
|
|
1468
|
+
N.items.push({ ...h, _span: re }), T += re, T >= i && (b.push(N), N = { items: [] }, T = 0);
|
|
1469
|
+
}), N.items.length > 0 && b.push(N), b;
|
|
1470
|
+
}), q = C(() => {
|
|
1471
|
+
var N;
|
|
1472
1472
|
if (!A.value || u.value)
|
|
1473
|
-
return
|
|
1474
|
-
const
|
|
1475
|
-
return
|
|
1476
|
-
}), A =
|
|
1477
|
-
var
|
|
1478
|
-
const
|
|
1479
|
-
return !!
|
|
1480
|
-
}),
|
|
1481
|
-
var
|
|
1473
|
+
return y.value;
|
|
1474
|
+
const b = Math.max(1, ((N = S.value.collapseOptions) == null ? void 0 : N.visibleRows) ?? 1);
|
|
1475
|
+
return y.value.slice(0, b);
|
|
1476
|
+
}), A = C(() => {
|
|
1477
|
+
var N, T;
|
|
1478
|
+
const b = Math.max(1, ((N = S.value.collapseOptions) == null ? void 0 : N.visibleRows) ?? 1);
|
|
1479
|
+
return !!S.value.useCollapse && !!((T = S.value.collapseOptions) != null && T.canExpand) && y.value.length > b;
|
|
1480
|
+
}), F = C(() => !!S.value.title || !!S.value.helpMessage || A.value), f = C(() => {
|
|
1481
|
+
var b, N;
|
|
1482
1482
|
return {
|
|
1483
|
-
expand: ((
|
|
1484
|
-
collapse: ((
|
|
1483
|
+
expand: ((b = S.value.collapseOptions) == null ? void 0 : b.expandButtonText) ?? "展开",
|
|
1484
|
+
collapse: ((N = S.value.collapseOptions) == null ? void 0 : N.collapseButtonText) ?? "收起"
|
|
1485
1485
|
};
|
|
1486
|
-
}),
|
|
1487
|
-
gridTemplateColumns: `repeat(${
|
|
1488
|
-
})), M = (
|
|
1489
|
-
gridColumn: `span ${
|
|
1490
|
-
}),
|
|
1491
|
-
minWidth:
|
|
1492
|
-
...
|
|
1493
|
-
}),
|
|
1494
|
-
minWidth:
|
|
1495
|
-
...
|
|
1496
|
-
}),
|
|
1497
|
-
|
|
1498
|
-
},
|
|
1499
|
-
|
|
1500
|
-
},
|
|
1501
|
-
o.value = { ...o.value, ...
|
|
1502
|
-
}, ee = async (
|
|
1503
|
-
|
|
1504
|
-
}, J = () => ({ ...
|
|
1505
|
-
setProps:
|
|
1486
|
+
}), K = C(() => ({
|
|
1487
|
+
gridTemplateColumns: `repeat(${g.value}, minmax(0, 1fr))`
|
|
1488
|
+
})), M = (b) => ({
|
|
1489
|
+
gridColumn: `span ${b._span}`
|
|
1490
|
+
}), D = (b) => ({
|
|
1491
|
+
minWidth: b.labelMinWidth ? `${b.labelMinWidth}px` : void 0,
|
|
1492
|
+
...b.labelStyle ?? {}
|
|
1493
|
+
}), j = (b) => ({
|
|
1494
|
+
minWidth: b.contentMinWidth ? `${b.contentMinWidth}px` : void 0,
|
|
1495
|
+
...b.contentStyle ?? {}
|
|
1496
|
+
}), G = (b) => V.value[b.dataIndex], H = () => {
|
|
1497
|
+
a.value = [...S.value.schema ?? []];
|
|
1498
|
+
}, Y = () => {
|
|
1499
|
+
r.value = { ...S.value.data ?? {} };
|
|
1500
|
+
}, X = async (b) => {
|
|
1501
|
+
o.value = { ...o.value, ...b }, b.schema && (a.value = [...b.schema]), b.data && (r.value = { ...b.data });
|
|
1502
|
+
}, ee = async (b) => {
|
|
1503
|
+
r.value = { ...r.value, ...b }, o.value = { ...o.value, data: r.value };
|
|
1504
|
+
}, J = () => ({ ...S.value.data ?? r.value ?? {} }), te = {
|
|
1505
|
+
setProps: X,
|
|
1506
1506
|
setData: ee,
|
|
1507
1507
|
getData: J
|
|
1508
1508
|
};
|
|
1509
1509
|
e(te);
|
|
1510
1510
|
const ne = () => {
|
|
1511
|
-
typeof window < "u" && (
|
|
1511
|
+
typeof window < "u" && (v.value = window.innerWidth);
|
|
1512
1512
|
};
|
|
1513
1513
|
return me(() => {
|
|
1514
|
-
var
|
|
1515
|
-
H(),
|
|
1516
|
-
}),
|
|
1514
|
+
var b;
|
|
1515
|
+
H(), Y(), u.value = ((b = S.value.collapseOptions) == null ? void 0 : b.defaultExpand) !== !1, n("register", te), typeof window < "u" && window.addEventListener("resize", ne);
|
|
1516
|
+
}), ke(() => {
|
|
1517
1517
|
typeof window < "u" && window.removeEventListener("resize", ne);
|
|
1518
|
-
}),
|
|
1519
|
-
var
|
|
1520
|
-
return (
|
|
1521
|
-
}, (
|
|
1522
|
-
|
|
1523
|
-
}), { __sfc: !0, props: t, emit: n, innerProps: o, innerData:
|
|
1518
|
+
}), U(() => S.value.schema, H, { deep: !0 }), U(() => S.value.data, Y, { deep: !0 }), U(() => {
|
|
1519
|
+
var b;
|
|
1520
|
+
return (b = S.value.collapseOptions) == null ? void 0 : b.defaultExpand;
|
|
1521
|
+
}, (b) => {
|
|
1522
|
+
b !== void 0 && (u.value = b);
|
|
1523
|
+
}), { __sfc: !0, props: t, emit: n, innerProps: o, innerData: r, innerSchema: a, windowWidth: v, expanded: u, DescriptionValueRenderer: P, normalizeTooltip: $, mergeSettings: m, effectiveProps: S, breakpoints: p, resolveColumn: x, currentColumn: g, effectiveData: V, visibleSchema: O, normalizedRows: y, renderedRows: q, showCollapseButton: A, showHeader: F, collapseButtonText: f, bodyStyle: K, getItemStyle: M, getLabelStyle: D, getContentStyle: j, getItemValue: G, syncSchema: H, syncData: Y, setProps: X, setData: ee, getData: J, descriptionAction: te, updateWindowWidth: ne };
|
|
1524
1524
|
}
|
|
1525
1525
|
});
|
|
1526
1526
|
var It = function() {
|
|
1527
1527
|
var o;
|
|
1528
1528
|
var e = this, n = e._self._c, t = e._self._setupProxy;
|
|
1529
|
-
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(
|
|
1530
|
-
return n("div", { key:
|
|
1531
|
-
}), 0) : n("span", [e._v(e._s(t.effectiveProps.helpMessage))])]), n("i", { staticClass: "el-icon-question ecp-pro-descriptions__help" })], 2) : e._e(), (o = t.effectiveProps.collapseOptions) != null && o.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(
|
|
1532
|
-
return n("div", { key: `collapse-${
|
|
1533
|
-
}), 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(
|
|
1529
|
+
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(r, a) {
|
|
1530
|
+
return n("div", { key: a }, [e._v(e._s(r))]);
|
|
1531
|
+
}), 0) : n("span", [e._v(e._s(t.effectiveProps.helpMessage))])]), n("i", { staticClass: "el-icon-question ecp-pro-descriptions__help" })], 2) : e._e(), (o = t.effectiveProps.collapseOptions) != null && o.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(r, a) {
|
|
1532
|
+
return n("div", { key: `collapse-${a}` }, [e._v(e._s(r))]);
|
|
1533
|
+
}), 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(r) {
|
|
1534
1534
|
t.expanded = !t.expanded;
|
|
1535
1535
|
} } }, [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: [
|
|
1536
1536
|
`is-${t.effectiveProps.size}`,
|
|
1537
1537
|
{ "is-bordered": t.effectiveProps.bordered, "is-collapsed": t.showCollapseButton && !t.expanded }
|
|
1538
|
-
], style: t.bodyStyle }, "div", e.$attrs, !1), [e._l(t.renderedRows, function(
|
|
1539
|
-
return [e._l(
|
|
1540
|
-
return [n("div", { key: `${
|
|
1538
|
+
], style: t.bodyStyle }, "div", e.$attrs, !1), [e._l(t.renderedRows, function(r, a) {
|
|
1539
|
+
return [e._l(r.items, function(v) {
|
|
1540
|
+
return [n("div", { key: `${a}-${v.dataIndex || v.field}`, staticClass: "ecp-pro-descriptions__item", style: t.getItemStyle(v) }, [n("div", { staticClass: "ecp-pro-descriptions__label", style: t.getLabelStyle(v) }, [e._v(" " + e._s(v.label) + " ")]), n("div", { staticClass: "ecp-pro-descriptions__content", style: t.getContentStyle(v) }, [e.$scopedSlots[v.slot || v.dataIndex] ? e._t(v.slot || v.dataIndex, null, { value: t.getItemValue(v), record: t.effectiveData, schema: v }) : n(t.DescriptionValueRenderer, { attrs: { schema: v, value: t.getItemValue(v), record: t.effectiveData, "empty-text": t.effectiveProps.emptyText || "-" } })], 2)])];
|
|
1541
1541
|
})];
|
|
1542
1542
|
})], 2)]);
|
|
1543
|
-
}, Vt = [],
|
|
1543
|
+
}, Vt = [], Wt = /* @__PURE__ */ ae(
|
|
1544
1544
|
Nt,
|
|
1545
1545
|
It,
|
|
1546
1546
|
Vt,
|
|
@@ -1550,38 +1550,113 @@ var It = function() {
|
|
|
1550
1550
|
null,
|
|
1551
1551
|
null
|
|
1552
1552
|
);
|
|
1553
|
-
const Ue =
|
|
1554
|
-
function
|
|
1555
|
-
const e =
|
|
1556
|
-
const
|
|
1557
|
-
if (!
|
|
1553
|
+
const Ue = Wt.exports;
|
|
1554
|
+
function on(c) {
|
|
1555
|
+
const e = z(null), n = () => c ? pe(c) : void 0, t = () => {
|
|
1556
|
+
const a = pe(e);
|
|
1557
|
+
if (!a)
|
|
1558
1558
|
throw new Error("ProDescriptions instance has not been registered");
|
|
1559
|
-
return
|
|
1560
|
-
}, o = (
|
|
1561
|
-
e.value =
|
|
1562
|
-
const
|
|
1563
|
-
|
|
1559
|
+
return a;
|
|
1560
|
+
}, o = (a) => {
|
|
1561
|
+
e.value = a;
|
|
1562
|
+
const v = n();
|
|
1563
|
+
v && Object.keys(v).length > 0 && a.setProps(v);
|
|
1564
1564
|
};
|
|
1565
|
-
return c &&
|
|
1565
|
+
return c && U(
|
|
1566
1566
|
() => n(),
|
|
1567
|
-
(
|
|
1568
|
-
|
|
1567
|
+
(a) => {
|
|
1568
|
+
a && e.value && e.value.setProps(a);
|
|
1569
1569
|
},
|
|
1570
1570
|
{ deep: !0 }
|
|
1571
1571
|
), [o, {
|
|
1572
|
-
setProps: (
|
|
1573
|
-
setData: (
|
|
1572
|
+
setProps: (a) => t().setProps(a),
|
|
1573
|
+
setData: (a) => t().setData(a),
|
|
1574
1574
|
getData: () => t().getData()
|
|
1575
1575
|
}];
|
|
1576
1576
|
}
|
|
1577
|
-
const
|
|
1577
|
+
const Kt = /* @__PURE__ */ oe({
|
|
1578
|
+
__name: "CollapseContainer",
|
|
1579
|
+
props: {
|
|
1580
|
+
title: null,
|
|
1581
|
+
loading: { type: Boolean, default: !1 },
|
|
1582
|
+
canExpan: { type: Boolean, default: !0 },
|
|
1583
|
+
canExpand: { type: Boolean, default: void 0 },
|
|
1584
|
+
helpMessage: null,
|
|
1585
|
+
triggerWindowResize: { type: Boolean, default: !0 },
|
|
1586
|
+
expanded: { type: Boolean, default: void 0 },
|
|
1587
|
+
defaultExpand: { type: Boolean, default: !0 },
|
|
1588
|
+
ghost: { type: Boolean, default: !1 },
|
|
1589
|
+
expandButtonText: { default: "展开" },
|
|
1590
|
+
collapseButtonText: { default: "收起" },
|
|
1591
|
+
wrapperProps: { default: () => ({}) },
|
|
1592
|
+
headerClass: { default: "" },
|
|
1593
|
+
headerStyle: { default: () => ({}) },
|
|
1594
|
+
contentClass: { default: "" },
|
|
1595
|
+
contentStyle: { default: () => ({}) }
|
|
1596
|
+
},
|
|
1597
|
+
emits: ["update:expanded", "change", "collapse", "expand"],
|
|
1598
|
+
setup(c, { expose: e, emit: n }) {
|
|
1599
|
+
const t = c, o = Fe(), { mergeSettings: r } = Be(), a = z(t.expanded ?? t.defaultExpand), v = C(() => r("CollapseContainer", { ...t })), u = C(() => v.value.canExpand ?? v.value.canExpan ?? !0), P = C(() => v.value.expanded !== void 0), $ = C(() => P.value ? !!v.value.expanded : a.value), m = C(() => !!o.title || !!o.action || !!v.value.title || !!v.value.helpMessage || u.value), S = C(() => u.value), p = C(() => {
|
|
1600
|
+
const y = v.value.wrapperProps ?? {}, q = y.class, A = y.style, F = { ...y };
|
|
1601
|
+
return delete F.class, delete F.style, {
|
|
1602
|
+
...F,
|
|
1603
|
+
class: q,
|
|
1604
|
+
style: A
|
|
1605
|
+
};
|
|
1606
|
+
}), x = () => {
|
|
1607
|
+
!v.value.triggerWindowResize || typeof window > "u" || window.setTimeout(() => {
|
|
1608
|
+
window.dispatchEvent(new Event("resize"));
|
|
1609
|
+
}, 220);
|
|
1610
|
+
}, g = (y) => {
|
|
1611
|
+
P.value || (a.value = y), n("update:expanded", y), n("change", y), n(y ? "expand" : "collapse"), x();
|
|
1612
|
+
}, V = () => {
|
|
1613
|
+
u.value && g(!$.value);
|
|
1614
|
+
}, O = () => {
|
|
1615
|
+
S.value && V();
|
|
1616
|
+
};
|
|
1617
|
+
return U(() => t.expanded, (y) => {
|
|
1618
|
+
y !== void 0 && (a.value = y);
|
|
1619
|
+
}), U(() => t.defaultExpand, (y) => {
|
|
1620
|
+
t.expanded === void 0 && (a.value = y);
|
|
1621
|
+
}), e({
|
|
1622
|
+
setExpanded: g,
|
|
1623
|
+
toggleExpand: V
|
|
1624
|
+
}), { __sfc: !0, props: t, emit: n, slots: o, mergeSettings: r, innerExpanded: a, effectiveProps: v, resolvedCanExpan: u, isControlled: P, mergedExpanded: $, showHeader: m, canToggleByHeader: S, wrapperProps: p, triggerWindowResize: x, setExpanded: g, toggleExpand: V, handleHeaderClick: O };
|
|
1625
|
+
}
|
|
1626
|
+
});
|
|
1627
|
+
var Lt = function() {
|
|
1628
|
+
var e = this, n = e._self._c, t = e._self._setupProxy;
|
|
1629
|
+
return n("div", e._b({ directives: [{ name: "loading", rawName: "v-loading", value: t.effectiveProps.loading, expression: "effectiveProps.loading" }], staticClass: "ecp-collapse-container", class: {
|
|
1630
|
+
"is-expanded": t.mergedExpanded,
|
|
1631
|
+
"is-ghost": t.effectiveProps.ghost,
|
|
1632
|
+
"is-header-clickable": t.canToggleByHeader
|
|
1633
|
+
} }, "div", t.wrapperProps, !1), [t.showHeader ? n("div", { staticClass: "ecp-collapse-container__header", class: t.effectiveProps.headerClass, style: t.effectiveProps.headerStyle }, [n("div", { staticClass: "ecp-collapse-container__header-main", on: { click: t.handleHeaderClick } }, [e.$slots.title || t.effectiveProps.title ? n("div", { staticClass: "ecp-collapse-container__title-wrap" }, [e._t("title", function() {
|
|
1634
|
+
return [n("span", { staticClass: "ecp-collapse-container__title" }, [e._v(e._s(t.effectiveProps.title))])];
|
|
1635
|
+
}), 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(o, r) {
|
|
1636
|
+
return n("div", { key: r }, [e._v(e._s(o))]);
|
|
1637
|
+
}), 0) : n("span", [e._v(e._s(t.effectiveProps.helpMessage))])]), n("i", { staticClass: "el-icon-question ecp-collapse-container__help" })], 2) : e._e()], 2) : e._e()]), e.$slots.action || t.resolvedCanExpan ? n("div", { staticClass: "ecp-collapse-container__header-extra", on: { click: function(o) {
|
|
1638
|
+
o.stopPropagation();
|
|
1639
|
+
} } }, [e._t("action"), t.resolvedCanExpan ? n("el-button", { staticClass: "ecp-collapse-container__toggle", attrs: { type: "text" }, on: { click: function(o) {
|
|
1640
|
+
return o.stopPropagation(), t.toggleExpand.apply(null, arguments);
|
|
1641
|
+
} } }, [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);
|
|
1642
|
+
}, jt = [], qt = /* @__PURE__ */ ae(
|
|
1643
|
+
Kt,
|
|
1644
|
+
Lt,
|
|
1645
|
+
jt,
|
|
1646
|
+
!1,
|
|
1647
|
+
null,
|
|
1648
|
+
"087dba3a",
|
|
1649
|
+
null,
|
|
1650
|
+
null
|
|
1651
|
+
);
|
|
1652
|
+
const Ge = qt.exports, Ht = {
|
|
1578
1653
|
name: "ProTableForm",
|
|
1579
1654
|
model: {
|
|
1580
1655
|
prop: "modelValue",
|
|
1581
1656
|
event: "update:modelValue"
|
|
1582
1657
|
}
|
|
1583
|
-
},
|
|
1584
|
-
...
|
|
1658
|
+
}, Jt = /* @__PURE__ */ oe({
|
|
1659
|
+
...Ht,
|
|
1585
1660
|
props: {
|
|
1586
1661
|
modelValue: { default: () => ({}) },
|
|
1587
1662
|
columns: null,
|
|
@@ -1604,7 +1679,7 @@ const Lt = {
|
|
|
1604
1679
|
},
|
|
1605
1680
|
emits: ["update:modelValue"],
|
|
1606
1681
|
setup(c, { expose: e, emit: n }) {
|
|
1607
|
-
const t = c, o =
|
|
1682
|
+
const t = c, o = z(null), r = () => t.competitorsKey ?? "competitors", a = () => t.competitorNameKey ?? "name", v = C(() => t.fixedRows.length > 0 ? !0 : t.showFirstColumn !== !1), u = C(() => "left"), P = C(() => {
|
|
1608
1683
|
const i = t.actionColumn;
|
|
1609
1684
|
return {
|
|
1610
1685
|
width: (i == null ? void 0 : i.width) ?? t.actionWidth,
|
|
@@ -1613,180 +1688,180 @@ const Lt = {
|
|
|
1613
1688
|
fixed: (i == null ? void 0 : i.fixed) === void 0 ? "right" : i.fixed
|
|
1614
1689
|
};
|
|
1615
1690
|
});
|
|
1616
|
-
function
|
|
1691
|
+
function $(i) {
|
|
1617
1692
|
return i._type === "fixed" ? `f-${i.rowKey}` : `c-${i._index}`;
|
|
1618
1693
|
}
|
|
1619
|
-
const
|
|
1694
|
+
const m = C(() => {
|
|
1620
1695
|
const i = [];
|
|
1621
|
-
t.fixedRows.forEach((
|
|
1696
|
+
t.fixedRows.forEach((L) => {
|
|
1622
1697
|
i.push({
|
|
1623
1698
|
_type: "fixed",
|
|
1624
|
-
rowKey:
|
|
1625
|
-
rowLabel:
|
|
1699
|
+
rowKey: L.rowKey,
|
|
1700
|
+
rowLabel: L.label
|
|
1626
1701
|
});
|
|
1627
1702
|
});
|
|
1628
|
-
const
|
|
1629
|
-
return ((
|
|
1630
|
-
i.push({ _type: "competitor", _index:
|
|
1703
|
+
const h = t.modelValue;
|
|
1704
|
+
return ((h && typeof h == "object" ? h[r()] : void 0) ?? []).forEach((L, E) => {
|
|
1705
|
+
i.push({ _type: "competitor", _index: E });
|
|
1631
1706
|
}), i;
|
|
1632
|
-
}),
|
|
1707
|
+
}), S = C(() => {
|
|
1633
1708
|
const i = t.modelValue;
|
|
1634
|
-
return ((i && typeof i == "object" ? i[
|
|
1709
|
+
return ((i && typeof i == "object" ? i[r()] : void 0) ?? []).length > t.minCompetitors;
|
|
1635
1710
|
});
|
|
1636
1711
|
function p() {
|
|
1637
1712
|
const i = t.modelValue;
|
|
1638
1713
|
return !i || typeof i != "object" ? {} : JSON.parse(JSON.stringify(i));
|
|
1639
1714
|
}
|
|
1640
|
-
function
|
|
1641
|
-
const
|
|
1642
|
-
if (!
|
|
1643
|
-
const
|
|
1644
|
-
for (const
|
|
1645
|
-
|
|
1646
|
-
return
|
|
1715
|
+
function x(i) {
|
|
1716
|
+
const h = t.modelValue;
|
|
1717
|
+
if (!h || typeof h != "object") {
|
|
1718
|
+
const E = {};
|
|
1719
|
+
for (const Z of t.columns)
|
|
1720
|
+
E[Z.key] = "";
|
|
1721
|
+
return E;
|
|
1647
1722
|
}
|
|
1648
|
-
const
|
|
1649
|
-
if (
|
|
1650
|
-
return
|
|
1651
|
-
const
|
|
1652
|
-
for (const
|
|
1653
|
-
|
|
1654
|
-
return
|
|
1723
|
+
const R = h[i];
|
|
1724
|
+
if (R && typeof R == "object" && !Array.isArray(R))
|
|
1725
|
+
return R;
|
|
1726
|
+
const L = {};
|
|
1727
|
+
for (const E of t.columns)
|
|
1728
|
+
L[E.key] = "";
|
|
1729
|
+
return L;
|
|
1655
1730
|
}
|
|
1656
|
-
function
|
|
1731
|
+
function g(i) {
|
|
1657
1732
|
n("update:modelValue", i);
|
|
1658
1733
|
}
|
|
1659
|
-
function
|
|
1660
|
-
return
|
|
1734
|
+
function V(i, h) {
|
|
1735
|
+
return x(i)[h] ?? "";
|
|
1661
1736
|
}
|
|
1662
|
-
function
|
|
1663
|
-
const
|
|
1664
|
-
|
|
1737
|
+
function O(i, h, R) {
|
|
1738
|
+
const L = p(), E = { ...L[i] || {} };
|
|
1739
|
+
E[h] = R, L[i] = E, g(L);
|
|
1665
1740
|
}
|
|
1666
|
-
function
|
|
1741
|
+
function y() {
|
|
1667
1742
|
const i = t.modelValue;
|
|
1668
1743
|
if (!i || typeof i != "object")
|
|
1669
1744
|
return [];
|
|
1670
|
-
const
|
|
1671
|
-
return Array.isArray(
|
|
1745
|
+
const h = i[r()];
|
|
1746
|
+
return Array.isArray(h) ? h : [];
|
|
1672
1747
|
}
|
|
1673
1748
|
function q(i) {
|
|
1674
|
-
const
|
|
1675
|
-
return
|
|
1749
|
+
const h = y()[i], R = a();
|
|
1750
|
+
return h ? String(h[R] ?? "") : "";
|
|
1676
1751
|
}
|
|
1677
|
-
function A(i,
|
|
1678
|
-
const
|
|
1679
|
-
|
|
1752
|
+
function A(i, h) {
|
|
1753
|
+
const R = p(), L = [...y()], E = { ...L[i] || {} };
|
|
1754
|
+
E[a()] = h, L[i] = E, R[r()] = L, g(R);
|
|
1680
1755
|
}
|
|
1681
|
-
function
|
|
1682
|
-
const
|
|
1683
|
-
return
|
|
1756
|
+
function F(i, h) {
|
|
1757
|
+
const R = y()[i];
|
|
1758
|
+
return R ? R[h] ?? "" : "";
|
|
1684
1759
|
}
|
|
1685
|
-
function f(i,
|
|
1686
|
-
const
|
|
1687
|
-
|
|
1760
|
+
function f(i, h, R) {
|
|
1761
|
+
const L = p(), E = [...y()], Z = { ...E[i] || {} };
|
|
1762
|
+
Z[h] = R, E[i] = Z, L[r()] = E, g(L);
|
|
1688
1763
|
}
|
|
1689
|
-
function
|
|
1690
|
-
return i._type === "fixed" ?
|
|
1764
|
+
function K(i, h) {
|
|
1765
|
+
return i._type === "fixed" ? V(i.rowKey, h.key) : F(i._index, h.key);
|
|
1691
1766
|
}
|
|
1692
|
-
function M(i,
|
|
1693
|
-
i._type === "fixed" ?
|
|
1767
|
+
function M(i, h, R) {
|
|
1768
|
+
i._type === "fixed" ? O(i.rowKey, h.key, R) : f(i._index, h.key, R);
|
|
1694
1769
|
}
|
|
1695
|
-
function
|
|
1696
|
-
return (
|
|
1770
|
+
function D(i, h) {
|
|
1771
|
+
return (R) => M(i.row, h, R);
|
|
1697
1772
|
}
|
|
1698
|
-
function
|
|
1699
|
-
const i = { [
|
|
1700
|
-
for (const
|
|
1701
|
-
i[
|
|
1773
|
+
function j() {
|
|
1774
|
+
const i = { [a()]: "" };
|
|
1775
|
+
for (const h of t.columns)
|
|
1776
|
+
i[h.key] = "";
|
|
1702
1777
|
return i;
|
|
1703
1778
|
}
|
|
1704
|
-
function
|
|
1705
|
-
const i = p(),
|
|
1706
|
-
|
|
1779
|
+
function G() {
|
|
1780
|
+
const i = p(), h = [...y()];
|
|
1781
|
+
h.push(j()), i[r()] = h, g(i);
|
|
1707
1782
|
}
|
|
1708
1783
|
function H(i) {
|
|
1709
|
-
if (!
|
|
1784
|
+
if (!S.value)
|
|
1710
1785
|
return;
|
|
1711
|
-
const
|
|
1712
|
-
|
|
1786
|
+
const h = p(), R = [...y()];
|
|
1787
|
+
R.splice(i, 1), h[r()] = R, g(h);
|
|
1713
1788
|
}
|
|
1714
|
-
function
|
|
1715
|
-
return `${i}.${
|
|
1789
|
+
function Y(i, h) {
|
|
1790
|
+
return `${i}.${h}`;
|
|
1716
1791
|
}
|
|
1717
|
-
function
|
|
1718
|
-
return `${
|
|
1792
|
+
function X(i) {
|
|
1793
|
+
return `${r()}.${i}.${a()}`;
|
|
1719
1794
|
}
|
|
1720
|
-
function ee(i,
|
|
1721
|
-
return `${
|
|
1795
|
+
function ee(i, h) {
|
|
1796
|
+
return `${r()}.${i}.${h}`;
|
|
1722
1797
|
}
|
|
1723
1798
|
function J(i) {
|
|
1724
|
-
return i.component === "formatted-number" ?
|
|
1799
|
+
return i.component === "formatted-number" ? Re : "el-input";
|
|
1725
1800
|
}
|
|
1726
1801
|
function te(i) {
|
|
1727
|
-
const
|
|
1802
|
+
const h = i.componentProps || {};
|
|
1728
1803
|
return i.component === "formatted-number" ? {
|
|
1729
1804
|
integerDigits: 5,
|
|
1730
1805
|
decimalPlaces: 6,
|
|
1731
1806
|
rounding: "round",
|
|
1732
1807
|
inputLimit: !0,
|
|
1733
|
-
...
|
|
1734
|
-
} : { ...
|
|
1808
|
+
...h
|
|
1809
|
+
} : { ...h };
|
|
1735
1810
|
}
|
|
1736
1811
|
function ne(i) {
|
|
1737
|
-
const
|
|
1738
|
-
if (
|
|
1812
|
+
const h = i.row;
|
|
1813
|
+
if (h._type === "fixed")
|
|
1739
1814
|
return {
|
|
1740
|
-
row:
|
|
1815
|
+
row: h,
|
|
1741
1816
|
rowType: "fixed",
|
|
1742
|
-
rowKey:
|
|
1743
|
-
rowLabel:
|
|
1817
|
+
rowKey: h.rowKey,
|
|
1818
|
+
rowLabel: h.rowLabel
|
|
1744
1819
|
};
|
|
1745
|
-
const
|
|
1820
|
+
const R = h._index;
|
|
1746
1821
|
return {
|
|
1747
|
-
row:
|
|
1822
|
+
row: h,
|
|
1748
1823
|
rowType: "competitor",
|
|
1749
|
-
rowIndex:
|
|
1750
|
-
value: q(
|
|
1751
|
-
updateValue: (
|
|
1824
|
+
rowIndex: R,
|
|
1825
|
+
value: q(R),
|
|
1826
|
+
updateValue: (L) => A(R, L)
|
|
1752
1827
|
};
|
|
1753
1828
|
}
|
|
1754
|
-
const
|
|
1755
|
-
const i = {},
|
|
1756
|
-
for (const
|
|
1757
|
-
for (const
|
|
1758
|
-
|
|
1759
|
-
return
|
|
1760
|
-
i[`${
|
|
1761
|
-
for (const
|
|
1762
|
-
|
|
1829
|
+
const b = C(() => {
|
|
1830
|
+
const i = {}, h = (L) => [{ required: !0, message: `请输入${L}`, trigger: "blur" }];
|
|
1831
|
+
for (const L of t.fixedRows)
|
|
1832
|
+
for (const E of t.columns)
|
|
1833
|
+
E.rules ? i[`${L.rowKey}.${E.key}`] = E.rules : E.required && (i[`${L.rowKey}.${E.key}`] = h(E.title));
|
|
1834
|
+
return y().forEach((L, E) => {
|
|
1835
|
+
i[`${r()}.${E}.${a()}`] = h("友商名称");
|
|
1836
|
+
for (const Z of t.columns)
|
|
1837
|
+
Z.rules ? i[`${r()}.${E}.${Z.key}`] = Z.rules : Z.required && (i[`${r()}.${E}.${Z.key}`] = h(Z.title));
|
|
1763
1838
|
}), { ...i, ...t.rules || {} };
|
|
1764
1839
|
});
|
|
1765
|
-
function
|
|
1840
|
+
function N() {
|
|
1766
1841
|
return new Promise((i) => {
|
|
1767
|
-
const
|
|
1768
|
-
if (!
|
|
1842
|
+
const h = o.value;
|
|
1843
|
+
if (!h || typeof h.validate != "function") {
|
|
1769
1844
|
i(!0);
|
|
1770
1845
|
return;
|
|
1771
1846
|
}
|
|
1772
|
-
|
|
1773
|
-
i(
|
|
1847
|
+
h.validate((R) => {
|
|
1848
|
+
i(R);
|
|
1774
1849
|
});
|
|
1775
1850
|
});
|
|
1776
1851
|
}
|
|
1777
|
-
function
|
|
1778
|
-
var
|
|
1779
|
-
(
|
|
1852
|
+
function T(i) {
|
|
1853
|
+
var h, R;
|
|
1854
|
+
(R = (h = o.value) == null ? void 0 : h.clearValidate) == null || R.call(h, i);
|
|
1780
1855
|
}
|
|
1781
1856
|
return e({
|
|
1782
|
-
validate:
|
|
1783
|
-
clearValidate:
|
|
1784
|
-
addCompetitor:
|
|
1857
|
+
validate: N,
|
|
1858
|
+
clearValidate: T,
|
|
1859
|
+
addCompetitor: G,
|
|
1785
1860
|
removeCompetitor: H
|
|
1786
|
-
}), { __sfc: !0, props: t, emit: n, formRef: o, ck:
|
|
1861
|
+
}), { __sfc: !0, props: t, emit: n, formRef: o, ck: r, nk: a, showFirstColumnComputed: v, firstColumnFixed: u, actionColumnBind: P, rowKeyFn: $, tableRows: m, canDeleteCompetitor: S, cloneModel: p, ensureFixedBlock: x, emitNext: g, getFixedMetric: V, setFixedMetric: O, competitorList: y, getCompetitorName: q, setCompetitorName: A, getCompetitorMetric: F, setCompetitorMetric: f, getCellValue: K, setCellValue: M, slotUpdateHandler: D, emptyCompetitorRow: j, addCompetitor: G, removeCompetitor: H, fixedMetricProp: Y, competitorNameProp: X, competitorMetricProp: ee, cellComponent: J, cellBind: te, firstColumnScope: ne, mergedRules: b, validate: N, clearValidate: T };
|
|
1787
1862
|
}
|
|
1788
1863
|
});
|
|
1789
|
-
var
|
|
1864
|
+
var Ut = function() {
|
|
1790
1865
|
var e = this, n = e._self._c, t = e._self._setupProxy;
|
|
1791
1866
|
return n("div", { staticClass: "ecp-pro-table-form" }, [n("el-form", { ref: "formRef", staticClass: "ecp-pro-table-form__form", attrs: { model: e.modelValue, rules: t.mergedRules, "label-width": e.labelWidth } }, [n("el-table", { staticClass: "ecp-pro-table-form__table", attrs: { data: t.tableRows, border: e.bordered, "row-key": t.rowKeyFn, "header-cell-class-name": "ecp-pro-table-form__header-cell" } }, [t.showFirstColumnComputed ? n("el-table-column", { attrs: { "min-width": e.firstColMinWidth, fixed: t.firstColumnFixed }, scopedSlots: e._u([{ key: "header", fn: function() {
|
|
1792
1867
|
return [e._t("firstColumnHeader", function() {
|
|
@@ -1794,8 +1869,8 @@ var Kt = function() {
|
|
|
1794
1869
|
})];
|
|
1795
1870
|
}, proxy: !0 }, { key: "default", fn: function(o) {
|
|
1796
1871
|
return [e._t("firstColumn", function() {
|
|
1797
|
-
return [o.row._type === "fixed" ? [n("span", { staticClass: "ecp-pro-table-form__fixed-label" }, [e._v(e._s(o.row.rowLabel))])] : n("el-form-item", { staticClass: "ecp-pro-table-form__cell-item", attrs: { prop: t.competitorNameProp(o.row._index) } }, [n("el-input", { attrs: { value: t.getCompetitorName(o.row._index), placeholder: e.competitorNamePlaceholder }, on: { input: function(
|
|
1798
|
-
return t.setCompetitorName(o.row._index,
|
|
1872
|
+
return [o.row._type === "fixed" ? [n("span", { staticClass: "ecp-pro-table-form__fixed-label" }, [e._v(e._s(o.row.rowLabel))])] : n("el-form-item", { staticClass: "ecp-pro-table-form__cell-item", attrs: { prop: t.competitorNameProp(o.row._index) } }, [n("el-input", { attrs: { value: t.getCompetitorName(o.row._index), placeholder: e.competitorNamePlaceholder }, on: { input: function(r) {
|
|
1873
|
+
return t.setCompetitorName(o.row._index, r);
|
|
1799
1874
|
} } })], 1)];
|
|
1800
1875
|
}, null, t.firstColumnScope(o))];
|
|
1801
1876
|
} }], null, !0) }) : e._e(), e._l(e.columns, function(o) {
|
|
@@ -1803,11 +1878,11 @@ var Kt = function() {
|
|
|
1803
1878
|
return [e._t("header-" + o.key, function() {
|
|
1804
1879
|
return [n("span", { staticClass: "ecp-pro-table-form__th-text" }, [o.required ? n("span", { staticClass: "ecp-pro-table-form__req" }, [e._v("*")]) : e._e(), e._v(e._s(o.title) + " ")])];
|
|
1805
1880
|
}, { column: o })];
|
|
1806
|
-
}, proxy: !0 }, { key: "default", fn: function(
|
|
1807
|
-
return [o.component === "slot" && o.slotName ? [
|
|
1808
|
-
return t.setFixedMetric(
|
|
1809
|
-
} } }, "component", t.cellBind(o), !1))], 1) : n("el-form-item", { staticClass: "ecp-pro-table-form__cell-item", attrs: { prop: t.competitorMetricProp(
|
|
1810
|
-
return t.setCompetitorMetric(
|
|
1881
|
+
}, proxy: !0 }, { key: "default", fn: function(r) {
|
|
1882
|
+
return [o.component === "slot" && o.slotName ? [r.row._type === "fixed" ? n("el-form-item", { staticClass: "ecp-pro-table-form__cell-item", attrs: { prop: t.fixedMetricProp(r.row.rowKey, o.key) } }, [e._t("cell-" + o.slotName, null, { column: o, row: r.row, value: t.getCellValue(r.row, o), updateValue: t.slotUpdateHandler(r, o) })], 2) : n("el-form-item", { staticClass: "ecp-pro-table-form__cell-item", attrs: { prop: t.competitorMetricProp(r.row._index, o.key) } }, [e._t("cell-" + o.slotName, null, { column: o, row: r.row, value: t.getCellValue(r.row, o), updateValue: t.slotUpdateHandler(r, o) })], 2)] : [r.row._type === "fixed" ? n("el-form-item", { staticClass: "ecp-pro-table-form__cell-item", attrs: { prop: t.fixedMetricProp(r.row.rowKey, o.key) } }, [n(t.cellComponent(o), e._b({ tag: "component", attrs: { value: t.getFixedMetric(r.row.rowKey, o.key), placeholder: o.placeholder || e.metricPlaceholder }, on: { input: function(a) {
|
|
1883
|
+
return t.setFixedMetric(r.row.rowKey, o.key, a);
|
|
1884
|
+
} } }, "component", t.cellBind(o), !1))], 1) : n("el-form-item", { staticClass: "ecp-pro-table-form__cell-item", attrs: { prop: t.competitorMetricProp(r.row._index, o.key) } }, [n(t.cellComponent(o), e._b({ tag: "component", attrs: { value: t.getCompetitorMetric(r.row._index, o.key), placeholder: o.placeholder || e.metricPlaceholder }, on: { input: function(a) {
|
|
1885
|
+
return t.setCompetitorMetric(r.row._index, o.key, a);
|
|
1811
1886
|
} } }, "component", t.cellBind(o), !1))], 1)]];
|
|
1812
1887
|
} }], null, !0) });
|
|
1813
1888
|
}), e.showActionColumn ? n("el-table-column", e._b({ scopedSlots: e._u([{ key: "header", fn: function() {
|
|
@@ -1817,68 +1892,71 @@ var Kt = function() {
|
|
|
1817
1892
|
})];
|
|
1818
1893
|
}, proxy: !0 }, { key: "default", fn: function(o) {
|
|
1819
1894
|
return [e._t("action", function() {
|
|
1820
|
-
return [o.row._type === "competitor" ? n("el-button", { staticClass: "ecp-pro-table-form__del-btn", attrs: { type: "text", disabled: !t.canDeleteCompetitor }, on: { click: function(
|
|
1895
|
+
return [o.row._type === "competitor" ? n("el-button", { staticClass: "ecp-pro-table-form__del-btn", attrs: { type: "text", disabled: !t.canDeleteCompetitor }, on: { click: function(r) {
|
|
1821
1896
|
return t.removeCompetitor(o.row._index);
|
|
1822
1897
|
} } }, [e._v(" 删除 ")]) : n("el-button", { staticClass: "ecp-pro-table-form__del-btn", attrs: { type: "text", disabled: "" } }, [e._v(" 删除 ")])];
|
|
1823
1898
|
}, { row: o.row, canDelete: t.canDeleteCompetitor, addCompetitor: t.addCompetitor, removeCompetitor: t.removeCompetitor })];
|
|
1824
1899
|
} }], null, !0) }, "el-table-column", t.actionColumnBind, !1)) : e._e()], 2)], 1)], 1);
|
|
1825
|
-
},
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1900
|
+
}, Gt = [], Xt = /* @__PURE__ */ ae(
|
|
1901
|
+
Jt,
|
|
1902
|
+
Ut,
|
|
1903
|
+
Gt,
|
|
1829
1904
|
!1,
|
|
1830
1905
|
null,
|
|
1831
1906
|
"44aa7592",
|
|
1832
1907
|
null,
|
|
1833
1908
|
null
|
|
1834
1909
|
);
|
|
1835
|
-
const
|
|
1836
|
-
{ name: "ProTable", component:
|
|
1910
|
+
const Xe = Xt.exports, Zt = [
|
|
1911
|
+
{ name: "ProTable", component: Le },
|
|
1837
1912
|
{ name: "TableAction", component: je },
|
|
1838
1913
|
{ name: "ProForm", component: Je },
|
|
1839
1914
|
{ name: "ProFormItem", component: qe },
|
|
1840
1915
|
{ name: "FormActions", component: He },
|
|
1841
|
-
{ name: "FormattedNumberInput", component:
|
|
1916
|
+
{ name: "FormattedNumberInput", component: Re },
|
|
1842
1917
|
{ name: "ProDescriptions", component: Ue },
|
|
1843
|
-
{ name: "
|
|
1918
|
+
{ name: "CollapseContainer", component: Ge },
|
|
1919
|
+
{ name: "ProTableForm", component: Xe }
|
|
1844
1920
|
];
|
|
1845
|
-
function
|
|
1846
|
-
|
|
1921
|
+
function Qt(c) {
|
|
1922
|
+
Zt.forEach(({ name: e, component: n }) => {
|
|
1847
1923
|
c.component(e, n);
|
|
1848
1924
|
});
|
|
1849
1925
|
}
|
|
1850
|
-
const
|
|
1851
|
-
install:
|
|
1852
|
-
ProTable:
|
|
1926
|
+
const ln = {
|
|
1927
|
+
install: Qt,
|
|
1928
|
+
ProTable: Le,
|
|
1853
1929
|
ProForm: Je,
|
|
1854
1930
|
ProDescriptions: Ue,
|
|
1931
|
+
CollapseContainer: Ge,
|
|
1855
1932
|
TableAction: je,
|
|
1856
|
-
FormattedNumberInput:
|
|
1857
|
-
ProTableForm:
|
|
1933
|
+
FormattedNumberInput: Re,
|
|
1934
|
+
ProTableForm: Xe
|
|
1858
1935
|
};
|
|
1859
1936
|
export {
|
|
1937
|
+
Ge as CollapseContainer,
|
|
1860
1938
|
He as FormActions,
|
|
1861
|
-
|
|
1939
|
+
Re as FormattedNumberInput,
|
|
1862
1940
|
Ue as ProDescriptions,
|
|
1863
1941
|
Je as ProForm,
|
|
1864
1942
|
qe as ProFormItem,
|
|
1865
|
-
|
|
1866
|
-
|
|
1943
|
+
Le as ProTable,
|
|
1944
|
+
Xe as ProTableForm,
|
|
1867
1945
|
je as TableAction,
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1946
|
+
ft as applyNumericInputDigitLimits,
|
|
1947
|
+
Ve as clampByIntegerDigits,
|
|
1948
|
+
ln as default,
|
|
1949
|
+
We as formatWithThousands,
|
|
1950
|
+
Qt as install,
|
|
1873
1951
|
Se as normalizeNumericValue,
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1952
|
+
ht as numberToEditString,
|
|
1953
|
+
mt as roundToDecimals,
|
|
1954
|
+
Ie as sanitizeNumericInput,
|
|
1955
|
+
Ae as stripNumberGrouping,
|
|
1956
|
+
vt as toFixedDecimalString,
|
|
1957
|
+
Be as useComponentSetting,
|
|
1958
|
+
on as useDescription,
|
|
1959
|
+
nn as useForm,
|
|
1960
|
+
tn as useProTable
|
|
1883
1961
|
};
|
|
1884
1962
|
//# sourceMappingURL=element-component-pro.es.js.map
|