cc1-form 1.2.10 → 1.2.11
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 +140 -136
- package/dist/cc1-form.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/cc1-form.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ElMessage as ce, ElLoading as me, ElForm as W, ElFormItem as ee, ElInput as x, ElSwitch as Z, ElSelect as q, ElOption as
|
|
1
|
+
import { ElMessage as ce, ElLoading as me, ElForm as W, ElFormItem as ee, ElInput as x, ElSwitch as Z, ElSelect as q, ElOption as K, ElRadioGroup as le, ElRadio as ne, ElTreeSelect as ue, ElDatePicker as ie, ElDialog as oe, ElButton as L, ElTableColumn as ae, ElDropdown as he, ElDropdownMenu as ge, ElDropdownItem as te, ElPagination as de, ElTable as ye } from "element-plus";
|
|
2
2
|
import "vue-router";
|
|
3
|
-
import { defineComponent as G, reactive as re, onMounted as fe, resolveComponent as _, createElementBlock as b, createCommentVNode as v, openBlock as f, renderSlot as C, createVNode as
|
|
3
|
+
import { defineComponent as G, reactive as re, onMounted as fe, resolveComponent as _, createElementBlock as b, createCommentVNode as v, openBlock as f, renderSlot as C, createVNode as E, withCtx as y, createTextVNode as U, Fragment as $, renderList as F, createBlock as g, normalizeClass as I, normalizeStyle as pe, ref as N, unref as o, createElementVNode as D, mergeProps as V, toHandlers as z, resolveDynamicComponent as Q, nextTick as be, toDisplayString as O, getCurrentInstance as we, createSlots as J, withModifiers as ke, resolveDirective as ve, withDirectives as Ce, normalizeProps as Ve, guardReactiveProps as ze } from "vue";
|
|
4
4
|
class M {
|
|
5
5
|
/**
|
|
6
6
|
* Vue Router 实例,需在应用初始化时赋值
|
|
@@ -515,7 +515,7 @@ class A {
|
|
|
515
515
|
A.config = ObjectUtil.deepMerge(A.config, a);
|
|
516
516
|
};
|
|
517
517
|
}
|
|
518
|
-
class
|
|
518
|
+
class B {
|
|
519
519
|
/**
|
|
520
520
|
* 自定义组件映射表,key 为组件名(同时作为 column.type 值),value 为 Vue 组件定义
|
|
521
521
|
*
|
|
@@ -555,7 +555,7 @@ class L {
|
|
|
555
555
|
)
|
|
556
556
|
*/
|
|
557
557
|
static setOptionsData = (a, p, s) => {
|
|
558
|
-
const l =
|
|
558
|
+
const l = B.findOptions(a, p);
|
|
559
559
|
l && (l.data = s);
|
|
560
560
|
};
|
|
561
561
|
static form = {
|
|
@@ -569,7 +569,7 @@ class L {
|
|
|
569
569
|
*/
|
|
570
570
|
parentId: (a, p, s, l) => {
|
|
571
571
|
const t = A.config.table.rowKey;
|
|
572
|
-
a ? p.type === M.EDialog.Add ? (p.form.parentId = a[t], p.form.sort = a.children.length + 1) : p.form.parentId = a.parentId.substring(a.parentId.lastIndexOf(",") + 1) : (p.form.parentId = "0", p.form.sort = s.length + 1),
|
|
572
|
+
a ? p.type === M.EDialog.Add ? (p.form.parentId = a[t], p.form.sort = a.children.length + 1) : p.form.parentId = a.parentId.substring(a.parentId.lastIndexOf(",") + 1) : (p.form.parentId = "0", p.form.sort = s.length + 1), B.setOptionsData(l, "parentId", [{ [t]: "0", title: "根", children: s }]);
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
575
|
};
|
|
@@ -628,7 +628,7 @@ class w {
|
|
|
628
628
|
/** curd表单 */
|
|
629
629
|
static curd = $e;
|
|
630
630
|
}
|
|
631
|
-
class
|
|
631
|
+
class H {
|
|
632
632
|
/**
|
|
633
633
|
* ID 生成函数,默认使用 `StrUtil.uuid()`,可覆盖为自定义实现
|
|
634
634
|
*/
|
|
@@ -645,7 +645,7 @@ class K {
|
|
|
645
645
|
s.forEach((e) => {
|
|
646
646
|
let r = e.default ?? "";
|
|
647
647
|
e.type === "number" && (r = e.default ?? 0), e.type === "boolean" && (r = e.default ?? !1), e.type === "time" && (r = e.default ?? /* @__PURE__ */ new Date()), t[e.value] === void 0 && (t[e.value] = r);
|
|
648
|
-
}), t[l] || (t[l] =
|
|
648
|
+
}), t[l] || (t[l] = H.getIdFun());
|
|
649
649
|
});
|
|
650
650
|
};
|
|
651
651
|
/**
|
|
@@ -657,7 +657,7 @@ class K {
|
|
|
657
657
|
*/
|
|
658
658
|
static add = (a, p, s, l) => {
|
|
659
659
|
const t = JSONUtil.cp(s);
|
|
660
|
-
|
|
660
|
+
H.setId(a, p, s);
|
|
661
661
|
const e = A.config.table.rowKey;
|
|
662
662
|
p[a].push(
|
|
663
663
|
t.reduce(
|
|
@@ -665,7 +665,7 @@ class K {
|
|
|
665
665
|
let m = d.default ?? "";
|
|
666
666
|
return d.type === "number" && (m = d.default ?? 0), d.type === "boolean" && (m = d.default ?? !1), d.type === "time" && (m = d.default ?? /* @__PURE__ */ new Date()), r[d.value] = m, r;
|
|
667
667
|
},
|
|
668
|
-
{ [e]:
|
|
668
|
+
{ [e]: H.getIdFun() }
|
|
669
669
|
)
|
|
670
670
|
), l?.(p);
|
|
671
671
|
};
|
|
@@ -689,7 +689,7 @@ class K {
|
|
|
689
689
|
static getNoIdData = (a, p) => {
|
|
690
690
|
const s = JSONUtil.cp(a), l = A.config.table.rowKey;
|
|
691
691
|
return s.forEach((t) => {
|
|
692
|
-
t[l] && delete t[l], p && t[p] &&
|
|
692
|
+
t[l] && delete t[l], p && t[p] && H.getNoIdData(t[p], p);
|
|
693
693
|
}), s;
|
|
694
694
|
};
|
|
695
695
|
}
|
|
@@ -742,18 +742,18 @@ const Ue = {
|
|
|
742
742
|
const p = i, s = re({
|
|
743
743
|
show: !1,
|
|
744
744
|
add: (t, e, r) => {
|
|
745
|
-
|
|
745
|
+
H.add(t, e, r, () => {
|
|
746
746
|
l("change");
|
|
747
747
|
});
|
|
748
748
|
},
|
|
749
749
|
remove: (t, e, r) => {
|
|
750
|
-
|
|
750
|
+
H.remove(t, e, r, () => {
|
|
751
751
|
l("change");
|
|
752
752
|
});
|
|
753
753
|
}
|
|
754
754
|
});
|
|
755
755
|
fe(() => {
|
|
756
|
-
|
|
756
|
+
H.setId(p.field, p.row, p.itemFields), s.show = !0;
|
|
757
757
|
});
|
|
758
758
|
const l = a;
|
|
759
759
|
return (t, e) => {
|
|
@@ -761,7 +761,7 @@ const Ue = {
|
|
|
761
761
|
return s.show ? (f(), b("div", Ue, [
|
|
762
762
|
C(t.$slots, "list-start", { row: i.row }),
|
|
763
763
|
i.addBottom ? v("", !0) : (f(), b("div", De, [
|
|
764
|
-
|
|
764
|
+
E(r, {
|
|
765
765
|
link: "",
|
|
766
766
|
type: "primary",
|
|
767
767
|
onClick: e[0] || (e[0] = (m) => s.add(i.field, i.row, i.itemFields))
|
|
@@ -789,7 +789,7 @@ const Ue = {
|
|
|
789
789
|
item: m,
|
|
790
790
|
row: i.row
|
|
791
791
|
}),
|
|
792
|
-
|
|
792
|
+
E(r, {
|
|
793
793
|
link: "",
|
|
794
794
|
type: "danger",
|
|
795
795
|
onClick: (c) => s.remove(i.field, i.row, m)
|
|
@@ -801,7 +801,7 @@ const Ue = {
|
|
|
801
801
|
}, 1032, ["onClick"])
|
|
802
802
|
]))), 256)),
|
|
803
803
|
i.addBottom ? (f(), b("div", Oe, [
|
|
804
|
-
|
|
804
|
+
E(r, {
|
|
805
805
|
link: "",
|
|
806
806
|
type: "primary",
|
|
807
807
|
onClick: e[2] || (e[2] = (m) => s.add(i.field, i.row, i.itemFields))
|
|
@@ -921,19 +921,19 @@ const Ue = {
|
|
|
921
921
|
key: 0,
|
|
922
922
|
class: I([u.item.form.span > 0 ? `col-${e.getColumnSpan(u, m)}` : "col", `form-item-col-${u.item.key}`])
|
|
923
923
|
}, [
|
|
924
|
-
|
|
924
|
+
E(o(ee), {
|
|
925
925
|
label: u.item.text?.form?.label ?? u.item.label,
|
|
926
926
|
prop: u.item.key,
|
|
927
927
|
"label-width": u.item.text?.form?.label == "" ? 0 : u.item.form?.labelWidth || i.option.form?.labelWidth || "100px"
|
|
928
928
|
}, {
|
|
929
929
|
default: y(() => [
|
|
930
|
-
|
|
930
|
+
D("div", Se, [
|
|
931
931
|
C(r.$slots, "form-" + u.item.key + "-start", {
|
|
932
932
|
row: e.form,
|
|
933
933
|
item: u.item
|
|
934
934
|
}),
|
|
935
|
-
|
|
936
|
-
|
|
935
|
+
D("div", Me, [
|
|
936
|
+
D("div", Ae, [
|
|
937
937
|
C(r.$slots, "form-" + u.item.key, {
|
|
938
938
|
row: e.form,
|
|
939
939
|
item: u.item
|
|
@@ -962,7 +962,7 @@ const Ue = {
|
|
|
962
962
|
style: { width: "100%" }
|
|
963
963
|
}), {
|
|
964
964
|
default: y(() => [
|
|
965
|
-
(f(!0), b($, null, F(u.item.options?.select?.data, (k) => (f(), g(o(
|
|
965
|
+
(f(!0), b($, null, F(u.item.options?.select?.data, (k) => (f(), g(o(K), {
|
|
966
966
|
key: k.value,
|
|
967
967
|
label: k.label,
|
|
968
968
|
value: k.value
|
|
@@ -1009,7 +1009,7 @@ const Ue = {
|
|
|
1009
1009
|
ref_for: !0
|
|
1010
1010
|
}, e.getBind(u.item), z(e.getOn(u.item)), {
|
|
1011
1011
|
disabled: e.getDisabled(u.item)
|
|
1012
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type && (o(
|
|
1012
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type && (o(B).customComponent[u.item.type] || o(B).customComponent[u.item.type]?.form) ? (f(), g(Q(o(B).customComponent[u.item.type]?.form || o(B).customComponent[u.item.type]), V({
|
|
1013
1013
|
key: 7,
|
|
1014
1014
|
modelValue: e.form[u.item.key],
|
|
1015
1015
|
"onUpdate:modelValue": (k) => e.form[u.item.key] = k,
|
|
@@ -1054,7 +1054,7 @@ const Ue = {
|
|
|
1054
1054
|
}, 8, ["model", "rules"]));
|
|
1055
1055
|
}
|
|
1056
1056
|
});
|
|
1057
|
-
class
|
|
1057
|
+
class Le {
|
|
1058
1058
|
/**
|
|
1059
1059
|
* 导出数据为 Excel 文件(.xlsx),自动触发浏览器下载
|
|
1060
1060
|
*
|
|
@@ -1073,7 +1073,7 @@ class Be {
|
|
|
1073
1073
|
l.utils.book_append_sheet(r, e, "Sheet1"), s ? typeof s == "function" && (s = s()) : s = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, l.writeFile(r, `${s}.xlsx`);
|
|
1074
1074
|
};
|
|
1075
1075
|
}
|
|
1076
|
-
const P = M.EDialog,
|
|
1076
|
+
const P = M.EDialog, Be = (i) => {
|
|
1077
1077
|
const a = N(), p = N(), s = N(), l = re({
|
|
1078
1078
|
option: i.option,
|
|
1079
1079
|
/** 查询区域相关配置对象 */
|
|
@@ -1303,7 +1303,7 @@ const P = M.EDialog, Le = (i) => {
|
|
|
1303
1303
|
},
|
|
1304
1304
|
{}
|
|
1305
1305
|
), m = i.option.tools?.export || {};
|
|
1306
|
-
m.before && m.before(d),
|
|
1306
|
+
m.before && m.before(d), Le.exportToExcel(d.data, d.columns, m.fileName);
|
|
1307
1307
|
},
|
|
1308
1308
|
/** 获取当前选中项进行导出 */
|
|
1309
1309
|
select: async () => {
|
|
@@ -1733,16 +1733,16 @@ const P = M.EDialog, Le = (i) => {
|
|
|
1733
1733
|
width: "400px"
|
|
1734
1734
|
}, {
|
|
1735
1735
|
footer: y(() => [
|
|
1736
|
-
|
|
1736
|
+
E(k, { size: c.size }, {
|
|
1737
1737
|
default: y(() => [
|
|
1738
|
-
|
|
1739
|
-
|
|
1738
|
+
D("span", je, [
|
|
1739
|
+
E(o(L), { onClick: m }, {
|
|
1740
1740
|
default: y(() => u[1] || (u[1] = [
|
|
1741
1741
|
U("取消")
|
|
1742
1742
|
])),
|
|
1743
1743
|
_: 1
|
|
1744
1744
|
}),
|
|
1745
|
-
|
|
1745
|
+
E(o(L), {
|
|
1746
1746
|
type: "primary",
|
|
1747
1747
|
onClick: d
|
|
1748
1748
|
}, {
|
|
@@ -1757,7 +1757,7 @@ const P = M.EDialog, Le = (i) => {
|
|
|
1757
1757
|
}, 8, ["size"])
|
|
1758
1758
|
]),
|
|
1759
1759
|
default: y(() => [
|
|
1760
|
-
|
|
1760
|
+
D("div", null, O(l.value), 1)
|
|
1761
1761
|
]),
|
|
1762
1762
|
_: 1
|
|
1763
1763
|
}, 8, ["modelValue", "title"]);
|
|
@@ -1772,22 +1772,22 @@ const P = M.EDialog, Le = (i) => {
|
|
|
1772
1772
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1773
1773
|
viewBox: "0 0 1024 1024"
|
|
1774
1774
|
};
|
|
1775
|
-
function
|
|
1775
|
+
function He(i, a) {
|
|
1776
1776
|
return f(), b("svg", Pe, a[0] || (a[0] = [
|
|
1777
|
-
|
|
1777
|
+
D("path", {
|
|
1778
1778
|
fill: "currentColor",
|
|
1779
1779
|
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"
|
|
1780
1780
|
}, null, -1)
|
|
1781
1781
|
]));
|
|
1782
1782
|
}
|
|
1783
|
-
const
|
|
1783
|
+
const Ke = /* @__PURE__ */ X(Ie, [["render", He]]), Ne = {}, We = {
|
|
1784
1784
|
"data-v-58697b5c": "",
|
|
1785
1785
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1786
1786
|
viewBox: "0 0 1024 1024"
|
|
1787
1787
|
};
|
|
1788
1788
|
function Je(i, a) {
|
|
1789
1789
|
return f(), b("svg", We, a[0] || (a[0] = [
|
|
1790
|
-
|
|
1790
|
+
D("path", {
|
|
1791
1791
|
fill: "currentColor",
|
|
1792
1792
|
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"
|
|
1793
1793
|
}, null, -1)
|
|
@@ -1800,7 +1800,7 @@ const qe = /* @__PURE__ */ X(Ne, [["render", Je]]), Qe = {}, Ge = {
|
|
|
1800
1800
|
};
|
|
1801
1801
|
function Xe(i, a) {
|
|
1802
1802
|
return f(), b("svg", Ge, a[0] || (a[0] = [
|
|
1803
|
-
|
|
1803
|
+
D("path", {
|
|
1804
1804
|
fill: "currentColor",
|
|
1805
1805
|
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"
|
|
1806
1806
|
}, null, -1)
|
|
@@ -1813,13 +1813,13 @@ const Ye = /* @__PURE__ */ X(Qe, [["render", Xe]]), Ze = {}, xe = {
|
|
|
1813
1813
|
};
|
|
1814
1814
|
function _e(i, a) {
|
|
1815
1815
|
return f(), b("svg", xe, a[0] || (a[0] = [
|
|
1816
|
-
|
|
1816
|
+
D("path", {
|
|
1817
1817
|
fill: "currentColor",
|
|
1818
1818
|
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"
|
|
1819
1819
|
}, null, -1)
|
|
1820
1820
|
]));
|
|
1821
1821
|
}
|
|
1822
|
-
const et = /* @__PURE__ */ X(Ze, [["render", _e]]), tt = { class: "row flex-center table-header-label inline" }, ot = { class: "table-header-tooltip" }, at = ["
|
|
1822
|
+
const et = /* @__PURE__ */ X(Ze, [["render", _e]]), tt = { class: "row flex-center table-header-label inline" }, ot = { class: "table-header-tooltip" }, at = ["innerHTML"], lt = ["onClick"], nt = { key: 1 }, it = ["onClick", "innerHTML"], rt = /* @__PURE__ */ G({
|
|
1823
1823
|
__name: "tableColumn",
|
|
1824
1824
|
props: {
|
|
1825
1825
|
conf: {},
|
|
@@ -1842,20 +1842,24 @@ const et = /* @__PURE__ */ X(Ze, [["render", _e]]), tt = { class: "row flex-cent
|
|
|
1842
1842
|
}, e.table), {
|
|
1843
1843
|
header: y(() => [
|
|
1844
1844
|
C(s.$slots, "table-header-" + e.key, { item: e }, () => [
|
|
1845
|
-
|
|
1845
|
+
D("div", tt, [
|
|
1846
1846
|
e.table?.header?.tooltip ? (f(), g(t, {
|
|
1847
1847
|
key: 0,
|
|
1848
1848
|
effect: "dark",
|
|
1849
|
-
content: e.table?.header?.tooltip,
|
|
1850
1849
|
placement: "top"
|
|
1851
1850
|
}, {
|
|
1851
|
+
content: y(() => [
|
|
1852
|
+
D("div", {
|
|
1853
|
+
innerHTML: e.table?.header?.tooltip
|
|
1854
|
+
}, null, 8, at)
|
|
1855
|
+
]),
|
|
1852
1856
|
default: y(() => [
|
|
1853
|
-
|
|
1854
|
-
|
|
1857
|
+
D("span", ot, [
|
|
1858
|
+
E(qe)
|
|
1855
1859
|
])
|
|
1856
1860
|
]),
|
|
1857
1861
|
_: 2
|
|
1858
|
-
},
|
|
1862
|
+
}, 1024)) : v("", !0),
|
|
1859
1863
|
U(" " + O(e.label) + " ", 1),
|
|
1860
1864
|
e.table?.header?.group !== void 0 ? (f(), b("span", {
|
|
1861
1865
|
key: 1,
|
|
@@ -1870,7 +1874,7 @@ const et = /* @__PURE__ */ X(Ze, [["render", _e]]), tt = { class: "row flex-cent
|
|
|
1870
1874
|
)
|
|
1871
1875
|
}, [
|
|
1872
1876
|
e.table.header.group ? (f(), g(Ye, { key: 0 })) : (f(), g(et, { key: 1 }))
|
|
1873
|
-
], 8,
|
|
1877
|
+
], 8, lt)) : v("", !0)
|
|
1874
1878
|
])
|
|
1875
1879
|
])
|
|
1876
1880
|
]),
|
|
@@ -1923,7 +1927,7 @@ const et = /* @__PURE__ */ X(Ze, [["render", _e]]), tt = { class: "row flex-cent
|
|
|
1923
1927
|
ref_for: !0
|
|
1924
1928
|
}, s.conf.update.getBind(e), z(s.conf.update.getOn(e, r))), {
|
|
1925
1929
|
default: y(() => [
|
|
1926
|
-
(f(!0), b($, null, F(e.options?.search?.select?.data || e.options?.select?.data, (d) => (f(), g(o(
|
|
1930
|
+
(f(!0), b($, null, F(e.options?.search?.select?.data || e.options?.select?.data, (d) => (f(), g(o(K), {
|
|
1927
1931
|
key: d.value,
|
|
1928
1932
|
label: d.label,
|
|
1929
1933
|
value: d.value
|
|
@@ -1966,7 +1970,7 @@ const et = /* @__PURE__ */ X(Ze, [["render", _e]]), tt = { class: "row flex-cent
|
|
|
1966
1970
|
ref_for: !0
|
|
1967
1971
|
}, s.conf.update.getBind(e), z(s.conf.update.getOn(e, r)), { style: { width: "100%" } }), {
|
|
1968
1972
|
default: y(() => [
|
|
1969
|
-
(f(!0), b($, null, F(e.options?.search?.select?.data || e.options?.select?.data, (d) => (f(), g(o(
|
|
1973
|
+
(f(!0), b($, null, F(e.options?.search?.select?.data || e.options?.select?.data, (d) => (f(), g(o(K), {
|
|
1970
1974
|
key: d.value,
|
|
1971
1975
|
label: d.label,
|
|
1972
1976
|
value: d.value
|
|
@@ -1986,7 +1990,7 @@ const et = /* @__PURE__ */ X(Ze, [["render", _e]]), tt = { class: "row flex-cent
|
|
|
1986
1990
|
row: r,
|
|
1987
1991
|
item: e
|
|
1988
1992
|
}, () => [
|
|
1989
|
-
o(
|
|
1993
|
+
o(B).customComponent[e.type ?? ""]?.table ? (f(), g(Q(o(B).customComponent[e.type ?? ""]?.table), V({
|
|
1990
1994
|
key: 0,
|
|
1991
1995
|
modelValue: r[e.key],
|
|
1992
1996
|
"onUpdate:modelValue": (d) => r[e.key] = d,
|
|
@@ -1999,7 +2003,7 @@ const et = /* @__PURE__ */ X(Ze, [["render", _e]]), tt = { class: "row flex-cent
|
|
|
1999
2003
|
loading: e.options?.switch?.loadingMap?.[r[s.option.table?.rowKey]]?.loading,
|
|
2000
2004
|
"before-change": () => e.options?.switch?.tableBeforeChange?.(e.key, r),
|
|
2001
2005
|
ref_for: !0
|
|
2002
|
-
}, e.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "loading", "before-change"])) : (f(), b("span",
|
|
2006
|
+
}, e.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "loading", "before-change"])) : (f(), b("span", nt, O(r[e.key] === e.options?.switch?.activeValue ? e.options?.switch?.activeText : e.options?.switch?.inactiveText), 1))
|
|
2003
2007
|
], 64)) : (f(), b("span", {
|
|
2004
2008
|
key: 2,
|
|
2005
2009
|
style: pe({
|
|
@@ -2008,7 +2012,7 @@ const et = /* @__PURE__ */ X(Ze, [["render", _e]]), tt = { class: "row flex-cent
|
|
|
2008
2012
|
class: I({ "table-text-click": e.table?.click?.callback }),
|
|
2009
2013
|
onClick: (d) => e.table?.click?.callback?.(r),
|
|
2010
2014
|
innerHTML: e.table?.format ? e.table?.format(r) : r[e.key]
|
|
2011
|
-
}, null, 14,
|
|
2015
|
+
}, null, 14, it))
|
|
2012
2016
|
])
|
|
2013
2017
|
], 64))
|
|
2014
2018
|
], 64))
|
|
@@ -2019,10 +2023,10 @@ const et = /* @__PURE__ */ X(Ze, [["render", _e]]), tt = { class: "row flex-cent
|
|
|
2019
2023
|
], 64))), 128);
|
|
2020
2024
|
};
|
|
2021
2025
|
}
|
|
2022
|
-
}),
|
|
2026
|
+
}), st = {
|
|
2023
2027
|
class: "row form-item-content",
|
|
2024
2028
|
style: { width: "100%" }
|
|
2025
|
-
},
|
|
2029
|
+
}, dt = { class: "col column form-item-content-item" }, ut = { class: "col" }, ft = ["innerHTML"], pt = /* @__PURE__ */ G({
|
|
2026
2030
|
__name: "formColumn",
|
|
2027
2031
|
props: {
|
|
2028
2032
|
conf: {},
|
|
@@ -2035,13 +2039,13 @@ const et = /* @__PURE__ */ X(Ze, [["render", _e]]), tt = { class: "row flex-cent
|
|
|
2035
2039
|
"label-width": a.item.item.text?.form?.label == "" ? 0 : a.item.item.form?.labelWidth || a.conf.option.form?.labelWidth
|
|
2036
2040
|
}, {
|
|
2037
2041
|
default: y(() => [
|
|
2038
|
-
|
|
2042
|
+
D("div", st, [
|
|
2039
2043
|
C(a.$slots, "form-" + a.item.item.key + "-start", {
|
|
2040
2044
|
row: a.conf.update.form,
|
|
2041
2045
|
item: a.item.item
|
|
2042
2046
|
}),
|
|
2043
|
-
|
|
2044
|
-
|
|
2047
|
+
D("div", dt, [
|
|
2048
|
+
D("div", ut, [
|
|
2045
2049
|
C(a.$slots, "form-" + a.item.item.key, {
|
|
2046
2050
|
row: a.conf.update.form,
|
|
2047
2051
|
item: a.item.item
|
|
@@ -2075,7 +2079,7 @@ const et = /* @__PURE__ */ X(Ze, [["render", _e]]), tt = { class: "row flex-cent
|
|
|
2075
2079
|
style: { width: "100%" }
|
|
2076
2080
|
}), {
|
|
2077
2081
|
default: y(() => [
|
|
2078
|
-
(f(!0), b($, null, F(a.conf.update.getBind(a.item.item).data, (s) => (f(), g(o(
|
|
2082
|
+
(f(!0), b($, null, F(a.conf.update.getBind(a.item.item).data, (s) => (f(), g(o(K), {
|
|
2079
2083
|
key: s.value,
|
|
2080
2084
|
label: s.label,
|
|
2081
2085
|
value: s.value
|
|
@@ -2118,7 +2122,7 @@ const et = /* @__PURE__ */ X(Ze, [["render", _e]]), tt = { class: "row flex-cent
|
|
|
2118
2122
|
"onUpdate:modelValue": p[5] || (p[5] = (s) => a.conf.update.form[a.item.item.key] = s)
|
|
2119
2123
|
}, a.conf.update.getBind(a.item.item), z(a.conf.update.getOn(a.item.item)), {
|
|
2120
2124
|
disabled: a.conf.update.getDisabled(a.item.item)
|
|
2121
|
-
}), null, 16, ["modelValue", "disabled"])) : a.item.item.type && (o(
|
|
2125
|
+
}), null, 16, ["modelValue", "disabled"])) : a.item.item.type && (o(B).customComponent[a.item.item.type] || o(B).customComponent[a.item.item.type]?.form) ? (f(), g(Q(o(B).customComponent[a.item.item.type]?.form || o(B).customComponent[a.item.item.type]), V({
|
|
2122
2126
|
key: 7,
|
|
2123
2127
|
modelValue: a.conf.update.form[a.item.item.key],
|
|
2124
2128
|
"onUpdate:modelValue": p[6] || (p[6] = (s) => a.conf.update.form[a.item.item.key] = s)
|
|
@@ -2139,7 +2143,7 @@ const et = /* @__PURE__ */ X(Ze, [["render", _e]]), tt = { class: "row flex-cent
|
|
|
2139
2143
|
key: 0,
|
|
2140
2144
|
class: "form-tip-text",
|
|
2141
2145
|
innerHTML: typeof a.item.item.form?.tipText == "function" ? a.item.item.form?.tipText(a.conf.update.form, a.conf.update.type) : a.item.item.form?.tipText
|
|
2142
|
-
}, null, 8,
|
|
2146
|
+
}, null, 8, ft)) : v("", !0)
|
|
2143
2147
|
])
|
|
2144
2148
|
]),
|
|
2145
2149
|
C(a.$slots, "form-" + a.item.item.key + "-end", {
|
|
@@ -2151,43 +2155,43 @@ const et = /* @__PURE__ */ X(Ze, [["render", _e]]), tt = { class: "row flex-cent
|
|
|
2151
2155
|
_: 3
|
|
2152
2156
|
}, 8, ["label", "prop", "label-width"]));
|
|
2153
2157
|
}
|
|
2154
|
-
}),
|
|
2158
|
+
}), ct = {}, mt = {
|
|
2155
2159
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2156
2160
|
viewBox: "64 64 896 896"
|
|
2157
2161
|
};
|
|
2158
|
-
function
|
|
2159
|
-
return f(), b("svg",
|
|
2160
|
-
|
|
2162
|
+
function ht(i, a) {
|
|
2163
|
+
return f(), b("svg", mt, a[0] || (a[0] = [
|
|
2164
|
+
D("path", {
|
|
2161
2165
|
fill: "currentColor",
|
|
2162
2166
|
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"
|
|
2163
2167
|
}, null, -1)
|
|
2164
2168
|
]));
|
|
2165
2169
|
}
|
|
2166
|
-
const
|
|
2170
|
+
const gt = /* @__PURE__ */ X(ct, [["render", ht]]), yt = {}, bt = {
|
|
2167
2171
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2168
2172
|
viewBox: "64 64 896 896"
|
|
2169
2173
|
};
|
|
2170
|
-
function
|
|
2171
|
-
return f(), b("svg",
|
|
2172
|
-
|
|
2174
|
+
function wt(i, a) {
|
|
2175
|
+
return f(), b("svg", bt, a[0] || (a[0] = [
|
|
2176
|
+
D("path", {
|
|
2173
2177
|
fill: "currentColor",
|
|
2174
2178
|
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"
|
|
2175
2179
|
}, null, -1)
|
|
2176
2180
|
]));
|
|
2177
2181
|
}
|
|
2178
|
-
const
|
|
2182
|
+
const kt = /* @__PURE__ */ X(yt, [["render", wt]]), vt = {
|
|
2179
2183
|
key: 0,
|
|
2180
2184
|
class: "relative curd-search fit-width"
|
|
2181
|
-
},
|
|
2185
|
+
}, Ct = { class: "mb-10 flex justify-between items-center fit-width" }, Vt = {
|
|
2182
2186
|
class: "flex items-center",
|
|
2183
2187
|
style: { gap: "10px" }
|
|
2184
|
-
},
|
|
2188
|
+
}, zt = { key: 0 }, $t = { key: 1 }, Ut = { key: 2 }, Dt = { class: "export-btn" }, Et = {
|
|
2185
2189
|
key: 1,
|
|
2186
2190
|
class: "export-btn"
|
|
2187
|
-
},
|
|
2191
|
+
}, Ot = {
|
|
2188
2192
|
class: "flex items-center table-tools-right",
|
|
2189
2193
|
style: { gap: "10px" }
|
|
2190
|
-
},
|
|
2194
|
+
}, St = { class: "row justify-end mt-10 mb-10 table-bottom-pagination" }, Mt = { class: "dialog-footer" }, At = { class: "dialog-footer" }, Ft = /* @__PURE__ */ G({
|
|
2191
2195
|
__name: "index",
|
|
2192
2196
|
props: {
|
|
2193
2197
|
/**
|
|
@@ -2198,7 +2202,7 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2198
2202
|
}
|
|
2199
2203
|
},
|
|
2200
2204
|
setup(i, { expose: a }) {
|
|
2201
|
-
const p = M.EDialog, s = i, l = M.isFun, { conf: t, switchConfirmRef: e, ruleFormRef: r, tableRef: d } =
|
|
2205
|
+
const p = M.EDialog, s = i, l = M.isFun, { conf: t, switchConfirmRef: e, ruleFormRef: r, tableRef: d } = Be(s);
|
|
2202
2206
|
return a({
|
|
2203
2207
|
conf: t
|
|
2204
2208
|
}), (m, c) => {
|
|
@@ -2206,16 +2210,16 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2206
2210
|
return f(), b("div", {
|
|
2207
2211
|
class: I(["relative cc1-form-box", [i.option.table?.fitHeight ? "col" : "no-min-height"]])
|
|
2208
2212
|
}, [
|
|
2209
|
-
|
|
2213
|
+
D("div", {
|
|
2210
2214
|
class: I(["row", [i.option.table?.fitHeight ? "absolute fit" : ""]]),
|
|
2211
2215
|
style: { overflow: "hidden" }
|
|
2212
2216
|
}, [
|
|
2213
2217
|
C(m.$slots, "box-left"),
|
|
2214
|
-
|
|
2218
|
+
D("div", {
|
|
2215
2219
|
class: I(["column fit-width no-wrap", [i.option.table?.fitHeight ? "col" : ""]])
|
|
2216
2220
|
}, [
|
|
2217
|
-
i.option.search?.show !== !1 ? (f(), b("div",
|
|
2218
|
-
|
|
2221
|
+
i.option.search?.show !== !1 ? (f(), b("div", vt, [
|
|
2222
|
+
E(o(W), {
|
|
2219
2223
|
model: o(t).search.form,
|
|
2220
2224
|
inline: "",
|
|
2221
2225
|
size: i.option.size?.search
|
|
@@ -2241,7 +2245,7 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2241
2245
|
C(m.$slots, "search-" + n.key, {
|
|
2242
2246
|
row: o(t).search.form
|
|
2243
2247
|
}, () => [
|
|
2244
|
-
o(
|
|
2248
|
+
o(B).customComponent[n.type ?? ""]?.search ? (f(), g(Q(o(B).customComponent[n.type ?? ""]?.search), V({
|
|
2245
2249
|
key: 0,
|
|
2246
2250
|
modelValue: o(t).search.form[n.key],
|
|
2247
2251
|
"onUpdate:modelValue": (h) => o(t).search.form[n.key] = h,
|
|
@@ -2264,12 +2268,12 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2264
2268
|
ref_for: !0
|
|
2265
2269
|
}, n.options?.search?.switch || n.options?.switch, z(n.options?.search?.switch?.on || n.options?.switch?.on || {})), {
|
|
2266
2270
|
default: y(() => [
|
|
2267
|
-
(f(), g(o(
|
|
2271
|
+
(f(), g(o(K), {
|
|
2268
2272
|
key: n.options?.switch?.activeValue,
|
|
2269
2273
|
label: n.options?.switch?.activeText,
|
|
2270
2274
|
value: n.options?.switch?.activeValue
|
|
2271
2275
|
}, null, 8, ["label", "value"])),
|
|
2272
|
-
(f(), g(o(
|
|
2276
|
+
(f(), g(o(K), {
|
|
2273
2277
|
key: n.options?.switch?.inactiveValue,
|
|
2274
2278
|
label: n.options?.switch?.inactiveText,
|
|
2275
2279
|
value: n.options?.switch?.inactiveValue
|
|
@@ -2286,7 +2290,7 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2286
2290
|
ref_for: !0
|
|
2287
2291
|
}, n.options?.search?.select || n.options?.select, z(n.options?.search?.select?.on || n.options?.select?.on || {})), {
|
|
2288
2292
|
default: y(() => [
|
|
2289
|
-
(f(!0), b($, null, F(n.options?.select?.data, (h) => (f(), g(o(
|
|
2293
|
+
(f(!0), b($, null, F(n.options?.select?.data, (h) => (f(), g(o(K), {
|
|
2290
2294
|
key: h.value,
|
|
2291
2295
|
label: h.label,
|
|
2292
2296
|
value: h.value
|
|
@@ -2314,7 +2318,7 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2314
2318
|
"onUpdate:modelValue": (h) => o(t).search.form[n.key] = h,
|
|
2315
2319
|
disabled: n.disabled?.search,
|
|
2316
2320
|
ref_for: !0
|
|
2317
|
-
}, n.options?.search?.datetime || n.options?.datetime, z(n.options?.search?.datetime?.on || n.options?.datetime?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.type && o(
|
|
2321
|
+
}, n.options?.search?.datetime || n.options?.datetime, z(n.options?.search?.datetime?.on || n.options?.datetime?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.type && o(B).customComponent[n.type] ? (f(), g(Q(o(B).customComponent[n.type]), V({
|
|
2318
2322
|
key: 6,
|
|
2319
2323
|
modelValue: o(t).search.form[n.key],
|
|
2320
2324
|
"onUpdate:modelValue": (h) => o(t).search.form[n.key] = h,
|
|
@@ -2338,7 +2342,7 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2338
2342
|
}),
|
|
2339
2343
|
i.option.tools?.search || i.option.tools?.reset ? (f(), g(o(ee), { key: 0 }, {
|
|
2340
2344
|
default: y(() => [
|
|
2341
|
-
i.option.tools?.search ? (f(), g(o(
|
|
2345
|
+
i.option.tools?.search ? (f(), g(o(L), {
|
|
2342
2346
|
key: 0,
|
|
2343
2347
|
type: "primary",
|
|
2344
2348
|
onClick: o(t).search.submit
|
|
@@ -2348,7 +2352,7 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2348
2352
|
]),
|
|
2349
2353
|
_: 1
|
|
2350
2354
|
}, 8, ["onClick"])) : v("", !0),
|
|
2351
|
-
i.option.tools?.reset ? (f(), g(o(
|
|
2355
|
+
i.option.tools?.reset ? (f(), g(o(L), {
|
|
2352
2356
|
key: 1,
|
|
2353
2357
|
onClick: o(t).search.reset
|
|
2354
2358
|
}, {
|
|
@@ -2367,10 +2371,10 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2367
2371
|
_: 3
|
|
2368
2372
|
}, 8, ["model", "size"])
|
|
2369
2373
|
])) : v("", !0),
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
o(l)(i.option.tools?.add) ? (f(), b("div",
|
|
2373
|
-
|
|
2374
|
+
D("div", Ct, [
|
|
2375
|
+
D("div", Vt, [
|
|
2376
|
+
o(l)(i.option.tools?.add) ? (f(), b("div", zt, [
|
|
2377
|
+
E(o(L), {
|
|
2374
2378
|
type: "primary",
|
|
2375
2379
|
onClick: c[0] || (c[0] = (n) => o(t).update.open(o(p).Add)),
|
|
2376
2380
|
size: i.option.size?.search
|
|
@@ -2381,8 +2385,8 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2381
2385
|
_: 1
|
|
2382
2386
|
}, 8, ["size"])
|
|
2383
2387
|
])) : v("", !0),
|
|
2384
|
-
i.option.table?.selectable && o(l)(i.option.tools?.delete) ? (f(), b("div",
|
|
2385
|
-
|
|
2388
|
+
i.option.table?.selectable && o(l)(i.option.tools?.delete) ? (f(), b("div", $t, [
|
|
2389
|
+
E(o(L), {
|
|
2386
2390
|
type: "danger",
|
|
2387
2391
|
onClick: c[1] || (c[1] = (n) => o(t).remove.open(o(t).table.selection.list)),
|
|
2388
2392
|
size: i.option.size?.search
|
|
@@ -2393,8 +2397,8 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2393
2397
|
_: 1
|
|
2394
2398
|
}, 8, ["size"])
|
|
2395
2399
|
])) : v("", !0),
|
|
2396
|
-
i.option.tools?.expand ? (f(), b("div",
|
|
2397
|
-
|
|
2400
|
+
i.option.tools?.expand ? (f(), b("div", Ut, [
|
|
2401
|
+
E(o(L), {
|
|
2398
2402
|
type: "warning",
|
|
2399
2403
|
onClick: c[2] || (c[2] = (n) => o(t).table.expand.all()),
|
|
2400
2404
|
size: i.option.size?.search
|
|
@@ -2411,7 +2415,7 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2411
2415
|
onCommand: o(t).export.click
|
|
2412
2416
|
}, {
|
|
2413
2417
|
dropdown: y(() => [
|
|
2414
|
-
|
|
2418
|
+
E(o(ge), {
|
|
2415
2419
|
size: i.option.size?.search
|
|
2416
2420
|
}, {
|
|
2417
2421
|
default: y(() => [
|
|
@@ -2447,8 +2451,8 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2447
2451
|
}, 8, ["size"])
|
|
2448
2452
|
]),
|
|
2449
2453
|
default: y(() => [
|
|
2450
|
-
|
|
2451
|
-
|
|
2454
|
+
D("div", Dt, [
|
|
2455
|
+
E(o(L), {
|
|
2452
2456
|
type: "warning",
|
|
2453
2457
|
loading: o(t).export.loading,
|
|
2454
2458
|
size: i.option.size?.search
|
|
@@ -2461,8 +2465,8 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2461
2465
|
])
|
|
2462
2466
|
]),
|
|
2463
2467
|
_: 1
|
|
2464
|
-
}, 8, ["onCommand"])) : (f(), b("div",
|
|
2465
|
-
|
|
2468
|
+
}, 8, ["onCommand"])) : (f(), b("div", Et, [
|
|
2469
|
+
E(o(L), {
|
|
2466
2470
|
type: "warning",
|
|
2467
2471
|
loading: o(t).export.loading,
|
|
2468
2472
|
size: i.option.size?.search,
|
|
@@ -2477,7 +2481,7 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2477
2481
|
], 64)) : v("", !0),
|
|
2478
2482
|
C(m.$slots, "tools-left")
|
|
2479
2483
|
]),
|
|
2480
|
-
|
|
2484
|
+
D("div", Ot, [
|
|
2481
2485
|
C(m.$slots, "tools-right"),
|
|
2482
2486
|
o(t).page.showTools ? (f(), g(o(de), V({
|
|
2483
2487
|
key: 0,
|
|
@@ -2501,12 +2505,12 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2501
2505
|
placement: "top"
|
|
2502
2506
|
}, {
|
|
2503
2507
|
default: y(() => [
|
|
2504
|
-
|
|
2508
|
+
D("div", {
|
|
2505
2509
|
class: I(["refresh-btn", [i.option.size?.search]]),
|
|
2506
2510
|
onClick: c[6] || (c[6] = //@ts-ignore
|
|
2507
2511
|
(...n) => o(t).table.header.group.toggleExpandAll && o(t).table.header.group.toggleExpandAll(...n))
|
|
2508
2512
|
}, [
|
|
2509
|
-
o(t).table.header.group.expand ? (f(), g(
|
|
2513
|
+
o(t).table.header.group.expand ? (f(), g(gt, { key: 0 })) : (f(), g(kt, { key: 1 }))
|
|
2510
2514
|
], 2)
|
|
2511
2515
|
]),
|
|
2512
2516
|
_: 1
|
|
@@ -2517,14 +2521,14 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2517
2521
|
onClick: c[7] || (c[7] = //@ts-ignore
|
|
2518
2522
|
(...n) => o(t).table.getList && o(t).table.getList(...n))
|
|
2519
2523
|
}, [
|
|
2520
|
-
|
|
2524
|
+
E(Ke)
|
|
2521
2525
|
], 2)) : v("", !0)
|
|
2522
2526
|
])
|
|
2523
2527
|
]),
|
|
2524
|
-
|
|
2528
|
+
D("div", {
|
|
2525
2529
|
class: I(["fit-width relative form-box", [i.option.table?.fitHeight ? "col " : "", i.option.table?.editMode ? "edit-mode" : ""]])
|
|
2526
2530
|
}, [
|
|
2527
|
-
|
|
2531
|
+
D("div", {
|
|
2528
2532
|
class: I(["column form-box-content", [i.option.table?.fitHeight ? "absolute fit" : ""]])
|
|
2529
2533
|
}, [
|
|
2530
2534
|
Ce((f(), g(o(ye), V({
|
|
@@ -2547,7 +2551,7 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2547
2551
|
"show-overflow-tooltip": !1,
|
|
2548
2552
|
className: "cc1-form-selectable-column"
|
|
2549
2553
|
}, typeof i.option.table?.selectable == "object" ? i.option.table?.selectable : {}, z(typeof i.option.table?.selectable == "object" ? i.option.table?.selectable?.on || {} : {})), null, 16)) : v("", !0),
|
|
2550
|
-
|
|
2554
|
+
E(rt, {
|
|
2551
2555
|
conf: o(t),
|
|
2552
2556
|
columnList: o(t).table.column.list,
|
|
2553
2557
|
option: i.option
|
|
@@ -2572,13 +2576,13 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2572
2576
|
])
|
|
2573
2577
|
]),
|
|
2574
2578
|
default: y(({ row: n }) => [
|
|
2575
|
-
|
|
2579
|
+
E(o(W), {
|
|
2576
2580
|
size: i.option.size?.table
|
|
2577
2581
|
}, {
|
|
2578
2582
|
default: y(() => [
|
|
2579
2583
|
C(m.$slots, "table-op-left", { row: n }),
|
|
2580
2584
|
o(t).update.type === o(p).Update && i.option.table?.inlineEdit && o(t).update.form[s.option.table?.rowKey] === n[s.option.table?.rowKey] ? (f(), b($, { key: 0 }, [
|
|
2581
|
-
|
|
2585
|
+
E(o(L), {
|
|
2582
2586
|
link: "",
|
|
2583
2587
|
type: "info",
|
|
2584
2588
|
onClick: o(t).update.close
|
|
@@ -2588,7 +2592,7 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2588
2592
|
]),
|
|
2589
2593
|
_: 1
|
|
2590
2594
|
}, 8, ["onClick"]),
|
|
2591
|
-
|
|
2595
|
+
E(o(L), {
|
|
2592
2596
|
link: "",
|
|
2593
2597
|
type: "primary",
|
|
2594
2598
|
onClick: o(t).update.submit,
|
|
@@ -2601,7 +2605,7 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2601
2605
|
}, 8, ["onClick", "loading"]),
|
|
2602
2606
|
C(m.$slots, "table-op-edit-right", { row: n })
|
|
2603
2607
|
], 64)) : (f(), b($, { key: 1 }, [
|
|
2604
|
-
o(l)(i.option.table?.add, n) ? (f(), g(o(
|
|
2608
|
+
o(l)(i.option.table?.add, n) ? (f(), g(o(L), {
|
|
2605
2609
|
key: 0,
|
|
2606
2610
|
link: "",
|
|
2607
2611
|
type: "primary",
|
|
@@ -2612,7 +2616,7 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2612
2616
|
]),
|
|
2613
2617
|
_: 2
|
|
2614
2618
|
}, 1032, ["onClick"])) : v("", !0),
|
|
2615
|
-
o(l)(i.option.table?.view, n) ? (f(), g(o(
|
|
2619
|
+
o(l)(i.option.table?.view, n) ? (f(), g(o(L), {
|
|
2616
2620
|
key: 1,
|
|
2617
2621
|
link: "",
|
|
2618
2622
|
type: "primary",
|
|
@@ -2623,7 +2627,7 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2623
2627
|
]),
|
|
2624
2628
|
_: 2
|
|
2625
2629
|
}, 1032, ["onClick"])) : v("", !0),
|
|
2626
|
-
o(l)(i.option.table?.update, n) ? (f(), g(o(
|
|
2630
|
+
o(l)(i.option.table?.update, n) ? (f(), g(o(L), {
|
|
2627
2631
|
key: 2,
|
|
2628
2632
|
link: "",
|
|
2629
2633
|
type: "warning",
|
|
@@ -2634,7 +2638,7 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2634
2638
|
]),
|
|
2635
2639
|
_: 2
|
|
2636
2640
|
}, 1032, ["onClick"])) : v("", !0),
|
|
2637
|
-
o(l)(i.option.table?.delete, n) ? (f(), g(o(
|
|
2641
|
+
o(l)(i.option.table?.delete, n) ? (f(), g(o(L), {
|
|
2638
2642
|
key: 3,
|
|
2639
2643
|
link: "",
|
|
2640
2644
|
type: "danger",
|
|
@@ -2660,7 +2664,7 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2660
2664
|
])
|
|
2661
2665
|
], 2)
|
|
2662
2666
|
], 2),
|
|
2663
|
-
|
|
2667
|
+
D("div", St, [
|
|
2664
2668
|
(i.option.page?.show === void 0 || i.option.page?.show) && !o(t).page.showTools ? (f(), g(o(de), V({
|
|
2665
2669
|
key: 0,
|
|
2666
2670
|
"current-page": o(t).page.num,
|
|
@@ -2680,19 +2684,19 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2680
2684
|
], 2),
|
|
2681
2685
|
C(m.$slots, "box-right")
|
|
2682
2686
|
], 2),
|
|
2683
|
-
|
|
2687
|
+
E(o(oe), V({
|
|
2684
2688
|
modelValue: o(t).update.show,
|
|
2685
2689
|
"onUpdate:modelValue": c[10] || (c[10] = (n) => o(t).update.show = n),
|
|
2686
2690
|
title: o(t).update.title,
|
|
2687
2691
|
"before-close": o(t).update.close
|
|
2688
2692
|
}, i.option.dialog), {
|
|
2689
2693
|
footer: y(() => [
|
|
2690
|
-
|
|
2691
|
-
|
|
2694
|
+
D("span", Mt, [
|
|
2695
|
+
E(o(W), {
|
|
2692
2696
|
size: i.option.size?.form
|
|
2693
2697
|
}, {
|
|
2694
2698
|
default: y(() => [
|
|
2695
|
-
|
|
2699
|
+
E(o(L), {
|
|
2696
2700
|
onClick: o(t).update.close
|
|
2697
2701
|
}, {
|
|
2698
2702
|
default: y(() => [
|
|
@@ -2700,7 +2704,7 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2700
2704
|
]),
|
|
2701
2705
|
_: 1
|
|
2702
2706
|
}, 8, ["onClick"]),
|
|
2703
|
-
o(t).update.type !== o(p).View ? (f(), g(o(
|
|
2707
|
+
o(t).update.type !== o(p).View ? (f(), g(o(L), {
|
|
2704
2708
|
key: 0,
|
|
2705
2709
|
type: "primary",
|
|
2706
2710
|
onClick: o(t).update.submit,
|
|
@@ -2717,7 +2721,7 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2717
2721
|
])
|
|
2718
2722
|
]),
|
|
2719
2723
|
default: y(() => [
|
|
2720
|
-
|
|
2724
|
+
E(o(W), {
|
|
2721
2725
|
ref_key: "ruleFormRef",
|
|
2722
2726
|
ref: r,
|
|
2723
2727
|
model: o(t).update.form,
|
|
@@ -2750,7 +2754,7 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2750
2754
|
key: 0,
|
|
2751
2755
|
class: I([h.item.form.span > 0 ? `col-${o(t).getColumnSpan(h, n)}` : "col", `form-item-col-${h.item.key}`])
|
|
2752
2756
|
}, [
|
|
2753
|
-
(f(!0), b($, null, F(h.item.children ? h.children : [h], (S) => (f(), g(
|
|
2757
|
+
(f(!0), b($, null, F(h.item.children ? h.children : [h], (S) => (f(), g(pt, {
|
|
2754
2758
|
key: S.item.key,
|
|
2755
2759
|
conf: o(t),
|
|
2756
2760
|
item: S
|
|
@@ -2775,19 +2779,19 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2775
2779
|
]),
|
|
2776
2780
|
_: 3
|
|
2777
2781
|
}, 16, ["modelValue", "title", "before-close"]),
|
|
2778
|
-
|
|
2782
|
+
E(o(oe), {
|
|
2779
2783
|
modelValue: o(t).remove.show,
|
|
2780
2784
|
"onUpdate:modelValue": c[11] || (c[11] = (n) => o(t).remove.show = n),
|
|
2781
2785
|
title: o(t).remove.title,
|
|
2782
2786
|
"close-on-click-modal": !1
|
|
2783
2787
|
}, {
|
|
2784
2788
|
footer: y(() => [
|
|
2785
|
-
|
|
2786
|
-
|
|
2789
|
+
D("span", At, [
|
|
2790
|
+
E(o(W), {
|
|
2787
2791
|
size: i.option.size?.form
|
|
2788
2792
|
}, {
|
|
2789
2793
|
default: y(() => [
|
|
2790
|
-
|
|
2794
|
+
E(o(L), {
|
|
2791
2795
|
onClick: o(t).remove.close
|
|
2792
2796
|
}, {
|
|
2793
2797
|
default: y(() => [
|
|
@@ -2795,7 +2799,7 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2795
2799
|
]),
|
|
2796
2800
|
_: 1
|
|
2797
2801
|
}, 8, ["onClick"]),
|
|
2798
|
-
|
|
2802
|
+
E(o(L), {
|
|
2799
2803
|
type: "danger",
|
|
2800
2804
|
onClick: o(t).remove.submit,
|
|
2801
2805
|
loading: o(t).remove.loading
|
|
@@ -2811,11 +2815,11 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2811
2815
|
])
|
|
2812
2816
|
]),
|
|
2813
2817
|
default: y(() => [
|
|
2814
|
-
|
|
2818
|
+
D("div", null, O(o(w).tCurd("confirmDeleteMessage", o(t).remove.items.length)), 1)
|
|
2815
2819
|
]),
|
|
2816
2820
|
_: 1
|
|
2817
2821
|
}, 8, ["modelValue", "title"]),
|
|
2818
|
-
|
|
2822
|
+
E(Re, {
|
|
2819
2823
|
ref_key: "switchConfirmRef",
|
|
2820
2824
|
ref: e,
|
|
2821
2825
|
size: i.option.size?.form
|
|
@@ -2824,7 +2828,7 @@ const wt = /* @__PURE__ */ X(gt, [["render", bt]]), kt = {
|
|
|
2824
2828
|
};
|
|
2825
2829
|
}
|
|
2826
2830
|
});
|
|
2827
|
-
class
|
|
2831
|
+
class Rt {
|
|
2828
2832
|
/**
|
|
2829
2833
|
* 通过远程 URL 下载文件,自动创建临时 `<a>` 标签触发浏览器下载
|
|
2830
2834
|
*
|
|
@@ -2869,26 +2873,26 @@ class jt {
|
|
|
2869
2873
|
}, document.body.appendChild(l), l.click();
|
|
2870
2874
|
});
|
|
2871
2875
|
}
|
|
2872
|
-
const
|
|
2873
|
-
if (i.component("TCurd",
|
|
2874
|
-
|
|
2876
|
+
const Tt = (i, a) => {
|
|
2877
|
+
if (i.component("TCurd", Ft), i.component("TFormList", se), i.component("TColumn", Te), a?.customComponent) {
|
|
2878
|
+
B.customComponent = a.customComponent;
|
|
2875
2879
|
for (const p in a.customComponent)
|
|
2876
2880
|
i.component(p, a.customComponent[p]);
|
|
2877
2881
|
}
|
|
2878
|
-
},
|
|
2879
|
-
install:
|
|
2882
|
+
}, It = {
|
|
2883
|
+
install: Tt
|
|
2880
2884
|
};
|
|
2881
2885
|
export {
|
|
2882
|
-
|
|
2883
|
-
|
|
2886
|
+
H as ArrUtil,
|
|
2887
|
+
Le as ExcelUtil,
|
|
2884
2888
|
Te as TColumn,
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2889
|
+
Ft as TCurd,
|
|
2890
|
+
Rt as TFile,
|
|
2891
|
+
B as TForm,
|
|
2888
2892
|
A as TFormConfig,
|
|
2889
2893
|
w as TFormI18n,
|
|
2890
2894
|
se as TFormList,
|
|
2891
2895
|
M as TSys,
|
|
2892
|
-
|
|
2893
|
-
|
|
2896
|
+
It as default,
|
|
2897
|
+
Tt as install
|
|
2894
2898
|
};
|
package/dist/cc1-form.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(C,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("element-plus"),require("vue-router"),require("vue")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue-router","vue"],g):(C=typeof globalThis<"u"?globalThis:C||self,g(C.cc1Form={},C.ElementPlus,C.VueRouter,C.Vue))})(this,(function(C,g,Ke,e){"use strict";class b{static router;static routes;static getRouterPath=()=>this.router.currentRoute.value.path;static EDialog={Add:"Add",Update:"Update",View:"View",Remove:"Remove"};static isFun=(n,...f)=>Array.isArray(n)?n.some(d=>typeof d=="function"?d(...f):d):typeof n=="function"?n(...f):n;static getRouterParams=()=>{const n=this.router.currentRoute.value.query||{},f=this.router.currentRoute.value.params||{};return Object.keys(n).length?n:Object.keys(f).length?f:{}};static moduleObj={};static loadModule=async n=>{if(!b.moduleObj[n])throw new Error(`模块${n}未加载,请赋值如:TSys.moduleObj = { ${n}: ()=>import('${n}') }`);const f=await b.moduleObj[n]();return f.default??f};static tipMessages={};static tipMessagesGap=500;static showMessage(n,f,d={}){const a=Date.now();if(!this.tipMessages[n]||a-this.tipMessages[n]>this.tipMessagesGap){this.tipMessages[n]=a;const o=Object.assign({message:n,type:f},d);g.ElMessage(o),setTimeout(()=>{delete this.tipMessages[n]},this.tipMessagesGap)}}static fail=(n,f={})=>{this.showMessage(n,"error",f)};static success=(n,f={})=>{this.showMessage(n,"success",f)};static loadingObj=null;static loadingTimer=null;static loading=(n=!0,f="Loading...")=>{Timer.un(this.loadingTimer),this.loadingTimer=Timer.once(()=>{n?this.loadingObj=g.ElLoading.service({lock:!0,text:f,background:"rgba(0, 0, 0, 0.3)"}):this.loadingObj&&(this.loadingObj.close(),this.loadingObj=null)},50)};static openUrl=(n,f=!0)=>{if(f){let d=screen.width/2-500,a=screen.height/2-800/2-30;window.open(n,"_blank","toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top="+a+", left="+d)}else window.open(n,"DescriptiveWindowName"+StrUtil.getId(),"resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0")};static getImgPic=n=>new Promise(async(f,d)=>{let a=document.getElementById(n.id);const o=await b.loadModule("html2canvas");try{o(a,{logging:!1,allowTaint:!0,scale:window.devicePixelRatio,width:n.windowWidth,height:n.windowHeight,windowWidth:n.windowWidth,windowHeight:n.windowHeight,useCORS:!0,backgroundColor:"#ffffff00"}).then(function(t){let i=t.toDataURL("image/png");f(i)})}catch(t){d(t)}})}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:{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=n=>{w.config=ObjectUtil.deepMerge(w.config,n)}}class B{static customComponent={};static findOptions=(n,f)=>{const d=n.column.find(o=>o.key===f),a=o=>o.replace(/-([a-z])/g,(t,i)=>i.toUpperCase());if(d)return d.options[a(d.type)]};static setOptionsData=(n,f,d)=>{const a=B.findOptions(n,f);a&&(a.data=d)};static form={openBefore:{parentId:(n,f,d,a)=>{const o=w.config.table.rowKey;n?f.type===b.EDialog.Add?(f.form.parentId=n[o],f.form.sort=n.children.length+1):f.form.parentId=n.parentId.substring(n.parentId.lastIndexOf(",")+1):(f.form.parentId="0",f.form.sort=d.length+1),B.setOptionsData(a,"parentId",[{[o]:"0",title:"根",children:d}])}}}}function We(r){return r}const L={search:"搜索",add:"新增",edit:"编辑",view:"查看",delete:"删除",export:"导出",exportSelect:"导出选中",exportPage:"导出本页",exportAll:"导出全部",import:"导入",refresh:"刷新",reset:"重置",expandCollapse:"展开/收缩",operation:"操作",close:"关闭",cancel:"取消",submit:"提交",confirm:"确认",confirmDelete:"确认删除",confirmDeleteMessage:"确认要删除【{count}】条数据吗?",placeholderInput:"请输入",placeholderSelect:"请选择",checkFormData:"请检查表单数据",selectDataToDelete:"请选择要删除的数据",selectDataToExport:"请选择要导出的数据",noData:"暂无数据",operationSuccess:"操作成功",switchOn:"开启",switchOff:"关闭",confirmModify:"确认修改",confirmSwitchMessage:"确认要修改吗?",mergeColumn:"合并栏位",expandColumn:"展开栏位"};class y{static t(n,...f){if(typeof n=="function")return n(...f);n=String(n);let d=0;return n.replace(/{([^}]+)}/g,(a,o)=>d<f.length?String(f[d++]):`{${o}}`)}static setI18n=n=>{y.curd=ObjectUtil.deepMerge(y.curd,n)};static tCurd(n,...f){return this.t(this.curd[n],...f)}static curd=L}class N{static getIdFun=()=>StrUtil.uuid();static setId=(n,f,d)=>{f[n]||(f[n]=[]);const a=w.config.table.rowKey;f[n].forEach(o=>{d.forEach(t=>{let i=t.default??"";t.type==="number"&&(i=t.default??0),t.type==="boolean"&&(i=t.default??!1),t.type==="time"&&(i=t.default??new Date),o[t.value]===void 0&&(o[t.value]=i)}),o[a]||(o[a]=N.getIdFun())})};static add=(n,f,d,a)=>{const o=JSONUtil.cp(d);N.setId(n,f,d);const t=w.config.table.rowKey;f[n].push(o.reduce((i,s)=>{let m=s.default??"";return s.type==="number"&&(m=s.default??0),s.type==="boolean"&&(m=s.default??!1),s.type==="time"&&(m=s.default??new Date),i[s.value]=m,i},{[t]:N.getIdFun()})),a?.(f)};static remove=(n,f,d,a)=>{const o=w.config.table.rowKey;f[n]=f[n].filter(t=>t[o]!==d[o]),a?.(f)};static getNoIdData=(n,f)=>{const d=JSONUtil.cp(n),a=w.config.table.rowKey;return d.forEach(o=>{o[a]&&delete o[a],f&&o[f]&&N.getNoIdData(o[f],f)}),d}}const x={key:0,class:"column curd-form-com-list",style:{width:"100%",gap:"10px"}},A={key:0},H={class:"row items-center",style:{gap:"10px",width:"100%"}},j={key:1},U=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(r,{emit:n}){const f=r,d=e.reactive({show:!1,add:(o,t,i)=>{N.add(o,t,i,()=>{a("change")})},remove:(o,t,i)=>{N.remove(o,t,i,()=>{a("change")})}});e.onMounted(()=>{N.setId(f.field,f.row,f.itemFields),d.show=!0});const a=n;return(o,t)=>{const i=e.resolveComponent("el-button"),s=e.resolveComponent("el-input");return d.show?(e.openBlock(),e.createElementBlock("div",x,[e.renderSlot(o.$slots,"list-start",{row:r.row}),r.addBottom?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",A,[e.createVNode(i,{link:"",type:"primary",onClick:t[0]||(t[0]=m=>d.add(r.field,r.row,r.itemFields))},{default:e.withCtx(()=>t[3]||(t[3]=[e.createTextVNode("添加")])),_:1})])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.row[r.field],m=>(e.openBlock(),e.createElementBlock("div",H,[e.renderSlot(o.$slots,"item-start",{item:m,row:r.row}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.itemFields,p=>(e.openBlock(),e.createBlock(s,{modelValue:m[p.value],"onUpdate:modelValue":c=>m[p.value]=c,style:e.normalizeStyle({width:r.inputWidth}),class:e.normalizeClass(r.inputClass),placeholder:p[r.label]||p[r.value],onChange:t[1]||(t[1]=c=>a("change"))},null,8,["modelValue","onUpdate:modelValue","style","class","placeholder"]))),256)),e.renderSlot(o.$slots,"item-end",{item:m,row:r.row}),e.createVNode(i,{link:"",type:"danger",onClick:p=>d.remove(r.field,r.row,m)},{default:e.withCtx(()=>t[4]||(t[4]=[e.createTextVNode("删除")])),_:2},1032,["onClick"])]))),256)),r.addBottom?(e.openBlock(),e.createElementBlock("div",j,[e.createVNode(i,{link:"",type:"primary",onClick:t[2]||(t[2]=m=>d.add(r.field,r.row,r.itemFields))},{default:e.withCtx(()=>t[5]||(t[5]=[e.createTextVNode("添加")])),_:1})])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"list-end",{row:r.row})])):e.createCommentVNode("",!0)}}}),I={class:"row form-item-content",style:{width:"100%"}},R={class:"col"},K={class:"col"},W=["innerHTML"],F=e.defineComponent({__name:"column",props:{option:{default:{}},type:{default:""}},setup(r,{expose:n}){const f=b.isFun,d=b.EDialog,a=e.ref(),o=r,t=e.reactive({rules:{},show:!0,form:{},formDefault:{},type:o.type||d.Add,formColumn:[],getDisabled:i=>t.type===d.View?i.disabled?.view===void 0?!0:i.disabled?.view:i.disabled?.[t.type===d.Add?"create":"update"],getBind:i=>i.options?.[t.type===d.Add?"formAdd":"formUpdate"]?.[i.type]||i.options?.[i.type]||{},getOn:i=>i.options?.[t.type===d.Add?"formAdd":"formUpdate"]?.[i.type]?.on||i.options?.[i.type]?.on||{},getColumnSpan:(i,s)=>{if(i.item.form?.spanCol){const m=o.option.form?.maxSpan||12,p=o.option.form?.defaultSpan||m/2,k=s.filter(l=>!b.isFun(l.item.show?.form,t.form,t.type)).reduce((l,h)=>l+(h.item.form?.span||p),0);return(i.item.form?.span||p)+k}return i.item.form?.span},initColumnForm:()=>{const i=o.option;t.formColumn=[],t.rules={},t.formDefault={};const s=[],m=o.option.form?.maxSpan||12,p=o.option.form?.defaultSpan||m/2;let c=[];const k=h=>{if(h.children){h.children.forEach(u=>{k(u)});return}if(t.formDefault[h.key]=h.value,h.isForm&&(typeof h.show?.form!="boolean"||h.show?.form)){h.form=h.form||{span:p},h.form.span=h.form.span??p;const u=h.form.span,E=c.reduce((S,$)=>S+$.span,u),V=c.length;if(c.push({item:h,span:u}),(V===1&&c[0].span===0||E>=m||u===0&&V>1)&&(s.push(c),c=[]),h.rules){const S={input:y.tCurd("placeholderInput"),select:y.tCurd("placeholderSelect")},$=(S[h.type]||S.input)+h.label;t.rules[h.key]=typeof h.rules=="boolean"?[{required:!0,message:$,trigger:"blur"}]:h.rules}}},l=(h,u)=>{h.isForm=u,Array.isArray(h.children)&&h.children.forEach(E=>l(E,u))};i.column.forEach(h=>{l(h,!0),k(h)}),c.length>0&&s.push(c),t.formColumn=s,t.form=JSONUtil.cp(t.formDefault)}});return t.initColumnForm(),n({ref:a,conf:t}),(i,s)=>(e.openBlock(),e.createBlock(e.unref(g.ElForm),{ref_key:"ruleFormRef",ref:a,model:t.form,rules:t.rules},{default:e.withCtx(()=>[t.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.formColumn,(m,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:p},[e.unref(f)(m.map(c=>c.item?.show?.form),t.form,t.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:r.option.form?.stripe===void 0?!0:r.option.form?.stripe}])},[e.renderSlot(i.$slots,"form-start",{row:t.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m,c=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c.item.key},[e.unref(f)(c.item.show?.form,t.form,t.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([c.item.form.span>0?`col-${t.getColumnSpan(c,m)}`:"col",`form-item-col-${c.item.key}`])},[e.createVNode(e.unref(g.ElFormItem),{label:c.item.text?.form?.label??c.item.label,prop:c.item.key,"label-width":c.item.text?.form?.label==""?0:c.item.form?.labelWidth||r.option.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.createElementVNode("div",I,[e.renderSlot(i.$slots,"form-"+c.item.key+"-start",{row:t.form,item:c.item}),e.createElementVNode("div",R,[e.createElementVNode("div",K,[e.renderSlot(i.$slots,"form-"+c.item.key,{row:t.form,item:c.item},()=>[c.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:0,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):c.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:1,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):c.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:2,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.item.options?.select?.data,k=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:k.value,label:k.label,value:k.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):c.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(g.ElRadioGroup),e.mergeProps({key:3,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.item.options?.radio?.data,k=>(e.openBlock(),e.createBlock(e.unref(g.ElRadio),{key:k.value,label:k.label,value:k.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):c.item.type==="list"?(e.openBlock(),e.createBlock(U,e.mergeProps({key:4,row:t.form,field:c.item.key,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):c.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(g.ElTreeSelect),e.mergeProps({key:5,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item),style:{width:"100%"}}),null,16,["modelValue","onUpdate:modelValue","disabled"])):c.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(g.ElDatePicker),e.mergeProps({key:6,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):c.item.type&&(e.unref(B).customComponent[c.item.type]||e.unref(B).customComponent[c.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[c.item.type]?.form||e.unref(B).customComponent[c.item.type]),e.mergeProps({key:7,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(i.$slots,"form-"+c.item.key+"-right",{row:t.form,item:c.item})]),e.renderSlot(i.$slots,"form-"+c.item.key+"-tip",{row:t.form,item:c.item},()=>[c.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof c.item.form?.tipText=="function"?c.item.form?.tipText(t.form,t.type):c.item.form?.tipText},null,8,W)):e.createCommentVNode("",!0)])]),e.renderSlot(i.$slots,"form-"+c.item.key+"-end",{row:t.form,item:c.item})])]),_:2},1032,["label","prop","label-width"])],2)):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(i.$slots,"form-end",{row:t.form})],2)):e.createCommentVNode("",!0)],64))),128)):e.createCommentVNode("",!0)]),_:3},8,["model","rules"]))}});class O{static exportToExcel=async(n,f,d)=>{if(!n||n.length===0)return;const a=await b.loadModule("xlsx"),o=n.map(s=>{const m={};return f.forEach(p=>{m[p.label]=s[p.key]}),m}),t=a.utils.json_to_sheet(o),i=a.utils.book_new();a.utils.book_append_sheet(i,t,"Sheet1"),d?typeof d=="function"&&(d=d()):d=`导出数据_${new Date().Format("yyyy-MM-dd")}_${new Date().getTime()}`,a.writeFile(i,`${d}.xlsx`)}}const D=b.EDialog,q=r=>{const n=e.ref(),f=e.ref(),d=e.ref(),a=e.reactive({option:r.option,search:{column:{list:[]},form:{},formDefault:{},getPlaceholder:(o,t=y.tCurd("placeholderInput"))=>o.text?.search?.placeholder===void 0?`${t}${o.label}`:o.text?.search?.placeholder,getFormData:()=>{let o={};r.option.column.forEach(i=>{(typeof i.show?.search=="function"?i.show?.search(a.search.form):i.show?.search)&&(o[i.key]=a.search.form[i.key])});const t=r.option.search?.before?.(o);return t&&(o=t),o},reset:()=>{const o=a.search.formDefault;Object.keys(o).forEach(t=>{r.option.search?.resetMode==="none"?o[t]=void 0:o[t]=a.search.formDefault[t]}),a.search.form=ObjectUtil.deepMerge(o,{}),a.page.num=1,r.option.init!==!1&&a.table.getList()},submit:()=>{a.page.num=1,a.table.getList()}},page:{num:1,total:0,layout:r.option.page?.layout||w.config.pagination.layout,showTools:r.option.page?.showTools||w.config.pagination.showTools,size:r.option.page?.size||w.config.pagination.size,sizeList:r.option.page?.sizeList||w.config.pagination.pageSizes,pagerCount:r.option.page?.pagerCount||w.config.pagination.pagerCount,getQuery:(o={})=>({[w.config.field.page.size]:o.size||a.page.size,[w.config.field.page.num]:o.num||a.page.num,...a.search.getFormData()})},table:{op:{width:(...o)=>o.filter(i=>i).length*30+60},loading:!1,data:[],expand:{isExpand:!1,rowKeys:[],change:(o,t)=>{},all:()=>{if(a.table.expand.isExpand)a.table.expand.rowKeys=[];else{const o=t=>{let i=[];return t.forEach(s=>{i.push(s[r.option.table.rowKey]),s.children&&s.children.length>0&&(i=i.concat(o(s.children)))}),i};a.table.expand.rowKeys=o(a.table.data)}a.table.expand.isExpand=!a.table.expand.isExpand}},column:{list:[],show:{listSource:[],list:[]}},header:{group:{expand:!1,toggleExpandAll:()=>{const o=!a.table.header.group.expand;a.table.header.group.expand=o;const t=i=>{i.forEach(s=>{s.table?.header?.group!==void 0&&(s.table.header.group=!o),s.table?.header?.groupKey!==void 0&&(s.table.header.show=o),Array.isArray(s.children)&&s.children.length>0&&t(s.children)})};t(a.table.column.list)}}},getList:async()=>{a.table.loading=!0;const o=r.option.api.list;try{await a.initApiData("init");let t={};if(a.table.sort.prop){const{props:h,order:u}=w.config.table.sort;t={[h.field]:a.table.sort.prop,[u.field]:a.table.sort.order}}const i=await o({...a.page.getQuery(),...t}),s=w.config.field.result,m=i.data||{[s.list]:i};let p=(Array.isArray(m[s.list]),m[s.list]);const c=a.update.formColumn.flat(),l=ObjectUtil.deepMerge({data:p},{}).data.map(h=>(Object.keys(h).forEach(E=>{const V=c.find(S=>S.item.key===E);V&&["select","radio"].includes(V.item.type)&&(V.item.table.format||(V.item.table.format=S=>V.item.options[V.item.type].data?.find($=>$.value==S[E])?.label||S[E]))}),h));a.table.data=r.option.data?await r.option.data(l,p):l,a.page.total=m[s.total]||0}catch(t){console.error(t)}finally{a.table.loading=!1}},selection:{list:[],change:o=>{a.table.selection.list=o},setList:(o,t)=>{a.table.selection.list=[];const i=d.value;if(i?.clearSelection(),!i||!o?.length)return;const s=r.option.table?.rowKey,m=a.table.data,p=c=>{const k=l=>{for(const h of l){if(s!=null&&s!==""){if(h[s]===c[s])return h}else if(h===c)return h;if(Array.isArray(h.children)&&h.children.length){const u=k(h.children);if(u!==void 0)return u}}};return k(m)};e.nextTick(()=>{o.forEach(c=>{const k=p(c)??c;if(t){const l=()=>{i.toggleRowSelection(k,!0,!1)};t(c)!==!1&&l()}else i.toggleRowSelection(k,!0,!1)})})}},sort:{prop:"",order:"",change:o=>{w.config.table.sort.resetPage&&(a.page.num=1);const t=w.config.table.sort;if(t.change){t.change(o,a);return}a.table.sort.prop=o.prop,o.order===null?a.table.sort.order="":a.table.sort.order=o.order==="ascending"?t.order.asc:t.order.desc,a.table.getList()}}},export:{run:{start:async o=>{let t=await a.export.run[o](),i=r.option.column;const s=ObjectUtil.deepMerge({data:t,columns:i},{}),m=r.option.tools?.export||{};m.before&&m.before(s),O.exportToExcel(s.data,s.columns,m.fileName)},select:async()=>{a.export.loading=!0;try{if(r.option.tools?.export?.select){await r.option.tools?.export?.select({...a.page.getQuery(),items:a.table.selection.list});return}if(a.table.selection.list.length===0)throw b.fail(y.tCurd("selectDataToExport")),new Error(y.tCurd("selectDataToExport"));return a.table.selection.list}catch(o){console.error(o)}finally{a.export.loading=!1}},page:async()=>{a.export.loading=!0;try{if(r.option.tools?.export?.page){await r.option.tools?.export?.page({...a.page.getQuery()});return}if(a.table.data.length===0)throw b.fail(y.tCurd("noData")),new Error(y.tCurd("noData"));return a.table.data}catch(o){console.error(o)}finally{a.export.loading=!1}},all:async()=>{a.export.loading=!0;try{if(r.option.tools?.export?.all){await r.option.tools?.export?.all({...a.page.getQuery()});return}const o=r.option.api.list,t=await o({...a.page.getQuery({size:999999,num:1})});return(t.data||{[w.config.field.result.list]:t})[w.config.field.result.list]}catch(o){console.error(o)}finally{a.export.loading=!1}}},loading:!1,click:o=>{a.export.loading||a.export.run.start(o)}},update:{title:"",rules:{},show:!1,showContent:!1,loading:!1,type:D.Update,form:{},formDefault:{},formColumn:[],getDisabled:(o,t=!1)=>r.option.table?.editMode&&t?o.disabled?.table===void 0?!1:o.disabled?.table:a.update.type===D.View?o.disabled?.view===void 0?!0:o.disabled?.view:o.disabled?.[a.update.type===D.Add?"create":"update"],getBind:o=>o.options?.[a.update.type===D.Add?"formAdd":"formUpdate"]?.[o.type]||o.options?.[o.type]||{},getOn:(o,t)=>{const s=o.options?.[a.update.type===D.Add?"formAdd":"formUpdate"]?.[o.type]?.on||o.options?.[o.type]?.on||{},m={};return Object.keys(s).forEach(p=>{const c=s[p];typeof c=="function"?m[p]=function(...k){return c.apply(this,[...k,t||a.update.form,o])}:m[p]=c}),m},getOptions:o=>{try{const i=a.update.formColumn.flat().find(s=>s.item.key===o)?.item;return i?{options:i.options,bind:a.update.getBind(i)}:{options:{},bind:{}}}catch{return{options:{},bind:{}}}},edit:{data:{},getApiData:o=>{if(r.option.form?.editAll)return o;let t={[r.option.table?.rowKey]:a.update.edit.data[r.option.table?.rowKey]};return Object.keys(a.update.edit.data).forEach(i=>{o[i]!==a.update.edit.data[i]&&(t[i]=o[i])}),t}},view:{},open:(o,t)=>{a.update.showContent||FunUtil.throttle(async()=>{b.loading(!0);try{a.update.type=o;const i=o===D.Add;a.update.edit.data=t,a.update.title=y.tCurd(i?"add":o===D.View?"view":"edit"),a.update.form=ObjectUtil.deepMerge(i?a.update.formDefault:t,{}),await a.initApiData("update"),await r.option.form?.openBefore?.(a.update.form,a.update),(!r.option.table?.inlineEdit||i)&&(a.update.show=!0,a.update.showContent=!0),r.option.form?.openAfter?.(a.update.form,a.update)}catch(i){console.error(i)}finally{b.loading(!1)}})},submit:()=>{FunUtil.throttle(async()=>{await f.value?.validate(async(s,m)=>new Promise((p,c)=>{s||(b.fail(y.tCurd("checkFormData")),c(!1)),p()})),a.update.loading=!0;const o=a.update.type===D.Add?r.option.api.create:r.option.api.update;try{await r.option.form?.submitBefore?.(a.update.form,a.update)}catch{a.update.loading=!1;return}let t=ObjectUtil.deepMerge(a.update.form,{});delete t.children;const i=new Set(r.option.column.filter(s=>s.type==="datetime").map(s=>s.key));Object.keys(t).forEach(s=>{if(i.has(s)&&t[s]!=null){const m=new Date(t[s]).getTime();isNaN(m)||(t[s]=m)}});try{if(!o)return;await o({...t}),a.update.close(),await a.table.getList(),r.option.form?.submitAfter?.(t,a.update)}catch(s){console.error(s)}finally{a.update.loading=!1}})},close:()=>{a.update.show=!1,r.option.table?.inlineEdit&&(a.update.form={}),setTimeout(()=>{a.update.showContent=!1},350)}},remove:{title:y.tCurd("confirmDelete"),show:!1,items:[],loading:!1,close:()=>{a.remove.show=!1},open:o=>{if(o.length===0){b.fail(y.tCurd("selectDataToDelete"));return}a.remove.items=o,a.remove.show=!0},submit:()=>{FunUtil.throttle(async()=>{a.remove.loading=!0;const o=r.option.api.delete;try{if(!o)return;await o({[r.option.table?.rowKey]:a.remove.items.map(t=>t[r.option.table?.rowKey]),items:a.remove.items}),b.success(y.tCurd("operationSuccess")),a.table.data.length<=1&&a.page.num>1&&(a.page.num-=1),a.remove.close(),await a.table.getList()}catch(t){console.error(t)}finally{a.remove.loading=!1}})}},init:()=>{a.initCurdConfig(),a.initColumnOptions(),a.initColumnForm()},apiDataMap:{},initApiData:async o=>{const t=[],i=s=>{if(s.children&&s.children.length){s.children.forEach(m=>i(m));return}if(s.options?.[s.type]?.dataApi&&s.options?.[s.type]?.dataApiConfig?.[o]){if(a.apiDataMap[s.key]&&s.options?.[s.type]?.dataApiConfig?.once)return;const m=(async()=>{try{let p=await s.options?.[s.type]?.dataApi?.(a.update.form,a.update.type);if(p){const c=s.options?.[s.type]?.dataPath;!Array.isArray(p)&&c&&(p=ObjectUtil.getPathValue(p,c)),s.options[s.type].data=p,s.options.search[s.type].data=p,s.options.formAdd[s.type].data=p,s.options.formUpdate[s.type].data=p,a.apiDataMap[s.key]=p}}catch{}})();t.push(m)}};return r.option.column.forEach(s=>{i(s)}),await Promise.all(t),!0},initCurdConfig:()=>{const o=ObjectUtil.deepMerge(w.config,{});o.table.emptyText=y.tCurd("noData"),r.option.size=r.option.size||{},o.table.size=r.option.size.table||o.size.table,o.form.size=r.option.size.form||o.size.form,o.size.search=r.option.size.search||o.size.search;const t=ObjectUtil.deepMerge(o,r.option||{});Object.keys(t).forEach(i=>{r.option[i]=t[i]})},initColumnOptions:()=>{let o=JSONUtil.cp(w.config.columnConfig);o.options=ObjectUtil.deepMerge({switch:{activeText:y.tCurd("switchOn"),inactiveText:y.tCurd("switchOff")}},o.options);const t=i=>{for(const s in o){if(s==="table"){if(i.table=ObjectUtil.deepMerge(o.table,i.table||{}),i.children){i.children.forEach(p=>{t(p)});return}}else s==="type"?i.type=i.type||o.type:i[s]=ObjectUtil.deepMerge(o[s],i[s]||{});i.options=i.options||{},i.options[i.type]=i.options[i.type]||{},i.options[i.type].size=r.option.size.form,["search","formAdd","formUpdate"].forEach(p=>{i.options[p]=i.options[p]||ObjectUtil.deepMerge(i.options,{}),i.options[p][i.type]=i.options[p][i.type]||{},i.options[p][i.type].size=p==="search"?r.option.size.search:r.option.size.form}),i.table=ObjectUtil.deepMerge(i.table,i.options[i.type].table||{})}i.type==="switch"&&(i.options.switch.tableBeforeChange=async(s,m)=>{const p=i.options?.switch;try{p.tableConfig?.confirm&&await n.value?.open({title:y.tCurd("confirmModify"),content:y.tCurd("confirmSwitchMessage")});try{if(!r.option.api.update&&!p.tableConfig?.api)return;const c=m[r.option.table?.rowKey];p.loadingMap||(p.loadingMap={}),p.loadingMap[c]||(p.loadingMap[c]={loading:!1}),p.loadingMap[c].loading=!0;const k=m[s]===p.activeValue?p.inactiveValue:p.activeValue,l=p.tableConfig?.api?p.tableConfig.api:r.option.api.update;if(!l)return;try{await l({...m,[s]:k},"switch")}catch{return!1}finally{p.loadingMap[c].loading=!1}return b.success(y.tCurd("operationSuccess")),p.tableConfig?.loadList&&(a.table.loading=!0,a.table.getList(),a.table.loading=!1),!0}catch(c){return console.error(c),!1}finally{a.table.loading=!1}}catch{return!1}}),i.type==="treeSelect"&&(i.options.treeSelect.rowKey=r.option.table?.rowKey,i.options.treeSelect.nodeKey=r.option.table?.rowKey)};r.option.column.forEach(t),r.option.table?.column?.forEach(t)},getColumnSpan:(o,t)=>{if(o.item.form?.spanCol){const i=w.config.form.defaultSpan,m=t.filter(p=>!b.isFun(p.item.show?.form,a.update.form,a.update.type)).reduce((p,c)=>p+(c.item.form?.span||i),0);return(o.item?.form.span||i)+m}return o.item.form.span},initColumnForm:()=>{const o=r.option;a.update.formColumn=[],a.table.column.show={list:[],listSource:[]};const t=[],i=r.option.form?.maxSpan||12,s=r.option.form?.defaultSpan||i/2;let m=[];const p=l=>{if(l.children){a.table.column.show.list.push(l.key),l.children.forEach(h=>{p(h)});return}if(a.update.formDefault[l.key]=l.value,l.table.table&&(l.show.table&&a.table.column.show.list.push(l.key),l.table.table&&a.table.column.show.listSource.push(l.key)),!(l.isForm&&typeof l.show?.form=="boolean")||l.show?.form){l.form=l.form||{span:s},l.form.span=l.form.span??s;let h=l.form.span,u=m.reduce((V,S)=>V+S.span,h);const E=m.length;if(m.push({item:l,span:h}),(E===1&&m[0].span===0||u>=i||h===0&&E>1)&&(t.push(m),m=[]),l.rules){const V={input:y.tCurd("placeholderInput"),select:y.tCurd("placeholderSelect")},S=(V[l.type]||V.input)+l.label;a.update.rules[l.key]=typeof l.rules=="boolean"?[{required:!0,message:S,trigger:"blur"}]:l.rules}}},c=(l,h)=>{l.isForm=h,Array.isArray(l.children)&&l.children.forEach(u=>c(u,h))};o.column.forEach(l=>{l.isForm=!0,c(l,!0),p(l)}),r.option.table?.column?.forEach(l=>{c(l,!1),p(l)}),a.search.column.list=o.column.concat(o.table?.column||[]),a.table.column.list=a.search.column.list.filter(l=>l.table?.table),a.search.column.list.sort((l,h)=>l.sort?.search-h.sort?.search),a.table.column.list.sort((l,h)=>l.sort?.table-h.sort?.table),m.length>0&&t.push(m),a.update.formColumn=t;const k=r.option.search?.formDefault;k&&Object.keys(k).forEach(l=>{a.search.formDefault[l]=k[l]}),o.column.forEach(l=>{l.show?.search||(a.search.formDefault[l.key]=void 0)}),a.search.form=ObjectUtil.deepMerge(a.search.formDefault,{})}});return a.init(),e.onMounted(()=>{r.option.init!==!1&&a.table.getList()}),{conf:a,switchConfirmRef:n,ruleFormRef:f,tableRef:d}},G={class:"dialog-footer"},J=e.defineComponent({__name:"switchConfirm",props:{size:{}},setup(r,{expose:n}){const f=e.ref(!1),d=e.ref("确认修改"),a=e.ref("确认要修改状态吗?");let o=null,t=null;const i=p=>(p?.title&&(d.value=p.title),p?.content&&(a.value=p.content),f.value=!0,new Promise((c,k)=>{o=c,t=k})),s=()=>{f.value=!1,o?.(!0),o=null,t=null},m=()=>{f.value=!1,t?.(new Error("用户取消操作")),o=null,t=null};return n({open:i}),(p,c)=>{const k=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(e.unref(g.ElDialog),{modelValue:f.value,"onUpdate:modelValue":c[0]||(c[0]=l=>f.value=l),title:d.value,"close-on-click-modal":!1,width:"400px"},{footer:e.withCtx(()=>[e.createVNode(k,{size:p.size},{default:e.withCtx(()=>[e.createElementVNode("span",G,[e.createVNode(e.unref(g.ElButton),{onClick:m},{default:e.withCtx(()=>c[1]||(c[1]=[e.createTextVNode("取消")])),_:1}),e.createVNode(e.unref(g.ElButton),{type:"primary",onClick:s},{default:e.withCtx(()=>c[2]||(c[2]=[e.createTextVNode("确认")])),_:1})])]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(a.value),1)]),_:1},8,["modelValue","title"])}}}),z=(r,n)=>{const f=r.__vccOpts||r;for(const[d,a]of n)f[d]=a;return f},Q={},X={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function Y(r,n){return e.openBlock(),e.createElementBlock("svg",X,n[0]||(n[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 Z=z(Q,[["render",Y]]),P={},_={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function v(r,n){return e.openBlock(),e.createElementBlock("svg",_,n[0]||(n[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 ee=z(P,[["render",v]]),te={},oe={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function ne(r,n){return e.openBlock(),e.createElementBlock("svg",oe,n[0]||(n[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 ae=z(te,[["render",ne]]),re={},le={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function ie(r,n){return e.openBlock(),e.createElementBlock("svg",le,n[0]||(n[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 de=z(re,[["render",ie]]),se={class:"row flex-center table-header-label inline"},ce={class:"table-header-tooltip"},fe=["onClick"],pe={key:1},me=["onClick","innerHTML"],he=e.defineComponent({__name:"tableColumn",props:{conf:{},columnList:{},option:{}},setup(r){const n=b.isFun,f=e.getCurrentInstance().type;return(d,a)=>{const o=e.resolveComponent("el-tooltip");return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.columnList,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.key},[d.conf.table.column.show.list.includes(t.key)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.table?.header?.groupKey===void 0||t.table.header.show?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),e.mergeProps({key:0,prop:t.key,label:t.label,ref_for:!0},t.table),{header:e.withCtx(()=>[e.renderSlot(d.$slots,"table-header-"+t.key,{item:t},()=>[e.createElementVNode("div",se,[t.table?.header?.tooltip?(e.openBlock(),e.createBlock(o,{key:0,effect:"dark",content:t.table?.header?.tooltip,placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("span",ce,[e.createVNode(ee)])]),_:2},1032,["content"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label)+" ",1),t.table?.header?.group!==void 0?(e.openBlock(),e.createElementBlock("span",{key:1,class:"table-header-plus",onClick:e.withModifiers(()=>{t.table.header.group=!t.table.header.group,d.columnList.forEach(i=>{i.table?.header?.groupKey===t.key&&(i.table.header.show=!t.table.header.group)})},["stop"])},[t.table.header.group?(e.openBlock(),e.createBlock(ae,{key:0})):(e.openBlock(),e.createBlock(de,{key:1}))],8,fe)):e.createCommentVNode("",!0)])])]),default:e.withCtx(({row:i})=>[t.children?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a[0]||(a[0]=e.createTextVNode(" ")),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(f)),{conf:d.conf,columnList:t.children,option:d.option},e.createSlots({_:2},[e.renderList(d.$slots,(s,m)=>({name:m,fn:e.withCtx(p=>[e.renderSlot(d.$slots,m,e.mergeProps({ref_for:!0},p||{}))])}))]),1032,["conf","columnList","option"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[d.option.table?.editMode?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row",["table-edit-"+t.key]]),style:{width:"100%"}},[e.renderSlot(d.$slots,"table-edit-left-"+t.key,{row:i,item:t}),t.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:0,modelValue:i[t.key],"onUpdate:modelValue":s=>i[t.key]=s,disabled:d.conf.update.getDisabled(t,!0),class:"col",ref_for:!0},d.conf.update.getBind(t),e.toHandlers(d.conf.update.getOn(t,i))),e.createSlots({_:2},[t.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof t.options?.input?.prepend=="function"?t.options?.input?.prepend(i):t.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:1,modelValue:i[t.key],"onUpdate:modelValue":s=>i[t.key]=s,disabled:d.conf.update.getDisabled(t,!0),class:"col",ref_for:!0},d.conf.update.getBind(t),e.toHandlers(d.conf.update.getOn(t,i))),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options?.search?.select?.data||t.options?.select?.data,s=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:2,modelValue:i[t.key],"onUpdate:modelValue":s=>i[t.key]=s,disabled:d.conf.update.getDisabled(t,!0),class:"col",ref_for:!0},d.conf.update.getBind(t),e.toHandlers(d.conf.update.getOn(t,i))),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0),e.renderSlot(d.$slots,"table-edit-right-"+t.key,{row:i,item:t})],2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[d.conf.update.type===e.unref(b).EDialog.Update&&e.unref(n)(t.show?.form,d.conf.update.form,e.unref(b).EDialog.Update)&&d.option.table?.inlineEdit&&d.conf.update.form[d.option.table?.rowKey]===i[d.option.table?.rowKey]&&(t.type==="input"||t.type==="select")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:0,modelValue:d.conf.update.form[t.key],"onUpdate:modelValue":s=>d.conf.update.form[t.key]=s,disabled:d.conf.update.getDisabled(t,!0),ref_for:!0},d.conf.update.getBind(t),e.toHandlers(d.conf.update.getOn(t,i)),{style:{width:"100%"}}),e.createSlots({_:2},[t.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof t.options?.input?.prepend=="function"?t.options?.input?.prepend(i):t.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:1,modelValue:d.conf.update.form[t.key],"onUpdate:modelValue":s=>d.conf.update.form[t.key]=s,disabled:d.conf.update.getDisabled(t,!0),ref_for:!0},d.conf.update.getBind(t),e.toHandlers(d.conf.update.getOn(t,i)),{style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options?.search?.select?.data||t.options?.select?.data,s=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:2,modelValue:d.conf.update.form[t.key],"onUpdate:modelValue":s=>d.conf.update.form[t.key]=s,ref_for:!0},d.conf.update.getBind(t),e.toHandlers(d.conf.update.getOn(t,i)),{disabled:d.conf.update.getDisabled(t,!0)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)],64)):e.renderSlot(d.$slots,"table-"+t.key,{key:1,row:i,item:t},()=>[e.unref(B).customComponent[t.type??""]?.table?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[t.type??""]?.table),e.mergeProps({key:0,modelValue:i[t.key],"onUpdate:modelValue":s=>i[t.key]=s,ref_for:!0},t.options?.[t.type??""],e.toHandlers(t.options?.[t.type??""]?.on||{})),null,16,["modelValue","onUpdate:modelValue"])):t.type==="switch"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.options?.switch?.tableConfig?.change?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:0,modelValue:i[t.key],"onUpdate:modelValue":s=>i[t.key]=s,loading:t.options?.switch?.loadingMap?.[i[d.option.table?.rowKey]]?.loading,"before-change":()=>t.options?.switch?.tableBeforeChange?.(t.key,i),ref_for:!0},t.options?.switch),null,16,["modelValue","onUpdate:modelValue","loading","before-change"])):(e.openBlock(),e.createElementBlock("span",pe,e.toDisplayString(i[t.key]===t.options?.switch?.activeValue?t.options?.switch?.activeText:t.options?.switch?.inactiveText),1))],64)):(e.openBlock(),e.createElementBlock("span",{key:2,style:e.normalizeStyle({"--table-text-click-color":t.table?.click?.color}),class:e.normalizeClass({"table-text-click":t.table?.click?.callback}),onClick:s=>t.table?.click?.callback?.(i),innerHTML:t.table?.format?t.table?.format(i):i[t.key]},null,14,me))])],64))],64))]),_:2},1040,["prop","label"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),128)}}}),ge={class:"row form-item-content",style:{width:"100%"}},ye={class:"col column form-item-content-item"},ke={class:"col"},be=["innerHTML"],ue=e.defineComponent({__name:"formColumn",props:{conf:{},item:{}},setup(r){return(n,f)=>(e.openBlock(),e.createBlock(e.unref(g.ElFormItem),{label:n.item.item.text?.form?.label??n.item.item.label,prop:n.item.item.key,"label-width":n.item.item.text?.form?.label==""?0:n.item.item.form?.labelWidth||n.conf.option.form?.labelWidth},{default:e.withCtx(()=>[e.createElementVNode("div",ge,[e.renderSlot(n.$slots,"form-"+n.item.item.key+"-start",{row:n.conf.update.form,item:n.item.item}),e.createElementVNode("div",ye,[e.createElementVNode("div",ke,[e.renderSlot(n.$slots,"form-"+n.item.item.key,{row:n.conf.update.form,item:n.item.item},()=>[n.item.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:0,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[0]||(f[0]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),e.createSlots({_:2},[n.item.item.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof n.item.item.options?.input?.prepend=="function"?n.item.item.options?.input?.prepend(n.conf.update.form):n.item.item.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","disabled"])):n.item.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:1,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[1]||(f[1]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):n.item.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:2,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[2]||(f[2]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.conf.update.getBind(n.item.item).data,d=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):n.item.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(g.ElRadioGroup),e.mergeProps({key:3,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[3]||(f[3]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.conf.update.getBind(n.item.item).data,d=>(e.openBlock(),e.createBlock(e.unref(g.ElRadio),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):n.item.item.type==="list"?(e.openBlock(),e.createBlock(U,e.mergeProps({key:4,row:n.conf.update.form,field:n.item.item.key},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):n.item.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(g.ElTreeSelect),e.mergeProps({key:5,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[4]||(f[4]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),null,16,["modelValue","disabled"])):n.item.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(g.ElDatePicker),e.mergeProps({key:6,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[5]||(f[5]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):n.item.item.type&&(e.unref(B).customComponent[n.item.item.type]||e.unref(B).customComponent[n.item.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[n.item.item.type]?.form||e.unref(B).customComponent[n.item.item.type]),e.mergeProps({key:7,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[6]||(f[6]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(n.$slots,"form-"+n.item.item.key+"-right",{row:n.conf.update.form,item:n.item.item})]),e.renderSlot(n.$slots,"form-"+n.item.item.key+"-tip",{row:n.conf.update.form,item:n.item.item},()=>[n.item.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof n.item.item.form?.tipText=="function"?n.item.item.form?.tipText(n.conf.update.form,n.conf.update.type):n.item.item.form?.tipText},null,8,be)):e.createCommentVNode("",!0)])]),e.renderSlot(n.$slots,"form-"+n.item.item.key+"-end",{row:n.conf.update.form,item:n.item.item})])]),_:3},8,["label","prop","label-width"]))}}),we={},Ce={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function Be(r,n){return e.openBlock(),e.createElementBlock("svg",Ce,n[0]||(n[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 Ve=z(we,[["render",Be]]),Ee={},Se={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function Ne(r,n){return e.openBlock(),e.createElementBlock("svg",Se,n[0]||(n[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 De=z(Ee,[["render",Ne]]),ze={key:0,class:"relative curd-search fit-width"},$e={class:"mb-10 flex justify-between items-center fit-width"},Ue={class:"flex items-center",style:{gap:"10px"}},Fe={key:0},Oe={key:1},Te={key:2},Me={class:"export-btn"},Le={key:1,class:"export-btn"},xe={class:"flex items-center table-tools-right",style:{gap:"10px"}},Ae={class:"row justify-end mt-10 mb-10 table-bottom-pagination"},He={class:"dialog-footer"},je={class:"dialog-footer"},T=e.defineComponent({__name:"index",props:{option:{default:{}}},setup(r,{expose:n}){const f=b.EDialog,d=r,a=b.isFun,{conf:o,switchConfirmRef:t,ruleFormRef:i,tableRef:s}=q(d);return n({conf:o}),(m,p)=>{const c=e.resolveComponent("el-tooltip"),k=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative cc1-form-box",[r.option.table?.fitHeight?"col":"no-min-height"]])},[e.createElementVNode("div",{class:e.normalizeClass(["row",[r.option.table?.fitHeight?"absolute fit":""]]),style:{overflow:"hidden"}},[e.renderSlot(m.$slots,"box-left"),e.createElementVNode("div",{class:e.normalizeClass(["column fit-width no-wrap",[r.option.table?.fitHeight?"col":""]])},[r.option.search?.show!==!1?(e.openBlock(),e.createElementBlock("div",ze,[e.createVNode(e.unref(g.ElForm),{model:e.unref(o).search.form,inline:"",size:r.option.size?.search},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"search-start",{row:e.unref(o).search.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).search.column.list,l=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:l.key},[e.renderSlot(m.$slots,"search-"+l.key+"-start",{row:e.unref(o).search.form}),(typeof l.show?.search=="function"?l.show?.search(e.unref(o).search.form):l.show?.search)?(e.openBlock(),e.createBlock(e.unref(g.ElFormItem),{key:0,label:l.text?.search?.label??l.label},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"search-"+l.key+"-left",{row:e.unref(o).search.form}),e.renderSlot(m.$slots,"search-"+l.key,{row:e.unref(o).search.form},()=>[e.unref(B).customComponent[l.type??""]?.search?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[l.type??""]?.search),e.mergeProps({key:0,modelValue:e.unref(o).search.form[l.key],"onUpdate:modelValue":h=>e.unref(o).search.form[l.key]=h,ref_for:!0},l.options?.search?.[l.type??""],e.toHandlers(l.options?.search?.[l.type??""]?.on||{})),null,16,["modelValue","onUpdate:modelValue"])):l.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:1,modelValue:e.unref(o).search.form[l.key],"onUpdate:modelValue":h=>e.unref(o).search.form[l.key]=h,placeholder:e.unref(o).search.getPlaceholder(l),clearable:"",disabled:l.disabled?.search,ref_for:!0},l.options?.search?.input||l.options?.input,e.toHandlers(l.options?.search?.input?.on||l.options?.input?.on||{})),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):l.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:2,modelValue:e.unref(o).search.form[l.key],"onUpdate:modelValue":h=>e.unref(o).search.form[l.key]=h,placeholder:e.unref(o).search.getPlaceholder(l,e.unref(y).tCurd("placeholderSelect")),clearable:"",disabled:l.disabled?.search,ref_for:!0},l.options?.search?.switch||l.options?.switch,e.toHandlers(l.options?.search?.switch?.on||l.options?.switch?.on||{})),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:l.options?.switch?.activeValue,label:l.options?.switch?.activeText,value:l.options?.switch?.activeValue},null,8,["label","value"])),(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:l.options?.switch?.inactiveValue,label:l.options?.switch?.inactiveText,value:l.options?.switch?.inactiveValue},null,8,["label","value"]))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder","disabled"])):l.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:3,modelValue:e.unref(o).search.form[l.key],"onUpdate:modelValue":h=>e.unref(o).search.form[l.key]=h,placeholder:e.unref(o).search.getPlaceholder(l,e.unref(y).tCurd("placeholderSelect")),clearable:"",disabled:l.disabled?.search,ref_for:!0},l.options?.search?.select||l.options?.select,e.toHandlers(l.options?.search?.select?.on||l.options?.select?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options?.select?.data,h=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:h.value,label:h.label,value:h.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder","disabled"])):l.type==="radio"?(e.openBlock(),e.createBlock(e.unref(g.ElRadioGroup),e.mergeProps({key:4,modelValue:e.unref(o).search.form[l.key],"onUpdate:modelValue":h=>e.unref(o).search.form[l.key]=h,disabled:l.disabled?.search,ref_for:!0},l.options?.search?.radio||l.options?.radio,e.toHandlers(l.options?.search?.radio?.on||l.options?.radio?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options?.radio?.data,h=>(e.openBlock(),e.createBlock(e.unref(g.ElRadio),{key:h.value,label:h.label,value:h.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):l.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(g.ElDatePicker),e.mergeProps({key:5,modelValue:e.unref(o).search.form[l.key],"onUpdate:modelValue":h=>e.unref(o).search.form[l.key]=h,disabled:l.disabled?.search,ref_for:!0},l.options?.search?.datetime||l.options?.datetime,e.toHandlers(l.options?.search?.datetime?.on||l.options?.datetime?.on||{})),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.type&&e.unref(B).customComponent[l.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[l.type]),e.mergeProps({key:6,modelValue:e.unref(o).search.form[l.key],"onUpdate:modelValue":h=>e.unref(o).search.form[l.key]=h,ref_for:!0},l.options?.search?.[l.type]||l.options?.[l.type],e.toHandlers(l.options?.search?.[l.type]?.on||l.options?.[l.type]?.on||{}),{disabled:l.disabled?.search}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(m.$slots,"search-"+l.key+"-right",{row:e.unref(o).search.form})]),_:2},1032,["label"])):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"search-"+l.key+"-end",{row:e.unref(o).search.form})],64))),128)),e.renderSlot(m.$slots,"search-center",{row:e.unref(o).search.form}),r.option.tools?.search||r.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(g.ElFormItem),{key:0},{default:e.withCtx(()=>[r.option.tools?.search?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:0,type:"primary",onClick:e.unref(o).search.submit},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("search")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),r.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:1,onClick:e.unref(o).search.reset},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("reset")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"search-end",{row:e.unref(o).search.form})]),_:3},8,["model","size"])])):e.createCommentVNode("",!0),e.createElementVNode("div",$e,[e.createElementVNode("div",Ue,[e.unref(a)(r.option.tools?.add)?(e.openBlock(),e.createElementBlock("div",Fe,[e.createVNode(e.unref(g.ElButton),{type:"primary",onClick:p[0]||(p[0]=l=>e.unref(o).update.open(e.unref(f).Add)),size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("add")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),r.option.table?.selectable&&e.unref(a)(r.option.tools?.delete)?(e.openBlock(),e.createElementBlock("div",Oe,[e.createVNode(e.unref(g.ElButton),{type:"danger",onClick:p[1]||(p[1]=l=>e.unref(o).remove.open(e.unref(o).table.selection.list)),size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("delete")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),r.option.tools?.expand?(e.openBlock(),e.createElementBlock("div",Te,[e.createVNode(e.unref(g.ElButton),{type:"warning",onClick:p[2]||(p[2]=l=>e.unref(o).table.expand.all()),size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("expandCollapse")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),r.option.tools?.export?.show?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[r.option.tools?.export?.dropdown?.show?(e.openBlock(),e.createBlock(e.unref(g.ElDropdown),{key:0,onCommand:e.unref(o).export.click},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(g.ElDropdownMenu),{size:r.option.size?.search},{default:e.withCtx(()=>[r.option.tools?.export?.dropdown?.select&&(r.option.table?.selectable||e.unref(a)(r.option.tools?.delete))?(e.openBlock(),e.createBlock(e.unref(g.ElDropdownItem),{key:0,command:"select"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("exportSelect")),1)]),_:1})):e.createCommentVNode("",!0),r.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(y).tCurd("exportPage")),1)]),_:1})):e.createCommentVNode("",!0),r.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(y).tCurd("exportAll")),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",Me,[e.createVNode(e.unref(g.ElButton),{type:"warning",loading:e.unref(o).export.loading,size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("export")),1)]),_:1},8,["loading","size"])])]),_:1},8,["onCommand"])):(e.openBlock(),e.createElementBlock("div",Le,[e.createVNode(e.unref(g.ElButton),{type:"warning",loading:e.unref(o).export.loading,size:r.option.size?.search,onClick:p[3]||(p[3]=l=>e.unref(o).export.run.start("all"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("export")),1)]),_:1},8,["loading","size"])]))],64)):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"tools-left")]),e.createElementVNode("div",xe,[e.renderSlot(m.$slots,"tools-right"),e.unref(o).page.showTools?(e.openBlock(),e.createBlock(e.unref(g.ElPagination),e.mergeProps({key:0,"current-page":e.unref(o).page.num,"onUpdate:currentPage":p[4]||(p[4]=l=>e.unref(o).page.num=l),"page-size":e.unref(o).page.size,"onUpdate:pageSize":p[5]||(p[5]=l=>e.unref(o).page.size=l),background:"","page-sizes":e.unref(o).page.sizeList,"pager-count":e.unref(o).page.pagerCount,layout:e.unref(o).page.layout,total:e.unref(o).page.total,size:r.option.size?.table,onSizeChange:e.unref(o).table.getList,onCurrentChange:e.unref(o).table.getList},r.option.page?.pagination||{},e.toHandlers(r.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0),r.option.tools?.expandColumn===void 0||r.option.tools?.expandColumn?(e.openBlock(),e.createBlock(c,{key:1,effect:"dark",content:e.unref(o).table.header.group.expand?e.unref(y).tCurd("mergeColumn"):e.unref(y).tCurd("expandColumn"),placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["refresh-btn",[r.option.size?.search]]),onClick:p[6]||(p[6]=(...l)=>e.unref(o).table.header.group.toggleExpandAll&&e.unref(o).table.header.group.toggleExpandAll(...l))},[e.unref(o).table.header.group.expand?(e.openBlock(),e.createBlock(Ve,{key:0})):(e.openBlock(),e.createBlock(De,{key:1}))],2)]),_:1},8,["content"])):e.createCommentVNode("",!0),r.option.tools?.refresh===void 0||r.option.tools?.refresh?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["refresh-btn",[r.option.size?.search]]),onClick:p[7]||(p[7]=(...l)=>e.unref(o).table.getList&&e.unref(o).table.getList(...l))},[e.createVNode(Z)],2)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:e.normalizeClass(["fit-width relative form-box",[r.option.table?.fitHeight?"col ":"",r.option.table?.editMode?"edit-mode":""]])},[e.createElementVNode("div",{class:e.normalizeClass(["column form-box-content",[r.option.table?.fitHeight?"absolute fit":""]])},[e.withDirectives((e.openBlock(),e.createBlock(e.unref(g.ElTable),e.mergeProps({ref_key:"tableRef",ref:s,data:e.unref(o).table.data,border:r.option.table?.border===void 0?!0:r.option.table?.border,onSelectionChange:e.unref(o).table.selection.change,onSortChange:e.unref(o).table.sort.change,"expand-row-keys":e.unref(o).table.expand.rowKeys,onExpandChange:e.unref(o).table.expand.change},r.option.table,e.toHandlers(r.option.table?.on||{})),{default:e.withCtx(()=>[(typeof r.option.table?.selectable=="object"?r.option.table?.selectable?.show:r.option.table?.selectable)||e.unref(a)(r.option.tools?.delete)||r.option.tools?.export?.show&&r.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 r.option.table?.selectable=="object"?r.option.table?.selectable:{},e.toHandlers(typeof r.option.table?.selectable=="object"?r.option.table?.selectable?.on||{}:{})),null,16)):e.createCommentVNode("",!0),e.createVNode(he,{conf:e.unref(o),columnList:e.unref(o).table.column.list,option:r.option},e.createSlots({_:2},[e.renderList(m.$slots,(l,h)=>({name:h,fn:e.withCtx(u=>[e.renderSlot(m.$slots,h,e.normalizeProps(e.guardReactiveProps(u||{})))])}))]),1032,["conf","columnList","option"]),e.unref(a)(r.option.table?.add)||e.unref(a)(r.option.table?.update)||e.unref(a)(r.option.table?.delete)||e.unref(a)(r.option.table?.view)||m.$slots["table-op-left"]||m.$slots["table-op-right"]?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),e.mergeProps({key:1,width:"auto","max-width":"200",align:"center",fixed:"right"},r.option.table?.operate,{"show-overflow-tooltip":!1}),{header:e.withCtx(()=>[e.renderSlot(m.$slots,"table-header-op",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("operation")),1)])]),default:e.withCtx(({row:l})=>[e.createVNode(e.unref(g.ElForm),{size:r.option.size?.table},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"table-op-left",{row:l}),e.unref(o).update.type===e.unref(f).Update&&r.option.table?.inlineEdit&&e.unref(o).update.form[d.option.table?.rowKey]===l[d.option.table?.rowKey]?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(g.ElButton),{link:"",type:"info",onClick:e.unref(o).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("cancel")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(g.ElButton),{link:"",type:"primary",onClick:e.unref(o).update.submit,loading:e.unref(o).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("confirm")),1)]),_:1},8,["onClick","loading"]),e.renderSlot(m.$slots,"table-op-edit-right",{row:l})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(a)(r.option.table?.add,l)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:0,link:"",type:"primary",onClick:h=>e.unref(o).update.open(e.unref(f).Add,l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("add")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(r.option.table?.view,l)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:1,link:"",type:"primary",onClick:h=>e.unref(o).update.open(e.unref(f).View,l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("view")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(r.option.table?.update,l)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:2,link:"",type:"warning",onClick:h=>e.unref(o).update.open(e.unref(f).Update,l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("edit")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(r.option.table?.delete,l)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:3,link:"",type:"danger",onClick:h=>e.unref(o).remove.open([l])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("delete")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"table-op-right",{row:l})],64))]),_:2},1032,["size"])]),_:3},16)):e.createCommentVNode("",!0)]),_:3},16,["data","border","onSelectionChange","onSortChange","expand-row-keys","onExpandChange"])),[[k,e.unref(o).table.loading]])],2)],2),e.createElementVNode("div",Ae,[(r.option.page?.show===void 0||r.option.page?.show)&&!e.unref(o).page.showTools?(e.openBlock(),e.createBlock(e.unref(g.ElPagination),e.mergeProps({key:0,"current-page":e.unref(o).page.num,"onUpdate:currentPage":p[8]||(p[8]=l=>e.unref(o).page.num=l),"page-size":e.unref(o).page.size,"onUpdate:pageSize":p[9]||(p[9]=l=>e.unref(o).page.size=l),background:"","page-sizes":e.unref(o).page.sizeList,"pager-count":e.unref(o).page.pagerCount,layout:e.unref(o).page.layout,total:e.unref(o).page.total,size:r.option.size?.table,onSizeChange:e.unref(o).table.getList,onCurrentChange:e.unref(o).table.getList},r.option.page?.pagination||{},e.toHandlers(r.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(m.$slots,"box-right")],2),e.createVNode(e.unref(g.ElDialog),e.mergeProps({modelValue:e.unref(o).update.show,"onUpdate:modelValue":p[10]||(p[10]=l=>e.unref(o).update.show=l),title:e.unref(o).update.title,"before-close":e.unref(o).update.close},r.option.dialog),{footer:e.withCtx(()=>[e.createElementVNode("span",He,[e.createVNode(e.unref(g.ElForm),{size:r.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(g.ElButton),{onClick:e.unref(o).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("close")),1)]),_:1},8,["onClick"]),e.unref(o).update.type!==e.unref(f).View?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:0,type:"primary",onClick:e.unref(o).update.submit,loading:e.unref(o).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("submit")),1)]),_:1},8,["onClick","loading"])):e.createCommentVNode("",!0)]),_:1},8,["size"])])]),default:e.withCtx(()=>[e.createVNode(e.unref(g.ElForm),{ref_key:"ruleFormRef",ref:i,model:e.unref(o).update.form,rules:e.unref(o).update.rules,size:r.option.size?.form,class:"update-dialog-form"},{default:e.withCtx(()=>[e.unref(o).update.showContent?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(o).update.formColumn,l=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)((()=>{const h=[],u=E=>{E?.item?.children?u(E.item.children):h.push(...E.map(V=>V.item?.show?.form))};return u(l),h})(),e.unref(o).update.form,e.unref(o).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:r.option.form?.stripe===void 0?!0:r.option.form?.stripe}])},[e.renderSlot(m.$slots,"form-start",{row:e.unref(o).update.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l,h=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)(h.item.show?.form,e.unref(o).update.form,e.unref(o).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([h.item.form.span>0?`col-${e.unref(o).getColumnSpan(h,l)}`:"col",`form-item-col-${h.item.key}`])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.item.children?h.children:[h],u=>(e.openBlock(),e.createBlock(ue,{key:u.item.key,conf:e.unref(o),item:u},e.createSlots({_:2},[e.renderList(m.$slots,(E,V)=>({name:V,fn:e.withCtx(S=>[e.renderSlot(m.$slots,V,e.mergeProps({ref_for:!0},S||{}))])}))]),1032,["conf","item"]))),128))],2)):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(m.$slots,"form-end",{row:e.unref(o).update.form})],2)):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0)]),_:3},8,["model","rules","size"])]),_:3},16,["modelValue","title","before-close"]),e.createVNode(e.unref(g.ElDialog),{modelValue:e.unref(o).remove.show,"onUpdate:modelValue":p[11]||(p[11]=l=>e.unref(o).remove.show=l),title:e.unref(o).remove.title,"close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createElementVNode("span",je,[e.createVNode(e.unref(g.ElForm),{size:r.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(g.ElButton),{onClick:e.unref(o).remove.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("close")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(g.ElButton),{type:"danger",onClick:e.unref(o).remove.submit,loading:e.unref(o).remove.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("confirmDelete")),1)]),_:1},8,["onClick","loading"])]),_:1},8,["size"])])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(e.unref(y).tCurd("confirmDeleteMessage",e.unref(o).remove.items.length)),1)]),_:1},8,["modelValue","title"]),e.createVNode(J,{ref_key:"switchConfirmRef",ref:t,size:r.option.size?.form},null,8,["size"])],2)}}});class Ie{static async download(n,f="download.png"){const d=document.createElement("a");d.style.display="none",d.href=n,d.setAttribute("download",f),typeof d.download>"u"&&d.setAttribute("target","_blank"),document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(n)}static exportJSONFile=(n,f)=>{const d=new Blob([JSON.stringify(n)],{type:"application/json"}),a=URL.createObjectURL(d),o=document.createElement("a");o.href=a,o.download=`${f||"config"}.json`,o.click()};static importFile=async n=>new Promise((f,d)=>{const a=document.createElement("input");a.type="file";const o=n?.accept||".json";a.accept=o,a.style.display="none",a.onchange=t=>{const i=t.target.files[0];if(!i){b.fail("未选择文件"),d("未选择文件");return}const s=new FileReader;s.onload=async m=>{const p=o==".json"?JSON.parse(m.target.result):m.target.result;f(p)},s.onerror=()=>{b.fail("文件读取失败"),d("文件读取失败")},s.readAsText(i),document.body.removeChild(a)},document.body.appendChild(a),a.click()})}const M=(r,n)=>{if(r.component("TCurd",T),r.component("TFormList",U),r.component("TColumn",F),n?.customComponent){B.customComponent=n.customComponent;for(const f in n.customComponent)r.component(f,n.customComponent[f])}},Re={install:M};C.ArrUtil=N,C.ExcelUtil=O,C.TColumn=F,C.TCurd=T,C.TFile=Ie,C.TForm=B,C.TFormConfig=w,C.TFormI18n=y,C.TFormList=U,C.TSys=b,C.default=Re,C.install=M,Object.defineProperties(C,{__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")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue-router","vue"],g):(C=typeof globalThis<"u"?globalThis:C||self,g(C.cc1Form={},C.ElementPlus,C.VueRouter,C.Vue))})(this,(function(C,g,We,e){"use strict";class b{static router;static routes;static getRouterPath=()=>this.router.currentRoute.value.path;static EDialog={Add:"Add",Update:"Update",View:"View",Remove:"Remove"};static isFun=(n,...f)=>Array.isArray(n)?n.some(d=>typeof d=="function"?d(...f):d):typeof n=="function"?n(...f):n;static getRouterParams=()=>{const n=this.router.currentRoute.value.query||{},f=this.router.currentRoute.value.params||{};return Object.keys(n).length?n:Object.keys(f).length?f:{}};static moduleObj={};static loadModule=async n=>{if(!b.moduleObj[n])throw new Error(`模块${n}未加载,请赋值如:TSys.moduleObj = { ${n}: ()=>import('${n}') }`);const f=await b.moduleObj[n]();return f.default??f};static tipMessages={};static tipMessagesGap=500;static showMessage(n,f,d={}){const a=Date.now();if(!this.tipMessages[n]||a-this.tipMessages[n]>this.tipMessagesGap){this.tipMessages[n]=a;const o=Object.assign({message:n,type:f},d);g.ElMessage(o),setTimeout(()=>{delete this.tipMessages[n]},this.tipMessagesGap)}}static fail=(n,f={})=>{this.showMessage(n,"error",f)};static success=(n,f={})=>{this.showMessage(n,"success",f)};static loadingObj=null;static loadingTimer=null;static loading=(n=!0,f="Loading...")=>{Timer.un(this.loadingTimer),this.loadingTimer=Timer.once(()=>{n?this.loadingObj=g.ElLoading.service({lock:!0,text:f,background:"rgba(0, 0, 0, 0.3)"}):this.loadingObj&&(this.loadingObj.close(),this.loadingObj=null)},50)};static openUrl=(n,f=!0)=>{if(f){let d=screen.width/2-500,a=screen.height/2-800/2-30;window.open(n,"_blank","toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top="+a+", left="+d)}else window.open(n,"DescriptiveWindowName"+StrUtil.getId(),"resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0")};static getImgPic=n=>new Promise(async(f,d)=>{let a=document.getElementById(n.id);const o=await b.loadModule("html2canvas");try{o(a,{logging:!1,allowTaint:!0,scale:window.devicePixelRatio,width:n.windowWidth,height:n.windowHeight,windowWidth:n.windowWidth,windowHeight:n.windowHeight,useCORS:!0,backgroundColor:"#ffffff00"}).then(function(t){let i=t.toDataURL("image/png");f(i)})}catch(t){d(t)}})}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:{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=n=>{w.config=ObjectUtil.deepMerge(w.config,n)}}class B{static customComponent={};static findOptions=(n,f)=>{const d=n.column.find(o=>o.key===f),a=o=>o.replace(/-([a-z])/g,(t,i)=>i.toUpperCase());if(d)return d.options[a(d.type)]};static setOptionsData=(n,f,d)=>{const a=B.findOptions(n,f);a&&(a.data=d)};static form={openBefore:{parentId:(n,f,d,a)=>{const o=w.config.table.rowKey;n?f.type===b.EDialog.Add?(f.form.parentId=n[o],f.form.sort=n.children.length+1):f.form.parentId=n.parentId.substring(n.parentId.lastIndexOf(",")+1):(f.form.parentId="0",f.form.sort=d.length+1),B.setOptionsData(a,"parentId",[{[o]:"0",title:"根",children:d}])}}}}function qe(r){return r}const L={search:"搜索",add:"新增",edit:"编辑",view:"查看",delete:"删除",export:"导出",exportSelect:"导出选中",exportPage:"导出本页",exportAll:"导出全部",import:"导入",refresh:"刷新",reset:"重置",expandCollapse:"展开/收缩",operation:"操作",close:"关闭",cancel:"取消",submit:"提交",confirm:"确认",confirmDelete:"确认删除",confirmDeleteMessage:"确认要删除【{count}】条数据吗?",placeholderInput:"请输入",placeholderSelect:"请选择",checkFormData:"请检查表单数据",selectDataToDelete:"请选择要删除的数据",selectDataToExport:"请选择要导出的数据",noData:"暂无数据",operationSuccess:"操作成功",switchOn:"开启",switchOff:"关闭",confirmModify:"确认修改",confirmSwitchMessage:"确认要修改吗?",mergeColumn:"合并栏位",expandColumn:"展开栏位"};class y{static t(n,...f){if(typeof n=="function")return n(...f);n=String(n);let d=0;return n.replace(/{([^}]+)}/g,(a,o)=>d<f.length?String(f[d++]):`{${o}}`)}static setI18n=n=>{y.curd=ObjectUtil.deepMerge(y.curd,n)};static tCurd(n,...f){return this.t(this.curd[n],...f)}static curd=L}class N{static getIdFun=()=>StrUtil.uuid();static setId=(n,f,d)=>{f[n]||(f[n]=[]);const a=w.config.table.rowKey;f[n].forEach(o=>{d.forEach(t=>{let i=t.default??"";t.type==="number"&&(i=t.default??0),t.type==="boolean"&&(i=t.default??!1),t.type==="time"&&(i=t.default??new Date),o[t.value]===void 0&&(o[t.value]=i)}),o[a]||(o[a]=N.getIdFun())})};static add=(n,f,d,a)=>{const o=JSONUtil.cp(d);N.setId(n,f,d);const t=w.config.table.rowKey;f[n].push(o.reduce((i,s)=>{let m=s.default??"";return s.type==="number"&&(m=s.default??0),s.type==="boolean"&&(m=s.default??!1),s.type==="time"&&(m=s.default??new Date),i[s.value]=m,i},{[t]:N.getIdFun()})),a?.(f)};static remove=(n,f,d,a)=>{const o=w.config.table.rowKey;f[n]=f[n].filter(t=>t[o]!==d[o]),a?.(f)};static getNoIdData=(n,f)=>{const d=JSONUtil.cp(n),a=w.config.table.rowKey;return d.forEach(o=>{o[a]&&delete o[a],f&&o[f]&&N.getNoIdData(o[f],f)}),d}}const x={key:0,class:"column curd-form-com-list",style:{width:"100%",gap:"10px"}},A={key:0},H={class:"row items-center",style:{gap:"10px",width:"100%"}},j={key:1},U=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(r,{emit:n}){const f=r,d=e.reactive({show:!1,add:(o,t,i)=>{N.add(o,t,i,()=>{a("change")})},remove:(o,t,i)=>{N.remove(o,t,i,()=>{a("change")})}});e.onMounted(()=>{N.setId(f.field,f.row,f.itemFields),d.show=!0});const a=n;return(o,t)=>{const i=e.resolveComponent("el-button"),s=e.resolveComponent("el-input");return d.show?(e.openBlock(),e.createElementBlock("div",x,[e.renderSlot(o.$slots,"list-start",{row:r.row}),r.addBottom?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",A,[e.createVNode(i,{link:"",type:"primary",onClick:t[0]||(t[0]=m=>d.add(r.field,r.row,r.itemFields))},{default:e.withCtx(()=>t[3]||(t[3]=[e.createTextVNode("添加")])),_:1})])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.row[r.field],m=>(e.openBlock(),e.createElementBlock("div",H,[e.renderSlot(o.$slots,"item-start",{item:m,row:r.row}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.itemFields,p=>(e.openBlock(),e.createBlock(s,{modelValue:m[p.value],"onUpdate:modelValue":c=>m[p.value]=c,style:e.normalizeStyle({width:r.inputWidth}),class:e.normalizeClass(r.inputClass),placeholder:p[r.label]||p[r.value],onChange:t[1]||(t[1]=c=>a("change"))},null,8,["modelValue","onUpdate:modelValue","style","class","placeholder"]))),256)),e.renderSlot(o.$slots,"item-end",{item:m,row:r.row}),e.createVNode(i,{link:"",type:"danger",onClick:p=>d.remove(r.field,r.row,m)},{default:e.withCtx(()=>t[4]||(t[4]=[e.createTextVNode("删除")])),_:2},1032,["onClick"])]))),256)),r.addBottom?(e.openBlock(),e.createElementBlock("div",j,[e.createVNode(i,{link:"",type:"primary",onClick:t[2]||(t[2]=m=>d.add(r.field,r.row,r.itemFields))},{default:e.withCtx(()=>t[5]||(t[5]=[e.createTextVNode("添加")])),_:1})])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"list-end",{row:r.row})])):e.createCommentVNode("",!0)}}}),I={class:"row form-item-content",style:{width:"100%"}},R={class:"col"},K={class:"col"},W=["innerHTML"],F=e.defineComponent({__name:"column",props:{option:{default:{}},type:{default:""}},setup(r,{expose:n}){const f=b.isFun,d=b.EDialog,a=e.ref(),o=r,t=e.reactive({rules:{},show:!0,form:{},formDefault:{},type:o.type||d.Add,formColumn:[],getDisabled:i=>t.type===d.View?i.disabled?.view===void 0?!0:i.disabled?.view:i.disabled?.[t.type===d.Add?"create":"update"],getBind:i=>i.options?.[t.type===d.Add?"formAdd":"formUpdate"]?.[i.type]||i.options?.[i.type]||{},getOn:i=>i.options?.[t.type===d.Add?"formAdd":"formUpdate"]?.[i.type]?.on||i.options?.[i.type]?.on||{},getColumnSpan:(i,s)=>{if(i.item.form?.spanCol){const m=o.option.form?.maxSpan||12,p=o.option.form?.defaultSpan||m/2,k=s.filter(l=>!b.isFun(l.item.show?.form,t.form,t.type)).reduce((l,h)=>l+(h.item.form?.span||p),0);return(i.item.form?.span||p)+k}return i.item.form?.span},initColumnForm:()=>{const i=o.option;t.formColumn=[],t.rules={},t.formDefault={};const s=[],m=o.option.form?.maxSpan||12,p=o.option.form?.defaultSpan||m/2;let c=[];const k=h=>{if(h.children){h.children.forEach(u=>{k(u)});return}if(t.formDefault[h.key]=h.value,h.isForm&&(typeof h.show?.form!="boolean"||h.show?.form)){h.form=h.form||{span:p},h.form.span=h.form.span??p;const u=h.form.span,E=c.reduce((S,$)=>S+$.span,u),V=c.length;if(c.push({item:h,span:u}),(V===1&&c[0].span===0||E>=m||u===0&&V>1)&&(s.push(c),c=[]),h.rules){const S={input:y.tCurd("placeholderInput"),select:y.tCurd("placeholderSelect")},$=(S[h.type]||S.input)+h.label;t.rules[h.key]=typeof h.rules=="boolean"?[{required:!0,message:$,trigger:"blur"}]:h.rules}}},l=(h,u)=>{h.isForm=u,Array.isArray(h.children)&&h.children.forEach(E=>l(E,u))};i.column.forEach(h=>{l(h,!0),k(h)}),c.length>0&&s.push(c),t.formColumn=s,t.form=JSONUtil.cp(t.formDefault)}});return t.initColumnForm(),n({ref:a,conf:t}),(i,s)=>(e.openBlock(),e.createBlock(e.unref(g.ElForm),{ref_key:"ruleFormRef",ref:a,model:t.form,rules:t.rules},{default:e.withCtx(()=>[t.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.formColumn,(m,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:p},[e.unref(f)(m.map(c=>c.item?.show?.form),t.form,t.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:r.option.form?.stripe===void 0?!0:r.option.form?.stripe}])},[e.renderSlot(i.$slots,"form-start",{row:t.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m,c=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c.item.key},[e.unref(f)(c.item.show?.form,t.form,t.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([c.item.form.span>0?`col-${t.getColumnSpan(c,m)}`:"col",`form-item-col-${c.item.key}`])},[e.createVNode(e.unref(g.ElFormItem),{label:c.item.text?.form?.label??c.item.label,prop:c.item.key,"label-width":c.item.text?.form?.label==""?0:c.item.form?.labelWidth||r.option.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.createElementVNode("div",I,[e.renderSlot(i.$slots,"form-"+c.item.key+"-start",{row:t.form,item:c.item}),e.createElementVNode("div",R,[e.createElementVNode("div",K,[e.renderSlot(i.$slots,"form-"+c.item.key,{row:t.form,item:c.item},()=>[c.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:0,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):c.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:1,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):c.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:2,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.item.options?.select?.data,k=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:k.value,label:k.label,value:k.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):c.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(g.ElRadioGroup),e.mergeProps({key:3,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.item.options?.radio?.data,k=>(e.openBlock(),e.createBlock(e.unref(g.ElRadio),{key:k.value,label:k.label,value:k.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):c.item.type==="list"?(e.openBlock(),e.createBlock(U,e.mergeProps({key:4,row:t.form,field:c.item.key,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):c.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(g.ElTreeSelect),e.mergeProps({key:5,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item),style:{width:"100%"}}),null,16,["modelValue","onUpdate:modelValue","disabled"])):c.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(g.ElDatePicker),e.mergeProps({key:6,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):c.item.type&&(e.unref(B).customComponent[c.item.type]||e.unref(B).customComponent[c.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[c.item.type]?.form||e.unref(B).customComponent[c.item.type]),e.mergeProps({key:7,modelValue:t.form[c.item.key],"onUpdate:modelValue":k=>t.form[c.item.key]=k,ref_for:!0},t.getBind(c.item),e.toHandlers(t.getOn(c.item)),{disabled:t.getDisabled(c.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(i.$slots,"form-"+c.item.key+"-right",{row:t.form,item:c.item})]),e.renderSlot(i.$slots,"form-"+c.item.key+"-tip",{row:t.form,item:c.item},()=>[c.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof c.item.form?.tipText=="function"?c.item.form?.tipText(t.form,t.type):c.item.form?.tipText},null,8,W)):e.createCommentVNode("",!0)])]),e.renderSlot(i.$slots,"form-"+c.item.key+"-end",{row:t.form,item:c.item})])]),_:2},1032,["label","prop","label-width"])],2)):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(i.$slots,"form-end",{row:t.form})],2)):e.createCommentVNode("",!0)],64))),128)):e.createCommentVNode("",!0)]),_:3},8,["model","rules"]))}});class T{static exportToExcel=async(n,f,d)=>{if(!n||n.length===0)return;const a=await b.loadModule("xlsx"),o=n.map(s=>{const m={};return f.forEach(p=>{m[p.label]=s[p.key]}),m}),t=a.utils.json_to_sheet(o),i=a.utils.book_new();a.utils.book_append_sheet(i,t,"Sheet1"),d?typeof d=="function"&&(d=d()):d=`导出数据_${new Date().Format("yyyy-MM-dd")}_${new Date().getTime()}`,a.writeFile(i,`${d}.xlsx`)}}const D=b.EDialog,q=r=>{const n=e.ref(),f=e.ref(),d=e.ref(),a=e.reactive({option:r.option,search:{column:{list:[]},form:{},formDefault:{},getPlaceholder:(o,t=y.tCurd("placeholderInput"))=>o.text?.search?.placeholder===void 0?`${t}${o.label}`:o.text?.search?.placeholder,getFormData:()=>{let o={};r.option.column.forEach(i=>{(typeof i.show?.search=="function"?i.show?.search(a.search.form):i.show?.search)&&(o[i.key]=a.search.form[i.key])});const t=r.option.search?.before?.(o);return t&&(o=t),o},reset:()=>{const o=a.search.formDefault;Object.keys(o).forEach(t=>{r.option.search?.resetMode==="none"?o[t]=void 0:o[t]=a.search.formDefault[t]}),a.search.form=ObjectUtil.deepMerge(o,{}),a.page.num=1,r.option.init!==!1&&a.table.getList()},submit:()=>{a.page.num=1,a.table.getList()}},page:{num:1,total:0,layout:r.option.page?.layout||w.config.pagination.layout,showTools:r.option.page?.showTools||w.config.pagination.showTools,size:r.option.page?.size||w.config.pagination.size,sizeList:r.option.page?.sizeList||w.config.pagination.pageSizes,pagerCount:r.option.page?.pagerCount||w.config.pagination.pagerCount,getQuery:(o={})=>({[w.config.field.page.size]:o.size||a.page.size,[w.config.field.page.num]:o.num||a.page.num,...a.search.getFormData()})},table:{op:{width:(...o)=>o.filter(i=>i).length*30+60},loading:!1,data:[],expand:{isExpand:!1,rowKeys:[],change:(o,t)=>{},all:()=>{if(a.table.expand.isExpand)a.table.expand.rowKeys=[];else{const o=t=>{let i=[];return t.forEach(s=>{i.push(s[r.option.table.rowKey]),s.children&&s.children.length>0&&(i=i.concat(o(s.children)))}),i};a.table.expand.rowKeys=o(a.table.data)}a.table.expand.isExpand=!a.table.expand.isExpand}},column:{list:[],show:{listSource:[],list:[]}},header:{group:{expand:!1,toggleExpandAll:()=>{const o=!a.table.header.group.expand;a.table.header.group.expand=o;const t=i=>{i.forEach(s=>{s.table?.header?.group!==void 0&&(s.table.header.group=!o),s.table?.header?.groupKey!==void 0&&(s.table.header.show=o),Array.isArray(s.children)&&s.children.length>0&&t(s.children)})};t(a.table.column.list)}}},getList:async()=>{a.table.loading=!0;const o=r.option.api.list;try{await a.initApiData("init");let t={};if(a.table.sort.prop){const{props:h,order:u}=w.config.table.sort;t={[h.field]:a.table.sort.prop,[u.field]:a.table.sort.order}}const i=await o({...a.page.getQuery(),...t}),s=w.config.field.result,m=i.data||{[s.list]:i};let p=(Array.isArray(m[s.list]),m[s.list]);const c=a.update.formColumn.flat(),l=ObjectUtil.deepMerge({data:p},{}).data.map(h=>(Object.keys(h).forEach(E=>{const V=c.find(S=>S.item.key===E);V&&["select","radio"].includes(V.item.type)&&(V.item.table.format||(V.item.table.format=S=>V.item.options[V.item.type].data?.find($=>$.value==S[E])?.label||S[E]))}),h));a.table.data=r.option.data?await r.option.data(l,p):l,a.page.total=m[s.total]||0}catch(t){console.error(t)}finally{a.table.loading=!1}},selection:{list:[],change:o=>{a.table.selection.list=o},setList:(o,t)=>{a.table.selection.list=[];const i=d.value;if(i?.clearSelection(),!i||!o?.length)return;const s=r.option.table?.rowKey,m=a.table.data,p=c=>{const k=l=>{for(const h of l){if(s!=null&&s!==""){if(h[s]===c[s])return h}else if(h===c)return h;if(Array.isArray(h.children)&&h.children.length){const u=k(h.children);if(u!==void 0)return u}}};return k(m)};e.nextTick(()=>{o.forEach(c=>{const k=p(c)??c;if(t){const l=()=>{i.toggleRowSelection(k,!0,!1)};t(c)!==!1&&l()}else i.toggleRowSelection(k,!0,!1)})})}},sort:{prop:"",order:"",change:o=>{w.config.table.sort.resetPage&&(a.page.num=1);const t=w.config.table.sort;if(t.change){t.change(o,a);return}a.table.sort.prop=o.prop,o.order===null?a.table.sort.order="":a.table.sort.order=o.order==="ascending"?t.order.asc:t.order.desc,a.table.getList()}}},export:{run:{start:async o=>{let t=await a.export.run[o](),i=r.option.column;const s=ObjectUtil.deepMerge({data:t,columns:i},{}),m=r.option.tools?.export||{};m.before&&m.before(s),T.exportToExcel(s.data,s.columns,m.fileName)},select:async()=>{a.export.loading=!0;try{if(r.option.tools?.export?.select){await r.option.tools?.export?.select({...a.page.getQuery(),items:a.table.selection.list});return}if(a.table.selection.list.length===0)throw b.fail(y.tCurd("selectDataToExport")),new Error(y.tCurd("selectDataToExport"));return a.table.selection.list}catch(o){console.error(o)}finally{a.export.loading=!1}},page:async()=>{a.export.loading=!0;try{if(r.option.tools?.export?.page){await r.option.tools?.export?.page({...a.page.getQuery()});return}if(a.table.data.length===0)throw b.fail(y.tCurd("noData")),new Error(y.tCurd("noData"));return a.table.data}catch(o){console.error(o)}finally{a.export.loading=!1}},all:async()=>{a.export.loading=!0;try{if(r.option.tools?.export?.all){await r.option.tools?.export?.all({...a.page.getQuery()});return}const o=r.option.api.list,t=await o({...a.page.getQuery({size:999999,num:1})});return(t.data||{[w.config.field.result.list]:t})[w.config.field.result.list]}catch(o){console.error(o)}finally{a.export.loading=!1}}},loading:!1,click:o=>{a.export.loading||a.export.run.start(o)}},update:{title:"",rules:{},show:!1,showContent:!1,loading:!1,type:D.Update,form:{},formDefault:{},formColumn:[],getDisabled:(o,t=!1)=>r.option.table?.editMode&&t?o.disabled?.table===void 0?!1:o.disabled?.table:a.update.type===D.View?o.disabled?.view===void 0?!0:o.disabled?.view:o.disabled?.[a.update.type===D.Add?"create":"update"],getBind:o=>o.options?.[a.update.type===D.Add?"formAdd":"formUpdate"]?.[o.type]||o.options?.[o.type]||{},getOn:(o,t)=>{const s=o.options?.[a.update.type===D.Add?"formAdd":"formUpdate"]?.[o.type]?.on||o.options?.[o.type]?.on||{},m={};return Object.keys(s).forEach(p=>{const c=s[p];typeof c=="function"?m[p]=function(...k){return c.apply(this,[...k,t||a.update.form,o])}:m[p]=c}),m},getOptions:o=>{try{const i=a.update.formColumn.flat().find(s=>s.item.key===o)?.item;return i?{options:i.options,bind:a.update.getBind(i)}:{options:{},bind:{}}}catch{return{options:{},bind:{}}}},edit:{data:{},getApiData:o=>{if(r.option.form?.editAll)return o;let t={[r.option.table?.rowKey]:a.update.edit.data[r.option.table?.rowKey]};return Object.keys(a.update.edit.data).forEach(i=>{o[i]!==a.update.edit.data[i]&&(t[i]=o[i])}),t}},view:{},open:(o,t)=>{a.update.showContent||FunUtil.throttle(async()=>{b.loading(!0);try{a.update.type=o;const i=o===D.Add;a.update.edit.data=t,a.update.title=y.tCurd(i?"add":o===D.View?"view":"edit"),a.update.form=ObjectUtil.deepMerge(i?a.update.formDefault:t,{}),await a.initApiData("update"),await r.option.form?.openBefore?.(a.update.form,a.update),(!r.option.table?.inlineEdit||i)&&(a.update.show=!0,a.update.showContent=!0),r.option.form?.openAfter?.(a.update.form,a.update)}catch(i){console.error(i)}finally{b.loading(!1)}})},submit:()=>{FunUtil.throttle(async()=>{await f.value?.validate(async(s,m)=>new Promise((p,c)=>{s||(b.fail(y.tCurd("checkFormData")),c(!1)),p()})),a.update.loading=!0;const o=a.update.type===D.Add?r.option.api.create:r.option.api.update;try{await r.option.form?.submitBefore?.(a.update.form,a.update)}catch{a.update.loading=!1;return}let t=ObjectUtil.deepMerge(a.update.form,{});delete t.children;const i=new Set(r.option.column.filter(s=>s.type==="datetime").map(s=>s.key));Object.keys(t).forEach(s=>{if(i.has(s)&&t[s]!=null){const m=new Date(t[s]).getTime();isNaN(m)||(t[s]=m)}});try{if(!o)return;await o({...t}),a.update.close(),await a.table.getList(),r.option.form?.submitAfter?.(t,a.update)}catch(s){console.error(s)}finally{a.update.loading=!1}})},close:()=>{a.update.show=!1,r.option.table?.inlineEdit&&(a.update.form={}),setTimeout(()=>{a.update.showContent=!1},350)}},remove:{title:y.tCurd("confirmDelete"),show:!1,items:[],loading:!1,close:()=>{a.remove.show=!1},open:o=>{if(o.length===0){b.fail(y.tCurd("selectDataToDelete"));return}a.remove.items=o,a.remove.show=!0},submit:()=>{FunUtil.throttle(async()=>{a.remove.loading=!0;const o=r.option.api.delete;try{if(!o)return;await o({[r.option.table?.rowKey]:a.remove.items.map(t=>t[r.option.table?.rowKey]),items:a.remove.items}),b.success(y.tCurd("operationSuccess")),a.table.data.length<=1&&a.page.num>1&&(a.page.num-=1),a.remove.close(),await a.table.getList()}catch(t){console.error(t)}finally{a.remove.loading=!1}})}},init:()=>{a.initCurdConfig(),a.initColumnOptions(),a.initColumnForm()},apiDataMap:{},initApiData:async o=>{const t=[],i=s=>{if(s.children&&s.children.length){s.children.forEach(m=>i(m));return}if(s.options?.[s.type]?.dataApi&&s.options?.[s.type]?.dataApiConfig?.[o]){if(a.apiDataMap[s.key]&&s.options?.[s.type]?.dataApiConfig?.once)return;const m=(async()=>{try{let p=await s.options?.[s.type]?.dataApi?.(a.update.form,a.update.type);if(p){const c=s.options?.[s.type]?.dataPath;!Array.isArray(p)&&c&&(p=ObjectUtil.getPathValue(p,c)),s.options[s.type].data=p,s.options.search[s.type].data=p,s.options.formAdd[s.type].data=p,s.options.formUpdate[s.type].data=p,a.apiDataMap[s.key]=p}}catch{}})();t.push(m)}};return r.option.column.forEach(s=>{i(s)}),await Promise.all(t),!0},initCurdConfig:()=>{const o=ObjectUtil.deepMerge(w.config,{});o.table.emptyText=y.tCurd("noData"),r.option.size=r.option.size||{},o.table.size=r.option.size.table||o.size.table,o.form.size=r.option.size.form||o.size.form,o.size.search=r.option.size.search||o.size.search;const t=ObjectUtil.deepMerge(o,r.option||{});Object.keys(t).forEach(i=>{r.option[i]=t[i]})},initColumnOptions:()=>{let o=JSONUtil.cp(w.config.columnConfig);o.options=ObjectUtil.deepMerge({switch:{activeText:y.tCurd("switchOn"),inactiveText:y.tCurd("switchOff")}},o.options);const t=i=>{for(const s in o){if(s==="table"){if(i.table=ObjectUtil.deepMerge(o.table,i.table||{}),i.children){i.children.forEach(p=>{t(p)});return}}else s==="type"?i.type=i.type||o.type:i[s]=ObjectUtil.deepMerge(o[s],i[s]||{});i.options=i.options||{},i.options[i.type]=i.options[i.type]||{},i.options[i.type].size=r.option.size.form,["search","formAdd","formUpdate"].forEach(p=>{i.options[p]=i.options[p]||ObjectUtil.deepMerge(i.options,{}),i.options[p][i.type]=i.options[p][i.type]||{},i.options[p][i.type].size=p==="search"?r.option.size.search:r.option.size.form}),i.table=ObjectUtil.deepMerge(i.table,i.options[i.type].table||{})}i.type==="switch"&&(i.options.switch.tableBeforeChange=async(s,m)=>{const p=i.options?.switch;try{p.tableConfig?.confirm&&await n.value?.open({title:y.tCurd("confirmModify"),content:y.tCurd("confirmSwitchMessage")});try{if(!r.option.api.update&&!p.tableConfig?.api)return;const c=m[r.option.table?.rowKey];p.loadingMap||(p.loadingMap={}),p.loadingMap[c]||(p.loadingMap[c]={loading:!1}),p.loadingMap[c].loading=!0;const k=m[s]===p.activeValue?p.inactiveValue:p.activeValue,l=p.tableConfig?.api?p.tableConfig.api:r.option.api.update;if(!l)return;try{await l({...m,[s]:k},"switch")}catch{return!1}finally{p.loadingMap[c].loading=!1}return b.success(y.tCurd("operationSuccess")),p.tableConfig?.loadList&&(a.table.loading=!0,a.table.getList(),a.table.loading=!1),!0}catch(c){return console.error(c),!1}finally{a.table.loading=!1}}catch{return!1}}),i.type==="treeSelect"&&(i.options.treeSelect.rowKey=r.option.table?.rowKey,i.options.treeSelect.nodeKey=r.option.table?.rowKey)};r.option.column.forEach(t),r.option.table?.column?.forEach(t)},getColumnSpan:(o,t)=>{if(o.item.form?.spanCol){const i=w.config.form.defaultSpan,m=t.filter(p=>!b.isFun(p.item.show?.form,a.update.form,a.update.type)).reduce((p,c)=>p+(c.item.form?.span||i),0);return(o.item?.form.span||i)+m}return o.item.form.span},initColumnForm:()=>{const o=r.option;a.update.formColumn=[],a.table.column.show={list:[],listSource:[]};const t=[],i=r.option.form?.maxSpan||12,s=r.option.form?.defaultSpan||i/2;let m=[];const p=l=>{if(l.children){a.table.column.show.list.push(l.key),l.children.forEach(h=>{p(h)});return}if(a.update.formDefault[l.key]=l.value,l.table.table&&(l.show.table&&a.table.column.show.list.push(l.key),l.table.table&&a.table.column.show.listSource.push(l.key)),!(l.isForm&&typeof l.show?.form=="boolean")||l.show?.form){l.form=l.form||{span:s},l.form.span=l.form.span??s;let h=l.form.span,u=m.reduce((V,S)=>V+S.span,h);const E=m.length;if(m.push({item:l,span:h}),(E===1&&m[0].span===0||u>=i||h===0&&E>1)&&(t.push(m),m=[]),l.rules){const V={input:y.tCurd("placeholderInput"),select:y.tCurd("placeholderSelect")},S=(V[l.type]||V.input)+l.label;a.update.rules[l.key]=typeof l.rules=="boolean"?[{required:!0,message:S,trigger:"blur"}]:l.rules}}},c=(l,h)=>{l.isForm=h,Array.isArray(l.children)&&l.children.forEach(u=>c(u,h))};o.column.forEach(l=>{l.isForm=!0,c(l,!0),p(l)}),r.option.table?.column?.forEach(l=>{c(l,!1),p(l)}),a.search.column.list=o.column.concat(o.table?.column||[]),a.table.column.list=a.search.column.list.filter(l=>l.table?.table),a.search.column.list.sort((l,h)=>l.sort?.search-h.sort?.search),a.table.column.list.sort((l,h)=>l.sort?.table-h.sort?.table),m.length>0&&t.push(m),a.update.formColumn=t;const k=r.option.search?.formDefault;k&&Object.keys(k).forEach(l=>{a.search.formDefault[l]=k[l]}),o.column.forEach(l=>{l.show?.search||(a.search.formDefault[l.key]=void 0)}),a.search.form=ObjectUtil.deepMerge(a.search.formDefault,{})}});return a.init(),e.onMounted(()=>{r.option.init!==!1&&a.table.getList()}),{conf:a,switchConfirmRef:n,ruleFormRef:f,tableRef:d}},G={class:"dialog-footer"},J=e.defineComponent({__name:"switchConfirm",props:{size:{}},setup(r,{expose:n}){const f=e.ref(!1),d=e.ref("确认修改"),a=e.ref("确认要修改状态吗?");let o=null,t=null;const i=p=>(p?.title&&(d.value=p.title),p?.content&&(a.value=p.content),f.value=!0,new Promise((c,k)=>{o=c,t=k})),s=()=>{f.value=!1,o?.(!0),o=null,t=null},m=()=>{f.value=!1,t?.(new Error("用户取消操作")),o=null,t=null};return n({open:i}),(p,c)=>{const k=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(e.unref(g.ElDialog),{modelValue:f.value,"onUpdate:modelValue":c[0]||(c[0]=l=>f.value=l),title:d.value,"close-on-click-modal":!1,width:"400px"},{footer:e.withCtx(()=>[e.createVNode(k,{size:p.size},{default:e.withCtx(()=>[e.createElementVNode("span",G,[e.createVNode(e.unref(g.ElButton),{onClick:m},{default:e.withCtx(()=>c[1]||(c[1]=[e.createTextVNode("取消")])),_:1}),e.createVNode(e.unref(g.ElButton),{type:"primary",onClick:s},{default:e.withCtx(()=>c[2]||(c[2]=[e.createTextVNode("确认")])),_:1})])]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(a.value),1)]),_:1},8,["modelValue","title"])}}}),z=(r,n)=>{const f=r.__vccOpts||r;for(const[d,a]of n)f[d]=a;return f},Q={},X={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function Y(r,n){return e.openBlock(),e.createElementBlock("svg",X,n[0]||(n[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 Z=z(Q,[["render",Y]]),P={},_={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function v(r,n){return e.openBlock(),e.createElementBlock("svg",_,n[0]||(n[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 ee=z(P,[["render",v]]),te={},oe={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function ne(r,n){return e.openBlock(),e.createElementBlock("svg",oe,n[0]||(n[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 ae=z(te,[["render",ne]]),re={},le={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function ie(r,n){return e.openBlock(),e.createElementBlock("svg",le,n[0]||(n[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 de=z(re,[["render",ie]]),se={class:"row flex-center table-header-label inline"},ce={class:"table-header-tooltip"},fe=["innerHTML"],pe=["onClick"],me={key:1},he=["onClick","innerHTML"],ge=e.defineComponent({__name:"tableColumn",props:{conf:{},columnList:{},option:{}},setup(r){const n=b.isFun,f=e.getCurrentInstance().type;return(d,a)=>{const o=e.resolveComponent("el-tooltip");return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.columnList,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.key},[d.conf.table.column.show.list.includes(t.key)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.table?.header?.groupKey===void 0||t.table.header.show?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),e.mergeProps({key:0,prop:t.key,label:t.label,ref_for:!0},t.table),{header:e.withCtx(()=>[e.renderSlot(d.$slots,"table-header-"+t.key,{item:t},()=>[e.createElementVNode("div",se,[t.table?.header?.tooltip?(e.openBlock(),e.createBlock(o,{key:0,effect:"dark",placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("div",{innerHTML:t.table?.header?.tooltip},null,8,fe)]),default:e.withCtx(()=>[e.createElementVNode("span",ce,[e.createVNode(ee)])]),_:2},1024)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label)+" ",1),t.table?.header?.group!==void 0?(e.openBlock(),e.createElementBlock("span",{key:1,class:"table-header-plus",onClick:e.withModifiers(()=>{t.table.header.group=!t.table.header.group,d.columnList.forEach(i=>{i.table?.header?.groupKey===t.key&&(i.table.header.show=!t.table.header.group)})},["stop"])},[t.table.header.group?(e.openBlock(),e.createBlock(ae,{key:0})):(e.openBlock(),e.createBlock(de,{key:1}))],8,pe)):e.createCommentVNode("",!0)])])]),default:e.withCtx(({row:i})=>[t.children?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a[0]||(a[0]=e.createTextVNode(" ")),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(f)),{conf:d.conf,columnList:t.children,option:d.option},e.createSlots({_:2},[e.renderList(d.$slots,(s,m)=>({name:m,fn:e.withCtx(p=>[e.renderSlot(d.$slots,m,e.mergeProps({ref_for:!0},p||{}))])}))]),1032,["conf","columnList","option"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[d.option.table?.editMode?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row",["table-edit-"+t.key]]),style:{width:"100%"}},[e.renderSlot(d.$slots,"table-edit-left-"+t.key,{row:i,item:t}),t.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:0,modelValue:i[t.key],"onUpdate:modelValue":s=>i[t.key]=s,disabled:d.conf.update.getDisabled(t,!0),class:"col",ref_for:!0},d.conf.update.getBind(t),e.toHandlers(d.conf.update.getOn(t,i))),e.createSlots({_:2},[t.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof t.options?.input?.prepend=="function"?t.options?.input?.prepend(i):t.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:1,modelValue:i[t.key],"onUpdate:modelValue":s=>i[t.key]=s,disabled:d.conf.update.getDisabled(t,!0),class:"col",ref_for:!0},d.conf.update.getBind(t),e.toHandlers(d.conf.update.getOn(t,i))),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options?.search?.select?.data||t.options?.select?.data,s=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:2,modelValue:i[t.key],"onUpdate:modelValue":s=>i[t.key]=s,disabled:d.conf.update.getDisabled(t,!0),class:"col",ref_for:!0},d.conf.update.getBind(t),e.toHandlers(d.conf.update.getOn(t,i))),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0),e.renderSlot(d.$slots,"table-edit-right-"+t.key,{row:i,item:t})],2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[d.conf.update.type===e.unref(b).EDialog.Update&&e.unref(n)(t.show?.form,d.conf.update.form,e.unref(b).EDialog.Update)&&d.option.table?.inlineEdit&&d.conf.update.form[d.option.table?.rowKey]===i[d.option.table?.rowKey]&&(t.type==="input"||t.type==="select")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:0,modelValue:d.conf.update.form[t.key],"onUpdate:modelValue":s=>d.conf.update.form[t.key]=s,disabled:d.conf.update.getDisabled(t,!0),ref_for:!0},d.conf.update.getBind(t),e.toHandlers(d.conf.update.getOn(t,i)),{style:{width:"100%"}}),e.createSlots({_:2},[t.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof t.options?.input?.prepend=="function"?t.options?.input?.prepend(i):t.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:1,modelValue:d.conf.update.form[t.key],"onUpdate:modelValue":s=>d.conf.update.form[t.key]=s,disabled:d.conf.update.getDisabled(t,!0),ref_for:!0},d.conf.update.getBind(t),e.toHandlers(d.conf.update.getOn(t,i)),{style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options?.search?.select?.data||t.options?.select?.data,s=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:2,modelValue:d.conf.update.form[t.key],"onUpdate:modelValue":s=>d.conf.update.form[t.key]=s,ref_for:!0},d.conf.update.getBind(t),e.toHandlers(d.conf.update.getOn(t,i)),{disabled:d.conf.update.getDisabled(t,!0)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)],64)):e.renderSlot(d.$slots,"table-"+t.key,{key:1,row:i,item:t},()=>[e.unref(B).customComponent[t.type??""]?.table?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[t.type??""]?.table),e.mergeProps({key:0,modelValue:i[t.key],"onUpdate:modelValue":s=>i[t.key]=s,ref_for:!0},t.options?.[t.type??""],e.toHandlers(t.options?.[t.type??""]?.on||{})),null,16,["modelValue","onUpdate:modelValue"])):t.type==="switch"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.options?.switch?.tableConfig?.change?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:0,modelValue:i[t.key],"onUpdate:modelValue":s=>i[t.key]=s,loading:t.options?.switch?.loadingMap?.[i[d.option.table?.rowKey]]?.loading,"before-change":()=>t.options?.switch?.tableBeforeChange?.(t.key,i),ref_for:!0},t.options?.switch),null,16,["modelValue","onUpdate:modelValue","loading","before-change"])):(e.openBlock(),e.createElementBlock("span",me,e.toDisplayString(i[t.key]===t.options?.switch?.activeValue?t.options?.switch?.activeText:t.options?.switch?.inactiveText),1))],64)):(e.openBlock(),e.createElementBlock("span",{key:2,style:e.normalizeStyle({"--table-text-click-color":t.table?.click?.color}),class:e.normalizeClass({"table-text-click":t.table?.click?.callback}),onClick:s=>t.table?.click?.callback?.(i),innerHTML:t.table?.format?t.table?.format(i):i[t.key]},null,14,he))])],64))],64))]),_:2},1040,["prop","label"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),128)}}}),ye={class:"row form-item-content",style:{width:"100%"}},ke={class:"col column form-item-content-item"},be={class:"col"},ue=["innerHTML"],we=e.defineComponent({__name:"formColumn",props:{conf:{},item:{}},setup(r){return(n,f)=>(e.openBlock(),e.createBlock(e.unref(g.ElFormItem),{label:n.item.item.text?.form?.label??n.item.item.label,prop:n.item.item.key,"label-width":n.item.item.text?.form?.label==""?0:n.item.item.form?.labelWidth||n.conf.option.form?.labelWidth},{default:e.withCtx(()=>[e.createElementVNode("div",ye,[e.renderSlot(n.$slots,"form-"+n.item.item.key+"-start",{row:n.conf.update.form,item:n.item.item}),e.createElementVNode("div",ke,[e.createElementVNode("div",be,[e.renderSlot(n.$slots,"form-"+n.item.item.key,{row:n.conf.update.form,item:n.item.item},()=>[n.item.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:0,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[0]||(f[0]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),e.createSlots({_:2},[n.item.item.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof n.item.item.options?.input?.prepend=="function"?n.item.item.options?.input?.prepend(n.conf.update.form):n.item.item.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","disabled"])):n.item.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),e.mergeProps({key:1,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[1]||(f[1]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):n.item.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:2,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[2]||(f[2]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.conf.update.getBind(n.item.item).data,d=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):n.item.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(g.ElRadioGroup),e.mergeProps({key:3,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[3]||(f[3]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.conf.update.getBind(n.item.item).data,d=>(e.openBlock(),e.createBlock(e.unref(g.ElRadio),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):n.item.item.type==="list"?(e.openBlock(),e.createBlock(U,e.mergeProps({key:4,row:n.conf.update.form,field:n.item.item.key},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):n.item.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(g.ElTreeSelect),e.mergeProps({key:5,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[4]||(f[4]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),null,16,["modelValue","disabled"])):n.item.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(g.ElDatePicker),e.mergeProps({key:6,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[5]||(f[5]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):n.item.item.type&&(e.unref(B).customComponent[n.item.item.type]||e.unref(B).customComponent[n.item.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[n.item.item.type]?.form||e.unref(B).customComponent[n.item.item.type]),e.mergeProps({key:7,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":f[6]||(f[6]=d=>n.conf.update.form[n.item.item.key]=d)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(n.$slots,"form-"+n.item.item.key+"-right",{row:n.conf.update.form,item:n.item.item})]),e.renderSlot(n.$slots,"form-"+n.item.item.key+"-tip",{row:n.conf.update.form,item:n.item.item},()=>[n.item.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof n.item.item.form?.tipText=="function"?n.item.item.form?.tipText(n.conf.update.form,n.conf.update.type):n.item.item.form?.tipText},null,8,ue)):e.createCommentVNode("",!0)])]),e.renderSlot(n.$slots,"form-"+n.item.item.key+"-end",{row:n.conf.update.form,item:n.item.item})])]),_:3},8,["label","prop","label-width"]))}}),Ce={},Be={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function Ve(r,n){return e.openBlock(),e.createElementBlock("svg",Be,n[0]||(n[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 Ee=z(Ce,[["render",Ve]]),Se={},Ne={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function De(r,n){return e.openBlock(),e.createElementBlock("svg",Ne,n[0]||(n[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 ze=z(Se,[["render",De]]),$e={key:0,class:"relative curd-search fit-width"},Ue={class:"mb-10 flex justify-between items-center fit-width"},Fe={class:"flex items-center",style:{gap:"10px"}},Te={key:0},Oe={key:1},Me={key:2},Le={class:"export-btn"},xe={key:1,class:"export-btn"},Ae={class:"flex items-center table-tools-right",style:{gap:"10px"}},He={class:"row justify-end mt-10 mb-10 table-bottom-pagination"},je={class:"dialog-footer"},Ie={class:"dialog-footer"},O=e.defineComponent({__name:"index",props:{option:{default:{}}},setup(r,{expose:n}){const f=b.EDialog,d=r,a=b.isFun,{conf:o,switchConfirmRef:t,ruleFormRef:i,tableRef:s}=q(d);return n({conf:o}),(m,p)=>{const c=e.resolveComponent("el-tooltip"),k=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative cc1-form-box",[r.option.table?.fitHeight?"col":"no-min-height"]])},[e.createElementVNode("div",{class:e.normalizeClass(["row",[r.option.table?.fitHeight?"absolute fit":""]]),style:{overflow:"hidden"}},[e.renderSlot(m.$slots,"box-left"),e.createElementVNode("div",{class:e.normalizeClass(["column fit-width no-wrap",[r.option.table?.fitHeight?"col":""]])},[r.option.search?.show!==!1?(e.openBlock(),e.createElementBlock("div",$e,[e.createVNode(e.unref(g.ElForm),{model:e.unref(o).search.form,inline:"",size:r.option.size?.search},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"search-start",{row:e.unref(o).search.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).search.column.list,l=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:l.key},[e.renderSlot(m.$slots,"search-"+l.key+"-start",{row:e.unref(o).search.form}),(typeof l.show?.search=="function"?l.show?.search(e.unref(o).search.form):l.show?.search)?(e.openBlock(),e.createBlock(e.unref(g.ElFormItem),{key:0,label:l.text?.search?.label??l.label},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"search-"+l.key+"-left",{row:e.unref(o).search.form}),e.renderSlot(m.$slots,"search-"+l.key,{row:e.unref(o).search.form},()=>[e.unref(B).customComponent[l.type??""]?.search?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[l.type??""]?.search),e.mergeProps({key:0,modelValue:e.unref(o).search.form[l.key],"onUpdate:modelValue":h=>e.unref(o).search.form[l.key]=h,ref_for:!0},l.options?.search?.[l.type??""],e.toHandlers(l.options?.search?.[l.type??""]?.on||{})),null,16,["modelValue","onUpdate:modelValue"])):l.type==="input"?(e.openBlock(),e.createBlock(e.unref(g.ElInput),e.mergeProps({key:1,modelValue:e.unref(o).search.form[l.key],"onUpdate:modelValue":h=>e.unref(o).search.form[l.key]=h,placeholder:e.unref(o).search.getPlaceholder(l),clearable:"",disabled:l.disabled?.search,ref_for:!0},l.options?.search?.input||l.options?.input,e.toHandlers(l.options?.search?.input?.on||l.options?.input?.on||{})),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):l.type==="switch"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:2,modelValue:e.unref(o).search.form[l.key],"onUpdate:modelValue":h=>e.unref(o).search.form[l.key]=h,placeholder:e.unref(o).search.getPlaceholder(l,e.unref(y).tCurd("placeholderSelect")),clearable:"",disabled:l.disabled?.search,ref_for:!0},l.options?.search?.switch||l.options?.switch,e.toHandlers(l.options?.search?.switch?.on||l.options?.switch?.on||{})),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:l.options?.switch?.activeValue,label:l.options?.switch?.activeText,value:l.options?.switch?.activeValue},null,8,["label","value"])),(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:l.options?.switch?.inactiveValue,label:l.options?.switch?.inactiveText,value:l.options?.switch?.inactiveValue},null,8,["label","value"]))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder","disabled"])):l.type==="select"?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),e.mergeProps({key:3,modelValue:e.unref(o).search.form[l.key],"onUpdate:modelValue":h=>e.unref(o).search.form[l.key]=h,placeholder:e.unref(o).search.getPlaceholder(l,e.unref(y).tCurd("placeholderSelect")),clearable:"",disabled:l.disabled?.search,ref_for:!0},l.options?.search?.select||l.options?.select,e.toHandlers(l.options?.search?.select?.on||l.options?.select?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options?.select?.data,h=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:h.value,label:h.label,value:h.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder","disabled"])):l.type==="radio"?(e.openBlock(),e.createBlock(e.unref(g.ElRadioGroup),e.mergeProps({key:4,modelValue:e.unref(o).search.form[l.key],"onUpdate:modelValue":h=>e.unref(o).search.form[l.key]=h,disabled:l.disabled?.search,ref_for:!0},l.options?.search?.radio||l.options?.radio,e.toHandlers(l.options?.search?.radio?.on||l.options?.radio?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options?.radio?.data,h=>(e.openBlock(),e.createBlock(e.unref(g.ElRadio),{key:h.value,label:h.label,value:h.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):l.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(g.ElDatePicker),e.mergeProps({key:5,modelValue:e.unref(o).search.form[l.key],"onUpdate:modelValue":h=>e.unref(o).search.form[l.key]=h,disabled:l.disabled?.search,ref_for:!0},l.options?.search?.datetime||l.options?.datetime,e.toHandlers(l.options?.search?.datetime?.on||l.options?.datetime?.on||{})),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.type&&e.unref(B).customComponent[l.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[l.type]),e.mergeProps({key:6,modelValue:e.unref(o).search.form[l.key],"onUpdate:modelValue":h=>e.unref(o).search.form[l.key]=h,ref_for:!0},l.options?.search?.[l.type]||l.options?.[l.type],e.toHandlers(l.options?.search?.[l.type]?.on||l.options?.[l.type]?.on||{}),{disabled:l.disabled?.search}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(m.$slots,"search-"+l.key+"-right",{row:e.unref(o).search.form})]),_:2},1032,["label"])):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"search-"+l.key+"-end",{row:e.unref(o).search.form})],64))),128)),e.renderSlot(m.$slots,"search-center",{row:e.unref(o).search.form}),r.option.tools?.search||r.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(g.ElFormItem),{key:0},{default:e.withCtx(()=>[r.option.tools?.search?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:0,type:"primary",onClick:e.unref(o).search.submit},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("search")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),r.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:1,onClick:e.unref(o).search.reset},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("reset")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"search-end",{row:e.unref(o).search.form})]),_:3},8,["model","size"])])):e.createCommentVNode("",!0),e.createElementVNode("div",Ue,[e.createElementVNode("div",Fe,[e.unref(a)(r.option.tools?.add)?(e.openBlock(),e.createElementBlock("div",Te,[e.createVNode(e.unref(g.ElButton),{type:"primary",onClick:p[0]||(p[0]=l=>e.unref(o).update.open(e.unref(f).Add)),size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("add")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),r.option.table?.selectable&&e.unref(a)(r.option.tools?.delete)?(e.openBlock(),e.createElementBlock("div",Oe,[e.createVNode(e.unref(g.ElButton),{type:"danger",onClick:p[1]||(p[1]=l=>e.unref(o).remove.open(e.unref(o).table.selection.list)),size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("delete")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),r.option.tools?.expand?(e.openBlock(),e.createElementBlock("div",Me,[e.createVNode(e.unref(g.ElButton),{type:"warning",onClick:p[2]||(p[2]=l=>e.unref(o).table.expand.all()),size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("expandCollapse")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),r.option.tools?.export?.show?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[r.option.tools?.export?.dropdown?.show?(e.openBlock(),e.createBlock(e.unref(g.ElDropdown),{key:0,onCommand:e.unref(o).export.click},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(g.ElDropdownMenu),{size:r.option.size?.search},{default:e.withCtx(()=>[r.option.tools?.export?.dropdown?.select&&(r.option.table?.selectable||e.unref(a)(r.option.tools?.delete))?(e.openBlock(),e.createBlock(e.unref(g.ElDropdownItem),{key:0,command:"select"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("exportSelect")),1)]),_:1})):e.createCommentVNode("",!0),r.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(y).tCurd("exportPage")),1)]),_:1})):e.createCommentVNode("",!0),r.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(y).tCurd("exportAll")),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",Le,[e.createVNode(e.unref(g.ElButton),{type:"warning",loading:e.unref(o).export.loading,size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("export")),1)]),_:1},8,["loading","size"])])]),_:1},8,["onCommand"])):(e.openBlock(),e.createElementBlock("div",xe,[e.createVNode(e.unref(g.ElButton),{type:"warning",loading:e.unref(o).export.loading,size:r.option.size?.search,onClick:p[3]||(p[3]=l=>e.unref(o).export.run.start("all"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("export")),1)]),_:1},8,["loading","size"])]))],64)):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"tools-left")]),e.createElementVNode("div",Ae,[e.renderSlot(m.$slots,"tools-right"),e.unref(o).page.showTools?(e.openBlock(),e.createBlock(e.unref(g.ElPagination),e.mergeProps({key:0,"current-page":e.unref(o).page.num,"onUpdate:currentPage":p[4]||(p[4]=l=>e.unref(o).page.num=l),"page-size":e.unref(o).page.size,"onUpdate:pageSize":p[5]||(p[5]=l=>e.unref(o).page.size=l),background:"","page-sizes":e.unref(o).page.sizeList,"pager-count":e.unref(o).page.pagerCount,layout:e.unref(o).page.layout,total:e.unref(o).page.total,size:r.option.size?.table,onSizeChange:e.unref(o).table.getList,onCurrentChange:e.unref(o).table.getList},r.option.page?.pagination||{},e.toHandlers(r.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0),r.option.tools?.expandColumn===void 0||r.option.tools?.expandColumn?(e.openBlock(),e.createBlock(c,{key:1,effect:"dark",content:e.unref(o).table.header.group.expand?e.unref(y).tCurd("mergeColumn"):e.unref(y).tCurd("expandColumn"),placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["refresh-btn",[r.option.size?.search]]),onClick:p[6]||(p[6]=(...l)=>e.unref(o).table.header.group.toggleExpandAll&&e.unref(o).table.header.group.toggleExpandAll(...l))},[e.unref(o).table.header.group.expand?(e.openBlock(),e.createBlock(Ee,{key:0})):(e.openBlock(),e.createBlock(ze,{key:1}))],2)]),_:1},8,["content"])):e.createCommentVNode("",!0),r.option.tools?.refresh===void 0||r.option.tools?.refresh?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["refresh-btn",[r.option.size?.search]]),onClick:p[7]||(p[7]=(...l)=>e.unref(o).table.getList&&e.unref(o).table.getList(...l))},[e.createVNode(Z)],2)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:e.normalizeClass(["fit-width relative form-box",[r.option.table?.fitHeight?"col ":"",r.option.table?.editMode?"edit-mode":""]])},[e.createElementVNode("div",{class:e.normalizeClass(["column form-box-content",[r.option.table?.fitHeight?"absolute fit":""]])},[e.withDirectives((e.openBlock(),e.createBlock(e.unref(g.ElTable),e.mergeProps({ref_key:"tableRef",ref:s,data:e.unref(o).table.data,border:r.option.table?.border===void 0?!0:r.option.table?.border,onSelectionChange:e.unref(o).table.selection.change,onSortChange:e.unref(o).table.sort.change,"expand-row-keys":e.unref(o).table.expand.rowKeys,onExpandChange:e.unref(o).table.expand.change},r.option.table,e.toHandlers(r.option.table?.on||{})),{default:e.withCtx(()=>[(typeof r.option.table?.selectable=="object"?r.option.table?.selectable?.show:r.option.table?.selectable)||e.unref(a)(r.option.tools?.delete)||r.option.tools?.export?.show&&r.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 r.option.table?.selectable=="object"?r.option.table?.selectable:{},e.toHandlers(typeof r.option.table?.selectable=="object"?r.option.table?.selectable?.on||{}:{})),null,16)):e.createCommentVNode("",!0),e.createVNode(ge,{conf:e.unref(o),columnList:e.unref(o).table.column.list,option:r.option},e.createSlots({_:2},[e.renderList(m.$slots,(l,h)=>({name:h,fn:e.withCtx(u=>[e.renderSlot(m.$slots,h,e.normalizeProps(e.guardReactiveProps(u||{})))])}))]),1032,["conf","columnList","option"]),e.unref(a)(r.option.table?.add)||e.unref(a)(r.option.table?.update)||e.unref(a)(r.option.table?.delete)||e.unref(a)(r.option.table?.view)||m.$slots["table-op-left"]||m.$slots["table-op-right"]?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),e.mergeProps({key:1,width:"auto","max-width":"200",align:"center",fixed:"right"},r.option.table?.operate,{"show-overflow-tooltip":!1}),{header:e.withCtx(()=>[e.renderSlot(m.$slots,"table-header-op",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("operation")),1)])]),default:e.withCtx(({row:l})=>[e.createVNode(e.unref(g.ElForm),{size:r.option.size?.table},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"table-op-left",{row:l}),e.unref(o).update.type===e.unref(f).Update&&r.option.table?.inlineEdit&&e.unref(o).update.form[d.option.table?.rowKey]===l[d.option.table?.rowKey]?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(g.ElButton),{link:"",type:"info",onClick:e.unref(o).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("cancel")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(g.ElButton),{link:"",type:"primary",onClick:e.unref(o).update.submit,loading:e.unref(o).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("confirm")),1)]),_:1},8,["onClick","loading"]),e.renderSlot(m.$slots,"table-op-edit-right",{row:l})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(a)(r.option.table?.add,l)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:0,link:"",type:"primary",onClick:h=>e.unref(o).update.open(e.unref(f).Add,l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("add")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(r.option.table?.view,l)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:1,link:"",type:"primary",onClick:h=>e.unref(o).update.open(e.unref(f).View,l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("view")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(r.option.table?.update,l)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:2,link:"",type:"warning",onClick:h=>e.unref(o).update.open(e.unref(f).Update,l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("edit")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(r.option.table?.delete,l)?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:3,link:"",type:"danger",onClick:h=>e.unref(o).remove.open([l])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("delete")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"table-op-right",{row:l})],64))]),_:2},1032,["size"])]),_:3},16)):e.createCommentVNode("",!0)]),_:3},16,["data","border","onSelectionChange","onSortChange","expand-row-keys","onExpandChange"])),[[k,e.unref(o).table.loading]])],2)],2),e.createElementVNode("div",He,[(r.option.page?.show===void 0||r.option.page?.show)&&!e.unref(o).page.showTools?(e.openBlock(),e.createBlock(e.unref(g.ElPagination),e.mergeProps({key:0,"current-page":e.unref(o).page.num,"onUpdate:currentPage":p[8]||(p[8]=l=>e.unref(o).page.num=l),"page-size":e.unref(o).page.size,"onUpdate:pageSize":p[9]||(p[9]=l=>e.unref(o).page.size=l),background:"","page-sizes":e.unref(o).page.sizeList,"pager-count":e.unref(o).page.pagerCount,layout:e.unref(o).page.layout,total:e.unref(o).page.total,size:r.option.size?.table,onSizeChange:e.unref(o).table.getList,onCurrentChange:e.unref(o).table.getList},r.option.page?.pagination||{},e.toHandlers(r.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(m.$slots,"box-right")],2),e.createVNode(e.unref(g.ElDialog),e.mergeProps({modelValue:e.unref(o).update.show,"onUpdate:modelValue":p[10]||(p[10]=l=>e.unref(o).update.show=l),title:e.unref(o).update.title,"before-close":e.unref(o).update.close},r.option.dialog),{footer:e.withCtx(()=>[e.createElementVNode("span",je,[e.createVNode(e.unref(g.ElForm),{size:r.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(g.ElButton),{onClick:e.unref(o).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("close")),1)]),_:1},8,["onClick"]),e.unref(o).update.type!==e.unref(f).View?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:0,type:"primary",onClick:e.unref(o).update.submit,loading:e.unref(o).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("submit")),1)]),_:1},8,["onClick","loading"])):e.createCommentVNode("",!0)]),_:1},8,["size"])])]),default:e.withCtx(()=>[e.createVNode(e.unref(g.ElForm),{ref_key:"ruleFormRef",ref:i,model:e.unref(o).update.form,rules:e.unref(o).update.rules,size:r.option.size?.form,class:"update-dialog-form"},{default:e.withCtx(()=>[e.unref(o).update.showContent?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(o).update.formColumn,l=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)((()=>{const h=[],u=E=>{E?.item?.children?u(E.item.children):h.push(...E.map(V=>V.item?.show?.form))};return u(l),h})(),e.unref(o).update.form,e.unref(o).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:r.option.form?.stripe===void 0?!0:r.option.form?.stripe}])},[e.renderSlot(m.$slots,"form-start",{row:e.unref(o).update.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l,h=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)(h.item.show?.form,e.unref(o).update.form,e.unref(o).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([h.item.form.span>0?`col-${e.unref(o).getColumnSpan(h,l)}`:"col",`form-item-col-${h.item.key}`])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.item.children?h.children:[h],u=>(e.openBlock(),e.createBlock(we,{key:u.item.key,conf:e.unref(o),item:u},e.createSlots({_:2},[e.renderList(m.$slots,(E,V)=>({name:V,fn:e.withCtx(S=>[e.renderSlot(m.$slots,V,e.mergeProps({ref_for:!0},S||{}))])}))]),1032,["conf","item"]))),128))],2)):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(m.$slots,"form-end",{row:e.unref(o).update.form})],2)):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0)]),_:3},8,["model","rules","size"])]),_:3},16,["modelValue","title","before-close"]),e.createVNode(e.unref(g.ElDialog),{modelValue:e.unref(o).remove.show,"onUpdate:modelValue":p[11]||(p[11]=l=>e.unref(o).remove.show=l),title:e.unref(o).remove.title,"close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createElementVNode("span",Ie,[e.createVNode(e.unref(g.ElForm),{size:r.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(g.ElButton),{onClick:e.unref(o).remove.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("close")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(g.ElButton),{type:"danger",onClick:e.unref(o).remove.submit,loading:e.unref(o).remove.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("confirmDelete")),1)]),_:1},8,["onClick","loading"])]),_:1},8,["size"])])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(e.unref(y).tCurd("confirmDeleteMessage",e.unref(o).remove.items.length)),1)]),_:1},8,["modelValue","title"]),e.createVNode(J,{ref_key:"switchConfirmRef",ref:t,size:r.option.size?.form},null,8,["size"])],2)}}});class Re{static async download(n,f="download.png"){const d=document.createElement("a");d.style.display="none",d.href=n,d.setAttribute("download",f),typeof d.download>"u"&&d.setAttribute("target","_blank"),document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(n)}static exportJSONFile=(n,f)=>{const d=new Blob([JSON.stringify(n)],{type:"application/json"}),a=URL.createObjectURL(d),o=document.createElement("a");o.href=a,o.download=`${f||"config"}.json`,o.click()};static importFile=async n=>new Promise((f,d)=>{const a=document.createElement("input");a.type="file";const o=n?.accept||".json";a.accept=o,a.style.display="none",a.onchange=t=>{const i=t.target.files[0];if(!i){b.fail("未选择文件"),d("未选择文件");return}const s=new FileReader;s.onload=async m=>{const p=o==".json"?JSON.parse(m.target.result):m.target.result;f(p)},s.onerror=()=>{b.fail("文件读取失败"),d("文件读取失败")},s.readAsText(i),document.body.removeChild(a)},document.body.appendChild(a),a.click()})}const M=(r,n)=>{if(r.component("TCurd",O),r.component("TFormList",U),r.component("TColumn",F),n?.customComponent){B.customComponent=n.customComponent;for(const f in n.customComponent)r.component(f,n.customComponent[f])}},Ke={install:M};C.ArrUtil=N,C.ExcelUtil=T,C.TColumn=F,C.TCurd=O,C.TFile=Re,C.TForm=B,C.TFormConfig=w,C.TFormI18n=y,C.TFormList=U,C.TSys=b,C.default=Ke,C.install=M,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|