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