@aspire-ui/element-component-pro 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ProForm/ApiSelect.vue.d.ts +67 -0
- package/dist/ProForm/ProForm.vue.d.ts +5 -1
- package/dist/ProForm/ProFormItem.vue.d.ts +4 -0
- package/dist/ProForm/TreeSelect.vue.d.ts +64 -0
- package/dist/ProTable/ProTable.vue.d.ts +1 -1
- package/dist/ProTable/index.d.ts +1 -1
- package/dist/ProTable/useProTable.d.ts +4 -2
- package/dist/element-component-pro.es.js +696 -484
- 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 +186 -167
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +13 -2
- package/package.json +1 -1
- package/src/ProForm/ApiSelect.vue +85 -0
- package/src/ProForm/ProForm.vue +10 -2
- package/src/ProForm/ProFormItem.vue +53 -1
- package/src/ProForm/TreeSelect.vue +272 -0
- package/src/types/index.ts +26 -2
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { reactive as
|
|
1
|
+
import { reactive as $e, defineComponent as ee, h as ce, useSlots as Ce, ref as A, computed as B, onMounted as we, nextTick as Fe, onUnmounted as Re, watch as U, unref as ye } from "vue";
|
|
2
2
|
import { MessageBox as ze } from "element-ui";
|
|
3
|
-
const
|
|
4
|
-
function
|
|
3
|
+
const ge = $e({});
|
|
4
|
+
function Be() {
|
|
5
5
|
return {
|
|
6
|
-
getSetting: (l) => l === void 0 ? { ...
|
|
6
|
+
getSetting: (l) => l === void 0 ? { ...ge } : { ...ge[l] ?? {} },
|
|
7
7
|
setSetting: (l, t) => {
|
|
8
|
-
const
|
|
9
|
-
|
|
8
|
+
const a = ge[l];
|
|
9
|
+
ge[l] = a ? { ...a, ...t } : { ...t };
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
const Ee = /* @__PURE__ */
|
|
13
|
+
const Ee = /* @__PURE__ */ ee({
|
|
14
14
|
__name: "ProTable",
|
|
15
15
|
props: {
|
|
16
16
|
columns: null,
|
|
@@ -54,8 +54,8 @@ const Ee = /* @__PURE__ */ Z({
|
|
|
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(F, { expose: e, emit: l }) {
|
|
58
|
+
const t = F, a = ee({
|
|
59
59
|
name: "EcpProTableDefaultCellRenderer",
|
|
60
60
|
props: {
|
|
61
61
|
column: { type: Object, required: !0 },
|
|
@@ -65,20 +65,20 @@ const Ee = /* @__PURE__ */ Z({
|
|
|
65
65
|
},
|
|
66
66
|
setup(o) {
|
|
67
67
|
return () => {
|
|
68
|
-
var
|
|
69
|
-
const
|
|
70
|
-
if (
|
|
71
|
-
const
|
|
72
|
-
return typeof
|
|
68
|
+
var d, b;
|
|
69
|
+
const n = o.column;
|
|
70
|
+
if (n != null && n.customRender) {
|
|
71
|
+
const D = n.customRender({ text: o.value, record: o.record, index: o.index });
|
|
72
|
+
return typeof D == "string" || typeof D == "number" ? ce("span", String(D)) : D;
|
|
73
73
|
}
|
|
74
|
-
if (
|
|
75
|
-
const
|
|
76
|
-
return
|
|
74
|
+
if (n != null && n.valueEnum) {
|
|
75
|
+
const D = ((b = (d = n.valueEnum) == null ? void 0 : d[o.value]) == null ? void 0 : b.text) ?? o.value;
|
|
76
|
+
return ce("span", D == null ? "" : String(D));
|
|
77
77
|
}
|
|
78
|
-
return
|
|
78
|
+
return ce("span", o.value == null ? "" : String(o.value));
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
-
}),
|
|
81
|
+
}), y = ee({
|
|
82
82
|
name: "EcpProTableBodyCellRenderer",
|
|
83
83
|
props: {
|
|
84
84
|
slotRender: { type: Function, required: !0 },
|
|
@@ -91,72 +91,72 @@ const Ee = /* @__PURE__ */ Z({
|
|
|
91
91
|
},
|
|
92
92
|
setup(o) {
|
|
93
93
|
return () => {
|
|
94
|
-
const
|
|
95
|
-
if (((
|
|
96
|
-
return
|
|
97
|
-
const
|
|
98
|
-
return o.customRender && (
|
|
94
|
+
const n = o.slotRender, d = n == null ? void 0 : n({ column: o.column, record: o.record, index: o.index, value: o.value });
|
|
95
|
+
if (((L) => L == null ? [] : Array.isArray(L) ? L.filter((G) => G != null && G !== !1 && !G.isComment) : [L])(d).length > 0)
|
|
96
|
+
return d;
|
|
97
|
+
const R = { ...o.column };
|
|
98
|
+
return o.customRender && (R.customRender = o.customRender), o.valueEnum && (R.valueEnum = o.valueEnum), ce(a, { props: { column: R, record: o.record, index: o.index, value: o.value } });
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
}),
|
|
101
|
+
}), r = Ce(), C = A(), s = A(), v = A(0), h = A(t.loading ?? !1), c = A([]), m = A({}), k = A([]), z = A({}), x = A([]), T = A(null), u = A({
|
|
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: f } =
|
|
106
|
+
}), { getSetting: f } = Be(), p = B(() => ({ ...f("ProTable"), ...t, ...z.value })), O = B(() => !!p.value.title || !!r.tableTitle || !!r.toolbar), K = B(() => T.value !== null ? T.value : !!t.pagination && typeof t.pagination == "object"), M = B(() => p.value.rowKey || "id"), N = B(() => new Set(x.value.map((o) => o[M.value]))), g = B(
|
|
107
107
|
() => k.value.filter((o) => !o.hideInTable && !o.defaultHidden)
|
|
108
|
-
),
|
|
109
|
-
var
|
|
108
|
+
), E = B(() => {
|
|
109
|
+
var n, d;
|
|
110
110
|
let o = 0;
|
|
111
|
-
return
|
|
112
|
-
}),
|
|
113
|
-
const
|
|
114
|
-
if (
|
|
115
|
-
const
|
|
116
|
-
let
|
|
117
|
-
const
|
|
118
|
-
return
|
|
111
|
+
return p.value.rowSelection && (o += Number(p.value.rowSelection.width) || 48), p.value.showIndexColumn && (o += Number((n = p.value.indexColumnProps) == null ? void 0 : n.width) || 60), p.value.actionColumn && (o += Number((d = p.value.actionColumn) == null ? void 0 : d.width) || 150), o;
|
|
112
|
+
}), I = (o) => typeof o == "number" && o > 0, W = B(() => g.value.filter((n) => Y(n) && I(n.width)).reduce((n, d) => n + (typeof d.width == "number" ? d.width : 0), 0)), X = B(() => g.value.filter((n) => Y(n) && typeof n.width == "string").reduce((n, d) => n + (Number(q(d)) || 80), 0)), V = (o) => o == null ? null : typeof o == "number" ? o : parseInt(String(o).replace(/px$/i, ""), 10) || null, q = (o) => {
|
|
113
|
+
const n = o.width;
|
|
114
|
+
if (I(n) && W.value > 0 && v.value > 0 && typeof n == "number") {
|
|
115
|
+
const d = v.value - E.value - X.value;
|
|
116
|
+
let b = Math.floor(d * n / W.value);
|
|
117
|
+
const D = V(o.minWidth) ?? 60, R = V(o.maxWidth);
|
|
118
|
+
return b = Math.max(D, b), R != null && (b = Math.min(R, b)), b;
|
|
119
119
|
}
|
|
120
|
-
if (typeof
|
|
121
|
-
const
|
|
122
|
-
let
|
|
123
|
-
return
|
|
120
|
+
if (typeof n == "string") {
|
|
121
|
+
const d = V(n) ?? 80, b = V(o.minWidth), D = V(o.maxWidth);
|
|
122
|
+
let R = d;
|
|
123
|
+
return b != null && (R = Math.max(b, R)), D != null && (R = Math.min(D, R)), R;
|
|
124
124
|
}
|
|
125
125
|
return o.width;
|
|
126
|
-
}, Y = (o) => o.ifShow === !1 ? !1 : typeof o.ifShow == "function" ? o.ifShow({ column: o }) : !0,
|
|
127
|
-
var
|
|
128
|
-
const o = (
|
|
129
|
-
return o ? c.value.filter((
|
|
130
|
-
var
|
|
131
|
-
return !((
|
|
126
|
+
}, Y = (o) => o.ifShow === !1 ? !1 : typeof o.ifShow == "function" ? o.ifShow({ column: o }) : !0, j = B(() => {
|
|
127
|
+
var n;
|
|
128
|
+
const o = (n = p.value.rowSelection) == null ? void 0 : n.getCheckboxProps;
|
|
129
|
+
return o ? c.value.filter((d) => {
|
|
130
|
+
var b;
|
|
131
|
+
return !((b = o(d)) != null && b.disabled);
|
|
132
132
|
}) : c.value;
|
|
133
|
-
}),
|
|
134
|
-
const o =
|
|
135
|
-
return o > 0 && o <
|
|
136
|
-
}), fe = (o) =>
|
|
137
|
-
var
|
|
138
|
-
return ((
|
|
139
|
-
},
|
|
140
|
-
var
|
|
141
|
-
return ((
|
|
142
|
-
},
|
|
143
|
-
const o =
|
|
144
|
-
l("selection-change", { keys: o, rows:
|
|
145
|
-
},
|
|
146
|
-
const
|
|
147
|
-
|
|
133
|
+
}), te = B(() => j.value.length > 0), ue = B(() => j.value.length === 0 ? !1 : j.value.every((o) => N.value.has(o[M.value]))), de = B(() => {
|
|
134
|
+
const o = j.value.filter((n) => N.value.has(n[M.value])).length;
|
|
135
|
+
return o > 0 && o < j.value.length;
|
|
136
|
+
}), fe = (o) => N.value.has(o[M.value]), pe = (o) => {
|
|
137
|
+
var n, d, b;
|
|
138
|
+
return ((b = (d = (n = p.value.rowSelection) == null ? void 0 : n.getCheckboxProps) == null ? void 0 : d.call(n, o)) == null ? void 0 : b.disabled) ?? !1;
|
|
139
|
+
}, ve = (o) => {
|
|
140
|
+
var n, d, b;
|
|
141
|
+
return ((b = (d = (n = p.value.rowSelection) == null ? void 0 : n.getRadioProps) == null ? void 0 : d.call(n, o)) == null ? void 0 : b.disabled) ?? !1;
|
|
142
|
+
}, Z = () => {
|
|
143
|
+
const o = x.value.map((n) => n[M.value]);
|
|
144
|
+
l("selection-change", { keys: o, rows: x.value });
|
|
145
|
+
}, me = (o, n) => {
|
|
146
|
+
const d = o[M.value];
|
|
147
|
+
n ? x.value = [...x.value.filter((b) => b[M.value] !== d), o] : x.value = x.value.filter((b) => b[M.value] !== d), Z();
|
|
148
148
|
}, he = (o) => {
|
|
149
|
-
|
|
150
|
-
},
|
|
149
|
+
x.value = [o], Z();
|
|
150
|
+
}, be = (o) => {
|
|
151
151
|
if (o) {
|
|
152
|
-
const
|
|
153
|
-
|
|
152
|
+
const n = new Set(x.value.map((b) => b[M.value])), d = j.value.filter((b) => !n.has(b[M.value]));
|
|
153
|
+
x.value = [...x.value, ...d];
|
|
154
154
|
} else {
|
|
155
|
-
const
|
|
156
|
-
|
|
155
|
+
const n = new Set(c.value.map((d) => d[M.value]));
|
|
156
|
+
x.value = x.value.filter((d) => !n.has(d[M.value]));
|
|
157
157
|
}
|
|
158
|
-
|
|
159
|
-
},
|
|
158
|
+
Z();
|
|
159
|
+
}, J = async (o) => {
|
|
160
160
|
if (!t.api) {
|
|
161
161
|
if (t.dataSource)
|
|
162
162
|
return;
|
|
@@ -165,174 +165,174 @@ const Ee = /* @__PURE__ */ Z({
|
|
|
165
165
|
}
|
|
166
166
|
h.value = !0;
|
|
167
167
|
try {
|
|
168
|
-
const
|
|
169
|
-
[
|
|
170
|
-
[
|
|
168
|
+
const n = p.value.fetchSetting ?? {}, d = n.pageField ?? "page", b = n.sizeField ?? "pageSize", D = n.listField ?? "list", R = n.totalField ?? "total", L = {
|
|
169
|
+
[d]: (o == null ? void 0 : o.page) ?? u.value.page,
|
|
170
|
+
[b]: (o == null ? void 0 : o.pageSize) ?? u.value.pageSize,
|
|
171
171
|
...t.searchInfo,
|
|
172
172
|
...o == null ? void 0 : o.searchInfo
|
|
173
173
|
};
|
|
174
|
-
(o == null ? void 0 : o.page) != null && (
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
const
|
|
178
|
-
c.value =
|
|
179
|
-
} catch (
|
|
180
|
-
l("fetch-error",
|
|
174
|
+
(o == null ? void 0 : o.page) != null && (u.value.page = o.page), (o == null ? void 0 : o.pageSize) != null && (u.value.pageSize = o.pageSize);
|
|
175
|
+
const G = t.beforeFetch ? t.beforeFetch(L) : L, Pe = await t.api(G);
|
|
176
|
+
m.value = Pe || {};
|
|
177
|
+
const _e = t.afterFetch ? t.afterFetch(Pe) : Pe, Se = _e[D] ?? _e.items ?? _e.list ?? [], xe = _e[R] ?? 0;
|
|
178
|
+
c.value = Se, u.value.total = xe, l("fetch-success", { items: Se, total: xe });
|
|
179
|
+
} catch (n) {
|
|
180
|
+
l("fetch-error", n);
|
|
181
181
|
} finally {
|
|
182
182
|
h.value = !1;
|
|
183
183
|
}
|
|
184
|
-
},
|
|
185
|
-
|
|
186
|
-
},
|
|
187
|
-
|
|
188
|
-
},
|
|
184
|
+
}, se = () => J(void 0), re = (o) => {
|
|
185
|
+
p.value.clearSelectOnPageChange && (x.value = []), u.value.pageSize = o, u.value.page = 1, J(void 0);
|
|
186
|
+
}, i = (o) => {
|
|
187
|
+
p.value.clearSelectOnPageChange && (x.value = []), u.value.page = o, J(void 0);
|
|
188
|
+
}, _ = (o, n, d) => l("row-click", o, d), S = (o, n, d) => l("row-dblclick", o, d), P = ({ prop: o, order: n }) => l("sort-change", { prop: o, order: n }), w = (o, n) => l("expand-change", o, n), $ = (o) => c.value.findIndex((n) => n[M.value] === o), H = {
|
|
189
189
|
setProps: (o) => {
|
|
190
|
-
|
|
190
|
+
z.value = { ...z.value, ...o };
|
|
191
191
|
},
|
|
192
|
-
reload: (o) =>
|
|
192
|
+
reload: (o) => J(o),
|
|
193
193
|
redoHeight: () => {
|
|
194
|
-
var o,
|
|
195
|
-
(
|
|
194
|
+
var o, n;
|
|
195
|
+
(n = (o = C.value) == null ? void 0 : o.doLayout) == null || n.call(o);
|
|
196
196
|
},
|
|
197
197
|
setLoading: (o) => {
|
|
198
198
|
h.value = o;
|
|
199
199
|
},
|
|
200
200
|
getDataSource: () => c.value,
|
|
201
|
-
getRawDataSource: () =>
|
|
201
|
+
getRawDataSource: () => m.value,
|
|
202
202
|
setTableData: (o) => {
|
|
203
203
|
c.value = o ?? [];
|
|
204
204
|
},
|
|
205
205
|
getColumns: () => k.value,
|
|
206
206
|
setColumns: (o) => {
|
|
207
207
|
if (Array.isArray(o) && o.length > 0 && typeof o[0] == "string") {
|
|
208
|
-
const
|
|
209
|
-
|
|
208
|
+
const n = o, d = (t.columns ?? []).filter((D) => n.includes(D.key ?? D.dataIndex)), b = n.map((D) => d.find((R) => (R.key ?? R.dataIndex) === D)).filter(Boolean);
|
|
209
|
+
b.length && (k.value = b);
|
|
210
210
|
} else
|
|
211
211
|
k.value = o ?? [];
|
|
212
212
|
},
|
|
213
213
|
setPagination: (o) => {
|
|
214
|
-
o != null && o.page && (
|
|
214
|
+
o != null && o.page && (u.value.page = o.page), o != null && o.pageSize && (u.value.pageSize = o.pageSize), (o == null ? void 0 : o.total) !== void 0 && (u.value.total = o.total);
|
|
215
215
|
},
|
|
216
|
-
getSelectRowKeys: () =>
|
|
217
|
-
getSelectRows: () =>
|
|
216
|
+
getSelectRowKeys: () => x.value.map((o) => o[M.value]),
|
|
217
|
+
getSelectRows: () => x.value,
|
|
218
218
|
clearSelectedRowKeys: () => {
|
|
219
|
-
|
|
219
|
+
x.value = [], Z();
|
|
220
220
|
},
|
|
221
221
|
setSelectedRowKeys: (o) => {
|
|
222
|
-
const
|
|
223
|
-
o.forEach((
|
|
224
|
-
|
|
225
|
-
}),
|
|
222
|
+
const n = new Set(o), d = c.value.filter((b) => n.has(b[M.value]));
|
|
223
|
+
o.forEach((b) => {
|
|
224
|
+
d.some((D) => D[M.value] === b) || d.push({ [M.value]: b });
|
|
225
|
+
}), x.value = d, Z();
|
|
226
226
|
},
|
|
227
227
|
deleteSelectRowByKey: (o) => {
|
|
228
|
-
|
|
228
|
+
x.value = x.value.filter((n) => n[M.value] !== o), Z();
|
|
229
229
|
},
|
|
230
|
-
updateTableData: (o,
|
|
231
|
-
o < 0 || o >= c.value.length || (c.value = [...c.value], c.value[o] = { ...c.value[o], [
|
|
230
|
+
updateTableData: (o, n, d) => {
|
|
231
|
+
o < 0 || o >= c.value.length || (c.value = [...c.value], c.value[o] = { ...c.value[o], [n]: d });
|
|
232
232
|
},
|
|
233
|
-
updateTableDataRecord: (o,
|
|
234
|
-
const
|
|
235
|
-
if (!(
|
|
236
|
-
return c.value = [...c.value], c.value[
|
|
233
|
+
updateTableDataRecord: (o, n) => {
|
|
234
|
+
const d = $(o);
|
|
235
|
+
if (!(d < 0))
|
|
236
|
+
return c.value = [...c.value], c.value[d] = { ...c.value[d], ...n }, c.value[d];
|
|
237
237
|
},
|
|
238
238
|
deleteTableDataRecord: (o) => {
|
|
239
|
-
const
|
|
240
|
-
c.value = c.value.filter((
|
|
239
|
+
const n = Array.isArray(o) ? o : [o], d = new Set(n);
|
|
240
|
+
c.value = c.value.filter((b) => !d.has(b[M.value]));
|
|
241
241
|
},
|
|
242
|
-
insertTableDataRecord: (o,
|
|
243
|
-
const
|
|
244
|
-
return
|
|
242
|
+
insertTableDataRecord: (o, n) => {
|
|
243
|
+
const d = [...c.value];
|
|
244
|
+
return n == null || n >= d.length ? d.push(o) : d.splice(n, 0, o), c.value = d, o;
|
|
245
245
|
},
|
|
246
|
-
getPaginationRef: () =>
|
|
247
|
-
getShowPagination: () =>
|
|
246
|
+
getPaginationRef: () => K.value ? { page: u.value.page, pageSize: Number(u.value.pageSize) || 10, total: u.value.total } : !1,
|
|
247
|
+
getShowPagination: () => K.value,
|
|
248
248
|
setShowPagination: (o) => {
|
|
249
|
-
|
|
249
|
+
T.value = o;
|
|
250
250
|
},
|
|
251
|
-
getRowSelection: () =>
|
|
251
|
+
getRowSelection: () => p.value.rowSelection,
|
|
252
252
|
expandAll: () => {
|
|
253
|
-
var
|
|
254
|
-
const o = ((
|
|
255
|
-
const
|
|
256
|
-
return
|
|
257
|
-
|
|
258
|
-
const
|
|
259
|
-
Array.isArray(
|
|
260
|
-
}),
|
|
253
|
+
var b;
|
|
254
|
+
const o = ((b = p.value.treeProps) == null ? void 0 : b.children) ?? "children", n = (D) => {
|
|
255
|
+
const R = [];
|
|
256
|
+
return D.forEach((L) => {
|
|
257
|
+
R.push(L);
|
|
258
|
+
const G = L[o];
|
|
259
|
+
Array.isArray(G) && G.length > 0 && R.push(...n(G));
|
|
260
|
+
}), R;
|
|
261
261
|
};
|
|
262
|
-
|
|
263
|
-
var
|
|
264
|
-
return (
|
|
262
|
+
n(c.value).forEach((D) => {
|
|
263
|
+
var R, L;
|
|
264
|
+
return (L = (R = C.value) == null ? void 0 : R.toggleRowExpansion) == null ? void 0 : L.call(R, D, !0);
|
|
265
265
|
});
|
|
266
266
|
},
|
|
267
267
|
collapseAll: () => {
|
|
268
|
-
var
|
|
269
|
-
const o = ((
|
|
270
|
-
const
|
|
271
|
-
return
|
|
272
|
-
|
|
273
|
-
const
|
|
274
|
-
Array.isArray(
|
|
275
|
-
}),
|
|
268
|
+
var b;
|
|
269
|
+
const o = ((b = p.value.treeProps) == null ? void 0 : b.children) ?? "children", n = (D) => {
|
|
270
|
+
const R = [];
|
|
271
|
+
return D.forEach((L) => {
|
|
272
|
+
R.push(L);
|
|
273
|
+
const G = L[o];
|
|
274
|
+
Array.isArray(G) && G.length > 0 && R.push(...n(G));
|
|
275
|
+
}), R;
|
|
276
276
|
};
|
|
277
|
-
|
|
278
|
-
var
|
|
279
|
-
return (
|
|
277
|
+
n(c.value).forEach((D) => {
|
|
278
|
+
var R, L;
|
|
279
|
+
return (L = (R = C.value) == null ? void 0 : R.toggleRowExpansion) == null ? void 0 : L.call(R, D, !1);
|
|
280
280
|
});
|
|
281
281
|
}
|
|
282
282
|
};
|
|
283
|
-
e(
|
|
284
|
-
const
|
|
283
|
+
e(H);
|
|
284
|
+
const Q = () => {
|
|
285
285
|
k.value = [...t.columns ?? []];
|
|
286
|
-
},
|
|
287
|
-
t.api &&
|
|
288
|
-
},
|
|
286
|
+
}, ne = () => {
|
|
287
|
+
t.api && p.value.immediate !== !1 ? J(void 0) : t.dataSource && (c.value = [...t.dataSource], !t.api && t.pagination !== !1 && (u.value.total = t.dataSource.length));
|
|
288
|
+
}, ie = () => {
|
|
289
289
|
s.value && (v.value = s.value.offsetWidth || 0);
|
|
290
290
|
};
|
|
291
|
-
let
|
|
292
|
-
return
|
|
293
|
-
|
|
294
|
-
|
|
291
|
+
let le = null, oe = null;
|
|
292
|
+
return we(() => {
|
|
293
|
+
Q(), l("register", H), ne(), typeof window < "u" && (window.addEventListener("resize", ie), le = new ResizeObserver(ie), Fe(() => {
|
|
294
|
+
ie(), oe = s.value, oe && (le == null || le.observe(oe));
|
|
295
295
|
}));
|
|
296
296
|
}), Re(() => {
|
|
297
|
-
typeof window < "u" && (window.removeEventListener("resize",
|
|
298
|
-
}),
|
|
297
|
+
typeof window < "u" && (window.removeEventListener("resize", ie), le && oe && (le.unobserve(oe), oe = null));
|
|
298
|
+
}), U(() => t.columns, Q, { deep: !0 }), U(() => t.dataSource, () => {
|
|
299
299
|
!t.api && t.dataSource && (c.value = [...t.dataSource]);
|
|
300
|
-
}, { deep: !0 }),
|
|
300
|
+
}, { deep: !0 }), U(() => t.loading, (o) => {
|
|
301
301
|
h.value = o ?? !1;
|
|
302
|
-
}), { __sfc: !0, DefaultCellRenderer:
|
|
302
|
+
}), { __sfc: !0, DefaultCellRenderer: a, BodyCellRenderer: y, props: t, emit: l, slots: r, tableRef: C, tableWrapRef: s, containerWidth: v, loading: h, innerData: c, rawDataSource: m, innerColumns: k, innerProps: z, selectedRows: x, showPaginationRef: T, pagination: u, getComponentSetting: f, effectiveProps: p, showTitleBar: O, showPagination: K, rowKeyField: M, selectedKeysSet: N, displayColumns: g, fixedColumnsWidth: E, isRatioWidth: I, totalRatio: W, fixedDataColumnsWidth: X, parseWidthPx: V, getColumnWidth: q, shouldShowColumn: Y, selectableRows: j, hasSelectableRows: te, isAllCurrentPageSelected: ue, isIndeterminate: de, isRowSelected: fe, getCheckboxDisabled: pe, getRadioDisabled: ve, emitSelectionChange: Z, handleCheckboxChange: me, handleRadioSelect: he, handleSelectAll: be, fetchData: J, handleReload: se, handleSizeChange: re, handleCurrentChange: i, handleRowClick: _, handleRowDblclick: S, handleSortChange: P, handleExpandChange: w, findRowIndex: $, tableAction: H, syncColumns: Q, loadData: ne, updateContainerWidth: ie, resizeObserver: le, observedEl: oe };
|
|
303
303
|
}
|
|
304
304
|
});
|
|
305
|
-
function
|
|
306
|
-
var s = typeof
|
|
307
|
-
e && (s.render = e, s.staticRenderFns = l, s._compiled = !0), t && (s.functional = !0),
|
|
305
|
+
function ae(F, e, l, t, a, y, r, C) {
|
|
306
|
+
var s = typeof F == "function" ? F.options : F;
|
|
307
|
+
e && (s.render = e, s.staticRenderFns = l, s._compiled = !0), t && (s.functional = !0), y && (s._scopeId = "data-v-" + y);
|
|
308
308
|
var v;
|
|
309
|
-
if (
|
|
310
|
-
|
|
309
|
+
if (r ? (v = function(m) {
|
|
310
|
+
m = m || // cached call
|
|
311
311
|
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
312
|
-
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !
|
|
313
|
-
}, s._ssrRegister = v) :
|
|
314
|
-
|
|
312
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !m && typeof __VUE_SSR_CONTEXT__ < "u" && (m = __VUE_SSR_CONTEXT__), a && a.call(this, m), m && m._registeredComponents && m._registeredComponents.add(r);
|
|
313
|
+
}, s._ssrRegister = v) : a && (v = C ? function() {
|
|
314
|
+
a.call(
|
|
315
315
|
this,
|
|
316
316
|
(s.functional ? this.parent : this).$root.$options.shadowRoot
|
|
317
317
|
);
|
|
318
|
-
} :
|
|
318
|
+
} : a), v)
|
|
319
319
|
if (s.functional) {
|
|
320
320
|
s._injectStyles = v;
|
|
321
321
|
var h = s.render;
|
|
322
|
-
s.render = function(k,
|
|
323
|
-
return v.call(
|
|
322
|
+
s.render = function(k, z) {
|
|
323
|
+
return v.call(z), h(k, z);
|
|
324
324
|
};
|
|
325
325
|
} else {
|
|
326
326
|
var c = s.beforeCreate;
|
|
327
327
|
s.beforeCreate = c ? [].concat(c, v) : [v];
|
|
328
328
|
}
|
|
329
329
|
return {
|
|
330
|
-
exports:
|
|
330
|
+
exports: F,
|
|
331
331
|
options: s
|
|
332
332
|
};
|
|
333
333
|
}
|
|
334
334
|
var Ie = function() {
|
|
335
|
-
var
|
|
335
|
+
var a, y, r, C;
|
|
336
336
|
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
337
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(s, v) {
|
|
338
338
|
return l("div", { key: v }, [e._v(e._s(s))]);
|
|
@@ -350,7 +350,7 @@ var Ie = function() {
|
|
|
350
350
|
} }, nativeOn: { click: function(h) {
|
|
351
351
|
h.stopPropagation();
|
|
352
352
|
} } }, [l("span")])];
|
|
353
|
-
} }], null, !1, 983730649) }) : e._e(), t.effectiveProps.showIndexColumn ? l("el-table-column", { attrs: { type: "index", label: ((
|
|
353
|
+
} }], null, !1, 983730649) }) : e._e(), t.effectiveProps.showIndexColumn ? l("el-table-column", { attrs: { type: "index", label: ((a = t.effectiveProps.indexColumnProps) == null ? void 0 : a.title) || "序号", width: ((y = t.effectiveProps.indexColumnProps) == null ? void 0 : y.width) || 60, fixed: (r = t.effectiveProps.indexColumnProps) == null ? void 0 : r.fixed, align: ((C = t.effectiveProps.indexColumnProps) == null ? void 0 : C.align) || "center" } }) : e._e(), e._l(t.displayColumns, function(s) {
|
|
354
354
|
return [t.shouldShowColumn(s) ? l("el-table-column", { key: s.dataIndex || s.key || s.title, attrs: { prop: s.dataIndex, label: s.title, width: t.getColumnWidth(s), "min-width": t.isRatioWidth(s.width) ? void 0 : s.minWidth, fixed: s.fixed, align: s.align || "left", sortable: s.sortable, formatter: s.formatter, "show-overflow-tooltip": s.ellipsis !== !1 && t.effectiveProps.ellipsis !== !1 }, scopedSlots: e._u([{ key: "header", fn: function(v) {
|
|
355
355
|
return [s.dataIndex && e.$scopedSlots[`header-${s.dataIndex}`] ? e._t(`header-${s.dataIndex}`, null, { column: s }) : e.$scopedSlots.headerCell ? e._t("headerCell", null, { column: s }) : [l("span", [e._v(e._s(s.title))]), s.helpMessage ? l("el-tooltip", { staticClass: "ecp-pro-table__col-help", attrs: { placement: "top", effect: "dark" } }, [l("template", { slot: "content" }, [Array.isArray(s.helpMessage) ? l("span", e._l(s.helpMessage, function(h, c) {
|
|
356
356
|
return l("div", { key: c }, [e._v(e._s(h))]);
|
|
@@ -361,215 +361,427 @@ var Ie = function() {
|
|
|
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(s) {
|
|
362
362
|
return [e.$scopedSlots.action ? e._t("action", null, { record: s.row, column: t.effectiveProps.actionColumn, index: s.$index }) : e.$scopedSlots.bodyCell ? l(t.BodyCellRenderer, { attrs: { "slot-render": e.$scopedSlots.bodyCell, column: t.effectiveProps.actionColumn, record: s.row, index: s.$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
|
-
},
|
|
364
|
+
}, Le = [], Oe = /* @__PURE__ */ ae(
|
|
365
365
|
Ee,
|
|
366
366
|
Ie,
|
|
367
|
-
|
|
367
|
+
Le,
|
|
368
368
|
!1,
|
|
369
369
|
null,
|
|
370
370
|
"c5638c20",
|
|
371
371
|
null,
|
|
372
372
|
null
|
|
373
373
|
);
|
|
374
|
-
const
|
|
374
|
+
const Ae = Oe.exports, Ve = /* @__PURE__ */ ee({
|
|
375
375
|
__name: "TableAction",
|
|
376
376
|
props: {
|
|
377
377
|
actions: { default: () => [] },
|
|
378
378
|
dropDownActions: { default: () => [] },
|
|
379
379
|
stopButtonPropagation: { type: Boolean, default: !1 }
|
|
380
380
|
},
|
|
381
|
-
setup(
|
|
382
|
-
const e =
|
|
383
|
-
const { ifShow:
|
|
384
|
-
return typeof
|
|
385
|
-
}),
|
|
386
|
-
return { __sfc: !0, props: e, normalizeTooltip: l, getButtonType: t, filterVisible:
|
|
387
|
-
var
|
|
388
|
-
e.stopButtonPropagation && c.stopPropagation(), (
|
|
389
|
-
}, handlePopConfirm: (h, c,
|
|
390
|
-
var k,
|
|
391
|
-
e.stopButtonPropagation &&
|
|
381
|
+
setup(F) {
|
|
382
|
+
const e = F, l = (h) => h ? typeof h == "string" ? { content: h } : h : {}, t = (h) => h.type ? h.type : h.color === "error" ? "danger" : h.color === "success" ? "success" : h.color === "warning" ? "warning" : "text", a = (h) => h.filter((c) => {
|
|
383
|
+
const { ifShow: m } = c;
|
|
384
|
+
return typeof m == "boolean" ? m : typeof m == "function" ? m(c) : !0;
|
|
385
|
+
}), y = B(() => a(e.actions || [])), r = B(() => a(e.dropDownActions || []));
|
|
386
|
+
return { __sfc: !0, props: e, normalizeTooltip: l, getButtonType: t, filterVisible: a, visibleActions: y, visibleDropDownActions: r, handleClick: (h, c) => {
|
|
387
|
+
var m;
|
|
388
|
+
e.stopButtonPropagation && c.stopPropagation(), (m = h.onClick) == null || m.call(h, c);
|
|
389
|
+
}, handlePopConfirm: (h, c, m) => {
|
|
390
|
+
var k, z, x, T;
|
|
391
|
+
e.stopButtonPropagation && m.stopPropagation(), h.popConfirm && (c === "confirm" ? (z = (k = h.popConfirm).confirm) == null || z.call(k) : (T = (x = h.popConfirm).cancel) == null || T.call(x));
|
|
392
392
|
}, handleDropdownCommand: (h) => {
|
|
393
393
|
var k;
|
|
394
|
-
const c = Number(h),
|
|
395
|
-
if (!(!
|
|
396
|
-
if (
|
|
397
|
-
const
|
|
398
|
-
ze.confirm(
|
|
399
|
-
confirmButtonText:
|
|
400
|
-
cancelButtonText:
|
|
394
|
+
const c = Number(h), m = r.value[c];
|
|
395
|
+
if (!(!m || m.disabled)) {
|
|
396
|
+
if (m.popConfirm) {
|
|
397
|
+
const z = m.popConfirm.title, x = m.popConfirm.okText || "确定", T = m.popConfirm.cancelText || "取消";
|
|
398
|
+
ze.confirm(z, "提示", {
|
|
399
|
+
confirmButtonText: x,
|
|
400
|
+
cancelButtonText: T,
|
|
401
401
|
type: "warning"
|
|
402
402
|
}).then(() => {
|
|
403
|
-
var
|
|
404
|
-
return (f = (
|
|
403
|
+
var u, f;
|
|
404
|
+
return (f = (u = m.popConfirm) == null ? void 0 : u.confirm) == null ? void 0 : f.call(u);
|
|
405
405
|
}).catch(() => {
|
|
406
|
-
var
|
|
407
|
-
return (f = (
|
|
406
|
+
var u, f;
|
|
407
|
+
return (f = (u = m.popConfirm) == null ? void 0 : u.cancel) == null ? void 0 : f.call(u);
|
|
408
408
|
});
|
|
409
409
|
return;
|
|
410
410
|
}
|
|
411
|
-
(k =
|
|
411
|
+
(k = m.onClick) == null || k.call(m, {});
|
|
412
412
|
}
|
|
413
413
|
} };
|
|
414
414
|
}
|
|
415
415
|
});
|
|
416
|
-
var
|
|
416
|
+
var Ke = function() {
|
|
417
417
|
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
418
|
-
return l("div", { staticClass: "ecp-table-action" }, [e._l(t.visibleActions, function(
|
|
419
|
-
return l("span", { key: `action-${
|
|
420
|
-
}), 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(
|
|
421
|
-
return l("el-dropdown-item", { key: `dropdown-${
|
|
418
|
+
return l("div", { staticClass: "ecp-table-action" }, [e._l(t.visibleActions, function(a, y) {
|
|
419
|
+
return l("span", { key: `action-${y}`, staticClass: "ecp-table-action__item" }, [a.popConfirm ? l("el-popconfirm", { attrs: { title: a.popConfirm.title, "confirm-button-text": a.popConfirm.okText || "确定", "cancel-button-text": a.popConfirm.cancelText || "取消" }, on: { confirm: (r) => t.handlePopConfirm(a, "confirm", r), cancel: (r) => t.handlePopConfirm(a, "cancel", r) } }, [l("span", { attrs: { slot: "reference" }, slot: "reference" }, [l(a.tooltip ? "el-tooltip" : "span", e._b({ tag: "component" }, "component", a.tooltip ? t.normalizeTooltip(a.tooltip) : {}, !1), [l("el-button", e._b({ attrs: { type: t.getButtonType(a), size: "small", disabled: a.disabled }, on: { click: (r) => t.handleClick(a, r) } }, "el-button", a.props, !1), [a.icon ? l("i", { class: ["ecp-table-action__icon", a.icon] }) : e._e(), l("span", [e._v(e._s(a.label))])])], 1)], 1)]) : l(a.tooltip ? "el-tooltip" : "span", e._b({ tag: "component" }, "component", a.tooltip ? t.normalizeTooltip(a.tooltip) : {}, !1), [l("el-button", e._b({ attrs: { type: t.getButtonType(a), size: "small", disabled: a.disabled }, on: { click: (r) => t.handleClick(a, r) } }, "el-button", a.props, !1), [a.icon ? l("i", { class: ["ecp-table-action__icon", a.icon] }) : e._e(), l("span", [e._v(e._s(a.label))])])], 1), a.divider ? l("el-divider", { attrs: { direction: "vertical" } }) : e._e()], 1);
|
|
420
|
+
}), 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(a, y) {
|
|
421
|
+
return l("el-dropdown-item", { key: `dropdown-${y}`, attrs: { command: y, disabled: a.disabled, divided: !!a.divider } }, [l("span", { staticClass: "ecp-table-action__dropdown-item" }, [a.icon ? l("i", { class: ["ecp-table-action__icon", a.icon] }) : e._e(), l("span", [e._v(e._s(a.label))])])]);
|
|
422
422
|
}), 1)], 1) : e._e()], 2);
|
|
423
|
-
},
|
|
424
|
-
We,
|
|
423
|
+
}, Ne = [], We = /* @__PURE__ */ ae(
|
|
425
424
|
Ve,
|
|
426
425
|
Ke,
|
|
426
|
+
Ne,
|
|
427
427
|
!1,
|
|
428
428
|
null,
|
|
429
429
|
"1b2d6c42",
|
|
430
430
|
null,
|
|
431
431
|
null
|
|
432
432
|
);
|
|
433
|
-
const
|
|
434
|
-
function
|
|
435
|
-
const e =
|
|
436
|
-
const
|
|
437
|
-
if (!
|
|
433
|
+
const ke = We.exports;
|
|
434
|
+
function ht(F) {
|
|
435
|
+
const e = A(null), l = () => F ? ye(F) : void 0, t = () => {
|
|
436
|
+
const r = ye(e);
|
|
437
|
+
if (!r)
|
|
438
438
|
throw new Error("ProTable instance has not been registered");
|
|
439
|
-
return
|
|
439
|
+
return r;
|
|
440
|
+
}, a = (r) => {
|
|
441
|
+
e.value = r;
|
|
442
|
+
const C = l();
|
|
443
|
+
C && Object.keys(C).length > 0 && r.setProps(C);
|
|
440
444
|
};
|
|
441
|
-
return
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
445
|
+
return F && U(
|
|
446
|
+
() => l(),
|
|
447
|
+
(r) => {
|
|
448
|
+
r && e.value && e.value.setProps(r);
|
|
449
|
+
},
|
|
450
|
+
{ deep: !0 }
|
|
451
|
+
), [a, {
|
|
452
|
+
setProps: (r) => t().setProps(r),
|
|
453
|
+
reload: (r) => t().reload(r),
|
|
454
|
+
redoHeight: () => t().redoHeight(),
|
|
455
|
+
setLoading: (r) => t().setLoading(r),
|
|
456
|
+
getDataSource: () => t().getDataSource(),
|
|
457
|
+
getRawDataSource: () => t().getRawDataSource(),
|
|
458
|
+
setTableData: (r) => t().setTableData(r),
|
|
459
|
+
getColumns: () => t().getColumns(),
|
|
460
|
+
setColumns: (r) => t().setColumns(r),
|
|
461
|
+
setPagination: (r) => t().setPagination(r),
|
|
462
|
+
getSelectRowKeys: () => t().getSelectRowKeys(),
|
|
463
|
+
getSelectRows: () => t().getSelectRows(),
|
|
464
|
+
clearSelectedRowKeys: () => t().clearSelectedRowKeys(),
|
|
465
|
+
setSelectedRowKeys: (r) => t().setSelectedRowKeys(r),
|
|
466
|
+
deleteSelectRowByKey: (r) => t().deleteSelectRowByKey(r),
|
|
467
|
+
updateTableData: (r, C, s) => t().updateTableData(r, C, s),
|
|
468
|
+
updateTableDataRecord: (r, C) => t().updateTableDataRecord(r, C),
|
|
469
|
+
deleteTableDataRecord: (r) => t().deleteTableDataRecord(r),
|
|
470
|
+
insertTableDataRecord: (r, C) => t().insertTableDataRecord(r, C),
|
|
471
|
+
getPaginationRef: () => t().getPaginationRef(),
|
|
472
|
+
getShowPagination: () => t().getShowPagination(),
|
|
473
|
+
setShowPagination: (r) => t().setShowPagination(r),
|
|
474
|
+
getRowSelection: () => t().getRowSelection(),
|
|
464
475
|
expandAll: () => {
|
|
465
|
-
var
|
|
466
|
-
return (
|
|
476
|
+
var r, C;
|
|
477
|
+
return (C = (r = t()).expandAll) == null ? void 0 : C.call(r);
|
|
467
478
|
},
|
|
468
479
|
collapseAll: () => {
|
|
469
|
-
var
|
|
470
|
-
return (
|
|
480
|
+
var r, C;
|
|
481
|
+
return (C = (r = t()).collapseAll) == null ? void 0 : C.call(r);
|
|
471
482
|
}
|
|
472
483
|
}];
|
|
473
484
|
}
|
|
474
|
-
const
|
|
485
|
+
const qe = /* @__PURE__ */ ee({
|
|
486
|
+
__name: "ApiSelect",
|
|
487
|
+
props: {
|
|
488
|
+
value: null,
|
|
489
|
+
api: null,
|
|
490
|
+
params: null,
|
|
491
|
+
lazy: { type: Boolean, default: !1 },
|
|
492
|
+
labelField: { default: "label" },
|
|
493
|
+
valueField: { default: "value" },
|
|
494
|
+
placeholder: null,
|
|
495
|
+
disabled: { type: Boolean },
|
|
496
|
+
clearable: { type: Boolean },
|
|
497
|
+
filterable: { type: Boolean },
|
|
498
|
+
multiple: { type: Boolean }
|
|
499
|
+
},
|
|
500
|
+
emits: ["input"],
|
|
501
|
+
setup(F) {
|
|
502
|
+
const e = F, l = A(!1), t = A([]), a = (r) => {
|
|
503
|
+
e.lazy && r && y();
|
|
504
|
+
}, y = async () => {
|
|
505
|
+
if (e.api) {
|
|
506
|
+
l.value = !0;
|
|
507
|
+
try {
|
|
508
|
+
const r = await e.api(e.params), C = Array.isArray(r) ? r : (r == null ? void 0 : r.list) ?? (r == null ? void 0 : r.data) ?? [], s = e.labelField ?? "label", v = e.valueField ?? "value";
|
|
509
|
+
t.value = C.map((h) => {
|
|
510
|
+
const c = h;
|
|
511
|
+
return {
|
|
512
|
+
label: String(c[s] ?? c.label ?? ""),
|
|
513
|
+
value: c[v] ?? c.value
|
|
514
|
+
};
|
|
515
|
+
});
|
|
516
|
+
} finally {
|
|
517
|
+
l.value = !1;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
return we(() => {
|
|
522
|
+
e.lazy || y();
|
|
523
|
+
}), U(
|
|
524
|
+
() => e.api,
|
|
525
|
+
() => {
|
|
526
|
+
e.lazy ? t.value = [] : y();
|
|
527
|
+
},
|
|
528
|
+
{ deep: !0 }
|
|
529
|
+
), U(() => e.params, () => {
|
|
530
|
+
e.lazy ? t.value = [] : y();
|
|
531
|
+
}, { deep: !0 }), { __sfc: !0, props: e, loading: l, options: t, onVisibleChange: a, fetchOptions: y };
|
|
532
|
+
}
|
|
533
|
+
});
|
|
534
|
+
var je = function() {
|
|
535
|
+
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
536
|
+
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(a) {
|
|
537
|
+
return e.$emit("input", a);
|
|
538
|
+
}, "visible-change": t.onVisibleChange } }, "el-select", e.$attrs, !1), e._l(t.options, function(a) {
|
|
539
|
+
return l("el-option", { key: String(a.value), attrs: { label: a.label, value: a.value } });
|
|
540
|
+
}), 1);
|
|
541
|
+
}, He = [], Ge = /* @__PURE__ */ ae(
|
|
542
|
+
qe,
|
|
543
|
+
je,
|
|
544
|
+
He,
|
|
545
|
+
!1,
|
|
546
|
+
null,
|
|
547
|
+
null,
|
|
548
|
+
null,
|
|
549
|
+
null
|
|
550
|
+
);
|
|
551
|
+
const Ue = Ge.exports, Xe = /* @__PURE__ */ ee({
|
|
552
|
+
__name: "TreeSelect",
|
|
553
|
+
props: {
|
|
554
|
+
value: null,
|
|
555
|
+
treeData: null,
|
|
556
|
+
api: null,
|
|
557
|
+
params: null,
|
|
558
|
+
lazy: { type: Boolean, default: !1 },
|
|
559
|
+
labelField: { default: "label" },
|
|
560
|
+
valueField: { default: "value" },
|
|
561
|
+
childrenField: { default: "children" },
|
|
562
|
+
filterable: { type: Boolean },
|
|
563
|
+
placeholder: null,
|
|
564
|
+
disabled: { type: Boolean },
|
|
565
|
+
clearable: { type: Boolean }
|
|
566
|
+
},
|
|
567
|
+
emits: ["input"],
|
|
568
|
+
setup(F, { emit: e }) {
|
|
569
|
+
const l = F, t = A(), a = A(), y = A(!1), r = A(!1), C = A(""), s = A([]), v = A({}), h = B(() => ({
|
|
570
|
+
label: l.labelField,
|
|
571
|
+
children: l.childrenField
|
|
572
|
+
}));
|
|
573
|
+
function c(g) {
|
|
574
|
+
const E = l.labelField ?? "label", I = l.valueField ?? "value", W = l.childrenField ?? "children", X = g[W], V = {};
|
|
575
|
+
return V[l.labelField ?? "label"] = g[E] ?? g.label, V[l.valueField ?? "value"] = g[I] ?? g.value, Array.isArray(X) && X.length && (V[l.childrenField ?? "children"] = X.map((q) => c(q))), V;
|
|
576
|
+
}
|
|
577
|
+
function m(g, E = "") {
|
|
578
|
+
const I = {}, W = l.labelField ?? "label", X = l.valueField ?? "value", V = l.childrenField ?? "children";
|
|
579
|
+
for (const q of g) {
|
|
580
|
+
const Y = String(q[W] ?? q.label ?? ""), j = q[X] ?? q.value;
|
|
581
|
+
j != null && (I[String(j)] = E ? E + " / " + Y : Y);
|
|
582
|
+
const te = q[V] ?? q.children;
|
|
583
|
+
Array.isArray(te) && te.length && Object.assign(I, m(te, Y));
|
|
584
|
+
}
|
|
585
|
+
return I;
|
|
586
|
+
}
|
|
587
|
+
function k() {
|
|
588
|
+
const g = l.treeData;
|
|
589
|
+
return Array.isArray(g) && g.length > 0;
|
|
590
|
+
}
|
|
591
|
+
function z(g) {
|
|
592
|
+
s.value = g, v.value = m(g);
|
|
593
|
+
}
|
|
594
|
+
function x() {
|
|
595
|
+
const g = l.treeData;
|
|
596
|
+
if (!Array.isArray(g) || g.length === 0)
|
|
597
|
+
return;
|
|
598
|
+
const E = g.map((I) => c(I));
|
|
599
|
+
z(E);
|
|
600
|
+
}
|
|
601
|
+
const T = B(() => l.value == null || l.value === "" ? "" : v.value[String(l.value)] ?? String(l.value)), u = (g, E) => {
|
|
602
|
+
if (!g)
|
|
603
|
+
return !0;
|
|
604
|
+
const I = l.labelField ?? "label";
|
|
605
|
+
return String(E[I] ?? E.label ?? "").toLowerCase().includes(g.toLowerCase());
|
|
606
|
+
};
|
|
607
|
+
U(C, (g) => {
|
|
608
|
+
var E;
|
|
609
|
+
(E = a.value) == null || E.filter(g);
|
|
610
|
+
});
|
|
611
|
+
let f = null;
|
|
612
|
+
function p() {
|
|
613
|
+
l.disabled || (y.value = !0, l.lazy && !k() && N(), Fe(() => {
|
|
614
|
+
f = (g) => {
|
|
615
|
+
t.value && !t.value.contains(g.target) && O();
|
|
616
|
+
}, document.addEventListener("click", f);
|
|
617
|
+
}));
|
|
618
|
+
}
|
|
619
|
+
function O() {
|
|
620
|
+
y.value = !1, C.value = "", f && (document.removeEventListener("click", f), f = null);
|
|
621
|
+
}
|
|
622
|
+
function K() {
|
|
623
|
+
e("input", void 0);
|
|
624
|
+
}
|
|
625
|
+
function M(g) {
|
|
626
|
+
const E = l.valueField ?? "value", I = g[E] ?? g.value;
|
|
627
|
+
e("input", I), O();
|
|
628
|
+
}
|
|
629
|
+
async function N() {
|
|
630
|
+
if (!(!l.api || k())) {
|
|
631
|
+
r.value = !0;
|
|
632
|
+
try {
|
|
633
|
+
const g = await l.api(l.params), E = Array.isArray(g) ? g : (g == null ? void 0 : g.list) ?? (g == null ? void 0 : g.data) ?? [];
|
|
634
|
+
s.value = E.map((I) => c(I)), v.value = m(s.value);
|
|
635
|
+
} finally {
|
|
636
|
+
r.value = !1;
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
return we(() => {
|
|
641
|
+
k() ? x() : l.lazy || N();
|
|
642
|
+
}), U(() => l.treeData, () => {
|
|
643
|
+
k() ? x() : (s.value = [], v.value = {}, !l.lazy && l.api && N());
|
|
644
|
+
}, { deep: !0 }), U(() => l.api, () => {
|
|
645
|
+
k() || (l.lazy ? (s.value = [], v.value = {}) : N());
|
|
646
|
+
}, { deep: !0 }), U(() => l.params, () => {
|
|
647
|
+
k() || (l.lazy ? (s.value = [], v.value = {}) : N());
|
|
648
|
+
}, { deep: !0 }), { __sfc: !0, props: l, emit: e, rootRef: t, treeRef: a, dropdownVisible: y, loading: r, filterText: C, treeData: s, flatLabelMap: v, treeProps: h, normalizeNode: c, buildFlatLabelMap: m, hasTreeDataProp: k, applyTreeData: z, syncFromTreeDataProp: x, displayText: T, filterNodeMethod: u, clickOutsideHandler: f, openDropdown: p, closeDropdown: O, clearValue: K, onNodeClick: M, fetchData: N };
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
var Ze = function() {
|
|
652
|
+
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
653
|
+
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(a) {
|
|
654
|
+
a.stopPropagation();
|
|
655
|
+
} }, model: { value: t.filterText, callback: function(a) {
|
|
656
|
+
t.filterText = a;
|
|
657
|
+
}, 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);
|
|
658
|
+
}, Je = [], Qe = /* @__PURE__ */ ae(
|
|
659
|
+
Xe,
|
|
660
|
+
Ze,
|
|
661
|
+
Je,
|
|
662
|
+
!1,
|
|
663
|
+
null,
|
|
664
|
+
"f30bba11",
|
|
665
|
+
null,
|
|
666
|
+
null
|
|
667
|
+
);
|
|
668
|
+
const Ye = Qe.exports, et = /* @__PURE__ */ ee({
|
|
475
669
|
__name: "ProFormItem",
|
|
476
670
|
props: {
|
|
477
671
|
schema: null,
|
|
478
672
|
formModel: null,
|
|
479
673
|
formDisabled: { type: Boolean },
|
|
480
674
|
autoPlaceholder: { type: Boolean },
|
|
481
|
-
formActionType: null
|
|
675
|
+
formActionType: null,
|
|
676
|
+
customComponents: null
|
|
482
677
|
},
|
|
483
|
-
setup(
|
|
484
|
-
const e =
|
|
678
|
+
setup(F) {
|
|
679
|
+
const e = F, l = /* @__PURE__ */ new Set([
|
|
680
|
+
"input",
|
|
681
|
+
"select",
|
|
682
|
+
"api-select",
|
|
683
|
+
"tree-select",
|
|
684
|
+
"date-picker",
|
|
685
|
+
"date-range",
|
|
686
|
+
"input-number",
|
|
687
|
+
"switch",
|
|
688
|
+
"cascader",
|
|
689
|
+
"checkbox",
|
|
690
|
+
"radio"
|
|
691
|
+
]), t = Ce(), a = B(() => ({
|
|
485
692
|
schema: e.schema,
|
|
486
693
|
values: e.formModel,
|
|
487
694
|
model: e.formModel,
|
|
488
695
|
field: e.schema.field
|
|
489
|
-
})),
|
|
490
|
-
const
|
|
491
|
-
return
|
|
492
|
-
}),
|
|
493
|
-
const
|
|
494
|
-
return
|
|
495
|
-
}),
|
|
696
|
+
})), y = B(() => {
|
|
697
|
+
const u = e.schema.ifShow;
|
|
698
|
+
return u === void 0 ? !0 : typeof u == "boolean" ? u : u(a.value);
|
|
699
|
+
}), r = B(() => {
|
|
700
|
+
const u = e.schema.show;
|
|
701
|
+
return u === void 0 ? !0 : typeof u == "boolean" ? u : u(a.value);
|
|
702
|
+
}), C = B(() => {
|
|
496
703
|
if (e.formDisabled)
|
|
497
704
|
return !0;
|
|
498
|
-
const
|
|
499
|
-
return
|
|
500
|
-
}), z = B(() => {
|
|
501
|
-
const p = e.schema.dynamicRules;
|
|
502
|
-
return p ? Array.isArray(p) ? p : p(t.value) : e.schema.rules;
|
|
705
|
+
const u = e.schema.dynamicDisabled;
|
|
706
|
+
return u === void 0 ? !1 : typeof u == "boolean" ? u : u(a.value);
|
|
503
707
|
}), s = B(() => {
|
|
504
|
-
const
|
|
505
|
-
|
|
708
|
+
const u = e.schema.dynamicRules;
|
|
709
|
+
return u ? Array.isArray(u) ? u : u(a.value) : e.schema.rules;
|
|
710
|
+
}), v = B(() => {
|
|
711
|
+
const u = e.schema.componentProps;
|
|
712
|
+
if (!u)
|
|
506
713
|
return { props: {}, listeners: {} };
|
|
507
|
-
const
|
|
508
|
-
...
|
|
714
|
+
const f = typeof u == "function" ? u({
|
|
715
|
+
...a.value,
|
|
509
716
|
formActionType: e.formActionType
|
|
510
|
-
}) : { ...
|
|
511
|
-
for (const [
|
|
512
|
-
if (
|
|
513
|
-
const
|
|
514
|
-
|
|
717
|
+
}) : { ...u }, p = {}, O = {};
|
|
718
|
+
for (const [K, M] of Object.entries(f))
|
|
719
|
+
if (K.length > 2 && /^on[A-Za-z]/.test(K) && typeof M == "function") {
|
|
720
|
+
const N = K.slice(2).charAt(0).toLowerCase() + K.slice(3);
|
|
721
|
+
O[N] = M;
|
|
515
722
|
} else
|
|
516
|
-
|
|
517
|
-
return { props:
|
|
518
|
-
}),
|
|
519
|
-
const
|
|
520
|
-
return Array.isArray(
|
|
521
|
-
},
|
|
522
|
-
const
|
|
523
|
-
return
|
|
723
|
+
p[K] = M;
|
|
724
|
+
return { props: p, listeners: O };
|
|
725
|
+
}), h = B(() => v.value.props), c = B(() => v.value.listeners), m = B(() => !!t.default), k = (u) => {
|
|
726
|
+
const f = u == null ? void 0 : u.options;
|
|
727
|
+
return Array.isArray(f) ? f : void 0;
|
|
728
|
+
}, z = B(() => {
|
|
729
|
+
const u = e.schema.component;
|
|
730
|
+
return u == null ? null : typeof u == "string" ? l.has(u) ? null : e.customComponents && e.customComponents[u] || u : u;
|
|
731
|
+
}), x = (u) => {
|
|
732
|
+
e.formModel[e.schema.field] = u;
|
|
733
|
+
}, T = B(() => {
|
|
734
|
+
const u = e.schema.render;
|
|
735
|
+
return u ? {
|
|
524
736
|
render() {
|
|
525
|
-
const
|
|
526
|
-
return Array.isArray(
|
|
737
|
+
const f = u(a.value);
|
|
738
|
+
return Array.isArray(f) ? ce("span", f) : f;
|
|
527
739
|
}
|
|
528
740
|
} : null;
|
|
529
741
|
});
|
|
530
|
-
return { __sfc: !0, props: e, slots:
|
|
742
|
+
return { __sfc: !0, BUILT_IN_COMPONENTS: l, props: e, slots: t, renderParams: a, shouldRender: y, shouldShow: r, effectiveDisabled: C, effectiveRules: s, effectiveComponentPropsAndListeners: v, effectiveComponentProps: h, effectiveComponentListeners: c, hasSlot: m, getOptions: k, resolvedCustomComponent: z, setFieldValue: x, renderComponent: T, ApiSelect: Ue, TreeSelect: Ye };
|
|
531
743
|
}
|
|
532
744
|
});
|
|
533
|
-
var
|
|
745
|
+
var tt = function() {
|
|
534
746
|
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
535
|
-
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 } }, [l("template", { slot: "label" }, [l("span", [e._v(e._s(e.schema.label))]), 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(
|
|
536
|
-
return l("div", { key:
|
|
537
|
-
}) : 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 }) : [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(
|
|
538
|
-
e.$set(e.formModel, e.schema.field,
|
|
539
|
-
}, 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(
|
|
540
|
-
e.$set(e.formModel, e.schema.field,
|
|
541
|
-
}, 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(
|
|
542
|
-
e.$set(e.formModel, e.schema.field,
|
|
543
|
-
}, expression: "formModel[schema.field]" } }, "el-select", t.effectiveComponentProps, !1), t.effectiveComponentListeners), e._l(t.getOptions(t.effectiveComponentProps) || [], function(
|
|
544
|
-
return l("el-option", { key: String(
|
|
545
|
-
}), 1) : e.schema.component === "date-picker" ? l("el-date-picker", 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(
|
|
546
|
-
e.$set(e.formModel, e.schema.field,
|
|
547
|
-
}, expression: "formModel[schema.field]" } }, "el-date-picker", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "date-range" ? l("el-date-picker", e._g(e._b({ attrs: { type: "daterange", "range-separator": "至", "start-placeholder": "开始日期", "end-placeholder": "结束日期", "value-format": "yyyy-MM-dd", disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(
|
|
548
|
-
e.$set(e.formModel, e.schema.field,
|
|
549
|
-
}, expression: "formModel[schema.field]" } }, "el-date-picker", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "switch" ? l("el-switch", e._g(e._b({ attrs: { disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(
|
|
550
|
-
e.$set(e.formModel, e.schema.field,
|
|
551
|
-
}, expression: "formModel[schema.field]" } }, "el-switch", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "cascader" ? l("el-cascader", 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(
|
|
552
|
-
e.$set(e.formModel, e.schema.field,
|
|
553
|
-
}, expression: "formModel[schema.field]" } }, "el-cascader", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "checkbox" ? l("el-checkbox-group", e._g(e._b({ attrs: { disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(
|
|
554
|
-
e.$set(e.formModel, e.schema.field,
|
|
555
|
-
}, expression: "formModel[schema.field]" } }, "el-checkbox-group", t.effectiveComponentProps, !1), t.effectiveComponentListeners), e._l(t.getOptions(t.effectiveComponentProps) || [], function(
|
|
556
|
-
return l("el-checkbox", { key: String(
|
|
557
|
-
}), 1) : e.schema.component === "radio" ? l("el-radio-group", e._g(e._b({ attrs: { disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(
|
|
558
|
-
e.$set(e.formModel, e.schema.field,
|
|
559
|
-
}, expression: "formModel[schema.field]" } }, "el-radio-group", t.effectiveComponentProps, !1), t.effectiveComponentListeners), e._l(t.getOptions(t.effectiveComponentProps) || [], function(
|
|
560
|
-
return l("el-radio", { key: String(
|
|
747
|
+
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 } }, [l("template", { slot: "label" }, [l("span", [e._v(e._s(e.schema.label))]), 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(a, y) {
|
|
748
|
+
return l("div", { key: y, staticClass: "ecp-pro-form-item__help-item" }, [e._v(" " + e._s(a) + " ")]);
|
|
749
|
+
}) : 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 }) : [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(a) {
|
|
750
|
+
e.$set(e.formModel, e.schema.field, a);
|
|
751
|
+
}, 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(a) {
|
|
752
|
+
e.$set(e.formModel, e.schema.field, a);
|
|
753
|
+
}, 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(a) {
|
|
754
|
+
e.$set(e.formModel, e.schema.field, a);
|
|
755
|
+
}, expression: "formModel[schema.field]" } }, "el-select", t.effectiveComponentProps, !1), t.effectiveComponentListeners), e._l(t.getOptions(t.effectiveComponentProps) || [], function(a) {
|
|
756
|
+
return l("el-option", { key: String(a.value), attrs: { label: a.label, value: a.value } });
|
|
757
|
+
}), 1) : e.schema.component === "api-select" ? l(t.ApiSelect, 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 } }, "ApiSelect", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "tree-select" ? l(t.TreeSelect, 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 } }, "TreeSelect", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "date-picker" ? l("el-date-picker", 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(a) {
|
|
758
|
+
e.$set(e.formModel, e.schema.field, a);
|
|
759
|
+
}, expression: "formModel[schema.field]" } }, "el-date-picker", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "date-range" ? l("el-date-picker", e._g(e._b({ attrs: { type: "daterange", "range-separator": "至", "start-placeholder": "开始日期", "end-placeholder": "结束日期", "value-format": "yyyy-MM-dd", disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(a) {
|
|
760
|
+
e.$set(e.formModel, e.schema.field, a);
|
|
761
|
+
}, expression: "formModel[schema.field]" } }, "el-date-picker", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "switch" ? l("el-switch", e._g(e._b({ attrs: { disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(a) {
|
|
762
|
+
e.$set(e.formModel, e.schema.field, a);
|
|
763
|
+
}, expression: "formModel[schema.field]" } }, "el-switch", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "cascader" ? l("el-cascader", 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(a) {
|
|
764
|
+
e.$set(e.formModel, e.schema.field, a);
|
|
765
|
+
}, expression: "formModel[schema.field]" } }, "el-cascader", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "checkbox" ? l("el-checkbox-group", e._g(e._b({ attrs: { disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(a) {
|
|
766
|
+
e.$set(e.formModel, e.schema.field, a);
|
|
767
|
+
}, expression: "formModel[schema.field]" } }, "el-checkbox-group", t.effectiveComponentProps, !1), t.effectiveComponentListeners), e._l(t.getOptions(t.effectiveComponentProps) || [], function(a) {
|
|
768
|
+
return l("el-checkbox", { key: String(a.value), attrs: { label: a.value } }, [e._v(" " + e._s(a.label) + " ")]);
|
|
769
|
+
}), 1) : e.schema.component === "radio" ? l("el-radio-group", e._g(e._b({ attrs: { disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(a) {
|
|
770
|
+
e.$set(e.formModel, e.schema.field, a);
|
|
771
|
+
}, expression: "formModel[schema.field]" } }, "el-radio-group", t.effectiveComponentProps, !1), t.effectiveComponentListeners), e._l(t.getOptions(t.effectiveComponentProps) || [], function(a) {
|
|
772
|
+
return l("el-radio", { key: String(a.value), attrs: { label: a.value } }, [e._v(" " + e._s(a.label) + " ")]);
|
|
561
773
|
}), 1) : e._e()]], 2) : e._e();
|
|
562
|
-
},
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
774
|
+
}, lt = [], ot = /* @__PURE__ */ ae(
|
|
775
|
+
et,
|
|
776
|
+
tt,
|
|
777
|
+
lt,
|
|
566
778
|
!1,
|
|
567
779
|
null,
|
|
568
|
-
"
|
|
780
|
+
"0dcbe9b0",
|
|
569
781
|
null,
|
|
570
782
|
null
|
|
571
783
|
);
|
|
572
|
-
const
|
|
784
|
+
const Te = ot.exports, at = /* @__PURE__ */ ee({
|
|
573
785
|
__name: "FormActions",
|
|
574
786
|
props: {
|
|
575
787
|
showActionButtonGroup: { type: Boolean, default: !0 },
|
|
@@ -586,28 +798,28 @@ const ke = Ge.exports, Ue = /* @__PURE__ */ Z({
|
|
|
586
798
|
actionColOptions: null
|
|
587
799
|
},
|
|
588
800
|
emits: ["submit", "reset", "toggle"],
|
|
589
|
-
setup(
|
|
801
|
+
setup(F) {
|
|
590
802
|
return { __sfc: !0 };
|
|
591
803
|
}
|
|
592
804
|
});
|
|
593
|
-
var
|
|
805
|
+
var nt = function() {
|
|
594
806
|
var e = this, l = e._self._c;
|
|
595
807
|
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) {
|
|
596
808
|
return e.$emit("submit");
|
|
597
809
|
} } }, [e._v(" " + e._s(e.submitButtonText) + " ")]) : e._e(), e._t("resetBefore"), e.showResetButton ? l("el-button", { attrs: { icon: e.resetButtonIcon }, on: { click: function(t) {
|
|
598
810
|
return e.$emit("reset");
|
|
599
811
|
} } }, [e._v(" " + e._s(e.resetButtonText) + " ")]) : e._e(), e._t("actions")], 2);
|
|
600
|
-
},
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
812
|
+
}, st = [], rt = /* @__PURE__ */ ae(
|
|
813
|
+
at,
|
|
814
|
+
nt,
|
|
815
|
+
st,
|
|
604
816
|
!1,
|
|
605
817
|
null,
|
|
606
818
|
"489c88d2",
|
|
607
819
|
null,
|
|
608
820
|
null
|
|
609
821
|
);
|
|
610
|
-
const
|
|
822
|
+
const De = rt.exports, it = /* @__PURE__ */ ee({
|
|
611
823
|
__name: "ProForm",
|
|
612
824
|
props: {
|
|
613
825
|
schemas: null,
|
|
@@ -634,256 +846,256 @@ const Te = Je.exports, Qe = /* @__PURE__ */ Z({
|
|
|
634
846
|
submitFunc: null,
|
|
635
847
|
resetFunc: null,
|
|
636
848
|
submitOnReset: { type: Boolean, default: !1 },
|
|
637
|
-
formListeners: null
|
|
849
|
+
formListeners: null,
|
|
850
|
+
components: null
|
|
638
851
|
},
|
|
639
852
|
emits: ["submit", "reset", "register"],
|
|
640
|
-
setup(
|
|
641
|
-
const t =
|
|
642
|
-
const
|
|
643
|
-
return
|
|
644
|
-
}, { getSetting:
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
853
|
+
setup(F, { expose: e, emit: l }) {
|
|
854
|
+
const t = F, a = Ce(), y = A(), r = A(), C = A(!1), s = A(!0), v = A({}), h = A({}), c = A([]), m = A({}), k = { xl: 1920, lg: 1200, md: 992, sm: 768 }, z = (i, _, S) => {
|
|
855
|
+
const P = S ?? (typeof window < "u" ? window.innerWidth : 1920), w = i ?? {}, $ = _ ?? {}, H = $.span ?? 8;
|
|
856
|
+
return P >= k.xl ? w.xl ?? $.xl ?? w.lg ?? $.lg ?? w.md ?? $.md ?? w.sm ?? $.sm ?? w.xs ?? $.xs ?? w.span ?? H : P >= k.lg ? w.lg ?? $.lg ?? w.md ?? $.md ?? w.sm ?? $.sm ?? w.xs ?? $.xs ?? w.span ?? H : P >= k.md ? w.md ?? $.md ?? w.sm ?? $.sm ?? w.xs ?? $.xs ?? w.span ?? H : P >= k.sm ? w.sm ?? $.sm ?? w.xs ?? $.xs ?? w.span ?? H : w.xs ?? $.xs ?? w.span ?? H;
|
|
857
|
+
}, { getSetting: x } = Be(), T = B(() => ({ ...x("ProForm"), ...t, ...m.value })), u = B(() => ({
|
|
858
|
+
...x("ProForm").components ?? {},
|
|
859
|
+
...t.components ?? {},
|
|
860
|
+
...m.value.components ?? {}
|
|
861
|
+
})), f = B(() => T.value.actionColOptions ?? { span: 24 }), p = A(typeof window < "u" ? window.innerWidth : 1920), O = (i, _, S, P) => {
|
|
862
|
+
let w = 24, $ = 1, H = 0;
|
|
863
|
+
for (const Q of i) {
|
|
864
|
+
const ne = z(Q.colProps, _, P);
|
|
865
|
+
if (ne > w) {
|
|
866
|
+
if ($++, $ > S)
|
|
650
867
|
break;
|
|
651
|
-
|
|
868
|
+
w = 24 - ne;
|
|
652
869
|
} else
|
|
653
|
-
|
|
654
|
-
|
|
870
|
+
w -= ne;
|
|
871
|
+
H++;
|
|
655
872
|
}
|
|
656
|
-
return
|
|
657
|
-
},
|
|
658
|
-
const
|
|
659
|
-
if (!
|
|
873
|
+
return H;
|
|
874
|
+
}, K = B(() => {
|
|
875
|
+
const i = c.value.filter((w) => g(w));
|
|
876
|
+
if (!T.value.showAdvancedButton)
|
|
660
877
|
return !1;
|
|
661
|
-
const
|
|
662
|
-
return console.log(
|
|
663
|
-
}),
|
|
664
|
-
const
|
|
665
|
-
if (!
|
|
666
|
-
return
|
|
667
|
-
const
|
|
668
|
-
return
|
|
669
|
-
}),
|
|
670
|
-
let
|
|
671
|
-
return typeof
|
|
672
|
-
},
|
|
673
|
-
const
|
|
674
|
-
c.value.forEach((
|
|
675
|
-
var
|
|
676
|
-
|
|
677
|
-
}), v.value = { ...v.value, ...
|
|
678
|
-
},
|
|
679
|
-
const
|
|
680
|
-
return c.value.forEach((
|
|
681
|
-
const
|
|
682
|
-
if (
|
|
878
|
+
const _ = T.value.alwaysShowLines ?? 1, S = T.value.baseColProps, P = O(i, S, _, p.value);
|
|
879
|
+
return console.log(i.length, P), i.length > P;
|
|
880
|
+
}), M = B(() => T.value.formListeners ?? {}), N = B(() => {
|
|
881
|
+
const i = c.value.filter((w) => g(w));
|
|
882
|
+
if (!T.value.showAdvancedButton || !s.value)
|
|
883
|
+
return i;
|
|
884
|
+
const _ = T.value.alwaysShowLines ?? 1, S = T.value.baseColProps, P = O(i, S, _, p.value);
|
|
885
|
+
return i.slice(0, P);
|
|
886
|
+
}), g = (i) => {
|
|
887
|
+
let _ = !0, S = !0;
|
|
888
|
+
return typeof i.ifShow == "function" && (_ = i.ifShow({ schema: i, values: v.value, model: v.value, field: i.field })), typeof i.ifShow == "boolean" && (_ = i.ifShow), typeof i.show == "function" && (S = i.show({ schema: i, values: v.value, model: v.value, field: i.field })), typeof i.show == "boolean" && (S = i.show), _ && S;
|
|
889
|
+
}, E = (i) => i.colProps ?? T.value.baseColProps ?? {}, I = (i) => i.slot || i.field, W = () => {
|
|
890
|
+
const i = {}, _ = {}, S = T.value.initialValues ?? t.initialValues;
|
|
891
|
+
c.value.forEach((P) => {
|
|
892
|
+
var w;
|
|
893
|
+
i[P.field] = P.defaultValue ?? (S == null ? void 0 : S[P.field]), (w = P.rules) != null && w.length && (_[P.field] = P.rules);
|
|
894
|
+
}), v.value = { ...v.value, ...i }, h.value = _;
|
|
895
|
+
}, X = (i) => {
|
|
896
|
+
const _ = { ...i };
|
|
897
|
+
return c.value.forEach((S) => {
|
|
898
|
+
const P = S.ifShow;
|
|
899
|
+
if (P === void 0)
|
|
683
900
|
return;
|
|
684
|
-
(typeof
|
|
685
|
-
}),
|
|
686
|
-
},
|
|
687
|
-
const
|
|
688
|
-
if (!(
|
|
689
|
-
return
|
|
690
|
-
const
|
|
691
|
-
return
|
|
692
|
-
const
|
|
693
|
-
Array.isArray(
|
|
694
|
-
}),
|
|
695
|
-
},
|
|
696
|
-
var
|
|
901
|
+
(typeof P == "boolean" ? P : P({ schema: S, values: i, model: i, field: S.field })) || delete _[S.field];
|
|
902
|
+
}), _;
|
|
903
|
+
}, V = (i) => {
|
|
904
|
+
const _ = X(i), S = m.value.fieldMapToTime;
|
|
905
|
+
if (!(S != null && S.length))
|
|
906
|
+
return _;
|
|
907
|
+
const P = { ..._ };
|
|
908
|
+
return S.forEach(([w, [$, H]]) => {
|
|
909
|
+
const Q = P[w];
|
|
910
|
+
Array.isArray(Q) && Q.length === 2 && (delete P[w], P[$] = Q[0], P[H] = Q[1]);
|
|
911
|
+
}), P;
|
|
912
|
+
}, q = async () => {
|
|
913
|
+
var i;
|
|
697
914
|
try {
|
|
698
|
-
await ((
|
|
699
|
-
} catch (
|
|
700
|
-
console.error("Form validation failed:",
|
|
915
|
+
await ((i = y.value) == null ? void 0 : i.validate()), T.value.submitFunc ? await T.value.submitFunc() : (C.value = !0, l("submit", V({ ...v.value })));
|
|
916
|
+
} catch (_) {
|
|
917
|
+
console.error("Form validation failed:", _);
|
|
701
918
|
} finally {
|
|
702
|
-
|
|
919
|
+
C.value = !1;
|
|
703
920
|
}
|
|
704
|
-
},
|
|
705
|
-
var
|
|
706
|
-
|
|
707
|
-
},
|
|
708
|
-
var
|
|
709
|
-
(
|
|
710
|
-
},
|
|
711
|
-
var
|
|
712
|
-
return ((
|
|
713
|
-
},
|
|
714
|
-
|
|
715
|
-
}))) :
|
|
716
|
-
var
|
|
717
|
-
const
|
|
718
|
-
return
|
|
719
|
-
},
|
|
720
|
-
var
|
|
721
|
-
(
|
|
722
|
-
},
|
|
723
|
-
(Array.isArray(
|
|
724
|
-
const
|
|
725
|
-
|
|
921
|
+
}, Y = async () => {
|
|
922
|
+
var i;
|
|
923
|
+
T.value.resetFunc ? await T.value.resetFunc() : ((i = y.value) == null || i.resetFields(), W(), l("reset"), T.value.submitOnReset && await q());
|
|
924
|
+
}, j = (i) => (v.value = { ...v.value, ...i }, Promise.resolve()), te = () => V({ ...v.value }), ue = async () => {
|
|
925
|
+
var i;
|
|
926
|
+
(i = y.value) == null || i.resetFields(), W();
|
|
927
|
+
}, de = (i) => {
|
|
928
|
+
var _;
|
|
929
|
+
return ((_ = y.value) == null ? void 0 : _.validate(i)) ?? Promise.resolve();
|
|
930
|
+
}, fe = (i) => y.value ? i != null && i.length ? Promise.all(i.map((_) => new Promise((S, P) => {
|
|
931
|
+
y.value.validateField(_, (w) => w ? S(void 0) : P(new Error("Validation failed")));
|
|
932
|
+
}))) : y.value.validate() : Promise.resolve(), pe = async (i, _) => {
|
|
933
|
+
var P;
|
|
934
|
+
const S = (P = r.value) == null ? void 0 : P.querySelector(`[data-field="${i}"]`);
|
|
935
|
+
return S && S.scrollIntoView({ behavior: (_ == null ? void 0 : _.behavior) ?? "smooth", block: (_ == null ? void 0 : _.block) ?? "nearest" }), Promise.resolve();
|
|
936
|
+
}, ve = (i) => {
|
|
937
|
+
var _;
|
|
938
|
+
(_ = y.value) == null || _.clearValidate(i);
|
|
939
|
+
}, Z = async (i) => {
|
|
940
|
+
(Array.isArray(i) ? i : [i]).forEach((S) => {
|
|
941
|
+
const P = c.value.findIndex((w) => w.field === S.field);
|
|
942
|
+
P >= 0 && (c.value[P] = { ...c.value[P], ...S });
|
|
726
943
|
});
|
|
727
|
-
},
|
|
728
|
-
if (
|
|
729
|
-
c.value.unshift(
|
|
730
|
-
else if (
|
|
731
|
-
const
|
|
732
|
-
c.value.splice(
|
|
944
|
+
}, me = async (i, _, S) => {
|
|
945
|
+
if (S)
|
|
946
|
+
c.value.unshift(i);
|
|
947
|
+
else if (_) {
|
|
948
|
+
const P = c.value.findIndex((w) => w.field === _);
|
|
949
|
+
c.value.splice(P + 1, 0, i);
|
|
733
950
|
} else
|
|
734
|
-
c.value.push(
|
|
735
|
-
|
|
736
|
-
},
|
|
737
|
-
const
|
|
738
|
-
c.value = c.value.filter((
|
|
739
|
-
},
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
updateSchema: me,
|
|
755
|
-
appendSchemaByField: K,
|
|
756
|
-
removeSchemaByField: ve,
|
|
757
|
-
setProps: he
|
|
951
|
+
c.value.push(i);
|
|
952
|
+
W();
|
|
953
|
+
}, he = async (i) => {
|
|
954
|
+
const _ = Array.isArray(i) ? i : [i];
|
|
955
|
+
c.value = c.value.filter((S) => !_.includes(S.field));
|
|
956
|
+
}, be = async (i) => {
|
|
957
|
+
m.value = { ...m.value, ...i }, i.schemas && (c.value = [...i.schemas], W());
|
|
958
|
+
}, J = {
|
|
959
|
+
getFieldsValue: te,
|
|
960
|
+
setFieldsValue: j,
|
|
961
|
+
resetFields: ue,
|
|
962
|
+
validate: de,
|
|
963
|
+
validateFields: fe,
|
|
964
|
+
submit: q,
|
|
965
|
+
scrollToField: pe,
|
|
966
|
+
clearValidate: ve,
|
|
967
|
+
updateSchema: Z,
|
|
968
|
+
appendSchemaByField: me,
|
|
969
|
+
removeSchemaByField: he,
|
|
970
|
+
setProps: be
|
|
758
971
|
};
|
|
759
|
-
e(
|
|
760
|
-
const
|
|
761
|
-
c.value = [...t.schemas ?? []],
|
|
762
|
-
},
|
|
763
|
-
typeof window < "u" && (
|
|
972
|
+
e(J);
|
|
973
|
+
const se = () => {
|
|
974
|
+
c.value = [...t.schemas ?? []], W();
|
|
975
|
+
}, re = () => {
|
|
976
|
+
typeof window < "u" && (p.value = window.innerWidth);
|
|
764
977
|
};
|
|
765
|
-
return
|
|
766
|
-
|
|
978
|
+
return we(() => {
|
|
979
|
+
se(), l("register", J), typeof window < "u" && window.addEventListener("resize", re);
|
|
767
980
|
}), Re(() => {
|
|
768
|
-
typeof window < "u" && window.removeEventListener("resize",
|
|
769
|
-
}),
|
|
981
|
+
typeof window < "u" && window.removeEventListener("resize", re);
|
|
982
|
+
}), U(() => [t.schemas, t.initialValues], se, { deep: !0 }), { __sfc: !0, props: t, emit: l, slots: a, formRef: y, formWrapRef: r, submitLoading: C, collapsed: s, formModel: v, formRules: h, innerSchemas: c, innerProps: m, BREAKPOINTS: k, getEffectiveSpan: z, getComponentSetting: x, effectiveProps: T, formCustomComponents: u, effectiveActionColOptions: f, windowWidth: p, getVisibleSchemaCount: O, hasMoreFields: K, formListeners: M, displaySchemas: N, shouldShow: g, getColProps: E, getSlotName: I, initForm: W, filterByIfShow: X, processFieldMapToTime: V, handleSubmit: q, handleReset: Y, setFieldsValue: j, getFieldsValue: te, resetFields: ue, validate: de, validateFields: fe, scrollToField: pe, clearValidate: ve, updateSchema: Z, appendSchemaByField: me, removeSchemaByField: he, setProps: be, formActionRef: J, syncSchemas: se, handleResize: re, ProFormItem: Te, FormActions: De };
|
|
770
983
|
}
|
|
771
984
|
});
|
|
772
|
-
var
|
|
985
|
+
var ct = function() {
|
|
773
986
|
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
774
|
-
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.formModel, 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(
|
|
775
|
-
var
|
|
776
|
-
return [t.shouldShow(
|
|
777
|
-
}), 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(
|
|
987
|
+
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.formModel, 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(a) {
|
|
988
|
+
var y, r;
|
|
989
|
+
return [t.shouldShow(a) ? l("el-col", e._b({ key: a.field, attrs: { offset: ((y = a.colProps) == null ? void 0 : y.offset) ?? ((r = t.effectiveProps.baseColProps) == null ? void 0 : r.offset) ?? 0, "data-field": a.field } }, "el-col", t.getColProps(a), !1), [l(t.ProFormItem, { attrs: { schema: a, "form-model": t.formModel, "form-disabled": t.effectiveProps.disabled, "auto-placeholder": t.effectiveProps.autoSetPlaceholder, "form-action-type": t.formActionRef, "custom-components": t.formCustomComponents } }, [t.slots[t.getSlotName(a)] ? [e._t(t.getSlotName(a), null, { model: t.formModel, schema: a, field: a.field, values: t.formModel })] : e._e()], 2)], 1) : e._e()];
|
|
990
|
+
}), 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(a) {
|
|
778
991
|
t.collapsed = !t.collapsed;
|
|
779
|
-
} } }, [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(
|
|
992
|
+
} } }, [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(a) {
|
|
780
993
|
t.collapsed = !t.collapsed;
|
|
781
994
|
} } }, [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);
|
|
782
|
-
},
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
995
|
+
}, ut = [], dt = /* @__PURE__ */ ae(
|
|
996
|
+
it,
|
|
997
|
+
ct,
|
|
998
|
+
ut,
|
|
786
999
|
!1,
|
|
787
1000
|
null,
|
|
788
|
-
"
|
|
1001
|
+
"4ee1cb87",
|
|
789
1002
|
null,
|
|
790
1003
|
null
|
|
791
1004
|
);
|
|
792
|
-
const Me =
|
|
793
|
-
function
|
|
794
|
-
const e =
|
|
1005
|
+
const Me = dt.exports;
|
|
1006
|
+
function bt(F) {
|
|
1007
|
+
const e = A(null), l = A(F ? ye(F) : void 0), t = () => F ? ye(F) : void 0, a = (f) => {
|
|
795
1008
|
e.value = f;
|
|
796
|
-
const
|
|
797
|
-
|
|
798
|
-
d && Object.keys(d).length > 0 && f.setProps(d);
|
|
1009
|
+
const p = t();
|
|
1010
|
+
p && Object.keys(p).length > 0 && f.setProps(p);
|
|
799
1011
|
};
|
|
800
|
-
return
|
|
1012
|
+
return F && U(
|
|
801
1013
|
() => t(),
|
|
802
1014
|
(f) => {
|
|
803
1015
|
l.value = f, f && e.value && e.value.setProps(f);
|
|
804
1016
|
},
|
|
805
1017
|
{ deep: !0 }
|
|
806
|
-
), [
|
|
807
|
-
register:
|
|
1018
|
+
), [a, {
|
|
1019
|
+
register: a,
|
|
808
1020
|
formAction: e,
|
|
809
1021
|
getFieldsValue: () => {
|
|
810
1022
|
var f;
|
|
811
1023
|
return ((f = e.value) == null ? void 0 : f.getFieldsValue()) ?? {};
|
|
812
1024
|
},
|
|
813
1025
|
setFieldsValue: async (f) => {
|
|
814
|
-
var
|
|
815
|
-
await ((
|
|
1026
|
+
var p;
|
|
1027
|
+
await ((p = e.value) == null ? void 0 : p.setFieldsValue(f));
|
|
816
1028
|
},
|
|
817
1029
|
resetFields: async () => {
|
|
818
1030
|
var f;
|
|
819
1031
|
await ((f = e.value) == null ? void 0 : f.resetFields());
|
|
820
1032
|
},
|
|
821
1033
|
validate: (f) => {
|
|
822
|
-
var
|
|
823
|
-
return ((
|
|
1034
|
+
var p;
|
|
1035
|
+
return ((p = e.value) == null ? void 0 : p.validate(f)) ?? Promise.resolve();
|
|
824
1036
|
},
|
|
825
1037
|
validateFields: (f) => {
|
|
826
|
-
var
|
|
827
|
-
return ((
|
|
1038
|
+
var p;
|
|
1039
|
+
return ((p = e.value) == null ? void 0 : p.validateFields(f)) ?? Promise.resolve();
|
|
828
1040
|
},
|
|
829
1041
|
submit: () => {
|
|
830
1042
|
var f;
|
|
831
1043
|
return ((f = e.value) == null ? void 0 : f.submit()) ?? Promise.resolve();
|
|
832
1044
|
},
|
|
833
|
-
scrollToField: (f,
|
|
1045
|
+
scrollToField: (f, p) => {
|
|
834
1046
|
var O;
|
|
835
|
-
return ((O = e.value) == null ? void 0 : O.scrollToField(f,
|
|
1047
|
+
return ((O = e.value) == null ? void 0 : O.scrollToField(f, p)) ?? Promise.resolve();
|
|
836
1048
|
},
|
|
837
1049
|
clearValidate: (f) => {
|
|
838
|
-
var
|
|
839
|
-
(
|
|
1050
|
+
var p;
|
|
1051
|
+
(p = e.value) == null || p.clearValidate(f);
|
|
840
1052
|
},
|
|
841
1053
|
updateSchema: (f) => {
|
|
842
|
-
var
|
|
843
|
-
return ((
|
|
1054
|
+
var p;
|
|
1055
|
+
return ((p = e.value) == null ? void 0 : p.updateSchema(f)) ?? Promise.resolve();
|
|
844
1056
|
},
|
|
845
|
-
appendSchemaByField: (f,
|
|
846
|
-
var
|
|
847
|
-
return ((
|
|
1057
|
+
appendSchemaByField: (f, p, O) => {
|
|
1058
|
+
var K;
|
|
1059
|
+
return ((K = e.value) == null ? void 0 : K.appendSchemaByField(f, p, O)) ?? Promise.resolve();
|
|
848
1060
|
},
|
|
849
1061
|
removeSchemaByField: (f) => {
|
|
850
|
-
var
|
|
851
|
-
return ((
|
|
1062
|
+
var p;
|
|
1063
|
+
return ((p = e.value) == null ? void 0 : p.removeSchemaByField(f)) ?? Promise.resolve();
|
|
852
1064
|
},
|
|
853
1065
|
setProps: async (f) => {
|
|
854
|
-
var
|
|
855
|
-
l.value = { ...l.value, ...f }, await ((
|
|
1066
|
+
var p;
|
|
1067
|
+
l.value = { ...l.value, ...f }, await ((p = e.value) == null ? void 0 : p.setProps(f));
|
|
856
1068
|
}
|
|
857
1069
|
}];
|
|
858
1070
|
}
|
|
859
|
-
const
|
|
860
|
-
{ name: "ProTable", component:
|
|
861
|
-
{ name: "TableAction", component:
|
|
1071
|
+
const ft = [
|
|
1072
|
+
{ name: "ProTable", component: Ae },
|
|
1073
|
+
{ name: "TableAction", component: ke },
|
|
862
1074
|
{ name: "ProForm", component: Me },
|
|
863
|
-
{ name: "ProFormItem", component:
|
|
864
|
-
{ name: "FormActions", component:
|
|
1075
|
+
{ name: "ProFormItem", component: Te },
|
|
1076
|
+
{ name: "FormActions", component: De }
|
|
865
1077
|
];
|
|
866
|
-
function
|
|
867
|
-
|
|
868
|
-
|
|
1078
|
+
function pt(F) {
|
|
1079
|
+
ft.forEach(({ name: e, component: l }) => {
|
|
1080
|
+
F.component(e, l);
|
|
869
1081
|
});
|
|
870
1082
|
}
|
|
871
|
-
const
|
|
872
|
-
install:
|
|
873
|
-
ProTable:
|
|
1083
|
+
const _t = {
|
|
1084
|
+
install: pt,
|
|
1085
|
+
ProTable: Ae,
|
|
874
1086
|
ProForm: Me,
|
|
875
|
-
TableAction:
|
|
1087
|
+
TableAction: ke
|
|
876
1088
|
};
|
|
877
1089
|
export {
|
|
878
|
-
|
|
1090
|
+
De as FormActions,
|
|
879
1091
|
Me as ProForm,
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
1092
|
+
Te as ProFormItem,
|
|
1093
|
+
Ae as ProTable,
|
|
1094
|
+
ke as TableAction,
|
|
1095
|
+
_t as default,
|
|
1096
|
+
pt as install,
|
|
1097
|
+
Be as useComponentSetting,
|
|
1098
|
+
bt as useForm,
|
|
1099
|
+
ht as useProTable
|
|
888
1100
|
};
|
|
889
1101
|
//# sourceMappingURL=element-component-pro.es.js.map
|