cc1-form 1.1.39 → 1.1.40

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 CHANGED
@@ -1,7 +1,7 @@
1
- import { ElMessage as ce, ElLoading as me, ElForm as N, ElFormItem as X, ElInput as Y, ElSwitch as oe, ElSelect as W, ElOption as K, ElRadioGroup as re, ElRadio as se, ElTreeSelect as de, ElDatePicker as ae, ElDialog as _, ElButton as A, ElTableColumn as ee, ElDropdown as he, ElDropdownMenu as ge, ElDropdownItem as x, ElPagination as ie, ElTable as be } from "element-plus";
1
+ import { ElMessage as ce, ElLoading as me, ElForm as N, ElFormItem as X, ElInput as Y, ElSwitch as oe, ElSelect as W, ElOption as K, ElRadioGroup as re, ElRadio as se, ElTreeSelect as de, ElDatePicker as ae, ElDialog as _, ElButton as T, ElTableColumn as ee, ElDropdown as he, ElDropdownMenu as ge, ElDropdownItem as x, ElPagination as ie, ElTable as be } from "element-plus";
2
2
  import "vue-router";
3
- import { defineComponent as J, reactive as le, onMounted as ue, resolveComponent as Q, createElementBlock as y, createCommentVNode as C, openBlock as f, renderSlot as k, createElementVNode as O, createVNode as z, withCtx as m, createTextVNode as E, Fragment as $, renderList as L, createBlock as h, normalizeClass as j, normalizeStyle as fe, ref as H, unref as a, mergeProps as v, toHandlers as S, resolveDynamicComponent as q, toDisplayString as T, getCurrentInstance as ye, createSlots as te, resolveDirective as we, withDirectives as ke, normalizeProps as Ce, guardReactiveProps as ve } from "vue";
4
- class U {
3
+ import { defineComponent as J, reactive as le, onMounted as ue, resolveComponent as Q, createElementBlock as y, createCommentVNode as C, openBlock as f, renderSlot as k, createElementVNode as U, createVNode as z, withCtx as m, createTextVNode as E, Fragment as $, renderList as L, createBlock as h, normalizeClass as j, normalizeStyle as fe, ref as H, unref as a, mergeProps as v, toHandlers as S, resolveDynamicComponent as q, toDisplayString as A, getCurrentInstance as ye, createSlots as te, resolveDirective as we, withDirectives as ke, normalizeProps as Ce, guardReactiveProps as ve } from "vue";
4
+ class O {
5
5
  /**
6
6
  * Vue Router 实例,需在应用初始化时赋值
7
7
  */
@@ -43,9 +43,9 @@ class U {
43
43
  * @param module
44
44
  */
45
45
  static loadModule = async (o) => {
46
- if (!U.moduleObj[o])
46
+ if (!O.moduleObj[o])
47
47
  throw new Error(`模块${o}未加载,请赋值如:TSys.moduleObj = { ${o}: ()=>import('${o}') }`);
48
- const u = await U.moduleObj[o]();
48
+ const u = await O.moduleObj[o]();
49
49
  return u.default ?? u;
50
50
  };
51
51
  /**
@@ -133,7 +133,7 @@ class U {
133
133
  */
134
134
  static getImgPic = (o) => new Promise(async (u, t) => {
135
135
  let i = document.getElementById(o.id);
136
- const l = await U.loadModule("html2canvas");
136
+ const l = await O.loadModule("html2canvas");
137
137
  try {
138
138
  l(i, {
139
139
  logging: !1,
@@ -547,7 +547,7 @@ class M {
547
547
  */
548
548
  parentId: (o, u, t, i) => {
549
549
  const l = D.config.table.rowKey;
550
- o ? u.type === U.EDialog.Add ? (u.form.parentId = o[l], u.form.sort = o.children.length + 1) : u.form.parentId = o.parentId.substring(o.parentId.lastIndexOf(",") + 1) : (u.form.parentId = "0", u.form.sort = t.length + 1), M.setOptionsData(i, "parentId", [{ [l]: "0", title: "根", children: t }]);
550
+ o ? u.type === O.EDialog.Add ? (u.form.parentId = o[l], u.form.sort = o.children.length + 1) : u.form.parentId = o.parentId.substring(o.parentId.lastIndexOf(",") + 1) : (u.form.parentId = "0", u.form.sort = t.length + 1), M.setOptionsData(i, "parentId", [{ [l]: "0", title: "根", children: t }]);
551
551
  }
552
552
  }
553
553
  };
@@ -733,7 +733,7 @@ const ze = {
733
733
  const s = Q("el-button"), p = Q("el-input");
734
734
  return t.show ? (f(), y("div", ze, [
735
735
  k(l.$slots, "list-start", { row: r.row }),
736
- O("div", null, [
736
+ U("div", null, [
737
737
  z(s, {
738
738
  link: "",
739
739
  type: "primary",
@@ -780,7 +780,7 @@ const ze = {
780
780
  }), Se = {
781
781
  class: "row form-item-content",
782
782
  style: { width: "100%" }
783
- }, Ee = { class: "col" }, $e = { class: "col" }, Oe = ["innerHTML"], Ue = /* @__PURE__ */ J({
783
+ }, Ee = { class: "col" }, $e = { class: "col" }, Ue = ["innerHTML"], Oe = /* @__PURE__ */ J({
784
784
  __name: "column",
785
785
  props: {
786
786
  /**
@@ -797,7 +797,7 @@ const ze = {
797
797
  }
798
798
  },
799
799
  setup(r, { expose: o }) {
800
- const u = U.isFun, t = U.EDialog, i = H(), l = r, e = le({
800
+ const u = O.isFun, t = O.EDialog, i = H(), l = r, e = le({
801
801
  rules: {},
802
802
  show: !0,
803
803
  form: {},
@@ -809,7 +809,7 @@ const ze = {
809
809
  getOn: (s) => s.options?.[e.type === t.Add ? "formAdd" : "formUpdate"]?.[s.type]?.on || s.options?.[s.type]?.on || {},
810
810
  getColumnSpan: (s, p) => {
811
811
  if (s.item.form?.spanCol) {
812
- const c = l.option.form?.maxSpan || 12, g = l.option.form?.defaultSpan || c / 2, d = p.filter((V) => !U.isFun(V.item.show?.form, e.form, e.type)).reduce((V, w) => V + (w.item.form?.span || g), 0);
812
+ const c = l.option.form?.maxSpan || 12, g = l.option.form?.defaultSpan || c / 2, d = p.filter((V) => !O.isFun(V.item.show?.form, e.form, e.type)).reduce((V, w) => V + (w.item.form?.span || g), 0);
813
813
  return (s.item.form?.span || g) + d;
814
814
  }
815
815
  return s.item.form?.span;
@@ -891,13 +891,13 @@ const ze = {
891
891
  "label-width": n.item.form?.labelWidth || r.option.form?.labelWidth || "100px"
892
892
  }, {
893
893
  default: m(() => [
894
- O("div", Se, [
894
+ U("div", Se, [
895
895
  k(s.$slots, "form-" + n.item.key + "-start", {
896
896
  row: e.form,
897
897
  item: n.item
898
898
  }),
899
- O("div", Ee, [
900
- O("div", $e, [
899
+ U("div", Ee, [
900
+ U("div", $e, [
901
901
  k(s.$slots, "form-" + n.item.key, {
902
902
  row: e.form,
903
903
  item: n.item
@@ -995,7 +995,7 @@ const ze = {
995
995
  key: 0,
996
996
  class: "form-tip-text",
997
997
  innerHTML: typeof n.item.form?.tipText == "function" ? n.item.form?.tipText(e.form, e.type) : n.item.form?.tipText
998
- }, null, 8, Oe)) : C("", !0)
998
+ }, null, 8, Ue)) : C("", !0)
999
999
  ])
1000
1000
  ]),
1001
1001
  k(s.$slots, "form-" + n.item.key + "-end", {
@@ -1028,7 +1028,7 @@ class Fe {
1028
1028
  */
1029
1029
  static exportToExcel = async (o, u, t) => {
1030
1030
  if (!o || o.length === 0) return;
1031
- const i = await U.loadModule("xlsx"), l = o.map((p) => {
1031
+ const i = await O.loadModule("xlsx"), l = o.map((p) => {
1032
1032
  const c = {};
1033
1033
  return u.forEach((g) => {
1034
1034
  c[g.label] = p[g.key];
@@ -1037,7 +1037,7 @@ class Fe {
1037
1037
  i.utils.book_append_sheet(s, e, "Sheet1"), t ? typeof t == "function" && (t = t()) : t = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, i.writeFile(s, `${t}.xlsx`);
1038
1038
  };
1039
1039
  }
1040
- const I = U.EDialog, Te = (r) => {
1040
+ const I = O.EDialog, Ae = (r) => {
1041
1041
  const o = H(), u = H(), t = le({
1042
1042
  option: r.option,
1043
1043
  /** 查询区域相关配置对象 */
@@ -1214,13 +1214,13 @@ const I = U.EDialog, Te = (r) => {
1214
1214
  /** 获取当前选中项进行导出 */
1215
1215
  select: () => {
1216
1216
  if (t.table.selection.list.length === 0)
1217
- throw U.fail(b.tCurd("selectDataToExport")), new Error(b.tCurd("selectDataToExport"));
1217
+ throw O.fail(b.tCurd("selectDataToExport")), new Error(b.tCurd("selectDataToExport"));
1218
1218
  return t.table.selection.list;
1219
1219
  },
1220
1220
  /** 导出当前页的数据 */
1221
1221
  page: () => {
1222
1222
  if (t.table.data.length === 0)
1223
- throw U.fail(b.tCurd("noData")), new Error(b.tCurd("noData"));
1223
+ throw O.fail(b.tCurd("noData")), new Error(b.tCurd("noData"));
1224
1224
  return t.table.data;
1225
1225
  },
1226
1226
  /** 导出所有数据 */
@@ -1281,15 +1281,15 @@ const I = U.EDialog, Te = (r) => {
1281
1281
  /** 获取表单组件事件属性 */
1282
1282
  getOn: (i) => i.options?.[t.update.type === I.Add ? "formAdd" : "formUpdate"]?.[i.type]?.on || i.options?.[i.type]?.on || {},
1283
1283
  /** 获取表单组件绑定属性和事件 */
1284
- getBindOnByKey: (i) => {
1284
+ getOptions: (i) => {
1285
1285
  try {
1286
1286
  const e = t.update.formColumn.flat().find((s) => s.item.key === i)?.item;
1287
1287
  return e ? {
1288
- bind: t.update.getBind(e),
1289
- on: t.update.getOn(e)
1290
- } : { bind: {}, on: {} };
1288
+ options: e.options,
1289
+ bind: t.update.getBind(e)
1290
+ } : { options: {}, bind: {} };
1291
1291
  } catch {
1292
- return { bind: {}, on: {} };
1292
+ return { options: {}, bind: {} };
1293
1293
  }
1294
1294
  },
1295
1295
  /** 编辑相关数据与方法 */
@@ -1312,7 +1312,7 @@ const I = U.EDialog, Te = (r) => {
1312
1312
  /** 打开增改弹窗 */
1313
1313
  open: (i, l) => {
1314
1314
  t.update.showContent || FunUtil.throttle(async () => {
1315
- U.loading(!0);
1315
+ O.loading(!0);
1316
1316
  try {
1317
1317
  t.update.type = i, await t.initApiData("update");
1318
1318
  const e = i === I.Add;
@@ -1320,11 +1320,11 @@ const I = U.EDialog, Te = (r) => {
1320
1320
  t.inlineEdit.open(l);
1321
1321
  return;
1322
1322
  }
1323
- t.update.edit.data = l, t.update.title = b.tCurd(e ? "add" : i === I.View ? "view" : "edit"), t.update.form = JSONUtil.cp(e ? t.update.formDefault : l), await r.option.form?.openBefore?.(l, t.update), t.inlineEdit.data || (t.update.show = !0), t.update.showContent = !0, r.option.form?.openAfter?.(l, t.update);
1323
+ t.update.edit.data = l, t.update.title = b.tCurd(e ? "add" : i === I.View ? "view" : "edit"), t.update.form = JSONUtil.cp(e ? t.update.formDefault : l), await r.option.form?.openBefore?.(t.update.form, t.update), t.inlineEdit.data || (t.update.show = !0), t.update.showContent = !0, r.option.form?.openAfter?.(t.update.form, t.update);
1324
1324
  } catch (e) {
1325
1325
  console.error(e);
1326
1326
  } finally {
1327
- U.loading(!1);
1327
+ O.loading(!1);
1328
1328
  }
1329
1329
  });
1330
1330
  },
@@ -1332,7 +1332,7 @@ const I = U.EDialog, Te = (r) => {
1332
1332
  submit: () => {
1333
1333
  FunUtil.throttle(async () => {
1334
1334
  await u.value?.validate(async (s, p) => new Promise((c, g) => {
1335
- s || (U.fail(b.tCurd("checkFormData")), g(!1)), c();
1335
+ s || (O.fail(b.tCurd("checkFormData")), g(!1)), c();
1336
1336
  })), t.update.loading = !0;
1337
1337
  const i = t.update.type === I.Add ? r.option.api.create : r.option.api.update;
1338
1338
  try {
@@ -1399,7 +1399,7 @@ const I = U.EDialog, Te = (r) => {
1399
1399
  /** 打开删除弹窗并设置待删除项 */
1400
1400
  open: (i) => {
1401
1401
  if (i.length === 0) {
1402
- U.fail(b.tCurd("selectDataToDelete"));
1402
+ O.fail(b.tCurd("selectDataToDelete"));
1403
1403
  return;
1404
1404
  }
1405
1405
  t.remove.items = i, t.remove.show = !0;
@@ -1414,7 +1414,7 @@ const I = U.EDialog, Te = (r) => {
1414
1414
  await i({
1415
1415
  [r.option.table?.rowKey]: t.remove.items.map((l) => l[r.option.table?.rowKey]),
1416
1416
  items: t.remove.items
1417
- }), U.success(b.tCurd("operationSuccess")), t.table.data.length <= 1 && t.page.num > 1 && (t.page.num -= 1), t.remove.close(), await t.table.getList();
1417
+ }), O.success(b.tCurd("operationSuccess")), t.table.data.length <= 1 && t.page.num > 1 && (t.page.num -= 1), t.remove.close(), await t.table.getList();
1418
1418
  } catch (l) {
1419
1419
  console.error(l);
1420
1420
  } finally {
@@ -1443,7 +1443,7 @@ const I = U.EDialog, Te = (r) => {
1443
1443
  let c = await s.options?.[s.type]?.dataApi?.(t.update.form, i);
1444
1444
  if (c) {
1445
1445
  const g = s.options?.[s.type]?.dataPath;
1446
- g && (c = ObjectUtil.getPathValue(c, g)), s.options[s.type].data = c, t.apiDataMap[s.key] = c;
1446
+ g && (c = ObjectUtil.getPathValue(c, g)), s.options[s.type].data = c, s.options.search[s.type].data = c, s.options.formAdd[s.type].data = c, s.options.formUpdate[s.type].data = c, t.apiDataMap[s.key] = c;
1447
1447
  }
1448
1448
  } catch {
1449
1449
  }
@@ -1505,7 +1505,7 @@ const I = U.EDialog, Te = (r) => {
1505
1505
  final(g, n, d) {
1506
1506
  t.table.loading = !1;
1507
1507
  }
1508
- }), t.table.loading = !1, U.success(b.tCurd("operationSuccess")), t.table.getList(), !0) : void 0;
1508
+ }), t.table.loading = !1, O.success(b.tCurd("operationSuccess")), t.table.getList(), !0) : void 0;
1509
1509
  } catch (g) {
1510
1510
  return console.error(g), !1;
1511
1511
  } finally {
@@ -1520,7 +1520,7 @@ const I = U.EDialog, Te = (r) => {
1520
1520
  },
1521
1521
  getColumnSpan: (i, l) => {
1522
1522
  if (i.item.form?.spanCol) {
1523
- const e = D.config.form.defaultSpan, p = l.filter((c) => !U.isFun(c.item.show?.form, t.update.form, t.update.type)).reduce((c, g) => c + (g.item.form?.span || e), 0);
1523
+ const e = D.config.form.defaultSpan, p = l.filter((c) => !O.isFun(c.item.show?.form, t.update.form, t.update.type)).reduce((c, g) => c + (g.item.form?.span || e), 0);
1524
1524
  return (i.item?.form.span || e) + p;
1525
1525
  }
1526
1526
  return i.item.form.span;
@@ -1578,7 +1578,7 @@ const I = U.EDialog, Te = (r) => {
1578
1578
  return t.init(), ue(() => {
1579
1579
  r.option.init !== !1 && t.table.getList();
1580
1580
  }), { conf: t, switchConfirmRef: o, ruleFormRef: u };
1581
- }, Ae = { class: "dialog-footer" }, Le = /* @__PURE__ */ J({
1581
+ }, Te = { class: "dialog-footer" }, Le = /* @__PURE__ */ J({
1582
1582
  __name: "switchConfirm",
1583
1583
  props: {
1584
1584
  size: {}
@@ -1607,14 +1607,14 @@ const I = U.EDialog, Te = (r) => {
1607
1607
  footer: m(() => [
1608
1608
  z(d, { size: g.size }, {
1609
1609
  default: m(() => [
1610
- O("span", Ae, [
1611
- z(a(A), { onClick: c }, {
1610
+ U("span", Te, [
1611
+ z(a(T), { onClick: c }, {
1612
1612
  default: m(() => n[1] || (n[1] = [
1613
1613
  E("取消")
1614
1614
  ])),
1615
1615
  _: 1
1616
1616
  }),
1617
- z(a(A), {
1617
+ z(a(T), {
1618
1618
  type: "primary",
1619
1619
  onClick: p
1620
1620
  }, {
@@ -1629,7 +1629,7 @@ const I = U.EDialog, Te = (r) => {
1629
1629
  }, 8, ["size"])
1630
1630
  ]),
1631
1631
  default: m(() => [
1632
- O("div", null, T(i.value), 1)
1632
+ U("div", null, A(i.value), 1)
1633
1633
  ]),
1634
1634
  _: 1
1635
1635
  }, 8, ["modelValue", "title"]);
@@ -1646,7 +1646,7 @@ const I = U.EDialog, Te = (r) => {
1646
1646
  };
1647
1647
  function je(r, o) {
1648
1648
  return f(), y("svg", Be, o[0] || (o[0] = [
1649
- O("path", {
1649
+ U("path", {
1650
1650
  fill: "currentColor",
1651
1651
  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"
1652
1652
  }, null, -1)
@@ -1659,7 +1659,7 @@ const Ie = /* @__PURE__ */ pe(Me, [["render", je]]), Re = {}, Pe = {
1659
1659
  };
1660
1660
  function Ne(r, o) {
1661
1661
  return f(), y("svg", Pe, o[0] || (o[0] = [
1662
- O("path", {
1662
+ U("path", {
1663
1663
  fill: "currentColor",
1664
1664
  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"
1665
1665
  }, null, -1)
@@ -1673,7 +1673,7 @@ const Ke = /* @__PURE__ */ pe(Re, [["render", Ne]]), He = { class: "row flex-cen
1673
1673
  option: {}
1674
1674
  },
1675
1675
  setup(r) {
1676
- const o = U.isFun, u = ye().type;
1676
+ const o = O.isFun, u = ye().type;
1677
1677
  return (t, i) => {
1678
1678
  const l = Q("el-tooltip");
1679
1679
  return f(!0), y($, null, L(t.columnList, (e) => (f(), y($, {
@@ -1687,7 +1687,7 @@ const Ke = /* @__PURE__ */ pe(Re, [["render", Ne]]), He = { class: "row flex-cen
1687
1687
  }, e.table), {
1688
1688
  header: m(() => [
1689
1689
  k(t.$slots, "table-header-" + e.key, { item: e }, () => [
1690
- O("div", He, [
1690
+ U("div", He, [
1691
1691
  e.table?.tooltip ? (f(), h(l, {
1692
1692
  key: 0,
1693
1693
  effect: "dark",
@@ -1695,13 +1695,13 @@ const Ke = /* @__PURE__ */ pe(Re, [["render", Ne]]), He = { class: "row flex-cen
1695
1695
  placement: "top"
1696
1696
  }, {
1697
1697
  default: m(() => [
1698
- O("span", Je, [
1698
+ U("span", Je, [
1699
1699
  z(Ke)
1700
1700
  ])
1701
1701
  ]),
1702
1702
  _: 2
1703
1703
  }, 1032, ["content"])) : C("", !0),
1704
- E(" " + T(e.label), 1)
1704
+ E(" " + A(e.label), 1)
1705
1705
  ])
1706
1706
  ])
1707
1707
  ]),
@@ -1721,7 +1721,7 @@ const Ke = /* @__PURE__ */ pe(Re, [["render", Ne]]), He = { class: "row flex-cen
1721
1721
  }))
1722
1722
  ]), 1032, ["conf", "columnList", "option"]))
1723
1723
  ], 64)) : (f(), y($, { key: 1 }, [
1724
- a(o)(e.show?.form, t.conf.update.form, a(U).EDialog.Update) && t.option.table?.inlineEdit && t.conf.inlineEdit.data === s && (e.type === "input" || e.type === "select") ? (f(), y($, { key: 0 }, [
1724
+ a(o)(e.show?.form, t.conf.update.form, a(O).EDialog.Update) && t.option.table?.inlineEdit && t.conf.inlineEdit.data === s && (e.type === "input" || e.type === "select") ? (f(), y($, { key: 0 }, [
1725
1725
  e.type === "input" ? (f(), h(a(Y), v({
1726
1726
  key: 0,
1727
1727
  modelValue: t.conf.update.form[e.key],
@@ -1734,7 +1734,7 @@ const Ke = /* @__PURE__ */ pe(Re, [["render", Ne]]), He = { class: "row flex-cen
1734
1734
  ref_for: !0
1735
1735
  }, t.conf.update.getBind(e), S(t.conf.update.getOn(e)), { style: { width: "100%" } }), {
1736
1736
  default: m(() => [
1737
- (f(!0), y($, null, L(e.options?.select?.data, (p) => (f(), h(a(K), {
1737
+ (f(!0), y($, null, L(e.options?.search?.select?.data || e.options?.select?.data, (p) => (f(), h(a(K), {
1738
1738
  key: p.value,
1739
1739
  label: p.label,
1740
1740
  value: p.value
@@ -1794,13 +1794,13 @@ const Ke = /* @__PURE__ */ pe(Re, [["render", Ne]]), He = { class: "row flex-cen
1794
1794
  "label-width": o.item.item.form?.labelWidth || o.conf.option.form?.labelWidth
1795
1795
  }, {
1796
1796
  default: m(() => [
1797
- O("div", Ge, [
1797
+ U("div", Ge, [
1798
1798
  k(o.$slots, "form-" + o.item.item.key + "-start", {
1799
1799
  row: o.conf.update.form,
1800
1800
  item: o.item.item
1801
1801
  }),
1802
- O("div", Xe, [
1803
- O("div", Qe, [
1802
+ U("div", Xe, [
1803
+ U("div", Qe, [
1804
1804
  k(o.$slots, "form-" + o.item.item.key, {
1805
1805
  row: o.conf.update.form,
1806
1806
  item: o.item.item
@@ -1826,7 +1826,7 @@ const Ke = /* @__PURE__ */ pe(Re, [["render", Ne]]), He = { class: "row flex-cen
1826
1826
  style: { width: "100%" }
1827
1827
  }), {
1828
1828
  default: m(() => [
1829
- (f(!0), y($, null, L(o.item.item.options?.select?.data, (t) => (f(), h(a(K), {
1829
+ (f(!0), y($, null, L(o.conf.update.getBind(o.item.item).data, (t) => (f(), h(a(K), {
1830
1830
  key: t.value,
1831
1831
  label: t.label,
1832
1832
  value: t.value
@@ -1842,7 +1842,7 @@ const Ke = /* @__PURE__ */ pe(Re, [["render", Ne]]), He = { class: "row flex-cen
1842
1842
  style: { width: "100%" }
1843
1843
  }), {
1844
1844
  default: m(() => [
1845
- (f(!0), y($, null, L(o.item.item.options?.radio?.data, (t) => (f(), h(a(se), {
1845
+ (f(!0), y($, null, L(o.conf.update.getBind(o.item.item).data, (t) => (f(), h(a(se), {
1846
1846
  key: t.value,
1847
1847
  label: t.label,
1848
1848
  value: t.value
@@ -1922,7 +1922,7 @@ const Ke = /* @__PURE__ */ pe(Re, [["render", Ne]]), He = { class: "row flex-cen
1922
1922
  }
1923
1923
  },
1924
1924
  setup(r, { expose: o }) {
1925
- const u = U.EDialog, t = r, i = U.isFun, { conf: l, switchConfirmRef: e, ruleFormRef: s } = Te(t);
1925
+ const u = O.EDialog, t = r, i = O.isFun, { conf: l, switchConfirmRef: e, ruleFormRef: s } = Ae(t);
1926
1926
  return o({
1927
1927
  conf: l
1928
1928
  }), (p, c) => {
@@ -1930,12 +1930,12 @@ const Ke = /* @__PURE__ */ pe(Re, [["render", Ne]]), He = { class: "row flex-cen
1930
1930
  return f(), y("div", {
1931
1931
  class: j(["relative cc1-form-box", [r.option.table?.fitHeight ? "col" : "no-min-height"]])
1932
1932
  }, [
1933
- O("div", {
1933
+ U("div", {
1934
1934
  class: j(["row", [r.option.table?.fitHeight ? "absolute fit" : ""]]),
1935
1935
  style: { overflow: "hidden" }
1936
1936
  }, [
1937
1937
  k(p.$slots, "box-left"),
1938
- O("div", {
1938
+ U("div", {
1939
1939
  class: j(["column fit-width no-wrap", [r.option.table?.fitHeight ? "col" : ""]])
1940
1940
  }, [
1941
1941
  r.option.search?.show !== !1 ? (f(), y("div", xe, [
@@ -2036,22 +2036,22 @@ const Ke = /* @__PURE__ */ pe(Re, [["render", Ne]]), He = { class: "row flex-cen
2036
2036
  }),
2037
2037
  r.option.tools?.search || r.option.tools?.reset ? (f(), h(a(X), { key: 0 }, {
2038
2038
  default: m(() => [
2039
- r.option.tools?.search ? (f(), h(a(A), {
2039
+ r.option.tools?.search ? (f(), h(a(T), {
2040
2040
  key: 0,
2041
2041
  type: "primary",
2042
2042
  onClick: a(l).search.submit
2043
2043
  }, {
2044
2044
  default: m(() => [
2045
- E(T(a(b).tCurd("search")), 1)
2045
+ E(A(a(b).tCurd("search")), 1)
2046
2046
  ]),
2047
2047
  _: 1
2048
2048
  }, 8, ["onClick"])) : C("", !0),
2049
- r.option.tools?.reset ? (f(), h(a(A), {
2049
+ r.option.tools?.reset ? (f(), h(a(T), {
2050
2050
  key: 1,
2051
2051
  onClick: a(l).search.reset
2052
2052
  }, {
2053
2053
  default: m(() => [
2054
- E(T(a(b).tCurd("reset")), 1)
2054
+ E(A(a(b).tCurd("reset")), 1)
2055
2055
  ]),
2056
2056
  _: 1
2057
2057
  }, 8, ["onClick"])) : C("", !0)
@@ -2065,40 +2065,40 @@ const Ke = /* @__PURE__ */ pe(Re, [["render", Ne]]), He = { class: "row flex-cen
2065
2065
  _: 3
2066
2066
  }, 8, ["model", "size"])
2067
2067
  ])) : C("", !0),
2068
- O("div", _e, [
2069
- O("div", et, [
2068
+ U("div", _e, [
2069
+ U("div", et, [
2070
2070
  a(i)(r.option.tools?.add) ? (f(), y("div", tt, [
2071
- z(a(A), {
2071
+ z(a(T), {
2072
2072
  type: "primary",
2073
2073
  onClick: c[0] || (c[0] = (n) => a(l).update.open(a(u).Add)),
2074
2074
  size: r.option.size?.search
2075
2075
  }, {
2076
2076
  default: m(() => [
2077
- E(T(a(b).tCurd("add")), 1)
2077
+ E(A(a(b).tCurd("add")), 1)
2078
2078
  ]),
2079
2079
  _: 1
2080
2080
  }, 8, ["size"])
2081
2081
  ])) : C("", !0),
2082
2082
  r.option.table?.selectable && a(i)(r.option.tools?.delete) ? (f(), y("div", ot, [
2083
- z(a(A), {
2083
+ z(a(T), {
2084
2084
  type: "danger",
2085
2085
  onClick: c[1] || (c[1] = (n) => a(l).remove.open(a(l).table.selection.list)),
2086
2086
  size: r.option.size?.search
2087
2087
  }, {
2088
2088
  default: m(() => [
2089
- E(T(a(b).tCurd("delete")), 1)
2089
+ E(A(a(b).tCurd("delete")), 1)
2090
2090
  ]),
2091
2091
  _: 1
2092
2092
  }, 8, ["size"])
2093
2093
  ])) : C("", !0),
2094
2094
  r.option.tools?.expand ? (f(), y("div", at, [
2095
- z(a(A), {
2095
+ z(a(T), {
2096
2096
  type: "warning",
2097
2097
  onClick: c[2] || (c[2] = (n) => a(l).table.expand.all()),
2098
2098
  size: r.option.size?.search
2099
2099
  }, {
2100
2100
  default: m(() => [
2101
- E(T(a(b).tCurd("expandCollapse")), 1)
2101
+ E(A(a(b).tCurd("expandCollapse")), 1)
2102
2102
  ]),
2103
2103
  _: 1
2104
2104
  }, 8, ["size"])
@@ -2117,19 +2117,19 @@ const Ke = /* @__PURE__ */ pe(Re, [["render", Ne]]), He = { class: "row flex-cen
2117
2117
  command: "select"
2118
2118
  }, {
2119
2119
  default: m(() => [
2120
- E(T(a(b).tCurd("exportSelect")), 1)
2120
+ E(A(a(b).tCurd("exportSelect")), 1)
2121
2121
  ]),
2122
2122
  _: 1
2123
2123
  })) : C("", !0),
2124
2124
  z(a(x), { command: "page" }, {
2125
2125
  default: m(() => [
2126
- E(T(a(b).tCurd("exportPage")), 1)
2126
+ E(A(a(b).tCurd("exportPage")), 1)
2127
2127
  ]),
2128
2128
  _: 1
2129
2129
  }),
2130
2130
  z(a(x), { command: "all" }, {
2131
2131
  default: m(() => [
2132
- E(T(a(b).tCurd("exportAll")), 1)
2132
+ E(A(a(b).tCurd("exportAll")), 1)
2133
2133
  ]),
2134
2134
  _: 1
2135
2135
  })
@@ -2138,14 +2138,14 @@ const Ke = /* @__PURE__ */ pe(Re, [["render", Ne]]), He = { class: "row flex-cen
2138
2138
  }, 8, ["size"])
2139
2139
  ]),
2140
2140
  default: m(() => [
2141
- O("div", lt, [
2142
- z(a(A), {
2141
+ U("div", lt, [
2142
+ z(a(T), {
2143
2143
  type: "warning",
2144
2144
  loading: a(l).export.loading,
2145
2145
  size: r.option.size?.search
2146
2146
  }, {
2147
2147
  default: m(() => [
2148
- E(T(a(b).tCurd("export")), 1)
2148
+ E(A(a(b).tCurd("export")), 1)
2149
2149
  ]),
2150
2150
  _: 1
2151
2151
  }, 8, ["loading", "size"])
@@ -2155,7 +2155,7 @@ const Ke = /* @__PURE__ */ pe(Re, [["render", Ne]]), He = { class: "row flex-cen
2155
2155
  }, 8, ["onCommand"])) : C("", !0),
2156
2156
  k(p.$slots, "tools-left")
2157
2157
  ]),
2158
- O("div", nt, [
2158
+ U("div", nt, [
2159
2159
  k(p.$slots, "tools-right"),
2160
2160
  a(l).page.showTools ? (f(), h(a(ie), v({
2161
2161
  key: 0,
@@ -2182,10 +2182,10 @@ const Ke = /* @__PURE__ */ pe(Re, [["render", Ne]]), He = { class: "row flex-cen
2182
2182
  ], 2)) : C("", !0)
2183
2183
  ])
2184
2184
  ]),
2185
- O("div", {
2185
+ U("div", {
2186
2186
  class: j(["fit-width relative form-box", [r.option.table?.fitHeight ? "col " : ""]])
2187
2187
  }, [
2188
- O("div", {
2188
+ U("div", {
2189
2189
  class: j(["column form-box-content", [r.option.table?.fitHeight ? "absolute fit" : ""]])
2190
2190
  }, [
2191
2191
  ke((f(), h(a(be), v({
@@ -2226,7 +2226,7 @@ const Ke = /* @__PURE__ */ pe(Re, [["render", Ne]]), He = { class: "row flex-cen
2226
2226
  }, r.option.table?.operate), {
2227
2227
  header: m(() => [
2228
2228
  k(p.$slots, "table-header-op", {}, () => [
2229
- E(T(a(b).tCurd("operation")), 1)
2229
+ E(A(a(b).tCurd("operation")), 1)
2230
2230
  ])
2231
2231
  ]),
2232
2232
  default: m(({ row: n }) => [
@@ -2236,70 +2236,70 @@ const Ke = /* @__PURE__ */ pe(Re, [["render", Ne]]), He = { class: "row flex-cen
2236
2236
  default: m(() => [
2237
2237
  k(p.$slots, "table-op-left", { row: n }),
2238
2238
  r.option.table?.inlineEdit && a(l).inlineEdit.data === n ? (f(), y($, { key: 0 }, [
2239
- z(a(A), {
2239
+ z(a(T), {
2240
2240
  link: "",
2241
2241
  type: "info",
2242
2242
  onClick: a(l).inlineEdit.close
2243
2243
  }, {
2244
2244
  default: m(() => [
2245
- E(T(a(b).tCurd("cancel")), 1)
2245
+ E(A(a(b).tCurd("cancel")), 1)
2246
2246
  ]),
2247
2247
  _: 1
2248
2248
  }, 8, ["onClick"]),
2249
- z(a(A), {
2249
+ z(a(T), {
2250
2250
  link: "",
2251
2251
  type: "primary",
2252
2252
  onClick: a(l).update.submit,
2253
2253
  loading: a(l).update.loading
2254
2254
  }, {
2255
2255
  default: m(() => [
2256
- E(T(a(b).tCurd("confirm")), 1)
2256
+ E(A(a(b).tCurd("confirm")), 1)
2257
2257
  ]),
2258
2258
  _: 1
2259
2259
  }, 8, ["onClick", "loading"]),
2260
2260
  k(p.$slots, "table-op-edit-right", { row: n })
2261
2261
  ], 64)) : (f(), y($, { key: 1 }, [
2262
- a(i)(r.option.table?.add, n) ? (f(), h(a(A), {
2262
+ a(i)(r.option.table?.add, n) ? (f(), h(a(T), {
2263
2263
  key: 0,
2264
2264
  link: "",
2265
2265
  type: "primary",
2266
2266
  onClick: (d) => a(l).update.open(a(u).Add, n)
2267
2267
  }, {
2268
2268
  default: m(() => [
2269
- E(T(a(b).tCurd("add")), 1)
2269
+ E(A(a(b).tCurd("add")), 1)
2270
2270
  ]),
2271
2271
  _: 2
2272
2272
  }, 1032, ["onClick"])) : C("", !0),
2273
- a(i)(r.option.table?.view, n) ? (f(), h(a(A), {
2273
+ a(i)(r.option.table?.view, n) ? (f(), h(a(T), {
2274
2274
  key: 1,
2275
2275
  link: "",
2276
2276
  type: "primary",
2277
2277
  onClick: (d) => a(l).update.open(a(u).View, n)
2278
2278
  }, {
2279
2279
  default: m(() => [
2280
- E(T(a(b).tCurd("view")), 1)
2280
+ E(A(a(b).tCurd("view")), 1)
2281
2281
  ]),
2282
2282
  _: 2
2283
2283
  }, 1032, ["onClick"])) : C("", !0),
2284
- a(i)(r.option.table?.update, n) ? (f(), h(a(A), {
2284
+ a(i)(r.option.table?.update, n) ? (f(), h(a(T), {
2285
2285
  key: 2,
2286
2286
  link: "",
2287
2287
  type: "warning",
2288
2288
  onClick: (d) => a(l).update.open(a(u).Update, n)
2289
2289
  }, {
2290
2290
  default: m(() => [
2291
- E(T(a(b).tCurd("edit")), 1)
2291
+ E(A(a(b).tCurd("edit")), 1)
2292
2292
  ]),
2293
2293
  _: 2
2294
2294
  }, 1032, ["onClick"])) : C("", !0),
2295
- a(i)(r.option.table?.delete, n) ? (f(), h(a(A), {
2295
+ a(i)(r.option.table?.delete, n) ? (f(), h(a(T), {
2296
2296
  key: 3,
2297
2297
  link: "",
2298
2298
  type: "danger",
2299
2299
  onClick: (d) => a(l).remove.open([n])
2300
2300
  }, {
2301
2301
  default: m(() => [
2302
- E(T(a(b).tCurd("delete")), 1)
2302
+ E(A(a(b).tCurd("delete")), 1)
2303
2303
  ]),
2304
2304
  _: 2
2305
2305
  }, 1032, ["onClick"])) : C("", !0),
@@ -2318,7 +2318,7 @@ const Ke = /* @__PURE__ */ pe(Re, [["render", Ne]]), He = { class: "row flex-cen
2318
2318
  ])
2319
2319
  ], 2)
2320
2320
  ], 2),
2321
- O("div", it, [
2321
+ U("div", it, [
2322
2322
  (r.option.page?.show === void 0 || r.option.page?.show) && !a(l).page.showTools ? (f(), h(a(ie), v({
2323
2323
  key: 0,
2324
2324
  "current-page": a(l).page.num,
@@ -2345,27 +2345,27 @@ const Ke = /* @__PURE__ */ pe(Re, [["render", Ne]]), He = { class: "row flex-cen
2345
2345
  "before-close": a(l).update.close
2346
2346
  }, r.option.dialog), {
2347
2347
  footer: m(() => [
2348
- O("span", rt, [
2348
+ U("span", rt, [
2349
2349
  z(a(N), {
2350
2350
  size: r.option.size?.form
2351
2351
  }, {
2352
2352
  default: m(() => [
2353
- z(a(A), {
2353
+ z(a(T), {
2354
2354
  onClick: a(l).update.close
2355
2355
  }, {
2356
2356
  default: m(() => [
2357
- E(T(a(b).tCurd("close")), 1)
2357
+ E(A(a(b).tCurd("close")), 1)
2358
2358
  ]),
2359
2359
  _: 1
2360
2360
  }, 8, ["onClick"]),
2361
- a(l).update.type !== a(u).View ? (f(), h(a(A), {
2361
+ a(l).update.type !== a(u).View ? (f(), h(a(T), {
2362
2362
  key: 0,
2363
2363
  type: "primary",
2364
2364
  onClick: a(l).update.submit,
2365
2365
  loading: a(l).update.loading
2366
2366
  }, {
2367
2367
  default: m(() => [
2368
- E(T(a(b).tCurd("submit")), 1)
2368
+ E(A(a(b).tCurd("submit")), 1)
2369
2369
  ]),
2370
2370
  _: 1
2371
2371
  }, 8, ["onClick", "loading"])) : C("", !0)
@@ -2439,26 +2439,26 @@ const Ke = /* @__PURE__ */ pe(Re, [["render", Ne]]), He = { class: "row flex-cen
2439
2439
  "close-on-click-modal": !1
2440
2440
  }, {
2441
2441
  footer: m(() => [
2442
- O("span", st, [
2442
+ U("span", st, [
2443
2443
  z(a(N), {
2444
2444
  size: r.option.size?.form
2445
2445
  }, {
2446
2446
  default: m(() => [
2447
- z(a(A), {
2447
+ z(a(T), {
2448
2448
  onClick: a(l).remove.close
2449
2449
  }, {
2450
2450
  default: m(() => [
2451
- E(T(a(b).tCurd("close")), 1)
2451
+ E(A(a(b).tCurd("close")), 1)
2452
2452
  ]),
2453
2453
  _: 1
2454
2454
  }, 8, ["onClick"]),
2455
- z(a(A), {
2455
+ z(a(T), {
2456
2456
  type: "danger",
2457
2457
  onClick: a(l).remove.submit,
2458
2458
  loading: a(l).remove.loading
2459
2459
  }, {
2460
2460
  default: m(() => [
2461
- E(T(a(b).tCurd("confirmDelete")), 1)
2461
+ E(A(a(b).tCurd("confirmDelete")), 1)
2462
2462
  ]),
2463
2463
  _: 1
2464
2464
  }, 8, ["onClick", "loading"])
@@ -2468,7 +2468,7 @@ const Ke = /* @__PURE__ */ pe(Re, [["render", Ne]]), He = { class: "row flex-cen
2468
2468
  ])
2469
2469
  ]),
2470
2470
  default: m(() => [
2471
- O("div", null, T(a(b).tCurd("confirmDeleteMessage", a(l).remove.items.length)), 1)
2471
+ U("div", null, A(a(b).tCurd("confirmDeleteMessage", a(l).remove.items.length)), 1)
2472
2472
  ]),
2473
2473
  _: 1
2474
2474
  }, 8, ["modelValue", "title"]),
@@ -2513,7 +2513,7 @@ class mt {
2513
2513
  i.accept = l, i.style.display = "none", i.onchange = (e) => {
2514
2514
  const s = e.target.files[0];
2515
2515
  if (!s) {
2516
- U.fail("未选择文件"), t("未选择文件");
2516
+ O.fail("未选择文件"), t("未选择文件");
2517
2517
  return;
2518
2518
  }
2519
2519
  const p = new FileReader();
@@ -2521,13 +2521,13 @@ class mt {
2521
2521
  const g = l == ".json" ? JSON.parse(c.target.result) : c.target.result;
2522
2522
  u(g);
2523
2523
  }, p.onerror = () => {
2524
- U.fail("文件读取失败"), t("文件读取失败");
2524
+ O.fail("文件读取失败"), t("文件读取失败");
2525
2525
  }, p.readAsText(s), document.body.removeChild(i);
2526
2526
  }, document.body.appendChild(i), i.click();
2527
2527
  });
2528
2528
  }
2529
2529
  const ut = (r, o) => {
2530
- if (r.component("TCurd", dt), r.component("TFormList", ne), r.component("TColumn", Ue), o?.customComponent) {
2530
+ if (r.component("TCurd", dt), r.component("TFormList", ne), r.component("TColumn", Oe), o?.customComponent) {
2531
2531
  M.customComponent = o.customComponent;
2532
2532
  for (const u in o.customComponent)
2533
2533
  r.component(u, o.customComponent[u]);
@@ -2538,14 +2538,14 @@ const ut = (r, o) => {
2538
2538
  export {
2539
2539
  P as ArrUtil,
2540
2540
  Fe as ExcelUtil,
2541
- Ue as TColumn,
2541
+ Oe as TColumn,
2542
2542
  dt as TCurd,
2543
2543
  mt as TFile,
2544
2544
  M as TForm,
2545
2545
  D as TFormConfig,
2546
2546
  b as TFormI18n,
2547
2547
  ne as TFormList,
2548
- U as TSys,
2548
+ O as TSys,
2549
2549
  ht as default,
2550
2550
  ut as install
2551
2551
  };
@@ -1 +1 @@
1
- (function(C,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("element-plus"),require("vue-router"),require("vue")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue-router","vue"],m):(C=typeof globalThis<"u"?globalThis:C||self,m(C.cc1Form={},C.ElementPlus,C.VueRouter,C.Vue))})(this,(function(C,m,Ce,e){"use strict";class k{static router;static routes;static getRouterPath=()=>this.router.currentRoute.value.path;static EDialog={Add:"Add",Update:"Update",View:"View",Remove:"Remove"};static isFun=(n,...c)=>Array.isArray(n)?n.some(o=>typeof o=="function"?o(...c):o):typeof n=="function"?n(...c):n;static getRouterParams=()=>{const n=this.router.currentRoute.value.query||{},c=this.router.currentRoute.value.params||{};return Object.keys(n).length?n:Object.keys(c).length?c:{}};static moduleObj={};static loadModule=async n=>{if(!k.moduleObj[n])throw new Error(`模块${n}未加载,请赋值如:TSys.moduleObj = { ${n}: ()=>import('${n}') }`);const c=await k.moduleObj[n]();return c.default??c};static tipMessages={};static tipMessagesGap=500;static showMessage(n,c,o={}){const r=Date.now();if(!this.tipMessages[n]||r-this.tipMessages[n]>this.tipMessagesGap){this.tipMessages[n]=r;const a=Object.assign({message:n,type:c},o);m.ElMessage(a),setTimeout(()=>{delete this.tipMessages[n]},this.tipMessagesGap)}}static fail=(n,c={})=>{this.showMessage(n,"error",c)};static success=(n,c={})=>{this.showMessage(n,"success",c)};static loadingObj=null;static loadingTimer=null;static loading=(n=!0,c="Loading...")=>{Timer.un(this.loadingTimer),this.loadingTimer=Timer.once(()=>{n?this.loadingObj=m.ElLoading.service({lock:!0,text:c,background:"rgba(0, 0, 0, 0.3)"}):this.loadingObj&&(this.loadingObj.close(),this.loadingObj=null)},50)};static openUrl=(n,c=!0)=>{if(c){let o=screen.width/2-500,r=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="+r+", left="+o)}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(c,o)=>{let r=document.getElementById(n.id);const a=await k.loadModule("html2canvas");try{a(r,{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 s=t.toDataURL("image/png");c(s)})}catch(t){o(t)}})}class u{static config={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:{refresh:!0,expand:!1,search:!0,reset:!0,add:!0,delete:!0,export:{show:!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},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=>{u.config=ObjectUtil.deepMerge(u.config,n)}}class B{static customComponent={};static findOptions=(n,c)=>{const o=n.column.find(a=>a.key===c),r=a=>a.replace(/-([a-z])/g,(t,s)=>s.toUpperCase());if(o)return o.options[r(o.type)]};static setOptionsData=(n,c,o)=>{const r=B.findOptions(n,c);r&&(r.data=o)};static form={openBefore:{parentId:(n,c,o,r)=>{const a=u.config.table.rowKey;n?c.type===k.EDialog.Add?(c.form.parentId=n[a],c.form.sort=n.children.length+1):c.form.parentId=n.parentId.substring(n.parentId.lastIndexOf(",")+1):(c.form.parentId="0",c.form.sort=o.length+1),B.setOptionsData(r,"parentId",[{[a]:"0",title:"根",children:o}])}}}}function Be(i){return i}const A={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:"确认要修改吗?"};class h{static t(n,...c){if(typeof n=="function")return n(...c);n=String(n);let o=0;return n.replace(/{([^}]+)}/g,(r,a)=>o<c.length?String(c[o++]):`{${a}}`)}static setI18n=n=>{h.curd=ObjectUtil.deepMerge(h.curd,n)};static tCurd(n,...c){return this.t(this.curd[n],...c)}static curd=A}class E{static getIdFun=()=>StrUtil.uuid();static setId=(n,c,o)=>{c[n]||(c[n]=[]);const r=u.config.table.rowKey;c[n].forEach(a=>{o.forEach(t=>{let s=t.default??"";t.type==="number"&&(s=t.default??0),t.type==="boolean"&&(s=t.default??!1),t.type==="time"&&(s=t.default??new Date),a[t.value]===void 0&&(a[t.value]=s)}),a[r]||(a[r]=E.getIdFun())})};static add=(n,c,o,r)=>{const a=JSONUtil.cp(o);E.setId(n,c,o);const t=u.config.table.rowKey;c[n].push(a.reduce((s,f)=>{let p=f.default??"";return f.type==="number"&&(p=f.default??0),f.type==="boolean"&&(p=f.default??!1),f.type==="time"&&(p=f.default??new Date),s[f.value]=p,s},{[t]:E.getIdFun()})),r?.(c)};static remove=(n,c,o,r)=>{const a=u.config.table.rowKey;c[n]=c[n].filter(t=>t[a]!==o[a]),r?.(c)};static getNoIdData=(n,c)=>{const o=JSONUtil.cp(n),r=u.config.table.rowKey;return o.forEach(a=>{a[r]&&delete a[r],c&&a[c]&&E.getNoIdData(a[c],c)}),o}}const M={key:0,class:"column",style:{width:"100%",gap:"10px"}},H={class:"row items-center",style:{gap:"10px",width:"100%"}},D=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:""}},emits:["change"],setup(i,{emit:n}){const c=i,o=e.reactive({show:!1,add:(a,t,s)=>{E.add(a,t,s,()=>{r("change")})},remove:(a,t,s)=>{E.remove(a,t,s,()=>{r("change")})}});e.onMounted(()=>{E.setId(c.field,c.row,c.itemFields),o.show=!0});const r=n;return(a,t)=>{const s=e.resolveComponent("el-button"),f=e.resolveComponent("el-input");return o.show?(e.openBlock(),e.createElementBlock("div",M,[e.renderSlot(a.$slots,"list-start",{row:i.row}),e.createElementVNode("div",null,[e.createVNode(s,{link:"",type:"primary",onClick:t[0]||(t[0]=p=>o.add(i.field,i.row,i.itemFields))},{default:e.withCtx(()=>t[2]||(t[2]=[e.createTextVNode("添加")])),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.row[i.field],p=>(e.openBlock(),e.createElementBlock("div",H,[e.renderSlot(a.$slots,"item-start",{item:p,row:i.row}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.itemFields,g=>(e.openBlock(),e.createBlock(f,{modelValue:p[g.value],"onUpdate:modelValue":l=>p[g.value]=l,style:e.normalizeStyle({width:i.inputWidth}),class:e.normalizeClass(i.inputClass),placeholder:g[i.label]||g[i.value],onChange:t[1]||(t[1]=l=>r("change"))},null,8,["modelValue","onUpdate:modelValue","style","class","placeholder"]))),256)),e.renderSlot(a.$slots,"item-end",{item:p,row:i.row}),e.createVNode(s,{link:"",type:"danger",onClick:g=>o.remove(i.field,i.row,p)},{default:e.withCtx(()=>t[3]||(t[3]=[e.createTextVNode("删除")])),_:2},1032,["onClick"])]))),256)),e.renderSlot(a.$slots,"list-end",{row:i.row})])):e.createCommentVNode("",!0)}}}),I={class:"row form-item-content",style:{width:"100%"}},j={class:"col"},x={class:"col"},R=["innerHTML"],O=e.defineComponent({__name:"column",props:{option:{default:{}},type:{default:""}},setup(i,{expose:n}){const c=k.isFun,o=k.EDialog,r=e.ref(),a=i,t=e.reactive({rules:{},show:!0,form:{},formDefault:{},type:a.type||o.Add,formColumn:[],getDisabled:s=>t.type===o.View?s.disabled?.view===void 0?!0:s.disabled?.view:s.disabled?.[t.type===o.Add?"create":"update"],getBind:s=>s.options?.[t.type===o.Add?"formAdd":"formUpdate"]?.[s.type]||s.options?.[s.type]||{},getOn:s=>s.options?.[t.type===o.Add?"formAdd":"formUpdate"]?.[s.type]?.on||s.options?.[s.type]?.on||{},getColumnSpan:(s,f)=>{if(s.item.form?.spanCol){const p=a.option.form?.maxSpan||12,g=a.option.form?.defaultSpan||p/2,d=f.filter(b=>!k.isFun(b.item.show?.form,t.form,t.type)).reduce((b,y)=>b+(y.item.form?.span||g),0);return(s.item.form?.span||g)+d}return s.item.form?.span},initColumnForm:()=>{const s=a.option;t.formColumn=[],t.rules={},t.formDefault={};const f=[],p=a.option.form?.maxSpan||12,g=a.option.form?.defaultSpan||p/2;let l=[];const d=y=>{if(y.children){y.children.forEach(w=>{d(w)});return}if(t.formDefault[y.key]=y.value,y.isForm&&(typeof y.show?.form!="boolean"||y.show?.form)){y.form=y.form||{span:g},y.form.span=y.form.span??g;const w=y.form.span,V=l.reduce((z,F)=>z+F.span,w),N=l.length;if(l.push({item:y,span:w}),(N===1&&l[0].span===0||V>=p||w===0&&N>1)&&(f.push(l),l=[]),y.rules){const z={input:h.tCurd("placeholderInput"),select:h.tCurd("placeholderSelect")},F=(z[y.type]||z.input)+y.label;t.rules[y.key]=typeof y.rules=="boolean"?[{required:!0,message:F,trigger:"blur"}]:y.rules}}},b=(y,w)=>{y.isForm=w,Array.isArray(y.children)&&y.children.forEach(V=>b(V,w))};s.column.forEach(y=>{b(y,!0),d(y)}),l.length>0&&f.push(l),t.formColumn=f,t.form=JSONUtil.cp(t.formDefault)}});return t.initColumnForm(),n({ref:r,conf:t}),(s,f)=>(e.openBlock(),e.createBlock(e.unref(m.ElForm),{ref_key:"ruleFormRef",ref:r,model:t.form,rules:t.rules},{default:e.withCtx(()=>[t.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.formColumn,(p,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:g},[e.unref(c)(p.map(l=>l.item?.show?.form),t.form,t.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:i.option.form?.stripe===void 0?!0:i.option.form?.stripe}])},[e.renderSlot(s.$slots,"form-start",{row:t.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p,l=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:l.item.key},[e.unref(c)(l.item.show?.form,t.form,t.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([l.item.form.span>0?`col-${t.getColumnSpan(l,p)}`:"col",`form-item-col-${l.item.key}`])},[e.createVNode(e.unref(m.ElFormItem),{class:e.normalizeClass({"hide-label":typeof l.item.text?.form?.label=="boolean"?!l.item.text?.form?.label:!1}),label:typeof l.item.text?.form?.label=="string"?l.item.text?.form?.label:l.item.label,prop:l.item.key,"label-width":l.item.form?.labelWidth||i.option.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.createElementVNode("div",I,[e.renderSlot(s.$slots,"form-"+l.item.key+"-start",{row:t.form,item:l.item}),e.createElementVNode("div",j,[e.createElementVNode("div",x,[e.renderSlot(s.$slots,"form-"+l.item.key,{row:t.form,item:l.item},()=>[l.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(m.ElInput),e.mergeProps({key:0,modelValue:t.form[l.item.key],"onUpdate:modelValue":d=>t.form[l.item.key]=d,ref_for:!0},t.getBind(l.item),e.toHandlers(t.getOn(l.item)),{disabled:t.getDisabled(l.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(m.ElSwitch),e.mergeProps({key:1,modelValue:t.form[l.item.key],"onUpdate:modelValue":d=>t.form[l.item.key]=d,ref_for:!0},t.getBind(l.item),e.toHandlers(t.getOn(l.item)),{disabled:t.getDisabled(l.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),e.mergeProps({key:2,modelValue:t.form[l.item.key],"onUpdate:modelValue":d=>t.form[l.item.key]=d,ref_for:!0},t.getBind(l.item),e.toHandlers(t.getOn(l.item)),{disabled:t.getDisabled(l.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.options?.select?.data,d=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):l.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(m.ElRadioGroup),e.mergeProps({key:3,modelValue:t.form[l.item.key],"onUpdate:modelValue":d=>t.form[l.item.key]=d,ref_for:!0},t.getBind(l.item),e.toHandlers(t.getOn(l.item)),{disabled:t.getDisabled(l.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.options?.radio?.data,d=>(e.openBlock(),e.createBlock(e.unref(m.ElRadio),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):l.item.type==="list"?(e.openBlock(),e.createBlock(D,e.mergeProps({key:4,row:t.form,field:l.item.key,ref_for:!0},t.getBind(l.item),e.toHandlers(t.getOn(l.item)),{disabled:t.getDisabled(l.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):l.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(m.ElTreeSelect),e.mergeProps({key:5,modelValue:t.form[l.item.key],"onUpdate:modelValue":d=>t.form[l.item.key]=d,ref_for:!0},t.getBind(l.item),e.toHandlers(t.getOn(l.item)),{disabled:t.getDisabled(l.item),style:{width:"100%"}}),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(m.ElDatePicker),e.mergeProps({key:6,modelValue:t.form[l.item.key],"onUpdate:modelValue":d=>t.form[l.item.key]=d,ref_for:!0},t.getBind(l.item),e.toHandlers(t.getOn(l.item)),{disabled:t.getDisabled(l.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):l.item.type&&(e.unref(B).customComponent[l.item.type]||e.unref(B).customComponent[l.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[l.item.type]?.form||e.unref(B).customComponent[l.item.type]),e.mergeProps({key:7,modelValue:t.form[l.item.key],"onUpdate:modelValue":d=>t.form[l.item.key]=d,ref_for:!0},t.getBind(l.item),e.toHandlers(t.getOn(l.item)),{disabled:t.getDisabled(l.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(s.$slots,"form-"+l.item.key+"-right",{row:t.form,item:l.item})]),e.renderSlot(s.$slots,"form-"+l.item.key+"-tip",{row:t.form,item:l.item},()=>[l.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof l.item.form?.tipText=="function"?l.item.form?.tipText(t.form,t.type):l.item.form?.tipText},null,8,R)):e.createCommentVNode("",!0)])]),e.renderSlot(s.$slots,"form-"+l.item.key+"-end",{row:t.form,item:l.item})])]),_:2},1032,["class","label","prop","label-width"])],2)):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(s.$slots,"form-end",{row:t.form})],2)):e.createCommentVNode("",!0)],64))),128)):e.createCommentVNode("",!0)]),_:3},8,["model","rules"]))}});class U{static exportToExcel=async(n,c,o)=>{if(!n||n.length===0)return;const r=await k.loadModule("xlsx"),a=n.map(f=>{const p={};return c.forEach(g=>{p[g.label]=f[g.key]}),p}),t=r.utils.json_to_sheet(a),s=r.utils.book_new();r.utils.book_append_sheet(s,t,"Sheet1"),o?typeof o=="function"&&(o=o()):o=`导出数据_${new Date().Format("yyyy-MM-dd")}_${new Date().getTime()}`,r.writeFile(s,`${o}.xlsx`)}}const S=k.EDialog,K=i=>{const n=e.ref(),c=e.ref(),o=e.reactive({option:i.option,search:{column:{list:[]},form:{},formDefault:{},getPlaceholder:(r,a=h.tCurd("placeholderInput"))=>r.text?.search?.placeholder===void 0?`${a}${r.label}`:r.text?.search?.placeholder,getFormData:()=>{let r={};i.option.column.forEach(t=>{(typeof t.show?.search=="function"?t.show?.search(o.search.form):t.show?.search)&&(r[t.key]=o.search.form[t.key])});const a=i.option.search?.before?.(r);return a&&(r=a),r},reset:()=>{const r=o.search.formDefault;Object.keys(r).forEach(a=>{i.option.search?.resetMode==="none"?r[a]=void 0:r[a]=o.search.formDefault[a]}),o.search.form=JSONUtil.cp(r),o.page.num=1,i.option.init!==!1&&o.table.getList()},submit:()=>{o.page.num=1,o.table.getList()}},page:{num:1,total:0,layout:i.option.page?.layout||u.config.pagination.layout,showTools:i.option.page?.showTools||u.config.pagination.showTools,size:i.option.page?.size||u.config.pagination.size,sizeList:i.option.page?.sizeList||u.config.pagination.pageSizes,pagerCount:i.option.page?.pagerCount||u.config.pagination.pagerCount},table:{op:{width:(...r)=>r.filter(t=>t).length*30+60},loading:!1,data:[],expand:{isExpand:!1,rowKeys:[],change:(r,a)=>{},all:()=>{if(o.table.expand.isExpand)o.table.expand.rowKeys=[];else{const r=a=>{let t=[];return a.forEach(s=>{t.push(s[i.option.table.rowKey]),s.children&&s.children.length>0&&(t=t.concat(r(s.children)))}),t};o.table.expand.rowKeys=r(o.table.data)}o.table.expand.isExpand=!o.table.expand.isExpand}},column:{list:[],show:{listSource:[],list:[]}},getList:async()=>{o.table.loading=!0;const r=i.option.api.list;try{await o.initApiData("init");let a={};if(o.table.sort.prop){const{props:d,order:b}=u.config.table.sort;a={[d.field]:o.table.sort.prop,[b.field]:o.table.sort.order}}const t=await r({[u.config.page.size]:o.page.size,[u.config.page.num]:o.page.num,...o.search.getFormData(),...a}),s=u.config.result,f=t.data||{[s.list]:t};let p=(Array.isArray(f[s.list]),f[s.list]);const g=o.update.formColumn.flat(),l=JSONUtil.cp(p).map(d=>(Object.keys(d).forEach(y=>{const w=g.find(V=>V.item.key===y);w&&["select","radio"].includes(w.item.type)&&(w.item.table.format||(w.item.table.format=V=>w.item.options[w.item.type].data?.find(N=>N.value==V[y])?.label||V[y]))}),d));o.table.data=i.option.data?await i.option.data(l,p):l,o.page.total=f[s.total]||0}catch(a){console.error(a)}finally{o.table.loading=!1}},selection:{list:[],change:r=>{o.table.selection.list=r}},sort:{prop:"",order:"",change:r=>{u.config.table.sort.resetPage&&(o.page.num=1);const a=u.config.table.sort;if(a.change){a.change(r,o);return}o.table.sort.prop=r.prop,r.order===null?o.table.sort.order="":o.table.sort.order=r.order==="ascending"?a.order.asc:a.order.desc,o.table.getList()}}},export:{run:{start:async r=>{let a=await o.export.run[r](),t=i.option.column;const s=JSONUtil.cp({data:a,columns:t}),f=i.option.tools?.export||{};f.before&&f.before(s),U.exportToExcel(s.data,s.columns,f.fileName)},select:()=>{if(o.table.selection.list.length===0)throw k.fail(h.tCurd("selectDataToExport")),new Error(h.tCurd("selectDataToExport"));return o.table.selection.list},page:()=>{if(o.table.data.length===0)throw k.fail(h.tCurd("noData")),new Error(h.tCurd("noData"));return o.table.data},all:async()=>{o.export.loading=!0;try{if(i.option.tools?.export?.all){await i.option.tools?.export?.all({[u.config.page.size]:o.page.size,[u.config.page.num]:o.page.num,...o.search.getFormData()});return}const r=i.option.api.list,a=await r({[u.config.page.size]:999999,[u.config.page.num]:1});return(a.data||{[u.config.result.list]:a})[u.config.result.list]}catch(r){console.error(r)}finally{o.export.loading=!1}}},loading:!1,click:r=>{o.export.loading||o.export.run.start(r)}},update:{title:"",rules:{},show:!1,showContent:!1,loading:!1,type:S.Add,form:{},formDefault:{},formColumn:[],getDisabled:r=>o.update.type===S.View?r.disabled?.view===void 0?!0:r.disabled?.view:r.disabled?.[o.update.type===S.Add?"create":"update"],getBind:r=>r.options?.[o.update.type===S.Add?"formAdd":"formUpdate"]?.[r.type]||r.options?.[r.type]||{},getOn:r=>r.options?.[o.update.type===S.Add?"formAdd":"formUpdate"]?.[r.type]?.on||r.options?.[r.type]?.on||{},getBindOnByKey:r=>{try{const t=o.update.formColumn.flat().find(s=>s.item.key===r)?.item;return t?{bind:o.update.getBind(t),on:o.update.getOn(t)}:{bind:{},on:{}}}catch{return{bind:{},on:{}}}},edit:{data:{},getApiData:r=>{if(i.option.form?.editAll)return r;let a={[i.option.table?.rowKey]:o.update.edit.data[i.option.table?.rowKey]};return Object.keys(o.update.edit.data).forEach(t=>{r[t]!==o.update.edit.data[t]&&(a[t]=r[t])}),a}},view:{},open:(r,a)=>{o.update.showContent||FunUtil.throttle(async()=>{k.loading(!0);try{o.update.type=r,await o.initApiData("update");const t=r===S.Add;if(!t&&i.option.table?.inlineEdit){o.inlineEdit.open(a);return}o.update.edit.data=a,o.update.title=h.tCurd(t?"add":r===S.View?"view":"edit"),o.update.form=JSONUtil.cp(t?o.update.formDefault:a),await i.option.form?.openBefore?.(a,o.update),o.inlineEdit.data||(o.update.show=!0),o.update.showContent=!0,i.option.form?.openAfter?.(a,o.update)}catch(t){console.error(t)}finally{k.loading(!1)}})},submit:()=>{FunUtil.throttle(async()=>{await c.value?.validate(async(s,f)=>new Promise((p,g)=>{s||(k.fail(h.tCurd("checkFormData")),g(!1)),p()})),o.update.loading=!0;const r=o.update.type===S.Add?i.option.api.create:i.option.api.update;try{await i.option.form?.submitBefore?.(o.update.form,o.update)}catch{o.update.loading=!1;return}let a=JSONUtil.cp(o.update.form);delete a.children;const t=new Set(i.option.column.filter(s=>s.type==="datetime").map(s=>s.key));Object.keys(a).forEach(s=>{if(t.has(s)&&a[s]!=null){const f=new Date(a[s]).getTime();isNaN(f)||(a[s]=f)}});try{if(!r)return;await r({...a}),o.update.close(),await o.table.getList(),i.option.form?.submitAfter?.(a,o.update)}catch(s){console.error(s)}finally{o.update.loading=!1}})},close:()=>{o.update.show=!1,setTimeout(()=>{o.update.showContent=!1},350)}},inlineEdit:{data:null,open:r=>{o.inlineEdit.data=r,o.update.open(S.Update,r)},close:()=>{o.inlineEdit.data=null,o.update.close()}},remove:{title:h.tCurd("confirmDelete"),show:!1,items:[],loading:!1,close:()=>{o.remove.show=!1},open:r=>{if(r.length===0){k.fail(h.tCurd("selectDataToDelete"));return}o.remove.items=r,o.remove.show=!0},submit:()=>{FunUtil.throttle(async()=>{o.remove.loading=!0;const r=i.option.api.delete;try{if(!r)return;await r({[i.option.table?.rowKey]:o.remove.items.map(a=>a[i.option.table?.rowKey]),items:o.remove.items}),k.success(h.tCurd("operationSuccess")),o.table.data.length<=1&&o.page.num>1&&(o.page.num-=1),o.remove.close(),await o.table.getList()}catch(a){console.error(a)}finally{o.remove.loading=!1}})}},init:()=>{o.initCurdConfig(),o.initColumnOptions(),o.initColumnForm()},apiDataMap:{},initApiData:async r=>{const a=[],t=s=>{if(s.children&&s.children.length){s.children.forEach(f=>t(f));return}if(["select","radio"].includes(s.type)&&s.options?.[s.type]?.dataApi&&s.options?.[s.type]?.dataApiConfig?.[r]){if(o.apiDataMap[s.key]&&s.options?.[s.type]?.dataApiConfig?.once)return;const f=(async()=>{try{let p=await s.options?.[s.type]?.dataApi?.(o.update.form,r);if(p){const g=s.options?.[s.type]?.dataPath;g&&(p=ObjectUtil.getPathValue(p,g)),s.options[s.type].data=p,o.apiDataMap[s.key]=p}}catch{}})();a.push(f)}};return i.option.column.forEach(s=>{t(s)}),await Promise.all(a),!0},initCurdConfig:()=>{const r=JSONUtil.cp(u.config);r.table.emptyText=h.tCurd("noData"),i.option.size=i.option.size||{},r.table.size=i.option.size.table||r.size.table,r.form.size=i.option.size.form||r.size.form,r.size.search=i.option.size.search||r.size.search;const a=ObjectUtil.deepMerge(r,i.option||{});Object.keys(a).forEach(t=>{i.option[t]=a[t]})},initColumnOptions:()=>{let r=JSONUtil.cp(u.config.columnConfig);r.options=ObjectUtil.deepMerge(r.options,{switch:{activeLabel:h.tCurd("switchOn"),inactiveLabel:h.tCurd("switchOff")}});const a=t=>{for(const s in r){if(s==="table"){if(t.table=ObjectUtil.deepMerge(r.table,t.table||{}),t.children){t.children.forEach(p=>{a(p)});return}}else s==="type"?t.type=t.type||r.type:t[s]=ObjectUtil.deepMerge(r[s],t[s]||{});t.options=t.options||{},t.options[t.type]=t.options[t.type]||{},t.options[t.type].size=i.option.size.form,["search","formAdd","formUpdate"].forEach(p=>{t.options[p]=t.options[p]||JSONUtil.cp(t.options),t.options[p][t.type]=t.options[p][t.type]||{},t.options[p][t.type].size=p==="search"?i.option.size.search:i.option.size.form}),t.table=ObjectUtil.deepMerge(t.table,t.options[t.type].table||{})}t.type==="switch"&&(t.options.switch.tableBeforeChange=async(s,f)=>{const p=t.options?.switch;try{await n.value?.open({title:h.tCurd("confirmModify"),content:h.tCurd("confirmSwitchMessage")}),o.table.loading=!0;try{return i.option.api.update?(await i.option.api.update({[i.option.table?.rowKey]:f[i.option.table?.rowKey],[s]:f[s]===p.activeValue?p.inactiveValue:p.activeValue,final(g,l,d){o.table.loading=!1}}),o.table.loading=!1,k.success(h.tCurd("operationSuccess")),o.table.getList(),!0):void 0}catch(g){return console.error(g),!1}finally{o.table.loading=!1}}catch{return!1}}),t.type==="treeSelect"&&(t.options.treeSelect.rowKey=i.option.table?.rowKey,t.options.treeSelect.nodeKey=i.option.table?.rowKey)};i.option.column.forEach(a),i.option.table?.column?.forEach(a)},getColumnSpan:(r,a)=>{if(r.item.form?.spanCol){const t=u.config.form.defaultSpan,f=a.filter(p=>!k.isFun(p.item.show?.form,o.update.form,o.update.type)).reduce((p,g)=>p+(g.item.form?.span||t),0);return(r.item?.form.span||t)+f}return r.item.form.span},initColumnForm:()=>{const r=i.option;o.update.formColumn=[],o.table.column.show={list:[],listSource:[]};const a=[],t=i.option.form?.maxSpan||12,s=i.option.form?.defaultSpan||t/2;let f=[];const p=d=>{if(d.children){o.table.column.show.list.push(d.key),d.children.forEach(b=>{p(b)});return}if(o.update.formDefault[d.key]=d.value,d.table.table&&(d.show.table&&o.table.column.show.list.push(d.key),d.table.table&&o.table.column.show.listSource.push(d.key)),!(d.isForm&&typeof d.show?.form=="boolean")||d.show?.form){d.form=d.form||{span:s},d.form.span=d.form.span??s;let b=d.form.span,y=f.reduce((V,N)=>V+N.span,b);const w=f.length;if(f.push({item:d,span:b}),(w===1&&f[0].span===0||y>=t||b===0&&w>1)&&(a.push(f),f=[]),d.rules){const V={input:h.tCurd("placeholderInput"),select:h.tCurd("placeholderSelect")},N=(V[d.type]||V.input)+d.label;o.update.rules[d.key]=typeof d.rules=="boolean"?[{required:!0,message:N,trigger:"blur"}]:d.rules}}},g=(d,b)=>{d.isForm=b,Array.isArray(d.children)&&d.children.forEach(y=>g(y,b))};r.column.forEach(d=>{d.isForm=!0,g(d,!0),p(d)}),i.option.table?.column?.forEach(d=>{g(d,!1),p(d)}),o.search.column.list=r.column.concat(r.table?.column||[]),o.table.column.list=o.search.column.list.filter(d=>d.table?.table),o.search.column.list.sort((d,b)=>d.sort?.search-b.sort?.search),o.table.column.list.sort((d,b)=>d.sort?.table-b.sort?.table),f.length>0&&a.push(f),o.update.formColumn=a;const l=i.option.search?.formDefault;l&&Object.keys(l).forEach(d=>{o.search.formDefault[d]=l[d]}),r.column.forEach(d=>{d.show?.search||(o.search.formDefault[d.key]=void 0)}),o.search.form=JSONUtil.cp(o.search.formDefault)}});return o.init(),e.onMounted(()=>{i.option.init!==!1&&o.table.getList()}),{conf:o,switchConfirmRef:n,ruleFormRef:c}},J={class:"dialog-footer"},W=e.defineComponent({__name:"switchConfirm",props:{size:{}},setup(i,{expose:n}){const c=e.ref(!1),o=e.ref("确认修改"),r=e.ref("确认要修改状态吗?");let a=null,t=null;const s=g=>(g?.title&&(o.value=g.title),g?.content&&(r.value=g.content),c.value=!0,new Promise((l,d)=>{a=l,t=d})),f=()=>{c.value=!1,a?.(!0),a=null,t=null},p=()=>{c.value=!1,t?.(new Error("用户取消操作")),a=null,t=null};return n({open:s}),(g,l)=>{const d=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(e.unref(m.ElDialog),{modelValue:c.value,"onUpdate:modelValue":l[0]||(l[0]=b=>c.value=b),title:o.value,"close-on-click-modal":!1,width:"400px"},{footer:e.withCtx(()=>[e.createVNode(d,{size:g.size},{default:e.withCtx(()=>[e.createElementVNode("span",J,[e.createVNode(e.unref(m.ElButton),{onClick:p},{default:e.withCtx(()=>l[1]||(l[1]=[e.createTextVNode("取消")])),_:1}),e.createVNode(e.unref(m.ElButton),{type:"primary",onClick:f},{default:e.withCtx(()=>l[2]||(l[2]=[e.createTextVNode("确认")])),_:1})])]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(r.value),1)]),_:1},8,["modelValue","title"])}}}),$=(i,n)=>{const c=i.__vccOpts||i;for(const[o,r]of n)c[o]=r;return c},q={},G={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function X(i,n){return e.openBlock(),e.createElementBlock("svg",G,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 Q=$(q,[["render",X]]),Y={},Z={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function P(i,n){return e.openBlock(),e.createElementBlock("svg",Z,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 _=$(Y,[["render",P]]),v={class:"row flex-center table-header-label inline"},ee={class:"table-header-tooltip"},te=["onClick","innerHTML"],oe=e.defineComponent({__name:"tableColumn",props:{conf:{},columnList:{},option:{}},setup(i){const n=k.isFun,c=e.getCurrentInstance().type;return(o,r)=>{const a=e.resolveComponent("el-tooltip");return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.columnList,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.key},[o.conf.table.column.show.list.includes(t.key)?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),e.mergeProps({key:0,prop:t.key,label:t.label,ref_for:!0},t.table),{header:e.withCtx(()=>[e.renderSlot(o.$slots,"table-header-"+t.key,{item:t},()=>[e.createElementVNode("div",v,[t.table?.tooltip?(e.openBlock(),e.createBlock(a,{key:0,effect:"dark",content:t.table?.tooltip,placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("span",ee,[e.createVNode(_)])]),_:2},1032,["content"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label),1)])])]),default:e.withCtx(({row:s})=>[t.children?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[r[0]||(r[0]=e.createTextVNode("   ")),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(c)),{conf:o.conf,columnList:t.children,option:o.option},e.createSlots({_:2},[e.renderList(o.$slots,(f,p)=>({name:p,fn:e.withCtx(g=>[e.renderSlot(o.$slots,p,e.mergeProps({ref_for:!0},g||{}))])}))]),1032,["conf","columnList","option"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(n)(t.show?.form,o.conf.update.form,e.unref(k).EDialog.Update)&&o.option.table?.inlineEdit&&o.conf.inlineEdit.data===s&&(t.type==="input"||t.type==="select")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.type==="input"?(e.openBlock(),e.createBlock(e.unref(m.ElInput),e.mergeProps({key:0,modelValue:o.conf.update.form[t.key],"onUpdate:modelValue":f=>o.conf.update.form[t.key]=f,ref_for:!0},o.conf.update.getBind(t),e.toHandlers(o.conf.update.getOn(t)),{style:{width:"100%"}}),null,16,["modelValue","onUpdate:modelValue"])):t.type==="select"?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),e.mergeProps({key:1,modelValue:o.conf.update.form[t.key],"onUpdate:modelValue":f=>o.conf.update.form[t.key]=f,ref_for:!0},o.conf.update.getBind(t),e.toHandlers(o.conf.update.getOn(t)),{style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options?.select?.data,f=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)],64)):e.renderSlot(o.$slots,"table-"+t.key,{key:1,row:s,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:s[t.key],"onUpdate:modelValue":f=>s[t.key]=f,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.createBlock(e.unref(m.ElSwitch),e.mergeProps({key:1,modelValue:s[t.key],"onUpdate:modelValue":f=>s[t.key]=f,"before-change":()=>t.options?.switch?.tableBeforeChange?.(t.key,s),ref_for:!0},t.options?.switch),null,16,["modelValue","onUpdate:modelValue","before-change"])):(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:f=>t.table?.click?.callback?.(s),innerHTML:t.table?.format?t.table?.format(s):s[t.key]},null,14,te))])],64))]),_:2},1040,["prop","label"])):e.createCommentVNode("",!0)],64))),128)}}}),ne={class:"row form-item-content",style:{width:"100%"}},ae={class:"col"},le={class:"col"},re=["innerHTML"],ie=e.defineComponent({__name:"formColumn",props:{conf:{},item:{}},setup(i){return(n,c)=>(e.openBlock(),e.createBlock(e.unref(m.ElFormItem),{class:e.normalizeClass({"hide-label":typeof n.item.item.text?.form?.label=="boolean"?!n.item.item.text?.form?.label:!1}),label:typeof n.item.item.text?.form?.label=="string"?n.item.item.text?.form?.label:n.item.item.label,prop:n.item.item.key,"label-width":n.item.item.form?.labelWidth||n.conf.option.form?.labelWidth},{default:e.withCtx(()=>[e.createElementVNode("div",ne,[e.renderSlot(n.$slots,"form-"+n.item.item.key+"-start",{row:n.conf.update.form,item:n.item.item}),e.createElementVNode("div",ae,[e.createElementVNode("div",le,[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(m.ElInput),e.mergeProps({key:0,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[0]||(c[0]=o=>n.conf.update.form[n.item.item.key]=o)},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==="switch"?(e.openBlock(),e.createBlock(e.unref(m.ElSwitch),e.mergeProps({key:1,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[1]||(c[1]=o=>n.conf.update.form[n.item.item.key]=o)},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(m.ElSelect),e.mergeProps({key:2,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[2]||(c[2]=o=>n.conf.update.form[n.item.item.key]=o)},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.item.item.options?.select?.data,o=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:o.value,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):n.item.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(m.ElRadioGroup),e.mergeProps({key:3,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[3]||(c[3]=o=>n.conf.update.form[n.item.item.key]=o)},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.item.item.options?.radio?.data,o=>(e.openBlock(),e.createBlock(e.unref(m.ElRadio),{key:o.value,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):n.item.item.type==="list"?(e.openBlock(),e.createBlock(D,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(m.ElTreeSelect),e.mergeProps({key:5,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[4]||(c[4]=o=>n.conf.update.form[n.item.item.key]=o)},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(m.ElDatePicker),e.mergeProps({key:6,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[5]||(c[5]=o=>n.conf.update.form[n.item.item.key]=o)},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":c[6]||(c[6]=o=>n.conf.update.form[n.item.item.key]=o)},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,re)):e.createCommentVNode("",!0)])]),e.renderSlot(n.$slots,"form-"+n.item.item.key+"-end",{row:n.conf.update.form,item:n.item.item})])]),_:3},8,["class","label","prop","label-width"]))}}),se={key:0,class:"relative curd-search fit-width"},de={class:"mb-10 flex justify-between items-center fit-width"},ce={class:"flex items-center",style:{gap:"10px"}},fe={key:0},pe={key:1},me={key:2},he={class:"export-btn"},ge={class:"flex items-center table-tools-right",style:{gap:"10px"}},ye={class:"row justify-end mt-10 mb-10 table-bottom-pagination"},be={class:"dialog-footer"},ue={class:"dialog-footer"},T=e.defineComponent({__name:"index",props:{option:{default:{}}},setup(i,{expose:n}){const c=k.EDialog,o=i,r=k.isFun,{conf:a,switchConfirmRef:t,ruleFormRef:s}=K(o);return n({conf:a}),(f,p)=>{const g=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative cc1-form-box",[i.option.table?.fitHeight?"col":"no-min-height"]])},[e.createElementVNode("div",{class:e.normalizeClass(["row",[i.option.table?.fitHeight?"absolute fit":""]]),style:{overflow:"hidden"}},[e.renderSlot(f.$slots,"box-left"),e.createElementVNode("div",{class:e.normalizeClass(["column fit-width no-wrap",[i.option.table?.fitHeight?"col":""]])},[i.option.search?.show!==!1?(e.openBlock(),e.createElementBlock("div",se,[e.createVNode(e.unref(m.ElForm),{model:e.unref(a).search.form,inline:"",size:i.option.size?.search},{default:e.withCtx(()=>[e.renderSlot(f.$slots,"search-start",{row:e.unref(a).search.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a).search.column.list,l=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:l.key},[(typeof l.show?.search=="function"?l.show?.search(e.unref(a).search.form):l.show?.search)?(e.openBlock(),e.createBlock(e.unref(m.ElFormItem),{key:0,label:typeof l.text?.search?.label=="string"?l.text?.search?.label:l.label,class:e.normalizeClass({"hide-label":typeof l.text?.search?.label=="boolean"?!l.text?.search?.label:!1})},{default:e.withCtx(()=>[e.renderSlot(f.$slots,"search-"+l.key,{row:e.unref(a).search.form},()=>[l.type==="input"?(e.openBlock(),e.createBlock(e.unref(m.ElInput),e.mergeProps({key:0,modelValue:e.unref(a).search.form[l.key],"onUpdate:modelValue":d=>e.unref(a).search.form[l.key]=d,placeholder:e.unref(a).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(m.ElSelect),e.mergeProps({key:1,modelValue:e.unref(a).search.form[l.key],"onUpdate:modelValue":d=>e.unref(a).search.form[l.key]=d,placeholder:e.unref(a).search.getPlaceholder(l,e.unref(h).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(m.ElOption),{key:l.options?.switch?.activeValue,label:l.options?.switch?.activeLabel,value:l.options?.switch?.activeValue},null,8,["label","value"])),(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:l.options?.switch?.inactiveValue,label:l.options?.switch?.inactiveLabel,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(m.ElSelect),e.mergeProps({key:2,modelValue:e.unref(a).search.form[l.key],"onUpdate:modelValue":d=>e.unref(a).search.form[l.key]=d,placeholder:e.unref(a).search.getPlaceholder(l,e.unref(h).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,d=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder","disabled"])):l.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(m.ElDatePicker),e.mergeProps({key:3,modelValue:e.unref(a).search.form[l.key],"onUpdate:modelValue":d=>e.unref(a).search.form[l.key]=d,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:4,modelValue:e.unref(a).search.form[l.key],"onUpdate:modelValue":d=>e.unref(a).search.form[l.key]=d,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(f.$slots,"search-"+l.key+"-right",{row:e.unref(a).search.form})]),_:2},1032,["label","class"])):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(f.$slots,"search-center",{row:e.unref(a).search.form}),i.option.tools?.search||i.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(m.ElFormItem),{key:0},{default:e.withCtx(()=>[i.option.tools?.search?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:0,type:"primary",onClick:e.unref(a).search.submit},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("search")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),i.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:1,onClick:e.unref(a).search.reset},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("reset")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"search-end",{row:e.unref(a).search.form})]),_:3},8,["model","size"])])):e.createCommentVNode("",!0),e.createElementVNode("div",de,[e.createElementVNode("div",ce,[e.unref(r)(i.option.tools?.add)?(e.openBlock(),e.createElementBlock("div",fe,[e.createVNode(e.unref(m.ElButton),{type:"primary",onClick:p[0]||(p[0]=l=>e.unref(a).update.open(e.unref(c).Add)),size:i.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("add")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),i.option.table?.selectable&&e.unref(r)(i.option.tools?.delete)?(e.openBlock(),e.createElementBlock("div",pe,[e.createVNode(e.unref(m.ElButton),{type:"danger",onClick:p[1]||(p[1]=l=>e.unref(a).remove.open(e.unref(a).table.selection.list)),size:i.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("delete")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),i.option.tools?.expand?(e.openBlock(),e.createElementBlock("div",me,[e.createVNode(e.unref(m.ElButton),{type:"warning",onClick:p[2]||(p[2]=l=>e.unref(a).table.expand.all()),size:i.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("expandCollapse")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),i.option.tools?.export?.show?(e.openBlock(),e.createBlock(e.unref(m.ElDropdown),{key:3,onCommand:e.unref(a).export.click},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(m.ElDropdownMenu),{size:i.option.size?.search},{default:e.withCtx(()=>[i.option.table?.selectable?(e.openBlock(),e.createBlock(e.unref(m.ElDropdownItem),{key:0,command:"select"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("exportSelect")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(m.ElDropdownItem),{command:"page"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("exportPage")),1)]),_:1}),e.createVNode(e.unref(m.ElDropdownItem),{command:"all"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("exportAll")),1)]),_:1})]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",he,[e.createVNode(e.unref(m.ElButton),{type:"warning",loading:e.unref(a).export.loading,size:i.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("export")),1)]),_:1},8,["loading","size"])])]),_:1},8,["onCommand"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"tools-left")]),e.createElementVNode("div",ge,[e.renderSlot(f.$slots,"tools-right"),e.unref(a).page.showTools?(e.openBlock(),e.createBlock(e.unref(m.ElPagination),e.mergeProps({key:0,"current-page":e.unref(a).page.num,"onUpdate:currentPage":p[3]||(p[3]=l=>e.unref(a).page.num=l),"page-size":e.unref(a).page.size,"onUpdate:pageSize":p[4]||(p[4]=l=>e.unref(a).page.size=l),background:"","page-sizes":e.unref(a).page.sizeList,"pager-count":e.unref(a).page.pagerCount,layout:e.unref(a).page.layout,total:e.unref(a).page.total,size:i.option.size?.table,onSizeChange:e.unref(a).table.getList,onCurrentChange:e.unref(a).table.getList},i.option.page?.pagination||{},e.toHandlers(i.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0),i.option.tools?.refresh===void 0||i.option.tools?.refresh?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["refresh-btn",[i.option.size?.search]]),onClick:p[5]||(p[5]=(...l)=>e.unref(a).table.getList&&e.unref(a).table.getList(...l))},[e.createVNode(Q)],2)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:e.normalizeClass(["fit-width relative form-box",[i.option.table?.fitHeight?"col ":""]])},[e.createElementVNode("div",{class:e.normalizeClass(["column form-box-content",[i.option.table?.fitHeight?"absolute fit":""]])},[e.withDirectives((e.openBlock(),e.createBlock(e.unref(m.ElTable),e.mergeProps({data:e.unref(a).table.data,border:i.option.table?.border===void 0?!0:i.option.table?.border,onSelectionChange:e.unref(a).table.selection.change,onSortChange:e.unref(a).table.sort.change,"expand-row-keys":e.unref(a).table.expand.rowKeys,onExpandChange:e.unref(a).table.expand.change},i.option.table,e.toHandlers(i.option.table?.on||{})),{default:e.withCtx(()=>[i.option.table?.selectable||e.unref(r)(i.option.tools?.delete)||i.option.tools?.export?.show?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),{key:0,type:"selection",selectable:typeof i.option.table?.selectable=="function"?i.option.table?.selectable:void 0,width:"40",align:"center",fixed:"left","show-overflow-tooltip":!1},null,8,["selectable"])):e.createCommentVNode("",!0),e.createVNode(oe,{conf:e.unref(a),columnList:e.unref(a).table.column.list,option:i.option},e.createSlots({_:2},[e.renderList(f.$slots,(l,d)=>({name:d,fn:e.withCtx(b=>[e.renderSlot(f.$slots,d,e.normalizeProps(e.guardReactiveProps(b||{})))])}))]),1032,["conf","columnList","option"]),e.unref(r)(i.option.table?.add)||e.unref(r)(i.option.table?.update)||e.unref(r)(i.option.table?.delete)||e.unref(r)(i.option.table?.view)||f.$slots["table-op-left"]||f.$slots["table-op-right"]?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),e.mergeProps({key:1,width:e.unref(a).table.op.width(e.unref(r)(i.option.table?.add),e.unref(r)(i.option.table?.update),e.unref(r)(i.option.table?.delete),e.unref(r)(i.option.table?.view),f.$slots["table-op-left"],f.$slots["table-op-right"]),align:"center",fixed:"right"},i.option.table?.operate),{header:e.withCtx(()=>[e.renderSlot(f.$slots,"table-header-op",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("operation")),1)])]),default:e.withCtx(({row:l})=>[e.createVNode(e.unref(m.ElForm),{size:i.option.size?.table},{default:e.withCtx(()=>[e.renderSlot(f.$slots,"table-op-left",{row:l}),i.option.table?.inlineEdit&&e.unref(a).inlineEdit.data===l?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(m.ElButton),{link:"",type:"info",onClick:e.unref(a).inlineEdit.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("cancel")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(m.ElButton),{link:"",type:"primary",onClick:e.unref(a).update.submit,loading:e.unref(a).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("confirm")),1)]),_:1},8,["onClick","loading"]),e.renderSlot(f.$slots,"table-op-edit-right",{row:l})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(r)(i.option.table?.add,l)?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:0,link:"",type:"primary",onClick:d=>e.unref(a).update.open(e.unref(c).Add,l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("add")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(r)(i.option.table?.view,l)?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:1,link:"",type:"primary",onClick:d=>e.unref(a).update.open(e.unref(c).View,l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("view")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(r)(i.option.table?.update,l)?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:2,link:"",type:"warning",onClick:d=>e.unref(a).update.open(e.unref(c).Update,l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("edit")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(r)(i.option.table?.delete,l)?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:3,link:"",type:"danger",onClick:d=>e.unref(a).remove.open([l])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("delete")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"table-op-right",{row:l})],64))]),_:2},1032,["size"])]),_:3},16,["width"])):e.createCommentVNode("",!0)]),_:3},16,["data","border","onSelectionChange","onSortChange","expand-row-keys","onExpandChange"])),[[g,e.unref(a).table.loading]])],2)],2),e.createElementVNode("div",ye,[(i.option.page?.show===void 0||i.option.page?.show)&&!e.unref(a).page.showTools?(e.openBlock(),e.createBlock(e.unref(m.ElPagination),e.mergeProps({key:0,"current-page":e.unref(a).page.num,"onUpdate:currentPage":p[6]||(p[6]=l=>e.unref(a).page.num=l),"page-size":e.unref(a).page.size,"onUpdate:pageSize":p[7]||(p[7]=l=>e.unref(a).page.size=l),background:"","page-sizes":e.unref(a).page.sizeList,"pager-count":e.unref(a).page.pagerCount,layout:e.unref(a).page.layout,total:e.unref(a).page.total,size:i.option.size?.table,onSizeChange:e.unref(a).table.getList,onCurrentChange:e.unref(a).table.getList},i.option.page?.pagination||{},e.toHandlers(i.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(f.$slots,"box-right")],2),e.createVNode(e.unref(m.ElDialog),e.mergeProps({modelValue:e.unref(a).update.show,"onUpdate:modelValue":p[8]||(p[8]=l=>e.unref(a).update.show=l),title:e.unref(a).update.title,"before-close":e.unref(a).update.close},i.option.dialog),{footer:e.withCtx(()=>[e.createElementVNode("span",be,[e.createVNode(e.unref(m.ElForm),{size:i.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(m.ElButton),{onClick:e.unref(a).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("close")),1)]),_:1},8,["onClick"]),e.unref(a).update.type!==e.unref(c).View?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:0,type:"primary",onClick:e.unref(a).update.submit,loading:e.unref(a).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("submit")),1)]),_:1},8,["onClick","loading"])):e.createCommentVNode("",!0)]),_:1},8,["size"])])]),default:e.withCtx(()=>[e.createVNode(e.unref(m.ElForm),{ref_key:"ruleFormRef",ref:s,model:e.unref(a).update.form,rules:e.unref(a).update.rules,size:i.option.size?.form},{default:e.withCtx(()=>[e.unref(a).update.showContent?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(a).update.formColumn,l=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(r)((()=>{const d=[],b=y=>{y?.item?.children?b(y.item.children):d.push(...y.map(w=>w.item?.show?.form))};return b(l),d})(),e.unref(a).update.form,e.unref(a).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:i.option.form?.stripe===void 0?!0:i.option.form?.stripe}])},[e.renderSlot(f.$slots,"form-start",{row:e.unref(a).update.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l,d=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(r)(d.item.show?.form,e.unref(a).update.form,e.unref(a).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([d.item.form.span>0?`col-${e.unref(a).getColumnSpan(d,l)}`:"col",`form-item-col-${d.item.key}`])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.item.children?d.children:[d],b=>(e.openBlock(),e.createBlock(ie,{key:b.item.key,conf:e.unref(a),item:b},e.createSlots({_:2},[e.renderList(f.$slots,(y,w)=>({name:w,fn:e.withCtx(V=>[e.renderSlot(f.$slots,w,e.mergeProps({ref_for:!0},V||{}))])}))]),1032,["conf","item"]))),128))],2)):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(f.$slots,"form-end",{row:e.unref(a).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(m.ElDialog),{modelValue:e.unref(a).remove.show,"onUpdate:modelValue":p[9]||(p[9]=l=>e.unref(a).remove.show=l),title:e.unref(a).remove.title,"close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createElementVNode("span",ue,[e.createVNode(e.unref(m.ElForm),{size:i.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(m.ElButton),{onClick:e.unref(a).remove.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("close")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(m.ElButton),{type:"danger",onClick:e.unref(a).remove.submit,loading:e.unref(a).remove.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("confirmDelete")),1)]),_:1},8,["onClick","loading"])]),_:1},8,["size"])])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(e.unref(h).tCurd("confirmDeleteMessage",e.unref(a).remove.items.length)),1)]),_:1},8,["modelValue","title"]),e.createVNode(W,{ref_key:"switchConfirmRef",ref:t,size:i.option.size?.form},null,8,["size"])],2)}}});class ke{static async download(n,c="download.png"){const o=document.createElement("a");o.style.display="none",o.href=n,o.setAttribute("download",c),typeof o.download>"u"&&o.setAttribute("target","_blank"),document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(n)}static exportJSONFile=(n,c)=>{const o=new Blob([JSON.stringify(n)],{type:"application/json"}),r=URL.createObjectURL(o),a=document.createElement("a");a.href=r,a.download=`${c||"config"}.json`,a.click()};static importFile=async n=>new Promise((c,o)=>{const r=document.createElement("input");r.type="file";const a=n?.accept||".json";r.accept=a,r.style.display="none",r.onchange=t=>{const s=t.target.files[0];if(!s){k.fail("未选择文件"),o("未选择文件");return}const f=new FileReader;f.onload=async p=>{const g=a==".json"?JSON.parse(p.target.result):p.target.result;c(g)},f.onerror=()=>{k.fail("文件读取失败"),o("文件读取失败")},f.readAsText(s),document.body.removeChild(r)},document.body.appendChild(r),r.click()})}const L=(i,n)=>{if(i.component("TCurd",T),i.component("TFormList",D),i.component("TColumn",O),n?.customComponent){B.customComponent=n.customComponent;for(const c in n.customComponent)i.component(c,n.customComponent[c])}},we={install:L};C.ArrUtil=E,C.ExcelUtil=U,C.TColumn=O,C.TCurd=T,C.TFile=ke,C.TForm=B,C.TFormConfig=u,C.TFormI18n=h,C.TFormList=D,C.TSys=k,C.default=we,C.install=L,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ (function(C,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("element-plus"),require("vue-router"),require("vue")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue-router","vue"],m):(C=typeof globalThis<"u"?globalThis:C||self,m(C.cc1Form={},C.ElementPlus,C.VueRouter,C.Vue))})(this,(function(C,m,Ce,e){"use strict";class u{static router;static routes;static getRouterPath=()=>this.router.currentRoute.value.path;static EDialog={Add:"Add",Update:"Update",View:"View",Remove:"Remove"};static isFun=(a,...c)=>Array.isArray(a)?a.some(o=>typeof o=="function"?o(...c):o):typeof a=="function"?a(...c):a;static getRouterParams=()=>{const a=this.router.currentRoute.value.query||{},c=this.router.currentRoute.value.params||{};return Object.keys(a).length?a:Object.keys(c).length?c:{}};static moduleObj={};static loadModule=async a=>{if(!u.moduleObj[a])throw new Error(`模块${a}未加载,请赋值如:TSys.moduleObj = { ${a}: ()=>import('${a}') }`);const c=await u.moduleObj[a]();return c.default??c};static tipMessages={};static tipMessagesGap=500;static showMessage(a,c,o={}){const l=Date.now();if(!this.tipMessages[a]||l-this.tipMessages[a]>this.tipMessagesGap){this.tipMessages[a]=l;const n=Object.assign({message:a,type:c},o);m.ElMessage(n),setTimeout(()=>{delete this.tipMessages[a]},this.tipMessagesGap)}}static fail=(a,c={})=>{this.showMessage(a,"error",c)};static success=(a,c={})=>{this.showMessage(a,"success",c)};static loadingObj=null;static loadingTimer=null;static loading=(a=!0,c="Loading...")=>{Timer.un(this.loadingTimer),this.loadingTimer=Timer.once(()=>{a?this.loadingObj=m.ElLoading.service({lock:!0,text:c,background:"rgba(0, 0, 0, 0.3)"}):this.loadingObj&&(this.loadingObj.close(),this.loadingObj=null)},50)};static openUrl=(a,c=!0)=>{if(c){let o=screen.width/2-500,l=screen.height/2-800/2-30;window.open(a,"_blank","toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top="+l+", left="+o)}else window.open(a,"DescriptiveWindowName"+StrUtil.getId(),"resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0")};static getImgPic=a=>new Promise(async(c,o)=>{let l=document.getElementById(a.id);const n=await u.loadModule("html2canvas");try{n(l,{logging:!1,allowTaint:!0,scale:window.devicePixelRatio,width:a.windowWidth,height:a.windowHeight,windowWidth:a.windowWidth,windowHeight:a.windowHeight,useCORS:!0,backgroundColor:"#ffffff00"}).then(function(t){let s=t.toDataURL("image/png");c(s)})}catch(t){o(t)}})}class k{static config={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:{refresh:!0,expand:!1,search:!0,reset:!0,add:!0,delete:!0,export:{show:!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},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=a=>{k.config=ObjectUtil.deepMerge(k.config,a)}}class B{static customComponent={};static findOptions=(a,c)=>{const o=a.column.find(n=>n.key===c),l=n=>n.replace(/-([a-z])/g,(t,s)=>s.toUpperCase());if(o)return o.options[l(o.type)]};static setOptionsData=(a,c,o)=>{const l=B.findOptions(a,c);l&&(l.data=o)};static form={openBefore:{parentId:(a,c,o,l)=>{const n=k.config.table.rowKey;a?c.type===u.EDialog.Add?(c.form.parentId=a[n],c.form.sort=a.children.length+1):c.form.parentId=a.parentId.substring(a.parentId.lastIndexOf(",")+1):(c.form.parentId="0",c.form.sort=o.length+1),B.setOptionsData(l,"parentId",[{[n]:"0",title:"根",children:o}])}}}}function Be(i){return i}const A={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:"确认要修改吗?"};class h{static t(a,...c){if(typeof a=="function")return a(...c);a=String(a);let o=0;return a.replace(/{([^}]+)}/g,(l,n)=>o<c.length?String(c[o++]):`{${n}}`)}static setI18n=a=>{h.curd=ObjectUtil.deepMerge(h.curd,a)};static tCurd(a,...c){return this.t(this.curd[a],...c)}static curd=A}class E{static getIdFun=()=>StrUtil.uuid();static setId=(a,c,o)=>{c[a]||(c[a]=[]);const l=k.config.table.rowKey;c[a].forEach(n=>{o.forEach(t=>{let s=t.default??"";t.type==="number"&&(s=t.default??0),t.type==="boolean"&&(s=t.default??!1),t.type==="time"&&(s=t.default??new Date),n[t.value]===void 0&&(n[t.value]=s)}),n[l]||(n[l]=E.getIdFun())})};static add=(a,c,o,l)=>{const n=JSONUtil.cp(o);E.setId(a,c,o);const t=k.config.table.rowKey;c[a].push(n.reduce((s,f)=>{let p=f.default??"";return f.type==="number"&&(p=f.default??0),f.type==="boolean"&&(p=f.default??!1),f.type==="time"&&(p=f.default??new Date),s[f.value]=p,s},{[t]:E.getIdFun()})),l?.(c)};static remove=(a,c,o,l)=>{const n=k.config.table.rowKey;c[a]=c[a].filter(t=>t[n]!==o[n]),l?.(c)};static getNoIdData=(a,c)=>{const o=JSONUtil.cp(a),l=k.config.table.rowKey;return o.forEach(n=>{n[l]&&delete n[l],c&&n[c]&&E.getNoIdData(n[c],c)}),o}}const M={key:0,class:"column",style:{width:"100%",gap:"10px"}},H={class:"row items-center",style:{gap:"10px",width:"100%"}},D=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:""}},emits:["change"],setup(i,{emit:a}){const c=i,o=e.reactive({show:!1,add:(n,t,s)=>{E.add(n,t,s,()=>{l("change")})},remove:(n,t,s)=>{E.remove(n,t,s,()=>{l("change")})}});e.onMounted(()=>{E.setId(c.field,c.row,c.itemFields),o.show=!0});const l=a;return(n,t)=>{const s=e.resolveComponent("el-button"),f=e.resolveComponent("el-input");return o.show?(e.openBlock(),e.createElementBlock("div",M,[e.renderSlot(n.$slots,"list-start",{row:i.row}),e.createElementVNode("div",null,[e.createVNode(s,{link:"",type:"primary",onClick:t[0]||(t[0]=p=>o.add(i.field,i.row,i.itemFields))},{default:e.withCtx(()=>t[2]||(t[2]=[e.createTextVNode("添加")])),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.row[i.field],p=>(e.openBlock(),e.createElementBlock("div",H,[e.renderSlot(n.$slots,"item-start",{item:p,row:i.row}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.itemFields,g=>(e.openBlock(),e.createBlock(f,{modelValue:p[g.value],"onUpdate:modelValue":r=>p[g.value]=r,style:e.normalizeStyle({width:i.inputWidth}),class:e.normalizeClass(i.inputClass),placeholder:g[i.label]||g[i.value],onChange:t[1]||(t[1]=r=>l("change"))},null,8,["modelValue","onUpdate:modelValue","style","class","placeholder"]))),256)),e.renderSlot(n.$slots,"item-end",{item:p,row:i.row}),e.createVNode(s,{link:"",type:"danger",onClick:g=>o.remove(i.field,i.row,p)},{default:e.withCtx(()=>t[3]||(t[3]=[e.createTextVNode("删除")])),_:2},1032,["onClick"])]))),256)),e.renderSlot(n.$slots,"list-end",{row:i.row})])):e.createCommentVNode("",!0)}}}),I={class:"row form-item-content",style:{width:"100%"}},j={class:"col"},x={class:"col"},R=["innerHTML"],O=e.defineComponent({__name:"column",props:{option:{default:{}},type:{default:""}},setup(i,{expose:a}){const c=u.isFun,o=u.EDialog,l=e.ref(),n=i,t=e.reactive({rules:{},show:!0,form:{},formDefault:{},type:n.type||o.Add,formColumn:[],getDisabled:s=>t.type===o.View?s.disabled?.view===void 0?!0:s.disabled?.view:s.disabled?.[t.type===o.Add?"create":"update"],getBind:s=>s.options?.[t.type===o.Add?"formAdd":"formUpdate"]?.[s.type]||s.options?.[s.type]||{},getOn:s=>s.options?.[t.type===o.Add?"formAdd":"formUpdate"]?.[s.type]?.on||s.options?.[s.type]?.on||{},getColumnSpan:(s,f)=>{if(s.item.form?.spanCol){const p=n.option.form?.maxSpan||12,g=n.option.form?.defaultSpan||p/2,d=f.filter(b=>!u.isFun(b.item.show?.form,t.form,t.type)).reduce((b,y)=>b+(y.item.form?.span||g),0);return(s.item.form?.span||g)+d}return s.item.form?.span},initColumnForm:()=>{const s=n.option;t.formColumn=[],t.rules={},t.formDefault={};const f=[],p=n.option.form?.maxSpan||12,g=n.option.form?.defaultSpan||p/2;let r=[];const d=y=>{if(y.children){y.children.forEach(w=>{d(w)});return}if(t.formDefault[y.key]=y.value,y.isForm&&(typeof y.show?.form!="boolean"||y.show?.form)){y.form=y.form||{span:g},y.form.span=y.form.span??g;const w=y.form.span,V=r.reduce((z,F)=>z+F.span,w),N=r.length;if(r.push({item:y,span:w}),(N===1&&r[0].span===0||V>=p||w===0&&N>1)&&(f.push(r),r=[]),y.rules){const z={input:h.tCurd("placeholderInput"),select:h.tCurd("placeholderSelect")},F=(z[y.type]||z.input)+y.label;t.rules[y.key]=typeof y.rules=="boolean"?[{required:!0,message:F,trigger:"blur"}]:y.rules}}},b=(y,w)=>{y.isForm=w,Array.isArray(y.children)&&y.children.forEach(V=>b(V,w))};s.column.forEach(y=>{b(y,!0),d(y)}),r.length>0&&f.push(r),t.formColumn=f,t.form=JSONUtil.cp(t.formDefault)}});return t.initColumnForm(),a({ref:l,conf:t}),(s,f)=>(e.openBlock(),e.createBlock(e.unref(m.ElForm),{ref_key:"ruleFormRef",ref:l,model:t.form,rules:t.rules},{default:e.withCtx(()=>[t.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.formColumn,(p,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:g},[e.unref(c)(p.map(r=>r.item?.show?.form),t.form,t.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:i.option.form?.stripe===void 0?!0:i.option.form?.stripe}])},[e.renderSlot(s.$slots,"form-start",{row:t.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p,r=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r.item.key},[e.unref(c)(r.item.show?.form,t.form,t.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([r.item.form.span>0?`col-${t.getColumnSpan(r,p)}`:"col",`form-item-col-${r.item.key}`])},[e.createVNode(e.unref(m.ElFormItem),{class:e.normalizeClass({"hide-label":typeof r.item.text?.form?.label=="boolean"?!r.item.text?.form?.label:!1}),label:typeof r.item.text?.form?.label=="string"?r.item.text?.form?.label:r.item.label,prop:r.item.key,"label-width":r.item.form?.labelWidth||i.option.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.createElementVNode("div",I,[e.renderSlot(s.$slots,"form-"+r.item.key+"-start",{row:t.form,item:r.item}),e.createElementVNode("div",j,[e.createElementVNode("div",x,[e.renderSlot(s.$slots,"form-"+r.item.key,{row:t.form,item:r.item},()=>[r.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(m.ElInput),e.mergeProps({key:0,modelValue:t.form[r.item.key],"onUpdate:modelValue":d=>t.form[r.item.key]=d,ref_for:!0},t.getBind(r.item),e.toHandlers(t.getOn(r.item)),{disabled:t.getDisabled(r.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):r.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(m.ElSwitch),e.mergeProps({key:1,modelValue:t.form[r.item.key],"onUpdate:modelValue":d=>t.form[r.item.key]=d,ref_for:!0},t.getBind(r.item),e.toHandlers(t.getOn(r.item)),{disabled:t.getDisabled(r.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):r.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),e.mergeProps({key:2,modelValue:t.form[r.item.key],"onUpdate:modelValue":d=>t.form[r.item.key]=d,ref_for:!0},t.getBind(r.item),e.toHandlers(t.getOn(r.item)),{disabled:t.getDisabled(r.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.item.options?.select?.data,d=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):r.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(m.ElRadioGroup),e.mergeProps({key:3,modelValue:t.form[r.item.key],"onUpdate:modelValue":d=>t.form[r.item.key]=d,ref_for:!0},t.getBind(r.item),e.toHandlers(t.getOn(r.item)),{disabled:t.getDisabled(r.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.item.options?.radio?.data,d=>(e.openBlock(),e.createBlock(e.unref(m.ElRadio),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):r.item.type==="list"?(e.openBlock(),e.createBlock(D,e.mergeProps({key:4,row:t.form,field:r.item.key,ref_for:!0},t.getBind(r.item),e.toHandlers(t.getOn(r.item)),{disabled:t.getDisabled(r.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):r.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(m.ElTreeSelect),e.mergeProps({key:5,modelValue:t.form[r.item.key],"onUpdate:modelValue":d=>t.form[r.item.key]=d,ref_for:!0},t.getBind(r.item),e.toHandlers(t.getOn(r.item)),{disabled:t.getDisabled(r.item),style:{width:"100%"}}),null,16,["modelValue","onUpdate:modelValue","disabled"])):r.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(m.ElDatePicker),e.mergeProps({key:6,modelValue:t.form[r.item.key],"onUpdate:modelValue":d=>t.form[r.item.key]=d,ref_for:!0},t.getBind(r.item),e.toHandlers(t.getOn(r.item)),{disabled:t.getDisabled(r.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):r.item.type&&(e.unref(B).customComponent[r.item.type]||e.unref(B).customComponent[r.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[r.item.type]?.form||e.unref(B).customComponent[r.item.type]),e.mergeProps({key:7,modelValue:t.form[r.item.key],"onUpdate:modelValue":d=>t.form[r.item.key]=d,ref_for:!0},t.getBind(r.item),e.toHandlers(t.getOn(r.item)),{disabled:t.getDisabled(r.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(s.$slots,"form-"+r.item.key+"-right",{row:t.form,item:r.item})]),e.renderSlot(s.$slots,"form-"+r.item.key+"-tip",{row:t.form,item:r.item},()=>[r.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof r.item.form?.tipText=="function"?r.item.form?.tipText(t.form,t.type):r.item.form?.tipText},null,8,R)):e.createCommentVNode("",!0)])]),e.renderSlot(s.$slots,"form-"+r.item.key+"-end",{row:t.form,item:r.item})])]),_:2},1032,["class","label","prop","label-width"])],2)):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(s.$slots,"form-end",{row:t.form})],2)):e.createCommentVNode("",!0)],64))),128)):e.createCommentVNode("",!0)]),_:3},8,["model","rules"]))}});class U{static exportToExcel=async(a,c,o)=>{if(!a||a.length===0)return;const l=await u.loadModule("xlsx"),n=a.map(f=>{const p={};return c.forEach(g=>{p[g.label]=f[g.key]}),p}),t=l.utils.json_to_sheet(n),s=l.utils.book_new();l.utils.book_append_sheet(s,t,"Sheet1"),o?typeof o=="function"&&(o=o()):o=`导出数据_${new Date().Format("yyyy-MM-dd")}_${new Date().getTime()}`,l.writeFile(s,`${o}.xlsx`)}}const S=u.EDialog,K=i=>{const a=e.ref(),c=e.ref(),o=e.reactive({option:i.option,search:{column:{list:[]},form:{},formDefault:{},getPlaceholder:(l,n=h.tCurd("placeholderInput"))=>l.text?.search?.placeholder===void 0?`${n}${l.label}`:l.text?.search?.placeholder,getFormData:()=>{let l={};i.option.column.forEach(t=>{(typeof t.show?.search=="function"?t.show?.search(o.search.form):t.show?.search)&&(l[t.key]=o.search.form[t.key])});const n=i.option.search?.before?.(l);return n&&(l=n),l},reset:()=>{const l=o.search.formDefault;Object.keys(l).forEach(n=>{i.option.search?.resetMode==="none"?l[n]=void 0:l[n]=o.search.formDefault[n]}),o.search.form=JSONUtil.cp(l),o.page.num=1,i.option.init!==!1&&o.table.getList()},submit:()=>{o.page.num=1,o.table.getList()}},page:{num:1,total:0,layout:i.option.page?.layout||k.config.pagination.layout,showTools:i.option.page?.showTools||k.config.pagination.showTools,size:i.option.page?.size||k.config.pagination.size,sizeList:i.option.page?.sizeList||k.config.pagination.pageSizes,pagerCount:i.option.page?.pagerCount||k.config.pagination.pagerCount},table:{op:{width:(...l)=>l.filter(t=>t).length*30+60},loading:!1,data:[],expand:{isExpand:!1,rowKeys:[],change:(l,n)=>{},all:()=>{if(o.table.expand.isExpand)o.table.expand.rowKeys=[];else{const l=n=>{let t=[];return n.forEach(s=>{t.push(s[i.option.table.rowKey]),s.children&&s.children.length>0&&(t=t.concat(l(s.children)))}),t};o.table.expand.rowKeys=l(o.table.data)}o.table.expand.isExpand=!o.table.expand.isExpand}},column:{list:[],show:{listSource:[],list:[]}},getList:async()=>{o.table.loading=!0;const l=i.option.api.list;try{await o.initApiData("init");let n={};if(o.table.sort.prop){const{props:d,order:b}=k.config.table.sort;n={[d.field]:o.table.sort.prop,[b.field]:o.table.sort.order}}const t=await l({[k.config.page.size]:o.page.size,[k.config.page.num]:o.page.num,...o.search.getFormData(),...n}),s=k.config.result,f=t.data||{[s.list]:t};let p=(Array.isArray(f[s.list]),f[s.list]);const g=o.update.formColumn.flat(),r=JSONUtil.cp(p).map(d=>(Object.keys(d).forEach(y=>{const w=g.find(V=>V.item.key===y);w&&["select","radio"].includes(w.item.type)&&(w.item.table.format||(w.item.table.format=V=>w.item.options[w.item.type].data?.find(N=>N.value==V[y])?.label||V[y]))}),d));o.table.data=i.option.data?await i.option.data(r,p):r,o.page.total=f[s.total]||0}catch(n){console.error(n)}finally{o.table.loading=!1}},selection:{list:[],change:l=>{o.table.selection.list=l}},sort:{prop:"",order:"",change:l=>{k.config.table.sort.resetPage&&(o.page.num=1);const n=k.config.table.sort;if(n.change){n.change(l,o);return}o.table.sort.prop=l.prop,l.order===null?o.table.sort.order="":o.table.sort.order=l.order==="ascending"?n.order.asc:n.order.desc,o.table.getList()}}},export:{run:{start:async l=>{let n=await o.export.run[l](),t=i.option.column;const s=JSONUtil.cp({data:n,columns:t}),f=i.option.tools?.export||{};f.before&&f.before(s),U.exportToExcel(s.data,s.columns,f.fileName)},select:()=>{if(o.table.selection.list.length===0)throw u.fail(h.tCurd("selectDataToExport")),new Error(h.tCurd("selectDataToExport"));return o.table.selection.list},page:()=>{if(o.table.data.length===0)throw u.fail(h.tCurd("noData")),new Error(h.tCurd("noData"));return o.table.data},all:async()=>{o.export.loading=!0;try{if(i.option.tools?.export?.all){await i.option.tools?.export?.all({[k.config.page.size]:o.page.size,[k.config.page.num]:o.page.num,...o.search.getFormData()});return}const l=i.option.api.list,n=await l({[k.config.page.size]:999999,[k.config.page.num]:1});return(n.data||{[k.config.result.list]:n})[k.config.result.list]}catch(l){console.error(l)}finally{o.export.loading=!1}}},loading:!1,click:l=>{o.export.loading||o.export.run.start(l)}},update:{title:"",rules:{},show:!1,showContent:!1,loading:!1,type:S.Add,form:{},formDefault:{},formColumn:[],getDisabled:l=>o.update.type===S.View?l.disabled?.view===void 0?!0:l.disabled?.view:l.disabled?.[o.update.type===S.Add?"create":"update"],getBind:l=>l.options?.[o.update.type===S.Add?"formAdd":"formUpdate"]?.[l.type]||l.options?.[l.type]||{},getOn:l=>l.options?.[o.update.type===S.Add?"formAdd":"formUpdate"]?.[l.type]?.on||l.options?.[l.type]?.on||{},getOptions:l=>{try{const t=o.update.formColumn.flat().find(s=>s.item.key===l)?.item;return t?{options:t.options,bind:o.update.getBind(t)}:{options:{},bind:{}}}catch{return{options:{},bind:{}}}},edit:{data:{},getApiData:l=>{if(i.option.form?.editAll)return l;let n={[i.option.table?.rowKey]:o.update.edit.data[i.option.table?.rowKey]};return Object.keys(o.update.edit.data).forEach(t=>{l[t]!==o.update.edit.data[t]&&(n[t]=l[t])}),n}},view:{},open:(l,n)=>{o.update.showContent||FunUtil.throttle(async()=>{u.loading(!0);try{o.update.type=l,await o.initApiData("update");const t=l===S.Add;if(!t&&i.option.table?.inlineEdit){o.inlineEdit.open(n);return}o.update.edit.data=n,o.update.title=h.tCurd(t?"add":l===S.View?"view":"edit"),o.update.form=JSONUtil.cp(t?o.update.formDefault:n),await i.option.form?.openBefore?.(o.update.form,o.update),o.inlineEdit.data||(o.update.show=!0),o.update.showContent=!0,i.option.form?.openAfter?.(o.update.form,o.update)}catch(t){console.error(t)}finally{u.loading(!1)}})},submit:()=>{FunUtil.throttle(async()=>{await c.value?.validate(async(s,f)=>new Promise((p,g)=>{s||(u.fail(h.tCurd("checkFormData")),g(!1)),p()})),o.update.loading=!0;const l=o.update.type===S.Add?i.option.api.create:i.option.api.update;try{await i.option.form?.submitBefore?.(o.update.form,o.update)}catch{o.update.loading=!1;return}let n=JSONUtil.cp(o.update.form);delete n.children;const t=new Set(i.option.column.filter(s=>s.type==="datetime").map(s=>s.key));Object.keys(n).forEach(s=>{if(t.has(s)&&n[s]!=null){const f=new Date(n[s]).getTime();isNaN(f)||(n[s]=f)}});try{if(!l)return;await l({...n}),o.update.close(),await o.table.getList(),i.option.form?.submitAfter?.(n,o.update)}catch(s){console.error(s)}finally{o.update.loading=!1}})},close:()=>{o.update.show=!1,setTimeout(()=>{o.update.showContent=!1},350)}},inlineEdit:{data:null,open:l=>{o.inlineEdit.data=l,o.update.open(S.Update,l)},close:()=>{o.inlineEdit.data=null,o.update.close()}},remove:{title:h.tCurd("confirmDelete"),show:!1,items:[],loading:!1,close:()=>{o.remove.show=!1},open:l=>{if(l.length===0){u.fail(h.tCurd("selectDataToDelete"));return}o.remove.items=l,o.remove.show=!0},submit:()=>{FunUtil.throttle(async()=>{o.remove.loading=!0;const l=i.option.api.delete;try{if(!l)return;await l({[i.option.table?.rowKey]:o.remove.items.map(n=>n[i.option.table?.rowKey]),items:o.remove.items}),u.success(h.tCurd("operationSuccess")),o.table.data.length<=1&&o.page.num>1&&(o.page.num-=1),o.remove.close(),await o.table.getList()}catch(n){console.error(n)}finally{o.remove.loading=!1}})}},init:()=>{o.initCurdConfig(),o.initColumnOptions(),o.initColumnForm()},apiDataMap:{},initApiData:async l=>{const n=[],t=s=>{if(s.children&&s.children.length){s.children.forEach(f=>t(f));return}if(["select","radio"].includes(s.type)&&s.options?.[s.type]?.dataApi&&s.options?.[s.type]?.dataApiConfig?.[l]){if(o.apiDataMap[s.key]&&s.options?.[s.type]?.dataApiConfig?.once)return;const f=(async()=>{try{let p=await s.options?.[s.type]?.dataApi?.(o.update.form,l);if(p){const g=s.options?.[s.type]?.dataPath;g&&(p=ObjectUtil.getPathValue(p,g)),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,o.apiDataMap[s.key]=p}}catch{}})();n.push(f)}};return i.option.column.forEach(s=>{t(s)}),await Promise.all(n),!0},initCurdConfig:()=>{const l=JSONUtil.cp(k.config);l.table.emptyText=h.tCurd("noData"),i.option.size=i.option.size||{},l.table.size=i.option.size.table||l.size.table,l.form.size=i.option.size.form||l.size.form,l.size.search=i.option.size.search||l.size.search;const n=ObjectUtil.deepMerge(l,i.option||{});Object.keys(n).forEach(t=>{i.option[t]=n[t]})},initColumnOptions:()=>{let l=JSONUtil.cp(k.config.columnConfig);l.options=ObjectUtil.deepMerge(l.options,{switch:{activeLabel:h.tCurd("switchOn"),inactiveLabel:h.tCurd("switchOff")}});const n=t=>{for(const s in l){if(s==="table"){if(t.table=ObjectUtil.deepMerge(l.table,t.table||{}),t.children){t.children.forEach(p=>{n(p)});return}}else s==="type"?t.type=t.type||l.type:t[s]=ObjectUtil.deepMerge(l[s],t[s]||{});t.options=t.options||{},t.options[t.type]=t.options[t.type]||{},t.options[t.type].size=i.option.size.form,["search","formAdd","formUpdate"].forEach(p=>{t.options[p]=t.options[p]||JSONUtil.cp(t.options),t.options[p][t.type]=t.options[p][t.type]||{},t.options[p][t.type].size=p==="search"?i.option.size.search:i.option.size.form}),t.table=ObjectUtil.deepMerge(t.table,t.options[t.type].table||{})}t.type==="switch"&&(t.options.switch.tableBeforeChange=async(s,f)=>{const p=t.options?.switch;try{await a.value?.open({title:h.tCurd("confirmModify"),content:h.tCurd("confirmSwitchMessage")}),o.table.loading=!0;try{return i.option.api.update?(await i.option.api.update({[i.option.table?.rowKey]:f[i.option.table?.rowKey],[s]:f[s]===p.activeValue?p.inactiveValue:p.activeValue,final(g,r,d){o.table.loading=!1}}),o.table.loading=!1,u.success(h.tCurd("operationSuccess")),o.table.getList(),!0):void 0}catch(g){return console.error(g),!1}finally{o.table.loading=!1}}catch{return!1}}),t.type==="treeSelect"&&(t.options.treeSelect.rowKey=i.option.table?.rowKey,t.options.treeSelect.nodeKey=i.option.table?.rowKey)};i.option.column.forEach(n),i.option.table?.column?.forEach(n)},getColumnSpan:(l,n)=>{if(l.item.form?.spanCol){const t=k.config.form.defaultSpan,f=n.filter(p=>!u.isFun(p.item.show?.form,o.update.form,o.update.type)).reduce((p,g)=>p+(g.item.form?.span||t),0);return(l.item?.form.span||t)+f}return l.item.form.span},initColumnForm:()=>{const l=i.option;o.update.formColumn=[],o.table.column.show={list:[],listSource:[]};const n=[],t=i.option.form?.maxSpan||12,s=i.option.form?.defaultSpan||t/2;let f=[];const p=d=>{if(d.children){o.table.column.show.list.push(d.key),d.children.forEach(b=>{p(b)});return}if(o.update.formDefault[d.key]=d.value,d.table.table&&(d.show.table&&o.table.column.show.list.push(d.key),d.table.table&&o.table.column.show.listSource.push(d.key)),!(d.isForm&&typeof d.show?.form=="boolean")||d.show?.form){d.form=d.form||{span:s},d.form.span=d.form.span??s;let b=d.form.span,y=f.reduce((V,N)=>V+N.span,b);const w=f.length;if(f.push({item:d,span:b}),(w===1&&f[0].span===0||y>=t||b===0&&w>1)&&(n.push(f),f=[]),d.rules){const V={input:h.tCurd("placeholderInput"),select:h.tCurd("placeholderSelect")},N=(V[d.type]||V.input)+d.label;o.update.rules[d.key]=typeof d.rules=="boolean"?[{required:!0,message:N,trigger:"blur"}]:d.rules}}},g=(d,b)=>{d.isForm=b,Array.isArray(d.children)&&d.children.forEach(y=>g(y,b))};l.column.forEach(d=>{d.isForm=!0,g(d,!0),p(d)}),i.option.table?.column?.forEach(d=>{g(d,!1),p(d)}),o.search.column.list=l.column.concat(l.table?.column||[]),o.table.column.list=o.search.column.list.filter(d=>d.table?.table),o.search.column.list.sort((d,b)=>d.sort?.search-b.sort?.search),o.table.column.list.sort((d,b)=>d.sort?.table-b.sort?.table),f.length>0&&n.push(f),o.update.formColumn=n;const r=i.option.search?.formDefault;r&&Object.keys(r).forEach(d=>{o.search.formDefault[d]=r[d]}),l.column.forEach(d=>{d.show?.search||(o.search.formDefault[d.key]=void 0)}),o.search.form=JSONUtil.cp(o.search.formDefault)}});return o.init(),e.onMounted(()=>{i.option.init!==!1&&o.table.getList()}),{conf:o,switchConfirmRef:a,ruleFormRef:c}},J={class:"dialog-footer"},W=e.defineComponent({__name:"switchConfirm",props:{size:{}},setup(i,{expose:a}){const c=e.ref(!1),o=e.ref("确认修改"),l=e.ref("确认要修改状态吗?");let n=null,t=null;const s=g=>(g?.title&&(o.value=g.title),g?.content&&(l.value=g.content),c.value=!0,new Promise((r,d)=>{n=r,t=d})),f=()=>{c.value=!1,n?.(!0),n=null,t=null},p=()=>{c.value=!1,t?.(new Error("用户取消操作")),n=null,t=null};return a({open:s}),(g,r)=>{const d=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(e.unref(m.ElDialog),{modelValue:c.value,"onUpdate:modelValue":r[0]||(r[0]=b=>c.value=b),title:o.value,"close-on-click-modal":!1,width:"400px"},{footer:e.withCtx(()=>[e.createVNode(d,{size:g.size},{default:e.withCtx(()=>[e.createElementVNode("span",J,[e.createVNode(e.unref(m.ElButton),{onClick:p},{default:e.withCtx(()=>r[1]||(r[1]=[e.createTextVNode("取消")])),_:1}),e.createVNode(e.unref(m.ElButton),{type:"primary",onClick:f},{default:e.withCtx(()=>r[2]||(r[2]=[e.createTextVNode("确认")])),_:1})])]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(l.value),1)]),_:1},8,["modelValue","title"])}}}),$=(i,a)=>{const c=i.__vccOpts||i;for(const[o,l]of a)c[o]=l;return c},q={},G={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function X(i,a){return e.openBlock(),e.createElementBlock("svg",G,a[0]||(a[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 Q=$(q,[["render",X]]),Y={},Z={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function P(i,a){return e.openBlock(),e.createElementBlock("svg",Z,a[0]||(a[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 _=$(Y,[["render",P]]),v={class:"row flex-center table-header-label inline"},ee={class:"table-header-tooltip"},te=["onClick","innerHTML"],oe=e.defineComponent({__name:"tableColumn",props:{conf:{},columnList:{},option:{}},setup(i){const a=u.isFun,c=e.getCurrentInstance().type;return(o,l)=>{const n=e.resolveComponent("el-tooltip");return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.columnList,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.key},[o.conf.table.column.show.list.includes(t.key)?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),e.mergeProps({key:0,prop:t.key,label:t.label,ref_for:!0},t.table),{header:e.withCtx(()=>[e.renderSlot(o.$slots,"table-header-"+t.key,{item:t},()=>[e.createElementVNode("div",v,[t.table?.tooltip?(e.openBlock(),e.createBlock(n,{key:0,effect:"dark",content:t.table?.tooltip,placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("span",ee,[e.createVNode(_)])]),_:2},1032,["content"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label),1)])])]),default:e.withCtx(({row:s})=>[t.children?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l[0]||(l[0]=e.createTextVNode("   ")),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(c)),{conf:o.conf,columnList:t.children,option:o.option},e.createSlots({_:2},[e.renderList(o.$slots,(f,p)=>({name:p,fn:e.withCtx(g=>[e.renderSlot(o.$slots,p,e.mergeProps({ref_for:!0},g||{}))])}))]),1032,["conf","columnList","option"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(a)(t.show?.form,o.conf.update.form,e.unref(u).EDialog.Update)&&o.option.table?.inlineEdit&&o.conf.inlineEdit.data===s&&(t.type==="input"||t.type==="select")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.type==="input"?(e.openBlock(),e.createBlock(e.unref(m.ElInput),e.mergeProps({key:0,modelValue:o.conf.update.form[t.key],"onUpdate:modelValue":f=>o.conf.update.form[t.key]=f,ref_for:!0},o.conf.update.getBind(t),e.toHandlers(o.conf.update.getOn(t)),{style:{width:"100%"}}),null,16,["modelValue","onUpdate:modelValue"])):t.type==="select"?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),e.mergeProps({key:1,modelValue:o.conf.update.form[t.key],"onUpdate:modelValue":f=>o.conf.update.form[t.key]=f,ref_for:!0},o.conf.update.getBind(t),e.toHandlers(o.conf.update.getOn(t)),{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,f=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)],64)):e.renderSlot(o.$slots,"table-"+t.key,{key:1,row:s,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:s[t.key],"onUpdate:modelValue":f=>s[t.key]=f,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.createBlock(e.unref(m.ElSwitch),e.mergeProps({key:1,modelValue:s[t.key],"onUpdate:modelValue":f=>s[t.key]=f,"before-change":()=>t.options?.switch?.tableBeforeChange?.(t.key,s),ref_for:!0},t.options?.switch),null,16,["modelValue","onUpdate:modelValue","before-change"])):(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:f=>t.table?.click?.callback?.(s),innerHTML:t.table?.format?t.table?.format(s):s[t.key]},null,14,te))])],64))]),_:2},1040,["prop","label"])):e.createCommentVNode("",!0)],64))),128)}}}),ae={class:"row form-item-content",style:{width:"100%"}},ne={class:"col"},re={class:"col"},le=["innerHTML"],ie=e.defineComponent({__name:"formColumn",props:{conf:{},item:{}},setup(i){return(a,c)=>(e.openBlock(),e.createBlock(e.unref(m.ElFormItem),{class:e.normalizeClass({"hide-label":typeof a.item.item.text?.form?.label=="boolean"?!a.item.item.text?.form?.label:!1}),label:typeof a.item.item.text?.form?.label=="string"?a.item.item.text?.form?.label:a.item.item.label,prop:a.item.item.key,"label-width":a.item.item.form?.labelWidth||a.conf.option.form?.labelWidth},{default:e.withCtx(()=>[e.createElementVNode("div",ae,[e.renderSlot(a.$slots,"form-"+a.item.item.key+"-start",{row:a.conf.update.form,item:a.item.item}),e.createElementVNode("div",ne,[e.createElementVNode("div",re,[e.renderSlot(a.$slots,"form-"+a.item.item.key,{row:a.conf.update.form,item:a.item.item},()=>[a.item.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(m.ElInput),e.mergeProps({key:0,modelValue:a.conf.update.form[a.item.item.key],"onUpdate:modelValue":c[0]||(c[0]=o=>a.conf.update.form[a.item.item.key]=o)},a.conf.update.getBind(a.item.item),e.toHandlers(a.conf.update.getOn(a.item.item)),{disabled:a.conf.update.getDisabled(a.item.item)}),null,16,["modelValue","disabled"])):a.item.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(m.ElSwitch),e.mergeProps({key:1,modelValue:a.conf.update.form[a.item.item.key],"onUpdate:modelValue":c[1]||(c[1]=o=>a.conf.update.form[a.item.item.key]=o)},a.conf.update.getBind(a.item.item),e.toHandlers(a.conf.update.getOn(a.item.item)),{disabled:a.conf.update.getDisabled(a.item.item)}),null,16,["modelValue","disabled"])):a.item.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),e.mergeProps({key:2,modelValue:a.conf.update.form[a.item.item.key],"onUpdate:modelValue":c[2]||(c[2]=o=>a.conf.update.form[a.item.item.key]=o)},a.conf.update.getBind(a.item.item),e.toHandlers(a.conf.update.getOn(a.item.item)),{disabled:a.conf.update.getDisabled(a.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.conf.update.getBind(a.item.item).data,o=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:o.value,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):a.item.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(m.ElRadioGroup),e.mergeProps({key:3,modelValue:a.conf.update.form[a.item.item.key],"onUpdate:modelValue":c[3]||(c[3]=o=>a.conf.update.form[a.item.item.key]=o)},a.conf.update.getBind(a.item.item),e.toHandlers(a.conf.update.getOn(a.item.item)),{disabled:a.conf.update.getDisabled(a.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.conf.update.getBind(a.item.item).data,o=>(e.openBlock(),e.createBlock(e.unref(m.ElRadio),{key:o.value,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):a.item.item.type==="list"?(e.openBlock(),e.createBlock(D,e.mergeProps({key:4,row:a.conf.update.form,field:a.item.item.key},a.conf.update.getBind(a.item.item),e.toHandlers(a.conf.update.getOn(a.item.item)),{disabled:a.conf.update.getDisabled(a.item.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):a.item.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(m.ElTreeSelect),e.mergeProps({key:5,modelValue:a.conf.update.form[a.item.item.key],"onUpdate:modelValue":c[4]||(c[4]=o=>a.conf.update.form[a.item.item.key]=o)},a.conf.update.getBind(a.item.item),e.toHandlers(a.conf.update.getOn(a.item.item)),{disabled:a.conf.update.getDisabled(a.item.item),style:{width:"100%"}}),null,16,["modelValue","disabled"])):a.item.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(m.ElDatePicker),e.mergeProps({key:6,modelValue:a.conf.update.form[a.item.item.key],"onUpdate:modelValue":c[5]||(c[5]=o=>a.conf.update.form[a.item.item.key]=o)},a.conf.update.getBind(a.item.item),e.toHandlers(a.conf.update.getOn(a.item.item)),{disabled:a.conf.update.getDisabled(a.item.item)}),null,16,["modelValue","disabled"])):a.item.item.type&&(e.unref(B).customComponent[a.item.item.type]||e.unref(B).customComponent[a.item.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[a.item.item.type]?.form||e.unref(B).customComponent[a.item.item.type]),e.mergeProps({key:7,modelValue:a.conf.update.form[a.item.item.key],"onUpdate:modelValue":c[6]||(c[6]=o=>a.conf.update.form[a.item.item.key]=o)},a.conf.update.getBind(a.item.item),e.toHandlers(a.conf.update.getOn(a.item.item)),{disabled:a.conf.update.getDisabled(a.item.item)}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(a.$slots,"form-"+a.item.item.key+"-right",{row:a.conf.update.form,item:a.item.item})]),e.renderSlot(a.$slots,"form-"+a.item.item.key+"-tip",{row:a.conf.update.form,item:a.item.item},()=>[a.item.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",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},null,8,le)):e.createCommentVNode("",!0)])]),e.renderSlot(a.$slots,"form-"+a.item.item.key+"-end",{row:a.conf.update.form,item:a.item.item})])]),_:3},8,["class","label","prop","label-width"]))}}),se={key:0,class:"relative curd-search fit-width"},de={class:"mb-10 flex justify-between items-center fit-width"},ce={class:"flex items-center",style:{gap:"10px"}},fe={key:0},pe={key:1},me={key:2},he={class:"export-btn"},ge={class:"flex items-center table-tools-right",style:{gap:"10px"}},ye={class:"row justify-end mt-10 mb-10 table-bottom-pagination"},be={class:"dialog-footer"},ke={class:"dialog-footer"},T=e.defineComponent({__name:"index",props:{option:{default:{}}},setup(i,{expose:a}){const c=u.EDialog,o=i,l=u.isFun,{conf:n,switchConfirmRef:t,ruleFormRef:s}=K(o);return a({conf:n}),(f,p)=>{const g=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative cc1-form-box",[i.option.table?.fitHeight?"col":"no-min-height"]])},[e.createElementVNode("div",{class:e.normalizeClass(["row",[i.option.table?.fitHeight?"absolute fit":""]]),style:{overflow:"hidden"}},[e.renderSlot(f.$slots,"box-left"),e.createElementVNode("div",{class:e.normalizeClass(["column fit-width no-wrap",[i.option.table?.fitHeight?"col":""]])},[i.option.search?.show!==!1?(e.openBlock(),e.createElementBlock("div",se,[e.createVNode(e.unref(m.ElForm),{model:e.unref(n).search.form,inline:"",size:i.option.size?.search},{default:e.withCtx(()=>[e.renderSlot(f.$slots,"search-start",{row:e.unref(n).search.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(n).search.column.list,r=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r.key},[(typeof r.show?.search=="function"?r.show?.search(e.unref(n).search.form):r.show?.search)?(e.openBlock(),e.createBlock(e.unref(m.ElFormItem),{key:0,label:typeof r.text?.search?.label=="string"?r.text?.search?.label:r.label,class:e.normalizeClass({"hide-label":typeof r.text?.search?.label=="boolean"?!r.text?.search?.label:!1})},{default:e.withCtx(()=>[e.renderSlot(f.$slots,"search-"+r.key,{row:e.unref(n).search.form},()=>[r.type==="input"?(e.openBlock(),e.createBlock(e.unref(m.ElInput),e.mergeProps({key:0,modelValue:e.unref(n).search.form[r.key],"onUpdate:modelValue":d=>e.unref(n).search.form[r.key]=d,placeholder:e.unref(n).search.getPlaceholder(r),clearable:"",disabled:r.disabled?.search,ref_for:!0},r.options?.search?.input||r.options?.input,e.toHandlers(r.options?.search?.input?.on||r.options?.input?.on||{})),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):r.type==="switch"?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),e.mergeProps({key:1,modelValue:e.unref(n).search.form[r.key],"onUpdate:modelValue":d=>e.unref(n).search.form[r.key]=d,placeholder:e.unref(n).search.getPlaceholder(r,e.unref(h).tCurd("placeholderSelect")),clearable:"",disabled:r.disabled?.search,ref_for:!0},r.options?.search?.switch||r.options?.switch,e.toHandlers(r.options?.search?.switch?.on||r.options?.switch?.on||{})),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:r.options?.switch?.activeValue,label:r.options?.switch?.activeLabel,value:r.options?.switch?.activeValue},null,8,["label","value"])),(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:r.options?.switch?.inactiveValue,label:r.options?.switch?.inactiveLabel,value:r.options?.switch?.inactiveValue},null,8,["label","value"]))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder","disabled"])):r.type==="select"?(e.openBlock(),e.createBlock(e.unref(m.ElSelect),e.mergeProps({key:2,modelValue:e.unref(n).search.form[r.key],"onUpdate:modelValue":d=>e.unref(n).search.form[r.key]=d,placeholder:e.unref(n).search.getPlaceholder(r,e.unref(h).tCurd("placeholderSelect")),clearable:"",disabled:r.disabled?.search,ref_for:!0},r.options?.search?.select||r.options?.select,e.toHandlers(r.options?.search?.select?.on||r.options?.select?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.options?.select?.data,d=>(e.openBlock(),e.createBlock(e.unref(m.ElOption),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder","disabled"])):r.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(m.ElDatePicker),e.mergeProps({key:3,modelValue:e.unref(n).search.form[r.key],"onUpdate:modelValue":d=>e.unref(n).search.form[r.key]=d,disabled:r.disabled?.search,ref_for:!0},r.options?.search?.datetime||r.options?.datetime,e.toHandlers(r.options?.search?.datetime?.on||r.options?.datetime?.on||{})),null,16,["modelValue","onUpdate:modelValue","disabled"])):r.type&&e.unref(B).customComponent[r.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[r.type]),e.mergeProps({key:4,modelValue:e.unref(n).search.form[r.key],"onUpdate:modelValue":d=>e.unref(n).search.form[r.key]=d,ref_for:!0},r.options?.search?.[r.type]||r.options?.[r.type],e.toHandlers(r.options?.search?.[r.type]?.on||r.options?.[r.type]?.on||{}),{disabled:r.disabled?.search}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(f.$slots,"search-"+r.key+"-right",{row:e.unref(n).search.form})]),_:2},1032,["label","class"])):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(f.$slots,"search-center",{row:e.unref(n).search.form}),i.option.tools?.search||i.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(m.ElFormItem),{key:0},{default:e.withCtx(()=>[i.option.tools?.search?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:0,type:"primary",onClick:e.unref(n).search.submit},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("search")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),i.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:1,onClick:e.unref(n).search.reset},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("reset")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"search-end",{row:e.unref(n).search.form})]),_:3},8,["model","size"])])):e.createCommentVNode("",!0),e.createElementVNode("div",de,[e.createElementVNode("div",ce,[e.unref(l)(i.option.tools?.add)?(e.openBlock(),e.createElementBlock("div",fe,[e.createVNode(e.unref(m.ElButton),{type:"primary",onClick:p[0]||(p[0]=r=>e.unref(n).update.open(e.unref(c).Add)),size:i.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("add")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),i.option.table?.selectable&&e.unref(l)(i.option.tools?.delete)?(e.openBlock(),e.createElementBlock("div",pe,[e.createVNode(e.unref(m.ElButton),{type:"danger",onClick:p[1]||(p[1]=r=>e.unref(n).remove.open(e.unref(n).table.selection.list)),size:i.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("delete")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),i.option.tools?.expand?(e.openBlock(),e.createElementBlock("div",me,[e.createVNode(e.unref(m.ElButton),{type:"warning",onClick:p[2]||(p[2]=r=>e.unref(n).table.expand.all()),size:i.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("expandCollapse")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),i.option.tools?.export?.show?(e.openBlock(),e.createBlock(e.unref(m.ElDropdown),{key:3,onCommand:e.unref(n).export.click},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(m.ElDropdownMenu),{size:i.option.size?.search},{default:e.withCtx(()=>[i.option.table?.selectable?(e.openBlock(),e.createBlock(e.unref(m.ElDropdownItem),{key:0,command:"select"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("exportSelect")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(m.ElDropdownItem),{command:"page"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("exportPage")),1)]),_:1}),e.createVNode(e.unref(m.ElDropdownItem),{command:"all"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("exportAll")),1)]),_:1})]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",he,[e.createVNode(e.unref(m.ElButton),{type:"warning",loading:e.unref(n).export.loading,size:i.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("export")),1)]),_:1},8,["loading","size"])])]),_:1},8,["onCommand"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"tools-left")]),e.createElementVNode("div",ge,[e.renderSlot(f.$slots,"tools-right"),e.unref(n).page.showTools?(e.openBlock(),e.createBlock(e.unref(m.ElPagination),e.mergeProps({key:0,"current-page":e.unref(n).page.num,"onUpdate:currentPage":p[3]||(p[3]=r=>e.unref(n).page.num=r),"page-size":e.unref(n).page.size,"onUpdate:pageSize":p[4]||(p[4]=r=>e.unref(n).page.size=r),background:"","page-sizes":e.unref(n).page.sizeList,"pager-count":e.unref(n).page.pagerCount,layout:e.unref(n).page.layout,total:e.unref(n).page.total,size:i.option.size?.table,onSizeChange:e.unref(n).table.getList,onCurrentChange:e.unref(n).table.getList},i.option.page?.pagination||{},e.toHandlers(i.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0),i.option.tools?.refresh===void 0||i.option.tools?.refresh?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["refresh-btn",[i.option.size?.search]]),onClick:p[5]||(p[5]=(...r)=>e.unref(n).table.getList&&e.unref(n).table.getList(...r))},[e.createVNode(Q)],2)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:e.normalizeClass(["fit-width relative form-box",[i.option.table?.fitHeight?"col ":""]])},[e.createElementVNode("div",{class:e.normalizeClass(["column form-box-content",[i.option.table?.fitHeight?"absolute fit":""]])},[e.withDirectives((e.openBlock(),e.createBlock(e.unref(m.ElTable),e.mergeProps({data:e.unref(n).table.data,border:i.option.table?.border===void 0?!0:i.option.table?.border,onSelectionChange:e.unref(n).table.selection.change,onSortChange:e.unref(n).table.sort.change,"expand-row-keys":e.unref(n).table.expand.rowKeys,onExpandChange:e.unref(n).table.expand.change},i.option.table,e.toHandlers(i.option.table?.on||{})),{default:e.withCtx(()=>[i.option.table?.selectable||e.unref(l)(i.option.tools?.delete)||i.option.tools?.export?.show?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),{key:0,type:"selection",selectable:typeof i.option.table?.selectable=="function"?i.option.table?.selectable:void 0,width:"40",align:"center",fixed:"left","show-overflow-tooltip":!1},null,8,["selectable"])):e.createCommentVNode("",!0),e.createVNode(oe,{conf:e.unref(n),columnList:e.unref(n).table.column.list,option:i.option},e.createSlots({_:2},[e.renderList(f.$slots,(r,d)=>({name:d,fn:e.withCtx(b=>[e.renderSlot(f.$slots,d,e.normalizeProps(e.guardReactiveProps(b||{})))])}))]),1032,["conf","columnList","option"]),e.unref(l)(i.option.table?.add)||e.unref(l)(i.option.table?.update)||e.unref(l)(i.option.table?.delete)||e.unref(l)(i.option.table?.view)||f.$slots["table-op-left"]||f.$slots["table-op-right"]?(e.openBlock(),e.createBlock(e.unref(m.ElTableColumn),e.mergeProps({key:1,width:e.unref(n).table.op.width(e.unref(l)(i.option.table?.add),e.unref(l)(i.option.table?.update),e.unref(l)(i.option.table?.delete),e.unref(l)(i.option.table?.view),f.$slots["table-op-left"],f.$slots["table-op-right"]),align:"center",fixed:"right"},i.option.table?.operate),{header:e.withCtx(()=>[e.renderSlot(f.$slots,"table-header-op",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("operation")),1)])]),default:e.withCtx(({row:r})=>[e.createVNode(e.unref(m.ElForm),{size:i.option.size?.table},{default:e.withCtx(()=>[e.renderSlot(f.$slots,"table-op-left",{row:r}),i.option.table?.inlineEdit&&e.unref(n).inlineEdit.data===r?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(m.ElButton),{link:"",type:"info",onClick:e.unref(n).inlineEdit.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("cancel")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(m.ElButton),{link:"",type:"primary",onClick:e.unref(n).update.submit,loading:e.unref(n).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("confirm")),1)]),_:1},8,["onClick","loading"]),e.renderSlot(f.$slots,"table-op-edit-right",{row:r})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(l)(i.option.table?.add,r)?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:0,link:"",type:"primary",onClick:d=>e.unref(n).update.open(e.unref(c).Add,r)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("add")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(l)(i.option.table?.view,r)?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:1,link:"",type:"primary",onClick:d=>e.unref(n).update.open(e.unref(c).View,r)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("view")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(l)(i.option.table?.update,r)?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:2,link:"",type:"warning",onClick:d=>e.unref(n).update.open(e.unref(c).Update,r)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("edit")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(l)(i.option.table?.delete,r)?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:3,link:"",type:"danger",onClick:d=>e.unref(n).remove.open([r])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("delete")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"table-op-right",{row:r})],64))]),_:2},1032,["size"])]),_:3},16,["width"])):e.createCommentVNode("",!0)]),_:3},16,["data","border","onSelectionChange","onSortChange","expand-row-keys","onExpandChange"])),[[g,e.unref(n).table.loading]])],2)],2),e.createElementVNode("div",ye,[(i.option.page?.show===void 0||i.option.page?.show)&&!e.unref(n).page.showTools?(e.openBlock(),e.createBlock(e.unref(m.ElPagination),e.mergeProps({key:0,"current-page":e.unref(n).page.num,"onUpdate:currentPage":p[6]||(p[6]=r=>e.unref(n).page.num=r),"page-size":e.unref(n).page.size,"onUpdate:pageSize":p[7]||(p[7]=r=>e.unref(n).page.size=r),background:"","page-sizes":e.unref(n).page.sizeList,"pager-count":e.unref(n).page.pagerCount,layout:e.unref(n).page.layout,total:e.unref(n).page.total,size:i.option.size?.table,onSizeChange:e.unref(n).table.getList,onCurrentChange:e.unref(n).table.getList},i.option.page?.pagination||{},e.toHandlers(i.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(f.$slots,"box-right")],2),e.createVNode(e.unref(m.ElDialog),e.mergeProps({modelValue:e.unref(n).update.show,"onUpdate:modelValue":p[8]||(p[8]=r=>e.unref(n).update.show=r),title:e.unref(n).update.title,"before-close":e.unref(n).update.close},i.option.dialog),{footer:e.withCtx(()=>[e.createElementVNode("span",be,[e.createVNode(e.unref(m.ElForm),{size:i.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(m.ElButton),{onClick:e.unref(n).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("close")),1)]),_:1},8,["onClick"]),e.unref(n).update.type!==e.unref(c).View?(e.openBlock(),e.createBlock(e.unref(m.ElButton),{key:0,type:"primary",onClick:e.unref(n).update.submit,loading:e.unref(n).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("submit")),1)]),_:1},8,["onClick","loading"])):e.createCommentVNode("",!0)]),_:1},8,["size"])])]),default:e.withCtx(()=>[e.createVNode(e.unref(m.ElForm),{ref_key:"ruleFormRef",ref:s,model:e.unref(n).update.form,rules:e.unref(n).update.rules,size:i.option.size?.form},{default:e.withCtx(()=>[e.unref(n).update.showContent?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(n).update.formColumn,r=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(l)((()=>{const d=[],b=y=>{y?.item?.children?b(y.item.children):d.push(...y.map(w=>w.item?.show?.form))};return b(r),d})(),e.unref(n).update.form,e.unref(n).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:i.option.form?.stripe===void 0?!0:i.option.form?.stripe}])},[e.renderSlot(f.$slots,"form-start",{row:e.unref(n).update.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,d=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(l)(d.item.show?.form,e.unref(n).update.form,e.unref(n).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([d.item.form.span>0?`col-${e.unref(n).getColumnSpan(d,r)}`:"col",`form-item-col-${d.item.key}`])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.item.children?d.children:[d],b=>(e.openBlock(),e.createBlock(ie,{key:b.item.key,conf:e.unref(n),item:b},e.createSlots({_:2},[e.renderList(f.$slots,(y,w)=>({name:w,fn:e.withCtx(V=>[e.renderSlot(f.$slots,w,e.mergeProps({ref_for:!0},V||{}))])}))]),1032,["conf","item"]))),128))],2)):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(f.$slots,"form-end",{row:e.unref(n).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(m.ElDialog),{modelValue:e.unref(n).remove.show,"onUpdate:modelValue":p[9]||(p[9]=r=>e.unref(n).remove.show=r),title:e.unref(n).remove.title,"close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createElementVNode("span",ke,[e.createVNode(e.unref(m.ElForm),{size:i.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(m.ElButton),{onClick:e.unref(n).remove.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("close")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(m.ElButton),{type:"danger",onClick:e.unref(n).remove.submit,loading:e.unref(n).remove.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h).tCurd("confirmDelete")),1)]),_:1},8,["onClick","loading"])]),_:1},8,["size"])])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(e.unref(h).tCurd("confirmDeleteMessage",e.unref(n).remove.items.length)),1)]),_:1},8,["modelValue","title"]),e.createVNode(W,{ref_key:"switchConfirmRef",ref:t,size:i.option.size?.form},null,8,["size"])],2)}}});class ue{static async download(a,c="download.png"){const o=document.createElement("a");o.style.display="none",o.href=a,o.setAttribute("download",c),typeof o.download>"u"&&o.setAttribute("target","_blank"),document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(a)}static exportJSONFile=(a,c)=>{const o=new Blob([JSON.stringify(a)],{type:"application/json"}),l=URL.createObjectURL(o),n=document.createElement("a");n.href=l,n.download=`${c||"config"}.json`,n.click()};static importFile=async a=>new Promise((c,o)=>{const l=document.createElement("input");l.type="file";const n=a?.accept||".json";l.accept=n,l.style.display="none",l.onchange=t=>{const s=t.target.files[0];if(!s){u.fail("未选择文件"),o("未选择文件");return}const f=new FileReader;f.onload=async p=>{const g=n==".json"?JSON.parse(p.target.result):p.target.result;c(g)},f.onerror=()=>{u.fail("文件读取失败"),o("文件读取失败")},f.readAsText(s),document.body.removeChild(l)},document.body.appendChild(l),l.click()})}const L=(i,a)=>{if(i.component("TCurd",T),i.component("TFormList",D),i.component("TColumn",O),a?.customComponent){B.customComponent=a.customComponent;for(const c in a.customComponent)i.component(c,a.customComponent[c])}},we={install:L};C.ArrUtil=E,C.ExcelUtil=U,C.TColumn=O,C.TCurd=T,C.TFile=ue,C.TForm=B,C.TFormConfig=k,C.TFormI18n=h,C.TFormList=D,C.TSys=u,C.default=we,C.install=L,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
@@ -1749,9 +1749,9 @@ export declare const curdConf: (props: {
1749
1749
  getDisabled: (item: CurdConfigColumn) => boolean | undefined;
1750
1750
  getBind: (item: CurdConfigColumn) => any;
1751
1751
  getOn: (item: CurdConfigColumn) => any;
1752
- getBindOnByKey: <T = any>(key: string) => {
1753
- bind: CurdConfigColumn<T>["options"];
1754
- on: any;
1752
+ getOptions: <T = any>(key: string) => {
1753
+ options: CurdConfigColumn<T>["options"];
1754
+ bind: Omit<CurdConfigColumn<T>["options"], "formAdd" | "formUpdate">;
1755
1755
  };
1756
1756
  edit: {
1757
1757
  data: any;
@@ -1753,9 +1753,9 @@ declare const conf: {
1753
1753
  getDisabled: (item: import("./indexType").CurdConfigColumn) => boolean | undefined;
1754
1754
  getBind: (item: import("./indexType").CurdConfigColumn) => any;
1755
1755
  getOn: (item: import("./indexType").CurdConfigColumn) => any;
1756
- getBindOnByKey: <T = any>(key: string) => {
1757
- bind: import("./indexType").CurdConfigColumn<T>["options"];
1758
- on: any;
1756
+ getOptions: <T = any>(key: string) => {
1757
+ options: import("./indexType").CurdConfigColumn<T>["options"];
1758
+ bind: Omit<import("./indexType").CurdConfigColumn<T>["options"], "formAdd" | "formUpdate">;
1759
1759
  };
1760
1760
  edit: {
1761
1761
  data: any;
@@ -3951,9 +3951,9 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
3951
3951
  getDisabled: (item: import("./indexType").CurdConfigColumn) => boolean | undefined;
3952
3952
  getBind: (item: import("./indexType").CurdConfigColumn) => any;
3953
3953
  getOn: (item: import("./indexType").CurdConfigColumn) => any;
3954
- getBindOnByKey: <T = any>(key: string) => {
3955
- bind: import("./indexType").CurdConfigColumn<T>["options"];
3956
- on: any;
3954
+ getOptions: <T = any>(key: string) => {
3955
+ options: import("./indexType").CurdConfigColumn<T>["options"];
3956
+ bind: Omit<import("./indexType").CurdConfigColumn<T>["options"], "formAdd" | "formUpdate">;
3957
3957
  };
3958
3958
  edit: {
3959
3959
  data: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc1-form",
3
- "version": "1.1.39",
3
+ "version": "1.1.40",
4
4
  "description": "我来助你-表单组件库",
5
5
  "repository": {
6
6
  "type": "git",