@aspire-ui/element-component-pro 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/ProForm/FormattedNumberInput.vue.d.ts +55 -0
- package/dist/ProForm/index.d.ts +2 -1
- package/dist/element-component-pro.es.js +817 -645
- 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 +78 -26
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/utils/formattedNumber.d.ts +16 -0
- package/package.json +1 -1
- package/src/ProForm/FormattedNumberInput.vue +122 -0
- package/src/ProForm/ProFormItem.vue +11 -0
- package/src/ProForm/index.ts +2 -1
- package/src/index.ts +5 -2
- package/src/types/index.ts +2 -1
- package/src/utils/formattedNumber.ts +118 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { reactive as
|
|
2
|
-
import { MessageBox as
|
|
3
|
-
const we =
|
|
4
|
-
function
|
|
1
|
+
import { reactive as je, defineComponent as oe, h as ue, useSlots as Se, ref as k, computed as S, onMounted as ve, nextTick as Oe, onUnmounted as Fe, watch as J, unref as fe } from "vue";
|
|
2
|
+
import { MessageBox as qe } from "element-ui";
|
|
3
|
+
const we = je({});
|
|
4
|
+
function Re() {
|
|
5
5
|
return {
|
|
6
6
|
getSetting: (l) => l === void 0 ? { ...we } : { ...we[l] ?? {} },
|
|
7
7
|
setSetting: (l, t) => {
|
|
@@ -10,7 +10,7 @@ function Se() {
|
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
const
|
|
13
|
+
const He = /* @__PURE__ */ oe({
|
|
14
14
|
__name: "ProTable",
|
|
15
15
|
props: {
|
|
16
16
|
columns: null,
|
|
@@ -54,8 +54,8 @@ const Le = /* @__PURE__ */ oe({
|
|
|
54
54
|
load: null
|
|
55
55
|
},
|
|
56
56
|
emits: ["register", "fetch-success", "fetch-error", "selection-change", "row-click", "row-dblclick", "sort-change", "expand-change"],
|
|
57
|
-
setup(
|
|
58
|
-
const t =
|
|
57
|
+
setup(i, { expose: e, emit: l }) {
|
|
58
|
+
const t = i, n = oe({
|
|
59
59
|
name: "EcpProTableDefaultCellRenderer",
|
|
60
60
|
props: {
|
|
61
61
|
column: { type: Object, required: !0 },
|
|
@@ -65,20 +65,20 @@ const Le = /* @__PURE__ */ oe({
|
|
|
65
65
|
},
|
|
66
66
|
setup(o) {
|
|
67
67
|
return () => {
|
|
68
|
-
var
|
|
68
|
+
var _, P;
|
|
69
69
|
const s = o.column;
|
|
70
70
|
if (s != null && s.customRender) {
|
|
71
|
-
const
|
|
72
|
-
return typeof
|
|
71
|
+
const E = s.customRender({ text: o.value, record: o.record, index: o.index });
|
|
72
|
+
return typeof E == "string" || typeof E == "number" ? ue("span", String(E)) : E;
|
|
73
73
|
}
|
|
74
74
|
if (s != null && s.valueEnum) {
|
|
75
|
-
const
|
|
76
|
-
return ue("span",
|
|
75
|
+
const E = ((P = (_ = s.valueEnum) == null ? void 0 : _[o.value]) == null ? void 0 : P.text) ?? o.value;
|
|
76
|
+
return ue("span", E == null ? "" : String(E));
|
|
77
77
|
}
|
|
78
78
|
return ue("span", o.value == null ? "" : String(o.value));
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
-
}),
|
|
81
|
+
}), u = oe({
|
|
82
82
|
name: "EcpProTableBodyCellRenderer",
|
|
83
83
|
props: {
|
|
84
84
|
slotRender: { type: Function, required: !0 },
|
|
@@ -91,356 +91,356 @@ const Le = /* @__PURE__ */ oe({
|
|
|
91
91
|
},
|
|
92
92
|
setup(o) {
|
|
93
93
|
return () => {
|
|
94
|
-
const s = o.slotRender,
|
|
95
|
-
if (((G) => G == null ? [] : Array.isArray(G) ? G.filter((te) => te != null && te !== !1 && !te.isComment) : [G])(
|
|
96
|
-
return
|
|
97
|
-
const
|
|
98
|
-
return o.customRender && (
|
|
94
|
+
const s = o.slotRender, _ = s == null ? void 0 : s({ column: o.column, record: o.record, index: o.index, value: o.value });
|
|
95
|
+
if (((G) => G == null ? [] : Array.isArray(G) ? G.filter((te) => te != null && te !== !1 && !te.isComment) : [G])(_).length > 0)
|
|
96
|
+
return _;
|
|
97
|
+
const I = { ...o.column };
|
|
98
|
+
return o.customRender && (I.customRender = o.customRender), o.valueEnum && (I.valueEnum = o.valueEnum), ue(n, { props: { column: I, record: o.record, index: o.index, value: o.value } });
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
}), a =
|
|
101
|
+
}), a = Se(), f = k(), r = k(), C = k(0), O = k(t.loading ?? !1), v = k([]), m = k({}), d = k([]), B = k({}), y = k([]), D = k(null), z = k({
|
|
102
102
|
page: 1,
|
|
103
103
|
pageSize: t.pagination && typeof t.pagination == "object" ? t.pagination.pageSize ?? 10 : 10,
|
|
104
104
|
pageSizes: t.pagination && typeof t.pagination == "object" ? t.pagination.pageSizes ?? [10, 20, 50, 100] : [10, 20, 50, 100],
|
|
105
105
|
total: 0
|
|
106
|
-
}), { getSetting:
|
|
107
|
-
() =>
|
|
108
|
-
),
|
|
109
|
-
var s,
|
|
106
|
+
}), { getSetting: g } = Re(), h = S(() => ({ ...g("ProTable"), ...t, ...B.value })), W = S(() => !!h.value.title || !!a.tableTitle || !!a.toolbar), b = S(() => D.value !== null ? D.value : !!t.pagination && typeof t.pagination == "object"), M = S(() => h.value.rowKey || "id"), j = S(() => new Set(y.value.map((o) => o[M.value]))), F = S(
|
|
107
|
+
() => d.value.filter((o) => !o.hideInTable && !o.defaultHidden)
|
|
108
|
+
), N = S(() => {
|
|
109
|
+
var s, _;
|
|
110
110
|
let o = 0;
|
|
111
|
-
return
|
|
112
|
-
}),
|
|
111
|
+
return h.value.rowSelection && (o += Number(h.value.rowSelection.width) || 48), h.value.showIndexColumn && (o += Number((s = h.value.indexColumnProps) == null ? void 0 : s.width) || 60), h.value.actionColumn && (o += Number((_ = h.value.actionColumn) == null ? void 0 : _.width) || 150), o;
|
|
112
|
+
}), L = (o) => typeof o == "number" && o > 0, Z = S(() => F.value.filter((s) => Q(s) && L(s.width)).reduce((s, _) => s + (typeof _.width == "number" ? _.width : 0), 0)), ee = S(() => F.value.filter((s) => Q(s) && typeof s.width == "string").reduce((s, _) => s + (Number(q(_)) || 80), 0)), H = (o) => o == null ? null : typeof o == "number" ? o : parseInt(String(o).replace(/px$/i, ""), 10) || null, q = (o) => {
|
|
113
113
|
const s = o.width;
|
|
114
|
-
if (
|
|
115
|
-
const
|
|
116
|
-
let P = Math.floor(
|
|
117
|
-
const
|
|
118
|
-
return P = Math.max(
|
|
114
|
+
if (L(s) && Z.value > 0 && C.value > 0 && typeof s == "number") {
|
|
115
|
+
const _ = C.value - N.value - ee.value;
|
|
116
|
+
let P = Math.floor(_ * s / Z.value);
|
|
117
|
+
const E = H(o.minWidth) ?? 60, I = H(o.maxWidth);
|
|
118
|
+
return P = Math.max(E, P), I != null && (P = Math.min(I, P)), P;
|
|
119
119
|
}
|
|
120
120
|
if (typeof s == "string") {
|
|
121
|
-
const
|
|
122
|
-
let
|
|
123
|
-
return P != null && (
|
|
121
|
+
const _ = H(s) ?? 80, P = H(o.minWidth), E = H(o.maxWidth);
|
|
122
|
+
let I = _;
|
|
123
|
+
return P != null && (I = Math.max(P, I)), E != null && (I = Math.min(E, I)), I;
|
|
124
124
|
}
|
|
125
125
|
return o.width;
|
|
126
|
-
}, Q = (o) => o.ifShow === !1 ? !1 : typeof o.ifShow == "function" ? o.ifShow({ column: o }) : !0, U =
|
|
126
|
+
}, Q = (o) => o.ifShow === !1 ? !1 : typeof o.ifShow == "function" ? o.ifShow({ column: o }) : !0, U = S(() => {
|
|
127
127
|
var s;
|
|
128
|
-
const o = (s =
|
|
129
|
-
return o ?
|
|
128
|
+
const o = (s = h.value.rowSelection) == null ? void 0 : s.getCheckboxProps;
|
|
129
|
+
return o ? v.value.filter((_) => {
|
|
130
130
|
var P;
|
|
131
|
-
return !((P = o(
|
|
132
|
-
}) :
|
|
133
|
-
}), Y =
|
|
134
|
-
const o = U.value.filter((s) => j.value.has(s[
|
|
131
|
+
return !((P = o(_)) != null && P.disabled);
|
|
132
|
+
}) : v.value;
|
|
133
|
+
}), Y = S(() => U.value.length > 0), re = S(() => U.value.length === 0 ? !1 : U.value.every((o) => j.value.has(o[M.value]))), p = S(() => {
|
|
134
|
+
const o = U.value.filter((s) => j.value.has(s[M.value])).length;
|
|
135
135
|
return o > 0 && o < U.value.length;
|
|
136
|
-
}),
|
|
137
|
-
var s,
|
|
138
|
-
return ((P = (
|
|
139
|
-
},
|
|
140
|
-
var s,
|
|
141
|
-
return ((P = (
|
|
142
|
-
},
|
|
143
|
-
const o =
|
|
144
|
-
l("selection-change", { keys: o, rows:
|
|
145
|
-
},
|
|
146
|
-
const
|
|
147
|
-
s ?
|
|
136
|
+
}), $ = (o) => j.value.has(o[M.value]), T = (o) => {
|
|
137
|
+
var s, _, P;
|
|
138
|
+
return ((P = (_ = (s = h.value.rowSelection) == null ? void 0 : s.getCheckboxProps) == null ? void 0 : _.call(s, o)) == null ? void 0 : P.disabled) ?? !1;
|
|
139
|
+
}, V = (o) => {
|
|
140
|
+
var s, _, P;
|
|
141
|
+
return ((P = (_ = (s = h.value.rowSelection) == null ? void 0 : s.getRadioProps) == null ? void 0 : _.call(s, o)) == null ? void 0 : P.disabled) ?? !1;
|
|
142
|
+
}, K = () => {
|
|
143
|
+
const o = y.value.map((s) => s[M.value]);
|
|
144
|
+
l("selection-change", { keys: o, rows: y.value });
|
|
145
|
+
}, X = (o, s) => {
|
|
146
|
+
const _ = o[M.value];
|
|
147
|
+
s ? y.value = [...y.value.filter((P) => P[M.value] !== _), o] : y.value = y.value.filter((P) => P[M.value] !== _), K();
|
|
148
148
|
}, ne = (o) => {
|
|
149
|
-
|
|
149
|
+
y.value = [o], K();
|
|
150
150
|
}, ae = (o) => {
|
|
151
151
|
if (o) {
|
|
152
|
-
const s = new Set(
|
|
153
|
-
|
|
152
|
+
const s = new Set(y.value.map((P) => P[M.value])), _ = U.value.filter((P) => !s.has(P[M.value]));
|
|
153
|
+
y.value = [...y.value, ..._];
|
|
154
154
|
} else {
|
|
155
|
-
const s = new Set(
|
|
156
|
-
|
|
155
|
+
const s = new Set(v.value.map((_) => _[M.value]));
|
|
156
|
+
y.value = y.value.filter((_) => !s.has(_[M.value]));
|
|
157
157
|
}
|
|
158
|
-
|
|
158
|
+
K();
|
|
159
159
|
}, le = async (o) => {
|
|
160
160
|
if (!t.api) {
|
|
161
161
|
if (t.dataSource)
|
|
162
162
|
return;
|
|
163
|
-
|
|
163
|
+
v.value = [];
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
|
-
|
|
166
|
+
O.value = !0;
|
|
167
167
|
try {
|
|
168
|
-
const s =
|
|
169
|
-
[
|
|
168
|
+
const s = h.value.fetchSetting ?? {}, _ = s.pageField ?? "page", P = s.sizeField ?? "pageSize", E = s.listField ?? "list", I = s.totalField ?? "total", G = {
|
|
169
|
+
[_]: (o == null ? void 0 : o.page) ?? z.value.page,
|
|
170
170
|
[P]: (o == null ? void 0 : o.pageSize) ?? z.value.pageSize,
|
|
171
171
|
...t.searchInfo,
|
|
172
172
|
...o == null ? void 0 : o.searchInfo
|
|
173
173
|
};
|
|
174
174
|
(o == null ? void 0 : o.page) != null && (z.value.page = o.page), (o == null ? void 0 : o.pageSize) != null && (z.value.pageSize = o.pageSize);
|
|
175
175
|
const te = t.beforeFetch ? t.beforeFetch(G) : G, Ce = await t.api(te);
|
|
176
|
-
|
|
177
|
-
const ye = t.afterFetch ? t.afterFetch(Ce) : Ce,
|
|
178
|
-
|
|
176
|
+
m.value = Ce || {};
|
|
177
|
+
const ye = t.afterFetch ? t.afterFetch(Ce) : Ce, Me = ye[E] ?? ye.items ?? ye.list ?? [], Te = ye[I] ?? 0;
|
|
178
|
+
v.value = Me, z.value.total = Te, l("fetch-success", { items: Me, total: Te });
|
|
179
179
|
} catch (s) {
|
|
180
180
|
l("fetch-error", s);
|
|
181
181
|
} finally {
|
|
182
|
-
|
|
182
|
+
O.value = !1;
|
|
183
183
|
}
|
|
184
184
|
}, ie = () => le(void 0), me = (o) => {
|
|
185
|
-
|
|
185
|
+
h.value.clearSelectOnPageChange && (y.value = []), z.value.pageSize = o, z.value.page = 1, le(void 0);
|
|
186
186
|
}, he = (o) => {
|
|
187
|
-
|
|
188
|
-
}, _e = (o, s,
|
|
187
|
+
h.value.clearSelectOnPageChange && (y.value = []), z.value.page = o, le(void 0);
|
|
188
|
+
}, _e = (o, s, _) => l("row-click", o, _), be = (o, s, _) => l("row-dblclick", o, _), ge = ({ prop: o, order: s }) => l("sort-change", { prop: o, order: s }), pe = (o, s) => l("expand-change", o, s), de = (o) => v.value.findIndex((s) => s[M.value] === o), ce = {
|
|
189
189
|
setProps: (o) => {
|
|
190
|
-
|
|
190
|
+
B.value = { ...B.value, ...o };
|
|
191
191
|
},
|
|
192
192
|
reload: (o) => le(o),
|
|
193
193
|
redoHeight: () => {
|
|
194
194
|
var o, s;
|
|
195
|
-
(s = (o =
|
|
195
|
+
(s = (o = f.value) == null ? void 0 : o.doLayout) == null || s.call(o);
|
|
196
196
|
},
|
|
197
197
|
setLoading: (o) => {
|
|
198
|
-
|
|
198
|
+
O.value = o;
|
|
199
199
|
},
|
|
200
|
-
getDataSource: () =>
|
|
201
|
-
getRawDataSource: () =>
|
|
200
|
+
getDataSource: () => v.value,
|
|
201
|
+
getRawDataSource: () => m.value,
|
|
202
202
|
setTableData: (o) => {
|
|
203
|
-
|
|
203
|
+
v.value = o ?? [];
|
|
204
204
|
},
|
|
205
|
-
getColumns: () =>
|
|
205
|
+
getColumns: () => d.value,
|
|
206
206
|
setColumns: (o) => {
|
|
207
207
|
if (Array.isArray(o) && o.length > 0 && typeof o[0] == "string") {
|
|
208
|
-
const s = o,
|
|
209
|
-
P.length && (
|
|
208
|
+
const s = o, _ = (t.columns ?? []).filter((E) => s.includes(E.key ?? E.dataIndex)), P = s.map((E) => _.find((I) => (I.key ?? I.dataIndex) === E)).filter(Boolean);
|
|
209
|
+
P.length && (d.value = P);
|
|
210
210
|
} else
|
|
211
|
-
|
|
211
|
+
d.value = o ?? [];
|
|
212
212
|
},
|
|
213
213
|
setPagination: (o) => {
|
|
214
214
|
o != null && o.page && (z.value.page = o.page), o != null && o.pageSize && (z.value.pageSize = o.pageSize), (o == null ? void 0 : o.total) !== void 0 && (z.value.total = o.total);
|
|
215
215
|
},
|
|
216
|
-
getSelectRowKeys: () =>
|
|
217
|
-
getSelectRows: () =>
|
|
216
|
+
getSelectRowKeys: () => y.value.map((o) => o[M.value]),
|
|
217
|
+
getSelectRows: () => y.value,
|
|
218
218
|
clearSelectedRowKeys: () => {
|
|
219
|
-
|
|
219
|
+
y.value = [], K();
|
|
220
220
|
},
|
|
221
221
|
setSelectedRowKeys: (o) => {
|
|
222
|
-
const s = new Set(o),
|
|
222
|
+
const s = new Set(o), _ = v.value.filter((P) => s.has(P[M.value]));
|
|
223
223
|
o.forEach((P) => {
|
|
224
|
-
|
|
225
|
-
}),
|
|
224
|
+
_.some((E) => E[M.value] === P) || _.push({ [M.value]: P });
|
|
225
|
+
}), y.value = _, K();
|
|
226
226
|
},
|
|
227
227
|
deleteSelectRowByKey: (o) => {
|
|
228
|
-
|
|
228
|
+
y.value = y.value.filter((s) => s[M.value] !== o), K();
|
|
229
229
|
},
|
|
230
|
-
updateTableData: (o, s,
|
|
231
|
-
o < 0 || o >=
|
|
230
|
+
updateTableData: (o, s, _) => {
|
|
231
|
+
o < 0 || o >= v.value.length || (v.value = [...v.value], v.value[o] = { ...v.value[o], [s]: _ });
|
|
232
232
|
},
|
|
233
233
|
updateTableDataRecord: (o, s) => {
|
|
234
|
-
const
|
|
235
|
-
if (!(
|
|
236
|
-
return
|
|
234
|
+
const _ = de(o);
|
|
235
|
+
if (!(_ < 0))
|
|
236
|
+
return v.value = [...v.value], v.value[_] = { ...v.value[_], ...s }, v.value[_];
|
|
237
237
|
},
|
|
238
238
|
deleteTableDataRecord: (o) => {
|
|
239
|
-
const s = Array.isArray(o) ? o : [o],
|
|
240
|
-
|
|
239
|
+
const s = Array.isArray(o) ? o : [o], _ = new Set(s);
|
|
240
|
+
v.value = v.value.filter((P) => !_.has(P[M.value]));
|
|
241
241
|
},
|
|
242
242
|
insertTableDataRecord: (o, s) => {
|
|
243
|
-
const
|
|
244
|
-
return s == null || s >=
|
|
243
|
+
const _ = [...v.value];
|
|
244
|
+
return s == null || s >= _.length ? _.push(o) : _.splice(s, 0, o), v.value = _, o;
|
|
245
245
|
},
|
|
246
|
-
getPaginationRef: () =>
|
|
247
|
-
getShowPagination: () =>
|
|
246
|
+
getPaginationRef: () => b.value ? { page: z.value.page, pageSize: Number(z.value.pageSize) || 10, total: z.value.total } : !1,
|
|
247
|
+
getShowPagination: () => b.value,
|
|
248
248
|
setShowPagination: (o) => {
|
|
249
|
-
|
|
249
|
+
D.value = o;
|
|
250
250
|
},
|
|
251
|
-
getRowSelection: () =>
|
|
251
|
+
getRowSelection: () => h.value.rowSelection,
|
|
252
252
|
expandAll: () => {
|
|
253
253
|
var P;
|
|
254
|
-
const o = ((P =
|
|
255
|
-
const
|
|
256
|
-
return
|
|
257
|
-
|
|
254
|
+
const o = ((P = h.value.treeProps) == null ? void 0 : P.children) ?? "children", s = (E) => {
|
|
255
|
+
const I = [];
|
|
256
|
+
return E.forEach((G) => {
|
|
257
|
+
I.push(G);
|
|
258
258
|
const te = G[o];
|
|
259
|
-
Array.isArray(te) && te.length > 0 &&
|
|
260
|
-
}),
|
|
259
|
+
Array.isArray(te) && te.length > 0 && I.push(...s(te));
|
|
260
|
+
}), I;
|
|
261
261
|
};
|
|
262
|
-
s(
|
|
263
|
-
var
|
|
264
|
-
return (G = (
|
|
262
|
+
s(v.value).forEach((E) => {
|
|
263
|
+
var I, G;
|
|
264
|
+
return (G = (I = f.value) == null ? void 0 : I.toggleRowExpansion) == null ? void 0 : G.call(I, E, !0);
|
|
265
265
|
});
|
|
266
266
|
},
|
|
267
267
|
collapseAll: () => {
|
|
268
268
|
var P;
|
|
269
|
-
const o = ((P =
|
|
270
|
-
const
|
|
271
|
-
return
|
|
272
|
-
|
|
269
|
+
const o = ((P = h.value.treeProps) == null ? void 0 : P.children) ?? "children", s = (E) => {
|
|
270
|
+
const I = [];
|
|
271
|
+
return E.forEach((G) => {
|
|
272
|
+
I.push(G);
|
|
273
273
|
const te = G[o];
|
|
274
|
-
Array.isArray(te) && te.length > 0 &&
|
|
275
|
-
}),
|
|
274
|
+
Array.isArray(te) && te.length > 0 && I.push(...s(te));
|
|
275
|
+
}), I;
|
|
276
276
|
};
|
|
277
|
-
s(
|
|
278
|
-
var
|
|
279
|
-
return (G = (
|
|
277
|
+
s(v.value).forEach((E) => {
|
|
278
|
+
var I, G;
|
|
279
|
+
return (G = (I = f.value) == null ? void 0 : I.toggleRowExpansion) == null ? void 0 : G.call(I, E, !1);
|
|
280
280
|
});
|
|
281
281
|
}
|
|
282
282
|
};
|
|
283
283
|
e(ce);
|
|
284
|
-
const
|
|
285
|
-
|
|
286
|
-
},
|
|
287
|
-
t.api &&
|
|
284
|
+
const c = () => {
|
|
285
|
+
d.value = [...t.columns ?? []];
|
|
286
|
+
}, w = () => {
|
|
287
|
+
t.api && h.value.immediate !== !1 ? le(void 0) : t.dataSource && (v.value = [...t.dataSource], !t.api && t.pagination !== !1 && (z.value.total = t.dataSource.length));
|
|
288
288
|
}, R = () => {
|
|
289
|
-
r.value && (
|
|
289
|
+
r.value && (C.value = r.value.offsetWidth || 0);
|
|
290
290
|
};
|
|
291
|
-
let
|
|
291
|
+
let A = null, x = null;
|
|
292
292
|
return ve(() => {
|
|
293
|
-
|
|
294
|
-
R(),
|
|
293
|
+
c(), l("register", ce), w(), typeof window < "u" && (window.addEventListener("resize", R), A = new ResizeObserver(R), Oe(() => {
|
|
294
|
+
R(), x = r.value, x && (A == null || A.observe(x));
|
|
295
295
|
}));
|
|
296
|
-
}),
|
|
297
|
-
typeof window < "u" && (window.removeEventListener("resize", R),
|
|
298
|
-
}),
|
|
299
|
-
!t.api && t.dataSource && (
|
|
300
|
-
}, { deep: !0 }),
|
|
301
|
-
|
|
302
|
-
}), { __sfc: !0, DefaultCellRenderer: n, BodyCellRenderer:
|
|
296
|
+
}), Fe(() => {
|
|
297
|
+
typeof window < "u" && (window.removeEventListener("resize", R), A && x && (A.unobserve(x), x = null));
|
|
298
|
+
}), J(() => t.columns, c, { deep: !0 }), J(() => t.dataSource, () => {
|
|
299
|
+
!t.api && t.dataSource && (v.value = [...t.dataSource]);
|
|
300
|
+
}, { deep: !0 }), J(() => t.loading, (o) => {
|
|
301
|
+
O.value = o ?? !1;
|
|
302
|
+
}), { __sfc: !0, DefaultCellRenderer: n, BodyCellRenderer: u, props: t, emit: l, slots: a, tableRef: f, tableWrapRef: r, containerWidth: C, loading: O, innerData: v, rawDataSource: m, innerColumns: d, innerProps: B, selectedRows: y, showPaginationRef: D, pagination: z, getComponentSetting: g, effectiveProps: h, showTitleBar: W, showPagination: b, rowKeyField: M, selectedKeysSet: j, displayColumns: F, fixedColumnsWidth: N, isRatioWidth: L, totalRatio: Z, fixedDataColumnsWidth: ee, parseWidthPx: H, getColumnWidth: q, shouldShowColumn: Q, selectableRows: U, hasSelectableRows: Y, isAllCurrentPageSelected: re, isIndeterminate: p, isRowSelected: $, getCheckboxDisabled: T, getRadioDisabled: V, emitSelectionChange: K, handleCheckboxChange: X, handleRadioSelect: ne, handleSelectAll: ae, fetchData: le, handleReload: ie, handleSizeChange: me, handleCurrentChange: he, handleRowClick: _e, handleRowDblclick: be, handleSortChange: ge, handleExpandChange: pe, findRowIndex: de, tableAction: ce, syncColumns: c, loadData: w, updateContainerWidth: R, resizeObserver: A, observedEl: x };
|
|
303
303
|
}
|
|
304
304
|
});
|
|
305
|
-
function
|
|
306
|
-
var r = typeof
|
|
307
|
-
e && (r.render = e, r.staticRenderFns = l, r._compiled = !0), t && (r.functional = !0),
|
|
308
|
-
var
|
|
309
|
-
if (a ? (
|
|
310
|
-
|
|
305
|
+
function se(i, e, l, t, n, u, a, f) {
|
|
306
|
+
var r = typeof i == "function" ? i.options : i;
|
|
307
|
+
e && (r.render = e, r.staticRenderFns = l, r._compiled = !0), t && (r.functional = !0), u && (r._scopeId = "data-v-" + u);
|
|
308
|
+
var C;
|
|
309
|
+
if (a ? (C = function(m) {
|
|
310
|
+
m = m || // cached call
|
|
311
311
|
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
312
|
-
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !
|
|
313
|
-
}, r._ssrRegister =
|
|
312
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !m && typeof __VUE_SSR_CONTEXT__ < "u" && (m = __VUE_SSR_CONTEXT__), n && n.call(this, m), m && m._registeredComponents && m._registeredComponents.add(a);
|
|
313
|
+
}, r._ssrRegister = C) : n && (C = f ? function() {
|
|
314
314
|
n.call(
|
|
315
315
|
this,
|
|
316
316
|
(r.functional ? this.parent : this).$root.$options.shadowRoot
|
|
317
317
|
);
|
|
318
|
-
} : n),
|
|
318
|
+
} : n), C)
|
|
319
319
|
if (r.functional) {
|
|
320
|
-
r._injectStyles =
|
|
321
|
-
var
|
|
322
|
-
r.render = function(
|
|
323
|
-
return
|
|
320
|
+
r._injectStyles = C;
|
|
321
|
+
var O = r.render;
|
|
322
|
+
r.render = function(d, B) {
|
|
323
|
+
return C.call(B), O(d, B);
|
|
324
324
|
};
|
|
325
325
|
} else {
|
|
326
|
-
var
|
|
327
|
-
r.beforeCreate =
|
|
326
|
+
var v = r.beforeCreate;
|
|
327
|
+
r.beforeCreate = v ? [].concat(v, C) : [C];
|
|
328
328
|
}
|
|
329
329
|
return {
|
|
330
|
-
exports:
|
|
330
|
+
exports: i,
|
|
331
331
|
options: r
|
|
332
332
|
};
|
|
333
333
|
}
|
|
334
|
-
var
|
|
335
|
-
var n,
|
|
334
|
+
var Ge = function() {
|
|
335
|
+
var n, u, a, f;
|
|
336
336
|
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
337
|
-
return l("div", { staticClass: "ecp-pro-table" }, [t.showTitleBar ? l("div", { staticClass: "ecp-pro-table__header" }, [l("div", { staticClass: "ecp-pro-table__title-wrapper" }, [l("span", { staticClass: "ecp-pro-table__title" }, [e._v(e._s(t.effectiveProps.title))]), t.effectiveProps.titleHelpMessage ? l("el-tooltip", { staticClass: "ecp-pro-table__help", attrs: { placement: "top" } }, [l("template", { slot: "content" }, [Array.isArray(t.effectiveProps.titleHelpMessage) ? l("span", e._l(t.effectiveProps.titleHelpMessage, function(r,
|
|
338
|
-
return l("div", { key:
|
|
337
|
+
return l("div", { staticClass: "ecp-pro-table" }, [t.showTitleBar ? l("div", { staticClass: "ecp-pro-table__header" }, [l("div", { staticClass: "ecp-pro-table__title-wrapper" }, [l("span", { staticClass: "ecp-pro-table__title" }, [e._v(e._s(t.effectiveProps.title))]), t.effectiveProps.titleHelpMessage ? l("el-tooltip", { staticClass: "ecp-pro-table__help", attrs: { placement: "top" } }, [l("template", { slot: "content" }, [Array.isArray(t.effectiveProps.titleHelpMessage) ? l("span", e._l(t.effectiveProps.titleHelpMessage, function(r, C) {
|
|
338
|
+
return l("div", { key: C }, [e._v(e._s(r))]);
|
|
339
339
|
}), 0) : l("span", [e._v(e._s(t.effectiveProps.titleHelpMessage))])]), l("i", { staticClass: "el-icon-question" })], 2) : e._e()], 1), l("div", { staticClass: "ecp-pro-table__toolbar" }, [e._t("tableTitle"), e._t("toolbar"), e._t("toolbar-right", function() {
|
|
340
340
|
var r;
|
|
341
341
|
return [((r = t.effectiveProps.tableSetting) == null ? void 0 : r.redo) !== !1 ? l("el-button", { attrs: { type: "text", icon: "el-icon-refresh", size: "small" }, on: { click: t.handleReload } }, [e._v(" 刷新 ")]) : e._e()];
|
|
342
342
|
})], 2)]) : e._e(), l("div", { directives: [{ name: "loading", rawName: "v-loading", value: t.loading, expression: "loading" }], ref: "tableWrapRef", staticClass: "ecp-pro-table__body" }, [l("el-table", e._b({ ref: "tableRef", attrs: { data: t.innerData, "row-key": t.effectiveProps.rowKey, border: t.effectiveProps.bordered, stripe: t.effectiveProps.striped, size: t.effectiveProps.size, "max-height": t.effectiveProps.maxHeight, height: t.effectiveProps.height, "default-sort": t.effectiveProps.defaultSort, "span-method": t.effectiveProps.spanMethod, "tree-props": t.effectiveProps.treeProps, "default-expand-all": t.effectiveProps.defaultExpandAll, "expand-row-keys": t.effectiveProps.expandRowKeys || [], lazy: t.effectiveProps.lazy, load: t.effectiveProps.load, "row-class-name": t.effectiveProps.rowClassName }, on: { "row-click": t.handleRowClick, "row-dblclick": t.handleRowDblclick, "sort-change": t.handleSortChange, "expand-change": t.handleExpandChange } }, "el-table", t.effectiveProps.tableProps, !1), [t.effectiveProps.rowSelection ? l("el-table-column", { attrs: { width: t.effectiveProps.rowSelection.width || 48, fixed: t.effectiveProps.rowSelection.fixed, align: "center" }, scopedSlots: e._u([{ key: "header", fn: function(r) {
|
|
343
343
|
return [t.effectiveProps.rowSelection.type !== "radio" ? l("el-checkbox", { attrs: { value: t.isAllCurrentPageSelected, indeterminate: t.isIndeterminate, disabled: !t.hasSelectableRows }, on: { change: t.handleSelectAll } }) : l("span")];
|
|
344
344
|
} }, { key: "default", fn: function(r) {
|
|
345
|
-
var
|
|
346
|
-
return [t.effectiveProps.rowSelection.type !== "radio" ? l("el-checkbox", { attrs: { value: t.isRowSelected(r.row), disabled: t.getCheckboxDisabled(r.row) }, on: { change: (
|
|
347
|
-
|
|
348
|
-
} } }) : l("el-radio", { attrs: { value: (
|
|
345
|
+
var C;
|
|
346
|
+
return [t.effectiveProps.rowSelection.type !== "radio" ? l("el-checkbox", { attrs: { value: t.isRowSelected(r.row), disabled: t.getCheckboxDisabled(r.row) }, on: { change: (O) => t.handleCheckboxChange(r.row, O) }, nativeOn: { click: function(O) {
|
|
347
|
+
O.stopPropagation();
|
|
348
|
+
} } }) : l("el-radio", { attrs: { value: (C = t.selectedRows[0]) == null ? void 0 : C[t.rowKeyField], label: r.row[t.rowKeyField], disabled: t.getRadioDisabled(r.row) }, on: { change: function(O) {
|
|
349
349
|
return t.handleRadioSelect(r.row);
|
|
350
|
-
} }, nativeOn: { click: function(
|
|
351
|
-
|
|
350
|
+
} }, nativeOn: { click: function(O) {
|
|
351
|
+
O.stopPropagation();
|
|
352
352
|
} } }, [l("span")])];
|
|
353
|
-
} }], null, !1, 983730649) }) : e._e(), t.effectiveProps.showIndexColumn ? l("el-table-column", { attrs: { type: "index", label: ((n = t.effectiveProps.indexColumnProps) == null ? void 0 : n.title) || "序号", width: ((
|
|
354
|
-
return [t.shouldShowColumn(r) ? l("el-table-column", { key: r.dataIndex || r.key || r.title, attrs: { prop: r.dataIndex, label: r.title, width: t.getColumnWidth(r), "min-width": t.isRatioWidth(r.width) ? void 0 : r.minWidth, fixed: r.fixed, align: r.align || "left", sortable: r.sortable, formatter: r.formatter, "show-overflow-tooltip": r.ellipsis !== !1 && t.effectiveProps.ellipsis !== !1 }, scopedSlots: e._u([{ key: "header", fn: function(
|
|
355
|
-
return [r.dataIndex && e.$scopedSlots[`header-${r.dataIndex}`] ? e._t(`header-${r.dataIndex}`, null, { column: r }) : e.$scopedSlots.headerCell ? e._t("headerCell", null, { column: r }) : [l("span", [e._v(e._s(r.title))]), r.helpMessage ? l("el-tooltip", { staticClass: "ecp-pro-table__col-help", attrs: { placement: "top", effect: "dark" } }, [l("template", { slot: "content" }, [Array.isArray(r.helpMessage) ? l("span", e._l(r.helpMessage, function(
|
|
356
|
-
return l("div", { key:
|
|
353
|
+
} }], null, !1, 983730649) }) : e._e(), t.effectiveProps.showIndexColumn ? l("el-table-column", { attrs: { type: "index", label: ((n = t.effectiveProps.indexColumnProps) == null ? void 0 : n.title) || "序号", width: ((u = t.effectiveProps.indexColumnProps) == null ? void 0 : u.width) || 60, fixed: (a = t.effectiveProps.indexColumnProps) == null ? void 0 : a.fixed, align: ((f = t.effectiveProps.indexColumnProps) == null ? void 0 : f.align) || "center" } }) : e._e(), e._l(t.displayColumns, function(r) {
|
|
354
|
+
return [t.shouldShowColumn(r) ? l("el-table-column", { key: r.dataIndex || r.key || r.title, attrs: { prop: r.dataIndex, label: r.title, width: t.getColumnWidth(r), "min-width": t.isRatioWidth(r.width) ? void 0 : r.minWidth, fixed: r.fixed, align: r.align || "left", sortable: r.sortable, formatter: r.formatter, "show-overflow-tooltip": r.ellipsis !== !1 && t.effectiveProps.ellipsis !== !1 }, scopedSlots: e._u([{ key: "header", fn: function(C) {
|
|
355
|
+
return [r.dataIndex && e.$scopedSlots[`header-${r.dataIndex}`] ? e._t(`header-${r.dataIndex}`, null, { column: r }) : e.$scopedSlots.headerCell ? e._t("headerCell", null, { column: r }) : [l("span", [e._v(e._s(r.title))]), r.helpMessage ? l("el-tooltip", { staticClass: "ecp-pro-table__col-help", attrs: { placement: "top", effect: "dark" } }, [l("template", { slot: "content" }, [Array.isArray(r.helpMessage) ? l("span", e._l(r.helpMessage, function(O, v) {
|
|
356
|
+
return l("div", { key: v }, [e._v(e._s(O))]);
|
|
357
357
|
}), 0) : l("span", [e._v(e._s(r.helpMessage))])]), l("i", { staticClass: "el-icon-question" })], 2) : e._e()]];
|
|
358
|
-
} }, { key: "default", fn: function(
|
|
359
|
-
return [r.dataIndex && e.$scopedSlots[r.dataIndex] ? e._t(r.dataIndex, null, { row:
|
|
358
|
+
} }, { key: "default", fn: function(C) {
|
|
359
|
+
return [r.dataIndex && e.$scopedSlots[r.dataIndex] ? e._t(r.dataIndex, null, { row: C.row, column: r, index: C.$index, value: C.row[r.dataIndex] }) : e.$scopedSlots.bodyCell ? l(t.BodyCellRenderer, { attrs: { "slot-render": e.$scopedSlots.bodyCell, column: r, record: C.row, index: C.$index, value: C.row[r.dataIndex], "custom-render": r.customRender, "value-enum": r.valueEnum } }) : l(t.DefaultCellRenderer, { attrs: { column: r, record: C.row, index: C.$index, value: C.row[r.dataIndex] } })];
|
|
360
360
|
} }], null, !0) }) : e._e()];
|
|
361
361
|
}), t.effectiveProps.actionColumn ? l("el-table-column", { attrs: { label: t.effectiveProps.actionColumn.title || "操作", width: t.effectiveProps.actionColumn.width || 150, fixed: t.effectiveProps.actionColumn.fixed || "right", align: t.effectiveProps.actionColumn.align || "center" }, scopedSlots: e._u([{ key: "default", fn: function(r) {
|
|
362
362
|
return [e.$scopedSlots.action ? e._t("action", null, { record: r.row, column: t.effectiveProps.actionColumn, index: r.$index }) : e.$scopedSlots.bodyCell ? l(t.BodyCellRenderer, { attrs: { "slot-render": e.$scopedSlots.bodyCell, column: t.effectiveProps.actionColumn, record: r.row, index: r.$index, value: void 0, "custom-render": t.effectiveProps.actionColumn.customRender, "value-enum": t.effectiveProps.actionColumn.valueEnum } }) : e._e()];
|
|
363
363
|
} }], null, !0) }) : e._e()], 2)], 1), t.showPagination ? l("div", { staticClass: "ecp-pro-table__pagination" }, [l("el-pagination", e._b({ attrs: { "current-page": t.pagination.page, "page-sizes": t.pagination.pageSizes, "page-size": t.pagination.pageSize, total: t.pagination.total, 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()]);
|
|
364
|
-
},
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
364
|
+
}, Ue = [], Je = /* @__PURE__ */ se(
|
|
365
|
+
He,
|
|
366
|
+
Ge,
|
|
367
|
+
Ue,
|
|
368
368
|
!1,
|
|
369
369
|
null,
|
|
370
370
|
"c5638c20",
|
|
371
371
|
null,
|
|
372
372
|
null
|
|
373
373
|
);
|
|
374
|
-
const
|
|
375
|
-
if (!
|
|
374
|
+
const Ee = Je.exports, ke = (i) => Array.isArray(i) ? i.length > 0 : i != null && String(i).trim() !== "", De = (i) => Array.isArray(i) ? i.map((e) => String(e)).join(", ") : i == null ? "" : typeof i == "object" ? JSON.stringify(i) : String(i), Be = (i, e) => {
|
|
375
|
+
if (!i)
|
|
376
376
|
return null;
|
|
377
|
-
if (
|
|
377
|
+
if (i === !0)
|
|
378
378
|
return {
|
|
379
|
-
content:
|
|
379
|
+
content: De(e),
|
|
380
380
|
placement: "top",
|
|
381
381
|
effect: "dark",
|
|
382
|
-
disabled: !
|
|
382
|
+
disabled: !ke(e)
|
|
383
383
|
};
|
|
384
|
-
if (typeof
|
|
384
|
+
if (typeof i == "string")
|
|
385
385
|
return {
|
|
386
|
-
content:
|
|
386
|
+
content: i,
|
|
387
387
|
placement: "top",
|
|
388
388
|
effect: "dark"
|
|
389
389
|
};
|
|
390
|
-
const l = { ...
|
|
391
|
-
return Object.prototype.hasOwnProperty.call(l, "content") || (l.content =
|
|
392
|
-
},
|
|
390
|
+
const l = { ...i };
|
|
391
|
+
return Object.prototype.hasOwnProperty.call(l, "content") || (l.content = De(e)), Object.prototype.hasOwnProperty.call(l, "placement") || (l.placement = "top"), Object.prototype.hasOwnProperty.call(l, "effect") || (l.effect = "dark"), Object.prototype.hasOwnProperty.call(l, "disabled") || (l.disabled = !ke(l.content)), l;
|
|
392
|
+
}, Xe = /* @__PURE__ */ oe({
|
|
393
393
|
__name: "TableAction",
|
|
394
394
|
props: {
|
|
395
395
|
actions: { default: () => [] },
|
|
396
396
|
dropDownActions: { default: () => [] },
|
|
397
397
|
stopButtonPropagation: { type: Boolean, default: !1 }
|
|
398
398
|
},
|
|
399
|
-
setup(
|
|
400
|
-
const e =
|
|
401
|
-
const { ifShow:
|
|
402
|
-
return typeof
|
|
403
|
-
}),
|
|
404
|
-
var
|
|
405
|
-
e.stopButtonPropagation &&
|
|
406
|
-
}, r = (
|
|
407
|
-
|
|
408
|
-
},
|
|
409
|
-
var
|
|
410
|
-
e.stopButtonPropagation &&
|
|
399
|
+
setup(i) {
|
|
400
|
+
const e = i, l = (d) => Be(d) || {}, t = (d) => d.type ? d.type : d.color === "error" ? "danger" : d.color === "success" ? "success" : d.color === "warning" ? "warning" : "text", n = (d) => d.filter((B) => {
|
|
401
|
+
const { ifShow: y } = B;
|
|
402
|
+
return typeof y == "boolean" ? y : typeof y == "function" ? y(B) : !0;
|
|
403
|
+
}), u = S(() => n(e.actions || [])), a = S(() => n(e.dropDownActions || [])), f = (d, B) => {
|
|
404
|
+
var y;
|
|
405
|
+
e.stopButtonPropagation && B.stopPropagation(), (y = d.onClick) == null || y.call(d, B);
|
|
406
|
+
}, r = (d, B) => {
|
|
407
|
+
f(d, B);
|
|
408
|
+
}, C = (d, B, y) => {
|
|
409
|
+
var D, z, g, h;
|
|
410
|
+
e.stopButtonPropagation && y.stopPropagation(), d.popConfirm && (B === "confirm" ? (z = (D = d.popConfirm).confirm) == null || z.call(D) : (h = (g = d.popConfirm).cancel) == null || h.call(g));
|
|
411
411
|
};
|
|
412
|
-
return { __sfc: !0, props: e, normalizeTooltip: l, getButtonType: t, filterVisible: n, visibleActions:
|
|
413
|
-
|
|
414
|
-
}, handlePopConfirmCancel: (
|
|
415
|
-
|
|
416
|
-
}, handleDropdownCommand: (
|
|
417
|
-
var
|
|
418
|
-
const
|
|
419
|
-
if (!(!
|
|
420
|
-
if (
|
|
421
|
-
const z =
|
|
422
|
-
|
|
423
|
-
confirmButtonText:
|
|
424
|
-
cancelButtonText:
|
|
412
|
+
return { __sfc: !0, props: e, normalizeTooltip: l, getButtonType: t, filterVisible: n, visibleActions: u, visibleDropDownActions: a, handleClick: f, handleActionClick: r, handlePopConfirm: C, handlePopConfirmConfirm: (d, B) => {
|
|
413
|
+
C(d, "confirm", B);
|
|
414
|
+
}, handlePopConfirmCancel: (d, B) => {
|
|
415
|
+
C(d, "cancel", B);
|
|
416
|
+
}, handleDropdownCommand: (d) => {
|
|
417
|
+
var D;
|
|
418
|
+
const B = Number(d), y = a.value[B];
|
|
419
|
+
if (!(!y || y.disabled)) {
|
|
420
|
+
if (y.popConfirm) {
|
|
421
|
+
const z = y.popConfirm.title, g = y.popConfirm.okText || "确定", h = y.popConfirm.cancelText || "取消";
|
|
422
|
+
qe.confirm(z, "提示", {
|
|
423
|
+
confirmButtonText: g,
|
|
424
|
+
cancelButtonText: h,
|
|
425
425
|
type: "warning"
|
|
426
426
|
}).then(() => {
|
|
427
|
-
var W,
|
|
428
|
-
return (
|
|
427
|
+
var W, b;
|
|
428
|
+
return (b = (W = y.popConfirm) == null ? void 0 : W.confirm) == null ? void 0 : b.call(W);
|
|
429
429
|
}).catch(() => {
|
|
430
|
-
var W,
|
|
431
|
-
return (
|
|
430
|
+
var W, b;
|
|
431
|
+
return (b = (W = y.popConfirm) == null ? void 0 : W.cancel) == null ? void 0 : b.call(W);
|
|
432
432
|
});
|
|
433
433
|
return;
|
|
434
434
|
}
|
|
435
|
-
(
|
|
435
|
+
(D = y.onClick) == null || D.call(y, {});
|
|
436
436
|
}
|
|
437
437
|
} };
|
|
438
438
|
}
|
|
439
439
|
});
|
|
440
|
-
var
|
|
440
|
+
var Ze = function() {
|
|
441
441
|
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
442
|
-
return l("div", { staticClass: "ecp-table-action" }, [e._l(t.visibleActions, function(n,
|
|
443
|
-
return l("span", { key: `action-${
|
|
442
|
+
return l("div", { staticClass: "ecp-table-action" }, [e._l(t.visibleActions, function(n, u) {
|
|
443
|
+
return l("span", { key: `action-${u}`, staticClass: "ecp-table-action__item" }, [n.popConfirm ? l("el-popconfirm", { attrs: { title: n.popConfirm.title, "confirm-button-text": n.popConfirm.okText || "确定", "cancel-button-text": n.popConfirm.cancelText || "取消" }, on: { confirm: function(a) {
|
|
444
444
|
return t.handlePopConfirmConfirm(n, a);
|
|
445
445
|
}, cancel: function(a) {
|
|
446
446
|
return t.handlePopConfirmCancel(n, a);
|
|
@@ -449,32 +449,32 @@ var qe = function() {
|
|
|
449
449
|
} } }, "el-button", n.props, !1), [n.icon ? l("i", { class: ["ecp-table-action__icon", n.icon] }) : e._e(), l("span", [e._v(e._s(n.label))])])], 1)], 1)]) : l(n.tooltip ? "el-tooltip" : "span", e._b({ tag: "component" }, "component", n.tooltip ? t.normalizeTooltip(n.tooltip) : {}, !1), [l("el-button", e._b({ attrs: { type: t.getButtonType(n), size: "small", disabled: n.disabled }, on: { click: function(a) {
|
|
450
450
|
return t.handleActionClick(n, a);
|
|
451
451
|
} } }, "el-button", n.props, !1), [n.icon ? l("i", { class: ["ecp-table-action__icon", n.icon] }) : e._e(), l("span", [e._v(e._s(n.label))])])], 1), n.divider ? l("el-divider", { attrs: { direction: "vertical" } }) : e._e()], 1);
|
|
452
|
-
}), t.visibleDropDownActions.length ? l("el-dropdown", { attrs: { trigger: "click" }, on: { command: t.handleDropdownCommand } }, [l("span", { staticClass: "ecp-table-action__more" }, [l("el-button", { attrs: { type: "text", size: "small" } }, [e._v(" 更多"), l("i", { staticClass: "el-icon-arrow-down el-icon--right" })])], 1), l("el-dropdown-menu", { attrs: { slot: "dropdown" }, slot: "dropdown" }, e._l(t.visibleDropDownActions, function(n,
|
|
453
|
-
return l("el-dropdown-item", { key: `dropdown-${
|
|
452
|
+
}), t.visibleDropDownActions.length ? l("el-dropdown", { attrs: { trigger: "click" }, on: { command: t.handleDropdownCommand } }, [l("span", { staticClass: "ecp-table-action__more" }, [l("el-button", { attrs: { type: "text", size: "small" } }, [e._v(" 更多"), l("i", { staticClass: "el-icon-arrow-down el-icon--right" })])], 1), l("el-dropdown-menu", { attrs: { slot: "dropdown" }, slot: "dropdown" }, e._l(t.visibleDropDownActions, function(n, u) {
|
|
453
|
+
return l("el-dropdown-item", { key: `dropdown-${u}`, attrs: { command: u, disabled: n.disabled, divided: !!n.divider } }, [l("span", { staticClass: "ecp-table-action__dropdown-item" }, [n.icon ? l("i", { class: ["ecp-table-action__icon", n.icon] }) : e._e(), l("span", [e._v(e._s(n.label))])])]);
|
|
454
454
|
}), 1)], 1) : e._e()], 2);
|
|
455
|
-
},
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
455
|
+
}, Qe = [], Ye = /* @__PURE__ */ se(
|
|
456
|
+
Xe,
|
|
457
|
+
Ze,
|
|
458
|
+
Qe,
|
|
459
459
|
!1,
|
|
460
460
|
null,
|
|
461
461
|
"45a58e7c",
|
|
462
462
|
null,
|
|
463
463
|
null
|
|
464
464
|
);
|
|
465
|
-
const
|
|
466
|
-
function
|
|
467
|
-
const e =
|
|
465
|
+
const Ne = Ye.exports;
|
|
466
|
+
function Ot(i) {
|
|
467
|
+
const e = k(null), l = () => i ? fe(i) : void 0, t = () => {
|
|
468
468
|
const a = fe(e);
|
|
469
469
|
if (!a)
|
|
470
470
|
throw new Error("ProTable instance has not been registered");
|
|
471
471
|
return a;
|
|
472
472
|
}, n = (a) => {
|
|
473
473
|
e.value = a;
|
|
474
|
-
const
|
|
475
|
-
|
|
474
|
+
const f = l();
|
|
475
|
+
f && Object.keys(f).length > 0 && a.setProps(f);
|
|
476
476
|
};
|
|
477
|
-
return
|
|
477
|
+
return i && J(
|
|
478
478
|
() => l(),
|
|
479
479
|
(a) => {
|
|
480
480
|
a && e.value && e.value.setProps(a);
|
|
@@ -496,25 +496,25 @@ function xt(p) {
|
|
|
496
496
|
clearSelectedRowKeys: () => t().clearSelectedRowKeys(),
|
|
497
497
|
setSelectedRowKeys: (a) => t().setSelectedRowKeys(a),
|
|
498
498
|
deleteSelectRowByKey: (a) => t().deleteSelectRowByKey(a),
|
|
499
|
-
updateTableData: (a,
|
|
500
|
-
updateTableDataRecord: (a,
|
|
499
|
+
updateTableData: (a, f, r) => t().updateTableData(a, f, r),
|
|
500
|
+
updateTableDataRecord: (a, f) => t().updateTableDataRecord(a, f),
|
|
501
501
|
deleteTableDataRecord: (a) => t().deleteTableDataRecord(a),
|
|
502
|
-
insertTableDataRecord: (a,
|
|
502
|
+
insertTableDataRecord: (a, f) => t().insertTableDataRecord(a, f),
|
|
503
503
|
getPaginationRef: () => t().getPaginationRef(),
|
|
504
504
|
getShowPagination: () => t().getShowPagination(),
|
|
505
505
|
setShowPagination: (a) => t().setShowPagination(a),
|
|
506
506
|
getRowSelection: () => t().getRowSelection(),
|
|
507
507
|
expandAll: () => {
|
|
508
|
-
var a,
|
|
509
|
-
return (
|
|
508
|
+
var a, f;
|
|
509
|
+
return (f = (a = t()).expandAll) == null ? void 0 : f.call(a);
|
|
510
510
|
},
|
|
511
511
|
collapseAll: () => {
|
|
512
|
-
var a,
|
|
513
|
-
return (
|
|
512
|
+
var a, f;
|
|
513
|
+
return (f = (a = t()).collapseAll) == null ? void 0 : f.call(a);
|
|
514
514
|
}
|
|
515
515
|
}];
|
|
516
516
|
}
|
|
517
|
-
const
|
|
517
|
+
const et = /* @__PURE__ */ oe({
|
|
518
518
|
__name: "ApiSelect",
|
|
519
519
|
props: {
|
|
520
520
|
value: null,
|
|
@@ -530,19 +530,19 @@ const Ue = /* @__PURE__ */ oe({
|
|
|
530
530
|
multiple: { type: Boolean }
|
|
531
531
|
},
|
|
532
532
|
emits: ["input"],
|
|
533
|
-
setup(
|
|
534
|
-
const e =
|
|
535
|
-
e.lazy && a &&
|
|
536
|
-
},
|
|
533
|
+
setup(i) {
|
|
534
|
+
const e = i, l = k(!1), t = k([]), n = (a) => {
|
|
535
|
+
e.lazy && a && u();
|
|
536
|
+
}, u = async () => {
|
|
537
537
|
if (e.api) {
|
|
538
538
|
l.value = !0;
|
|
539
539
|
try {
|
|
540
|
-
const a = await e.api(e.params),
|
|
541
|
-
t.value =
|
|
542
|
-
const
|
|
540
|
+
const a = await e.api(e.params), f = Array.isArray(a) ? a : (a == null ? void 0 : a.list) ?? (a == null ? void 0 : a.data) ?? [], r = e.labelField ?? "label", C = e.valueField ?? "value";
|
|
541
|
+
t.value = f.map((O) => {
|
|
542
|
+
const v = O;
|
|
543
543
|
return {
|
|
544
|
-
label: String(
|
|
545
|
-
value:
|
|
544
|
+
label: String(v[r] ?? v.label ?? ""),
|
|
545
|
+
value: v[C] ?? v.value
|
|
546
546
|
};
|
|
547
547
|
});
|
|
548
548
|
} finally {
|
|
@@ -551,36 +551,197 @@ const Ue = /* @__PURE__ */ oe({
|
|
|
551
551
|
}
|
|
552
552
|
};
|
|
553
553
|
return ve(() => {
|
|
554
|
-
e.lazy ||
|
|
555
|
-
}),
|
|
554
|
+
e.lazy || u();
|
|
555
|
+
}), J(
|
|
556
556
|
() => e.api,
|
|
557
557
|
() => {
|
|
558
|
-
e.lazy ? t.value = [] :
|
|
558
|
+
e.lazy ? t.value = [] : u();
|
|
559
559
|
},
|
|
560
560
|
{ deep: !0 }
|
|
561
|
-
),
|
|
562
|
-
e.lazy ? t.value = [] :
|
|
563
|
-
}, { deep: !0 }), { __sfc: !0, props: e, loading: l, options: t, onVisibleChange: n, fetchOptions:
|
|
561
|
+
), J(() => e.params, () => {
|
|
562
|
+
e.lazy ? t.value = [] : u();
|
|
563
|
+
}, { deep: !0 }), { __sfc: !0, props: e, loading: l, options: t, onVisibleChange: n, fetchOptions: u };
|
|
564
564
|
}
|
|
565
565
|
});
|
|
566
|
-
var
|
|
566
|
+
var tt = function() {
|
|
567
567
|
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
568
568
|
return l("el-select", e._b({ attrs: { value: e.value, placeholder: e.placeholder, disabled: e.disabled, loading: t.loading, clearable: e.clearable, filterable: e.filterable, multiple: e.multiple }, on: { input: function(n) {
|
|
569
569
|
return e.$emit("input", n);
|
|
570
570
|
}, "visible-change": t.onVisibleChange } }, "el-select", e.$attrs, !1), e._l(t.options, function(n) {
|
|
571
571
|
return l("el-option", { key: String(n.value), attrs: { label: n.label, value: n.value } });
|
|
572
572
|
}), 1);
|
|
573
|
-
},
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
573
|
+
}, lt = [], ot = /* @__PURE__ */ se(
|
|
574
|
+
et,
|
|
575
|
+
tt,
|
|
576
|
+
lt,
|
|
577
577
|
!1,
|
|
578
578
|
null,
|
|
579
579
|
null,
|
|
580
580
|
null,
|
|
581
581
|
null
|
|
582
582
|
);
|
|
583
|
-
const
|
|
583
|
+
const nt = ot.exports;
|
|
584
|
+
function $e(i) {
|
|
585
|
+
const e = i.trim();
|
|
586
|
+
if (!e)
|
|
587
|
+
return "";
|
|
588
|
+
let l = 0, t = "";
|
|
589
|
+
e[0] === "-" && (t = "-", l = 1);
|
|
590
|
+
let n = !1;
|
|
591
|
+
for (; l < e.length; l++) {
|
|
592
|
+
const u = e[l];
|
|
593
|
+
if (u >= "0" && u <= "9") {
|
|
594
|
+
t += u;
|
|
595
|
+
continue;
|
|
596
|
+
}
|
|
597
|
+
u === "." && !n && (n = !0, (t === "" || t === "-") && (t += "0"), t += ".");
|
|
598
|
+
}
|
|
599
|
+
return t;
|
|
600
|
+
}
|
|
601
|
+
function xe(i) {
|
|
602
|
+
return i.replace(/,/g, "").trim();
|
|
603
|
+
}
|
|
604
|
+
function at(i, e) {
|
|
605
|
+
const l = Math.pow(10, i) - 1;
|
|
606
|
+
return e <= 0 ? l : l + (1 - Math.pow(10, -e));
|
|
607
|
+
}
|
|
608
|
+
function ze(i, e, l) {
|
|
609
|
+
const t = at(e, l), n = i < 0 ? -1 : 1;
|
|
610
|
+
return Math.abs(i) <= t ? i : n * t;
|
|
611
|
+
}
|
|
612
|
+
function st(i, e, l) {
|
|
613
|
+
if (e <= 0)
|
|
614
|
+
switch (l) {
|
|
615
|
+
case "floor":
|
|
616
|
+
return Math.floor(i);
|
|
617
|
+
case "ceil":
|
|
618
|
+
return Math.ceil(i);
|
|
619
|
+
default:
|
|
620
|
+
return Math.round(i);
|
|
621
|
+
}
|
|
622
|
+
const t = Math.pow(10, e), n = i * t;
|
|
623
|
+
let u;
|
|
624
|
+
switch (l) {
|
|
625
|
+
case "floor":
|
|
626
|
+
u = Math.floor(n);
|
|
627
|
+
break;
|
|
628
|
+
case "ceil":
|
|
629
|
+
u = Math.ceil(n);
|
|
630
|
+
break;
|
|
631
|
+
default:
|
|
632
|
+
u = Math.round(n);
|
|
633
|
+
}
|
|
634
|
+
return u / t;
|
|
635
|
+
}
|
|
636
|
+
function Pe(i, e, l, t) {
|
|
637
|
+
let n = ze(i, e, l);
|
|
638
|
+
return n = st(n, l, t), n = ze(n, e, l), n;
|
|
639
|
+
}
|
|
640
|
+
function Ie(i, e) {
|
|
641
|
+
if (Number.isNaN(i) || !Number.isFinite(i))
|
|
642
|
+
return "";
|
|
643
|
+
const l = i.toFixed(Math.max(0, e)), t = l.startsWith("-"), n = t ? l.slice(1) : l, [u, a] = n.split("."), f = u.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
644
|
+
return e <= 0 || a === void 0 ? (t ? "-" : "") + f : (t ? "-" : "") + f + "." + a;
|
|
645
|
+
}
|
|
646
|
+
function rt(i, e) {
|
|
647
|
+
if (Number.isNaN(i) || !Number.isFinite(i))
|
|
648
|
+
return "";
|
|
649
|
+
let l = i.toFixed(Math.max(0, e));
|
|
650
|
+
return l = l.replace(/(\.\d*?)0+$/, "$1"), l = l.replace(/\.$/, ""), l;
|
|
651
|
+
}
|
|
652
|
+
const it = /* @__PURE__ */ oe({
|
|
653
|
+
__name: "FormattedNumberInput",
|
|
654
|
+
props: {
|
|
655
|
+
value: null,
|
|
656
|
+
placeholder: null,
|
|
657
|
+
disabled: { type: Boolean },
|
|
658
|
+
integerDigits: { default: 5 },
|
|
659
|
+
decimalPlaces: { default: 6 },
|
|
660
|
+
rounding: { default: "round" }
|
|
661
|
+
},
|
|
662
|
+
emits: ["input"],
|
|
663
|
+
setup(i, { emit: e }) {
|
|
664
|
+
const l = i, t = k(!1), n = k(""), u = () => Math.max(0, Math.floor(l.integerDigits ?? 5)), a = () => Math.max(0, Math.floor(l.decimalPlaces ?? 6));
|
|
665
|
+
function f(m) {
|
|
666
|
+
if (m == null || m === "")
|
|
667
|
+
return null;
|
|
668
|
+
if (typeof m == "number")
|
|
669
|
+
return Number.isFinite(m) ? m : null;
|
|
670
|
+
const d = xe(String(m));
|
|
671
|
+
if (d === "" || d === "-")
|
|
672
|
+
return null;
|
|
673
|
+
const B = Number(d);
|
|
674
|
+
return Number.isFinite(B) ? B : null;
|
|
675
|
+
}
|
|
676
|
+
function r() {
|
|
677
|
+
if (t.value)
|
|
678
|
+
return;
|
|
679
|
+
const m = f(l.value);
|
|
680
|
+
if (m === null) {
|
|
681
|
+
n.value = "";
|
|
682
|
+
return;
|
|
683
|
+
}
|
|
684
|
+
n.value = Ie(
|
|
685
|
+
Pe(m, u(), a(), l.rounding),
|
|
686
|
+
a()
|
|
687
|
+
);
|
|
688
|
+
}
|
|
689
|
+
J(
|
|
690
|
+
() => [l.value, l.integerDigits, l.decimalPlaces, l.rounding],
|
|
691
|
+
() => r(),
|
|
692
|
+
{ immediate: !0, deep: !0 }
|
|
693
|
+
);
|
|
694
|
+
function C(m) {
|
|
695
|
+
const d = $e(m);
|
|
696
|
+
if (n.value = d, d === "" || d === "-")
|
|
697
|
+
return;
|
|
698
|
+
const B = Number(d);
|
|
699
|
+
Number.isFinite(B) && e("input", B);
|
|
700
|
+
}
|
|
701
|
+
function O() {
|
|
702
|
+
t.value = !0;
|
|
703
|
+
const m = xe(n.value), d = f(m === "" ? l.value : m);
|
|
704
|
+
if (d === null) {
|
|
705
|
+
n.value = "";
|
|
706
|
+
return;
|
|
707
|
+
}
|
|
708
|
+
n.value = rt(
|
|
709
|
+
Pe(d, u(), a(), l.rounding),
|
|
710
|
+
a()
|
|
711
|
+
);
|
|
712
|
+
}
|
|
713
|
+
function v() {
|
|
714
|
+
t.value = !1;
|
|
715
|
+
const m = xe(n.value);
|
|
716
|
+
if (m === "" || m === "-") {
|
|
717
|
+
n.value = "", e("input", void 0);
|
|
718
|
+
return;
|
|
719
|
+
}
|
|
720
|
+
const d = Number($e(m));
|
|
721
|
+
if (!Number.isFinite(d)) {
|
|
722
|
+
n.value = "", e("input", void 0);
|
|
723
|
+
return;
|
|
724
|
+
}
|
|
725
|
+
const B = Pe(d, u(), a(), l.rounding);
|
|
726
|
+
n.value = Ie(B, a()), e("input", B);
|
|
727
|
+
}
|
|
728
|
+
return { __sfc: !0, props: l, emit: e, focused: t, displayText: n, intN: u, decM: a, parseExternalToNumber: f, syncDisplayFromValue: r, onInput: C, onFocus: O, onBlur: v };
|
|
729
|
+
}
|
|
730
|
+
});
|
|
731
|
+
var ct = function() {
|
|
732
|
+
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
733
|
+
return l("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));
|
|
734
|
+
}, ut = [], dt = /* @__PURE__ */ se(
|
|
735
|
+
it,
|
|
736
|
+
ct,
|
|
737
|
+
ut,
|
|
738
|
+
!1,
|
|
739
|
+
null,
|
|
740
|
+
null,
|
|
741
|
+
null,
|
|
742
|
+
null
|
|
743
|
+
);
|
|
744
|
+
const Ae = dt.exports, ft = /* @__PURE__ */ oe({
|
|
584
745
|
__name: "TreeSelect",
|
|
585
746
|
props: {
|
|
586
747
|
value: null,
|
|
@@ -597,107 +758,107 @@ const Qe = Ze.exports, Ye = /* @__PURE__ */ oe({
|
|
|
597
758
|
clearable: { type: Boolean }
|
|
598
759
|
},
|
|
599
760
|
emits: ["input"],
|
|
600
|
-
setup(
|
|
601
|
-
const l =
|
|
761
|
+
setup(i, { emit: e }) {
|
|
762
|
+
const l = i, t = k(), n = k(), u = k(!1), a = k(!1), f = k(""), r = k([]), C = k({}), O = S(() => ({
|
|
602
763
|
label: l.labelField,
|
|
603
764
|
children: l.childrenField
|
|
604
765
|
}));
|
|
605
|
-
function
|
|
606
|
-
const
|
|
607
|
-
return H[l.labelField ?? "label"] = F[
|
|
766
|
+
function v(F) {
|
|
767
|
+
const N = l.labelField ?? "label", L = l.valueField ?? "value", Z = l.childrenField ?? "children", ee = F[Z], H = {};
|
|
768
|
+
return H[l.labelField ?? "label"] = F[N] ?? F.label, H[l.valueField ?? "value"] = F[L] ?? F.value, Array.isArray(ee) && ee.length && (H[l.childrenField ?? "children"] = ee.map((q) => v(q))), H;
|
|
608
769
|
}
|
|
609
|
-
function
|
|
610
|
-
const
|
|
770
|
+
function m(F, N = "") {
|
|
771
|
+
const L = {}, Z = l.labelField ?? "label", ee = l.valueField ?? "value", H = l.childrenField ?? "children";
|
|
611
772
|
for (const q of F) {
|
|
612
773
|
const Q = String(q[Z] ?? q.label ?? ""), U = q[ee] ?? q.value;
|
|
613
|
-
U != null && (
|
|
774
|
+
U != null && (L[String(U)] = N ? N + " / " + Q : Q);
|
|
614
775
|
const Y = q[H] ?? q.children;
|
|
615
|
-
Array.isArray(Y) && Y.length && Object.assign(
|
|
776
|
+
Array.isArray(Y) && Y.length && Object.assign(L, m(Y, Q));
|
|
616
777
|
}
|
|
617
|
-
return
|
|
778
|
+
return L;
|
|
618
779
|
}
|
|
619
|
-
function
|
|
780
|
+
function d() {
|
|
620
781
|
const F = l.treeData;
|
|
621
782
|
return Array.isArray(F) && F.length > 0;
|
|
622
783
|
}
|
|
623
|
-
function
|
|
624
|
-
r.value = F,
|
|
784
|
+
function B(F) {
|
|
785
|
+
r.value = F, C.value = m(F);
|
|
625
786
|
}
|
|
626
|
-
function
|
|
787
|
+
function y() {
|
|
627
788
|
const F = l.treeData;
|
|
628
789
|
if (!Array.isArray(F) || F.length === 0)
|
|
629
790
|
return;
|
|
630
|
-
const
|
|
631
|
-
|
|
791
|
+
const N = F.map((L) => v(L));
|
|
792
|
+
B(N);
|
|
632
793
|
}
|
|
633
|
-
const
|
|
794
|
+
const D = S(() => l.value == null || l.value === "" ? "" : C.value[String(l.value)] ?? String(l.value)), z = (F, N) => {
|
|
634
795
|
if (!F)
|
|
635
796
|
return !0;
|
|
636
|
-
const
|
|
637
|
-
return String(
|
|
797
|
+
const L = l.labelField ?? "label";
|
|
798
|
+
return String(N[L] ?? N.label ?? "").toLowerCase().includes(F.toLowerCase());
|
|
638
799
|
};
|
|
639
|
-
|
|
640
|
-
var
|
|
641
|
-
(
|
|
800
|
+
J(f, (F) => {
|
|
801
|
+
var N;
|
|
802
|
+
(N = n.value) == null || N.filter(F);
|
|
642
803
|
});
|
|
643
|
-
let
|
|
644
|
-
function
|
|
645
|
-
l.disabled || (
|
|
646
|
-
|
|
804
|
+
let g = null;
|
|
805
|
+
function h() {
|
|
806
|
+
l.disabled || (u.value = !0, l.lazy && !d() && j(), Oe(() => {
|
|
807
|
+
g = (F) => {
|
|
647
808
|
t.value && !t.value.contains(F.target) && W();
|
|
648
|
-
}, document.addEventListener("click",
|
|
809
|
+
}, document.addEventListener("click", g);
|
|
649
810
|
}));
|
|
650
811
|
}
|
|
651
812
|
function W() {
|
|
652
|
-
|
|
813
|
+
u.value = !1, f.value = "", g && (document.removeEventListener("click", g), g = null);
|
|
653
814
|
}
|
|
654
|
-
function
|
|
815
|
+
function b() {
|
|
655
816
|
e("input", void 0);
|
|
656
817
|
}
|
|
657
|
-
function
|
|
658
|
-
const
|
|
659
|
-
e("input",
|
|
818
|
+
function M(F) {
|
|
819
|
+
const N = l.valueField ?? "value", L = F[N] ?? F.value;
|
|
820
|
+
e("input", L), W();
|
|
660
821
|
}
|
|
661
822
|
async function j() {
|
|
662
|
-
if (!(!l.api ||
|
|
823
|
+
if (!(!l.api || d())) {
|
|
663
824
|
a.value = !0;
|
|
664
825
|
try {
|
|
665
|
-
const F = await l.api(l.params),
|
|
666
|
-
r.value =
|
|
826
|
+
const F = await l.api(l.params), N = Array.isArray(F) ? F : (F == null ? void 0 : F.list) ?? (F == null ? void 0 : F.data) ?? [];
|
|
827
|
+
r.value = N.map((L) => v(L)), C.value = m(r.value);
|
|
667
828
|
} finally {
|
|
668
829
|
a.value = !1;
|
|
669
830
|
}
|
|
670
831
|
}
|
|
671
832
|
}
|
|
672
833
|
return ve(() => {
|
|
673
|
-
|
|
674
|
-
}),
|
|
675
|
-
|
|
676
|
-
}, { deep: !0 }),
|
|
677
|
-
|
|
678
|
-
}, { deep: !0 }),
|
|
679
|
-
|
|
680
|
-
}, { deep: !0 }), { __sfc: !0, props: l, emit: e, rootRef: t, treeRef: n, dropdownVisible:
|
|
834
|
+
d() ? y() : l.lazy || j();
|
|
835
|
+
}), J(() => l.treeData, () => {
|
|
836
|
+
d() ? y() : (r.value = [], C.value = {}, !l.lazy && l.api && j());
|
|
837
|
+
}, { deep: !0 }), J(() => l.api, () => {
|
|
838
|
+
d() || (l.lazy ? (r.value = [], C.value = {}) : j());
|
|
839
|
+
}, { deep: !0 }), J(() => l.params, () => {
|
|
840
|
+
d() || (l.lazy ? (r.value = [], C.value = {}) : j());
|
|
841
|
+
}, { deep: !0 }), { __sfc: !0, props: l, emit: e, rootRef: t, treeRef: n, dropdownVisible: u, loading: a, filterText: f, treeData: r, flatLabelMap: C, treeProps: O, normalizeNode: v, buildFlatLabelMap: m, hasTreeDataProp: d, applyTreeData: B, syncFromTreeDataProp: y, displayText: D, filterNodeMethod: z, clickOutsideHandler: g, openDropdown: h, closeDropdown: W, clearValue: b, onNodeClick: M, fetchData: j };
|
|
681
842
|
}
|
|
682
843
|
});
|
|
683
|
-
var
|
|
844
|
+
var pt = function() {
|
|
684
845
|
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
685
846
|
return l("div", { ref: "rootRef", staticClass: "ecp-tree-select" }, [l("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 } }), l("transition", { attrs: { name: "el-zoom-in-top" } }, [l("div", { directives: [{ name: "show", rawName: "v-show", value: t.dropdownVisible, expression: "dropdownVisible" }], staticClass: "ecp-tree-select__dropdown" }, [e.filterable ? l("div", { staticClass: "ecp-tree-select__filter-inner" }, [l("el-input", { attrs: { size: "small", placeholder: "搜索节点", "prefix-icon": "el-icon-search", clearable: "" }, nativeOn: { click: function(n) {
|
|
686
847
|
n.stopPropagation();
|
|
687
848
|
} }, model: { value: t.filterText, callback: function(n) {
|
|
688
849
|
t.filterText = n;
|
|
689
850
|
}, expression: "filterText" } })], 1) : e._e(), l("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 ? l("div", { staticClass: "ecp-tree-select__loading" }, [l("i", { staticClass: "el-icon-loading" }), e._v(" 加载中... ")]) : e._e()], 1)])], 1);
|
|
690
|
-
},
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
851
|
+
}, vt = [], mt = /* @__PURE__ */ se(
|
|
852
|
+
ft,
|
|
853
|
+
pt,
|
|
854
|
+
vt,
|
|
694
855
|
!1,
|
|
695
856
|
null,
|
|
696
857
|
"f30bba11",
|
|
697
858
|
null,
|
|
698
859
|
null
|
|
699
860
|
);
|
|
700
|
-
const
|
|
861
|
+
const ht = mt.exports, _t = /* @__PURE__ */ oe({
|
|
701
862
|
__name: "ProFormItem",
|
|
702
863
|
props: {
|
|
703
864
|
schema: null,
|
|
@@ -709,8 +870,8 @@ const ot = lt.exports, nt = /* @__PURE__ */ oe({
|
|
|
709
870
|
onFieldChange: null,
|
|
710
871
|
customComponents: null
|
|
711
872
|
},
|
|
712
|
-
setup(
|
|
713
|
-
const e =
|
|
873
|
+
setup(i) {
|
|
874
|
+
const e = i, l = /* @__PURE__ */ new Set([
|
|
714
875
|
"input",
|
|
715
876
|
"select",
|
|
716
877
|
"api-select",
|
|
@@ -718,80 +879,81 @@ const ot = lt.exports, nt = /* @__PURE__ */ oe({
|
|
|
718
879
|
"date-picker",
|
|
719
880
|
"date-range",
|
|
720
881
|
"input-number",
|
|
882
|
+
"formatted-number",
|
|
721
883
|
"switch",
|
|
722
884
|
"cascader",
|
|
723
885
|
"checkbox",
|
|
724
886
|
"radio"
|
|
725
|
-
]), t =
|
|
887
|
+
]), t = Se(), n = S(() => ({
|
|
726
888
|
schema: e.schema,
|
|
727
889
|
values: e.formModel,
|
|
728
890
|
model: e.formModel,
|
|
729
891
|
field: e.schema.field
|
|
730
|
-
})),
|
|
731
|
-
const
|
|
732
|
-
return
|
|
733
|
-
}), a =
|
|
734
|
-
const
|
|
735
|
-
return
|
|
736
|
-
}),
|
|
892
|
+
})), u = S(() => {
|
|
893
|
+
const b = e.schema.ifShow;
|
|
894
|
+
return b === void 0 ? !0 : typeof b == "boolean" ? b : b(n.value);
|
|
895
|
+
}), a = S(() => {
|
|
896
|
+
const b = e.schema.show;
|
|
897
|
+
return b === void 0 ? !0 : typeof b == "boolean" ? b : b(n.value);
|
|
898
|
+
}), f = S(() => {
|
|
737
899
|
if (e.formDisabled)
|
|
738
900
|
return !0;
|
|
739
|
-
const
|
|
740
|
-
return
|
|
741
|
-
}), r =
|
|
742
|
-
const
|
|
743
|
-
return
|
|
744
|
-
}),
|
|
745
|
-
const
|
|
746
|
-
if (!
|
|
901
|
+
const b = e.schema.dynamicDisabled;
|
|
902
|
+
return b === void 0 ? !1 : typeof b == "boolean" ? b : b(n.value);
|
|
903
|
+
}), r = S(() => {
|
|
904
|
+
const b = e.schema.dynamicRules;
|
|
905
|
+
return b ? Array.isArray(b) ? b : b(n.value) : e.schema.rules;
|
|
906
|
+
}), C = S(() => {
|
|
907
|
+
const b = e.schema.componentProps;
|
|
908
|
+
if (!b)
|
|
747
909
|
return { props: {}, listeners: {} };
|
|
748
|
-
const
|
|
910
|
+
const M = typeof b == "function" ? b({
|
|
749
911
|
...n.value,
|
|
750
912
|
formActionType: e.formActionType
|
|
751
|
-
}) : { ...
|
|
752
|
-
for (const [
|
|
753
|
-
if (
|
|
754
|
-
const Z =
|
|
755
|
-
F[Z] =
|
|
913
|
+
}) : { ...b }, j = {}, F = {};
|
|
914
|
+
for (const [N, L] of Object.entries(M))
|
|
915
|
+
if (N.length > 2 && /^on[A-Za-z]/.test(N) && typeof L == "function") {
|
|
916
|
+
const Z = N.slice(2).charAt(0).toLowerCase() + N.slice(3);
|
|
917
|
+
F[Z] = L;
|
|
756
918
|
} else
|
|
757
|
-
j[
|
|
919
|
+
j[N] = L;
|
|
758
920
|
return { props: j, listeners: F };
|
|
759
|
-
}),
|
|
760
|
-
const
|
|
761
|
-
if (!
|
|
921
|
+
}), O = S(() => C.value.props), v = S(() => C.value.listeners), m = S(() => e.schema.colon ?? e.colon ?? !1), d = S(() => {
|
|
922
|
+
const b = e.schema.tooltip;
|
|
923
|
+
if (!b)
|
|
762
924
|
return null;
|
|
763
|
-
const
|
|
764
|
-
return
|
|
765
|
-
}),
|
|
766
|
-
const
|
|
767
|
-
return Array.isArray(
|
|
768
|
-
},
|
|
769
|
-
const
|
|
770
|
-
return
|
|
771
|
-
}),
|
|
772
|
-
var
|
|
773
|
-
(
|
|
774
|
-
}, W =
|
|
775
|
-
const
|
|
776
|
-
return
|
|
925
|
+
const M = typeof b == "function" ? b(n.value) : b;
|
|
926
|
+
return Be(M, e.formModel[e.schema.field]);
|
|
927
|
+
}), B = S(() => d.value ? "el-tooltip" : "span"), y = S(() => d.value || {}), D = S(() => !!t.default), z = (b) => {
|
|
928
|
+
const M = b == null ? void 0 : b.options;
|
|
929
|
+
return Array.isArray(M) ? M : void 0;
|
|
930
|
+
}, g = S(() => {
|
|
931
|
+
const b = e.schema.component;
|
|
932
|
+
return b == null ? null : typeof b == "string" ? l.has(b) ? null : e.customComponents && e.customComponents[b] || b : b;
|
|
933
|
+
}), h = (b) => {
|
|
934
|
+
var M;
|
|
935
|
+
(M = e.onFieldChange) == null || M.call(e, e.schema.field, b);
|
|
936
|
+
}, W = S(() => {
|
|
937
|
+
const b = e.schema.render;
|
|
938
|
+
return b ? {
|
|
777
939
|
render() {
|
|
778
|
-
const
|
|
779
|
-
return Array.isArray(
|
|
940
|
+
const M = b(n.value);
|
|
941
|
+
return Array.isArray(M) ? ue("span", M) : M;
|
|
780
942
|
}
|
|
781
943
|
} : null;
|
|
782
944
|
});
|
|
783
|
-
return { __sfc: !0, BUILT_IN_COMPONENTS: l, props: e, slots: t, renderParams: n, shouldRender:
|
|
945
|
+
return { __sfc: !0, BUILT_IN_COMPONENTS: l, props: e, slots: t, renderParams: n, shouldRender: u, shouldShow: a, effectiveDisabled: f, effectiveRules: r, effectiveComponentPropsAndListeners: C, effectiveComponentProps: O, effectiveComponentListeners: v, showColon: m, normalizedTooltip: d, fieldWrapperComponent: B, fieldWrapperProps: y, hasSlot: D, getOptions: z, resolvedCustomComponent: g, setFieldValue: h, renderComponent: W, ApiSelect: nt, FormattedNumberInput: Ae, TreeSelect: ht };
|
|
784
946
|
}
|
|
785
947
|
});
|
|
786
|
-
var
|
|
948
|
+
var bt = function() {
|
|
787
949
|
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
788
|
-
return t.shouldRender ? l("el-form-item", { directives: [{ name: "show", rawName: "v-show", value: t.shouldShow, expression: "shouldShow" }], attrs: { prop: e.schema.field, required: e.schema.required, rules: t.effectiveRules, "label-width": e.schema.labelWidth } }, [l("template", { slot: "label" }, [l("span", [e._v(" " + e._s(e.schema.label)), t.showColon ? l("span", { staticClass: "ecp-pro-form-item__colon" }, [e._v(":")]) : e._e()]), e.schema.helpMessage ? l("el-tooltip", e._b({ attrs: { placement: "top", effect: "light" } }, "el-tooltip", e.schema.helpComponentProps || {}, !1), [l("template", { slot: "content" }, [Array.isArray(e.schema.helpMessage) ? e._l(e.schema.helpMessage, function(n,
|
|
789
|
-
return l("div", { key:
|
|
950
|
+
return t.shouldRender ? l("el-form-item", { directives: [{ name: "show", rawName: "v-show", value: t.shouldShow, expression: "shouldShow" }], attrs: { prop: e.schema.field, required: e.schema.required, rules: t.effectiveRules, "label-width": e.schema.labelWidth } }, [l("template", { slot: "label" }, [l("span", [e._v(" " + e._s(e.schema.label)), t.showColon ? l("span", { staticClass: "ecp-pro-form-item__colon" }, [e._v(":")]) : e._e()]), e.schema.helpMessage ? l("el-tooltip", e._b({ attrs: { placement: "top", effect: "light" } }, "el-tooltip", e.schema.helpComponentProps || {}, !1), [l("template", { slot: "content" }, [Array.isArray(e.schema.helpMessage) ? e._l(e.schema.helpMessage, function(n, u) {
|
|
951
|
+
return l("div", { key: u, staticClass: "ecp-pro-form-item__help-item" }, [e._v(" " + e._s(n) + " ")]);
|
|
790
952
|
}) : l("span", [e._v(e._s(e.schema.helpMessage))])], 2), l("i", { staticClass: "el-icon-question ecp-pro-form-item__help-icon" })], 2) : e._e()], 1), e.schema.render ? [l(t.renderComponent, { tag: "component" })] : t.hasSlot ? e._t("default", null, { model: e.formModel, schema: e.schema, field: e.schema.field, values: e.formModel }) : [l(t.fieldWrapperComponent, e._b({ tag: "component" }, "component", t.fieldWrapperProps, !1), [t.resolvedCustomComponent ? l(t.resolvedCustomComponent, e._g(e._b({ tag: "component", attrs: { value: e.formModel[e.schema.field], placeholder: e.schema.placeholder || (e.autoPlaceholder ? `请输入${e.schema.label}` : void 0), disabled: t.effectiveDisabled }, on: { input: t.setFieldValue } }, "component", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "input" || !e.schema.component ? l("el-input", e._g(e._b({ attrs: { placeholder: e.schema.placeholder || (e.autoPlaceholder ? `请输入${e.schema.label}` : void 0), disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(n) {
|
|
791
953
|
e.$set(e.formModel, e.schema.field, n);
|
|
792
954
|
}, expression: "formModel[schema.field]" } }, "el-input", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "input-number" ? l("el-input-number", e._g(e._b({ attrs: { placeholder: e.schema.placeholder, disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(n) {
|
|
793
955
|
e.$set(e.formModel, e.schema.field, n);
|
|
794
|
-
}, expression: "formModel[schema.field]" } }, "el-input-number", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "select" ? l("el-select", e._g(e._b({ staticClass: "ecp-pro-form-item__select", attrs: { placeholder: e.schema.placeholder || (e.autoPlaceholder ? `请选择${e.schema.label}` : void 0), disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(n) {
|
|
956
|
+
}, expression: "formModel[schema.field]" } }, "el-input-number", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "formatted-number" ? l(t.FormattedNumberInput, e._g(e._b({ 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 } }, "FormattedNumberInput", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "select" ? l("el-select", e._g(e._b({ staticClass: "ecp-pro-form-item__select", attrs: { placeholder: e.schema.placeholder || (e.autoPlaceholder ? `请选择${e.schema.label}` : void 0), disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(n) {
|
|
795
957
|
e.$set(e.formModel, e.schema.field, n);
|
|
796
958
|
}, expression: "formModel[schema.field]" } }, "el-select", t.effectiveComponentProps, !1), t.effectiveComponentListeners), e._l(t.getOptions(t.effectiveComponentProps) || [], function(n) {
|
|
797
959
|
return l("el-option", { key: String(n.value), attrs: { label: n.label, value: n.value } });
|
|
@@ -812,17 +974,17 @@ var at = function() {
|
|
|
812
974
|
}, expression: "formModel[schema.field]" } }, "el-radio-group", t.effectiveComponentProps, !1), t.effectiveComponentListeners), e._l(t.getOptions(t.effectiveComponentProps) || [], function(n) {
|
|
813
975
|
return l("el-radio", { key: String(n.value), attrs: { label: n.value } }, [e._v(" " + e._s(n.label) + " ")]);
|
|
814
976
|
}), 1) : e._e()], 1)]], 2) : e._e();
|
|
815
|
-
},
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
977
|
+
}, gt = [], yt = /* @__PURE__ */ se(
|
|
978
|
+
_t,
|
|
979
|
+
bt,
|
|
980
|
+
gt,
|
|
819
981
|
!1,
|
|
820
982
|
null,
|
|
821
|
-
"
|
|
983
|
+
"d3466c67",
|
|
822
984
|
null,
|
|
823
985
|
null
|
|
824
986
|
);
|
|
825
|
-
const
|
|
987
|
+
const Ve = yt.exports, wt = /* @__PURE__ */ oe({
|
|
826
988
|
__name: "FormActions",
|
|
827
989
|
props: {
|
|
828
990
|
showActionButtonGroup: { type: Boolean, default: !0 },
|
|
@@ -839,28 +1001,28 @@ const $e = rt.exports, it = /* @__PURE__ */ oe({
|
|
|
839
1001
|
actionColOptions: null
|
|
840
1002
|
},
|
|
841
1003
|
emits: ["submit", "reset", "toggle"],
|
|
842
|
-
setup(
|
|
1004
|
+
setup(i) {
|
|
843
1005
|
return { __sfc: !0 };
|
|
844
1006
|
}
|
|
845
1007
|
});
|
|
846
|
-
var
|
|
1008
|
+
var Ct = function() {
|
|
847
1009
|
var e = this, l = e._self._c;
|
|
848
1010
|
return e._self._setupProxy, l("div", { staticClass: "ecp-form-actions" }, [e._t("submitBefore"), e.showSubmitButton ? l("el-button", { attrs: { type: "primary", icon: e.submitButtonIcon, loading: e.submitLoading }, on: { click: function(t) {
|
|
849
1011
|
return e.$emit("submit");
|
|
850
1012
|
} } }, [e._v(" " + e._s(e.submitButtonText) + " ")]) : e._e(), e._t("resetBefore"), e.showResetButton ? l("el-button", { attrs: { icon: e.resetButtonIcon }, on: { click: function(t) {
|
|
851
1013
|
return e.$emit("reset");
|
|
852
1014
|
} } }, [e._v(" " + e._s(e.resetButtonText) + " ")]) : e._e(), e._t("actions")], 2);
|
|
853
|
-
},
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
1015
|
+
}, xt = [], Pt = /* @__PURE__ */ se(
|
|
1016
|
+
wt,
|
|
1017
|
+
Ct,
|
|
1018
|
+
xt,
|
|
857
1019
|
!1,
|
|
858
1020
|
null,
|
|
859
1021
|
"489c88d2",
|
|
860
1022
|
null,
|
|
861
1023
|
null
|
|
862
1024
|
);
|
|
863
|
-
const
|
|
1025
|
+
const We = Pt.exports, St = /* @__PURE__ */ oe({
|
|
864
1026
|
__name: "ProForm",
|
|
865
1027
|
props: {
|
|
866
1028
|
schemas: null,
|
|
@@ -893,136 +1055,136 @@ const ze = dt.exports, ft = /* @__PURE__ */ oe({
|
|
|
893
1055
|
components: null
|
|
894
1056
|
},
|
|
895
1057
|
emits: ["submit", "reset", "register", "update:modelValue"],
|
|
896
|
-
setup(
|
|
897
|
-
const t =
|
|
898
|
-
const
|
|
899
|
-
return
|
|
900
|
-
}, { getSetting:
|
|
901
|
-
...
|
|
902
|
-
...
|
|
903
|
-
...
|
|
904
|
-
})),
|
|
905
|
-
let
|
|
906
|
-
for (const
|
|
907
|
-
const P =
|
|
908
|
-
if (P >
|
|
1058
|
+
setup(i, { expose: e, emit: l }) {
|
|
1059
|
+
const t = i, n = Se(), u = k(), a = k(), f = k(!1), r = k(!0), C = k({}), O = k({}), v = k([]), m = k({}), d = { xl: 1920, lg: 1200, md: 992, sm: 768 }, B = (c, w, R) => {
|
|
1060
|
+
const A = R ?? (typeof window < "u" ? window.innerWidth : 1920), x = c ?? {}, o = w ?? {}, s = o.span ?? 8;
|
|
1061
|
+
return A >= d.xl ? x.xl ?? o.xl ?? x.lg ?? o.lg ?? x.md ?? o.md ?? x.sm ?? o.sm ?? x.xs ?? o.xs ?? x.span ?? s : A >= d.lg ? x.lg ?? o.lg ?? x.md ?? o.md ?? x.sm ?? o.sm ?? x.xs ?? o.xs ?? x.span ?? s : A >= d.md ? x.md ?? o.md ?? x.sm ?? o.sm ?? x.xs ?? o.xs ?? x.span ?? s : A >= d.sm ? x.sm ?? o.sm ?? x.xs ?? o.xs ?? x.span ?? s : x.xs ?? o.xs ?? x.span ?? s;
|
|
1062
|
+
}, { getSetting: y } = Re(), D = S(() => ({ ...y("ProForm"), ...t, ...m.value })), z = S(() => D.value.modelValue), g = S(() => z.value !== void 0), h = S(() => g.value ? z.value ?? {} : C.value), W = S(() => ({
|
|
1063
|
+
...y("ProForm").components ?? {},
|
|
1064
|
+
...D.value.components ?? {},
|
|
1065
|
+
...m.value.components ?? {}
|
|
1066
|
+
})), b = S(() => D.value.actionColOptions ?? { span: 24 }), M = k(typeof window < "u" ? window.innerWidth : 1920), j = (c, w, R, A) => {
|
|
1067
|
+
let x = 24, o = 1, s = 0;
|
|
1068
|
+
for (const _ of c) {
|
|
1069
|
+
const P = B(_.colProps, w, A);
|
|
1070
|
+
if (P > x) {
|
|
909
1071
|
if (o++, o > R)
|
|
910
1072
|
break;
|
|
911
|
-
|
|
1073
|
+
x = 24 - P;
|
|
912
1074
|
} else
|
|
913
|
-
|
|
1075
|
+
x -= P;
|
|
914
1076
|
s++;
|
|
915
1077
|
}
|
|
916
1078
|
return s;
|
|
917
|
-
}, F =
|
|
918
|
-
const
|
|
919
|
-
if (!
|
|
1079
|
+
}, F = S(() => {
|
|
1080
|
+
const c = v.value.filter((x) => Z(x));
|
|
1081
|
+
if (!D.value.showAdvancedButton)
|
|
920
1082
|
return !1;
|
|
921
|
-
const
|
|
922
|
-
return
|
|
923
|
-
}),
|
|
924
|
-
const
|
|
925
|
-
if (!
|
|
926
|
-
return
|
|
927
|
-
const
|
|
928
|
-
return
|
|
929
|
-
}), Z = (
|
|
930
|
-
let
|
|
931
|
-
return typeof
|
|
932
|
-
}, ee = (
|
|
933
|
-
const R =
|
|
934
|
-
return
|
|
935
|
-
if (!(
|
|
936
|
-
if (
|
|
937
|
-
R[
|
|
1083
|
+
const w = D.value.alwaysShowLines ?? 1, R = D.value.baseColProps, A = j(c, R, w, M.value);
|
|
1084
|
+
return c.length > A;
|
|
1085
|
+
}), N = S(() => D.value.formListeners ?? {}), L = S(() => {
|
|
1086
|
+
const c = v.value.filter((x) => Z(x));
|
|
1087
|
+
if (!D.value.showAdvancedButton || !r.value)
|
|
1088
|
+
return c;
|
|
1089
|
+
const w = D.value.alwaysShowLines ?? 1, R = D.value.baseColProps, A = j(c, R, w, M.value);
|
|
1090
|
+
return c.slice(0, A);
|
|
1091
|
+
}), Z = (c) => {
|
|
1092
|
+
let w = !0, R = !0;
|
|
1093
|
+
return typeof c.ifShow == "function" && (w = c.ifShow({ schema: c, values: h.value, model: h.value, field: c.field })), typeof c.ifShow == "boolean" && (w = c.ifShow), typeof c.show == "function" && (R = c.show({ schema: c, values: h.value, model: h.value, field: c.field })), typeof c.show == "boolean" && (R = c.show), w && R;
|
|
1094
|
+
}, ee = (c) => c.colProps ?? D.value.baseColProps ?? {}, H = (c) => c.slot || c.field, q = (c, w = !0) => {
|
|
1095
|
+
const R = w ? { ...c ?? {} } : {}, A = D.value.initialValues ?? t.initialValues;
|
|
1096
|
+
return v.value.forEach((x) => {
|
|
1097
|
+
if (!(w && Object.prototype.hasOwnProperty.call(R, x.field))) {
|
|
1098
|
+
if (x.defaultValue !== void 0) {
|
|
1099
|
+
R[x.field] = x.defaultValue;
|
|
938
1100
|
return;
|
|
939
1101
|
}
|
|
940
|
-
|
|
1102
|
+
A && Object.prototype.hasOwnProperty.call(A, x.field) && (R[x.field] = A[x.field]);
|
|
941
1103
|
}
|
|
942
1104
|
}), R;
|
|
943
|
-
}, Q = (
|
|
944
|
-
|
|
945
|
-
}, U = (
|
|
946
|
-
const
|
|
947
|
-
return Q(
|
|
1105
|
+
}, Q = (c, w = !0) => {
|
|
1106
|
+
C.value = c, w && l("update:modelValue", c);
|
|
1107
|
+
}, U = (c) => {
|
|
1108
|
+
const w = q({ ...h.value, ...c });
|
|
1109
|
+
return Q(w), w;
|
|
948
1110
|
}, Y = () => {
|
|
949
|
-
const
|
|
950
|
-
|
|
1111
|
+
const c = {};
|
|
1112
|
+
v.value.forEach((w) => {
|
|
951
1113
|
var R;
|
|
952
|
-
(R =
|
|
953
|
-
}), Q(q(
|
|
954
|
-
},
|
|
955
|
-
const
|
|
956
|
-
return
|
|
957
|
-
const
|
|
958
|
-
if (
|
|
1114
|
+
(R = w.rules) != null && R.length && (c[w.field] = w.rules);
|
|
1115
|
+
}), Q(q(h.value), !1), O.value = c;
|
|
1116
|
+
}, re = (c) => {
|
|
1117
|
+
const w = { ...c };
|
|
1118
|
+
return v.value.forEach((R) => {
|
|
1119
|
+
const A = R.ifShow;
|
|
1120
|
+
if (A === void 0)
|
|
959
1121
|
return;
|
|
960
|
-
(typeof
|
|
961
|
-
}),
|
|
962
|
-
},
|
|
963
|
-
const
|
|
1122
|
+
(typeof A == "boolean" ? A : A({ schema: R, values: c, model: c, field: R.field })) || delete w[R.field];
|
|
1123
|
+
}), w;
|
|
1124
|
+
}, p = (c) => {
|
|
1125
|
+
const w = re(c), R = m.value.fieldMapToTime;
|
|
964
1126
|
if (!(R != null && R.length))
|
|
965
|
-
return
|
|
966
|
-
const
|
|
967
|
-
return R.forEach(([
|
|
968
|
-
const
|
|
969
|
-
Array.isArray(
|
|
970
|
-
}),
|
|
971
|
-
},
|
|
972
|
-
var
|
|
1127
|
+
return w;
|
|
1128
|
+
const A = { ...w };
|
|
1129
|
+
return R.forEach(([x, [o, s]]) => {
|
|
1130
|
+
const _ = A[x];
|
|
1131
|
+
Array.isArray(_) && _.length === 2 && (delete A[x], A[o] = _[0], A[s] = _[1]);
|
|
1132
|
+
}), A;
|
|
1133
|
+
}, $ = async () => {
|
|
1134
|
+
var c;
|
|
973
1135
|
try {
|
|
974
|
-
await ((
|
|
975
|
-
} catch (
|
|
976
|
-
console.error("Form validation failed:",
|
|
1136
|
+
await ((c = u.value) == null ? void 0 : c.validate()), D.value.submitFunc ? await D.value.submitFunc() : (f.value = !0, l("submit", p({ ...h.value })));
|
|
1137
|
+
} catch (w) {
|
|
1138
|
+
console.error("Form validation failed:", w);
|
|
977
1139
|
} finally {
|
|
978
|
-
|
|
1140
|
+
f.value = !1;
|
|
979
1141
|
}
|
|
980
|
-
},
|
|
981
|
-
var
|
|
982
|
-
|
|
983
|
-
},
|
|
984
|
-
var
|
|
985
|
-
(
|
|
986
|
-
}, ne = (
|
|
987
|
-
U({ [
|
|
988
|
-
}, ae = (
|
|
989
|
-
var
|
|
990
|
-
return ((
|
|
991
|
-
}, le = (
|
|
992
|
-
|
|
993
|
-
}))) :
|
|
994
|
-
var
|
|
995
|
-
const R = (
|
|
996
|
-
return R && R.scrollIntoView({ behavior: (
|
|
997
|
-
}, me = (
|
|
998
|
-
var
|
|
999
|
-
(
|
|
1000
|
-
}, he = async (
|
|
1001
|
-
(Array.isArray(
|
|
1002
|
-
const
|
|
1003
|
-
|
|
1142
|
+
}, T = async () => {
|
|
1143
|
+
var c;
|
|
1144
|
+
D.value.resetFunc ? await D.value.resetFunc() : ((c = u.value) == null || c.resetFields(), Y(), l("reset"), D.value.submitOnReset && await $());
|
|
1145
|
+
}, V = (c) => (U(c), Promise.resolve()), K = () => p({ ...h.value }), X = async () => {
|
|
1146
|
+
var c;
|
|
1147
|
+
(c = u.value) == null || c.resetFields(), Q(q(void 0, !1));
|
|
1148
|
+
}, ne = (c, w) => {
|
|
1149
|
+
U({ [c]: w });
|
|
1150
|
+
}, ae = (c) => {
|
|
1151
|
+
var w;
|
|
1152
|
+
return ((w = u.value) == null ? void 0 : w.validate(c)) ?? Promise.resolve();
|
|
1153
|
+
}, le = (c) => u.value ? c != null && c.length ? Promise.all(c.map((w) => new Promise((R, A) => {
|
|
1154
|
+
u.value.validateField(w, (x) => x ? R(void 0) : A(new Error("Validation failed")));
|
|
1155
|
+
}))) : u.value.validate() : Promise.resolve(), ie = async (c, w) => {
|
|
1156
|
+
var A;
|
|
1157
|
+
const R = (A = a.value) == null ? void 0 : A.querySelector(`[data-field="${c}"]`);
|
|
1158
|
+
return R && R.scrollIntoView({ behavior: (w == null ? void 0 : w.behavior) ?? "smooth", block: (w == null ? void 0 : w.block) ?? "nearest" }), Promise.resolve();
|
|
1159
|
+
}, me = (c) => {
|
|
1160
|
+
var w;
|
|
1161
|
+
(w = u.value) == null || w.clearValidate(c);
|
|
1162
|
+
}, he = async (c) => {
|
|
1163
|
+
(Array.isArray(c) ? c : [c]).forEach((R) => {
|
|
1164
|
+
const A = v.value.findIndex((x) => x.field === R.field);
|
|
1165
|
+
A >= 0 && (v.value[A] = { ...v.value[A], ...R });
|
|
1004
1166
|
});
|
|
1005
|
-
}, _e = async (
|
|
1167
|
+
}, _e = async (c, w, R) => {
|
|
1006
1168
|
if (R)
|
|
1007
|
-
|
|
1008
|
-
else if (
|
|
1009
|
-
const
|
|
1010
|
-
|
|
1169
|
+
v.value.unshift(c);
|
|
1170
|
+
else if (w) {
|
|
1171
|
+
const A = v.value.findIndex((x) => x.field === w);
|
|
1172
|
+
v.value.splice(A + 1, 0, c);
|
|
1011
1173
|
} else
|
|
1012
|
-
|
|
1174
|
+
v.value.push(c);
|
|
1013
1175
|
Y();
|
|
1014
|
-
}, be = async (
|
|
1015
|
-
const
|
|
1016
|
-
|
|
1017
|
-
}, ge = async (
|
|
1018
|
-
|
|
1176
|
+
}, be = async (c) => {
|
|
1177
|
+
const w = Array.isArray(c) ? c : [c];
|
|
1178
|
+
v.value = v.value.filter((R) => !w.includes(R.field));
|
|
1179
|
+
}, ge = async (c) => {
|
|
1180
|
+
m.value = { ...m.value, ...c }, c.schemas && (v.value = [...c.schemas], Y());
|
|
1019
1181
|
}, pe = {
|
|
1020
|
-
getFieldsValue:
|
|
1021
|
-
setFieldsValue:
|
|
1022
|
-
resetFields:
|
|
1182
|
+
getFieldsValue: K,
|
|
1183
|
+
setFieldsValue: V,
|
|
1184
|
+
resetFields: X,
|
|
1023
1185
|
validate: ae,
|
|
1024
1186
|
validateFields: le,
|
|
1025
|
-
submit:
|
|
1187
|
+
submit: $,
|
|
1026
1188
|
scrollToField: ie,
|
|
1027
1189
|
clearValidate: me,
|
|
1028
1190
|
updateSchema: he,
|
|
@@ -1032,106 +1194,106 @@ const ze = dt.exports, ft = /* @__PURE__ */ oe({
|
|
|
1032
1194
|
};
|
|
1033
1195
|
e(pe);
|
|
1034
1196
|
const de = () => {
|
|
1035
|
-
|
|
1197
|
+
v.value = [...t.schemas ?? []], Y();
|
|
1036
1198
|
}, ce = () => {
|
|
1037
|
-
typeof window < "u" && (
|
|
1199
|
+
typeof window < "u" && (M.value = window.innerWidth);
|
|
1038
1200
|
};
|
|
1039
1201
|
return ve(() => {
|
|
1040
1202
|
de(), l("register", pe), typeof window < "u" && window.addEventListener("resize", ce);
|
|
1041
|
-
}),
|
|
1203
|
+
}), Fe(() => {
|
|
1042
1204
|
typeof window < "u" && window.removeEventListener("resize", ce);
|
|
1043
|
-
}),
|
|
1044
|
-
!
|
|
1045
|
-
}, { deep: !0, immediate: !0 }),
|
|
1205
|
+
}), J(() => z.value, (c) => {
|
|
1206
|
+
!g.value || c === void 0 || Q(q(c), !1);
|
|
1207
|
+
}, { deep: !0, immediate: !0 }), J(() => [t.schemas, t.initialValues], de, { deep: !0 }), { __sfc: !0, props: t, emit: l, slots: n, formRef: u, formWrapRef: a, submitLoading: f, collapsed: r, formModel: C, formRules: O, innerSchemas: v, innerProps: m, BREAKPOINTS: d, getEffectiveSpan: B, getComponentSetting: y, effectiveProps: D, controlledModelValue: z, isControlled: g, currentFormModel: h, formCustomComponents: W, effectiveActionColOptions: b, windowWidth: M, getVisibleSchemaCount: j, hasMoreFields: F, formListeners: N, displaySchemas: L, shouldShow: Z, getColProps: ee, getSlotName: H, resolveSchemaModel: q, applyFormModel: Q, updateFormModel: U, initForm: Y, filterByIfShow: re, processFieldMapToTime: p, handleSubmit: $, handleReset: T, setFieldsValue: V, getFieldsValue: K, resetFields: X, handleFieldChange: ne, validate: ae, validateFields: le, scrollToField: ie, clearValidate: me, updateSchema: he, appendSchemaByField: _e, removeSchemaByField: be, setProps: ge, formActionRef: pe, syncSchemas: de, handleResize: ce, ProFormItem: Ve, FormActions: We };
|
|
1046
1208
|
}
|
|
1047
1209
|
});
|
|
1048
|
-
var
|
|
1210
|
+
var Ft = function() {
|
|
1049
1211
|
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
1050
1212
|
return l("div", { ref: "formWrapRef", staticClass: "ecp-pro-form" }, [l("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"), l("el-row", { style: t.effectiveProps.baseRowStyle, attrs: { gutter: t.effectiveProps.gutter } }, [e._l(t.displaySchemas, function(n) {
|
|
1051
|
-
var
|
|
1052
|
-
return [t.shouldShow(n) ? l("el-col", e._b({ key: n.field, attrs: { offset: ((
|
|
1213
|
+
var u, a;
|
|
1214
|
+
return [t.shouldShow(n) ? l("el-col", e._b({ key: n.field, attrs: { offset: ((u = n.colProps) == null ? void 0 : u.offset) ?? ((a = t.effectiveProps.baseColProps) == null ? void 0 : a.offset) ?? 0, "data-field": n.field } }, "el-col", t.getColProps(n), !1), [l(t.ProFormItem, { attrs: { schema: n, "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 } }, [t.slots[t.getSlotName(n)] ? [e._t(t.getSlotName(n), null, { model: t.currentFormModel, schema: n, field: n.field, values: t.currentFormModel })] : e._e()], 2)], 1) : e._e()];
|
|
1053
1215
|
}), t.effectiveProps.showActionButtonGroup ? l("el-col", e._b({ staticClass: "ecp-pro-form_col" }, "el-col", t.hasMoreFields ? { span: 24 } : t.effectiveProps.actionColOptions || { span: 6 }, !1), [l(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(n) {
|
|
1054
1216
|
t.collapsed = !t.collapsed;
|
|
1055
1217
|
} } }, [l("template", { slot: "submitBefore" }, [e._t("submitBefore")], 2), l("template", { slot: "resetBefore" }, [e._t("resetBefore")], 2), l("template", { slot: "advanceBefore" }, [e._t("advanceBefore")], 2), l("template", { slot: "advanceAfter" }, [e._t("advanceAfter")], 2), l("template", { slot: "actions" }, [e._t("actions")], 2)], 2)], 1) : e._e()], 2), t.effectiveProps.showAdvancedButton && t.hasMoreFields ? l("el-button", { staticClass: "ecp-form-actions__advance", attrs: { type: "text" }, on: { click: function(n) {
|
|
1056
1218
|
t.collapsed = !t.collapsed;
|
|
1057
1219
|
} } }, [l("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);
|
|
1058
|
-
},
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1220
|
+
}, Rt = [], Bt = /* @__PURE__ */ se(
|
|
1221
|
+
St,
|
|
1222
|
+
Ft,
|
|
1223
|
+
Rt,
|
|
1062
1224
|
!1,
|
|
1063
1225
|
null,
|
|
1064
1226
|
"bf70afca",
|
|
1065
1227
|
null,
|
|
1066
1228
|
null
|
|
1067
1229
|
);
|
|
1068
|
-
const
|
|
1069
|
-
function
|
|
1070
|
-
const e =
|
|
1071
|
-
e.value =
|
|
1072
|
-
const
|
|
1073
|
-
|
|
1230
|
+
const Le = Bt.exports;
|
|
1231
|
+
function Et(i) {
|
|
1232
|
+
const e = k(null), l = k(i ? fe(i) : void 0), t = () => i ? fe(i) : void 0, n = (g) => {
|
|
1233
|
+
e.value = g;
|
|
1234
|
+
const h = t();
|
|
1235
|
+
h && Object.keys(h).length > 0 && g.setProps(h);
|
|
1074
1236
|
};
|
|
1075
|
-
return
|
|
1237
|
+
return i && J(
|
|
1076
1238
|
() => t(),
|
|
1077
|
-
(
|
|
1078
|
-
l.value =
|
|
1239
|
+
(g) => {
|
|
1240
|
+
l.value = g, g && e.value && e.value.setProps(g);
|
|
1079
1241
|
},
|
|
1080
1242
|
{ deep: !0 }
|
|
1081
1243
|
), [n, {
|
|
1082
1244
|
register: n,
|
|
1083
1245
|
formAction: e,
|
|
1084
1246
|
getFieldsValue: () => {
|
|
1085
|
-
var
|
|
1086
|
-
return ((
|
|
1247
|
+
var g;
|
|
1248
|
+
return ((g = e.value) == null ? void 0 : g.getFieldsValue()) ?? {};
|
|
1087
1249
|
},
|
|
1088
|
-
setFieldsValue: async (
|
|
1089
|
-
var
|
|
1090
|
-
await ((
|
|
1250
|
+
setFieldsValue: async (g) => {
|
|
1251
|
+
var h;
|
|
1252
|
+
await ((h = e.value) == null ? void 0 : h.setFieldsValue(g));
|
|
1091
1253
|
},
|
|
1092
1254
|
resetFields: async () => {
|
|
1093
|
-
var
|
|
1094
|
-
await ((
|
|
1255
|
+
var g;
|
|
1256
|
+
await ((g = e.value) == null ? void 0 : g.resetFields());
|
|
1095
1257
|
},
|
|
1096
|
-
validate: (
|
|
1097
|
-
var
|
|
1098
|
-
return ((
|
|
1258
|
+
validate: (g) => {
|
|
1259
|
+
var h;
|
|
1260
|
+
return ((h = e.value) == null ? void 0 : h.validate(g)) ?? Promise.resolve();
|
|
1099
1261
|
},
|
|
1100
|
-
validateFields: (
|
|
1101
|
-
var
|
|
1102
|
-
return ((
|
|
1262
|
+
validateFields: (g) => {
|
|
1263
|
+
var h;
|
|
1264
|
+
return ((h = e.value) == null ? void 0 : h.validateFields(g)) ?? Promise.resolve();
|
|
1103
1265
|
},
|
|
1104
1266
|
submit: () => {
|
|
1105
|
-
var
|
|
1106
|
-
return ((
|
|
1267
|
+
var g;
|
|
1268
|
+
return ((g = e.value) == null ? void 0 : g.submit()) ?? Promise.resolve();
|
|
1107
1269
|
},
|
|
1108
|
-
scrollToField: (
|
|
1270
|
+
scrollToField: (g, h) => {
|
|
1109
1271
|
var W;
|
|
1110
|
-
return ((W = e.value) == null ? void 0 : W.scrollToField(
|
|
1272
|
+
return ((W = e.value) == null ? void 0 : W.scrollToField(g, h)) ?? Promise.resolve();
|
|
1111
1273
|
},
|
|
1112
|
-
clearValidate: (
|
|
1113
|
-
var
|
|
1114
|
-
(
|
|
1274
|
+
clearValidate: (g) => {
|
|
1275
|
+
var h;
|
|
1276
|
+
(h = e.value) == null || h.clearValidate(g);
|
|
1115
1277
|
},
|
|
1116
|
-
updateSchema: (
|
|
1117
|
-
var
|
|
1118
|
-
return ((
|
|
1278
|
+
updateSchema: (g) => {
|
|
1279
|
+
var h;
|
|
1280
|
+
return ((h = e.value) == null ? void 0 : h.updateSchema(g)) ?? Promise.resolve();
|
|
1119
1281
|
},
|
|
1120
|
-
appendSchemaByField: (
|
|
1121
|
-
var
|
|
1122
|
-
return ((
|
|
1282
|
+
appendSchemaByField: (g, h, W) => {
|
|
1283
|
+
var b;
|
|
1284
|
+
return ((b = e.value) == null ? void 0 : b.appendSchemaByField(g, h, W)) ?? Promise.resolve();
|
|
1123
1285
|
},
|
|
1124
|
-
removeSchemaByField: (
|
|
1125
|
-
var
|
|
1126
|
-
return ((
|
|
1286
|
+
removeSchemaByField: (g) => {
|
|
1287
|
+
var h;
|
|
1288
|
+
return ((h = e.value) == null ? void 0 : h.removeSchemaByField(g)) ?? Promise.resolve();
|
|
1127
1289
|
},
|
|
1128
|
-
setProps: async (
|
|
1129
|
-
var
|
|
1130
|
-
l.value = { ...l.value, ...
|
|
1290
|
+
setProps: async (g) => {
|
|
1291
|
+
var h;
|
|
1292
|
+
l.value = { ...l.value, ...g }, await ((h = e.value) == null ? void 0 : h.setProps(g));
|
|
1131
1293
|
}
|
|
1132
1294
|
}];
|
|
1133
1295
|
}
|
|
1134
|
-
const
|
|
1296
|
+
const At = /* @__PURE__ */ oe({
|
|
1135
1297
|
__name: "ProDescriptions",
|
|
1136
1298
|
props: {
|
|
1137
1299
|
title: null,
|
|
@@ -1146,8 +1308,8 @@ const ht = /* @__PURE__ */ oe({
|
|
|
1146
1308
|
collapseOptions: { default: () => ({ canExpand: !1, defaultExpand: !0, expandButtonText: "展开", collapseButtonText: "收起", visibleRows: 1 }) }
|
|
1147
1309
|
},
|
|
1148
1310
|
emits: ["register"],
|
|
1149
|
-
setup(
|
|
1150
|
-
const t =
|
|
1311
|
+
setup(i, { expose: e, emit: l }) {
|
|
1312
|
+
const t = i, n = k({}), u = k({}), a = k([]), f = k(typeof window < "u" ? window.innerWidth : 1920), r = k(!0), C = oe({
|
|
1151
1313
|
name: "EcpDescriptionValueRenderer",
|
|
1152
1314
|
props: {
|
|
1153
1315
|
schema: { type: Object, required: !0 },
|
|
@@ -1155,139 +1317,139 @@ const ht = /* @__PURE__ */ oe({
|
|
|
1155
1317
|
record: { type: Object, required: !0 },
|
|
1156
1318
|
emptyText: { type: String, default: "-" }
|
|
1157
1319
|
},
|
|
1158
|
-
setup(
|
|
1320
|
+
setup(p) {
|
|
1159
1321
|
return () => {
|
|
1160
|
-
const
|
|
1161
|
-
const ne =
|
|
1322
|
+
const $ = p.schema, T = p.record, V = p.value, K = (X) => {
|
|
1323
|
+
const ne = O($, X === p.emptyText ? V : X, T), ae = ue("span", X);
|
|
1162
1324
|
return ne ? ue("el-tooltip", { props: ne }, [ae]) : ae;
|
|
1163
1325
|
};
|
|
1164
|
-
if (
|
|
1165
|
-
const
|
|
1166
|
-
return
|
|
1326
|
+
if ($.render) {
|
|
1327
|
+
const X = $.render(V, T);
|
|
1328
|
+
return X == null || X === "" ? K(p.emptyText) : typeof X == "string" || typeof X == "number" ? K(String(X)) : X;
|
|
1167
1329
|
}
|
|
1168
|
-
return Array.isArray(
|
|
1330
|
+
return Array.isArray(V) ? K(V.length ? V.join(", ") : p.emptyText) : V == null || V === "" ? K(p.emptyText) : K(typeof V == "object" ? JSON.stringify(V) : String(V));
|
|
1169
1331
|
};
|
|
1170
1332
|
}
|
|
1171
|
-
}),
|
|
1172
|
-
const
|
|
1173
|
-
if (!
|
|
1333
|
+
}), O = (p, $, T) => {
|
|
1334
|
+
const V = p.tooltip;
|
|
1335
|
+
if (!V)
|
|
1174
1336
|
return null;
|
|
1175
|
-
const
|
|
1176
|
-
return
|
|
1177
|
-
}, { getSetting:
|
|
1178
|
-
if (typeof
|
|
1179
|
-
return Math.max(1,
|
|
1180
|
-
const
|
|
1181
|
-
return
|
|
1182
|
-
},
|
|
1183
|
-
...
|
|
1184
|
-
dataIndex:
|
|
1185
|
-
}))),
|
|
1186
|
-
const
|
|
1187
|
-
let
|
|
1188
|
-
const
|
|
1189
|
-
return z.value.forEach((
|
|
1190
|
-
const ne = z.value.length -
|
|
1191
|
-
|
|
1192
|
-
const ie = ne === 1 &&
|
|
1193
|
-
|
|
1194
|
-
}),
|
|
1195
|
-
}),
|
|
1196
|
-
var
|
|
1337
|
+
const K = typeof V == "function" ? V({ value: $, record: T, schema: p }) : V;
|
|
1338
|
+
return Be(K, $);
|
|
1339
|
+
}, { getSetting: v } = Re(), m = S(() => ({ ...v("ProDescriptions"), ...t, ...n.value })), d = { xxl: 1920, xl: 1200, lg: 992, md: 768, sm: 576 }, B = (p, $) => {
|
|
1340
|
+
if (typeof p == "number")
|
|
1341
|
+
return Math.max(1, p);
|
|
1342
|
+
const T = p ?? {};
|
|
1343
|
+
return $ >= d.xxl ? T.xxl ?? T.xl ?? T.lg ?? T.md ?? T.sm ?? T.xs ?? 3 : $ >= d.xl ? T.xl ?? T.lg ?? T.md ?? T.sm ?? T.xs ?? 3 : $ >= d.lg ? T.lg ?? T.md ?? T.sm ?? T.xs ?? 3 : $ >= d.md ? T.md ?? T.sm ?? T.xs ?? 3 : $ >= d.sm ? T.sm ?? T.xs ?? 2 : T.xs ?? 1;
|
|
1344
|
+
}, y = S(() => B(m.value.column, f.value)), D = S(() => m.value.data ?? u.value ?? {}), z = S(() => (a.value.length ? a.value : m.value.schema ?? []).filter((p) => p.dataIndex || p.field ? typeof p.show == "function" ? p.show(D.value) : p.show !== !1 : !1).map((p) => ({
|
|
1345
|
+
...p,
|
|
1346
|
+
dataIndex: p.dataIndex || p.field || ""
|
|
1347
|
+
}))), g = S(() => {
|
|
1348
|
+
const p = [];
|
|
1349
|
+
let $ = { items: [] }, T = 0;
|
|
1350
|
+
const V = y.value;
|
|
1351
|
+
return z.value.forEach((K, X) => {
|
|
1352
|
+
const ne = z.value.length - X, ae = Math.max(1, Math.min(K.span ?? 1, V)), le = ne === 1 ? V - T || V : ae;
|
|
1353
|
+
T + le > V && (p.push($), $ = { items: [] }, T = 0);
|
|
1354
|
+
const ie = ne === 1 && T < V ? Math.max(1, V - T) : le;
|
|
1355
|
+
$.items.push({ ...K, _span: ie }), T += ie, T >= V && (p.push($), $ = { items: [] }, T = 0);
|
|
1356
|
+
}), $.items.length > 0 && p.push($), p;
|
|
1357
|
+
}), h = S(() => {
|
|
1358
|
+
var $;
|
|
1197
1359
|
if (!W.value || r.value)
|
|
1198
|
-
return
|
|
1199
|
-
const
|
|
1200
|
-
return
|
|
1201
|
-
}), W =
|
|
1202
|
-
var
|
|
1203
|
-
const
|
|
1204
|
-
return !!
|
|
1205
|
-
}),
|
|
1206
|
-
var
|
|
1360
|
+
return g.value;
|
|
1361
|
+
const p = Math.max(1, (($ = m.value.collapseOptions) == null ? void 0 : $.visibleRows) ?? 1);
|
|
1362
|
+
return g.value.slice(0, p);
|
|
1363
|
+
}), W = S(() => {
|
|
1364
|
+
var $, T;
|
|
1365
|
+
const p = Math.max(1, (($ = m.value.collapseOptions) == null ? void 0 : $.visibleRows) ?? 1);
|
|
1366
|
+
return !!m.value.useCollapse && !!((T = m.value.collapseOptions) != null && T.canExpand) && g.value.length > p;
|
|
1367
|
+
}), b = S(() => !!m.value.title || !!m.value.helpMessage || W.value), M = S(() => {
|
|
1368
|
+
var p, $;
|
|
1207
1369
|
return {
|
|
1208
|
-
expand: ((
|
|
1209
|
-
collapse: ((
|
|
1370
|
+
expand: ((p = m.value.collapseOptions) == null ? void 0 : p.expandButtonText) ?? "展开",
|
|
1371
|
+
collapse: (($ = m.value.collapseOptions) == null ? void 0 : $.collapseButtonText) ?? "收起"
|
|
1210
1372
|
};
|
|
1211
|
-
}), j =
|
|
1212
|
-
gridTemplateColumns: `repeat(${
|
|
1213
|
-
})), F = (
|
|
1214
|
-
gridColumn: `span ${
|
|
1215
|
-
}),
|
|
1216
|
-
minWidth:
|
|
1217
|
-
...
|
|
1218
|
-
}),
|
|
1219
|
-
minWidth:
|
|
1220
|
-
...
|
|
1221
|
-
}), Z = (
|
|
1222
|
-
a.value = [...
|
|
1373
|
+
}), j = S(() => ({
|
|
1374
|
+
gridTemplateColumns: `repeat(${y.value}, minmax(0, 1fr))`
|
|
1375
|
+
})), F = (p) => ({
|
|
1376
|
+
gridColumn: `span ${p._span}`
|
|
1377
|
+
}), N = (p) => ({
|
|
1378
|
+
minWidth: p.labelMinWidth ? `${p.labelMinWidth}px` : void 0,
|
|
1379
|
+
...p.labelStyle ?? {}
|
|
1380
|
+
}), L = (p) => ({
|
|
1381
|
+
minWidth: p.contentMinWidth ? `${p.contentMinWidth}px` : void 0,
|
|
1382
|
+
...p.contentStyle ?? {}
|
|
1383
|
+
}), Z = (p) => D.value[p.dataIndex], ee = () => {
|
|
1384
|
+
a.value = [...m.value.schema ?? []];
|
|
1223
1385
|
}, H = () => {
|
|
1224
|
-
|
|
1225
|
-
}, q = async (
|
|
1226
|
-
n.value = { ...n.value, ...
|
|
1227
|
-
}, Q = async (
|
|
1228
|
-
|
|
1229
|
-
}, U = () => ({ ...
|
|
1386
|
+
u.value = { ...m.value.data ?? {} };
|
|
1387
|
+
}, q = async (p) => {
|
|
1388
|
+
n.value = { ...n.value, ...p }, p.schema && (a.value = [...p.schema]), p.data && (u.value = { ...p.data });
|
|
1389
|
+
}, Q = async (p) => {
|
|
1390
|
+
u.value = { ...u.value, ...p }, n.value = { ...n.value, data: u.value };
|
|
1391
|
+
}, U = () => ({ ...m.value.data ?? u.value ?? {} }), Y = {
|
|
1230
1392
|
setProps: q,
|
|
1231
1393
|
setData: Q,
|
|
1232
1394
|
getData: U
|
|
1233
1395
|
};
|
|
1234
1396
|
e(Y);
|
|
1235
|
-
const
|
|
1236
|
-
typeof window < "u" && (
|
|
1397
|
+
const re = () => {
|
|
1398
|
+
typeof window < "u" && (f.value = window.innerWidth);
|
|
1237
1399
|
};
|
|
1238
1400
|
return ve(() => {
|
|
1239
|
-
var
|
|
1240
|
-
ee(), H(), r.value = ((
|
|
1241
|
-
}),
|
|
1242
|
-
typeof window < "u" && window.removeEventListener("resize",
|
|
1243
|
-
}),
|
|
1244
|
-
var
|
|
1245
|
-
return (
|
|
1246
|
-
}, (
|
|
1247
|
-
|
|
1248
|
-
}), { __sfc: !0, props: t, emit: l, innerProps: n, innerData:
|
|
1401
|
+
var p;
|
|
1402
|
+
ee(), H(), r.value = ((p = m.value.collapseOptions) == null ? void 0 : p.defaultExpand) !== !1, l("register", Y), typeof window < "u" && window.addEventListener("resize", re);
|
|
1403
|
+
}), Fe(() => {
|
|
1404
|
+
typeof window < "u" && window.removeEventListener("resize", re);
|
|
1405
|
+
}), J(() => m.value.schema, ee, { deep: !0 }), J(() => m.value.data, H, { deep: !0 }), J(() => {
|
|
1406
|
+
var p;
|
|
1407
|
+
return (p = m.value.collapseOptions) == null ? void 0 : p.defaultExpand;
|
|
1408
|
+
}, (p) => {
|
|
1409
|
+
p !== void 0 && (r.value = p);
|
|
1410
|
+
}), { __sfc: !0, props: t, emit: l, innerProps: n, innerData: u, innerSchema: a, windowWidth: f, expanded: r, DescriptionValueRenderer: C, normalizeTooltip: O, getSetting: v, effectiveProps: m, breakpoints: d, resolveColumn: B, currentColumn: y, effectiveData: D, visibleSchema: z, normalizedRows: g, renderedRows: h, showCollapseButton: W, showHeader: b, collapseButtonText: M, bodyStyle: j, getItemStyle: F, getLabelStyle: N, getContentStyle: L, getItemValue: Z, syncSchema: ee, syncData: H, setProps: q, setData: Q, getData: U, descriptionAction: Y, updateWindowWidth: re };
|
|
1249
1411
|
}
|
|
1250
1412
|
});
|
|
1251
|
-
var
|
|
1413
|
+
var Mt = function() {
|
|
1252
1414
|
var n;
|
|
1253
1415
|
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
1254
|
-
return l("div", { staticClass: "ecp-pro-descriptions" }, [t.showHeader ? l("div", { staticClass: "ecp-pro-descriptions__header" }, [l("div", { staticClass: "ecp-pro-descriptions__title-wrap" }, [t.effectiveProps.title ? l("span", { staticClass: "ecp-pro-descriptions__title" }, [e._v(e._s(t.effectiveProps.title))]) : e._e(), t.effectiveProps.helpMessage ? l("el-tooltip", { attrs: { placement: "top", effect: "dark" } }, [l("template", { slot: "content" }, [Array.isArray(t.effectiveProps.helpMessage) ? l("span", e._l(t.effectiveProps.helpMessage, function(
|
|
1255
|
-
return l("div", { key: a }, [e._v(e._s(
|
|
1256
|
-
}), 0) : l("span", [e._v(e._s(t.effectiveProps.helpMessage))])]), l("i", { staticClass: "el-icon-question ecp-pro-descriptions__help" })], 2) : e._e(), (n = t.effectiveProps.collapseOptions) != null && n.helpMessage ? l("el-tooltip", { attrs: { placement: "top", effect: "dark" } }, [l("template", { slot: "content" }, [Array.isArray(t.effectiveProps.collapseOptions.helpMessage) ? l("span", e._l(t.effectiveProps.collapseOptions.helpMessage, function(
|
|
1257
|
-
return l("div", { key: `collapse-${a}` }, [e._v(e._s(
|
|
1258
|
-
}), 0) : l("span", [e._v(e._s(t.effectiveProps.collapseOptions.helpMessage))])]), l("i", { staticClass: "el-icon-info ecp-pro-descriptions__help" })], 2) : e._e()], 1), t.showCollapseButton ? l("el-button", { staticClass: "ecp-pro-descriptions__toggle", attrs: { type: "text" }, on: { click: function(
|
|
1416
|
+
return l("div", { staticClass: "ecp-pro-descriptions" }, [t.showHeader ? l("div", { staticClass: "ecp-pro-descriptions__header" }, [l("div", { staticClass: "ecp-pro-descriptions__title-wrap" }, [t.effectiveProps.title ? l("span", { staticClass: "ecp-pro-descriptions__title" }, [e._v(e._s(t.effectiveProps.title))]) : e._e(), t.effectiveProps.helpMessage ? l("el-tooltip", { attrs: { placement: "top", effect: "dark" } }, [l("template", { slot: "content" }, [Array.isArray(t.effectiveProps.helpMessage) ? l("span", e._l(t.effectiveProps.helpMessage, function(u, a) {
|
|
1417
|
+
return l("div", { key: a }, [e._v(e._s(u))]);
|
|
1418
|
+
}), 0) : l("span", [e._v(e._s(t.effectiveProps.helpMessage))])]), l("i", { staticClass: "el-icon-question ecp-pro-descriptions__help" })], 2) : e._e(), (n = t.effectiveProps.collapseOptions) != null && n.helpMessage ? l("el-tooltip", { attrs: { placement: "top", effect: "dark" } }, [l("template", { slot: "content" }, [Array.isArray(t.effectiveProps.collapseOptions.helpMessage) ? l("span", e._l(t.effectiveProps.collapseOptions.helpMessage, function(u, a) {
|
|
1419
|
+
return l("div", { key: `collapse-${a}` }, [e._v(e._s(u))]);
|
|
1420
|
+
}), 0) : l("span", [e._v(e._s(t.effectiveProps.collapseOptions.helpMessage))])]), l("i", { staticClass: "el-icon-info ecp-pro-descriptions__help" })], 2) : e._e()], 1), t.showCollapseButton ? l("el-button", { staticClass: "ecp-pro-descriptions__toggle", attrs: { type: "text" }, on: { click: function(u) {
|
|
1259
1421
|
t.expanded = !t.expanded;
|
|
1260
1422
|
} } }, [e._v(" " + e._s(t.expanded ? t.collapseButtonText.collapse : t.collapseButtonText.expand) + " "), l("i", { staticClass: "el-icon-arrow-down", class: t.expanded ? "is-expanded" : "" })]) : e._e()], 1) : e._e(), l("div", e._b({ staticClass: "ecp-pro-descriptions__body", class: [
|
|
1261
1423
|
`is-${t.effectiveProps.size}`,
|
|
1262
1424
|
{ "is-bordered": t.effectiveProps.bordered, "is-collapsed": t.showCollapseButton && !t.expanded }
|
|
1263
|
-
], style: t.bodyStyle }, "div", e.$attrs, !1), [e._l(t.renderedRows, function(
|
|
1264
|
-
return [e._l(
|
|
1265
|
-
return [l("div", { key: `${a}-${
|
|
1425
|
+
], style: t.bodyStyle }, "div", e.$attrs, !1), [e._l(t.renderedRows, function(u, a) {
|
|
1426
|
+
return [e._l(u.items, function(f) {
|
|
1427
|
+
return [l("div", { key: `${a}-${f.dataIndex || f.field}`, staticClass: "ecp-pro-descriptions__item", style: t.getItemStyle(f) }, [l("div", { staticClass: "ecp-pro-descriptions__label", style: t.getLabelStyle(f) }, [e._v(" " + e._s(f.label) + " ")]), l("div", { staticClass: "ecp-pro-descriptions__content", style: t.getContentStyle(f) }, [e.$scopedSlots[f.slot || f.dataIndex] ? e._t(f.slot || f.dataIndex, null, { value: t.getItemValue(f), record: t.effectiveData, schema: f }) : l(t.DescriptionValueRenderer, { attrs: { schema: f, value: t.getItemValue(f), record: t.effectiveData, "empty-text": t.effectiveProps.emptyText || "-" } })], 2)])];
|
|
1266
1428
|
})];
|
|
1267
1429
|
})], 2)]);
|
|
1268
|
-
},
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1430
|
+
}, Tt = [], kt = /* @__PURE__ */ se(
|
|
1431
|
+
At,
|
|
1432
|
+
Mt,
|
|
1433
|
+
Tt,
|
|
1272
1434
|
!1,
|
|
1273
1435
|
null,
|
|
1274
1436
|
"7d6cd376",
|
|
1275
1437
|
null,
|
|
1276
1438
|
null
|
|
1277
1439
|
);
|
|
1278
|
-
const
|
|
1279
|
-
function
|
|
1280
|
-
const e =
|
|
1440
|
+
const Ke = kt.exports;
|
|
1441
|
+
function Nt(i) {
|
|
1442
|
+
const e = k(null), l = () => i ? fe(i) : void 0, t = () => {
|
|
1281
1443
|
const a = fe(e);
|
|
1282
1444
|
if (!a)
|
|
1283
1445
|
throw new Error("ProDescriptions instance has not been registered");
|
|
1284
1446
|
return a;
|
|
1285
1447
|
}, n = (a) => {
|
|
1286
1448
|
e.value = a;
|
|
1287
|
-
const
|
|
1288
|
-
|
|
1449
|
+
const f = l();
|
|
1450
|
+
f && Object.keys(f).length > 0 && a.setProps(f);
|
|
1289
1451
|
};
|
|
1290
|
-
return
|
|
1452
|
+
return i && J(
|
|
1291
1453
|
() => l(),
|
|
1292
1454
|
(a) => {
|
|
1293
1455
|
a && e.value && e.value.setProps(a);
|
|
@@ -1299,38 +1461,48 @@ function Ft(p) {
|
|
|
1299
1461
|
getData: () => t().getData()
|
|
1300
1462
|
}];
|
|
1301
1463
|
}
|
|
1302
|
-
const
|
|
1303
|
-
{ name: "ProTable", component:
|
|
1304
|
-
{ name: "TableAction", component:
|
|
1305
|
-
{ name: "ProForm", component:
|
|
1306
|
-
{ name: "ProFormItem", component:
|
|
1307
|
-
{ name: "FormActions", component:
|
|
1308
|
-
{ name: "
|
|
1464
|
+
const Dt = [
|
|
1465
|
+
{ name: "ProTable", component: Ee },
|
|
1466
|
+
{ name: "TableAction", component: Ne },
|
|
1467
|
+
{ name: "ProForm", component: Le },
|
|
1468
|
+
{ name: "ProFormItem", component: Ve },
|
|
1469
|
+
{ name: "FormActions", component: We },
|
|
1470
|
+
{ name: "FormattedNumberInput", component: Ae },
|
|
1471
|
+
{ name: "ProDescriptions", component: Ke }
|
|
1309
1472
|
];
|
|
1310
|
-
function
|
|
1311
|
-
|
|
1312
|
-
|
|
1473
|
+
function $t(i) {
|
|
1474
|
+
Dt.forEach(({ name: e, component: l }) => {
|
|
1475
|
+
i.component(e, l);
|
|
1313
1476
|
});
|
|
1314
1477
|
}
|
|
1315
|
-
const
|
|
1316
|
-
install:
|
|
1317
|
-
ProTable:
|
|
1318
|
-
ProForm:
|
|
1319
|
-
ProDescriptions:
|
|
1320
|
-
TableAction:
|
|
1478
|
+
const Vt = {
|
|
1479
|
+
install: $t,
|
|
1480
|
+
ProTable: Ee,
|
|
1481
|
+
ProForm: Le,
|
|
1482
|
+
ProDescriptions: Ke,
|
|
1483
|
+
TableAction: Ne,
|
|
1484
|
+
FormattedNumberInput: Ae
|
|
1321
1485
|
};
|
|
1322
1486
|
export {
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1487
|
+
We as FormActions,
|
|
1488
|
+
Ae as FormattedNumberInput,
|
|
1489
|
+
Ke as ProDescriptions,
|
|
1490
|
+
Le as ProForm,
|
|
1491
|
+
Ve as ProFormItem,
|
|
1492
|
+
Ee as ProTable,
|
|
1493
|
+
Ne as TableAction,
|
|
1494
|
+
ze as clampByIntegerDigits,
|
|
1495
|
+
Vt as default,
|
|
1496
|
+
Ie as formatWithThousands,
|
|
1497
|
+
$t as install,
|
|
1498
|
+
Pe as normalizeNumericValue,
|
|
1499
|
+
rt as numberToEditString,
|
|
1500
|
+
st as roundToDecimals,
|
|
1501
|
+
$e as sanitizeNumericInput,
|
|
1502
|
+
xe as stripNumberGrouping,
|
|
1503
|
+
Re as useComponentSetting,
|
|
1504
|
+
Nt as useDescription,
|
|
1505
|
+
Et as useForm,
|
|
1506
|
+
Ot as useProTable
|
|
1335
1507
|
};
|
|
1336
1508
|
//# sourceMappingURL=element-component-pro.es.js.map
|