cc1-form 1.2.27 → 1.2.28
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/cc1-form.js +79 -79
- package/dist/cc1-form.umd.cjs +1 -1
- package/dist/components/TCurd/com/form/column.vue.d.ts +12 -0
- package/dist/components/TCurd/core/update.d.ts +3 -2
- package/dist/components/TCurd/index.d.ts +3 -2
- package/dist/components/TCurd/index.vue.d.ts +15 -10
- package/dist/index.d.ts +2 -1
- package/package.json +1 -1
package/dist/cc1-form.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElMessage as Ie, ElLoading as Ke, ElFormItem as he, ElInput as se, ElSwitch as ie, ElSelect as oe, ElOption as X, ElRadioGroup as Ce, ElRadio as xe, ElTreeSelect as He, ElDatePicker as Se, ElForm as q, ElDialog as ye, ElButton as
|
|
1
|
+
import { ElMessage as Ie, ElLoading as Ke, ElFormItem as he, ElInput as se, ElSwitch as ie, ElSelect as oe, ElOption as X, ElRadioGroup as Ce, ElRadio as xe, ElTreeSelect as He, ElDatePicker as Se, ElForm as q, ElDialog as ye, ElButton as L, ElTableColumn as re, ElDropdown as Ge, ElDropdownMenu as Ne, ElDropdownItem as ge, ElPagination as we, ElTable as We } from "element-plus";
|
|
2
2
|
import "vue-router";
|
|
3
3
|
import { defineComponent as G, reactive as me, onMounted as Ve, resolveComponent as ae, openBlock as u, createElementBlock as p, renderSlot as k, createVNode as $, withCtx as y, createTextVNode as V, createCommentVNode as w, Fragment as F, renderList as j, createBlock as h, normalizeClass as I, normalizeStyle as de, unref as r, createElementVNode as O, mergeProps as C, toHandlers as E, createSlots as W, toDisplayString as D, resolveDynamicComponent as Y, computed as te, ref as Q, watch as Je, normalizeProps as be, guardReactiveProps as pe, getCurrentInstance as Qe, withModifiers as qe, resolveDirective as Xe, withDirectives as Ye } from "vue";
|
|
4
4
|
import { Scope as ze } from "cc1-vue3";
|
|
@@ -1006,45 +1006,45 @@ const K = 12, ue = (e, n) => {
|
|
|
1006
1006
|
const x = [];
|
|
1007
1007
|
let z = 1;
|
|
1008
1008
|
return t.forEach((U) => {
|
|
1009
|
-
const
|
|
1009
|
+
const T = ve(U.item), A = l;
|
|
1010
1010
|
x.push({
|
|
1011
1011
|
...U,
|
|
1012
1012
|
span: A,
|
|
1013
1013
|
colSpan: A,
|
|
1014
|
-
rowSpan:
|
|
1014
|
+
rowSpan: T,
|
|
1015
1015
|
gridRow: z,
|
|
1016
1016
|
gridColumn: 1,
|
|
1017
1017
|
gridBand: ce({ gridRow: z })
|
|
1018
|
-
}), z +=
|
|
1018
|
+
}), z += T;
|
|
1019
1019
|
}), { cells: x, maxSpan: l };
|
|
1020
1020
|
}
|
|
1021
1021
|
const s = /* @__PURE__ */ new Set(), f = [];
|
|
1022
1022
|
let d = 0, c = 0;
|
|
1023
|
-
const v = (x) => Math.floor(x / K) * K, m = (x, z) => `${x},${z}`, g = (x, z, U,
|
|
1023
|
+
const v = (x) => Math.floor(x / K) * K, m = (x, z) => `${x},${z}`, g = (x, z, U, T) => {
|
|
1024
1024
|
if (z + U > l) return !1;
|
|
1025
|
-
for (let A = 0; A <
|
|
1025
|
+
for (let A = 0; A < T; A++)
|
|
1026
1026
|
for (let R = 0; R < U; R++)
|
|
1027
1027
|
if (s.has(m(x + A, z + R))) return !1;
|
|
1028
1028
|
return !0;
|
|
1029
|
-
}, B = (x, z, U,
|
|
1030
|
-
for (let A = 0; A <
|
|
1029
|
+
}, B = (x, z, U, T) => {
|
|
1030
|
+
for (let A = 0; A < T; A++)
|
|
1031
1031
|
for (let R = 0; R < U; R++)
|
|
1032
1032
|
s.add(m(x + A, z + R));
|
|
1033
|
-
}, H = (x, z, U,
|
|
1033
|
+
}, H = (x, z, U, T) => {
|
|
1034
1034
|
for (let R = v(x); R < 500 * K; R += K) {
|
|
1035
|
-
const
|
|
1036
|
-
for (let ee = je; ee <
|
|
1035
|
+
const Te = R + K, je = R === v(x) ? Math.max(R, x) : R;
|
|
1036
|
+
for (let ee = je; ee < Te; ee++) {
|
|
1037
1037
|
const Pe = ee === x ? z : 0;
|
|
1038
1038
|
for (let ne = Pe; ne <= l - U; ne++)
|
|
1039
|
-
if (g(ee, ne, U,
|
|
1039
|
+
if (g(ee, ne, U, T))
|
|
1040
1040
|
return { tr: ee, tc: ne };
|
|
1041
1041
|
}
|
|
1042
1042
|
}
|
|
1043
1043
|
return { tr: x, tc: z };
|
|
1044
|
-
}, _ = (x, z, U,
|
|
1044
|
+
}, _ = (x, z, U, T) => {
|
|
1045
1045
|
const A = v(x);
|
|
1046
|
-
if (
|
|
1047
|
-
d = x +
|
|
1046
|
+
if (T < K && x + T < A + K) {
|
|
1047
|
+
d = x + T, c = z;
|
|
1048
1048
|
return;
|
|
1049
1049
|
}
|
|
1050
1050
|
const R = z + U;
|
|
@@ -1057,9 +1057,9 @@ const K = 12, ue = (e, n) => {
|
|
|
1057
1057
|
for (const x of t) {
|
|
1058
1058
|
const z = x.span === 0 ? l : x.span, U = ve(x.item);
|
|
1059
1059
|
x.item.form?.rowBreak && f.length && (c = 0, d = v(d) + K);
|
|
1060
|
-
let { tr:
|
|
1061
|
-
g(
|
|
1062
|
-
const R =
|
|
1060
|
+
let { tr: T, tc: A } = g(d, c, z, U) ? { tr: d, tc: c } : H(d, c, z, U);
|
|
1061
|
+
g(T, A, z, U) || ({ tr: T, tc: A } = H(0, 0, z, U)), B(T, A, z, U);
|
|
1062
|
+
const R = T + 1;
|
|
1063
1063
|
f.push({
|
|
1064
1064
|
...x,
|
|
1065
1065
|
span: z,
|
|
@@ -1068,7 +1068,7 @@ const K = 12, ue = (e, n) => {
|
|
|
1068
1068
|
gridRow: R,
|
|
1069
1069
|
gridColumn: A + 1,
|
|
1070
1070
|
gridBand: ce({ gridRow: R })
|
|
1071
|
-
}), _(
|
|
1071
|
+
}), _(T, A, z, U);
|
|
1072
1072
|
}
|
|
1073
1073
|
return { cells: f, maxSpan: l };
|
|
1074
1074
|
}, ft = (e) => e.map((n) => n.item?.show?.form), mt = (e, n, l) => {
|
|
@@ -1124,7 +1124,7 @@ const K = 12, ue = (e, n) => {
|
|
|
1124
1124
|
}
|
|
1125
1125
|
};
|
|
1126
1126
|
e.forEach(i);
|
|
1127
|
-
}, yt = { class: "curd-form-cell-inner" },
|
|
1127
|
+
}, yt = { class: "curd-form-cell-inner" }, Le = /* @__PURE__ */ G({
|
|
1128
1128
|
__name: "layout",
|
|
1129
1129
|
props: {
|
|
1130
1130
|
formGrid: {},
|
|
@@ -1290,7 +1290,7 @@ const fe = (e) => {
|
|
|
1290
1290
|
s.formDefault = d.formDefault, s.rules = d.rules, s.formGrid = d.formGrid, s.formMaxSpan = d.formMaxSpan, s.formColumn = d.formColumn, s.type === l.Add ? f.isExternal() ? f.merge(JSONUtil.cp(s.formDefault)) : f.set(JSONUtil.cp(s.formDefault)) : !f.isExternal() && i.form && f.set(JSONUtil.cp(i.form));
|
|
1291
1291
|
}
|
|
1292
1292
|
});
|
|
1293
|
-
return s.initColumnForm(), Je(
|
|
1293
|
+
return i.option.form?.initStart?.(s), s.initColumnForm(), i.option.form?.initEnd?.(s), Je(
|
|
1294
1294
|
() => i.form,
|
|
1295
1295
|
(f) => {
|
|
1296
1296
|
o = fe(f), s.initColumnForm();
|
|
@@ -1302,7 +1302,7 @@ const fe = (e) => {
|
|
|
1302
1302
|
rules: s.rules
|
|
1303
1303
|
}, {
|
|
1304
1304
|
default: y(() => [
|
|
1305
|
-
s.show ? (u(), h(
|
|
1305
|
+
s.show ? (u(), h(Le, {
|
|
1306
1306
|
key: 0,
|
|
1307
1307
|
"form-grid": s.formGrid,
|
|
1308
1308
|
"max-span": s.formMaxSpan,
|
|
@@ -1689,10 +1689,11 @@ const xt = (e, n) => ({
|
|
|
1689
1689
|
}
|
|
1690
1690
|
},
|
|
1691
1691
|
view: {},
|
|
1692
|
-
|
|
1692
|
+
openLoading: !1,
|
|
1693
|
+
open: async (i, o) => {
|
|
1693
1694
|
const t = e();
|
|
1694
|
-
t.update.showContent ||
|
|
1695
|
-
S.loading(!0);
|
|
1695
|
+
if (!(t.update.showContent || t.update.openLoading)) {
|
|
1696
|
+
S.loading(!0), t.update.openLoading = !0;
|
|
1696
1697
|
try {
|
|
1697
1698
|
t.update.type = i;
|
|
1698
1699
|
const s = i === le.Add;
|
|
@@ -1702,9 +1703,9 @@ const xt = (e, n) => ({
|
|
|
1702
1703
|
} catch (s) {
|
|
1703
1704
|
console.error(s);
|
|
1704
1705
|
} finally {
|
|
1705
|
-
S.loading(!1);
|
|
1706
|
+
S.loading(!1), t.update.openLoading = !1;
|
|
1706
1707
|
}
|
|
1707
|
-
}
|
|
1708
|
+
}
|
|
1708
1709
|
},
|
|
1709
1710
|
validate: async () => {
|
|
1710
1711
|
const i = e();
|
|
@@ -1719,36 +1720,34 @@ const xt = (e, n) => ({
|
|
|
1719
1720
|
S.fail(b.tCurd("checkFormData"));
|
|
1720
1721
|
}
|
|
1721
1722
|
},
|
|
1722
|
-
submit: () => {
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
isNaN(c) || (s[d] = c);
|
|
1741
|
-
}
|
|
1742
|
-
});
|
|
1743
|
-
try {
|
|
1744
|
-
if (!t) return;
|
|
1745
|
-
await t({ ...s }), i.update.close(), await i.table.getList(), n.option.form?.submitAfter?.(s, i.update);
|
|
1746
|
-
} catch (d) {
|
|
1747
|
-
console.error(d);
|
|
1748
|
-
} finally {
|
|
1749
|
-
i.update.loading = !1;
|
|
1723
|
+
submit: async () => {
|
|
1724
|
+
const i = e();
|
|
1725
|
+
if (!await i.update.validate() || i.update.loading) return;
|
|
1726
|
+
i.update.loading = !0;
|
|
1727
|
+
const t = i.update.type === le.Add ? n.option.api.create : n.option.api.update;
|
|
1728
|
+
try {
|
|
1729
|
+
await n.option.form?.submitBefore?.(i.update.form, i.update);
|
|
1730
|
+
} catch {
|
|
1731
|
+
i.update.loading = !1;
|
|
1732
|
+
return;
|
|
1733
|
+
}
|
|
1734
|
+
let s = ObjectUtil.deepMerge(i.update.form, {});
|
|
1735
|
+
delete s.children;
|
|
1736
|
+
const f = new Set(n.option.column.filter((d) => d.type === "datetime").map((d) => d.key));
|
|
1737
|
+
Object.keys(s).forEach((d) => {
|
|
1738
|
+
if (f.has(d) && s[d] != null) {
|
|
1739
|
+
const c = new Date(s[d]).getTime();
|
|
1740
|
+
isNaN(c) || (s[d] = c);
|
|
1750
1741
|
}
|
|
1751
1742
|
});
|
|
1743
|
+
try {
|
|
1744
|
+
if (!t) return;
|
|
1745
|
+
await t({ ...s }), i.update.close(), await i.table.getList(), n.option.form?.submitAfter?.(s, i.update);
|
|
1746
|
+
} catch (d) {
|
|
1747
|
+
console.error(d);
|
|
1748
|
+
} finally {
|
|
1749
|
+
i.update.loading = !1;
|
|
1750
|
+
}
|
|
1752
1751
|
},
|
|
1753
1752
|
close: () => {
|
|
1754
1753
|
const i = e();
|
|
@@ -1977,13 +1976,13 @@ const xt = (e, n) => ({
|
|
|
1977
1976
|
$(m, { size: e.size }, {
|
|
1978
1977
|
default: y(() => [
|
|
1979
1978
|
O("span", Et, [
|
|
1980
|
-
$(r(
|
|
1979
|
+
$(r(L), { onClick: d }, {
|
|
1981
1980
|
default: y(() => [...v[1] || (v[1] = [
|
|
1982
1981
|
V("取消", -1)
|
|
1983
1982
|
])]),
|
|
1984
1983
|
_: 1
|
|
1985
1984
|
}),
|
|
1986
|
-
$(r(
|
|
1985
|
+
$(r(L), {
|
|
1987
1986
|
type: "primary",
|
|
1988
1987
|
onClick: f
|
|
1989
1988
|
}, {
|
|
@@ -2123,19 +2122,19 @@ function At(e, n) {
|
|
|
2123
2122
|
}, null, -1)
|
|
2124
2123
|
])]);
|
|
2125
2124
|
}
|
|
2126
|
-
const Rt = /* @__PURE__ */ Z(Ft, [["render", At]]), Bt = {},
|
|
2125
|
+
const Rt = /* @__PURE__ */ Z(Ft, [["render", At]]), Bt = {}, Lt = {
|
|
2127
2126
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2128
2127
|
viewBox: "64 64 896 896"
|
|
2129
2128
|
};
|
|
2130
|
-
function
|
|
2131
|
-
return u(), p("svg",
|
|
2129
|
+
function Tt(e, n) {
|
|
2130
|
+
return u(), p("svg", Lt, [...n[0] || (n[0] = [
|
|
2132
2131
|
O("path", {
|
|
2133
2132
|
fill: "currentColor",
|
|
2134
2133
|
d: "M180 176h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zm724 0h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zM785.3 504.3L657.7 403.6a7.23 7.23 0 00-11.7 5.7V476H378v-62.8c0-6-7-9.4-11.7-5.7L238.7 508.3a7.14 7.14 0 000 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h268v62.8c0 6 7 9.4 11.7 5.7l127.5-100.8c3.8-2.9 3.8-8.5.2-11.4z"
|
|
2135
2134
|
}, null, -1)
|
|
2136
2135
|
])]);
|
|
2137
2136
|
}
|
|
2138
|
-
const jt = /* @__PURE__ */ Z(Bt, [["render",
|
|
2137
|
+
const jt = /* @__PURE__ */ Z(Bt, [["render", Tt]]), Pt = {}, It = {
|
|
2139
2138
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2140
2139
|
viewBox: "0 0 1024 1024"
|
|
2141
2140
|
};
|
|
@@ -2486,7 +2485,7 @@ const to = /* @__PURE__ */ Z(Zt, [["render", eo]]), oo = { class: "row flex-cent
|
|
|
2486
2485
|
}),
|
|
2487
2486
|
e.option.tools?.search || e.option.tools?.reset ? (u(), h(r(he), { key: 0 }, {
|
|
2488
2487
|
default: y(() => [
|
|
2489
|
-
e.option.tools?.search ? (u(), h(r(
|
|
2488
|
+
e.option.tools?.search ? (u(), h(r(L), {
|
|
2490
2489
|
key: 0,
|
|
2491
2490
|
type: "primary",
|
|
2492
2491
|
onClick: r(o).search.submit
|
|
@@ -2496,7 +2495,7 @@ const to = /* @__PURE__ */ Z(Zt, [["render", eo]]), oo = { class: "row flex-cent
|
|
|
2496
2495
|
]),
|
|
2497
2496
|
_: 1
|
|
2498
2497
|
}, 8, ["onClick"])) : w("", !0),
|
|
2499
|
-
e.option.tools?.reset ? (u(), h(r(
|
|
2498
|
+
e.option.tools?.reset ? (u(), h(r(L), {
|
|
2500
2499
|
key: 1,
|
|
2501
2500
|
onClick: r(o).search.reset
|
|
2502
2501
|
}, {
|
|
@@ -2518,7 +2517,7 @@ const to = /* @__PURE__ */ Z(Zt, [["render", eo]]), oo = { class: "row flex-cent
|
|
|
2518
2517
|
O("div", co, [
|
|
2519
2518
|
O("div", fo, [
|
|
2520
2519
|
r(i)(e.option.tools?.add) ? (u(), p("div", mo, [
|
|
2521
|
-
$(r(
|
|
2520
|
+
$(r(L), {
|
|
2522
2521
|
type: "primary",
|
|
2523
2522
|
onClick: c[0] || (c[0] = (g) => r(o).update.open(r(l).Add)),
|
|
2524
2523
|
size: e.option.size?.search
|
|
@@ -2530,7 +2529,7 @@ const to = /* @__PURE__ */ Z(Zt, [["render", eo]]), oo = { class: "row flex-cent
|
|
|
2530
2529
|
}, 8, ["size"])
|
|
2531
2530
|
])) : w("", !0),
|
|
2532
2531
|
e.option.table?.selectable && r(i)(e.option.tools?.delete) ? (u(), p("div", go, [
|
|
2533
|
-
$(r(
|
|
2532
|
+
$(r(L), {
|
|
2534
2533
|
type: "danger",
|
|
2535
2534
|
onClick: c[1] || (c[1] = (g) => r(o).remove.open(r(o).table.selection.list)),
|
|
2536
2535
|
size: e.option.size?.search
|
|
@@ -2542,7 +2541,7 @@ const to = /* @__PURE__ */ Z(Zt, [["render", eo]]), oo = { class: "row flex-cent
|
|
|
2542
2541
|
}, 8, ["size"])
|
|
2543
2542
|
])) : w("", !0),
|
|
2544
2543
|
e.option.tools?.expand ? (u(), p("div", ho, [
|
|
2545
|
-
$(r(
|
|
2544
|
+
$(r(L), {
|
|
2546
2545
|
type: "warning",
|
|
2547
2546
|
onClick: c[2] || (c[2] = (g) => r(o).table.expand.all()),
|
|
2548
2547
|
size: e.option.size?.search
|
|
@@ -2596,7 +2595,7 @@ const to = /* @__PURE__ */ Z(Zt, [["render", eo]]), oo = { class: "row flex-cent
|
|
|
2596
2595
|
]),
|
|
2597
2596
|
default: y(() => [
|
|
2598
2597
|
O("div", yo, [
|
|
2599
|
-
$(r(
|
|
2598
|
+
$(r(L), {
|
|
2600
2599
|
type: "warning",
|
|
2601
2600
|
loading: r(o).export.loading,
|
|
2602
2601
|
size: e.option.size?.search
|
|
@@ -2610,7 +2609,7 @@ const to = /* @__PURE__ */ Z(Zt, [["render", eo]]), oo = { class: "row flex-cent
|
|
|
2610
2609
|
]),
|
|
2611
2610
|
_: 1
|
|
2612
2611
|
}, 8, ["onCommand"])) : (u(), p("div", bo, [
|
|
2613
|
-
$(r(
|
|
2612
|
+
$(r(L), {
|
|
2614
2613
|
type: "warning",
|
|
2615
2614
|
loading: r(o).export.loading,
|
|
2616
2615
|
size: e.option.size?.search,
|
|
@@ -2737,7 +2736,7 @@ const to = /* @__PURE__ */ Z(Zt, [["render", eo]]), oo = { class: "row flex-cent
|
|
|
2737
2736
|
default: y(() => [
|
|
2738
2737
|
k(d.$slots, "table-op-left", { row: g }),
|
|
2739
2738
|
r(o).update.type === r(l).Update && e.option.table?.inlineEdit && r(o).update.form[a.option.table?.rowKey] === g[a.option.table?.rowKey] ? (u(), p(F, { key: 0 }, [
|
|
2740
|
-
$(r(
|
|
2739
|
+
$(r(L), {
|
|
2741
2740
|
link: "",
|
|
2742
2741
|
type: "info",
|
|
2743
2742
|
onClick: r(o).update.close
|
|
@@ -2747,7 +2746,7 @@ const to = /* @__PURE__ */ Z(Zt, [["render", eo]]), oo = { class: "row flex-cent
|
|
|
2747
2746
|
]),
|
|
2748
2747
|
_: 1
|
|
2749
2748
|
}, 8, ["onClick"]),
|
|
2750
|
-
$(r(
|
|
2749
|
+
$(r(L), {
|
|
2751
2750
|
link: "",
|
|
2752
2751
|
type: "primary",
|
|
2753
2752
|
onClick: r(o).update.submit,
|
|
@@ -2760,7 +2759,7 @@ const to = /* @__PURE__ */ Z(Zt, [["render", eo]]), oo = { class: "row flex-cent
|
|
|
2760
2759
|
}, 8, ["onClick", "loading"]),
|
|
2761
2760
|
k(d.$slots, "table-op-edit-right", { row: g })
|
|
2762
2761
|
], 64)) : (u(), p(F, { key: 1 }, [
|
|
2763
|
-
r(i)(e.option.table?.add, g) ? (u(), h(r(
|
|
2762
|
+
r(i)(e.option.table?.add, g) ? (u(), h(r(L), {
|
|
2764
2763
|
key: 0,
|
|
2765
2764
|
link: "",
|
|
2766
2765
|
type: "primary",
|
|
@@ -2771,7 +2770,7 @@ const to = /* @__PURE__ */ Z(Zt, [["render", eo]]), oo = { class: "row flex-cent
|
|
|
2771
2770
|
]),
|
|
2772
2771
|
_: 1
|
|
2773
2772
|
}, 8, ["onClick"])) : w("", !0),
|
|
2774
|
-
r(i)(e.option.table?.view, g) ? (u(), h(r(
|
|
2773
|
+
r(i)(e.option.table?.view, g) ? (u(), h(r(L), {
|
|
2775
2774
|
key: 1,
|
|
2776
2775
|
link: "",
|
|
2777
2776
|
type: "primary",
|
|
@@ -2782,7 +2781,7 @@ const to = /* @__PURE__ */ Z(Zt, [["render", eo]]), oo = { class: "row flex-cent
|
|
|
2782
2781
|
]),
|
|
2783
2782
|
_: 1
|
|
2784
2783
|
}, 8, ["onClick"])) : w("", !0),
|
|
2785
|
-
r(i)(e.option.table?.update, g) ? (u(), h(r(
|
|
2784
|
+
r(i)(e.option.table?.update, g) ? (u(), h(r(L), {
|
|
2786
2785
|
key: 2,
|
|
2787
2786
|
link: "",
|
|
2788
2787
|
type: "warning",
|
|
@@ -2793,7 +2792,7 @@ const to = /* @__PURE__ */ Z(Zt, [["render", eo]]), oo = { class: "row flex-cent
|
|
|
2793
2792
|
]),
|
|
2794
2793
|
_: 1
|
|
2795
2794
|
}, 8, ["onClick"])) : w("", !0),
|
|
2796
|
-
r(i)(e.option.table?.delete, g) ? (u(), h(r(
|
|
2795
|
+
r(i)(e.option.table?.delete, g) ? (u(), h(r(L), {
|
|
2797
2796
|
key: 3,
|
|
2798
2797
|
link: "",
|
|
2799
2798
|
type: "danger",
|
|
@@ -2854,7 +2853,7 @@ const to = /* @__PURE__ */ Z(Zt, [["render", eo]]), oo = { class: "row flex-cent
|
|
|
2854
2853
|
k(d.$slots, "dialog-footer", {
|
|
2855
2854
|
row: r(o).update
|
|
2856
2855
|
}, () => [
|
|
2857
|
-
$(r(
|
|
2856
|
+
$(r(L), {
|
|
2858
2857
|
onClick: r(o).update.close
|
|
2859
2858
|
}, {
|
|
2860
2859
|
default: y(() => [
|
|
@@ -2862,7 +2861,7 @@ const to = /* @__PURE__ */ Z(Zt, [["render", eo]]), oo = { class: "row flex-cent
|
|
|
2862
2861
|
]),
|
|
2863
2862
|
_: 1
|
|
2864
2863
|
}, 8, ["onClick"]),
|
|
2865
|
-
r(o).update.type !== r(l).View ? (u(), h(r(
|
|
2864
|
+
r(o).update.type !== r(l).View ? (u(), h(r(L), {
|
|
2866
2865
|
key: 0,
|
|
2867
2866
|
type: "primary",
|
|
2868
2867
|
onClick: r(o).update.submit,
|
|
@@ -2892,7 +2891,7 @@ const to = /* @__PURE__ */ Z(Zt, [["render", eo]]), oo = { class: "row flex-cent
|
|
|
2892
2891
|
class: "update-dialog-form"
|
|
2893
2892
|
}, {
|
|
2894
2893
|
default: y(() => [
|
|
2895
|
-
r(o).update.showContent ? (u(), h(
|
|
2894
|
+
r(o).update.showContent ? (u(), h(Le, {
|
|
2896
2895
|
key: 0,
|
|
2897
2896
|
"form-grid": r(o).update.formGrid,
|
|
2898
2897
|
"max-span": r(o).update.formMaxSpan,
|
|
@@ -2933,7 +2932,7 @@ const to = /* @__PURE__ */ Z(Zt, [["render", eo]]), oo = { class: "row flex-cent
|
|
|
2933
2932
|
size: e.option.size?.form
|
|
2934
2933
|
}, {
|
|
2935
2934
|
default: y(() => [
|
|
2936
|
-
$(r(
|
|
2935
|
+
$(r(L), {
|
|
2937
2936
|
onClick: r(o).remove.close
|
|
2938
2937
|
}, {
|
|
2939
2938
|
default: y(() => [
|
|
@@ -2941,7 +2940,7 @@ const to = /* @__PURE__ */ Z(Zt, [["render", eo]]), oo = { class: "row flex-cent
|
|
|
2941
2940
|
]),
|
|
2942
2941
|
_: 1
|
|
2943
2942
|
}, 8, ["onClick"]),
|
|
2944
|
-
$(r(
|
|
2943
|
+
$(r(L), {
|
|
2945
2944
|
type: "danger",
|
|
2946
2945
|
onClick: r(o).remove.submit,
|
|
2947
2946
|
loading: r(o).remove.loading
|
|
@@ -3039,6 +3038,7 @@ export {
|
|
|
3039
3038
|
M as TFormConfig,
|
|
3040
3039
|
b as TFormI18n,
|
|
3041
3040
|
$e as TFormList,
|
|
3041
|
+
J as TObj,
|
|
3042
3042
|
S as TSys,
|
|
3043
3043
|
Mo as default,
|
|
3044
3044
|
Vo as install
|
package/dist/cc1-form.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(B,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("element-plus"),require("vue-router"),require("vue"),require("cc1-vue3")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue-router","vue","cc1-vue3"],g):(B=typeof globalThis<"u"?globalThis:B||self,g(B.cc1Form={},B.ElementPlus,B.VueRouter,B.Vue,B.cc1Vue3))})(this,(function(B,g,Ot,e,I){"use strict";class y{static router;static routes;static getRouterPath=()=>this.router.currentRoute.value.path;static EDialog={Add:"Add",Update:"Update",View:"View",Remove:"Remove"};static isFun=(l,...r)=>Array.isArray(l)?l.some(a=>typeof a=="function"?a(...r):a):typeof l=="function"?l(...r):l;static getRouterParams=()=>{const l=this.router.currentRoute.value.query||{},r=this.router.currentRoute.value.params||{};return Object.keys(l).length?l:Object.keys(r).length?r:{}};static moduleObj={};static loadModule=async l=>{if(!y.moduleObj[l])throw new Error(`模块${l}未加载,请赋值如:TSys.moduleObj = { ${l}: ()=>import('${l}') }`);const r=await y.moduleObj[l]();return r.default??r};static tipMessages={};static tipMessagesGap=500;static showMessage(l,r,a={}){const i=Date.now();if(!this.tipMessages[l]||i-this.tipMessages[l]>this.tipMessagesGap){this.tipMessages[l]=i;const n=Object.assign({message:l,type:r},a);g.ElMessage(n),setTimeout(()=>{delete this.tipMessages[l]},this.tipMessagesGap)}}static fail=(l,r={})=>{this.showMessage(l,"error",r)};static success=(l,r={})=>{this.showMessage(l,"success",r)};static loadingObj=null;static loadingTimer=null;static loading=(l=!0,r="Loading...")=>{Timer.un(this.loadingTimer),this.loadingTimer=Timer.once(()=>{l?this.loadingObj=g.ElLoading.service({lock:!0,text:r,background:"rgba(0, 0, 0, 0.3)"}):this.loadingObj&&(this.loadingObj.close(),this.loadingObj=null)},50)};static openUrl=(l,r=!0)=>{if(r){let a=screen.width/2-500,i=screen.height/2-800/2-30;window.open(l,"_blank","toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top="+i+", left="+a)}else window.open(l,"DescriptiveWindowName"+StrUtil.getId(),"resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0")};static getImgPic=l=>new Promise(async(r,a)=>{let i=document.getElementById(l.id);const n=await y.loadModule("html2canvas");try{n(i,{logging:!1,allowTaint:!0,scale:window.devicePixelRatio,width:l.windowWidth,height:l.windowHeight,windowWidth:l.windowWidth,windowHeight:l.windowHeight,useCORS:!0,backgroundColor:"#ffffff00"}).then(function(o){let d=o.toDataURL("image/png");r(d)})}catch(o){a(o)}})}class w{static config={field:{page:{num:"num",size:"size"},result:{list:"list",pages:"pages",num:"num",size:"size",total:"total"}},dialog:{width:"980px",closeOnClickModal:!1},pagination:{layout:"total, sizes, prev, pager, next, jumper",pageSizes:[10,20,50,100],size:10,pagerCount:7,showTools:!1},size:{table:"default",form:"default",search:"default"},tools:{expandColumn:!1,refresh:!0,expand:!1,search:!0,reset:!0,add:!0,delete:!0,export:{show:!0,dropdown:{show:!0,select:!0,page:!0,all:!0},fileName:"Export Data "}},form:{size:"default",labelWidth:"120px",stripe:!0,editAll:!1,maxSpan:12,defaultSpan:6,openBefore:void 0,openAfter:void 0,closeBefore:void 0,submitBefore:void 0,submitAfter:void 0},table:{index:!1,labelWidth:"100px",size:"default",emptyText:"",headerCellClassName:"table-header",rowKey:"_id",highlightCurrentRow:!0,border:!0,selectable:!1,column:[],showOverflowTooltip:!0,showSummary:!1,summaryMethod:()=>[],inlineEdit:!1,operate:{width:void 0},add:!1,update:!0,delete:!0,sort:{props:{field:"sortField"},order:{field:"sortOrder",asc:"asc",desc:"desc"},resetPage:!1,change:void 0},fitHeight:!0},columnConfig:{type:"input",form:{width:"100%",spanCol:!1},table:{table:!0,minWidth:120,width:void 0,fixed:void 0,align:"center",showOverflowTooltip:!0,format:void 0,click:{callback:void 0,color:"#409EFF"},tooltip:void 0},show:{table:!0,search:!1,form:!0},sort:{search:0,table:0,form:0},disabled:{view:!0},options:{switch:{activeValue:!0,inactiveValue:!1,tableConfig:{change:!0,confirm:!0,loadList:!0}},treeSelect:{multiple:!0,renderAfterExpand:!1,showCheckbox:!0,checkStrictly:!0,checkOnClickNode:!0,props:{label:"title",children:"children"}},datetime:{type:"datetime"},select:{data:[],clearable:!0,filterable:!0,dataPath:"data.data",dataApiConfig:{once:!0,init:!0,create:!0,update:!0}},radio:{data:[],dataPath:"data.data",dataApiConfig:{once:!0,init:!0,create:!0,update:!0}}}}};static setConfig=l=>{w.config=ObjectUtil.deepMerge(w.config,l)}}class N{static customComponent={};static findOptions=(l,r)=>{const a=l.column.find(n=>n.key===r),i=n=>n.replace(/-([a-z])/g,(o,d)=>d.toUpperCase());if(a)return a.options[i(a.type)]};static setOptionsData=(l,r,a)=>{const i=N.findOptions(l,r);i&&(i.data=a)};static form={openBefore:{parentId:(l,r,a,i)=>{const n=w.config.table.rowKey;l?r.type===y.EDialog.Add?(r.form.parentId=l[n],r.form.sort=l.children.length+1):r.form.parentId=l.parentId.substring(l.parentId.lastIndexOf(",")+1):(r.form.parentId="0",r.form.sort=a.length+1),N.setOptionsData(i,"parentId",[{[n]:"0",title:"根",children:a}])}}}}class F{static getIdFun=()=>StrUtil.uuid();static setId=(l,r,a)=>{r[l]||(r[l]=[]);const i=w.config.table.rowKey;r[l].forEach(n=>{a.forEach(o=>{let d=o.default??"";o.type==="number"&&(d=o.default??0),o.type==="boolean"&&(d=o.default??!1),o.type==="time"&&(d=o.default??new Date),n[o.value]===void 0&&(n[o.value]=d)}),n[i]||(n[i]=F.getIdFun())})};static add=(l,r,a,i)=>{const n=JSONUtil.cp(a);F.setId(l,r,a);const o=w.config.table.rowKey;r[l].push(n.reduce((d,f)=>{let c=f.default??"";return f.type==="number"&&(c=f.default??0),f.type==="boolean"&&(c=f.default??!1),f.type==="time"&&(c=f.default??new Date),d[f.value]=c,d},{[o]:F.getIdFun()})),i?.(r)};static remove=(l,r,a,i)=>{const n=w.config.table.rowKey;r[l]=r[l].filter(o=>o[n]!==a[n]),i?.(r)};static getNoIdData=(l,r)=>{const a=JSONUtil.cp(l),i=w.config.table.rowKey;return a.forEach(n=>{n[i]&&delete n[i],r&&n[r]&&F.getNoIdData(n[r],r)}),a}}const ae={key:0,class:"column curd-form-com-list",style:{width:"100%",gap:"10px"}},le={key:0},re={class:"row items-center",style:{gap:"10px",width:"100%"}},ie={key:1},j=e.defineComponent({__name:"list",props:{row:{default:{}},label:{default:"label"},value:{default:"value"},itemFields:{default:[{label:"label",value:"label"},{label:"value",value:"value"}]},field:{default:"value"},inputWidth:{default:"120px"},inputClass:{default:""},addBottom:{default:!1}},emits:["change"],setup(t,{emit:l}){const r=t,a=e.reactive({show:!1,add:(n,o,d)=>{F.add(n,o,d,()=>{i("change")})},remove:(n,o,d)=>{F.remove(n,o,d,()=>{i("change")})}});e.onMounted(()=>{F.setId(r.field,r.row,r.itemFields),a.show=!0});const i=l;return(n,o)=>{const d=e.resolveComponent("el-button"),f=e.resolveComponent("el-input");return a.show?(e.openBlock(),e.createElementBlock("div",ae,[e.renderSlot(n.$slots,"list-start",{row:t.row}),t.addBottom?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",le,[e.createVNode(d,{link:"",type:"primary",onClick:o[0]||(o[0]=c=>a.add(t.field,t.row,t.itemFields))},{default:e.withCtx(()=>[...o[3]||(o[3]=[e.createTextVNode("添加",-1)])]),_:1})])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.row[t.field],c=>(e.openBlock(),e.createElementBlock("div",re,[e.renderSlot(n.$slots,"item-start",{item:c,row:t.row}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.itemFields,s=>(e.openBlock(),e.createBlock(f,{modelValue:c[s.value],"onUpdate:modelValue":u=>c[s.value]=u,style:e.normalizeStyle({width:t.inputWidth}),class:e.normalizeClass(t.inputClass),placeholder:s[t.label]||s[t.value],onChange:o[1]||(o[1]=u=>i("change"))},null,8,["modelValue","onUpdate:modelValue","style","class","placeholder"]))),256)),e.renderSlot(n.$slots,"item-end",{item:c,row:t.row}),e.createVNode(d,{link:"",type:"danger",onClick:s=>a.remove(t.field,t.row,c)},{default:e.withCtx(()=>[...o[4]||(o[4]=[e.createTextVNode("删除",-1)])]),_:1},8,["onClick"])]))),256)),t.addBottom?(e.openBlock(),e.createElementBlock("div",ie,[e.createVNode(d,{link:"",type:"primary",onClick:o[2]||(o[2]=c=>a.add(t.field,t.row,t.itemFields))},{default:e.withCtx(()=>[...o[5]||(o[5]=[e.createTextVNode("添加",-1)])]),_:1})])):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"list-end",{row:t.row})])):e.createCommentVNode("",!0)}}}),de={class:"row form-item-content",style:{width:"100%"}},ce={class:"col column form-item-content-item"},se={class:"col"},fe=["innerHTML"],me=e.defineComponent({__name:"field",props:{item:{},form:{},type:{},labelWidth:{},getBind:{type:Function},getOn:{type:Function},getDisabled:{type:Function}},setup(t){return(l,r)=>(e.openBlock(),e.createBlock(e.unref(g.ElFormItem),{label:t.item.text?.form?.label??t.item.label,prop:t.item.key,"label-width":t.item.text?.form?.label==""?0:t.item.form?.labelWidth||t.labelWidth},{default:e.withCtx(()=>[e.createElementVNode("div",de,[e.renderSlot(l.$slots,"form-"+t.item.key+"-start",{row:t.form,item:t.item}),e.createElementVNode("div",ce,[e.createElementVNode("div",se,[e.renderSlot(l.$slots,"form-"+t.item.key,{row:t.form,item:t.item},()=>[t.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:0,modelValue:t.form[t.item.key],"onUpdate:modelValue":r[0]||(r[0]=a=>t.form[t.item.key]=a)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),e.createSlots({_:2},[t.getBind(t.item).prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof t.getBind(t.item).prepend=="function"?t.getBind(t.item).prepend(t.form):t.getBind(t.item).prepend),1)]),key:"0"}:void 0]),1040,["modelValue","disabled"])):t.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:1,modelValue:t.form[t.item.key],"onUpdate:modelValue":r[1]||(r[1]=a=>t.form[t.item.key]=a)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),null,16,["modelValue","disabled"])):t.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:2,modelValue:t.form[t.item.key],"onUpdate:modelValue":r[2]||(r[2]=a=>t.form[t.item.key]=a)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.getBind(t.item).data||[],a=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),e.mergeProps({key:a.value},{ref_for:!0},a,e.toHandlers(a.on||{})),null,16))),128))]),_:1},16,["modelValue","disabled"])):t.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(g.ElRadioGroup),e.mergeProps({key:3,modelValue:t.form[t.item.key],"onUpdate:modelValue":r[3]||(r[3]=a=>t.form[t.item.key]=a)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.getBind(t.item).data||[],a=>(e.openBlock(),e.createBlock(e.unref(g.ElRadio),e.mergeProps({key:a.value},{ref_for:!0},a,e.toHandlers(a.on||{})),null,16))),128))]),_:1},16,["modelValue","disabled"])):t.item.type==="list"?(e.openBlock(),e.createBlock(j,e.mergeProps({key:4,row:t.form,field:t.item.key},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):t.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(g.ElTreeSelect),e.mergeProps({key:5,modelValue:t.form[t.item.key],"onUpdate:modelValue":r[4]||(r[4]=a=>t.form[t.item.key]=a)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item),style:{width:"100%"}}),null,16,["modelValue","disabled"])):t.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(g.ElDatePicker),e.mergeProps({key:6,modelValue:t.form[t.item.key],"onUpdate:modelValue":r[5]||(r[5]=a=>t.form[t.item.key]=a)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),null,16,["modelValue","disabled"])):t.item.type&&(e.unref(N).customComponent[t.item.type]||e.unref(N).customComponent[t.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(N).customComponent[t.item.type]?.form||e.unref(N).customComponent[t.item.type]),e.mergeProps({key:7,modelValue:t.form[t.item.key],"onUpdate:modelValue":r[6]||(r[6]=a=>t.form[t.item.key]=a)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(l.$slots,"form-"+t.item.key+"-right",{row:t.form,item:t.item})]),e.renderSlot(l.$slots,"form-"+t.item.key+"-tip",{row:t.form,item:t.item},()=>[t.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof t.item.form?.tipText=="function"?t.item.form?.tipText(t.form,t.type):t.item.form?.tipText},null,8,fe)):e.createCommentVNode("",!0)])]),e.renderSlot(l.$slots,"form-"+t.item.key+"-end",{row:t.form,item:t.item})])]),_:3},8,["label","prop","label-width"]))}});function Mt(t){return t}const pe={search:"搜索",add:"新增",edit:"编辑",view:"查看",delete:"删除",export:"导出",exportSelect:"导出选中",exportPage:"导出本页",exportAll:"导出全部",import:"导入",refresh:"刷新",reset:"重置",expandCollapse:"展开/收缩",operation:"操作",close:"关闭",cancel:"取消",submit:"提交",confirm:"确认",deleteTitle:"删除提示",confirmDelete:"确认删除",confirmDeleteMessage:"确认要删除【{count}】条数据吗?",placeholderInput:"请输入",placeholderSelect:"请选择",checkFormData:"部分内容未输入或输入错误,请检查",selectDataToDelete:"请选择要删除的数据",selectDataToExport:"请选择要导出的数据",noData:"暂无数据",operationSuccess:"操作成功",switchOn:"开启",switchOff:"关闭",confirmModify:"确认修改",confirmSwitchMessage:"确认要修改吗?",mergeColumn:"合并栏位",expandColumn:"展开栏位"};class h{static t(l,...r){if(typeof l=="function")return l(...r);l=String(l);let a=0;return l.replace(/{([^}]+)}/g,(i,n)=>a<r.length?String(r[a++]):`{${n}}`)}static setI18n=l=>{h.curd=ObjectUtil.deepMerge(h.curd,l)};static tCurd(l,...r){return this.t(this.curd[l],...r)}static curd=pe}const D=12,U=(t,l)=>{t.isForm=l,Array.isArray(t.children)&&t.children.forEach(r=>U(r,l))},ge=t=>t.isForm===!1?!1:typeof t.show?.form=="boolean"?t.show.form:!0,he=(t,l,r)=>(t.form=t.form||{span:l},r==="column"?t.form.span=t.form.span??12:t.form.span=t.form.span??l,t.form.span),K=t=>{const l=t.form;return l?.row!=null&&l.row>0?l.row:D},L=t=>Math.floor((t.gridRow-1)/D),G=(t,l,r)=>{if(l===y.EDialog.View)return t.disabled?.view===void 0?!0:y.isFun(t.disabled?.view,r);const a=t.disabled?.[l===y.EDialog.Add?"create":"update"];return y.isFun(a,r)},W=(t,l)=>t.options?.[l===y.EDialog.Add?"formAdd":"formUpdate"]?.[t.type]||t.options?.[t.type]||{},J=(t,l,r=[])=>{const i=t.options?.[l===y.EDialog.Add?"formAdd":"formUpdate"]?.[t.type]?.on||t.options?.[t.type]?.on||{},n={};return Object.keys(i).forEach(o=>{const d=i[o];typeof d=="function"?n[o]=function(...f){return d.apply(this,[...f,...r])}:n[o]=d}),n},P=(t,l,r,a,i)=>{const n=t,o=n.colSpan??t.span;if(!t.item.form?.spanCol)return o;const d=i?.maxSpan||12,f=i?.defaultSpan||d/2,c=n.gridBand,u=l.filter(m=>c!=null?m.gridBand===c&&!y.isFun(m.item.show?.form,r,a):m.gridRow===n.gridRow&&!y.isFun(m.item.show?.form,r,a)).reduce((m,p)=>m+(p.colSpan??p.span??f),0);return o+u},q=t=>{const l=new Map;return t.forEach(r=>{const a=r.gridBand??L(r);l.has(a)||l.set(a,[]),l.get(a).push(r)}),Array.from(l.keys()).sort((r,a)=>r-a).map(r=>l.get(r))},Q=t=>t?.length?Array.isArray(t[0])?t.flat():t:[],ue=(t,l)=>{if(!ge(t)||!t.key)return null;const r=l.defaultSpan??(l.maxSpan||12)/2,a=he(t,r,l.layout);return{item:t,span:a}},ye=(t,l={})=>{const r=[],a=i=>{if(i.children?.length){i.children.forEach(o=>a(o));return}const n=ue(i,l);n&&r.push(n)};return t.forEach(i=>a(i)),r},X=(t,l={})=>{const r=l.maxSpan??12,a=l.defaultSpan??r/2,i=l.layout??"row",o=ye(t,{maxSpan:r,defaultSpan:a,layout:i});if(i==="column"){const b=[];let k=1;return o.forEach(C=>{const S=K(C.item),x=r;b.push({...C,span:x,colSpan:x,rowSpan:S,gridRow:k,gridColumn:1,gridBand:L({gridRow:k})}),k+=S}),{cells:b,maxSpan:r}}const d=new Set,f=[];let c=0,s=0;const u=b=>Math.floor(b/D)*D,m=(b,k)=>`${b},${k}`,p=(b,k,C,S)=>{if(k+C>r)return!1;for(let x=0;x<S;x++)for(let V=0;V<C;V++)if(d.has(m(b+x,k+V)))return!1;return!0},E=(b,k,C,S)=>{for(let x=0;x<S;x++)for(let V=0;V<C;V++)d.add(m(b+x,k+V))},z=(b,k,C,S)=>{for(let V=u(b);V<500*D;V+=D){const zt=V+D,Ft=V===u(b)?Math.max(V,b):V;for(let T=Ft;T<zt;T++){const $t=T===b?k:0;for(let H=$t;H<=r-C;H++)if(p(T,H,C,S))return{tr:T,tc:H}}}return{tr:b,tc:k}},M=(b,k,C,S)=>{const x=u(b);if(S<D&&b+S<x+D){c=b+S,s=k;return}const V=k+C;if(V<r){s=V,c=x;return}s=0,c=x+D};for(const b of o){const k=b.span===0?r:b.span,C=K(b.item);b.item.form?.rowBreak&&f.length&&(s=0,c=u(c)+D);let{tr:S,tc:x}=p(c,s,k,C)?{tr:c,tc:s}:z(c,s,k,C);p(S,x,k,C)||({tr:S,tc:x}=z(0,0,k,C)),E(S,x,k,C);const V=S+1;f.push({...b,span:k,colSpan:k,rowSpan:C,gridRow:V,gridColumn:x+1,gridBand:L({gridRow:V})}),M(S,x,k,C)}return{cells:f,maxSpan:r}},be=t=>t.map(l=>l.item?.show?.form),ke=(t,l,r)=>{if(!t.rules)return;const a=typeof t.rules=="boolean"?[{required:!0,message:l(t),trigger:"blur"}]:t.rules;return r?a.map(i=>r(i)):a},Y=t=>(l,r)=>ke(l,t,a=>{if(a.validator){const i=a.validator;return{...a,validator:(n,o,d)=>i(n,o,d,r)}}return a}),we=()=>Y(t=>{const l={input:h.tCurd("placeholderInput"),select:h.tCurd("placeholderSelect")};return(l[t.type||"input"]||l.input)+t.label}),Ce=(t,l,r)=>{const a={},i={},n=l?.maxSpan||12,o=l?.defaultSpan||n/2,d=we();t.forEach(s=>U(s,!0)),Z(t,a,i,s=>d(s,r));const{cells:f,maxSpan:c}=X(t,{maxSpan:n,defaultSpan:o,layout:l?.layout});return{formDefault:a,rules:i,formGrid:f,formMaxSpan:c,formColumn:q(f)}},Z=(t,l,r,a)=>{const i=n=>{if(n.children?.length){n.children.forEach(o=>i(o));return}if(n.key){l[n.key]=n.value;const o=a(n);o&&(r[n.key]=o)}};t.forEach(i)},Be={class:"curd-form-cell-inner"},_=e.defineComponent({__name:"layout",props:{formGrid:{},maxSpan:{},form:{},type:{},stripe:{type:Boolean},labelWidth:{},formOption:{},getBind:{type:Function},getOn:{type:Function},getDisabled:{type:Function}},setup(t){const l=y.isFun,r=t,a=e.computed(()=>r.formGrid.filter(s=>l(s.item.show?.form,r.form,r.type))),i=e.computed(()=>({gridTemplateColumns:`repeat(${r.maxSpan}, minmax(0, 1fr))`})),n=e.computed(()=>{let s=0;return a.value.forEach(u=>{const m=u.gridRow+u.rowSpan-1;m>s&&(s=m)}),s}),o=s=>s.gridRow+s.rowSpan-1>=n.value,d=s=>s.rowSpan>=D,f=s=>P(s,r.formGrid,r.form,r.type,{maxSpan:r.maxSpan,defaultSpan:r.formOption?.defaultSpan}),c=s=>{const u=f(s)||s.colSpan;return{gridRow:`${s.gridRow} / span ${s.rowSpan}`,gridColumn:`${s.gridColumn} / span ${u}`}};return(s,u)=>e.unref(l)(e.unref(be)(t.formGrid),t.form,t.type)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.renderSlot(s.$slots,"form-start",{row:t.form}),e.createElementVNode("div",{class:e.normalizeClass(["curd-form-grid",{stripe:t.stripe!==!1}]),style:e.normalizeStyle(i.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,m=>(e.openBlock(),e.createElementBlock("div",{key:m.item.key,class:e.normalizeClass(["curd-form-grid-cell",[t.stripe!==!1&&e.unref(L)(m)%2===0?"stripe-band-odd":"",m.gridColumn>1?"has-col-border":"",t.stripe!==!1&&o(m)?"is-last-row":"",d(m)?"is-row-span":"",`form-item-col-${m.item.key}`]]),style:e.normalizeStyle(c(m))},[e.createElementVNode("div",Be,[e.unref(l)(m.item.show?.form,t.form,t.type)?(e.openBlock(),e.createBlock(me,{key:0,class:e.normalizeClass({"is-row-span-field":d(m)}),item:m.item,form:t.form,type:t.type,"label-width":t.labelWidth,"get-bind":t.getBind,"get-on":t.getOn,"get-disabled":t.getDisabled},e.createSlots({_:2},[e.renderList(s.$slots,(p,E)=>({name:E,fn:e.withCtx(z=>[e.renderSlot(s.$slots,E,e.mergeProps({ref_for:!0},z||{}))])}))]),1032,["class","item","form","type","label-width","get-bind","get-on","get-disabled"])):e.createCommentVNode("",!0)])],6))),128))],6),e.renderSlot(s.$slots,"form-end",{row:t.form})],64)):e.createCommentVNode("",!0)}});class ${static delAllKey=l=>{Object.keys(l).forEach(r=>{delete l[r]})};static setValue=(l,r,a=!1)=>{a&&$.delAllKey(l),Object.keys(r).forEach(i=>{l[i]!==r[i]&&(l[i]=r[i])})}}const R=t=>{const l=e.reactive({}),r=()=>typeof t=="function"?t():t,a=()=>{const i=r();return i??l};return{internal:l,isExternal:()=>r()!=null,get(){return a()},set(i){$.setValue(a(),i,!0)},merge(i){$.setValue(a(),i,!1)},clear(){$.delAllKey(a())}}},v=e.defineComponent({__name:"column",props:{option:{default:()=>({form:{},column:[]})},type:{default:""},form:{default:void 0}},setup(t,{expose:l}){const r=y.EDialog,a=e.ref(),i=t;let n=R(i.form);const o=I.Scope.getConf();o?.formRef?.set("formRef-"+StrUtil.getId(),a);const d=e.reactive({rules:{},show:!0,formDefault:{},type:i.type||o?.update?.type||r.Add,formColumn:[],formGrid:[],formMaxSpan:12,get form(){return n.get()},set form(f){n.set(f)},getDisabled:f=>G(f,d.type,d.form),getBind:f=>W(f,d.type),getOn:f=>J(f,d.type,[d.form,f]),initColumnForm:()=>{const f=n,c=Ce(i.option.column,i.option.form,f.get());d.formDefault=c.formDefault,d.rules=c.rules,d.formGrid=c.formGrid,d.formMaxSpan=c.formMaxSpan,d.formColumn=c.formColumn,d.type===r.Add?f.isExternal()?f.merge(JSONUtil.cp(d.formDefault)):f.set(JSONUtil.cp(d.formDefault)):!f.isExternal()&&i.form&&f.set(JSONUtil.cp(i.form))}});return d.initColumnForm(),e.watch(()=>i.form,f=>{n=R(f),d.initColumnForm()}),l({ref:a,conf:d}),(f,c)=>(e.openBlock(),e.createBlock(e.unref(g.ElForm),{ref_key:"ruleFormRef",ref:a,model:d.form,rules:d.rules},{default:e.withCtx(()=>[d.show?(e.openBlock(),e.createBlock(_,{key:0,"form-grid":d.formGrid,"max-span":d.formMaxSpan,form:d.form,type:d.type,stripe:t.option.form?.stripe,"label-width":t.option.form?.labelWidth||"100px","form-option":t.option.form,"get-bind":d.getBind,"get-on":d.getOn,"get-disabled":d.getDisabled},e.createSlots({_:2},[e.renderList(f.$slots,(s,u)=>({name:u,fn:e.withCtx(m=>[e.renderSlot(f.$slots,u,e.normalizeProps(e.guardReactiveProps(m||{})))])}))]),1032,["form-grid","max-span","form","type","stripe","label-width","form-option","get-bind","get-on","get-disabled"])):e.createCommentVNode("",!0)]),_:3},8,["model","rules"]))}}),xe=()=>({formRef:{map:{},set(t,l){this.map[t]=l},validate(){return new Promise(async(t,l)=>{try{const r=Object.keys(this.map);await Promise.all(r.map(a=>this.map[a]?.validate(async i=>new Promise((n,o)=>{i||o(!1),n(!0)})))),t(!0)}catch(r){l(r)}})}}}),Ve=(t,l)=>{const r=R(()=>l.searchForm);return{search:{column:{list:[]},get form(){return r.get()},set form(a){r.set(a)},formDefault:{},getPlaceholder:(a,i=h.tCurd("placeholderInput"))=>a.text?.search?.placeholder===void 0?`${i}${a.label}`:a.text?.search?.placeholder,getFormData:()=>{const a=t();let i={};l.option.column.forEach(o=>{(typeof o.show?.search=="function"?o.show?.search(a.search.form):o.show?.search)&&(i[o.key]=a.search.form[o.key])});const n=l.option.search?.before?.(i);return n&&(i=n),i},reset:()=>{const a=t(),i=a.search.formDefault;Object.keys(i).forEach(o=>{l.option.search?.resetMode==="none"?i[o]=void 0:i[o]=a.search.formDefault[o]});const n=ObjectUtil.deepMerge(i,{});$.setValue(a.search.form,n,!0),a.page.num=1,l.option.init!==!1&&a.table.getList()},submit:()=>{const a=t();a.page.num=1,a.table.getList()}}}},Ee=(t,l)=>({page:{num:1,total:0,layout:l.option.page?.layout||w.config.pagination.layout,showTools:l.option.page?.showTools||w.config.pagination.showTools,size:l.option.page?.size||w.config.pagination.size,sizeList:l.option.page?.sizeList||w.config.pagination.pageSizes,pagerCount:l.option.page?.pagerCount||w.config.pagination.pagerCount,getQuery:(r={})=>{const a=t();return{[w.config.field.page.size]:r.size||a.page.size,[w.config.field.page.num]:r.num||a.page.num,...a.search.getFormData()}}}}),Se=(t,l,r)=>({table:{op:{width:(...a)=>a.filter(n=>n).length*30+60},loading:!1,data:[],expand:{isExpand:!1,rowKeys:[],change:(a,i)=>{},all:()=>{const a=t();if(a.table.expand.isExpand)a.table.expand.rowKeys=[];else{const i=n=>{let o=[];return n.forEach(d=>{o.push(d[l.option.table.rowKey]),d.children?.length&&(o=o.concat(i(d.children)))}),o};a.table.expand.rowKeys=i(a.table.data)}a.table.expand.isExpand=!a.table.expand.isExpand}},column:{list:[],show:{listSource:[],list:[]}},header:{group:{expand:!1,toggleExpandAll:()=>{const a=t(),i=!a.table.header.group.expand;a.table.header.group.expand=i;const n=o=>{o.forEach(d=>{d.table?.header?.group!==void 0&&(d.table.header.group=!i),d.table?.header?.groupKey!==void 0&&(d.table.header.show=i),Array.isArray(d.children)&&d.children.length&&n(d.children)})};n(a.table.column.list)}}},getList:async()=>{const a=t();a.table.loading=!0;const i=l.option.api.list,n=JSONUtil.cp(a.table.selection.list);try{await a.initApiData("init");let o={};if(a.table.sort.prop){const{props:E,order:z}=w.config.table.sort;o={[E.field]:a.table.sort.prop,[z.field]:a.table.sort.order}}const d=await i({...a.page.getQuery(),...o}),f=w.config.field.result,c=d.data||{[f.list]:d},s=(Array.isArray(c[f.list]),c[f.list]),u=Q(a.update.formGrid?.length?a.update.formGrid:a.update.formColumn),p=ObjectUtil.deepMerge({data:s},{}).data.map(E=>(Object.keys(E).forEach(M=>{const b=u.find(k=>k.item.key===M);b&&["select","radio"].includes(b.item.type)&&(b.item.table.format||(b.item.table.format=k=>b.item.options[b.item.type].data?.find(C=>C.value==k[M])?.label||k[M]))}),E));a.table.data=l.option.data?await l.option.data(p,s):p,a.page.total=c[f.total]||0,setTimeout(()=>{a.table.selection.setList(n)},20)}catch(o){console.error(o)}finally{a.table.loading=!1}},selection:{list:[],change:a=>{t().table.selection.list=a},setList:(a,i)=>{const n=t();n.table.selection.list=[];const o=r.tableRef.value;if(o?.clearSelection(),!o||!a?.length)return;const d=l.option.table?.rowKey,f=c=>{const s=u=>{for(const m of u){if(d!=null&&d!==""){if(m[d]===c[d])return m}else if(m===c)return m;if(Array.isArray(m.children)&&m.children.length){const p=s(m.children);if(p!==void 0)return p}}};return s(n.table.data)};a.forEach(c=>{const s=f(c);if(s)if(i){const u=()=>o.toggleRowSelection(s,!0,!1);i(c)!==!1&&u()}else o.toggleRowSelection(s,!0,!1)})}},sort:{prop:"",order:"",change:a=>{const i=t();w.config.table.sort.resetPage&&(i.page.num=1);const n=w.config.table.sort;if(n.change){n.change(a,i);return}i.table.sort.prop=a.prop,a.order===null?(i.table.sort.order="",i.table.sort.prop=""):i.table.sort.order=a.order==="ascending"?n.order.asc:n.order.desc,i.table.getList()}}}});class ee{static exportToExcel=async(l,r,a)=>{if(!l||l.length===0)return;const i=await y.loadModule("xlsx"),n=l.map(f=>{const c={};return r.forEach(s=>{c[s.label]=f[s.key]}),c}),o=i.utils.json_to_sheet(n),d=i.utils.book_new();i.utils.book_append_sheet(d,o,"Sheet1"),a?typeof a=="function"&&(a=a()):a=`导出数据_${new Date().Format("yyyy-MM-dd")}_${new Date().getTime()}`,i.writeFile(d,`${a}.xlsx`)}}const Ne=(t,l)=>({export:{run:{start:async r=>{let i=await t().export.run[r]();const n=l.option.column,o=ObjectUtil.deepMerge({data:i,columns:n},{}),d=l.option.tools?.export||{};d.before?.(o),ee.exportToExcel(o.data,o.columns,d.fileName)},select:async()=>{const r=t();r.export.loading=!0;try{if(l.option.tools?.export?.select){await l.option.tools.export.select({...r.page.getQuery(),items:r.table.selection.list});return}if(r.table.selection.list.length===0)throw y.fail(h.tCurd("selectDataToExport")),new Error(h.tCurd("selectDataToExport"));return r.table.selection.list}catch(a){console.error(a)}finally{r.export.loading=!1}},page:async()=>{const r=t();r.export.loading=!0;try{if(l.option.tools?.export?.page){await l.option.tools.export.page({...r.page.getQuery()});return}if(r.table.data.length===0)throw y.fail(h.tCurd("noData")),new Error(h.tCurd("noData"));return r.table.data}catch(a){console.error(a)}finally{r.export.loading=!1}},all:async()=>{const r=t();r.export.loading=!0;try{if(l.option.tools?.export?.all){await l.option.tools.export.all({...r.page.getQuery()});return}const a=l.option.api.list,i=await a({...r.page.getQuery({size:999999,num:1})});return(i.data||{[w.config.field.result.list]:i})[w.config.field.result.list]}catch(a){console.error(a)}finally{r.export.loading=!1}}},loading:!1,click:r=>{const a=t();a.export.loading||a.export.run.start(r)}}}),A=y.EDialog,De=(t,l,r)=>{const a=R(()=>l.form);return{update:{title:"",rules:{},show:!1,showContent:!1,loading:!1,type:A.Update,get form(){return a.get()},set form(i){a.set(i)},formDefault:{},formColumn:[],formGrid:[],formMaxSpan:12,getDisabled:(i,n=!1)=>{const o=t();return l.option.table?.editMode&&n?i.disabled?.table===void 0?!1:y.isFun(i.disabled?.table,o.update.form):G(i,o.update.type,o.update.form)},getBind:i=>{const n=t();return W(i,n.update.type)},getOn:(i,n)=>{const o=t();return J(i,o.update.type,[n||o.update.form,i])},getOptions:i=>{const n=t();try{const d=Q(n.update.formGrid?.length?n.update.formGrid:n.update.formColumn).find(f=>f.item.key===i)?.item;return d?{options:d.options,bind:n.update.getBind(d)}:{options:{},bind:{}}}catch{return{options:{},bind:{}}}},edit:{data:{},getApiData:i=>{const n=t();if(l.option.form?.editAll)return i;const o={[l.option.table?.rowKey]:n.update.edit.data[l.option.table?.rowKey]};return Object.keys(n.update.edit.data).forEach(d=>{i[d]!==n.update.edit.data[d]&&(o[d]=i[d])}),o}},view:{},open:(i,n)=>{const o=t();o.update.showContent||FunUtil.throttle(async()=>{y.loading(!0);try{o.update.type=i;const d=i===A.Add;o.update.edit.data=d?void 0:JSONUtil.cp(n),o.update.title=h.tCurd(d?"add":i===A.View?"view":"edit");const f=d?ObjectUtil.deepMerge(JSONUtil.cp(o.update.formDefault),n?JSONUtil.cp(n):{}):JSONUtil.cp(n);$.setValue(o.update.form,f,!0),await o.initApiData("update"),await l.option.form?.openBefore?.(o.update.form,o.update),(!l.option.table?.inlineEdit||d)&&(o.update.show=!0,o.update.showContent=!0),l.option.form?.openAfter?.(o.update.form,o.update)}catch(d){console.error(d)}finally{y.loading(!1)}})},validate:async()=>{const i=t();try{return await Promise.all([r.ruleFormRef.value?.validate(async n=>new Promise((o,d)=>{n||d(!1),o(void 0)})),i.formRef.validate()]),!0}catch{y.fail(h.tCurd("checkFormData"))}},submit:()=>{FunUtil.throttle(async()=>{const i=t();if(!await i.update.validate())return;i.update.loading=!0;const o=i.update.type===A.Add?l.option.api.create:l.option.api.update;try{await l.option.form?.submitBefore?.(i.update.form,i.update)}catch{i.update.loading=!1;return}let d=ObjectUtil.deepMerge(i.update.form,{});delete d.children;const f=new Set(l.option.column.filter(c=>c.type==="datetime").map(c=>c.key));Object.keys(d).forEach(c=>{if(f.has(c)&&d[c]!=null){const s=new Date(d[c]).getTime();isNaN(s)||(d[c]=s)}});try{if(!o)return;await o({...d}),i.update.close(),await i.table.getList(),l.option.form?.submitAfter?.(d,i.update)}catch(c){console.error(c)}finally{i.update.loading=!1}})},close:()=>{const i=t();i.update.show=!1,i.update.edit.data=void 0,setTimeout(()=>{i.update.showContent=!1,r.ruleFormRef.value?.resetFields?.(),a.clear()},350)}}}},ze=(t,l)=>({remove:{title:h.tCurd("deleteTitle"),show:!1,items:[],loading:!1,close:()=>{t().remove.show=!1},open:r=>{if(r.length===0){y.fail(h.tCurd("selectDataToDelete"));return}const a=t();a.remove.items=r,a.remove.show=!0},submit:()=>{FunUtil.throttle(async()=>{const r=t();r.remove.loading=!0;const a=l.option.api.delete;try{if(!a)return;await a({[l.option.table?.rowKey]:r.remove.items.map(i=>i[l.option.table?.rowKey]),items:r.remove.items}),y.success(h.tCurd("operationSuccess")),r.table.data.length<=1&&r.page.num>1&&(r.page.num-=1),r.remove.close(),await r.table.getList()}catch(i){console.error(i)}finally{r.remove.loading=!1}})}}}),Fe=(t,l,r)=>({apiDataMap:{},getColumnSpan:(a,i)=>{const n=t(),o=n.update.formGrid?.length?n.update.formGrid:i||[];return P(a,o,n.update.form,n.update.type,{maxSpan:n.update.formMaxSpan||l.option.form?.maxSpan,defaultSpan:l.option.form?.defaultSpan||w.config.form.defaultSpan})},init:()=>{const a=t();a.initCurdConfig(),a.initColumnOptions(),a.initColumnForm()},initApiData:async a=>{const i=t(),n=[],o=d=>{if(d.children?.length){d.children.forEach(f=>o(f));return}if(d.options?.[d.type]?.dataApi&&d.options?.[d.type]?.dataApiConfig?.[a]){if(i.apiDataMap[d.key]&&d.options?.[d.type]?.dataApiConfig?.once)return;const f=(async()=>{try{let c=await d.options?.[d.type]?.dataApi?.(i.update.form,i.update.type);if(c){const s=d.options?.[d.type]?.dataPath;!Array.isArray(c)&&s&&(c=ObjectUtil.getPathValue(c,s)),d.options[d.type].data=c,d.options.search[d.type].data=c,d.options.search[d.options.search.type??d.type]||(d.options.search[d.options.search.type??d.type]={}),d.options.search[d.options.search.type??d.type].data=c,d.options.formAdd[d.type].data=c,d.options.formUpdate[d.type].data=c,i.apiDataMap[d.key]=c}}catch{}})();n.push(f)}};return l.option.column.forEach(d=>o(d)),await Promise.all(n),!0},initCurdConfig:()=>{const a=ObjectUtil.deepMerge(w.config,{});a.table.emptyText=h.tCurd("noData"),l.option.size=l.option.size||{},a.table.size=l.option.size.table||a.size.table,a.form.size=l.option.size.form||a.size.form,a.size.search=l.option.size.search||a.size.search;const i=ObjectUtil.deepMerge(a,l.option||{});Object.keys(i).forEach(n=>{l.option[n]=i[n]})},initColumnOptions:()=>{const a=t();let i=JSONUtil.cp(w.config.columnConfig);i.options=ObjectUtil.deepMerge({switch:{activeText:h.tCurd("switchOn"),inactiveText:h.tCurd("switchOff")}},i.options);const n=o=>{for(const d in i){if(d==="table"){if(o.table=ObjectUtil.deepMerge(i.table,o.table||{}),o.children){o.children.forEach(c=>n(c));return}}else d==="type"?o.type=o.type||i.type:o[d]=ObjectUtil.deepMerge(i[d],o[d]||{});o.options=o.options||{},o.options[o.type]=o.options[o.type]||{},o.options[o.type].size=l.option.size.form,["search","formAdd","formUpdate"].forEach(c=>{o.options[c]=o.options[c]||ObjectUtil.deepMerge(o.options,{}),o.options[c][o.type]=o.options[c][o.type]||{},o.options[c][o.type].size=c==="search"?l.option.size.search:l.option.size.form}),o.table=ObjectUtil.deepMerge(o.table,o.options[o.type].table||{})}o.type==="switch"&&(o.options.switch.tableBeforeChange=async(d,f)=>{const c=o.options?.switch;try{c.tableConfig?.confirm&&await r.switchConfirmRef.value?.open({title:h.tCurd("confirmModify"),content:h.tCurd("confirmSwitchMessage")});try{if(!l.option.api.update&&!c.tableConfig?.api)return;const s=f[l.option.table?.rowKey];c.loadingMap||(c.loadingMap={}),c.loadingMap[s]||(c.loadingMap[s]={loading:!1}),c.loadingMap[s].loading=!0;const u=f[d]===c.activeValue?c.inactiveValue:c.activeValue,m=c.tableConfig?.api?c.tableConfig.api:l.option.api.update;if(!m)return;try{await m({...f,[d]:u},"switch")}catch{return!1}finally{c.loadingMap[s].loading=!1}return y.success(h.tCurd("operationSuccess")),c.tableConfig?.loadList&&(a.table.loading=!0,a.table.getList(),a.table.loading=!1),!0}catch(s){return console.error(s),!1}finally{a.table.loading=!1}}catch{return!1}}),o.type==="treeSelect"&&(o.options.treeSelect.rowKey=l.option.table?.rowKey,o.options.treeSelect.nodeKey=l.option.table?.rowKey)};l.option.column.forEach(n),l.option.table?.column?.forEach(n)},initColumnForm:()=>{const a=t(),i=l.option;a.update.formColumn=[],a.update.formGrid=[],a.update.formMaxSpan=12,a.table.column.show={list:[],listSource:[]};const n=l.option.form?.maxSpan||12,o=l.option.form?.defaultSpan||n/2,d=Y(m=>{const p={input:h.tCurd("placeholderInput"),select:h.tCurd("placeholderSelect")};return(p[m.type||"input"]||p.input)+m.label}),f=m=>{if(m.children){a.table.column.show.list.push(m.key),m.children.forEach(p=>f(p));return}a.update.formDefault[m.key]=m.value,m.table?.table&&(m.show?.table&&a.table.column.show.list.push(m.key),a.table.column.show.listSource.push(m.key))};i.column.forEach(m=>{U(m,!0),f(m)}),l.option.table?.column?.forEach(m=>{U(m,!1),f(m)}),a.search.column.list=i.column.concat(i.table?.column||[]),a.table.column.list=a.search.column.list.filter(m=>m.table?.table),a.search.column.list.sort((m,p)=>m.sort?.search-p.sort?.search),a.table.column.list.sort((m,p)=>m.sort?.table-p.sort?.table),a.update.rules={},Z(i.column,a.update.formDefault,a.update.rules,m=>d(m,a.update.form));const c=X(i.column,{maxSpan:n,defaultSpan:o,layout:l.option.form?.layout});a.update.formGrid=c.cells,a.update.formMaxSpan=c.maxSpan,a.update.formColumn=q(c.cells);const s=l.option.search?.formDefault;s&&Object.keys(s).forEach(m=>{a.search.formDefault[m]=s[m]}),i.column.forEach(m=>{m.show?.search||(a.search.formDefault[m.key]=void 0)});const u=ObjectUtil.deepMerge(a.search.formDefault,{});$.setValue(a.search.form,u,!0)}}),$e=t=>{const l=e.ref(),r=e.ref(),a=e.ref(),i={switchConfirmRef:l,ruleFormRef:r,tableRef:a},n=()=>o;let o=e.reactive({...xe(),option:t.option,...Ve(n,t),...Ee(n,t),...Se(n,t,i),...Ne(n,t),...De(n,t,i),...ze(n,t),...Fe(n,t,i)});return o.init(),e.onMounted(()=>{t.option.init!==!1&&o.table.getList()}),I.Scope.setConf(o),{conf:o,switchConfirmRef:l,ruleFormRef:r,tableRef:a}},Oe={class:"dialog-footer"},Me=e.defineComponent({__name:"switchConfirm",props:{size:{}},setup(t,{expose:l}){const r=e.ref(!1),a=e.ref("确认修改"),i=e.ref("确认要修改状态吗?");let n=null,o=null;const d=s=>(s?.title&&(a.value=s.title),s?.content&&(i.value=s.content),r.value=!0,new Promise((u,m)=>{n=u,o=m})),f=()=>{r.value=!1,n?.(!0),n=null,o=null},c=()=>{r.value=!1,o?.(new Error("用户取消操作")),n=null,o=null};return l({open:d}),(s,u)=>{const m=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(e.unref(g.ElDialog),{modelValue:r.value,"onUpdate:modelValue":u[0]||(u[0]=p=>r.value=p),title:a.value,"close-on-click-modal":!1,width:"400px"},{footer:e.withCtx(()=>[e.createVNode(m,{size:t.size},{default:e.withCtx(()=>[e.createElementVNode("span",Oe,[e.createVNode(e.unref(g.ElButton),{onClick:c},{default:e.withCtx(()=>[...u[1]||(u[1]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(e.unref(g.ElButton),{type:"primary",onClick:f},{default:e.withCtx(()=>[...u[2]||(u[2]=[e.createTextVNode("确认",-1)])]),_:1})])]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(i.value),1)]),_:1},8,["modelValue","title"])}}}),Te=["innerHTML"],Ue=e.defineComponent({__name:"text",props:{content:{},value:{}},setup(t){const l=t,r=e.computed(()=>typeof l.content=="function"?l.content(l.value):l.content);return(a,i)=>typeof r.value=="object"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0})):(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:r.value},null,8,Te))}}),te=e.defineComponent({__name:"searchField",props:{item:{},conf:{},type:{}},setup(t){const l=t,r=e.computed({get:()=>l.conf.search.form?.[l.item?.key],set:a=>{l.item?.key!==void 0&&(l.conf.search.form[l.item.key]=a)}});return(a,i)=>e.unref(N).customComponent[t.type??""]?.search?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(N).customComponent[t.type??""]?.search),e.mergeProps({key:0,modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=n=>r.value=n)},t.item.options?.search?.[t.type??""],e.toHandlers(t.item.options?.search?.[t.type??""]?.on||{})),null,16,["modelValue"])):t.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:1,modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=n=>r.value=n),placeholder:t.conf.search.getPlaceholder(t.item),clearable:"",disabled:t.item.disabled?.search},t.item.options?.search?.input||t.item.options?.input,e.toHandlers(t.item.options?.search?.input?.on||t.item.options?.input?.on||{})),null,16,["modelValue","placeholder","disabled"])):t.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:2,modelValue:r.value,"onUpdate:modelValue":i[2]||(i[2]=n=>r.value=n),placeholder:t.conf.search.getPlaceholder(t.item,e.unref(h).tCurd("placeholderSelect")),clearable:"",disabled:t.item.disabled?.search},t.item.options?.search?.switch||t.item.options?.switch,e.toHandlers(t.item.options?.search?.switch?.on||t.item.options?.switch?.on||{})),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:t.item.options?.switch?.activeValue,label:t.item.options?.switch?.activeText,value:t.item.options?.switch?.activeValue},null,8,["label","value"])),(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:t.item.options?.switch?.inactiveValue,label:t.item.options?.switch?.inactiveText,value:t.item.options?.switch?.inactiveValue},null,8,["label","value"]))]),_:1},16,["modelValue","placeholder","disabled"])):t.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:3,modelValue:r.value,"onUpdate:modelValue":i[3]||(i[3]=n=>r.value=n),placeholder:t.conf.search.getPlaceholder(t.item,e.unref(h).tCurd("placeholderSelect")),clearable:"",disabled:t.item.disabled?.search},t.item.options?.search?.select||t.item.options?.select,e.toHandlers(t.item.options?.search?.select?.on||t.item.options?.select?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.options?.search?.select?.data||t.item.options?.select?.data||[],n=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","placeholder","disabled"])):t.type==="radio"?(e.openBlock(),e.createBlock(e.unref(g.ElRadioGroup),e.mergeProps({key:4,modelValue:r.value,"onUpdate:modelValue":i[4]||(i[4]=n=>r.value=n),disabled:t.item.disabled?.search},t.item.options?.search?.radio||t.item.options?.radio,e.toHandlers(t.item.options?.search?.radio?.on||t.item.options?.radio?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.options?.radio?.data,n=>(e.openBlock(),e.createBlock(e.unref(g.ElRadio),{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):t.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(g.ElDatePicker),e.mergeProps({key:5,modelValue:r.value,"onUpdate:modelValue":i[5]||(i[5]=n=>r.value=n),disabled:t.item.disabled?.search},t.item.options?.search?.datetime||t.item.options?.datetime,e.toHandlers(t.item.options?.search?.datetime?.on||t.item.options?.datetime?.on||{})),null,16,["modelValue","disabled"])):t.type&&e.unref(N).customComponent[t.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(N).customComponent[t.type]),e.mergeProps({key:6,modelValue:r.value,"onUpdate:modelValue":i[6]||(i[6]=n=>r.value=n)},t.item.options?.search?.[t.type]||t.item.options?.[t.type],e.toHandlers(t.item.options?.search?.[t.type]?.on||t.item.options?.[t.type]?.on||{}),{disabled:t.item.disabled?.search}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)}}),O=(t,l)=>{const r=t.__vccOpts||t;for(const[a,i]of l)r[a]=i;return r},Le={},Re={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function Ae(t,l){return e.openBlock(),e.createElementBlock("svg",Re,[...l[0]||(l[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M482.2 508.4L331.3 389c-3-2.4-7.3-.2-7.3 3.6V478H184V184h204v128c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V144c0-15.5-12.5-28-28-28H144c-15.5 0-28 12.5-28 28v736c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v128H184V546h140v85.4c0 3.8 4.4 6 7.3 3.6l150.9-119.4a4.5 4.5 0 000-7.2zM880 116H596c-15.5 0-28 12.5-28 28v168c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V184h204v294H700v-85.4c0-3.8-4.3-6-7.3-3.6l-151 119.4a4.52 4.52 0 000 7.1l151 119.5c2.9 2.3 7.3.2 7.3-3.6V546h140v294H636V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v168c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V144c0-15.5-12.5-28-28-28z"},null,-1)])])}const He=O(Le,[["render",Ae]]),je={},Ie={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function Ke(t,l){return e.openBlock(),e.createElementBlock("svg",Ie,[...l[0]||(l[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M180 176h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zm724 0h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zM785.3 504.3L657.7 403.6a7.23 7.23 0 00-11.7 5.7V476H378v-62.8c0-6-7-9.4-11.7-5.7L238.7 508.3a7.14 7.14 0 000 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h268v62.8c0 6 7 9.4 11.7 5.7l127.5-100.8c3.8-2.9 3.8-8.5.2-11.4z"},null,-1)])])}const Ge=O(je,[["render",Ke]]),We={},Je={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function Pe(t,l){return e.openBlock(),e.createElementBlock("svg",Je,[...l[0]||(l[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"},null,-1)])])}const qe=O(We,[["render",Pe]]),Qe={},Xe={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function Ye(t,l){return e.openBlock(),e.createElementBlock("svg",Xe,[...l[0]||(l[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m23.744 191.488c-52.096 0-92.928 14.784-123.2 44.352-30.976 29.568-45.76 70.4-45.76 122.496h80.256c0-29.568 5.632-52.8 17.6-68.992 13.376-19.712 35.2-28.864 66.176-28.864 23.936 0 42.944 6.336 56.32 19.712 12.672 13.376 19.712 31.68 19.712 54.912 0 17.6-6.336 34.496-19.008 49.984l-8.448 9.856c-45.76 40.832-73.216 70.4-82.368 89.408-9.856 19.008-14.08 42.24-14.08 68.992v9.856h80.96v-9.856c0-16.896 3.52-31.68 10.56-45.76 6.336-12.672 15.488-24.64 28.16-35.2 33.792-29.568 54.208-48.576 60.544-55.616 16.896-22.528 26.048-51.392 26.048-86.592q0-64.416-42.24-101.376c-28.16-25.344-65.472-37.312-111.232-37.312m-12.672 406.208a54.27 54.27 0 0 0-38.72 14.784 49.4 49.4 0 0 0-15.488 38.016c0 15.488 4.928 28.16 15.488 38.016A54.85 54.85 0 0 0 523.072 768c15.488 0 28.16-4.928 38.72-14.784a51.52 51.52 0 0 0 16.192-38.72 51.97 51.97 0 0 0-15.488-38.016 55.94 55.94 0 0 0-39.424-14.784"},null,-1)])])}const Ze=O(Qe,[["render",Ye]]),_e={},ve={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function et(t,l){return e.openBlock(),e.createElementBlock("svg",ve,[...l[0]||(l[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-38.4 409.6H326.4a38.4 38.4 0 1 0 0 76.8h147.2v147.2a38.4 38.4 0 0 0 76.8 0V550.4h147.2a38.4 38.4 0 0 0 0-76.8H550.4V326.4a38.4 38.4 0 1 0-76.8 0z"},null,-1)])])}const tt=O(_e,[["render",et]]),ot={},nt={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function at(t,l){return e.openBlock(),e.createElementBlock("svg",nt,[...l[0]||(l[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896M288 512a38.4 38.4 0 0 0 38.4 38.4h371.2a38.4 38.4 0 0 0 0-76.8H326.4A38.4 38.4 0 0 0 288 512"},null,-1)])])}const lt=O(ot,[["render",at]]),rt={class:"row flex-center table-header-label inline"},it={class:"table-header-tooltip"},dt=["innerHTML"],ct=["onClick"],st={key:1},ft=["onClick","innerHTML"],mt=e.defineComponent({__name:"tableColumn",props:{conf:{},columnList:{},option:{}},setup(t){const l=y.isFun,r=e.getCurrentInstance().type;return(a,i)=>{const n=e.resolveComponent("el-tooltip");return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columnList,o=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:o.key},[t.conf.table.column.show.list.includes(o.key)&&(o.show?.table===void 0||e.unref(l)(o.show?.table,t.conf.table.data))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[o.table?.header?.groupKey===void 0||o.table.header.show?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),e.mergeProps({key:0,prop:o.key,label:o.label},{ref_for:!0},o.table),{header:e.withCtx(()=>[e.renderSlot(a.$slots,"table-header-"+o.key,{item:o},()=>[e.createElementVNode("div",rt,[o.table?.header?.tooltip?(e.openBlock(),e.createBlock(n,{key:0,effect:"dark",placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("div",{innerHTML:o.table?.header?.tooltip},null,8,dt)]),default:e.withCtx(()=>[e.createElementVNode("span",it,[e.createVNode(Ze)])]),_:2},1024)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(o.label)+" ",1),o.table?.header?.group!==void 0?(e.openBlock(),e.createElementBlock("span",{key:1,class:"table-header-plus",onClick:e.withModifiers(()=>{o.table.header.group=!o.table.header.group,t.columnList.forEach(d=>{d.table?.header?.groupKey===o.key&&(d.table.header.show=!o.table.header.group)})},["stop"])},[o.table.header.group?(e.openBlock(),e.createBlock(tt,{key:0})):(e.openBlock(),e.createBlock(lt,{key:1}))],8,ct)):e.createCommentVNode("",!0)])])]),default:e.withCtx(({row:d})=>[o.children?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[i[0]||(i[0]=e.createTextVNode(" ",-1)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(r)),{conf:t.conf,columnList:o.children,option:t.option},e.createSlots({_:2},[e.renderList(a.$slots,(f,c)=>({name:c,fn:e.withCtx(s=>[e.renderSlot(a.$slots,c,e.mergeProps({ref_for:!0},s||{}))])}))]),1032,["conf","columnList","option"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.option.table?.editMode?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row",["table-edit-"+o.key]]),style:{width:"100%"}},[e.renderSlot(a.$slots,"table-edit-left-"+o.key,{row:d,item:o}),o.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:0,modelValue:d[o.key],"onUpdate:modelValue":f=>d[o.key]=f,disabled:t.conf.update.getDisabled(o,!0),class:"col"},{ref_for:!0},t.conf.update.getBind(o),e.toHandlers(t.conf.update.getOn(o,d))),e.createSlots({_:2},[o.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof o.options?.input?.prepend=="function"?o.options?.input?.prepend(d):o.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):o.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:1,modelValue:d[o.key],"onUpdate:modelValue":f=>d[o.key]=f,disabled:t.conf.update.getDisabled(o,!0),class:"col"},{ref_for:!0},t.conf.update.getBind(o),e.toHandlers(t.conf.update.getOn(o,d))),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.options?.search?.select?.data||o.options?.select?.data,f=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):o.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:2,modelValue:d[o.key],"onUpdate:modelValue":f=>d[o.key]=f,disabled:t.conf.update.getDisabled(o,!0),class:"col"},{ref_for:!0},t.conf.update.getBind(o),e.toHandlers(t.conf.update.getOn(o,d))),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"table-edit-right-"+o.key,{row:d,item:o})],2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.conf.update.type===e.unref(y).EDialog.Update&&e.unref(l)(o.show?.form,t.conf.update.form,e.unref(y).EDialog.Update)&&t.option.table?.inlineEdit&&t.conf.update.form[t.option.table?.rowKey]===d[t.option.table?.rowKey]&&(o.type==="input"||o.type==="select")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[o.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:0,modelValue:t.conf.update.form[o.key],"onUpdate:modelValue":f=>t.conf.update.form[o.key]=f,disabled:t.conf.update.getDisabled(o,!0)},{ref_for:!0},t.conf.update.getBind(o),e.toHandlers(t.conf.update.getOn(o,d)),{style:{width:"100%"}}),e.createSlots({_:2},[o.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof o.options?.input?.prepend=="function"?o.options?.input?.prepend(d):o.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):o.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:1,modelValue:t.conf.update.form[o.key],"onUpdate:modelValue":f=>t.conf.update.form[o.key]=f,disabled:t.conf.update.getDisabled(o,!0)},{ref_for:!0},t.conf.update.getBind(o),e.toHandlers(t.conf.update.getOn(o,d)),{style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.options?.search?.select?.data||o.options?.select?.data,f=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):o.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:2,modelValue:t.conf.update.form[o.key],"onUpdate:modelValue":f=>t.conf.update.form[o.key]=f},{ref_for:!0},t.conf.update.getBind(o),e.toHandlers(t.conf.update.getOn(o,d)),{disabled:t.conf.update.getDisabled(o,!0)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)],64)):e.renderSlot(a.$slots,"table-"+o.key,{key:1,row:d,item:o},()=>[e.unref(N).customComponent[o.type??""]?.table?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(N).customComponent[o.type??""]?.table),e.mergeProps({key:0,modelValue:d[o.key],"onUpdate:modelValue":f=>d[o.key]=f},{ref_for:!0},o.options?.[o.type??""],e.toHandlers(o.options?.[o.type??""]?.on||{})),null,16,["modelValue","onUpdate:modelValue"])):o.type==="switch"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[o.options?.switch?.tableConfig?.change?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:0,modelValue:d[o.key],"onUpdate:modelValue":f=>d[o.key]=f,loading:o.options?.switch?.loadingMap?.[d[t.option.table?.rowKey]]?.loading,"before-change":()=>o.options?.switch?.tableBeforeChange?.(o.key,d)},{ref_for:!0},o.options?.switch),null,16,["modelValue","onUpdate:modelValue","loading","before-change"])):(e.openBlock(),e.createElementBlock("span",st,e.toDisplayString(d[o.key]===o.options?.switch?.activeValue?o.options?.switch?.activeText:o.options?.switch?.inactiveText),1))],64)):(e.openBlock(),e.createElementBlock("span",{key:2,style:e.normalizeStyle({"--table-text-click-color":o.table?.click?.color}),class:e.normalizeClass({"table-text-click":o.table?.click?.callback}),onClick:f=>o.table?.click?.callback?.(d),innerHTML:o.table?.format?o.table?.format(d):d[o.key]},null,14,ft))])],64))],64))]),_:2},1040,["prop","label"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),128)}}}),pt={key:0,class:"relative curd-search fit-width"},gt={class:"mb-10 flex justify-between items-center fit-width"},ht={class:"flex items-center",style:{gap:"10px"}},ut={key:0},yt={key:1},bt={key:2},kt={class:"export-btn"},wt={key:1,class:"export-btn"},Ct={class:"flex items-center table-tools-right",style:{gap:"10px"}},Bt={class:"row justify-end mt-10 mb-10 table-bottom-pagination"},xt={class:"dialog-footer"},Vt={key:0},Et={key:1},St={class:"dialog-footer"},oe=e.defineComponent({__name:"index",props:{option:{default:{}},form:{default:void 0},searchForm:{default:void 0}},setup(t,{expose:l}){const r=y.EDialog,a=t,i=y.isFun,{conf:n,switchConfirmRef:o,ruleFormRef:d,tableRef:f}=$e(a);return l({conf:n}),(c,s)=>{const u=e.resolveComponent("el-tooltip"),m=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative cc1-form-box",[t.option.table?.fitHeight?"col":"no-min-height"]])},[e.createElementVNode("div",{class:e.normalizeClass(["row",[t.option.table?.fitHeight?"absolute fit":""]]),style:{overflow:"hidden"}},[e.renderSlot(c.$slots,"box-left"),e.createElementVNode("div",{class:e.normalizeClass(["column fit-width no-wrap",[t.option.table?.fitHeight?"col":""]])},[t.option.search?.show!==!1?(e.openBlock(),e.createElementBlock("div",pt,[e.createVNode(e.unref(g.ElForm),{model:e.unref(n).search.form,inline:"",size:t.option.size?.search},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"search-start",{row:e.unref(n).search.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(n).search.column.list,p=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:p.key},[e.renderSlot(c.$slots,"search-"+p.key+"-start",{row:e.unref(n).search.form}),(typeof p.show?.search=="function"?p.show?.search(e.unref(n).search.form):p.show?.search)?(e.openBlock(),e.createBlock(e.unref(g.ElFormItem),{key:0,label:p.text?.search?.label??p.label},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"search-"+p.key+"-left",{row:e.unref(n).search.form}),e.renderSlot(c.$slots,"search-"+p.key,{row:e.unref(n).search.form},()=>[p.options?.search?.type?(e.openBlock(),e.createBlock(te,{key:0,item:p,conf:e.unref(n),type:p.options.search.type},null,8,["item","conf","type"])):(e.openBlock(),e.createBlock(te,{key:1,item:p,conf:e.unref(n),type:p.type},null,8,["item","conf","type"]))]),e.renderSlot(c.$slots,"search-"+p.key+"-right",{row:e.unref(n).search.form})]),_:2},1032,["label"])):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"search-"+p.key+"-end",{row:e.unref(n).search.form})],64))),128)),e.renderSlot(c.$slots,"search-center",{row:e.unref(n).search.form}),t.option.tools?.search||t.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(g.ElFormItem),{key:0},{default:e.withCtx(()=>[t.option.tools?.search?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:0,type:"primary",onClick:e.unref(n).search.submit},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("search")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),t.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:1,onClick:e.unref(n).search.reset},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("reset")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"search-end",{row:e.unref(n).search.form})]),_:3},8,["model","size"])])):e.createCommentVNode("",!0),e.createElementVNode("div",gt,[e.createElementVNode("div",ht,[e.unref(i)(t.option.tools?.add)?(e.openBlock(),e.createElementBlock("div",ut,[e.createVNode(e.unref(g.ElButton),{type:"primary",onClick:s[0]||(s[0]=p=>e.unref(n).update.open(e.unref(r).Add)),size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("add")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),t.option.table?.selectable&&e.unref(i)(t.option.tools?.delete)?(e.openBlock(),e.createElementBlock("div",yt,[e.createVNode(e.unref(g.ElButton),{type:"danger",onClick:s[1]||(s[1]=p=>e.unref(n).remove.open(e.unref(n).table.selection.list)),size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("delete")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),t.option.tools?.expand?(e.openBlock(),e.createElementBlock("div",bt,[e.createVNode(e.unref(g.ElButton),{type:"warning",onClick:s[2]||(s[2]=p=>e.unref(n).table.expand.all()),size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("expandCollapse")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),t.option.tools?.export?.show?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[t.option.tools?.export?.dropdown?.show?(e.openBlock(),e.createBlock(e.unref(g.ElDropdown),{key:0,onCommand:e.unref(n).export.click},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(g.ElDropdownMenu),{size:t.option.size?.search},{default:e.withCtx(()=>[t.option.tools?.export?.dropdown?.select&&(t.option.table?.selectable||e.unref(i)(t.option.tools?.delete))?(e.openBlock(),e.createBlock(e.unref(g.ElDropdownItem),{key:0,command:"select"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("exportSelect")),1)]),_:1})):e.createCommentVNode("",!0),t.option.tools?.export?.dropdown?.page?(e.openBlock(),e.createBlock(e.unref(g.ElDropdownItem),{key:1,command:"page"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("exportPage")),1)]),_:1})):e.createCommentVNode("",!0),t.option.tools?.export?.dropdown?.all?(e.openBlock(),e.createBlock(e.unref(g.ElDropdownItem),{key:2,command:"all"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("exportAll")),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",kt,[e.createVNode(e.unref(g.ElButton),{type:"warning",loading:e.unref(n).export.loading,size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("export")),1)]),_:1},8,["loading","size"])])]),_:1},8,["onCommand"])):(e.openBlock(),e.createElementBlock("div",wt,[e.createVNode(e.unref(g.ElButton),{type:"warning",loading:e.unref(n).export.loading,size:t.option.size?.search,onClick:s[3]||(s[3]=p=>e.unref(n).export.run.start("all"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("export")),1)]),_:1},8,["loading","size"])]))],64)):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"tools-left")]),e.createElementVNode("div",Ct,[e.renderSlot(c.$slots,"tools-right"),e.unref(n).page.showTools?(e.openBlock(),e.createBlock(e.unref(g.ElPagination),e.mergeProps({key:0,"current-page":e.unref(n).page.num,"onUpdate:currentPage":s[4]||(s[4]=p=>e.unref(n).page.num=p),"page-size":e.unref(n).page.size,"onUpdate:pageSize":s[5]||(s[5]=p=>e.unref(n).page.size=p),background:"","page-sizes":e.unref(n).page.sizeList,"pager-count":e.unref(n).page.pagerCount,layout:e.unref(n).page.layout,total:e.unref(n).page.total,size:t.option.size?.table,onSizeChange:e.unref(n).table.getList,onCurrentChange:e.unref(n).table.getList},t.option.page?.pagination||{},e.toHandlers(t.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0),t.option.tools?.expandColumn===void 0||t.option.tools?.expandColumn?(e.openBlock(),e.createBlock(u,{key:1,effect:"dark",content:e.unref(n).table.header.group.expand?e.unref(h).tCurd("mergeColumn"):e.unref(h).tCurd("expandColumn"),placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["refresh-btn",[t.option.size?.search]]),onClick:s[6]||(s[6]=(...p)=>e.unref(n).table.header.group.toggleExpandAll&&e.unref(n).table.header.group.toggleExpandAll(...p))},[e.unref(n).table.header.group.expand?(e.openBlock(),e.createBlock(He,{key:0})):(e.openBlock(),e.createBlock(Ge,{key:1}))],2)]),_:1},8,["content"])):e.createCommentVNode("",!0),t.option.tools?.refresh===void 0||t.option.tools?.refresh?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["refresh-btn",[t.option.size?.search]]),onClick:s[7]||(s[7]=(...p)=>e.unref(n).table.getList&&e.unref(n).table.getList(...p))},[e.createVNode(qe)],2)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:e.normalizeClass(["fit-width relative form-box",[t.option.table?.fitHeight?"col ":"",t.option.table?.editMode?"edit-mode":""]])},[e.createElementVNode("div",{class:e.normalizeClass(["column form-box-content",[t.option.table?.fitHeight?"absolute fit":""]])},[e.withDirectives((e.openBlock(),e.createBlock(e.unref(g.ElTable),e.mergeProps({ref_key:"tableRef",ref:f,data:e.unref(n).table.data,border:t.option.table?.border===void 0?!0:t.option.table?.border,onSelectionChange:e.unref(n).table.selection.change,onSortChange:e.unref(n).table.sort.change,"expand-row-keys":e.unref(n).table.expand.rowKeys,onExpandChange:e.unref(n).table.expand.change},t.option.table,e.toHandlers(t.option.table?.on||{})),{default:e.withCtx(()=>[(typeof t.option.table?.selectable=="object"?t.option.table?.selectable?.show:t.option.table?.selectable)||e.unref(i)(t.option.tools?.delete)||t.option.tools?.export?.show&&t.option.tools?.export?.select?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),e.mergeProps({key:0,type:"selection",width:"40",align:"center",fixed:"left","show-overflow-tooltip":!1,className:"cc1-form-selectable-column"},typeof t.option.table?.selectable=="object"?t.option.table?.selectable:{},e.toHandlers(typeof t.option.table?.selectable=="object"?t.option.table?.selectable?.on||{}:{})),null,16)):e.createCommentVNode("",!0),(typeof t.option.table?.index=="object"?t.option.table?.index?.show:t.option.table?.index)?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),e.mergeProps({key:1,type:"index",fixed:"left",width:"40",align:"center",label:"#","show-overflow-tooltip":!1,className:"cc1-form-index-column"},typeof t.option.table?.index=="object"?t.option.table?.index:{},e.toHandlers(typeof t.option.table?.index=="object"?t.option.table?.index?.on||{}:{})),null,16)):e.createCommentVNode("",!0),e.createVNode(mt,{conf:e.unref(n),columnList:e.unref(n).table.column.list,option:t.option},e.createSlots({_:2},[e.renderList(c.$slots,(p,E)=>({name:E,fn:e.withCtx(z=>[e.renderSlot(c.$slots,E,e.normalizeProps(e.guardReactiveProps(z||{})))])}))]),1032,["conf","columnList","option"]),e.unref(i)(t.option.table?.add)||e.unref(i)(t.option.table?.update)||e.unref(i)(t.option.table?.delete)||e.unref(i)(t.option.table?.view)||c.$slots["table-op-left"]||c.$slots["table-op-right"]?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),e.mergeProps({key:2,align:"center",fixed:"right"},t.option.table?.operate,{width:t.option.table?.operate?.width||120,"show-overflow-tooltip":!1}),{header:e.withCtx(()=>[e.renderSlot(c.$slots,"table-header-op",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("operation")),1)])]),default:e.withCtx(({row:p})=>[e.createVNode(e.unref(g.ElForm),{size:t.option.size?.table},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"table-op-left",{row:p}),e.unref(n).update.type===e.unref(r).Update&&t.option.table?.inlineEdit&&e.unref(n).update.form[a.option.table?.rowKey]===p[a.option.table?.rowKey]?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(g.ElButton),{link:"",type:"info",onClick:e.unref(n).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("cancel")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(g.ElButton),{link:"",type:"primary",onClick:e.unref(n).update.submit,loading:e.unref(n).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("confirm")),1)]),_:1},8,["onClick","loading"]),e.renderSlot(c.$slots,"table-op-edit-right",{row:p})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(i)(t.option.table?.add,p)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:0,link:"",type:"primary",onClick:E=>e.unref(n).update.open(e.unref(r).Add,p)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("add")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(i)(t.option.table?.view,p)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:1,link:"",type:"primary",onClick:E=>e.unref(n).update.open(e.unref(r).View,p)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("view")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(i)(t.option.table?.update,p)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:2,link:"",type:"warning",onClick:E=>e.unref(n).update.open(e.unref(r).Update,p)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("edit")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(i)(t.option.table?.delete,p)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:3,link:"",type:"danger",onClick:E=>e.unref(n).remove.open([p])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("delete")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"table-op-right",{row:p})],64))]),_:2},1032,["size"])]),_:3},16,["width"])):e.createCommentVNode("",!0)]),_:3},16,["data","border","onSelectionChange","onSortChange","expand-row-keys","onExpandChange"])),[[m,e.unref(n).table.loading]])],2)],2),e.createElementVNode("div",Bt,[(t.option.page?.show===void 0||t.option.page?.show)&&!e.unref(n).page.showTools?(e.openBlock(),e.createBlock(e.unref(g.ElPagination),e.mergeProps({key:0,"current-page":e.unref(n).page.num,"onUpdate:currentPage":s[8]||(s[8]=p=>e.unref(n).page.num=p),"page-size":e.unref(n).page.size,"onUpdate:pageSize":s[9]||(s[9]=p=>e.unref(n).page.size=p),background:"","page-sizes":e.unref(n).page.sizeList,"pager-count":e.unref(n).page.pagerCount,layout:e.unref(n).page.layout,total:e.unref(n).page.total,size:t.option.size?.table,onSizeChange:e.unref(n).table.getList,onCurrentChange:e.unref(n).table.getList},t.option.page?.pagination||{},e.toHandlers(t.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0)])],2),e.renderSlot(c.$slots,"box-right")],2),e.createVNode(e.unref(g.ElDialog),e.mergeProps({modelValue:e.unref(n).update.show,"onUpdate:modelValue":s[10]||(s[10]=p=>e.unref(n).update.show=p),title:e.unref(n).update.title,"before-close":e.unref(n).update.close},t.option.dialog),{footer:e.withCtx(()=>[e.createElementVNode("span",xt,[e.createVNode(e.unref(g.ElForm),{size:t.option.size?.form},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"dialog-footer",{row:e.unref(n).update},()=>[e.createVNode(e.unref(g.ElButton),{onClick:e.unref(n).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("close")),1)]),_:1},8,["onClick"]),e.unref(n).update.type!==e.unref(r).View?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:0,type:"primary",onClick:e.unref(n).update.submit,loading:e.unref(n).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("submit")),1)]),_:1},8,["onClick","loading"])):e.createCommentVNode("",!0)])]),_:3},8,["size"])])]),default:e.withCtx(()=>[e.renderSlot(c.$slots,"dialog-start",{row:e.unref(n).update}),e.createVNode(e.unref(g.ElForm),{ref_key:"ruleFormRef",ref:d,model:e.unref(n).update.form,rules:e.unref(n).update.rules,size:t.option.size?.form,class:"update-dialog-form"},{default:e.withCtx(()=>[e.unref(n).update.showContent?(e.openBlock(),e.createBlock(_,{key:0,"form-grid":e.unref(n).update.formGrid,"max-span":e.unref(n).update.formMaxSpan,form:e.unref(n).update.form,type:e.unref(n).update.type,stripe:t.option.form?.stripe,"label-width":t.option.form?.labelWidth,"form-option":t.option.form,"get-bind":e.unref(n).update.getBind,"get-on":e.unref(n).update.getOn,"get-disabled":e.unref(n).update.getDisabled},e.createSlots({_:2},[e.renderList(c.$slots,(p,E)=>({name:E,fn:e.withCtx(z=>[e.renderSlot(c.$slots,E,e.normalizeProps(e.guardReactiveProps(z||{})))])}))]),1032,["form-grid","max-span","form","type","stripe","label-width","form-option","get-bind","get-on","get-disabled"])):e.createCommentVNode("",!0)]),_:3},8,["model","rules","size"]),e.renderSlot(c.$slots,"dialog-end",{row:e.unref(n).update})]),_:3},16,["modelValue","title","before-close"]),e.createVNode(e.unref(g.ElDialog),{modelValue:e.unref(n).remove.show,"onUpdate:modelValue":s[11]||(s[11]=p=>e.unref(n).remove.show=p),title:e.unref(n).remove.title,"close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createElementVNode("span",St,[e.createVNode(e.unref(g.ElForm),{size:t.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(g.ElButton),{onClick:e.unref(n).remove.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("close")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(g.ElButton),{type:"danger",onClick:e.unref(n).remove.submit,loading:e.unref(n).remove.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("confirmDelete")),1)]),_:1},8,["onClick","loading"])]),_:1},8,["size"])])]),default:e.withCtx(()=>[t.option.dialog?.delete?.content?(e.openBlock(),e.createElementBlock("div",Vt,[e.createVNode(Ue,{content:t.option.dialog?.delete?.content,value:e.unref(n).remove.items},null,8,["content","value"])])):(e.openBlock(),e.createElementBlock("div",Et,e.toDisplayString(e.unref(h).tCurd("confirmDeleteMessage",e.unref(n).remove.items.length)),1))]),_:1},8,["modelValue","title"]),e.createVNode(Me,{ref_key:"switchConfirmRef",ref:o,size:t.option.size?.form},null,8,["size"])],2)}}});class Nt{static async download(l,r="download.png"){const a=document.createElement("a");a.style.display="none",a.href=l,a.setAttribute("download",r),typeof a.download>"u"&&a.setAttribute("target","_blank"),document.body.appendChild(a),a.click(),document.body.removeChild(a),window.URL.revokeObjectURL(l)}static exportJSONFile=(l,r)=>{const a=new Blob([JSON.stringify(l)],{type:"application/json"}),i=URL.createObjectURL(a),n=document.createElement("a");n.href=i,n.download=`${r||"config"}.json`,n.click()};static importFile=async l=>new Promise((r,a)=>{const i=document.createElement("input");i.type="file";const n=l?.accept||".json";i.accept=n,i.style.display="none",i.onchange=o=>{const d=o.target.files[0];if(!d){y.fail("未选择文件"),a("未选择文件");return}const f=new FileReader;f.onload=async c=>{const s=n==".json"?JSON.parse(c.target.result):c.target.result;r(s)},f.onerror=()=>{y.fail("文件读取失败"),a("文件读取失败")},f.readAsText(d),document.body.removeChild(i)},document.body.appendChild(i),i.click()})}const ne=(t,l)=>{if(t.component("TCurd",oe),t.component("TFormList",j),t.component("TColumn",v),l?.customComponent){N.customComponent=l.customComponent;for(const r in l.customComponent)t.component(r,l.customComponent[r])}},Dt={install:ne};B.ArrUtil=F,B.ExcelUtil=ee,B.TColumn=v,B.TCurd=oe,B.TFile=Nt,B.TForm=N,B.TFormConfig=w,B.TFormI18n=h,B.TFormList=j,B.TSys=y,B.default=Dt,B.install=ne,Object.defineProperties(B,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
1
|
+
(function(C,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("element-plus"),require("vue-router"),require("vue"),require("cc1-vue3")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue-router","vue","cc1-vue3"],g):(C=typeof globalThis<"u"?globalThis:C||self,g(C.cc1Form={},C.ElementPlus,C.VueRouter,C.Vue,C.cc1Vue3))})(this,(function(C,g,Ot,e,I){"use strict";class y{static router;static routes;static getRouterPath=()=>this.router.currentRoute.value.path;static EDialog={Add:"Add",Update:"Update",View:"View",Remove:"Remove"};static isFun=(l,...r)=>Array.isArray(l)?l.some(a=>typeof a=="function"?a(...r):a):typeof l=="function"?l(...r):l;static getRouterParams=()=>{const l=this.router.currentRoute.value.query||{},r=this.router.currentRoute.value.params||{};return Object.keys(l).length?l:Object.keys(r).length?r:{}};static moduleObj={};static loadModule=async l=>{if(!y.moduleObj[l])throw new Error(`模块${l}未加载,请赋值如:TSys.moduleObj = { ${l}: ()=>import('${l}') }`);const r=await y.moduleObj[l]();return r.default??r};static tipMessages={};static tipMessagesGap=500;static showMessage(l,r,a={}){const i=Date.now();if(!this.tipMessages[l]||i-this.tipMessages[l]>this.tipMessagesGap){this.tipMessages[l]=i;const n=Object.assign({message:l,type:r},a);g.ElMessage(n),setTimeout(()=>{delete this.tipMessages[l]},this.tipMessagesGap)}}static fail=(l,r={})=>{this.showMessage(l,"error",r)};static success=(l,r={})=>{this.showMessage(l,"success",r)};static loadingObj=null;static loadingTimer=null;static loading=(l=!0,r="Loading...")=>{Timer.un(this.loadingTimer),this.loadingTimer=Timer.once(()=>{l?this.loadingObj=g.ElLoading.service({lock:!0,text:r,background:"rgba(0, 0, 0, 0.3)"}):this.loadingObj&&(this.loadingObj.close(),this.loadingObj=null)},50)};static openUrl=(l,r=!0)=>{if(r){let a=screen.width/2-500,i=screen.height/2-800/2-30;window.open(l,"_blank","toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top="+i+", left="+a)}else window.open(l,"DescriptiveWindowName"+StrUtil.getId(),"resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0")};static getImgPic=l=>new Promise(async(r,a)=>{let i=document.getElementById(l.id);const n=await y.loadModule("html2canvas");try{n(i,{logging:!1,allowTaint:!0,scale:window.devicePixelRatio,width:l.windowWidth,height:l.windowHeight,windowWidth:l.windowWidth,windowHeight:l.windowHeight,useCORS:!0,backgroundColor:"#ffffff00"}).then(function(o){let d=o.toDataURL("image/png");r(d)})}catch(o){a(o)}})}class w{static config={field:{page:{num:"num",size:"size"},result:{list:"list",pages:"pages",num:"num",size:"size",total:"total"}},dialog:{width:"980px",closeOnClickModal:!1},pagination:{layout:"total, sizes, prev, pager, next, jumper",pageSizes:[10,20,50,100],size:10,pagerCount:7,showTools:!1},size:{table:"default",form:"default",search:"default"},tools:{expandColumn:!1,refresh:!0,expand:!1,search:!0,reset:!0,add:!0,delete:!0,export:{show:!0,dropdown:{show:!0,select:!0,page:!0,all:!0},fileName:"Export Data "}},form:{size:"default",labelWidth:"120px",stripe:!0,editAll:!1,maxSpan:12,defaultSpan:6,openBefore:void 0,openAfter:void 0,closeBefore:void 0,submitBefore:void 0,submitAfter:void 0},table:{index:!1,labelWidth:"100px",size:"default",emptyText:"",headerCellClassName:"table-header",rowKey:"_id",highlightCurrentRow:!0,border:!0,selectable:!1,column:[],showOverflowTooltip:!0,showSummary:!1,summaryMethod:()=>[],inlineEdit:!1,operate:{width:void 0},add:!1,update:!0,delete:!0,sort:{props:{field:"sortField"},order:{field:"sortOrder",asc:"asc",desc:"desc"},resetPage:!1,change:void 0},fitHeight:!0},columnConfig:{type:"input",form:{width:"100%",spanCol:!1},table:{table:!0,minWidth:120,width:void 0,fixed:void 0,align:"center",showOverflowTooltip:!0,format:void 0,click:{callback:void 0,color:"#409EFF"},tooltip:void 0},show:{table:!0,search:!1,form:!0},sort:{search:0,table:0,form:0},disabled:{view:!0},options:{switch:{activeValue:!0,inactiveValue:!1,tableConfig:{change:!0,confirm:!0,loadList:!0}},treeSelect:{multiple:!0,renderAfterExpand:!1,showCheckbox:!0,checkStrictly:!0,checkOnClickNode:!0,props:{label:"title",children:"children"}},datetime:{type:"datetime"},select:{data:[],clearable:!0,filterable:!0,dataPath:"data.data",dataApiConfig:{once:!0,init:!0,create:!0,update:!0}},radio:{data:[],dataPath:"data.data",dataApiConfig:{once:!0,init:!0,create:!0,update:!0}}}}};static setConfig=l=>{w.config=ObjectUtil.deepMerge(w.config,l)}}class N{static customComponent={};static findOptions=(l,r)=>{const a=l.column.find(n=>n.key===r),i=n=>n.replace(/-([a-z])/g,(o,d)=>d.toUpperCase());if(a)return a.options[i(a.type)]};static setOptionsData=(l,r,a)=>{const i=N.findOptions(l,r);i&&(i.data=a)};static form={openBefore:{parentId:(l,r,a,i)=>{const n=w.config.table.rowKey;l?r.type===y.EDialog.Add?(r.form.parentId=l[n],r.form.sort=l.children.length+1):r.form.parentId=l.parentId.substring(l.parentId.lastIndexOf(",")+1):(r.form.parentId="0",r.form.sort=a.length+1),N.setOptionsData(i,"parentId",[{[n]:"0",title:"根",children:a}])}}}}class F{static getIdFun=()=>StrUtil.uuid();static setId=(l,r,a)=>{r[l]||(r[l]=[]);const i=w.config.table.rowKey;r[l].forEach(n=>{a.forEach(o=>{let d=o.default??"";o.type==="number"&&(d=o.default??0),o.type==="boolean"&&(d=o.default??!1),o.type==="time"&&(d=o.default??new Date),n[o.value]===void 0&&(n[o.value]=d)}),n[i]||(n[i]=F.getIdFun())})};static add=(l,r,a,i)=>{const n=JSONUtil.cp(a);F.setId(l,r,a);const o=w.config.table.rowKey;r[l].push(n.reduce((d,f)=>{let c=f.default??"";return f.type==="number"&&(c=f.default??0),f.type==="boolean"&&(c=f.default??!1),f.type==="time"&&(c=f.default??new Date),d[f.value]=c,d},{[o]:F.getIdFun()})),i?.(r)};static remove=(l,r,a,i)=>{const n=w.config.table.rowKey;r[l]=r[l].filter(o=>o[n]!==a[n]),i?.(r)};static getNoIdData=(l,r)=>{const a=JSONUtil.cp(l),i=w.config.table.rowKey;return a.forEach(n=>{n[i]&&delete n[i],r&&n[r]&&F.getNoIdData(n[r],r)}),a}}const ae={key:0,class:"column curd-form-com-list",style:{width:"100%",gap:"10px"}},le={key:0},re={class:"row items-center",style:{gap:"10px",width:"100%"}},ie={key:1},j=e.defineComponent({__name:"list",props:{row:{default:{}},label:{default:"label"},value:{default:"value"},itemFields:{default:[{label:"label",value:"label"},{label:"value",value:"value"}]},field:{default:"value"},inputWidth:{default:"120px"},inputClass:{default:""},addBottom:{default:!1}},emits:["change"],setup(t,{emit:l}){const r=t,a=e.reactive({show:!1,add:(n,o,d)=>{F.add(n,o,d,()=>{i("change")})},remove:(n,o,d)=>{F.remove(n,o,d,()=>{i("change")})}});e.onMounted(()=>{F.setId(r.field,r.row,r.itemFields),a.show=!0});const i=l;return(n,o)=>{const d=e.resolveComponent("el-button"),f=e.resolveComponent("el-input");return a.show?(e.openBlock(),e.createElementBlock("div",ae,[e.renderSlot(n.$slots,"list-start",{row:t.row}),t.addBottom?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",le,[e.createVNode(d,{link:"",type:"primary",onClick:o[0]||(o[0]=c=>a.add(t.field,t.row,t.itemFields))},{default:e.withCtx(()=>[...o[3]||(o[3]=[e.createTextVNode("添加",-1)])]),_:1})])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.row[t.field],c=>(e.openBlock(),e.createElementBlock("div",re,[e.renderSlot(n.$slots,"item-start",{item:c,row:t.row}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.itemFields,s=>(e.openBlock(),e.createBlock(f,{modelValue:c[s.value],"onUpdate:modelValue":u=>c[s.value]=u,style:e.normalizeStyle({width:t.inputWidth}),class:e.normalizeClass(t.inputClass),placeholder:s[t.label]||s[t.value],onChange:o[1]||(o[1]=u=>i("change"))},null,8,["modelValue","onUpdate:modelValue","style","class","placeholder"]))),256)),e.renderSlot(n.$slots,"item-end",{item:c,row:t.row}),e.createVNode(d,{link:"",type:"danger",onClick:s=>a.remove(t.field,t.row,c)},{default:e.withCtx(()=>[...o[4]||(o[4]=[e.createTextVNode("删除",-1)])]),_:1},8,["onClick"])]))),256)),t.addBottom?(e.openBlock(),e.createElementBlock("div",ie,[e.createVNode(d,{link:"",type:"primary",onClick:o[2]||(o[2]=c=>a.add(t.field,t.row,t.itemFields))},{default:e.withCtx(()=>[...o[5]||(o[5]=[e.createTextVNode("添加",-1)])]),_:1})])):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"list-end",{row:t.row})])):e.createCommentVNode("",!0)}}}),de={class:"row form-item-content",style:{width:"100%"}},ce={class:"col column form-item-content-item"},se={class:"col"},fe=["innerHTML"],me=e.defineComponent({__name:"field",props:{item:{},form:{},type:{},labelWidth:{},getBind:{type:Function},getOn:{type:Function},getDisabled:{type:Function}},setup(t){return(l,r)=>(e.openBlock(),e.createBlock(e.unref(g.ElFormItem),{label:t.item.text?.form?.label??t.item.label,prop:t.item.key,"label-width":t.item.text?.form?.label==""?0:t.item.form?.labelWidth||t.labelWidth},{default:e.withCtx(()=>[e.createElementVNode("div",de,[e.renderSlot(l.$slots,"form-"+t.item.key+"-start",{row:t.form,item:t.item}),e.createElementVNode("div",ce,[e.createElementVNode("div",se,[e.renderSlot(l.$slots,"form-"+t.item.key,{row:t.form,item:t.item},()=>[t.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:0,modelValue:t.form[t.item.key],"onUpdate:modelValue":r[0]||(r[0]=a=>t.form[t.item.key]=a)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),e.createSlots({_:2},[t.getBind(t.item).prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof t.getBind(t.item).prepend=="function"?t.getBind(t.item).prepend(t.form):t.getBind(t.item).prepend),1)]),key:"0"}:void 0]),1040,["modelValue","disabled"])):t.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:1,modelValue:t.form[t.item.key],"onUpdate:modelValue":r[1]||(r[1]=a=>t.form[t.item.key]=a)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),null,16,["modelValue","disabled"])):t.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:2,modelValue:t.form[t.item.key],"onUpdate:modelValue":r[2]||(r[2]=a=>t.form[t.item.key]=a)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.getBind(t.item).data||[],a=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),e.mergeProps({key:a.value},{ref_for:!0},a,e.toHandlers(a.on||{})),null,16))),128))]),_:1},16,["modelValue","disabled"])):t.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(g.ElRadioGroup),e.mergeProps({key:3,modelValue:t.form[t.item.key],"onUpdate:modelValue":r[3]||(r[3]=a=>t.form[t.item.key]=a)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.getBind(t.item).data||[],a=>(e.openBlock(),e.createBlock(e.unref(g.ElRadio),e.mergeProps({key:a.value},{ref_for:!0},a,e.toHandlers(a.on||{})),null,16))),128))]),_:1},16,["modelValue","disabled"])):t.item.type==="list"?(e.openBlock(),e.createBlock(j,e.mergeProps({key:4,row:t.form,field:t.item.key},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):t.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(g.ElTreeSelect),e.mergeProps({key:5,modelValue:t.form[t.item.key],"onUpdate:modelValue":r[4]||(r[4]=a=>t.form[t.item.key]=a)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item),style:{width:"100%"}}),null,16,["modelValue","disabled"])):t.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(g.ElDatePicker),e.mergeProps({key:6,modelValue:t.form[t.item.key],"onUpdate:modelValue":r[5]||(r[5]=a=>t.form[t.item.key]=a)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),null,16,["modelValue","disabled"])):t.item.type&&(e.unref(N).customComponent[t.item.type]||e.unref(N).customComponent[t.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(N).customComponent[t.item.type]?.form||e.unref(N).customComponent[t.item.type]),e.mergeProps({key:7,modelValue:t.form[t.item.key],"onUpdate:modelValue":r[6]||(r[6]=a=>t.form[t.item.key]=a)},t.getBind(t.item),e.toHandlers(t.getOn(t.item)),{disabled:t.getDisabled(t.item)}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(l.$slots,"form-"+t.item.key+"-right",{row:t.form,item:t.item})]),e.renderSlot(l.$slots,"form-"+t.item.key+"-tip",{row:t.form,item:t.item},()=>[t.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof t.item.form?.tipText=="function"?t.item.form?.tipText(t.form,t.type):t.item.form?.tipText},null,8,fe)):e.createCommentVNode("",!0)])]),e.renderSlot(l.$slots,"form-"+t.item.key+"-end",{row:t.form,item:t.item})])]),_:3},8,["label","prop","label-width"]))}});function Mt(t){return t}const pe={search:"搜索",add:"新增",edit:"编辑",view:"查看",delete:"删除",export:"导出",exportSelect:"导出选中",exportPage:"导出本页",exportAll:"导出全部",import:"导入",refresh:"刷新",reset:"重置",expandCollapse:"展开/收缩",operation:"操作",close:"关闭",cancel:"取消",submit:"提交",confirm:"确认",deleteTitle:"删除提示",confirmDelete:"确认删除",confirmDeleteMessage:"确认要删除【{count}】条数据吗?",placeholderInput:"请输入",placeholderSelect:"请选择",checkFormData:"部分内容未输入或输入错误,请检查",selectDataToDelete:"请选择要删除的数据",selectDataToExport:"请选择要导出的数据",noData:"暂无数据",operationSuccess:"操作成功",switchOn:"开启",switchOff:"关闭",confirmModify:"确认修改",confirmSwitchMessage:"确认要修改吗?",mergeColumn:"合并栏位",expandColumn:"展开栏位"};class h{static t(l,...r){if(typeof l=="function")return l(...r);l=String(l);let a=0;return l.replace(/{([^}]+)}/g,(i,n)=>a<r.length?String(r[a++]):`{${n}}`)}static setI18n=l=>{h.curd=ObjectUtil.deepMerge(h.curd,l)};static tCurd(l,...r){return this.t(this.curd[l],...r)}static curd=pe}const D=12,U=(t,l)=>{t.isForm=l,Array.isArray(t.children)&&t.children.forEach(r=>U(r,l))},ge=t=>t.isForm===!1?!1:typeof t.show?.form=="boolean"?t.show.form:!0,he=(t,l,r)=>(t.form=t.form||{span:l},r==="column"?t.form.span=t.form.span??12:t.form.span=t.form.span??l,t.form.span),K=t=>{const l=t.form;return l?.row!=null&&l.row>0?l.row:D},L=t=>Math.floor((t.gridRow-1)/D),G=(t,l,r)=>{if(l===y.EDialog.View)return t.disabled?.view===void 0?!0:y.isFun(t.disabled?.view,r);const a=t.disabled?.[l===y.EDialog.Add?"create":"update"];return y.isFun(a,r)},W=(t,l)=>t.options?.[l===y.EDialog.Add?"formAdd":"formUpdate"]?.[t.type]||t.options?.[t.type]||{},J=(t,l,r=[])=>{const i=t.options?.[l===y.EDialog.Add?"formAdd":"formUpdate"]?.[t.type]?.on||t.options?.[t.type]?.on||{},n={};return Object.keys(i).forEach(o=>{const d=i[o];typeof d=="function"?n[o]=function(...f){return d.apply(this,[...f,...r])}:n[o]=d}),n},P=(t,l,r,a,i)=>{const n=t,o=n.colSpan??t.span;if(!t.item.form?.spanCol)return o;const d=i?.maxSpan||12,f=i?.defaultSpan||d/2,c=n.gridBand,u=l.filter(m=>c!=null?m.gridBand===c&&!y.isFun(m.item.show?.form,r,a):m.gridRow===n.gridRow&&!y.isFun(m.item.show?.form,r,a)).reduce((m,p)=>m+(p.colSpan??p.span??f),0);return o+u},q=t=>{const l=new Map;return t.forEach(r=>{const a=r.gridBand??L(r);l.has(a)||l.set(a,[]),l.get(a).push(r)}),Array.from(l.keys()).sort((r,a)=>r-a).map(r=>l.get(r))},Q=t=>t?.length?Array.isArray(t[0])?t.flat():t:[],ue=(t,l)=>{if(!ge(t)||!t.key)return null;const r=l.defaultSpan??(l.maxSpan||12)/2,a=he(t,r,l.layout);return{item:t,span:a}},ye=(t,l={})=>{const r=[],a=i=>{if(i.children?.length){i.children.forEach(o=>a(o));return}const n=ue(i,l);n&&r.push(n)};return t.forEach(i=>a(i)),r},X=(t,l={})=>{const r=l.maxSpan??12,a=l.defaultSpan??r/2,i=l.layout??"row",o=ye(t,{maxSpan:r,defaultSpan:a,layout:i});if(i==="column"){const b=[];let k=1;return o.forEach(B=>{const S=K(B.item),x=r;b.push({...B,span:x,colSpan:x,rowSpan:S,gridRow:k,gridColumn:1,gridBand:L({gridRow:k})}),k+=S}),{cells:b,maxSpan:r}}const d=new Set,f=[];let c=0,s=0;const u=b=>Math.floor(b/D)*D,m=(b,k)=>`${b},${k}`,p=(b,k,B,S)=>{if(k+B>r)return!1;for(let x=0;x<S;x++)for(let V=0;V<B;V++)if(d.has(m(b+x,k+V)))return!1;return!0},E=(b,k,B,S)=>{for(let x=0;x<S;x++)for(let V=0;V<B;V++)d.add(m(b+x,k+V))},z=(b,k,B,S)=>{for(let V=u(b);V<500*D;V+=D){const zt=V+D,Ft=V===u(b)?Math.max(V,b):V;for(let T=Ft;T<zt;T++){const $t=T===b?k:0;for(let H=$t;H<=r-B;H++)if(p(T,H,B,S))return{tr:T,tc:H}}}return{tr:b,tc:k}},M=(b,k,B,S)=>{const x=u(b);if(S<D&&b+S<x+D){c=b+S,s=k;return}const V=k+B;if(V<r){s=V,c=x;return}s=0,c=x+D};for(const b of o){const k=b.span===0?r:b.span,B=K(b.item);b.item.form?.rowBreak&&f.length&&(s=0,c=u(c)+D);let{tr:S,tc:x}=p(c,s,k,B)?{tr:c,tc:s}:z(c,s,k,B);p(S,x,k,B)||({tr:S,tc:x}=z(0,0,k,B)),E(S,x,k,B);const V=S+1;f.push({...b,span:k,colSpan:k,rowSpan:B,gridRow:V,gridColumn:x+1,gridBand:L({gridRow:V})}),M(S,x,k,B)}return{cells:f,maxSpan:r}},be=t=>t.map(l=>l.item?.show?.form),ke=(t,l,r)=>{if(!t.rules)return;const a=typeof t.rules=="boolean"?[{required:!0,message:l(t),trigger:"blur"}]:t.rules;return r?a.map(i=>r(i)):a},Y=t=>(l,r)=>ke(l,t,a=>{if(a.validator){const i=a.validator;return{...a,validator:(n,o,d)=>i(n,o,d,r)}}return a}),we=()=>Y(t=>{const l={input:h.tCurd("placeholderInput"),select:h.tCurd("placeholderSelect")};return(l[t.type||"input"]||l.input)+t.label}),Ce=(t,l,r)=>{const a={},i={},n=l?.maxSpan||12,o=l?.defaultSpan||n/2,d=we();t.forEach(s=>U(s,!0)),Z(t,a,i,s=>d(s,r));const{cells:f,maxSpan:c}=X(t,{maxSpan:n,defaultSpan:o,layout:l?.layout});return{formDefault:a,rules:i,formGrid:f,formMaxSpan:c,formColumn:q(f)}},Z=(t,l,r,a)=>{const i=n=>{if(n.children?.length){n.children.forEach(o=>i(o));return}if(n.key){l[n.key]=n.value;const o=a(n);o&&(r[n.key]=o)}};t.forEach(i)},Be={class:"curd-form-cell-inner"},_=e.defineComponent({__name:"layout",props:{formGrid:{},maxSpan:{},form:{},type:{},stripe:{type:Boolean},labelWidth:{},formOption:{},getBind:{type:Function},getOn:{type:Function},getDisabled:{type:Function}},setup(t){const l=y.isFun,r=t,a=e.computed(()=>r.formGrid.filter(s=>l(s.item.show?.form,r.form,r.type))),i=e.computed(()=>({gridTemplateColumns:`repeat(${r.maxSpan}, minmax(0, 1fr))`})),n=e.computed(()=>{let s=0;return a.value.forEach(u=>{const m=u.gridRow+u.rowSpan-1;m>s&&(s=m)}),s}),o=s=>s.gridRow+s.rowSpan-1>=n.value,d=s=>s.rowSpan>=D,f=s=>P(s,r.formGrid,r.form,r.type,{maxSpan:r.maxSpan,defaultSpan:r.formOption?.defaultSpan}),c=s=>{const u=f(s)||s.colSpan;return{gridRow:`${s.gridRow} / span ${s.rowSpan}`,gridColumn:`${s.gridColumn} / span ${u}`}};return(s,u)=>e.unref(l)(e.unref(be)(t.formGrid),t.form,t.type)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.renderSlot(s.$slots,"form-start",{row:t.form}),e.createElementVNode("div",{class:e.normalizeClass(["curd-form-grid",{stripe:t.stripe!==!1}]),style:e.normalizeStyle(i.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,m=>(e.openBlock(),e.createElementBlock("div",{key:m.item.key,class:e.normalizeClass(["curd-form-grid-cell",[t.stripe!==!1&&e.unref(L)(m)%2===0?"stripe-band-odd":"",m.gridColumn>1?"has-col-border":"",t.stripe!==!1&&o(m)?"is-last-row":"",d(m)?"is-row-span":"",`form-item-col-${m.item.key}`]]),style:e.normalizeStyle(c(m))},[e.createElementVNode("div",Be,[e.unref(l)(m.item.show?.form,t.form,t.type)?(e.openBlock(),e.createBlock(me,{key:0,class:e.normalizeClass({"is-row-span-field":d(m)}),item:m.item,form:t.form,type:t.type,"label-width":t.labelWidth,"get-bind":t.getBind,"get-on":t.getOn,"get-disabled":t.getDisabled},e.createSlots({_:2},[e.renderList(s.$slots,(p,E)=>({name:E,fn:e.withCtx(z=>[e.renderSlot(s.$slots,E,e.mergeProps({ref_for:!0},z||{}))])}))]),1032,["class","item","form","type","label-width","get-bind","get-on","get-disabled"])):e.createCommentVNode("",!0)])],6))),128))],6),e.renderSlot(s.$slots,"form-end",{row:t.form})],64)):e.createCommentVNode("",!0)}});class ${static delAllKey=l=>{Object.keys(l).forEach(r=>{delete l[r]})};static setValue=(l,r,a=!1)=>{a&&$.delAllKey(l),Object.keys(r).forEach(i=>{l[i]!==r[i]&&(l[i]=r[i])})}}const R=t=>{const l=e.reactive({}),r=()=>typeof t=="function"?t():t,a=()=>{const i=r();return i??l};return{internal:l,isExternal:()=>r()!=null,get(){return a()},set(i){$.setValue(a(),i,!0)},merge(i){$.setValue(a(),i,!1)},clear(){$.delAllKey(a())}}},v=e.defineComponent({__name:"column",props:{option:{default:()=>({form:{},column:[]})},type:{default:""},form:{default:void 0}},setup(t,{expose:l}){const r=y.EDialog,a=e.ref(),i=t;let n=R(i.form);const o=I.Scope.getConf();o?.formRef?.set("formRef-"+StrUtil.getId(),a);const d=e.reactive({rules:{},show:!0,formDefault:{},type:i.type||o?.update?.type||r.Add,formColumn:[],formGrid:[],formMaxSpan:12,get form(){return n.get()},set form(f){n.set(f)},getDisabled:f=>G(f,d.type,d.form),getBind:f=>W(f,d.type),getOn:f=>J(f,d.type,[d.form,f]),initColumnForm:()=>{const f=n,c=Ce(i.option.column,i.option.form,f.get());d.formDefault=c.formDefault,d.rules=c.rules,d.formGrid=c.formGrid,d.formMaxSpan=c.formMaxSpan,d.formColumn=c.formColumn,d.type===r.Add?f.isExternal()?f.merge(JSONUtil.cp(d.formDefault)):f.set(JSONUtil.cp(d.formDefault)):!f.isExternal()&&i.form&&f.set(JSONUtil.cp(i.form))}});return i.option.form?.initStart?.(d),d.initColumnForm(),i.option.form?.initEnd?.(d),e.watch(()=>i.form,f=>{n=R(f),d.initColumnForm()}),l({ref:a,conf:d}),(f,c)=>(e.openBlock(),e.createBlock(e.unref(g.ElForm),{ref_key:"ruleFormRef",ref:a,model:d.form,rules:d.rules},{default:e.withCtx(()=>[d.show?(e.openBlock(),e.createBlock(_,{key:0,"form-grid":d.formGrid,"max-span":d.formMaxSpan,form:d.form,type:d.type,stripe:t.option.form?.stripe,"label-width":t.option.form?.labelWidth||"100px","form-option":t.option.form,"get-bind":d.getBind,"get-on":d.getOn,"get-disabled":d.getDisabled},e.createSlots({_:2},[e.renderList(f.$slots,(s,u)=>({name:u,fn:e.withCtx(m=>[e.renderSlot(f.$slots,u,e.normalizeProps(e.guardReactiveProps(m||{})))])}))]),1032,["form-grid","max-span","form","type","stripe","label-width","form-option","get-bind","get-on","get-disabled"])):e.createCommentVNode("",!0)]),_:3},8,["model","rules"]))}}),xe=()=>({formRef:{map:{},set(t,l){this.map[t]=l},validate(){return new Promise(async(t,l)=>{try{const r=Object.keys(this.map);await Promise.all(r.map(a=>this.map[a]?.validate(async i=>new Promise((n,o)=>{i||o(!1),n(!0)})))),t(!0)}catch(r){l(r)}})}}}),Ve=(t,l)=>{const r=R(()=>l.searchForm);return{search:{column:{list:[]},get form(){return r.get()},set form(a){r.set(a)},formDefault:{},getPlaceholder:(a,i=h.tCurd("placeholderInput"))=>a.text?.search?.placeholder===void 0?`${i}${a.label}`:a.text?.search?.placeholder,getFormData:()=>{const a=t();let i={};l.option.column.forEach(o=>{(typeof o.show?.search=="function"?o.show?.search(a.search.form):o.show?.search)&&(i[o.key]=a.search.form[o.key])});const n=l.option.search?.before?.(i);return n&&(i=n),i},reset:()=>{const a=t(),i=a.search.formDefault;Object.keys(i).forEach(o=>{l.option.search?.resetMode==="none"?i[o]=void 0:i[o]=a.search.formDefault[o]});const n=ObjectUtil.deepMerge(i,{});$.setValue(a.search.form,n,!0),a.page.num=1,l.option.init!==!1&&a.table.getList()},submit:()=>{const a=t();a.page.num=1,a.table.getList()}}}},Ee=(t,l)=>({page:{num:1,total:0,layout:l.option.page?.layout||w.config.pagination.layout,showTools:l.option.page?.showTools||w.config.pagination.showTools,size:l.option.page?.size||w.config.pagination.size,sizeList:l.option.page?.sizeList||w.config.pagination.pageSizes,pagerCount:l.option.page?.pagerCount||w.config.pagination.pagerCount,getQuery:(r={})=>{const a=t();return{[w.config.field.page.size]:r.size||a.page.size,[w.config.field.page.num]:r.num||a.page.num,...a.search.getFormData()}}}}),Se=(t,l,r)=>({table:{op:{width:(...a)=>a.filter(n=>n).length*30+60},loading:!1,data:[],expand:{isExpand:!1,rowKeys:[],change:(a,i)=>{},all:()=>{const a=t();if(a.table.expand.isExpand)a.table.expand.rowKeys=[];else{const i=n=>{let o=[];return n.forEach(d=>{o.push(d[l.option.table.rowKey]),d.children?.length&&(o=o.concat(i(d.children)))}),o};a.table.expand.rowKeys=i(a.table.data)}a.table.expand.isExpand=!a.table.expand.isExpand}},column:{list:[],show:{listSource:[],list:[]}},header:{group:{expand:!1,toggleExpandAll:()=>{const a=t(),i=!a.table.header.group.expand;a.table.header.group.expand=i;const n=o=>{o.forEach(d=>{d.table?.header?.group!==void 0&&(d.table.header.group=!i),d.table?.header?.groupKey!==void 0&&(d.table.header.show=i),Array.isArray(d.children)&&d.children.length&&n(d.children)})};n(a.table.column.list)}}},getList:async()=>{const a=t();a.table.loading=!0;const i=l.option.api.list,n=JSONUtil.cp(a.table.selection.list);try{await a.initApiData("init");let o={};if(a.table.sort.prop){const{props:E,order:z}=w.config.table.sort;o={[E.field]:a.table.sort.prop,[z.field]:a.table.sort.order}}const d=await i({...a.page.getQuery(),...o}),f=w.config.field.result,c=d.data||{[f.list]:d},s=(Array.isArray(c[f.list]),c[f.list]),u=Q(a.update.formGrid?.length?a.update.formGrid:a.update.formColumn),p=ObjectUtil.deepMerge({data:s},{}).data.map(E=>(Object.keys(E).forEach(M=>{const b=u.find(k=>k.item.key===M);b&&["select","radio"].includes(b.item.type)&&(b.item.table.format||(b.item.table.format=k=>b.item.options[b.item.type].data?.find(B=>B.value==k[M])?.label||k[M]))}),E));a.table.data=l.option.data?await l.option.data(p,s):p,a.page.total=c[f.total]||0,setTimeout(()=>{a.table.selection.setList(n)},20)}catch(o){console.error(o)}finally{a.table.loading=!1}},selection:{list:[],change:a=>{t().table.selection.list=a},setList:(a,i)=>{const n=t();n.table.selection.list=[];const o=r.tableRef.value;if(o?.clearSelection(),!o||!a?.length)return;const d=l.option.table?.rowKey,f=c=>{const s=u=>{for(const m of u){if(d!=null&&d!==""){if(m[d]===c[d])return m}else if(m===c)return m;if(Array.isArray(m.children)&&m.children.length){const p=s(m.children);if(p!==void 0)return p}}};return s(n.table.data)};a.forEach(c=>{const s=f(c);if(s)if(i){const u=()=>o.toggleRowSelection(s,!0,!1);i(c)!==!1&&u()}else o.toggleRowSelection(s,!0,!1)})}},sort:{prop:"",order:"",change:a=>{const i=t();w.config.table.sort.resetPage&&(i.page.num=1);const n=w.config.table.sort;if(n.change){n.change(a,i);return}i.table.sort.prop=a.prop,a.order===null?(i.table.sort.order="",i.table.sort.prop=""):i.table.sort.order=a.order==="ascending"?n.order.asc:n.order.desc,i.table.getList()}}}});class ee{static exportToExcel=async(l,r,a)=>{if(!l||l.length===0)return;const i=await y.loadModule("xlsx"),n=l.map(f=>{const c={};return r.forEach(s=>{c[s.label]=f[s.key]}),c}),o=i.utils.json_to_sheet(n),d=i.utils.book_new();i.utils.book_append_sheet(d,o,"Sheet1"),a?typeof a=="function"&&(a=a()):a=`导出数据_${new Date().Format("yyyy-MM-dd")}_${new Date().getTime()}`,i.writeFile(d,`${a}.xlsx`)}}const Ne=(t,l)=>({export:{run:{start:async r=>{let i=await t().export.run[r]();const n=l.option.column,o=ObjectUtil.deepMerge({data:i,columns:n},{}),d=l.option.tools?.export||{};d.before?.(o),ee.exportToExcel(o.data,o.columns,d.fileName)},select:async()=>{const r=t();r.export.loading=!0;try{if(l.option.tools?.export?.select){await l.option.tools.export.select({...r.page.getQuery(),items:r.table.selection.list});return}if(r.table.selection.list.length===0)throw y.fail(h.tCurd("selectDataToExport")),new Error(h.tCurd("selectDataToExport"));return r.table.selection.list}catch(a){console.error(a)}finally{r.export.loading=!1}},page:async()=>{const r=t();r.export.loading=!0;try{if(l.option.tools?.export?.page){await l.option.tools.export.page({...r.page.getQuery()});return}if(r.table.data.length===0)throw y.fail(h.tCurd("noData")),new Error(h.tCurd("noData"));return r.table.data}catch(a){console.error(a)}finally{r.export.loading=!1}},all:async()=>{const r=t();r.export.loading=!0;try{if(l.option.tools?.export?.all){await l.option.tools.export.all({...r.page.getQuery()});return}const a=l.option.api.list,i=await a({...r.page.getQuery({size:999999,num:1})});return(i.data||{[w.config.field.result.list]:i})[w.config.field.result.list]}catch(a){console.error(a)}finally{r.export.loading=!1}}},loading:!1,click:r=>{const a=t();a.export.loading||a.export.run.start(r)}}}),A=y.EDialog,De=(t,l,r)=>{const a=R(()=>l.form);return{update:{title:"",rules:{},show:!1,showContent:!1,loading:!1,type:A.Update,get form(){return a.get()},set form(i){a.set(i)},formDefault:{},formColumn:[],formGrid:[],formMaxSpan:12,getDisabled:(i,n=!1)=>{const o=t();return l.option.table?.editMode&&n?i.disabled?.table===void 0?!1:y.isFun(i.disabled?.table,o.update.form):G(i,o.update.type,o.update.form)},getBind:i=>{const n=t();return W(i,n.update.type)},getOn:(i,n)=>{const o=t();return J(i,o.update.type,[n||o.update.form,i])},getOptions:i=>{const n=t();try{const d=Q(n.update.formGrid?.length?n.update.formGrid:n.update.formColumn).find(f=>f.item.key===i)?.item;return d?{options:d.options,bind:n.update.getBind(d)}:{options:{},bind:{}}}catch{return{options:{},bind:{}}}},edit:{data:{},getApiData:i=>{const n=t();if(l.option.form?.editAll)return i;const o={[l.option.table?.rowKey]:n.update.edit.data[l.option.table?.rowKey]};return Object.keys(n.update.edit.data).forEach(d=>{i[d]!==n.update.edit.data[d]&&(o[d]=i[d])}),o}},view:{},openLoading:!1,open:async(i,n)=>{const o=t();if(!(o.update.showContent||o.update.openLoading)){y.loading(!0),o.update.openLoading=!0;try{o.update.type=i;const d=i===A.Add;o.update.edit.data=d?void 0:JSONUtil.cp(n),o.update.title=h.tCurd(d?"add":i===A.View?"view":"edit");const f=d?ObjectUtil.deepMerge(JSONUtil.cp(o.update.formDefault),n?JSONUtil.cp(n):{}):JSONUtil.cp(n);$.setValue(o.update.form,f,!0),await o.initApiData("update"),await l.option.form?.openBefore?.(o.update.form,o.update),(!l.option.table?.inlineEdit||d)&&(o.update.show=!0,o.update.showContent=!0),l.option.form?.openAfter?.(o.update.form,o.update)}catch(d){console.error(d)}finally{y.loading(!1),o.update.openLoading=!1}}},validate:async()=>{const i=t();try{return await Promise.all([r.ruleFormRef.value?.validate(async n=>new Promise((o,d)=>{n||d(!1),o(void 0)})),i.formRef.validate()]),!0}catch{y.fail(h.tCurd("checkFormData"))}},submit:async()=>{const i=t();if(!await i.update.validate()||i.update.loading)return;i.update.loading=!0;const o=i.update.type===A.Add?l.option.api.create:l.option.api.update;try{await l.option.form?.submitBefore?.(i.update.form,i.update)}catch{i.update.loading=!1;return}let d=ObjectUtil.deepMerge(i.update.form,{});delete d.children;const f=new Set(l.option.column.filter(c=>c.type==="datetime").map(c=>c.key));Object.keys(d).forEach(c=>{if(f.has(c)&&d[c]!=null){const s=new Date(d[c]).getTime();isNaN(s)||(d[c]=s)}});try{if(!o)return;await o({...d}),i.update.close(),await i.table.getList(),l.option.form?.submitAfter?.(d,i.update)}catch(c){console.error(c)}finally{i.update.loading=!1}},close:()=>{const i=t();i.update.show=!1,i.update.edit.data=void 0,setTimeout(()=>{i.update.showContent=!1,r.ruleFormRef.value?.resetFields?.(),a.clear()},350)}}}},ze=(t,l)=>({remove:{title:h.tCurd("deleteTitle"),show:!1,items:[],loading:!1,close:()=>{t().remove.show=!1},open:r=>{if(r.length===0){y.fail(h.tCurd("selectDataToDelete"));return}const a=t();a.remove.items=r,a.remove.show=!0},submit:()=>{FunUtil.throttle(async()=>{const r=t();r.remove.loading=!0;const a=l.option.api.delete;try{if(!a)return;await a({[l.option.table?.rowKey]:r.remove.items.map(i=>i[l.option.table?.rowKey]),items:r.remove.items}),y.success(h.tCurd("operationSuccess")),r.table.data.length<=1&&r.page.num>1&&(r.page.num-=1),r.remove.close(),await r.table.getList()}catch(i){console.error(i)}finally{r.remove.loading=!1}})}}}),Fe=(t,l,r)=>({apiDataMap:{},getColumnSpan:(a,i)=>{const n=t(),o=n.update.formGrid?.length?n.update.formGrid:i||[];return P(a,o,n.update.form,n.update.type,{maxSpan:n.update.formMaxSpan||l.option.form?.maxSpan,defaultSpan:l.option.form?.defaultSpan||w.config.form.defaultSpan})},init:()=>{const a=t();a.initCurdConfig(),a.initColumnOptions(),a.initColumnForm()},initApiData:async a=>{const i=t(),n=[],o=d=>{if(d.children?.length){d.children.forEach(f=>o(f));return}if(d.options?.[d.type]?.dataApi&&d.options?.[d.type]?.dataApiConfig?.[a]){if(i.apiDataMap[d.key]&&d.options?.[d.type]?.dataApiConfig?.once)return;const f=(async()=>{try{let c=await d.options?.[d.type]?.dataApi?.(i.update.form,i.update.type);if(c){const s=d.options?.[d.type]?.dataPath;!Array.isArray(c)&&s&&(c=ObjectUtil.getPathValue(c,s)),d.options[d.type].data=c,d.options.search[d.type].data=c,d.options.search[d.options.search.type??d.type]||(d.options.search[d.options.search.type??d.type]={}),d.options.search[d.options.search.type??d.type].data=c,d.options.formAdd[d.type].data=c,d.options.formUpdate[d.type].data=c,i.apiDataMap[d.key]=c}}catch{}})();n.push(f)}};return l.option.column.forEach(d=>o(d)),await Promise.all(n),!0},initCurdConfig:()=>{const a=ObjectUtil.deepMerge(w.config,{});a.table.emptyText=h.tCurd("noData"),l.option.size=l.option.size||{},a.table.size=l.option.size.table||a.size.table,a.form.size=l.option.size.form||a.size.form,a.size.search=l.option.size.search||a.size.search;const i=ObjectUtil.deepMerge(a,l.option||{});Object.keys(i).forEach(n=>{l.option[n]=i[n]})},initColumnOptions:()=>{const a=t();let i=JSONUtil.cp(w.config.columnConfig);i.options=ObjectUtil.deepMerge({switch:{activeText:h.tCurd("switchOn"),inactiveText:h.tCurd("switchOff")}},i.options);const n=o=>{for(const d in i){if(d==="table"){if(o.table=ObjectUtil.deepMerge(i.table,o.table||{}),o.children){o.children.forEach(c=>n(c));return}}else d==="type"?o.type=o.type||i.type:o[d]=ObjectUtil.deepMerge(i[d],o[d]||{});o.options=o.options||{},o.options[o.type]=o.options[o.type]||{},o.options[o.type].size=l.option.size.form,["search","formAdd","formUpdate"].forEach(c=>{o.options[c]=o.options[c]||ObjectUtil.deepMerge(o.options,{}),o.options[c][o.type]=o.options[c][o.type]||{},o.options[c][o.type].size=c==="search"?l.option.size.search:l.option.size.form}),o.table=ObjectUtil.deepMerge(o.table,o.options[o.type].table||{})}o.type==="switch"&&(o.options.switch.tableBeforeChange=async(d,f)=>{const c=o.options?.switch;try{c.tableConfig?.confirm&&await r.switchConfirmRef.value?.open({title:h.tCurd("confirmModify"),content:h.tCurd("confirmSwitchMessage")});try{if(!l.option.api.update&&!c.tableConfig?.api)return;const s=f[l.option.table?.rowKey];c.loadingMap||(c.loadingMap={}),c.loadingMap[s]||(c.loadingMap[s]={loading:!1}),c.loadingMap[s].loading=!0;const u=f[d]===c.activeValue?c.inactiveValue:c.activeValue,m=c.tableConfig?.api?c.tableConfig.api:l.option.api.update;if(!m)return;try{await m({...f,[d]:u},"switch")}catch{return!1}finally{c.loadingMap[s].loading=!1}return y.success(h.tCurd("operationSuccess")),c.tableConfig?.loadList&&(a.table.loading=!0,a.table.getList(),a.table.loading=!1),!0}catch(s){return console.error(s),!1}finally{a.table.loading=!1}}catch{return!1}}),o.type==="treeSelect"&&(o.options.treeSelect.rowKey=l.option.table?.rowKey,o.options.treeSelect.nodeKey=l.option.table?.rowKey)};l.option.column.forEach(n),l.option.table?.column?.forEach(n)},initColumnForm:()=>{const a=t(),i=l.option;a.update.formColumn=[],a.update.formGrid=[],a.update.formMaxSpan=12,a.table.column.show={list:[],listSource:[]};const n=l.option.form?.maxSpan||12,o=l.option.form?.defaultSpan||n/2,d=Y(m=>{const p={input:h.tCurd("placeholderInput"),select:h.tCurd("placeholderSelect")};return(p[m.type||"input"]||p.input)+m.label}),f=m=>{if(m.children){a.table.column.show.list.push(m.key),m.children.forEach(p=>f(p));return}a.update.formDefault[m.key]=m.value,m.table?.table&&(m.show?.table&&a.table.column.show.list.push(m.key),a.table.column.show.listSource.push(m.key))};i.column.forEach(m=>{U(m,!0),f(m)}),l.option.table?.column?.forEach(m=>{U(m,!1),f(m)}),a.search.column.list=i.column.concat(i.table?.column||[]),a.table.column.list=a.search.column.list.filter(m=>m.table?.table),a.search.column.list.sort((m,p)=>m.sort?.search-p.sort?.search),a.table.column.list.sort((m,p)=>m.sort?.table-p.sort?.table),a.update.rules={},Z(i.column,a.update.formDefault,a.update.rules,m=>d(m,a.update.form));const c=X(i.column,{maxSpan:n,defaultSpan:o,layout:l.option.form?.layout});a.update.formGrid=c.cells,a.update.formMaxSpan=c.maxSpan,a.update.formColumn=q(c.cells);const s=l.option.search?.formDefault;s&&Object.keys(s).forEach(m=>{a.search.formDefault[m]=s[m]}),i.column.forEach(m=>{m.show?.search||(a.search.formDefault[m.key]=void 0)});const u=ObjectUtil.deepMerge(a.search.formDefault,{});$.setValue(a.search.form,u,!0)}}),$e=t=>{const l=e.ref(),r=e.ref(),a=e.ref(),i={switchConfirmRef:l,ruleFormRef:r,tableRef:a},n=()=>o;let o=e.reactive({...xe(),option:t.option,...Ve(n,t),...Ee(n,t),...Se(n,t,i),...Ne(n,t),...De(n,t,i),...ze(n,t),...Fe(n,t,i)});return o.init(),e.onMounted(()=>{t.option.init!==!1&&o.table.getList()}),I.Scope.setConf(o),{conf:o,switchConfirmRef:l,ruleFormRef:r,tableRef:a}},Oe={class:"dialog-footer"},Me=e.defineComponent({__name:"switchConfirm",props:{size:{}},setup(t,{expose:l}){const r=e.ref(!1),a=e.ref("确认修改"),i=e.ref("确认要修改状态吗?");let n=null,o=null;const d=s=>(s?.title&&(a.value=s.title),s?.content&&(i.value=s.content),r.value=!0,new Promise((u,m)=>{n=u,o=m})),f=()=>{r.value=!1,n?.(!0),n=null,o=null},c=()=>{r.value=!1,o?.(new Error("用户取消操作")),n=null,o=null};return l({open:d}),(s,u)=>{const m=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(e.unref(g.ElDialog),{modelValue:r.value,"onUpdate:modelValue":u[0]||(u[0]=p=>r.value=p),title:a.value,"close-on-click-modal":!1,width:"400px"},{footer:e.withCtx(()=>[e.createVNode(m,{size:t.size},{default:e.withCtx(()=>[e.createElementVNode("span",Oe,[e.createVNode(e.unref(g.ElButton),{onClick:c},{default:e.withCtx(()=>[...u[1]||(u[1]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(e.unref(g.ElButton),{type:"primary",onClick:f},{default:e.withCtx(()=>[...u[2]||(u[2]=[e.createTextVNode("确认",-1)])]),_:1})])]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(i.value),1)]),_:1},8,["modelValue","title"])}}}),Te=["innerHTML"],Ue=e.defineComponent({__name:"text",props:{content:{},value:{}},setup(t){const l=t,r=e.computed(()=>typeof l.content=="function"?l.content(l.value):l.content);return(a,i)=>typeof r.value=="object"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0})):(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:r.value},null,8,Te))}}),te=e.defineComponent({__name:"searchField",props:{item:{},conf:{},type:{}},setup(t){const l=t,r=e.computed({get:()=>l.conf.search.form?.[l.item?.key],set:a=>{l.item?.key!==void 0&&(l.conf.search.form[l.item.key]=a)}});return(a,i)=>e.unref(N).customComponent[t.type??""]?.search?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(N).customComponent[t.type??""]?.search),e.mergeProps({key:0,modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=n=>r.value=n)},t.item.options?.search?.[t.type??""],e.toHandlers(t.item.options?.search?.[t.type??""]?.on||{})),null,16,["modelValue"])):t.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:1,modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=n=>r.value=n),placeholder:t.conf.search.getPlaceholder(t.item),clearable:"",disabled:t.item.disabled?.search},t.item.options?.search?.input||t.item.options?.input,e.toHandlers(t.item.options?.search?.input?.on||t.item.options?.input?.on||{})),null,16,["modelValue","placeholder","disabled"])):t.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:2,modelValue:r.value,"onUpdate:modelValue":i[2]||(i[2]=n=>r.value=n),placeholder:t.conf.search.getPlaceholder(t.item,e.unref(h).tCurd("placeholderSelect")),clearable:"",disabled:t.item.disabled?.search},t.item.options?.search?.switch||t.item.options?.switch,e.toHandlers(t.item.options?.search?.switch?.on||t.item.options?.switch?.on||{})),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:t.item.options?.switch?.activeValue,label:t.item.options?.switch?.activeText,value:t.item.options?.switch?.activeValue},null,8,["label","value"])),(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:t.item.options?.switch?.inactiveValue,label:t.item.options?.switch?.inactiveText,value:t.item.options?.switch?.inactiveValue},null,8,["label","value"]))]),_:1},16,["modelValue","placeholder","disabled"])):t.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:3,modelValue:r.value,"onUpdate:modelValue":i[3]||(i[3]=n=>r.value=n),placeholder:t.conf.search.getPlaceholder(t.item,e.unref(h).tCurd("placeholderSelect")),clearable:"",disabled:t.item.disabled?.search},t.item.options?.search?.select||t.item.options?.select,e.toHandlers(t.item.options?.search?.select?.on||t.item.options?.select?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.options?.search?.select?.data||t.item.options?.select?.data||[],n=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","placeholder","disabled"])):t.type==="radio"?(e.openBlock(),e.createBlock(e.unref(g.ElRadioGroup),e.mergeProps({key:4,modelValue:r.value,"onUpdate:modelValue":i[4]||(i[4]=n=>r.value=n),disabled:t.item.disabled?.search},t.item.options?.search?.radio||t.item.options?.radio,e.toHandlers(t.item.options?.search?.radio?.on||t.item.options?.radio?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.options?.radio?.data,n=>(e.openBlock(),e.createBlock(e.unref(g.ElRadio),{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):t.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(g.ElDatePicker),e.mergeProps({key:5,modelValue:r.value,"onUpdate:modelValue":i[5]||(i[5]=n=>r.value=n),disabled:t.item.disabled?.search},t.item.options?.search?.datetime||t.item.options?.datetime,e.toHandlers(t.item.options?.search?.datetime?.on||t.item.options?.datetime?.on||{})),null,16,["modelValue","disabled"])):t.type&&e.unref(N).customComponent[t.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(N).customComponent[t.type]),e.mergeProps({key:6,modelValue:r.value,"onUpdate:modelValue":i[6]||(i[6]=n=>r.value=n)},t.item.options?.search?.[t.type]||t.item.options?.[t.type],e.toHandlers(t.item.options?.search?.[t.type]?.on||t.item.options?.[t.type]?.on||{}),{disabled:t.item.disabled?.search}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)}}),O=(t,l)=>{const r=t.__vccOpts||t;for(const[a,i]of l)r[a]=i;return r},Le={},Re={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function Ae(t,l){return e.openBlock(),e.createElementBlock("svg",Re,[...l[0]||(l[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M482.2 508.4L331.3 389c-3-2.4-7.3-.2-7.3 3.6V478H184V184h204v128c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V144c0-15.5-12.5-28-28-28H144c-15.5 0-28 12.5-28 28v736c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v128H184V546h140v85.4c0 3.8 4.4 6 7.3 3.6l150.9-119.4a4.5 4.5 0 000-7.2zM880 116H596c-15.5 0-28 12.5-28 28v168c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V184h204v294H700v-85.4c0-3.8-4.3-6-7.3-3.6l-151 119.4a4.52 4.52 0 000 7.1l151 119.5c2.9 2.3 7.3.2 7.3-3.6V546h140v294H636V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v168c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V144c0-15.5-12.5-28-28-28z"},null,-1)])])}const He=O(Le,[["render",Ae]]),je={},Ie={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function Ke(t,l){return e.openBlock(),e.createElementBlock("svg",Ie,[...l[0]||(l[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M180 176h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zm724 0h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zM785.3 504.3L657.7 403.6a7.23 7.23 0 00-11.7 5.7V476H378v-62.8c0-6-7-9.4-11.7-5.7L238.7 508.3a7.14 7.14 0 000 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h268v62.8c0 6 7 9.4 11.7 5.7l127.5-100.8c3.8-2.9 3.8-8.5.2-11.4z"},null,-1)])])}const Ge=O(je,[["render",Ke]]),We={},Je={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function Pe(t,l){return e.openBlock(),e.createElementBlock("svg",Je,[...l[0]||(l[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"},null,-1)])])}const qe=O(We,[["render",Pe]]),Qe={},Xe={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function Ye(t,l){return e.openBlock(),e.createElementBlock("svg",Xe,[...l[0]||(l[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m23.744 191.488c-52.096 0-92.928 14.784-123.2 44.352-30.976 29.568-45.76 70.4-45.76 122.496h80.256c0-29.568 5.632-52.8 17.6-68.992 13.376-19.712 35.2-28.864 66.176-28.864 23.936 0 42.944 6.336 56.32 19.712 12.672 13.376 19.712 31.68 19.712 54.912 0 17.6-6.336 34.496-19.008 49.984l-8.448 9.856c-45.76 40.832-73.216 70.4-82.368 89.408-9.856 19.008-14.08 42.24-14.08 68.992v9.856h80.96v-9.856c0-16.896 3.52-31.68 10.56-45.76 6.336-12.672 15.488-24.64 28.16-35.2 33.792-29.568 54.208-48.576 60.544-55.616 16.896-22.528 26.048-51.392 26.048-86.592q0-64.416-42.24-101.376c-28.16-25.344-65.472-37.312-111.232-37.312m-12.672 406.208a54.27 54.27 0 0 0-38.72 14.784 49.4 49.4 0 0 0-15.488 38.016c0 15.488 4.928 28.16 15.488 38.016A54.85 54.85 0 0 0 523.072 768c15.488 0 28.16-4.928 38.72-14.784a51.52 51.52 0 0 0 16.192-38.72 51.97 51.97 0 0 0-15.488-38.016 55.94 55.94 0 0 0-39.424-14.784"},null,-1)])])}const Ze=O(Qe,[["render",Ye]]),_e={},ve={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function et(t,l){return e.openBlock(),e.createElementBlock("svg",ve,[...l[0]||(l[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-38.4 409.6H326.4a38.4 38.4 0 1 0 0 76.8h147.2v147.2a38.4 38.4 0 0 0 76.8 0V550.4h147.2a38.4 38.4 0 0 0 0-76.8H550.4V326.4a38.4 38.4 0 1 0-76.8 0z"},null,-1)])])}const tt=O(_e,[["render",et]]),ot={},nt={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function at(t,l){return e.openBlock(),e.createElementBlock("svg",nt,[...l[0]||(l[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896M288 512a38.4 38.4 0 0 0 38.4 38.4h371.2a38.4 38.4 0 0 0 0-76.8H326.4A38.4 38.4 0 0 0 288 512"},null,-1)])])}const lt=O(ot,[["render",at]]),rt={class:"row flex-center table-header-label inline"},it={class:"table-header-tooltip"},dt=["innerHTML"],ct=["onClick"],st={key:1},ft=["onClick","innerHTML"],mt=e.defineComponent({__name:"tableColumn",props:{conf:{},columnList:{},option:{}},setup(t){const l=y.isFun,r=e.getCurrentInstance().type;return(a,i)=>{const n=e.resolveComponent("el-tooltip");return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columnList,o=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:o.key},[t.conf.table.column.show.list.includes(o.key)&&(o.show?.table===void 0||e.unref(l)(o.show?.table,t.conf.table.data))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[o.table?.header?.groupKey===void 0||o.table.header.show?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),e.mergeProps({key:0,prop:o.key,label:o.label},{ref_for:!0},o.table),{header:e.withCtx(()=>[e.renderSlot(a.$slots,"table-header-"+o.key,{item:o},()=>[e.createElementVNode("div",rt,[o.table?.header?.tooltip?(e.openBlock(),e.createBlock(n,{key:0,effect:"dark",placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("div",{innerHTML:o.table?.header?.tooltip},null,8,dt)]),default:e.withCtx(()=>[e.createElementVNode("span",it,[e.createVNode(Ze)])]),_:2},1024)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(o.label)+" ",1),o.table?.header?.group!==void 0?(e.openBlock(),e.createElementBlock("span",{key:1,class:"table-header-plus",onClick:e.withModifiers(()=>{o.table.header.group=!o.table.header.group,t.columnList.forEach(d=>{d.table?.header?.groupKey===o.key&&(d.table.header.show=!o.table.header.group)})},["stop"])},[o.table.header.group?(e.openBlock(),e.createBlock(tt,{key:0})):(e.openBlock(),e.createBlock(lt,{key:1}))],8,ct)):e.createCommentVNode("",!0)])])]),default:e.withCtx(({row:d})=>[o.children?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[i[0]||(i[0]=e.createTextVNode(" ",-1)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(r)),{conf:t.conf,columnList:o.children,option:t.option},e.createSlots({_:2},[e.renderList(a.$slots,(f,c)=>({name:c,fn:e.withCtx(s=>[e.renderSlot(a.$slots,c,e.mergeProps({ref_for:!0},s||{}))])}))]),1032,["conf","columnList","option"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.option.table?.editMode?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row",["table-edit-"+o.key]]),style:{width:"100%"}},[e.renderSlot(a.$slots,"table-edit-left-"+o.key,{row:d,item:o}),o.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:0,modelValue:d[o.key],"onUpdate:modelValue":f=>d[o.key]=f,disabled:t.conf.update.getDisabled(o,!0),class:"col"},{ref_for:!0},t.conf.update.getBind(o),e.toHandlers(t.conf.update.getOn(o,d))),e.createSlots({_:2},[o.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof o.options?.input?.prepend=="function"?o.options?.input?.prepend(d):o.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):o.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:1,modelValue:d[o.key],"onUpdate:modelValue":f=>d[o.key]=f,disabled:t.conf.update.getDisabled(o,!0),class:"col"},{ref_for:!0},t.conf.update.getBind(o),e.toHandlers(t.conf.update.getOn(o,d))),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.options?.search?.select?.data||o.options?.select?.data,f=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):o.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:2,modelValue:d[o.key],"onUpdate:modelValue":f=>d[o.key]=f,disabled:t.conf.update.getDisabled(o,!0),class:"col"},{ref_for:!0},t.conf.update.getBind(o),e.toHandlers(t.conf.update.getOn(o,d))),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"table-edit-right-"+o.key,{row:d,item:o})],2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.conf.update.type===e.unref(y).EDialog.Update&&e.unref(l)(o.show?.form,t.conf.update.form,e.unref(y).EDialog.Update)&&t.option.table?.inlineEdit&&t.conf.update.form[t.option.table?.rowKey]===d[t.option.table?.rowKey]&&(o.type==="input"||o.type==="select")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[o.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:0,modelValue:t.conf.update.form[o.key],"onUpdate:modelValue":f=>t.conf.update.form[o.key]=f,disabled:t.conf.update.getDisabled(o,!0)},{ref_for:!0},t.conf.update.getBind(o),e.toHandlers(t.conf.update.getOn(o,d)),{style:{width:"100%"}}),e.createSlots({_:2},[o.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof o.options?.input?.prepend=="function"?o.options?.input?.prepend(d):o.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):o.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:1,modelValue:t.conf.update.form[o.key],"onUpdate:modelValue":f=>t.conf.update.form[o.key]=f,disabled:t.conf.update.getDisabled(o,!0)},{ref_for:!0},t.conf.update.getBind(o),e.toHandlers(t.conf.update.getOn(o,d)),{style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.options?.search?.select?.data||o.options?.select?.data,f=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):o.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:2,modelValue:t.conf.update.form[o.key],"onUpdate:modelValue":f=>t.conf.update.form[o.key]=f},{ref_for:!0},t.conf.update.getBind(o),e.toHandlers(t.conf.update.getOn(o,d)),{disabled:t.conf.update.getDisabled(o,!0)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)],64)):e.renderSlot(a.$slots,"table-"+o.key,{key:1,row:d,item:o},()=>[e.unref(N).customComponent[o.type??""]?.table?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(N).customComponent[o.type??""]?.table),e.mergeProps({key:0,modelValue:d[o.key],"onUpdate:modelValue":f=>d[o.key]=f},{ref_for:!0},o.options?.[o.type??""],e.toHandlers(o.options?.[o.type??""]?.on||{})),null,16,["modelValue","onUpdate:modelValue"])):o.type==="switch"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[o.options?.switch?.tableConfig?.change?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:0,modelValue:d[o.key],"onUpdate:modelValue":f=>d[o.key]=f,loading:o.options?.switch?.loadingMap?.[d[t.option.table?.rowKey]]?.loading,"before-change":()=>o.options?.switch?.tableBeforeChange?.(o.key,d)},{ref_for:!0},o.options?.switch),null,16,["modelValue","onUpdate:modelValue","loading","before-change"])):(e.openBlock(),e.createElementBlock("span",st,e.toDisplayString(d[o.key]===o.options?.switch?.activeValue?o.options?.switch?.activeText:o.options?.switch?.inactiveText),1))],64)):(e.openBlock(),e.createElementBlock("span",{key:2,style:e.normalizeStyle({"--table-text-click-color":o.table?.click?.color}),class:e.normalizeClass({"table-text-click":o.table?.click?.callback}),onClick:f=>o.table?.click?.callback?.(d),innerHTML:o.table?.format?o.table?.format(d):d[o.key]},null,14,ft))])],64))],64))]),_:2},1040,["prop","label"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),128)}}}),pt={key:0,class:"relative curd-search fit-width"},gt={class:"mb-10 flex justify-between items-center fit-width"},ht={class:"flex items-center",style:{gap:"10px"}},ut={key:0},yt={key:1},bt={key:2},kt={class:"export-btn"},wt={key:1,class:"export-btn"},Ct={class:"flex items-center table-tools-right",style:{gap:"10px"}},Bt={class:"row justify-end mt-10 mb-10 table-bottom-pagination"},xt={class:"dialog-footer"},Vt={key:0},Et={key:1},St={class:"dialog-footer"},oe=e.defineComponent({__name:"index",props:{option:{default:{}},form:{default:void 0},searchForm:{default:void 0}},setup(t,{expose:l}){const r=y.EDialog,a=t,i=y.isFun,{conf:n,switchConfirmRef:o,ruleFormRef:d,tableRef:f}=$e(a);return l({conf:n}),(c,s)=>{const u=e.resolveComponent("el-tooltip"),m=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative cc1-form-box",[t.option.table?.fitHeight?"col":"no-min-height"]])},[e.createElementVNode("div",{class:e.normalizeClass(["row",[t.option.table?.fitHeight?"absolute fit":""]]),style:{overflow:"hidden"}},[e.renderSlot(c.$slots,"box-left"),e.createElementVNode("div",{class:e.normalizeClass(["column fit-width no-wrap",[t.option.table?.fitHeight?"col":""]])},[t.option.search?.show!==!1?(e.openBlock(),e.createElementBlock("div",pt,[e.createVNode(e.unref(g.ElForm),{model:e.unref(n).search.form,inline:"",size:t.option.size?.search},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"search-start",{row:e.unref(n).search.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(n).search.column.list,p=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:p.key},[e.renderSlot(c.$slots,"search-"+p.key+"-start",{row:e.unref(n).search.form}),(typeof p.show?.search=="function"?p.show?.search(e.unref(n).search.form):p.show?.search)?(e.openBlock(),e.createBlock(e.unref(g.ElFormItem),{key:0,label:p.text?.search?.label??p.label},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"search-"+p.key+"-left",{row:e.unref(n).search.form}),e.renderSlot(c.$slots,"search-"+p.key,{row:e.unref(n).search.form},()=>[p.options?.search?.type?(e.openBlock(),e.createBlock(te,{key:0,item:p,conf:e.unref(n),type:p.options.search.type},null,8,["item","conf","type"])):(e.openBlock(),e.createBlock(te,{key:1,item:p,conf:e.unref(n),type:p.type},null,8,["item","conf","type"]))]),e.renderSlot(c.$slots,"search-"+p.key+"-right",{row:e.unref(n).search.form})]),_:2},1032,["label"])):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"search-"+p.key+"-end",{row:e.unref(n).search.form})],64))),128)),e.renderSlot(c.$slots,"search-center",{row:e.unref(n).search.form}),t.option.tools?.search||t.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(g.ElFormItem),{key:0},{default:e.withCtx(()=>[t.option.tools?.search?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:0,type:"primary",onClick:e.unref(n).search.submit},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("search")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),t.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:1,onClick:e.unref(n).search.reset},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("reset")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"search-end",{row:e.unref(n).search.form})]),_:3},8,["model","size"])])):e.createCommentVNode("",!0),e.createElementVNode("div",gt,[e.createElementVNode("div",ht,[e.unref(i)(t.option.tools?.add)?(e.openBlock(),e.createElementBlock("div",ut,[e.createVNode(e.unref(g.ElButton),{type:"primary",onClick:s[0]||(s[0]=p=>e.unref(n).update.open(e.unref(r).Add)),size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("add")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),t.option.table?.selectable&&e.unref(i)(t.option.tools?.delete)?(e.openBlock(),e.createElementBlock("div",yt,[e.createVNode(e.unref(g.ElButton),{type:"danger",onClick:s[1]||(s[1]=p=>e.unref(n).remove.open(e.unref(n).table.selection.list)),size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("delete")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),t.option.tools?.expand?(e.openBlock(),e.createElementBlock("div",bt,[e.createVNode(e.unref(g.ElButton),{type:"warning",onClick:s[2]||(s[2]=p=>e.unref(n).table.expand.all()),size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("expandCollapse")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),t.option.tools?.export?.show?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[t.option.tools?.export?.dropdown?.show?(e.openBlock(),e.createBlock(e.unref(g.ElDropdown),{key:0,onCommand:e.unref(n).export.click},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(g.ElDropdownMenu),{size:t.option.size?.search},{default:e.withCtx(()=>[t.option.tools?.export?.dropdown?.select&&(t.option.table?.selectable||e.unref(i)(t.option.tools?.delete))?(e.openBlock(),e.createBlock(e.unref(g.ElDropdownItem),{key:0,command:"select"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("exportSelect")),1)]),_:1})):e.createCommentVNode("",!0),t.option.tools?.export?.dropdown?.page?(e.openBlock(),e.createBlock(e.unref(g.ElDropdownItem),{key:1,command:"page"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("exportPage")),1)]),_:1})):e.createCommentVNode("",!0),t.option.tools?.export?.dropdown?.all?(e.openBlock(),e.createBlock(e.unref(g.ElDropdownItem),{key:2,command:"all"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("exportAll")),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",kt,[e.createVNode(e.unref(g.ElButton),{type:"warning",loading:e.unref(n).export.loading,size:t.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("export")),1)]),_:1},8,["loading","size"])])]),_:1},8,["onCommand"])):(e.openBlock(),e.createElementBlock("div",wt,[e.createVNode(e.unref(g.ElButton),{type:"warning",loading:e.unref(n).export.loading,size:t.option.size?.search,onClick:s[3]||(s[3]=p=>e.unref(n).export.run.start("all"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("export")),1)]),_:1},8,["loading","size"])]))],64)):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"tools-left")]),e.createElementVNode("div",Ct,[e.renderSlot(c.$slots,"tools-right"),e.unref(n).page.showTools?(e.openBlock(),e.createBlock(e.unref(g.ElPagination),e.mergeProps({key:0,"current-page":e.unref(n).page.num,"onUpdate:currentPage":s[4]||(s[4]=p=>e.unref(n).page.num=p),"page-size":e.unref(n).page.size,"onUpdate:pageSize":s[5]||(s[5]=p=>e.unref(n).page.size=p),background:"","page-sizes":e.unref(n).page.sizeList,"pager-count":e.unref(n).page.pagerCount,layout:e.unref(n).page.layout,total:e.unref(n).page.total,size:t.option.size?.table,onSizeChange:e.unref(n).table.getList,onCurrentChange:e.unref(n).table.getList},t.option.page?.pagination||{},e.toHandlers(t.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0),t.option.tools?.expandColumn===void 0||t.option.tools?.expandColumn?(e.openBlock(),e.createBlock(u,{key:1,effect:"dark",content:e.unref(n).table.header.group.expand?e.unref(h).tCurd("mergeColumn"):e.unref(h).tCurd("expandColumn"),placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["refresh-btn",[t.option.size?.search]]),onClick:s[6]||(s[6]=(...p)=>e.unref(n).table.header.group.toggleExpandAll&&e.unref(n).table.header.group.toggleExpandAll(...p))},[e.unref(n).table.header.group.expand?(e.openBlock(),e.createBlock(He,{key:0})):(e.openBlock(),e.createBlock(Ge,{key:1}))],2)]),_:1},8,["content"])):e.createCommentVNode("",!0),t.option.tools?.refresh===void 0||t.option.tools?.refresh?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["refresh-btn",[t.option.size?.search]]),onClick:s[7]||(s[7]=(...p)=>e.unref(n).table.getList&&e.unref(n).table.getList(...p))},[e.createVNode(qe)],2)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:e.normalizeClass(["fit-width relative form-box",[t.option.table?.fitHeight?"col ":"",t.option.table?.editMode?"edit-mode":""]])},[e.createElementVNode("div",{class:e.normalizeClass(["column form-box-content",[t.option.table?.fitHeight?"absolute fit":""]])},[e.withDirectives((e.openBlock(),e.createBlock(e.unref(g.ElTable),e.mergeProps({ref_key:"tableRef",ref:f,data:e.unref(n).table.data,border:t.option.table?.border===void 0?!0:t.option.table?.border,onSelectionChange:e.unref(n).table.selection.change,onSortChange:e.unref(n).table.sort.change,"expand-row-keys":e.unref(n).table.expand.rowKeys,onExpandChange:e.unref(n).table.expand.change},t.option.table,e.toHandlers(t.option.table?.on||{})),{default:e.withCtx(()=>[(typeof t.option.table?.selectable=="object"?t.option.table?.selectable?.show:t.option.table?.selectable)||e.unref(i)(t.option.tools?.delete)||t.option.tools?.export?.show&&t.option.tools?.export?.select?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),e.mergeProps({key:0,type:"selection",width:"40",align:"center",fixed:"left","show-overflow-tooltip":!1,className:"cc1-form-selectable-column"},typeof t.option.table?.selectable=="object"?t.option.table?.selectable:{},e.toHandlers(typeof t.option.table?.selectable=="object"?t.option.table?.selectable?.on||{}:{})),null,16)):e.createCommentVNode("",!0),(typeof t.option.table?.index=="object"?t.option.table?.index?.show:t.option.table?.index)?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),e.mergeProps({key:1,type:"index",fixed:"left",width:"40",align:"center",label:"#","show-overflow-tooltip":!1,className:"cc1-form-index-column"},typeof t.option.table?.index=="object"?t.option.table?.index:{},e.toHandlers(typeof t.option.table?.index=="object"?t.option.table?.index?.on||{}:{})),null,16)):e.createCommentVNode("",!0),e.createVNode(mt,{conf:e.unref(n),columnList:e.unref(n).table.column.list,option:t.option},e.createSlots({_:2},[e.renderList(c.$slots,(p,E)=>({name:E,fn:e.withCtx(z=>[e.renderSlot(c.$slots,E,e.normalizeProps(e.guardReactiveProps(z||{})))])}))]),1032,["conf","columnList","option"]),e.unref(i)(t.option.table?.add)||e.unref(i)(t.option.table?.update)||e.unref(i)(t.option.table?.delete)||e.unref(i)(t.option.table?.view)||c.$slots["table-op-left"]||c.$slots["table-op-right"]?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),e.mergeProps({key:2,align:"center",fixed:"right"},t.option.table?.operate,{width:t.option.table?.operate?.width||120,"show-overflow-tooltip":!1}),{header:e.withCtx(()=>[e.renderSlot(c.$slots,"table-header-op",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("operation")),1)])]),default:e.withCtx(({row:p})=>[e.createVNode(e.unref(g.ElForm),{size:t.option.size?.table},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"table-op-left",{row:p}),e.unref(n).update.type===e.unref(r).Update&&t.option.table?.inlineEdit&&e.unref(n).update.form[a.option.table?.rowKey]===p[a.option.table?.rowKey]?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(g.ElButton),{link:"",type:"info",onClick:e.unref(n).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("cancel")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(g.ElButton),{link:"",type:"primary",onClick:e.unref(n).update.submit,loading:e.unref(n).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("confirm")),1)]),_:1},8,["onClick","loading"]),e.renderSlot(c.$slots,"table-op-edit-right",{row:p})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(i)(t.option.table?.add,p)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:0,link:"",type:"primary",onClick:E=>e.unref(n).update.open(e.unref(r).Add,p)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("add")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(i)(t.option.table?.view,p)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:1,link:"",type:"primary",onClick:E=>e.unref(n).update.open(e.unref(r).View,p)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("view")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(i)(t.option.table?.update,p)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:2,link:"",type:"warning",onClick:E=>e.unref(n).update.open(e.unref(r).Update,p)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("edit")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(i)(t.option.table?.delete,p)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:3,link:"",type:"danger",onClick:E=>e.unref(n).remove.open([p])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("delete")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"table-op-right",{row:p})],64))]),_:2},1032,["size"])]),_:3},16,["width"])):e.createCommentVNode("",!0)]),_:3},16,["data","border","onSelectionChange","onSortChange","expand-row-keys","onExpandChange"])),[[m,e.unref(n).table.loading]])],2)],2),e.createElementVNode("div",Bt,[(t.option.page?.show===void 0||t.option.page?.show)&&!e.unref(n).page.showTools?(e.openBlock(),e.createBlock(e.unref(g.ElPagination),e.mergeProps({key:0,"current-page":e.unref(n).page.num,"onUpdate:currentPage":s[8]||(s[8]=p=>e.unref(n).page.num=p),"page-size":e.unref(n).page.size,"onUpdate:pageSize":s[9]||(s[9]=p=>e.unref(n).page.size=p),background:"","page-sizes":e.unref(n).page.sizeList,"pager-count":e.unref(n).page.pagerCount,layout:e.unref(n).page.layout,total:e.unref(n).page.total,size:t.option.size?.table,onSizeChange:e.unref(n).table.getList,onCurrentChange:e.unref(n).table.getList},t.option.page?.pagination||{},e.toHandlers(t.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0)])],2),e.renderSlot(c.$slots,"box-right")],2),e.createVNode(e.unref(g.ElDialog),e.mergeProps({modelValue:e.unref(n).update.show,"onUpdate:modelValue":s[10]||(s[10]=p=>e.unref(n).update.show=p),title:e.unref(n).update.title,"before-close":e.unref(n).update.close},t.option.dialog),{footer:e.withCtx(()=>[e.createElementVNode("span",xt,[e.createVNode(e.unref(g.ElForm),{size:t.option.size?.form},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"dialog-footer",{row:e.unref(n).update},()=>[e.createVNode(e.unref(g.ElButton),{onClick:e.unref(n).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("close")),1)]),_:1},8,["onClick"]),e.unref(n).update.type!==e.unref(r).View?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:0,type:"primary",onClick:e.unref(n).update.submit,loading:e.unref(n).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("submit")),1)]),_:1},8,["onClick","loading"])):e.createCommentVNode("",!0)])]),_:3},8,["size"])])]),default:e.withCtx(()=>[e.renderSlot(c.$slots,"dialog-start",{row:e.unref(n).update}),e.createVNode(e.unref(g.ElForm),{ref_key:"ruleFormRef",ref:d,model:e.unref(n).update.form,rules:e.unref(n).update.rules,size:t.option.size?.form,class:"update-dialog-form"},{default:e.withCtx(()=>[e.unref(n).update.showContent?(e.openBlock(),e.createBlock(_,{key:0,"form-grid":e.unref(n).update.formGrid,"max-span":e.unref(n).update.formMaxSpan,form:e.unref(n).update.form,type:e.unref(n).update.type,stripe:t.option.form?.stripe,"label-width":t.option.form?.labelWidth,"form-option":t.option.form,"get-bind":e.unref(n).update.getBind,"get-on":e.unref(n).update.getOn,"get-disabled":e.unref(n).update.getDisabled},e.createSlots({_:2},[e.renderList(c.$slots,(p,E)=>({name:E,fn:e.withCtx(z=>[e.renderSlot(c.$slots,E,e.normalizeProps(e.guardReactiveProps(z||{})))])}))]),1032,["form-grid","max-span","form","type","stripe","label-width","form-option","get-bind","get-on","get-disabled"])):e.createCommentVNode("",!0)]),_:3},8,["model","rules","size"]),e.renderSlot(c.$slots,"dialog-end",{row:e.unref(n).update})]),_:3},16,["modelValue","title","before-close"]),e.createVNode(e.unref(g.ElDialog),{modelValue:e.unref(n).remove.show,"onUpdate:modelValue":s[11]||(s[11]=p=>e.unref(n).remove.show=p),title:e.unref(n).remove.title,"close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createElementVNode("span",St,[e.createVNode(e.unref(g.ElForm),{size:t.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(g.ElButton),{onClick:e.unref(n).remove.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("close")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(g.ElButton),{type:"danger",onClick:e.unref(n).remove.submit,loading:e.unref(n).remove.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("confirmDelete")),1)]),_:1},8,["onClick","loading"])]),_:1},8,["size"])])]),default:e.withCtx(()=>[t.option.dialog?.delete?.content?(e.openBlock(),e.createElementBlock("div",Vt,[e.createVNode(Ue,{content:t.option.dialog?.delete?.content,value:e.unref(n).remove.items},null,8,["content","value"])])):(e.openBlock(),e.createElementBlock("div",Et,e.toDisplayString(e.unref(h).tCurd("confirmDeleteMessage",e.unref(n).remove.items.length)),1))]),_:1},8,["modelValue","title"]),e.createVNode(Me,{ref_key:"switchConfirmRef",ref:o,size:t.option.size?.form},null,8,["size"])],2)}}});class Nt{static async download(l,r="download.png"){const a=document.createElement("a");a.style.display="none",a.href=l,a.setAttribute("download",r),typeof a.download>"u"&&a.setAttribute("target","_blank"),document.body.appendChild(a),a.click(),document.body.removeChild(a),window.URL.revokeObjectURL(l)}static exportJSONFile=(l,r)=>{const a=new Blob([JSON.stringify(l)],{type:"application/json"}),i=URL.createObjectURL(a),n=document.createElement("a");n.href=i,n.download=`${r||"config"}.json`,n.click()};static importFile=async l=>new Promise((r,a)=>{const i=document.createElement("input");i.type="file";const n=l?.accept||".json";i.accept=n,i.style.display="none",i.onchange=o=>{const d=o.target.files[0];if(!d){y.fail("未选择文件"),a("未选择文件");return}const f=new FileReader;f.onload=async c=>{const s=n==".json"?JSON.parse(c.target.result):c.target.result;r(s)},f.onerror=()=>{y.fail("文件读取失败"),a("文件读取失败")},f.readAsText(d),document.body.removeChild(i)},document.body.appendChild(i),i.click()})}const ne=(t,l)=>{if(t.component("TCurd",oe),t.component("TFormList",j),t.component("TColumn",v),l?.customComponent){N.customComponent=l.customComponent;for(const r in l.customComponent)t.component(r,l.customComponent[r])}},Dt={install:ne};C.ArrUtil=F,C.ExcelUtil=ee,C.TColumn=v,C.TCurd=oe,C.TFile=Nt,C.TForm=N,C.TFormConfig=w,C.TFormI18n=h,C.TFormList=j,C.TObj=$,C.TSys=y,C.default=Dt,C.install=ne,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
@@ -899,6 +899,8 @@ declare const __VLS_self: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
899
899
|
labelWidth?: string;
|
|
900
900
|
stripe?: boolean;
|
|
901
901
|
layout?: "row" | "column";
|
|
902
|
+
initStart?: (conf: any) => any;
|
|
903
|
+
initEnd?: (conf: any) => any;
|
|
902
904
|
};
|
|
903
905
|
column: CurdConfigColumn[];
|
|
904
906
|
};
|
|
@@ -923,6 +925,8 @@ declare const __VLS_self: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
923
925
|
labelWidth?: string;
|
|
924
926
|
stripe?: boolean;
|
|
925
927
|
layout?: "row" | "column";
|
|
928
|
+
initStart?: (conf: any) => any;
|
|
929
|
+
initEnd?: (conf: any) => any;
|
|
926
930
|
};
|
|
927
931
|
column: CurdConfigColumn[];
|
|
928
932
|
};
|
|
@@ -943,6 +947,8 @@ declare const __VLS_self: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
943
947
|
labelWidth?: string;
|
|
944
948
|
stripe?: boolean;
|
|
945
949
|
layout?: "row" | "column";
|
|
950
|
+
initStart?: (conf: any) => any;
|
|
951
|
+
initEnd?: (conf: any) => any;
|
|
946
952
|
};
|
|
947
953
|
column: CurdConfigColumn[];
|
|
948
954
|
};
|
|
@@ -956,6 +962,8 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
956
962
|
labelWidth?: string;
|
|
957
963
|
stripe?: boolean;
|
|
958
964
|
layout?: "row" | "column";
|
|
965
|
+
initStart?: (conf: any) => any;
|
|
966
|
+
initEnd?: (conf: any) => any;
|
|
959
967
|
};
|
|
960
968
|
column: CurdConfigColumn[];
|
|
961
969
|
};
|
|
@@ -1850,6 +1858,8 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
1850
1858
|
labelWidth?: string;
|
|
1851
1859
|
stripe?: boolean;
|
|
1852
1860
|
layout?: "row" | "column";
|
|
1861
|
+
initStart?: (conf: any) => any;
|
|
1862
|
+
initEnd?: (conf: any) => any;
|
|
1853
1863
|
};
|
|
1854
1864
|
column: CurdConfigColumn[];
|
|
1855
1865
|
};
|
|
@@ -1870,6 +1880,8 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
1870
1880
|
labelWidth?: string;
|
|
1871
1881
|
stripe?: boolean;
|
|
1872
1882
|
layout?: "row" | "column";
|
|
1883
|
+
initStart?: (conf: any) => any;
|
|
1884
|
+
initEnd?: (conf: any) => any;
|
|
1873
1885
|
};
|
|
1874
1886
|
column: CurdConfigColumn[];
|
|
1875
1887
|
};
|
|
@@ -41,9 +41,10 @@ export declare const createUpdateModule: (getConf: CurdConfGetter, props: CurdPr
|
|
|
41
41
|
getApiData: (form: any) => any;
|
|
42
42
|
};
|
|
43
43
|
view: {};
|
|
44
|
-
|
|
44
|
+
openLoading: boolean;
|
|
45
|
+
open: (type: keyof typeof EDialog, item?: any) => Promise<void>;
|
|
45
46
|
validate: () => Promise<true | undefined>;
|
|
46
|
-
submit: () => void
|
|
47
|
+
submit: () => Promise<void>;
|
|
47
48
|
close: () => void;
|
|
48
49
|
};
|
|
49
50
|
};
|
|
@@ -901,9 +901,10 @@ export declare const curdConf: (props: CurdProps) => {
|
|
|
901
901
|
getApiData: (form: any) => any;
|
|
902
902
|
};
|
|
903
903
|
view: {};
|
|
904
|
-
|
|
904
|
+
openLoading: boolean;
|
|
905
|
+
open: (type: "Add" | "Update" | "View" | "Remove", item?: any) => Promise<void>;
|
|
905
906
|
validate: () => Promise<true | undefined>;
|
|
906
|
-
submit: () => void
|
|
907
|
+
submit: () => Promise<void>;
|
|
907
908
|
close: () => void;
|
|
908
909
|
};
|
|
909
910
|
export: {
|
|
@@ -917,9 +917,10 @@ declare const conf: {
|
|
|
917
917
|
getApiData: (form: any) => any;
|
|
918
918
|
};
|
|
919
919
|
view: {};
|
|
920
|
-
|
|
920
|
+
openLoading: boolean;
|
|
921
|
+
open: (type: "Add" | "Update" | "View" | "Remove", item?: any) => Promise<void>;
|
|
921
922
|
validate: () => Promise<true | undefined>;
|
|
922
|
-
submit: () => void
|
|
923
|
+
submit: () => Promise<void>;
|
|
923
924
|
close: () => void;
|
|
924
925
|
};
|
|
925
926
|
export: {
|
|
@@ -3708,9 +3709,10 @@ declare var __VLS_1: {}, __VLS_7: {
|
|
|
3708
3709
|
getApiData: (form: any) => any;
|
|
3709
3710
|
};
|
|
3710
3711
|
view: {};
|
|
3711
|
-
|
|
3712
|
+
openLoading: boolean;
|
|
3713
|
+
open: (type: "Add" | "Update" | "View" | "Remove", item?: any) => Promise<void>;
|
|
3712
3714
|
validate: () => Promise<true | undefined>;
|
|
3713
|
-
submit: () => void
|
|
3715
|
+
submit: () => Promise<void>;
|
|
3714
3716
|
close: () => void;
|
|
3715
3717
|
};
|
|
3716
3718
|
}, __VLS_267: string | number, __VLS_268: {
|
|
@@ -4600,9 +4602,10 @@ declare var __VLS_1: {}, __VLS_7: {
|
|
|
4600
4602
|
getApiData: (form: any) => any;
|
|
4601
4603
|
};
|
|
4602
4604
|
view: {};
|
|
4603
|
-
|
|
4605
|
+
openLoading: boolean;
|
|
4606
|
+
open: (type: "Add" | "Update" | "View" | "Remove", item?: any) => Promise<void>;
|
|
4604
4607
|
validate: () => Promise<true | undefined>;
|
|
4605
|
-
submit: () => void
|
|
4608
|
+
submit: () => Promise<void>;
|
|
4606
4609
|
close: () => void;
|
|
4607
4610
|
};
|
|
4608
4611
|
}, __VLS_276: {
|
|
@@ -5489,9 +5492,10 @@ declare var __VLS_1: {}, __VLS_7: {
|
|
|
5489
5492
|
getApiData: (form: any) => any;
|
|
5490
5493
|
};
|
|
5491
5494
|
view: {};
|
|
5492
|
-
|
|
5495
|
+
openLoading: boolean;
|
|
5496
|
+
open: (type: "Add" | "Update" | "View" | "Remove", item?: any) => Promise<void>;
|
|
5493
5497
|
validate: () => Promise<true | undefined>;
|
|
5494
|
-
submit: () => void
|
|
5498
|
+
submit: () => Promise<void>;
|
|
5495
5499
|
close: () => void;
|
|
5496
5500
|
};
|
|
5497
5501
|
};
|
|
@@ -6527,9 +6531,10 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
6527
6531
|
getApiData: (form: any) => any;
|
|
6528
6532
|
};
|
|
6529
6533
|
view: {};
|
|
6530
|
-
|
|
6534
|
+
openLoading: boolean;
|
|
6535
|
+
open: (type: "Add" | "Update" | "View" | "Remove", item?: any) => Promise<void>;
|
|
6531
6536
|
validate: () => Promise<true | undefined>;
|
|
6532
|
-
submit: () => void
|
|
6537
|
+
submit: () => Promise<void>;
|
|
6533
6538
|
close: () => void;
|
|
6534
6539
|
};
|
|
6535
6540
|
export: {
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import TFormConfig from './utils/TFormConfig';
|
|
|
12
12
|
import TFormI18n from './utils/TFormI18n';
|
|
13
13
|
import TSys from './utils/TSys';
|
|
14
14
|
import TFile from './utils/TFile';
|
|
15
|
+
import TObj from './utils/TObj';
|
|
15
16
|
/**
|
|
16
17
|
* 安装 cc1-form 插件,注册全局组件 `TCurd`、`TFormList`、`TColumn`
|
|
17
18
|
*
|
|
@@ -46,7 +47,7 @@ export declare const install: (app: App, options?: {
|
|
|
46
47
|
[key: string]: any;
|
|
47
48
|
};
|
|
48
49
|
}) => void;
|
|
49
|
-
export { ArrUtil, ExcelUtil, TColumn, TCurd, TForm, TFormList, TFormI18n, TSys, TFile, TFormConfig, type CurdConfig, type CurdConfigColumn, type CurdOption, type curdConfType };
|
|
50
|
+
export { ArrUtil, ExcelUtil, TColumn, TCurd, TForm, TFormList, TFormI18n, TSys, TFile, TFormConfig, type CurdConfig, type CurdConfigColumn, type CurdOption, type curdConfType, TObj };
|
|
50
51
|
declare const _default: {
|
|
51
52
|
install: (app: App, options?: {
|
|
52
53
|
/**
|