@aspire-ui/element-component-pro 1.0.7 → 1.0.9
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 +836 -654
- 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 +20 -0
- package/package.json +1 -1
- package/src/ProForm/FormattedNumberInput.vue +128 -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 +126 -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 h, 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 = (h = s.valueEnum) == null ? void 0 : h[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
|
+
}), d = 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, h = 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])(h).length > 0)
|
|
96
|
+
return h;
|
|
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(), y = k(0), O = k(t.loading ?? !1), v = k([]), x = k({}), u = k([]), F = k({}), _ = 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(), m = S(() => ({ ...g("ProTable"), ...t, ...F.value })), W = S(() => !!m.value.title || !!a.tableTitle || !!a.toolbar), b = S(() => D.value !== null ? D.value : !!t.pagination && typeof t.pagination == "object"), M = S(() => m.value.rowKey || "id"), j = S(() => new Set(_.value.map((o) => o[M.value]))), R = S(
|
|
107
|
+
() => u.value.filter((o) => !o.hideInTable && !o.defaultHidden)
|
|
108
|
+
), N = S(() => {
|
|
109
|
+
var s, h;
|
|
110
110
|
let o = 0;
|
|
111
|
-
return
|
|
112
|
-
}),
|
|
111
|
+
return m.value.rowSelection && (o += Number(m.value.rowSelection.width) || 48), m.value.showIndexColumn && (o += Number((s = m.value.indexColumnProps) == null ? void 0 : s.width) || 60), m.value.actionColumn && (o += Number((h = m.value.actionColumn) == null ? void 0 : h.width) || 150), o;
|
|
112
|
+
}), L = (o) => typeof o == "number" && o > 0, Z = S(() => R.value.filter((s) => Q(s) && L(s.width)).reduce((s, h) => s + (typeof h.width == "number" ? h.width : 0), 0)), ee = S(() => R.value.filter((s) => Q(s) && typeof s.width == "string").reduce((s, h) => s + (Number(q(h)) || 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 && y.value > 0 && typeof s == "number") {
|
|
115
|
+
const h = y.value - N.value - ee.value;
|
|
116
|
+
let P = Math.floor(h * 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 = H(s) ?? 80, P = H(o.minWidth), E = H(o.maxWidth);
|
|
122
|
+
let I = h;
|
|
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 = m.value.rowSelection) == null ? void 0 : s.getCheckboxProps;
|
|
129
|
+
return o ? v.value.filter((h) => {
|
|
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(h)) != 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, h, P;
|
|
138
|
+
return ((P = (h = (s = m.value.rowSelection) == null ? void 0 : s.getCheckboxProps) == null ? void 0 : h.call(s, o)) == null ? void 0 : P.disabled) ?? !1;
|
|
139
|
+
}, V = (o) => {
|
|
140
|
+
var s, h, P;
|
|
141
|
+
return ((P = (h = (s = m.value.rowSelection) == null ? void 0 : s.getRadioProps) == null ? void 0 : h.call(s, o)) == null ? void 0 : P.disabled) ?? !1;
|
|
142
|
+
}, K = () => {
|
|
143
|
+
const o = _.value.map((s) => s[M.value]);
|
|
144
|
+
l("selection-change", { keys: o, rows: _.value });
|
|
145
|
+
}, X = (o, s) => {
|
|
146
|
+
const h = o[M.value];
|
|
147
|
+
s ? _.value = [..._.value.filter((P) => P[M.value] !== h), o] : _.value = _.value.filter((P) => P[M.value] !== h), K();
|
|
148
148
|
}, ne = (o) => {
|
|
149
|
-
|
|
149
|
+
_.value = [o], K();
|
|
150
150
|
}, ae = (o) => {
|
|
151
151
|
if (o) {
|
|
152
|
-
const s = new Set(
|
|
153
|
-
|
|
152
|
+
const s = new Set(_.value.map((P) => P[M.value])), h = U.value.filter((P) => !s.has(P[M.value]));
|
|
153
|
+
_.value = [..._.value, ...h];
|
|
154
154
|
} else {
|
|
155
|
-
const s = new Set(
|
|
156
|
-
|
|
155
|
+
const s = new Set(v.value.map((h) => h[M.value]));
|
|
156
|
+
_.value = _.value.filter((h) => !s.has(h[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 = m.value.fetchSetting ?? {}, h = s.pageField ?? "page", P = s.sizeField ?? "pageSize", E = s.listField ?? "list", I = s.totalField ?? "total", G = {
|
|
169
|
+
[h]: (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
|
-
const te = t.beforeFetch ? t.beforeFetch(G) : G,
|
|
176
|
-
|
|
177
|
-
const ye = t.afterFetch ? t.afterFetch(
|
|
178
|
-
|
|
175
|
+
const te = t.beforeFetch ? t.beforeFetch(G) : G, xe = await t.api(te);
|
|
176
|
+
x.value = xe || {};
|
|
177
|
+
const ye = t.afterFetch ? t.afterFetch(xe) : xe, 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
|
+
m.value.clearSelectOnPageChange && (_.value = []), z.value.pageSize = o, z.value.page = 1, le(void 0);
|
|
186
186
|
}, he = (o) => {
|
|
187
|
-
|
|
188
|
-
}, _e = (o, s,
|
|
187
|
+
m.value.clearSelectOnPageChange && (_.value = []), z.value.page = o, le(void 0);
|
|
188
|
+
}, _e = (o, s, h) => l("row-click", o, h), be = (o, s, h) => l("row-dblclick", o, h), 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
|
+
F.value = { ...F.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: () => x.value,
|
|
202
202
|
setTableData: (o) => {
|
|
203
|
-
|
|
203
|
+
v.value = o ?? [];
|
|
204
204
|
},
|
|
205
|
-
getColumns: () =>
|
|
205
|
+
getColumns: () => u.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, h = (t.columns ?? []).filter((E) => s.includes(E.key ?? E.dataIndex)), P = s.map((E) => h.find((I) => (I.key ?? I.dataIndex) === E)).filter(Boolean);
|
|
209
|
+
P.length && (u.value = P);
|
|
210
210
|
} else
|
|
211
|
-
|
|
211
|
+
u.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: () => _.value.map((o) => o[M.value]),
|
|
217
|
+
getSelectRows: () => _.value,
|
|
218
218
|
clearSelectedRowKeys: () => {
|
|
219
|
-
|
|
219
|
+
_.value = [], K();
|
|
220
220
|
},
|
|
221
221
|
setSelectedRowKeys: (o) => {
|
|
222
|
-
const s = new Set(o),
|
|
222
|
+
const s = new Set(o), h = v.value.filter((P) => s.has(P[M.value]));
|
|
223
223
|
o.forEach((P) => {
|
|
224
|
-
|
|
225
|
-
}),
|
|
224
|
+
h.some((E) => E[M.value] === P) || h.push({ [M.value]: P });
|
|
225
|
+
}), _.value = h, K();
|
|
226
226
|
},
|
|
227
227
|
deleteSelectRowByKey: (o) => {
|
|
228
|
-
|
|
228
|
+
_.value = _.value.filter((s) => s[M.value] !== o), K();
|
|
229
229
|
},
|
|
230
|
-
updateTableData: (o, s,
|
|
231
|
-
o < 0 || o >=
|
|
230
|
+
updateTableData: (o, s, h) => {
|
|
231
|
+
o < 0 || o >= v.value.length || (v.value = [...v.value], v.value[o] = { ...v.value[o], [s]: h });
|
|
232
232
|
},
|
|
233
233
|
updateTableDataRecord: (o, s) => {
|
|
234
|
-
const
|
|
235
|
-
if (!(
|
|
236
|
-
return
|
|
234
|
+
const h = de(o);
|
|
235
|
+
if (!(h < 0))
|
|
236
|
+
return v.value = [...v.value], v.value[h] = { ...v.value[h], ...s }, v.value[h];
|
|
237
237
|
},
|
|
238
238
|
deleteTableDataRecord: (o) => {
|
|
239
|
-
const s = Array.isArray(o) ? o : [o],
|
|
240
|
-
|
|
239
|
+
const s = Array.isArray(o) ? o : [o], h = new Set(s);
|
|
240
|
+
v.value = v.value.filter((P) => !h.has(P[M.value]));
|
|
241
241
|
},
|
|
242
242
|
insertTableDataRecord: (o, s) => {
|
|
243
|
-
const
|
|
244
|
-
return s == null || s >=
|
|
243
|
+
const h = [...v.value];
|
|
244
|
+
return s == null || s >= h.length ? h.push(o) : h.splice(s, 0, o), v.value = h, 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: () => m.value.rowSelection,
|
|
252
252
|
expandAll: () => {
|
|
253
253
|
var P;
|
|
254
|
-
const o = ((P =
|
|
255
|
-
const
|
|
256
|
-
return
|
|
257
|
-
|
|
254
|
+
const o = ((P = m.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 = m.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 &&
|
|
288
|
-
},
|
|
289
|
-
r.value && (
|
|
284
|
+
const c = () => {
|
|
285
|
+
u.value = [...t.columns ?? []];
|
|
286
|
+
}, w = () => {
|
|
287
|
+
t.api && m.value.immediate !== !1 ? le(void 0) : t.dataSource && (v.value = [...t.dataSource], !t.api && t.pagination !== !1 && (z.value.total = t.dataSource.length));
|
|
288
|
+
}, B = () => {
|
|
289
|
+
r.value && (y.value = r.value.offsetWidth || 0);
|
|
290
290
|
};
|
|
291
|
-
let
|
|
291
|
+
let A = null, C = null;
|
|
292
292
|
return ve(() => {
|
|
293
|
-
|
|
294
|
-
|
|
293
|
+
c(), l("register", ce), w(), typeof window < "u" && (window.addEventListener("resize", B), A = new ResizeObserver(B), Oe(() => {
|
|
294
|
+
B(), C = r.value, C && (A == null || A.observe(C));
|
|
295
295
|
}));
|
|
296
|
-
}),
|
|
297
|
-
typeof window < "u" && (window.removeEventListener("resize",
|
|
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", B), A && C && (A.unobserve(C), C = 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: d, props: t, emit: l, slots: a, tableRef: f, tableWrapRef: r, containerWidth: y, loading: O, innerData: v, rawDataSource: x, innerColumns: u, innerProps: F, selectedRows: _, showPaginationRef: D, pagination: z, getComponentSetting: g, effectiveProps: m, showTitleBar: W, showPagination: b, rowKeyField: M, selectedKeysSet: j, displayColumns: R, 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: B, resizeObserver: A, observedEl: C };
|
|
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, d, 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), d && (r._scopeId = "data-v-" + d);
|
|
308
|
+
var y;
|
|
309
|
+
if (a ? (y = function(x) {
|
|
310
|
+
x = x || // 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, !x && typeof __VUE_SSR_CONTEXT__ < "u" && (x = __VUE_SSR_CONTEXT__), n && n.call(this, x), x && x._registeredComponents && x._registeredComponents.add(a);
|
|
313
|
+
}, r._ssrRegister = y) : n && (y = 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), y)
|
|
319
319
|
if (r.functional) {
|
|
320
|
-
r._injectStyles =
|
|
321
|
-
var
|
|
322
|
-
r.render = function(
|
|
323
|
-
return
|
|
320
|
+
r._injectStyles = y;
|
|
321
|
+
var O = r.render;
|
|
322
|
+
r.render = function(u, F) {
|
|
323
|
+
return y.call(F), O(u, F);
|
|
324
324
|
};
|
|
325
325
|
} else {
|
|
326
|
-
var
|
|
327
|
-
r.beforeCreate =
|
|
326
|
+
var v = r.beforeCreate;
|
|
327
|
+
r.beforeCreate = v ? [].concat(v, y) : [y];
|
|
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, d, 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, y) {
|
|
338
|
+
return l("div", { key: y }, [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 y;
|
|
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: (y = t.selectedRows[0]) == null ? void 0 : y[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: ((d = t.effectiveProps.indexColumnProps) == null ? void 0 : d.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(y) {
|
|
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(y) {
|
|
359
|
+
return [r.dataIndex && e.$scopedSlots[r.dataIndex] ? e._t(r.dataIndex, null, { row: y.row, column: r, index: y.$index, value: y.row[r.dataIndex] }) : e.$scopedSlots.bodyCell ? l(t.BodyCellRenderer, { attrs: { "slot-render": e.$scopedSlots.bodyCell, column: r, record: y.row, index: y.$index, value: y.row[r.dataIndex], "custom-render": r.customRender, "value-enum": r.valueEnum } }) : l(t.DefaultCellRenderer, { attrs: { column: r, record: y.row, index: y.$index, value: y.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, De = (i) => Array.isArray(i) ? i.length > 0 : i != null && String(i).trim() !== "", ke = (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
379
|
content: ke(e),
|
|
380
380
|
placement: "top",
|
|
381
381
|
effect: "dark",
|
|
382
|
-
disabled: !
|
|
382
|
+
disabled: !De(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 = ke(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 = !
|
|
392
|
-
},
|
|
390
|
+
const l = { ...i };
|
|
391
|
+
return Object.prototype.hasOwnProperty.call(l, "content") || (l.content = ke(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 = !De(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 = (u) => Be(u) || {}, t = (u) => u.type ? u.type : u.color === "error" ? "danger" : u.color === "success" ? "success" : u.color === "warning" ? "warning" : "text", n = (u) => u.filter((F) => {
|
|
401
|
+
const { ifShow: _ } = F;
|
|
402
|
+
return typeof _ == "boolean" ? _ : typeof _ == "function" ? _(F) : !0;
|
|
403
|
+
}), d = S(() => n(e.actions || [])), a = S(() => n(e.dropDownActions || [])), f = (u, F) => {
|
|
404
|
+
var _;
|
|
405
|
+
e.stopButtonPropagation && F.stopPropagation(), (_ = u.onClick) == null || _.call(u, F);
|
|
406
|
+
}, r = (u, F) => {
|
|
407
|
+
f(u, F);
|
|
408
|
+
}, y = (u, F, _) => {
|
|
409
|
+
var D, z, g, m;
|
|
410
|
+
e.stopButtonPropagation && _.stopPropagation(), u.popConfirm && (F === "confirm" ? (z = (D = u.popConfirm).confirm) == null || z.call(D) : (m = (g = u.popConfirm).cancel) == null || m.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: d, visibleDropDownActions: a, handleClick: f, handleActionClick: r, handlePopConfirm: y, handlePopConfirmConfirm: (u, F) => {
|
|
413
|
+
y(u, "confirm", F);
|
|
414
|
+
}, handlePopConfirmCancel: (u, F) => {
|
|
415
|
+
y(u, "cancel", F);
|
|
416
|
+
}, handleDropdownCommand: (u) => {
|
|
417
|
+
var D;
|
|
418
|
+
const F = Number(u), _ = a.value[F];
|
|
419
|
+
if (!(!_ || _.disabled)) {
|
|
420
|
+
if (_.popConfirm) {
|
|
421
|
+
const z = _.popConfirm.title, g = _.popConfirm.okText || "确定", m = _.popConfirm.cancelText || "取消";
|
|
422
|
+
qe.confirm(z, "提示", {
|
|
423
|
+
confirmButtonText: g,
|
|
424
|
+
cancelButtonText: m,
|
|
425
425
|
type: "warning"
|
|
426
426
|
}).then(() => {
|
|
427
|
-
var W,
|
|
428
|
-
return (
|
|
427
|
+
var W, b;
|
|
428
|
+
return (b = (W = _.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 = _.popConfirm) == null ? void 0 : W.cancel) == null ? void 0 : b.call(W);
|
|
432
432
|
});
|
|
433
433
|
return;
|
|
434
434
|
}
|
|
435
|
-
(
|
|
435
|
+
(D = _.onClick) == null || D.call(_, {});
|
|
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, d) {
|
|
443
|
+
return l("span", { key: `action-${d}`, 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, d) {
|
|
453
|
+
return l("el-dropdown-item", { key: `dropdown-${d}`, attrs: { command: d, 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 Et(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 && d();
|
|
536
|
+
}, d = 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", y = 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[y] ?? v.value
|
|
546
546
|
};
|
|
547
547
|
});
|
|
548
548
|
} finally {
|
|
@@ -551,36 +551,206 @@ const Ue = /* @__PURE__ */ oe({
|
|
|
551
551
|
}
|
|
552
552
|
};
|
|
553
553
|
return ve(() => {
|
|
554
|
-
e.lazy ||
|
|
555
|
-
}),
|
|
554
|
+
e.lazy || d();
|
|
555
|
+
}), J(
|
|
556
556
|
() => e.api,
|
|
557
557
|
() => {
|
|
558
|
-
e.lazy ? t.value = [] :
|
|
558
|
+
e.lazy ? t.value = [] : d();
|
|
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 = [] : d();
|
|
563
|
+
}, { deep: !0 }), { __sfc: !0, props: e, loading: l, options: t, onVisibleChange: n, fetchOptions: d };
|
|
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 d = e[l];
|
|
593
|
+
if (d >= "0" && d <= "9") {
|
|
594
|
+
t += d;
|
|
595
|
+
continue;
|
|
596
|
+
}
|
|
597
|
+
d === "." && !n && (n = !0, (t === "" || t === "-") && (t += "0"), t += ".");
|
|
598
|
+
}
|
|
599
|
+
return t;
|
|
600
|
+
}
|
|
601
|
+
function Pe(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 d;
|
|
624
|
+
switch (l) {
|
|
625
|
+
case "floor":
|
|
626
|
+
d = Math.floor(n);
|
|
627
|
+
break;
|
|
628
|
+
case "ceil":
|
|
629
|
+
d = Math.ceil(n);
|
|
630
|
+
break;
|
|
631
|
+
default:
|
|
632
|
+
d = Math.round(n);
|
|
633
|
+
}
|
|
634
|
+
return d / t;
|
|
635
|
+
}
|
|
636
|
+
function Ce(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 rt(i, e) {
|
|
641
|
+
return Number.isNaN(i) || !Number.isFinite(i) ? "" : i.toFixed(Math.max(0, e));
|
|
642
|
+
}
|
|
643
|
+
function Ie(i, e) {
|
|
644
|
+
if (Number.isNaN(i) || !Number.isFinite(i))
|
|
645
|
+
return "";
|
|
646
|
+
const l = i.toFixed(Math.max(0, e)), t = l.startsWith("-"), n = t ? l.slice(1) : l, [d, a] = n.split("."), f = d.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
647
|
+
return e <= 0 || a === void 0 ? (t ? "-" : "") + f : (t ? "-" : "") + f + "." + a;
|
|
648
|
+
}
|
|
649
|
+
function it(i, e) {
|
|
650
|
+
if (Number.isNaN(i) || !Number.isFinite(i))
|
|
651
|
+
return "";
|
|
652
|
+
let l = i.toFixed(Math.max(0, e));
|
|
653
|
+
return l = l.replace(/(\.\d*?)0+$/, "$1"), l = l.replace(/\.$/, ""), l;
|
|
654
|
+
}
|
|
655
|
+
const ct = /* @__PURE__ */ oe({
|
|
656
|
+
__name: "FormattedNumberInput",
|
|
657
|
+
props: {
|
|
658
|
+
value: null,
|
|
659
|
+
placeholder: null,
|
|
660
|
+
disabled: { type: Boolean },
|
|
661
|
+
integerDigits: { default: 5 },
|
|
662
|
+
decimalPlaces: { default: 6 },
|
|
663
|
+
rounding: { default: "round" }
|
|
664
|
+
},
|
|
665
|
+
emits: ["input"],
|
|
666
|
+
setup(i, { emit: e }) {
|
|
667
|
+
const l = i, t = k(!1), n = k(""), d = () => Math.max(0, Math.floor(l.integerDigits ?? 5)), a = () => Math.max(0, Math.floor(l.decimalPlaces ?? 6));
|
|
668
|
+
function f(u) {
|
|
669
|
+
if (u == null || u === "")
|
|
670
|
+
return null;
|
|
671
|
+
if (typeof u == "number")
|
|
672
|
+
return Number.isFinite(u) ? u : null;
|
|
673
|
+
const F = Pe(String(u));
|
|
674
|
+
if (F === "" || F === "-")
|
|
675
|
+
return null;
|
|
676
|
+
const _ = Number(F);
|
|
677
|
+
return Number.isFinite(_) ? _ : null;
|
|
678
|
+
}
|
|
679
|
+
function r() {
|
|
680
|
+
if (t.value)
|
|
681
|
+
return;
|
|
682
|
+
const u = f(l.value);
|
|
683
|
+
if (u === null) {
|
|
684
|
+
n.value = "";
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
n.value = Ie(
|
|
688
|
+
Ce(u, d(), a(), l.rounding),
|
|
689
|
+
a()
|
|
690
|
+
);
|
|
691
|
+
}
|
|
692
|
+
J(
|
|
693
|
+
() => [l.value, l.integerDigits, l.decimalPlaces, l.rounding],
|
|
694
|
+
() => r(),
|
|
695
|
+
{ immediate: !0, deep: !0 }
|
|
696
|
+
);
|
|
697
|
+
function y(u) {
|
|
698
|
+
e("input", rt(u, a()));
|
|
699
|
+
}
|
|
700
|
+
function O(u) {
|
|
701
|
+
const F = $e(u);
|
|
702
|
+
if (n.value = F, F === "" || F === "-")
|
|
703
|
+
return;
|
|
704
|
+
const _ = Number(F);
|
|
705
|
+
if (!Number.isFinite(_))
|
|
706
|
+
return;
|
|
707
|
+
const D = Ce(_, d(), a(), l.rounding);
|
|
708
|
+
y(D);
|
|
709
|
+
}
|
|
710
|
+
function v() {
|
|
711
|
+
t.value = !0;
|
|
712
|
+
const u = Pe(n.value), F = f(u === "" ? l.value : u);
|
|
713
|
+
if (F === null) {
|
|
714
|
+
n.value = "";
|
|
715
|
+
return;
|
|
716
|
+
}
|
|
717
|
+
n.value = it(
|
|
718
|
+
Ce(F, d(), a(), l.rounding),
|
|
719
|
+
a()
|
|
720
|
+
);
|
|
721
|
+
}
|
|
722
|
+
function x() {
|
|
723
|
+
t.value = !1;
|
|
724
|
+
const u = Pe(n.value);
|
|
725
|
+
if (u === "" || u === "-") {
|
|
726
|
+
n.value = "", e("input", void 0);
|
|
727
|
+
return;
|
|
728
|
+
}
|
|
729
|
+
const F = Number($e(u));
|
|
730
|
+
if (!Number.isFinite(F)) {
|
|
731
|
+
n.value = "", e("input", void 0);
|
|
732
|
+
return;
|
|
733
|
+
}
|
|
734
|
+
const _ = Ce(F, d(), a(), l.rounding);
|
|
735
|
+
n.value = Ie(_, a()), y(_);
|
|
736
|
+
}
|
|
737
|
+
return { __sfc: !0, props: l, emit: e, focused: t, displayText: n, intN: d, decM: a, parseExternalToNumber: f, syncDisplayFromValue: r, emitStoredValue: y, onInput: O, onFocus: v, onBlur: x };
|
|
738
|
+
}
|
|
739
|
+
});
|
|
740
|
+
var ut = function() {
|
|
741
|
+
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
742
|
+
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));
|
|
743
|
+
}, dt = [], ft = /* @__PURE__ */ se(
|
|
744
|
+
ct,
|
|
745
|
+
ut,
|
|
746
|
+
dt,
|
|
747
|
+
!1,
|
|
748
|
+
null,
|
|
749
|
+
null,
|
|
750
|
+
null,
|
|
751
|
+
null
|
|
752
|
+
);
|
|
753
|
+
const Ae = ft.exports, pt = /* @__PURE__ */ oe({
|
|
584
754
|
__name: "TreeSelect",
|
|
585
755
|
props: {
|
|
586
756
|
value: null,
|
|
@@ -597,107 +767,107 @@ const Qe = Ze.exports, Ye = /* @__PURE__ */ oe({
|
|
|
597
767
|
clearable: { type: Boolean }
|
|
598
768
|
},
|
|
599
769
|
emits: ["input"],
|
|
600
|
-
setup(
|
|
601
|
-
const l =
|
|
770
|
+
setup(i, { emit: e }) {
|
|
771
|
+
const l = i, t = k(), n = k(), d = k(!1), a = k(!1), f = k(""), r = k([]), y = k({}), O = S(() => ({
|
|
602
772
|
label: l.labelField,
|
|
603
773
|
children: l.childrenField
|
|
604
774
|
}));
|
|
605
|
-
function
|
|
606
|
-
const
|
|
607
|
-
return H[l.labelField ?? "label"] =
|
|
775
|
+
function v(R) {
|
|
776
|
+
const N = l.labelField ?? "label", L = l.valueField ?? "value", Z = l.childrenField ?? "children", ee = R[Z], H = {};
|
|
777
|
+
return H[l.labelField ?? "label"] = R[N] ?? R.label, H[l.valueField ?? "value"] = R[L] ?? R.value, Array.isArray(ee) && ee.length && (H[l.childrenField ?? "children"] = ee.map((q) => v(q))), H;
|
|
608
778
|
}
|
|
609
|
-
function
|
|
610
|
-
const
|
|
611
|
-
for (const q of
|
|
779
|
+
function x(R, N = "") {
|
|
780
|
+
const L = {}, Z = l.labelField ?? "label", ee = l.valueField ?? "value", H = l.childrenField ?? "children";
|
|
781
|
+
for (const q of R) {
|
|
612
782
|
const Q = String(q[Z] ?? q.label ?? ""), U = q[ee] ?? q.value;
|
|
613
|
-
U != null && (
|
|
783
|
+
U != null && (L[String(U)] = N ? N + " / " + Q : Q);
|
|
614
784
|
const Y = q[H] ?? q.children;
|
|
615
|
-
Array.isArray(Y) && Y.length && Object.assign(
|
|
785
|
+
Array.isArray(Y) && Y.length && Object.assign(L, x(Y, Q));
|
|
616
786
|
}
|
|
617
|
-
return
|
|
787
|
+
return L;
|
|
618
788
|
}
|
|
619
|
-
function
|
|
620
|
-
const
|
|
621
|
-
return Array.isArray(
|
|
789
|
+
function u() {
|
|
790
|
+
const R = l.treeData;
|
|
791
|
+
return Array.isArray(R) && R.length > 0;
|
|
622
792
|
}
|
|
623
|
-
function
|
|
624
|
-
r.value =
|
|
793
|
+
function F(R) {
|
|
794
|
+
r.value = R, y.value = x(R);
|
|
625
795
|
}
|
|
626
|
-
function
|
|
627
|
-
const
|
|
628
|
-
if (!Array.isArray(
|
|
796
|
+
function _() {
|
|
797
|
+
const R = l.treeData;
|
|
798
|
+
if (!Array.isArray(R) || R.length === 0)
|
|
629
799
|
return;
|
|
630
|
-
const
|
|
631
|
-
|
|
800
|
+
const N = R.map((L) => v(L));
|
|
801
|
+
F(N);
|
|
632
802
|
}
|
|
633
|
-
const
|
|
634
|
-
if (!
|
|
803
|
+
const D = S(() => l.value == null || l.value === "" ? "" : y.value[String(l.value)] ?? String(l.value)), z = (R, N) => {
|
|
804
|
+
if (!R)
|
|
635
805
|
return !0;
|
|
636
|
-
const
|
|
637
|
-
return String(
|
|
806
|
+
const L = l.labelField ?? "label";
|
|
807
|
+
return String(N[L] ?? N.label ?? "").toLowerCase().includes(R.toLowerCase());
|
|
638
808
|
};
|
|
639
|
-
|
|
640
|
-
var
|
|
641
|
-
(
|
|
809
|
+
J(f, (R) => {
|
|
810
|
+
var N;
|
|
811
|
+
(N = n.value) == null || N.filter(R);
|
|
642
812
|
});
|
|
643
|
-
let
|
|
644
|
-
function
|
|
645
|
-
l.disabled || (
|
|
646
|
-
|
|
647
|
-
t.value && !t.value.contains(
|
|
648
|
-
}, document.addEventListener("click",
|
|
813
|
+
let g = null;
|
|
814
|
+
function m() {
|
|
815
|
+
l.disabled || (d.value = !0, l.lazy && !u() && j(), Oe(() => {
|
|
816
|
+
g = (R) => {
|
|
817
|
+
t.value && !t.value.contains(R.target) && W();
|
|
818
|
+
}, document.addEventListener("click", g);
|
|
649
819
|
}));
|
|
650
820
|
}
|
|
651
821
|
function W() {
|
|
652
|
-
|
|
822
|
+
d.value = !1, f.value = "", g && (document.removeEventListener("click", g), g = null);
|
|
653
823
|
}
|
|
654
|
-
function
|
|
824
|
+
function b() {
|
|
655
825
|
e("input", void 0);
|
|
656
826
|
}
|
|
657
|
-
function
|
|
658
|
-
const
|
|
659
|
-
e("input",
|
|
827
|
+
function M(R) {
|
|
828
|
+
const N = l.valueField ?? "value", L = R[N] ?? R.value;
|
|
829
|
+
e("input", L), W();
|
|
660
830
|
}
|
|
661
831
|
async function j() {
|
|
662
|
-
if (!(!l.api ||
|
|
832
|
+
if (!(!l.api || u())) {
|
|
663
833
|
a.value = !0;
|
|
664
834
|
try {
|
|
665
|
-
const
|
|
666
|
-
r.value =
|
|
835
|
+
const R = await l.api(l.params), N = Array.isArray(R) ? R : (R == null ? void 0 : R.list) ?? (R == null ? void 0 : R.data) ?? [];
|
|
836
|
+
r.value = N.map((L) => v(L)), y.value = x(r.value);
|
|
667
837
|
} finally {
|
|
668
838
|
a.value = !1;
|
|
669
839
|
}
|
|
670
840
|
}
|
|
671
841
|
}
|
|
672
842
|
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:
|
|
843
|
+
u() ? _() : l.lazy || j();
|
|
844
|
+
}), J(() => l.treeData, () => {
|
|
845
|
+
u() ? _() : (r.value = [], y.value = {}, !l.lazy && l.api && j());
|
|
846
|
+
}, { deep: !0 }), J(() => l.api, () => {
|
|
847
|
+
u() || (l.lazy ? (r.value = [], y.value = {}) : j());
|
|
848
|
+
}, { deep: !0 }), J(() => l.params, () => {
|
|
849
|
+
u() || (l.lazy ? (r.value = [], y.value = {}) : j());
|
|
850
|
+
}, { deep: !0 }), { __sfc: !0, props: l, emit: e, rootRef: t, treeRef: n, dropdownVisible: d, loading: a, filterText: f, treeData: r, flatLabelMap: y, treeProps: O, normalizeNode: v, buildFlatLabelMap: x, hasTreeDataProp: u, applyTreeData: F, syncFromTreeDataProp: _, displayText: D, filterNodeMethod: z, clickOutsideHandler: g, openDropdown: m, closeDropdown: W, clearValue: b, onNodeClick: M, fetchData: j };
|
|
681
851
|
}
|
|
682
852
|
});
|
|
683
|
-
var
|
|
853
|
+
var vt = function() {
|
|
684
854
|
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
685
855
|
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
856
|
n.stopPropagation();
|
|
687
857
|
} }, model: { value: t.filterText, callback: function(n) {
|
|
688
858
|
t.filterText = n;
|
|
689
859
|
}, 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
|
-
|
|
860
|
+
}, mt = [], ht = /* @__PURE__ */ se(
|
|
861
|
+
pt,
|
|
862
|
+
vt,
|
|
863
|
+
mt,
|
|
694
864
|
!1,
|
|
695
865
|
null,
|
|
696
866
|
"f30bba11",
|
|
697
867
|
null,
|
|
698
868
|
null
|
|
699
869
|
);
|
|
700
|
-
const
|
|
870
|
+
const _t = ht.exports, bt = /* @__PURE__ */ oe({
|
|
701
871
|
__name: "ProFormItem",
|
|
702
872
|
props: {
|
|
703
873
|
schema: null,
|
|
@@ -709,8 +879,8 @@ const ot = lt.exports, nt = /* @__PURE__ */ oe({
|
|
|
709
879
|
onFieldChange: null,
|
|
710
880
|
customComponents: null
|
|
711
881
|
},
|
|
712
|
-
setup(
|
|
713
|
-
const e =
|
|
882
|
+
setup(i) {
|
|
883
|
+
const e = i, l = /* @__PURE__ */ new Set([
|
|
714
884
|
"input",
|
|
715
885
|
"select",
|
|
716
886
|
"api-select",
|
|
@@ -718,80 +888,81 @@ const ot = lt.exports, nt = /* @__PURE__ */ oe({
|
|
|
718
888
|
"date-picker",
|
|
719
889
|
"date-range",
|
|
720
890
|
"input-number",
|
|
891
|
+
"formatted-number",
|
|
721
892
|
"switch",
|
|
722
893
|
"cascader",
|
|
723
894
|
"checkbox",
|
|
724
895
|
"radio"
|
|
725
|
-
]), t =
|
|
896
|
+
]), t = Se(), n = S(() => ({
|
|
726
897
|
schema: e.schema,
|
|
727
898
|
values: e.formModel,
|
|
728
899
|
model: e.formModel,
|
|
729
900
|
field: e.schema.field
|
|
730
|
-
})),
|
|
731
|
-
const
|
|
732
|
-
return
|
|
733
|
-
}), a =
|
|
734
|
-
const
|
|
735
|
-
return
|
|
736
|
-
}),
|
|
901
|
+
})), d = S(() => {
|
|
902
|
+
const b = e.schema.ifShow;
|
|
903
|
+
return b === void 0 ? !0 : typeof b == "boolean" ? b : b(n.value);
|
|
904
|
+
}), a = S(() => {
|
|
905
|
+
const b = e.schema.show;
|
|
906
|
+
return b === void 0 ? !0 : typeof b == "boolean" ? b : b(n.value);
|
|
907
|
+
}), f = S(() => {
|
|
737
908
|
if (e.formDisabled)
|
|
738
909
|
return !0;
|
|
739
|
-
const
|
|
740
|
-
return
|
|
741
|
-
}), r =
|
|
742
|
-
const
|
|
743
|
-
return
|
|
744
|
-
}),
|
|
745
|
-
const
|
|
746
|
-
if (!
|
|
910
|
+
const b = e.schema.dynamicDisabled;
|
|
911
|
+
return b === void 0 ? !1 : typeof b == "boolean" ? b : b(n.value);
|
|
912
|
+
}), r = S(() => {
|
|
913
|
+
const b = e.schema.dynamicRules;
|
|
914
|
+
return b ? Array.isArray(b) ? b : b(n.value) : e.schema.rules;
|
|
915
|
+
}), y = S(() => {
|
|
916
|
+
const b = e.schema.componentProps;
|
|
917
|
+
if (!b)
|
|
747
918
|
return { props: {}, listeners: {} };
|
|
748
|
-
const
|
|
919
|
+
const M = typeof b == "function" ? b({
|
|
749
920
|
...n.value,
|
|
750
921
|
formActionType: e.formActionType
|
|
751
|
-
}) : { ...
|
|
752
|
-
for (const [
|
|
753
|
-
if (
|
|
754
|
-
const Z =
|
|
755
|
-
|
|
922
|
+
}) : { ...b }, j = {}, R = {};
|
|
923
|
+
for (const [N, L] of Object.entries(M))
|
|
924
|
+
if (N.length > 2 && /^on[A-Za-z]/.test(N) && typeof L == "function") {
|
|
925
|
+
const Z = N.slice(2).charAt(0).toLowerCase() + N.slice(3);
|
|
926
|
+
R[Z] = L;
|
|
756
927
|
} else
|
|
757
|
-
j[
|
|
758
|
-
return { props: j, listeners:
|
|
759
|
-
}),
|
|
760
|
-
const
|
|
761
|
-
if (!
|
|
928
|
+
j[N] = L;
|
|
929
|
+
return { props: j, listeners: R };
|
|
930
|
+
}), O = S(() => y.value.props), v = S(() => y.value.listeners), x = S(() => e.schema.colon ?? e.colon ?? !1), u = S(() => {
|
|
931
|
+
const b = e.schema.tooltip;
|
|
932
|
+
if (!b)
|
|
762
933
|
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
|
|
934
|
+
const M = typeof b == "function" ? b(n.value) : b;
|
|
935
|
+
return Be(M, e.formModel[e.schema.field]);
|
|
936
|
+
}), F = S(() => u.value ? "el-tooltip" : "span"), _ = S(() => u.value || {}), D = S(() => !!t.default), z = (b) => {
|
|
937
|
+
const M = b == null ? void 0 : b.options;
|
|
938
|
+
return Array.isArray(M) ? M : void 0;
|
|
939
|
+
}, g = S(() => {
|
|
940
|
+
const b = e.schema.component;
|
|
941
|
+
return b == null ? null : typeof b == "string" ? l.has(b) ? null : e.customComponents && e.customComponents[b] || b : b;
|
|
942
|
+
}), m = (b) => {
|
|
943
|
+
var M;
|
|
944
|
+
(M = e.onFieldChange) == null || M.call(e, e.schema.field, b);
|
|
945
|
+
}, W = S(() => {
|
|
946
|
+
const b = e.schema.render;
|
|
947
|
+
return b ? {
|
|
777
948
|
render() {
|
|
778
|
-
const
|
|
779
|
-
return Array.isArray(
|
|
949
|
+
const M = b(n.value);
|
|
950
|
+
return Array.isArray(M) ? ue("span", M) : M;
|
|
780
951
|
}
|
|
781
952
|
} : null;
|
|
782
953
|
});
|
|
783
|
-
return { __sfc: !0, BUILT_IN_COMPONENTS: l, props: e, slots: t, renderParams: n, shouldRender:
|
|
954
|
+
return { __sfc: !0, BUILT_IN_COMPONENTS: l, props: e, slots: t, renderParams: n, shouldRender: d, shouldShow: a, effectiveDisabled: f, effectiveRules: r, effectiveComponentPropsAndListeners: y, effectiveComponentProps: O, effectiveComponentListeners: v, showColon: x, normalizedTooltip: u, fieldWrapperComponent: F, fieldWrapperProps: _, hasSlot: D, getOptions: z, resolvedCustomComponent: g, setFieldValue: m, renderComponent: W, ApiSelect: nt, FormattedNumberInput: Ae, TreeSelect: _t };
|
|
784
955
|
}
|
|
785
956
|
});
|
|
786
|
-
var
|
|
957
|
+
var gt = function() {
|
|
787
958
|
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:
|
|
959
|
+
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, d) {
|
|
960
|
+
return l("div", { key: d, staticClass: "ecp-pro-form-item__help-item" }, [e._v(" " + e._s(n) + " ")]);
|
|
790
961
|
}) : 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
962
|
e.$set(e.formModel, e.schema.field, n);
|
|
792
963
|
}, 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
964
|
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) {
|
|
965
|
+
}, 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
966
|
e.$set(e.formModel, e.schema.field, n);
|
|
796
967
|
}, expression: "formModel[schema.field]" } }, "el-select", t.effectiveComponentProps, !1), t.effectiveComponentListeners), e._l(t.getOptions(t.effectiveComponentProps) || [], function(n) {
|
|
797
968
|
return l("el-option", { key: String(n.value), attrs: { label: n.label, value: n.value } });
|
|
@@ -812,17 +983,17 @@ var at = function() {
|
|
|
812
983
|
}, expression: "formModel[schema.field]" } }, "el-radio-group", t.effectiveComponentProps, !1), t.effectiveComponentListeners), e._l(t.getOptions(t.effectiveComponentProps) || [], function(n) {
|
|
813
984
|
return l("el-radio", { key: String(n.value), attrs: { label: n.value } }, [e._v(" " + e._s(n.label) + " ")]);
|
|
814
985
|
}), 1) : e._e()], 1)]], 2) : e._e();
|
|
815
|
-
},
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
986
|
+
}, yt = [], wt = /* @__PURE__ */ se(
|
|
987
|
+
bt,
|
|
988
|
+
gt,
|
|
989
|
+
yt,
|
|
819
990
|
!1,
|
|
820
991
|
null,
|
|
821
|
-
"
|
|
992
|
+
"d3466c67",
|
|
822
993
|
null,
|
|
823
994
|
null
|
|
824
995
|
);
|
|
825
|
-
const
|
|
996
|
+
const Ve = wt.exports, Ct = /* @__PURE__ */ oe({
|
|
826
997
|
__name: "FormActions",
|
|
827
998
|
props: {
|
|
828
999
|
showActionButtonGroup: { type: Boolean, default: !0 },
|
|
@@ -839,28 +1010,28 @@ const $e = rt.exports, it = /* @__PURE__ */ oe({
|
|
|
839
1010
|
actionColOptions: null
|
|
840
1011
|
},
|
|
841
1012
|
emits: ["submit", "reset", "toggle"],
|
|
842
|
-
setup(
|
|
1013
|
+
setup(i) {
|
|
843
1014
|
return { __sfc: !0 };
|
|
844
1015
|
}
|
|
845
1016
|
});
|
|
846
|
-
var
|
|
1017
|
+
var xt = function() {
|
|
847
1018
|
var e = this, l = e._self._c;
|
|
848
1019
|
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
1020
|
return e.$emit("submit");
|
|
850
1021
|
} } }, [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
1022
|
return e.$emit("reset");
|
|
852
1023
|
} } }, [e._v(" " + e._s(e.resetButtonText) + " ")]) : e._e(), e._t("actions")], 2);
|
|
853
|
-
},
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
1024
|
+
}, Pt = [], St = /* @__PURE__ */ se(
|
|
1025
|
+
Ct,
|
|
1026
|
+
xt,
|
|
1027
|
+
Pt,
|
|
857
1028
|
!1,
|
|
858
1029
|
null,
|
|
859
1030
|
"489c88d2",
|
|
860
1031
|
null,
|
|
861
1032
|
null
|
|
862
1033
|
);
|
|
863
|
-
const
|
|
1034
|
+
const We = St.exports, Ft = /* @__PURE__ */ oe({
|
|
864
1035
|
__name: "ProForm",
|
|
865
1036
|
props: {
|
|
866
1037
|
schemas: null,
|
|
@@ -893,20 +1064,20 @@ const ze = dt.exports, ft = /* @__PURE__ */ oe({
|
|
|
893
1064
|
components: null
|
|
894
1065
|
},
|
|
895
1066
|
emits: ["submit", "reset", "register", "update:modelValue"],
|
|
896
|
-
setup(
|
|
897
|
-
const t =
|
|
898
|
-
const
|
|
899
|
-
return
|
|
900
|
-
}, { getSetting:
|
|
901
|
-
...
|
|
902
|
-
...
|
|
903
|
-
...
|
|
904
|
-
})),
|
|
1067
|
+
setup(i, { expose: e, emit: l }) {
|
|
1068
|
+
const t = i, n = Se(), d = k(), a = k(), f = k(!1), r = k(!0), y = k({}), O = k({}), v = k([]), x = k({}), u = { xl: 1920, lg: 1200, md: 992, sm: 768 }, F = (c, w, B) => {
|
|
1069
|
+
const A = B ?? (typeof window < "u" ? window.innerWidth : 1920), C = c ?? {}, o = w ?? {}, s = o.span ?? 8;
|
|
1070
|
+
return A >= u.xl ? C.xl ?? o.xl ?? C.lg ?? o.lg ?? C.md ?? o.md ?? C.sm ?? o.sm ?? C.xs ?? o.xs ?? C.span ?? s : A >= u.lg ? C.lg ?? o.lg ?? C.md ?? o.md ?? C.sm ?? o.sm ?? C.xs ?? o.xs ?? C.span ?? s : A >= u.md ? C.md ?? o.md ?? C.sm ?? o.sm ?? C.xs ?? o.xs ?? C.span ?? s : A >= u.sm ? C.sm ?? o.sm ?? C.xs ?? o.xs ?? C.span ?? s : C.xs ?? o.xs ?? C.span ?? s;
|
|
1071
|
+
}, { getSetting: _ } = Re(), D = S(() => ({ ..._("ProForm"), ...t, ...x.value })), z = S(() => D.value.modelValue), g = S(() => z.value !== void 0), m = S(() => g.value ? z.value ?? {} : y.value), W = S(() => ({
|
|
1072
|
+
..._("ProForm").components ?? {},
|
|
1073
|
+
...D.value.components ?? {},
|
|
1074
|
+
...x.value.components ?? {}
|
|
1075
|
+
})), b = S(() => D.value.actionColOptions ?? { span: 24 }), M = k(typeof window < "u" ? window.innerWidth : 1920), j = (c, w, B, A) => {
|
|
905
1076
|
let C = 24, o = 1, s = 0;
|
|
906
|
-
for (const
|
|
907
|
-
const P =
|
|
1077
|
+
for (const h of c) {
|
|
1078
|
+
const P = F(h.colProps, w, A);
|
|
908
1079
|
if (P > C) {
|
|
909
|
-
if (o++, o >
|
|
1080
|
+
if (o++, o > B)
|
|
910
1081
|
break;
|
|
911
1082
|
C = 24 - P;
|
|
912
1083
|
} else
|
|
@@ -914,115 +1085,115 @@ const ze = dt.exports, ft = /* @__PURE__ */ oe({
|
|
|
914
1085
|
s++;
|
|
915
1086
|
}
|
|
916
1087
|
return s;
|
|
917
|
-
},
|
|
918
|
-
const
|
|
919
|
-
if (!
|
|
1088
|
+
}, R = S(() => {
|
|
1089
|
+
const c = v.value.filter((C) => Z(C));
|
|
1090
|
+
if (!D.value.showAdvancedButton)
|
|
920
1091
|
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
|
|
934
|
-
return
|
|
935
|
-
if (!(
|
|
1092
|
+
const w = D.value.alwaysShowLines ?? 1, B = D.value.baseColProps, A = j(c, B, w, M.value);
|
|
1093
|
+
return c.length > A;
|
|
1094
|
+
}), N = S(() => D.value.formListeners ?? {}), L = S(() => {
|
|
1095
|
+
const c = v.value.filter((C) => Z(C));
|
|
1096
|
+
if (!D.value.showAdvancedButton || !r.value)
|
|
1097
|
+
return c;
|
|
1098
|
+
const w = D.value.alwaysShowLines ?? 1, B = D.value.baseColProps, A = j(c, B, w, M.value);
|
|
1099
|
+
return c.slice(0, A);
|
|
1100
|
+
}), Z = (c) => {
|
|
1101
|
+
let w = !0, B = !0;
|
|
1102
|
+
return typeof c.ifShow == "function" && (w = c.ifShow({ schema: c, values: m.value, model: m.value, field: c.field })), typeof c.ifShow == "boolean" && (w = c.ifShow), typeof c.show == "function" && (B = c.show({ schema: c, values: m.value, model: m.value, field: c.field })), typeof c.show == "boolean" && (B = c.show), w && B;
|
|
1103
|
+
}, ee = (c) => c.colProps ?? D.value.baseColProps ?? {}, H = (c) => c.slot || c.field, q = (c, w = !0) => {
|
|
1104
|
+
const B = w ? { ...c ?? {} } : {}, A = D.value.initialValues ?? t.initialValues;
|
|
1105
|
+
return v.value.forEach((C) => {
|
|
1106
|
+
if (!(w && Object.prototype.hasOwnProperty.call(B, C.field))) {
|
|
936
1107
|
if (C.defaultValue !== void 0) {
|
|
937
|
-
|
|
1108
|
+
B[C.field] = C.defaultValue;
|
|
938
1109
|
return;
|
|
939
1110
|
}
|
|
940
|
-
|
|
1111
|
+
A && Object.prototype.hasOwnProperty.call(A, C.field) && (B[C.field] = A[C.field]);
|
|
941
1112
|
}
|
|
942
|
-
}),
|
|
943
|
-
}, Q = (
|
|
944
|
-
|
|
945
|
-
}, U = (
|
|
946
|
-
const
|
|
947
|
-
return Q(
|
|
1113
|
+
}), B;
|
|
1114
|
+
}, Q = (c, w = !0) => {
|
|
1115
|
+
y.value = c, w && l("update:modelValue", c);
|
|
1116
|
+
}, U = (c) => {
|
|
1117
|
+
const w = q({ ...m.value, ...c });
|
|
1118
|
+
return Q(w), w;
|
|
948
1119
|
}, Y = () => {
|
|
949
|
-
const
|
|
950
|
-
|
|
951
|
-
var
|
|
952
|
-
(
|
|
953
|
-
}), Q(q(
|
|
954
|
-
},
|
|
955
|
-
const
|
|
956
|
-
return
|
|
957
|
-
const
|
|
958
|
-
if (
|
|
1120
|
+
const c = {};
|
|
1121
|
+
v.value.forEach((w) => {
|
|
1122
|
+
var B;
|
|
1123
|
+
(B = w.rules) != null && B.length && (c[w.field] = w.rules);
|
|
1124
|
+
}), Q(q(m.value), !1), O.value = c;
|
|
1125
|
+
}, re = (c) => {
|
|
1126
|
+
const w = { ...c };
|
|
1127
|
+
return v.value.forEach((B) => {
|
|
1128
|
+
const A = B.ifShow;
|
|
1129
|
+
if (A === void 0)
|
|
959
1130
|
return;
|
|
960
|
-
(typeof
|
|
961
|
-
}),
|
|
962
|
-
},
|
|
963
|
-
const
|
|
964
|
-
if (!(
|
|
965
|
-
return
|
|
966
|
-
const
|
|
967
|
-
return
|
|
968
|
-
const
|
|
969
|
-
Array.isArray(
|
|
970
|
-
}),
|
|
971
|
-
},
|
|
972
|
-
var
|
|
1131
|
+
(typeof A == "boolean" ? A : A({ schema: B, values: c, model: c, field: B.field })) || delete w[B.field];
|
|
1132
|
+
}), w;
|
|
1133
|
+
}, p = (c) => {
|
|
1134
|
+
const w = re(c), B = x.value.fieldMapToTime;
|
|
1135
|
+
if (!(B != null && B.length))
|
|
1136
|
+
return w;
|
|
1137
|
+
const A = { ...w };
|
|
1138
|
+
return B.forEach(([C, [o, s]]) => {
|
|
1139
|
+
const h = A[C];
|
|
1140
|
+
Array.isArray(h) && h.length === 2 && (delete A[C], A[o] = h[0], A[s] = h[1]);
|
|
1141
|
+
}), A;
|
|
1142
|
+
}, $ = async () => {
|
|
1143
|
+
var c;
|
|
973
1144
|
try {
|
|
974
|
-
await ((
|
|
975
|
-
} catch (
|
|
976
|
-
console.error("Form validation failed:",
|
|
1145
|
+
await ((c = d.value) == null ? void 0 : c.validate()), D.value.submitFunc ? await D.value.submitFunc() : (f.value = !0, l("submit", p({ ...m.value })));
|
|
1146
|
+
} catch (w) {
|
|
1147
|
+
console.error("Form validation failed:", w);
|
|
977
1148
|
} finally {
|
|
978
|
-
|
|
1149
|
+
f.value = !1;
|
|
979
1150
|
}
|
|
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
|
|
996
|
-
return
|
|
997
|
-
}, me = (
|
|
998
|
-
var
|
|
999
|
-
(
|
|
1000
|
-
}, he = async (
|
|
1001
|
-
(Array.isArray(
|
|
1002
|
-
const
|
|
1003
|
-
|
|
1151
|
+
}, T = async () => {
|
|
1152
|
+
var c;
|
|
1153
|
+
D.value.resetFunc ? await D.value.resetFunc() : ((c = d.value) == null || c.resetFields(), Y(), l("reset"), D.value.submitOnReset && await $());
|
|
1154
|
+
}, V = (c) => (U(c), Promise.resolve()), K = () => p({ ...m.value }), X = async () => {
|
|
1155
|
+
var c;
|
|
1156
|
+
(c = d.value) == null || c.resetFields(), Q(q(void 0, !1));
|
|
1157
|
+
}, ne = (c, w) => {
|
|
1158
|
+
U({ [c]: w });
|
|
1159
|
+
}, ae = (c) => {
|
|
1160
|
+
var w;
|
|
1161
|
+
return ((w = d.value) == null ? void 0 : w.validate(c)) ?? Promise.resolve();
|
|
1162
|
+
}, le = (c) => d.value ? c != null && c.length ? Promise.all(c.map((w) => new Promise((B, A) => {
|
|
1163
|
+
d.value.validateField(w, (C) => C ? B(void 0) : A(new Error("Validation failed")));
|
|
1164
|
+
}))) : d.value.validate() : Promise.resolve(), ie = async (c, w) => {
|
|
1165
|
+
var A;
|
|
1166
|
+
const B = (A = a.value) == null ? void 0 : A.querySelector(`[data-field="${c}"]`);
|
|
1167
|
+
return B && B.scrollIntoView({ behavior: (w == null ? void 0 : w.behavior) ?? "smooth", block: (w == null ? void 0 : w.block) ?? "nearest" }), Promise.resolve();
|
|
1168
|
+
}, me = (c) => {
|
|
1169
|
+
var w;
|
|
1170
|
+
(w = d.value) == null || w.clearValidate(c);
|
|
1171
|
+
}, he = async (c) => {
|
|
1172
|
+
(Array.isArray(c) ? c : [c]).forEach((B) => {
|
|
1173
|
+
const A = v.value.findIndex((C) => C.field === B.field);
|
|
1174
|
+
A >= 0 && (v.value[A] = { ...v.value[A], ...B });
|
|
1004
1175
|
});
|
|
1005
|
-
}, _e = async (
|
|
1006
|
-
if (
|
|
1007
|
-
|
|
1008
|
-
else if (
|
|
1009
|
-
const
|
|
1010
|
-
|
|
1176
|
+
}, _e = async (c, w, B) => {
|
|
1177
|
+
if (B)
|
|
1178
|
+
v.value.unshift(c);
|
|
1179
|
+
else if (w) {
|
|
1180
|
+
const A = v.value.findIndex((C) => C.field === w);
|
|
1181
|
+
v.value.splice(A + 1, 0, c);
|
|
1011
1182
|
} else
|
|
1012
|
-
|
|
1183
|
+
v.value.push(c);
|
|
1013
1184
|
Y();
|
|
1014
|
-
}, be = async (
|
|
1015
|
-
const
|
|
1016
|
-
|
|
1017
|
-
}, ge = async (
|
|
1018
|
-
|
|
1185
|
+
}, be = async (c) => {
|
|
1186
|
+
const w = Array.isArray(c) ? c : [c];
|
|
1187
|
+
v.value = v.value.filter((B) => !w.includes(B.field));
|
|
1188
|
+
}, ge = async (c) => {
|
|
1189
|
+
x.value = { ...x.value, ...c }, c.schemas && (v.value = [...c.schemas], Y());
|
|
1019
1190
|
}, pe = {
|
|
1020
|
-
getFieldsValue:
|
|
1021
|
-
setFieldsValue:
|
|
1022
|
-
resetFields:
|
|
1191
|
+
getFieldsValue: K,
|
|
1192
|
+
setFieldsValue: V,
|
|
1193
|
+
resetFields: X,
|
|
1023
1194
|
validate: ae,
|
|
1024
1195
|
validateFields: le,
|
|
1025
|
-
submit:
|
|
1196
|
+
submit: $,
|
|
1026
1197
|
scrollToField: ie,
|
|
1027
1198
|
clearValidate: me,
|
|
1028
1199
|
updateSchema: he,
|
|
@@ -1032,106 +1203,106 @@ const ze = dt.exports, ft = /* @__PURE__ */ oe({
|
|
|
1032
1203
|
};
|
|
1033
1204
|
e(pe);
|
|
1034
1205
|
const de = () => {
|
|
1035
|
-
|
|
1206
|
+
v.value = [...t.schemas ?? []], Y();
|
|
1036
1207
|
}, ce = () => {
|
|
1037
|
-
typeof window < "u" && (
|
|
1208
|
+
typeof window < "u" && (M.value = window.innerWidth);
|
|
1038
1209
|
};
|
|
1039
1210
|
return ve(() => {
|
|
1040
1211
|
de(), l("register", pe), typeof window < "u" && window.addEventListener("resize", ce);
|
|
1041
|
-
}),
|
|
1212
|
+
}), Fe(() => {
|
|
1042
1213
|
typeof window < "u" && window.removeEventListener("resize", ce);
|
|
1043
|
-
}),
|
|
1044
|
-
!
|
|
1045
|
-
}, { deep: !0, immediate: !0 }),
|
|
1214
|
+
}), J(() => z.value, (c) => {
|
|
1215
|
+
!g.value || c === void 0 || Q(q(c), !1);
|
|
1216
|
+
}, { deep: !0, immediate: !0 }), J(() => [t.schemas, t.initialValues], de, { deep: !0 }), { __sfc: !0, props: t, emit: l, slots: n, formRef: d, formWrapRef: a, submitLoading: f, collapsed: r, formModel: y, formRules: O, innerSchemas: v, innerProps: x, BREAKPOINTS: u, getEffectiveSpan: F, getComponentSetting: _, effectiveProps: D, controlledModelValue: z, isControlled: g, currentFormModel: m, formCustomComponents: W, effectiveActionColOptions: b, windowWidth: M, getVisibleSchemaCount: j, hasMoreFields: R, 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
1217
|
}
|
|
1047
1218
|
});
|
|
1048
|
-
var
|
|
1219
|
+
var Rt = function() {
|
|
1049
1220
|
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
1050
1221
|
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: ((
|
|
1222
|
+
var d, a;
|
|
1223
|
+
return [t.shouldShow(n) ? l("el-col", e._b({ key: n.field, attrs: { offset: ((d = n.colProps) == null ? void 0 : d.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
1224
|
}), 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
1225
|
t.collapsed = !t.collapsed;
|
|
1055
1226
|
} } }, [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
1227
|
t.collapsed = !t.collapsed;
|
|
1057
1228
|
} } }, [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
|
-
|
|
1229
|
+
}, Bt = [], At = /* @__PURE__ */ se(
|
|
1230
|
+
Ft,
|
|
1231
|
+
Rt,
|
|
1232
|
+
Bt,
|
|
1062
1233
|
!1,
|
|
1063
1234
|
null,
|
|
1064
1235
|
"bf70afca",
|
|
1065
1236
|
null,
|
|
1066
1237
|
null
|
|
1067
1238
|
);
|
|
1068
|
-
const
|
|
1069
|
-
function
|
|
1070
|
-
const e =
|
|
1071
|
-
e.value =
|
|
1072
|
-
const
|
|
1073
|
-
|
|
1239
|
+
const Le = At.exports;
|
|
1240
|
+
function Nt(i) {
|
|
1241
|
+
const e = k(null), l = k(i ? fe(i) : void 0), t = () => i ? fe(i) : void 0, n = (g) => {
|
|
1242
|
+
e.value = g;
|
|
1243
|
+
const m = t();
|
|
1244
|
+
m && Object.keys(m).length > 0 && g.setProps(m);
|
|
1074
1245
|
};
|
|
1075
|
-
return
|
|
1246
|
+
return i && J(
|
|
1076
1247
|
() => t(),
|
|
1077
|
-
(
|
|
1078
|
-
l.value =
|
|
1248
|
+
(g) => {
|
|
1249
|
+
l.value = g, g && e.value && e.value.setProps(g);
|
|
1079
1250
|
},
|
|
1080
1251
|
{ deep: !0 }
|
|
1081
1252
|
), [n, {
|
|
1082
1253
|
register: n,
|
|
1083
1254
|
formAction: e,
|
|
1084
1255
|
getFieldsValue: () => {
|
|
1085
|
-
var
|
|
1086
|
-
return ((
|
|
1256
|
+
var g;
|
|
1257
|
+
return ((g = e.value) == null ? void 0 : g.getFieldsValue()) ?? {};
|
|
1087
1258
|
},
|
|
1088
|
-
setFieldsValue: async (
|
|
1089
|
-
var
|
|
1090
|
-
await ((
|
|
1259
|
+
setFieldsValue: async (g) => {
|
|
1260
|
+
var m;
|
|
1261
|
+
await ((m = e.value) == null ? void 0 : m.setFieldsValue(g));
|
|
1091
1262
|
},
|
|
1092
1263
|
resetFields: async () => {
|
|
1093
|
-
var
|
|
1094
|
-
await ((
|
|
1264
|
+
var g;
|
|
1265
|
+
await ((g = e.value) == null ? void 0 : g.resetFields());
|
|
1095
1266
|
},
|
|
1096
|
-
validate: (
|
|
1097
|
-
var
|
|
1098
|
-
return ((
|
|
1267
|
+
validate: (g) => {
|
|
1268
|
+
var m;
|
|
1269
|
+
return ((m = e.value) == null ? void 0 : m.validate(g)) ?? Promise.resolve();
|
|
1099
1270
|
},
|
|
1100
|
-
validateFields: (
|
|
1101
|
-
var
|
|
1102
|
-
return ((
|
|
1271
|
+
validateFields: (g) => {
|
|
1272
|
+
var m;
|
|
1273
|
+
return ((m = e.value) == null ? void 0 : m.validateFields(g)) ?? Promise.resolve();
|
|
1103
1274
|
},
|
|
1104
1275
|
submit: () => {
|
|
1105
|
-
var
|
|
1106
|
-
return ((
|
|
1276
|
+
var g;
|
|
1277
|
+
return ((g = e.value) == null ? void 0 : g.submit()) ?? Promise.resolve();
|
|
1107
1278
|
},
|
|
1108
|
-
scrollToField: (
|
|
1279
|
+
scrollToField: (g, m) => {
|
|
1109
1280
|
var W;
|
|
1110
|
-
return ((W = e.value) == null ? void 0 : W.scrollToField(
|
|
1111
|
-
},
|
|
1112
|
-
clearValidate: (b) => {
|
|
1113
|
-
var u;
|
|
1114
|
-
(u = e.value) == null || u.clearValidate(b);
|
|
1281
|
+
return ((W = e.value) == null ? void 0 : W.scrollToField(g, m)) ?? Promise.resolve();
|
|
1115
1282
|
},
|
|
1116
|
-
|
|
1117
|
-
var
|
|
1118
|
-
|
|
1283
|
+
clearValidate: (g) => {
|
|
1284
|
+
var m;
|
|
1285
|
+
(m = e.value) == null || m.clearValidate(g);
|
|
1119
1286
|
},
|
|
1120
|
-
|
|
1287
|
+
updateSchema: (g) => {
|
|
1121
1288
|
var m;
|
|
1122
|
-
return ((m = e.value) == null ? void 0 : m.
|
|
1289
|
+
return ((m = e.value) == null ? void 0 : m.updateSchema(g)) ?? Promise.resolve();
|
|
1290
|
+
},
|
|
1291
|
+
appendSchemaByField: (g, m, W) => {
|
|
1292
|
+
var b;
|
|
1293
|
+
return ((b = e.value) == null ? void 0 : b.appendSchemaByField(g, m, W)) ?? Promise.resolve();
|
|
1123
1294
|
},
|
|
1124
|
-
removeSchemaByField: (
|
|
1125
|
-
var
|
|
1126
|
-
return ((
|
|
1295
|
+
removeSchemaByField: (g) => {
|
|
1296
|
+
var m;
|
|
1297
|
+
return ((m = e.value) == null ? void 0 : m.removeSchemaByField(g)) ?? Promise.resolve();
|
|
1127
1298
|
},
|
|
1128
|
-
setProps: async (
|
|
1129
|
-
var
|
|
1130
|
-
l.value = { ...l.value, ...
|
|
1299
|
+
setProps: async (g) => {
|
|
1300
|
+
var m;
|
|
1301
|
+
l.value = { ...l.value, ...g }, await ((m = e.value) == null ? void 0 : m.setProps(g));
|
|
1131
1302
|
}
|
|
1132
1303
|
}];
|
|
1133
1304
|
}
|
|
1134
|
-
const
|
|
1305
|
+
const Mt = /* @__PURE__ */ oe({
|
|
1135
1306
|
__name: "ProDescriptions",
|
|
1136
1307
|
props: {
|
|
1137
1308
|
title: null,
|
|
@@ -1146,8 +1317,8 @@ const ht = /* @__PURE__ */ oe({
|
|
|
1146
1317
|
collapseOptions: { default: () => ({ canExpand: !1, defaultExpand: !0, expandButtonText: "展开", collapseButtonText: "收起", visibleRows: 1 }) }
|
|
1147
1318
|
},
|
|
1148
1319
|
emits: ["register"],
|
|
1149
|
-
setup(
|
|
1150
|
-
const t =
|
|
1320
|
+
setup(i, { expose: e, emit: l }) {
|
|
1321
|
+
const t = i, n = k({}), d = k({}), a = k([]), f = k(typeof window < "u" ? window.innerWidth : 1920), r = k(!0), y = oe({
|
|
1151
1322
|
name: "EcpDescriptionValueRenderer",
|
|
1152
1323
|
props: {
|
|
1153
1324
|
schema: { type: Object, required: !0 },
|
|
@@ -1155,139 +1326,139 @@ const ht = /* @__PURE__ */ oe({
|
|
|
1155
1326
|
record: { type: Object, required: !0 },
|
|
1156
1327
|
emptyText: { type: String, default: "-" }
|
|
1157
1328
|
},
|
|
1158
|
-
setup(
|
|
1329
|
+
setup(p) {
|
|
1159
1330
|
return () => {
|
|
1160
|
-
const
|
|
1161
|
-
const ne =
|
|
1331
|
+
const $ = p.schema, T = p.record, V = p.value, K = (X) => {
|
|
1332
|
+
const ne = O($, X === p.emptyText ? V : X, T), ae = ue("span", X);
|
|
1162
1333
|
return ne ? ue("el-tooltip", { props: ne }, [ae]) : ae;
|
|
1163
1334
|
};
|
|
1164
|
-
if (
|
|
1165
|
-
const
|
|
1166
|
-
return
|
|
1335
|
+
if ($.render) {
|
|
1336
|
+
const X = $.render(V, T);
|
|
1337
|
+
return X == null || X === "" ? K(p.emptyText) : typeof X == "string" || typeof X == "number" ? K(String(X)) : X;
|
|
1167
1338
|
}
|
|
1168
|
-
return Array.isArray(
|
|
1339
|
+
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
1340
|
};
|
|
1170
1341
|
}
|
|
1171
|
-
}),
|
|
1172
|
-
const
|
|
1173
|
-
if (!
|
|
1342
|
+
}), O = (p, $, T) => {
|
|
1343
|
+
const V = p.tooltip;
|
|
1344
|
+
if (!V)
|
|
1174
1345
|
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
|
|
1346
|
+
const K = typeof V == "function" ? V({ value: $, record: T, schema: p }) : V;
|
|
1347
|
+
return Be(K, $);
|
|
1348
|
+
}, { getSetting: v } = Re(), x = S(() => ({ ...v("ProDescriptions"), ...t, ...n.value })), u = { xxl: 1920, xl: 1200, lg: 992, md: 768, sm: 576 }, F = (p, $) => {
|
|
1349
|
+
if (typeof p == "number")
|
|
1350
|
+
return Math.max(1, p);
|
|
1351
|
+
const T = p ?? {};
|
|
1352
|
+
return $ >= u.xxl ? T.xxl ?? T.xl ?? T.lg ?? T.md ?? T.sm ?? T.xs ?? 3 : $ >= u.xl ? T.xl ?? T.lg ?? T.md ?? T.sm ?? T.xs ?? 3 : $ >= u.lg ? T.lg ?? T.md ?? T.sm ?? T.xs ?? 3 : $ >= u.md ? T.md ?? T.sm ?? T.xs ?? 3 : $ >= u.sm ? T.sm ?? T.xs ?? 2 : T.xs ?? 1;
|
|
1353
|
+
}, _ = S(() => F(x.value.column, f.value)), D = S(() => x.value.data ?? d.value ?? {}), z = S(() => (a.value.length ? a.value : x.value.schema ?? []).filter((p) => p.dataIndex || p.field ? typeof p.show == "function" ? p.show(D.value) : p.show !== !1 : !1).map((p) => ({
|
|
1354
|
+
...p,
|
|
1355
|
+
dataIndex: p.dataIndex || p.field || ""
|
|
1356
|
+
}))), g = S(() => {
|
|
1357
|
+
const p = [];
|
|
1358
|
+
let $ = { items: [] }, T = 0;
|
|
1359
|
+
const V = _.value;
|
|
1360
|
+
return z.value.forEach((K, X) => {
|
|
1361
|
+
const ne = z.value.length - X, ae = Math.max(1, Math.min(K.span ?? 1, V)), le = ne === 1 ? V - T || V : ae;
|
|
1362
|
+
T + le > V && (p.push($), $ = { items: [] }, T = 0);
|
|
1363
|
+
const ie = ne === 1 && T < V ? Math.max(1, V - T) : le;
|
|
1364
|
+
$.items.push({ ...K, _span: ie }), T += ie, T >= V && (p.push($), $ = { items: [] }, T = 0);
|
|
1365
|
+
}), $.items.length > 0 && p.push($), p;
|
|
1366
|
+
}), m = S(() => {
|
|
1367
|
+
var $;
|
|
1197
1368
|
if (!W.value || r.value)
|
|
1198
|
-
return
|
|
1199
|
-
const
|
|
1200
|
-
return
|
|
1201
|
-
}), W =
|
|
1202
|
-
var
|
|
1203
|
-
const
|
|
1204
|
-
return !!
|
|
1205
|
-
}),
|
|
1206
|
-
var
|
|
1369
|
+
return g.value;
|
|
1370
|
+
const p = Math.max(1, (($ = x.value.collapseOptions) == null ? void 0 : $.visibleRows) ?? 1);
|
|
1371
|
+
return g.value.slice(0, p);
|
|
1372
|
+
}), W = S(() => {
|
|
1373
|
+
var $, T;
|
|
1374
|
+
const p = Math.max(1, (($ = x.value.collapseOptions) == null ? void 0 : $.visibleRows) ?? 1);
|
|
1375
|
+
return !!x.value.useCollapse && !!((T = x.value.collapseOptions) != null && T.canExpand) && g.value.length > p;
|
|
1376
|
+
}), b = S(() => !!x.value.title || !!x.value.helpMessage || W.value), M = S(() => {
|
|
1377
|
+
var p, $;
|
|
1207
1378
|
return {
|
|
1208
|
-
expand: ((
|
|
1209
|
-
collapse: ((
|
|
1379
|
+
expand: ((p = x.value.collapseOptions) == null ? void 0 : p.expandButtonText) ?? "展开",
|
|
1380
|
+
collapse: (($ = x.value.collapseOptions) == null ? void 0 : $.collapseButtonText) ?? "收起"
|
|
1210
1381
|
};
|
|
1211
|
-
}), j =
|
|
1212
|
-
gridTemplateColumns: `repeat(${
|
|
1213
|
-
})),
|
|
1214
|
-
gridColumn: `span ${
|
|
1215
|
-
}),
|
|
1216
|
-
minWidth:
|
|
1217
|
-
...
|
|
1218
|
-
}),
|
|
1219
|
-
minWidth:
|
|
1220
|
-
...
|
|
1221
|
-
}), Z = (
|
|
1222
|
-
a.value = [...
|
|
1382
|
+
}), j = S(() => ({
|
|
1383
|
+
gridTemplateColumns: `repeat(${_.value}, minmax(0, 1fr))`
|
|
1384
|
+
})), R = (p) => ({
|
|
1385
|
+
gridColumn: `span ${p._span}`
|
|
1386
|
+
}), N = (p) => ({
|
|
1387
|
+
minWidth: p.labelMinWidth ? `${p.labelMinWidth}px` : void 0,
|
|
1388
|
+
...p.labelStyle ?? {}
|
|
1389
|
+
}), L = (p) => ({
|
|
1390
|
+
minWidth: p.contentMinWidth ? `${p.contentMinWidth}px` : void 0,
|
|
1391
|
+
...p.contentStyle ?? {}
|
|
1392
|
+
}), Z = (p) => D.value[p.dataIndex], ee = () => {
|
|
1393
|
+
a.value = [...x.value.schema ?? []];
|
|
1223
1394
|
}, H = () => {
|
|
1224
|
-
|
|
1225
|
-
}, q = async (
|
|
1226
|
-
n.value = { ...n.value, ...
|
|
1227
|
-
}, Q = async (
|
|
1228
|
-
|
|
1229
|
-
}, U = () => ({ ...
|
|
1395
|
+
d.value = { ...x.value.data ?? {} };
|
|
1396
|
+
}, q = async (p) => {
|
|
1397
|
+
n.value = { ...n.value, ...p }, p.schema && (a.value = [...p.schema]), p.data && (d.value = { ...p.data });
|
|
1398
|
+
}, Q = async (p) => {
|
|
1399
|
+
d.value = { ...d.value, ...p }, n.value = { ...n.value, data: d.value };
|
|
1400
|
+
}, U = () => ({ ...x.value.data ?? d.value ?? {} }), Y = {
|
|
1230
1401
|
setProps: q,
|
|
1231
1402
|
setData: Q,
|
|
1232
1403
|
getData: U
|
|
1233
1404
|
};
|
|
1234
1405
|
e(Y);
|
|
1235
|
-
const
|
|
1236
|
-
typeof window < "u" && (
|
|
1406
|
+
const re = () => {
|
|
1407
|
+
typeof window < "u" && (f.value = window.innerWidth);
|
|
1237
1408
|
};
|
|
1238
1409
|
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:
|
|
1410
|
+
var p;
|
|
1411
|
+
ee(), H(), r.value = ((p = x.value.collapseOptions) == null ? void 0 : p.defaultExpand) !== !1, l("register", Y), typeof window < "u" && window.addEventListener("resize", re);
|
|
1412
|
+
}), Fe(() => {
|
|
1413
|
+
typeof window < "u" && window.removeEventListener("resize", re);
|
|
1414
|
+
}), J(() => x.value.schema, ee, { deep: !0 }), J(() => x.value.data, H, { deep: !0 }), J(() => {
|
|
1415
|
+
var p;
|
|
1416
|
+
return (p = x.value.collapseOptions) == null ? void 0 : p.defaultExpand;
|
|
1417
|
+
}, (p) => {
|
|
1418
|
+
p !== void 0 && (r.value = p);
|
|
1419
|
+
}), { __sfc: !0, props: t, emit: l, innerProps: n, innerData: d, innerSchema: a, windowWidth: f, expanded: r, DescriptionValueRenderer: y, normalizeTooltip: O, getSetting: v, effectiveProps: x, breakpoints: u, resolveColumn: F, currentColumn: _, effectiveData: D, visibleSchema: z, normalizedRows: g, renderedRows: m, showCollapseButton: W, showHeader: b, collapseButtonText: M, bodyStyle: j, getItemStyle: R, getLabelStyle: N, getContentStyle: L, getItemValue: Z, syncSchema: ee, syncData: H, setProps: q, setData: Q, getData: U, descriptionAction: Y, updateWindowWidth: re };
|
|
1249
1420
|
}
|
|
1250
1421
|
});
|
|
1251
|
-
var
|
|
1422
|
+
var Tt = function() {
|
|
1252
1423
|
var n;
|
|
1253
1424
|
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(
|
|
1425
|
+
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(d, a) {
|
|
1426
|
+
return l("div", { key: a }, [e._v(e._s(d))]);
|
|
1427
|
+
}), 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(d, a) {
|
|
1428
|
+
return l("div", { key: `collapse-${a}` }, [e._v(e._s(d))]);
|
|
1429
|
+
}), 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(d) {
|
|
1259
1430
|
t.expanded = !t.expanded;
|
|
1260
1431
|
} } }, [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
1432
|
`is-${t.effectiveProps.size}`,
|
|
1262
1433
|
{ "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}-${
|
|
1434
|
+
], style: t.bodyStyle }, "div", e.$attrs, !1), [e._l(t.renderedRows, function(d, a) {
|
|
1435
|
+
return [e._l(d.items, function(f) {
|
|
1436
|
+
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
1437
|
})];
|
|
1267
1438
|
})], 2)]);
|
|
1268
|
-
},
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1439
|
+
}, Dt = [], kt = /* @__PURE__ */ se(
|
|
1440
|
+
Mt,
|
|
1441
|
+
Tt,
|
|
1442
|
+
Dt,
|
|
1272
1443
|
!1,
|
|
1273
1444
|
null,
|
|
1274
1445
|
"7d6cd376",
|
|
1275
1446
|
null,
|
|
1276
1447
|
null
|
|
1277
1448
|
);
|
|
1278
|
-
const
|
|
1279
|
-
function
|
|
1280
|
-
const e =
|
|
1449
|
+
const Ke = kt.exports;
|
|
1450
|
+
function Vt(i) {
|
|
1451
|
+
const e = k(null), l = () => i ? fe(i) : void 0, t = () => {
|
|
1281
1452
|
const a = fe(e);
|
|
1282
1453
|
if (!a)
|
|
1283
1454
|
throw new Error("ProDescriptions instance has not been registered");
|
|
1284
1455
|
return a;
|
|
1285
1456
|
}, n = (a) => {
|
|
1286
1457
|
e.value = a;
|
|
1287
|
-
const
|
|
1288
|
-
|
|
1458
|
+
const f = l();
|
|
1459
|
+
f && Object.keys(f).length > 0 && a.setProps(f);
|
|
1289
1460
|
};
|
|
1290
|
-
return
|
|
1461
|
+
return i && J(
|
|
1291
1462
|
() => l(),
|
|
1292
1463
|
(a) => {
|
|
1293
1464
|
a && e.value && e.value.setProps(a);
|
|
@@ -1299,38 +1470,49 @@ function Ft(p) {
|
|
|
1299
1470
|
getData: () => t().getData()
|
|
1300
1471
|
}];
|
|
1301
1472
|
}
|
|
1302
|
-
const
|
|
1303
|
-
{ name: "ProTable", component:
|
|
1304
|
-
{ name: "TableAction", component:
|
|
1305
|
-
{ name: "ProForm", component:
|
|
1306
|
-
{ name: "ProFormItem", component:
|
|
1307
|
-
{ name: "FormActions", component:
|
|
1308
|
-
{ name: "
|
|
1473
|
+
const $t = [
|
|
1474
|
+
{ name: "ProTable", component: Ee },
|
|
1475
|
+
{ name: "TableAction", component: Ne },
|
|
1476
|
+
{ name: "ProForm", component: Le },
|
|
1477
|
+
{ name: "ProFormItem", component: Ve },
|
|
1478
|
+
{ name: "FormActions", component: We },
|
|
1479
|
+
{ name: "FormattedNumberInput", component: Ae },
|
|
1480
|
+
{ name: "ProDescriptions", component: Ke }
|
|
1309
1481
|
];
|
|
1310
|
-
function
|
|
1311
|
-
|
|
1312
|
-
|
|
1482
|
+
function zt(i) {
|
|
1483
|
+
$t.forEach(({ name: e, component: l }) => {
|
|
1484
|
+
i.component(e, l);
|
|
1313
1485
|
});
|
|
1314
1486
|
}
|
|
1315
|
-
const
|
|
1316
|
-
install:
|
|
1317
|
-
ProTable:
|
|
1318
|
-
ProForm:
|
|
1319
|
-
ProDescriptions:
|
|
1320
|
-
TableAction:
|
|
1487
|
+
const Wt = {
|
|
1488
|
+
install: zt,
|
|
1489
|
+
ProTable: Ee,
|
|
1490
|
+
ProForm: Le,
|
|
1491
|
+
ProDescriptions: Ke,
|
|
1492
|
+
TableAction: Ne,
|
|
1493
|
+
FormattedNumberInput: Ae
|
|
1321
1494
|
};
|
|
1322
1495
|
export {
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1496
|
+
We as FormActions,
|
|
1497
|
+
Ae as FormattedNumberInput,
|
|
1498
|
+
Ke as ProDescriptions,
|
|
1499
|
+
Le as ProForm,
|
|
1500
|
+
Ve as ProFormItem,
|
|
1501
|
+
Ee as ProTable,
|
|
1502
|
+
Ne as TableAction,
|
|
1503
|
+
ze as clampByIntegerDigits,
|
|
1504
|
+
Wt as default,
|
|
1505
|
+
Ie as formatWithThousands,
|
|
1506
|
+
zt as install,
|
|
1507
|
+
Ce as normalizeNumericValue,
|
|
1508
|
+
it as numberToEditString,
|
|
1509
|
+
st as roundToDecimals,
|
|
1510
|
+
$e as sanitizeNumericInput,
|
|
1511
|
+
Pe as stripNumberGrouping,
|
|
1512
|
+
rt as toFixedDecimalString,
|
|
1513
|
+
Re as useComponentSetting,
|
|
1514
|
+
Vt as useDescription,
|
|
1515
|
+
Nt as useForm,
|
|
1516
|
+
Et as useProTable
|
|
1335
1517
|
};
|
|
1336
1518
|
//# sourceMappingURL=element-component-pro.es.js.map
|