cc1-form 1.2.16 → 1.2.17

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,6 +1,6 @@
1
- import { ElMessage as he, ElLoading as ge, ElForm as q, ElFormItem as te, ElInput as x, ElSwitch as Z, ElSelect as G, ElOption as N, ElRadioGroup as le, ElRadio as ne, ElTreeSelect as pe, ElDatePicker as ie, ElDialog as ae, ElButton as L, ElTableColumn as ee, ElDropdown as ye, ElDropdownMenu as be, ElDropdownItem as oe, ElPagination as de, ElTable as we } from "element-plus";
1
+ import { ElMessage as he, ElLoading as ye, ElForm as q, ElFormItem as te, ElInput as x, ElSwitch as Z, ElSelect as G, ElOption as N, ElRadioGroup as le, ElRadio as ne, ElTreeSelect as pe, ElDatePicker as ie, ElDialog as ae, ElButton as L, ElTableColumn as ee, ElDropdown as ge, ElDropdownMenu as be, ElDropdownItem as oe, ElPagination as de, ElTable as we } from "element-plus";
2
2
  import "vue-router";
3
- import { defineComponent as K, reactive as re, onMounted as fe, resolveComponent as _, createElementBlock as b, createCommentVNode as v, openBlock as d, renderSlot as C, createVNode as U, withCtx as y, createTextVNode as D, Fragment as $, renderList as A, createBlock as h, normalizeClass as I, normalizeStyle as ce, ref as W, unref as a, createElementVNode as E, mergeProps as V, toHandlers as z, resolveDynamicComponent as J, nextTick as ke, toDisplayString as O, computed as me, getCurrentInstance as ve, createSlots as Q, withModifiers as Ce, resolveDirective as Ve, withDirectives as ze, normalizeProps as $e, guardReactiveProps as De } from "vue";
3
+ import { defineComponent as K, reactive as re, onMounted as fe, resolveComponent as _, createElementBlock as b, createCommentVNode as v, openBlock as d, renderSlot as C, createVNode as U, withCtx as g, createTextVNode as D, Fragment as $, renderList as A, createBlock as h, normalizeClass as I, normalizeStyle as ce, ref as W, unref as a, createElementVNode as E, mergeProps as V, toHandlers as z, resolveDynamicComponent as J, nextTick as ke, toDisplayString as O, computed as me, getCurrentInstance as ve, createSlots as Q, withModifiers as Ce, resolveDirective as Ve, withDirectives as ze, normalizeProps as $e, guardReactiveProps as De } from "vue";
4
4
  class M {
5
5
  /**
6
6
  * Vue Router 实例,需在应用初始化时赋值
@@ -103,7 +103,7 @@ class M {
103
103
  */
104
104
  static loading = (o = !0, p = "Loading...") => {
105
105
  Timer.un(this.loadingTimer), this.loadingTimer = Timer.once(() => {
106
- o ? this.loadingObj = ge.service({
106
+ o ? this.loadingObj = ye.service({
107
107
  lock: !0,
108
108
  text: p,
109
109
  background: "rgba(0, 0, 0, 0.3)"
@@ -771,7 +771,7 @@ const Ee = {
771
771
  type: "primary",
772
772
  onClick: e[0] || (e[0] = (m) => n.add(i.field, i.row, i.itemFields))
773
773
  }, {
774
- default: y(() => e[3] || (e[3] = [
774
+ default: g(() => e[3] || (e[3] = [
775
775
  D("添加")
776
776
  ])),
777
777
  _: 1
@@ -799,7 +799,7 @@ const Ee = {
799
799
  type: "danger",
800
800
  onClick: (c) => n.remove(i.field, i.row, m)
801
801
  }, {
802
- default: y(() => e[4] || (e[4] = [
802
+ default: g(() => e[4] || (e[4] = [
803
803
  D("删除")
804
804
  ])),
805
805
  _: 2
@@ -811,7 +811,7 @@ const Ee = {
811
811
  type: "primary",
812
812
  onClick: e[2] || (e[2] = (m) => n.add(i.field, i.row, i.itemFields))
813
813
  }, {
814
- default: y(() => e[5] || (e[5] = [
814
+ default: g(() => e[5] || (e[5] = [
815
815
  D("添加")
816
816
  ])),
817
817
  _: 1
@@ -853,7 +853,7 @@ const Ee = {
853
853
  getOn: (r) => r.options?.[e.type === n.Add ? "formAdd" : "formUpdate"]?.[r.type]?.on || r.options?.[r.type]?.on || {},
854
854
  getColumnSpan: (r, s) => {
855
855
  if (r.item.form?.spanCol) {
856
- const m = t.option.form?.maxSpan || 12, c = t.option.form?.defaultSpan || m / 2, k = s.filter((f) => !M.isFun(f.item.show?.form, e.form, e.type)).reduce((f, g) => f + (g.item.form?.span || c), 0);
856
+ const m = t.option.form?.maxSpan || 12, c = t.option.form?.defaultSpan || m / 2, k = s.filter((f) => !M.isFun(f.item.show?.form, e.form, e.type)).reduce((f, y) => f + (y.item.form?.span || c), 0);
857
857
  return (r.item.form?.span || c) + k;
858
858
  }
859
859
  return r.item.form?.span;
@@ -863,35 +863,35 @@ const Ee = {
863
863
  e.formColumn = [], e.rules = {}, e.formDefault = {};
864
864
  const s = [], m = t.option.form?.maxSpan || 12, c = t.option.form?.defaultSpan || m / 2;
865
865
  let u = [];
866
- const k = (g) => {
867
- if (g.children) {
868
- g.children.forEach((S) => {
866
+ const k = (y) => {
867
+ if (y.children) {
868
+ y.children.forEach((S) => {
869
869
  k(S);
870
870
  });
871
871
  return;
872
872
  }
873
- if (e.formDefault[g.key] = g.value, g.isForm && (typeof g.show?.form != "boolean" || g.show?.form)) {
874
- g.form = g.form || { span: c }, g.form.span = g.form.span ?? c;
875
- const S = g.form.span, B = u.reduce((R, Y) => R + Y.span, S), F = u.length;
876
- if (u.push({ item: g, span: S }), (F === 1 && u[0].span === 0 || B >= m || S === 0 && F > 1) && (s.push(u), u = []), g.rules) {
873
+ if (e.formDefault[y.key] = y.value, y.isForm && (typeof y.show?.form != "boolean" || y.show?.form)) {
874
+ y.form = y.form || { span: c }, y.form.span = y.form.span ?? c;
875
+ const S = y.form.span, B = u.reduce((R, Y) => R + Y.span, S), F = u.length;
876
+ if (u.push({ item: y, span: S }), (F === 1 && u[0].span === 0 || B >= m || S === 0 && F > 1) && (s.push(u), u = []), y.rules) {
877
877
  const R = {
878
878
  input: w.tCurd("placeholderInput"),
879
879
  select: w.tCurd("placeholderSelect")
880
- }, Y = (R[g.type] || R.input) + g.label;
881
- e.rules[g.key] = typeof g.rules == "boolean" ? [
880
+ }, Y = (R[y.type] || R.input) + y.label;
881
+ e.rules[y.key] = typeof y.rules == "boolean" ? [
882
882
  {
883
883
  required: !0,
884
884
  message: Y,
885
885
  trigger: "blur"
886
886
  }
887
- ] : g.rules;
887
+ ] : y.rules;
888
888
  }
889
889
  }
890
- }, f = (g, S) => {
891
- g.isForm = S, Array.isArray(g.children) && g.children.forEach((B) => f(B, S));
890
+ }, f = (y, S) => {
891
+ y.isForm = S, Array.isArray(y.children) && y.children.forEach((B) => f(B, S));
892
892
  };
893
- r.column.forEach((g) => {
894
- f(g, !0), k(g);
893
+ r.column.forEach((y) => {
894
+ f(y, !0), k(y);
895
895
  }), u.length > 0 && s.push(u), e.formColumn = s, e.form = JSONUtil.cp(e.formDefault);
896
896
  }
897
897
  });
@@ -904,7 +904,7 @@ const Ee = {
904
904
  model: e.form,
905
905
  rules: e.rules
906
906
  }, {
907
- default: y(() => [
907
+ default: g(() => [
908
908
  e.show ? (d(!0), b($, { key: 0 }, A(e.formColumn, (m, c) => (d(), b($, { key: c }, [
909
909
  a(p)(
910
910
  m.map((u) => u.item?.show?.form),
@@ -931,7 +931,7 @@ const Ee = {
931
931
  prop: u.item.key,
932
932
  "label-width": u.item.text?.form?.label == "" ? 0 : u.item.form?.labelWidth || i.option.form?.labelWidth || "100px"
933
933
  }, {
934
- default: y(() => [
934
+ default: g(() => [
935
935
  E("div", Te, [
936
936
  C(r.$slots, "form-" + u.item.key + "-start", {
937
937
  row: e.form,
@@ -966,7 +966,7 @@ const Ee = {
966
966
  disabled: e.getDisabled(u.item),
967
967
  style: { width: "100%" }
968
968
  }), {
969
- default: y(() => [
969
+ default: g(() => [
970
970
  (d(!0), b($, null, A(u.item.options?.select?.data, (k) => (d(), h(a(N), {
971
971
  key: k.value,
972
972
  label: k.label,
@@ -983,7 +983,7 @@ const Ee = {
983
983
  disabled: e.getDisabled(u.item),
984
984
  style: { width: "100%" }
985
985
  }), {
986
- default: y(() => [
986
+ default: g(() => [
987
987
  (d(!0), b($, null, A(u.item.options?.radio?.data, (k) => (d(), h(a(ne), {
988
988
  key: k.value,
989
989
  label: k.label,
@@ -1212,9 +1212,9 @@ const H = M.EDialog, Re = (i) => {
1212
1212
  await l.initApiData("init");
1213
1213
  let e = {};
1214
1214
  if (l.table.sort.prop) {
1215
- const { props: g, order: S } = T.config.table.sort;
1215
+ const { props: y, order: S } = T.config.table.sort;
1216
1216
  e = {
1217
- [g.field]: l.table.sort.prop,
1217
+ [y.field]: l.table.sort.prop,
1218
1218
  [S.field]: l.table.sort.order
1219
1219
  };
1220
1220
  }
@@ -1223,10 +1223,10 @@ const H = M.EDialog, Re = (i) => {
1223
1223
  ...e
1224
1224
  }), s = T.config.field.result, m = r.data || { [s.list]: r };
1225
1225
  let c = (Array.isArray(m[s.list]), m[s.list]);
1226
- const u = l.update.formColumn.flat(), f = ObjectUtil.deepMerge({ data: c }, {}).data.map((g) => (Object.keys(g).forEach((B) => {
1226
+ const u = l.update.formColumn.flat(), f = ObjectUtil.deepMerge({ data: c }, {}).data.map((y) => (Object.keys(y).forEach((B) => {
1227
1227
  const F = u.find((R) => R.item.key === B);
1228
1228
  F && ["select", "radio"].includes(F.item.type) && (F.item.table.format || (F.item.table.format = (R) => F.item.options[F.item.type].data?.find((Y) => Y.value == R[B])?.label || R[B]));
1229
- }), g));
1229
+ }), y));
1230
1230
  l.table.data = i.option.data ? await i.option.data(f, c) : f, l.page.total = m[s.total] || 0;
1231
1231
  } catch (e) {
1232
1232
  console.error(e);
@@ -1249,13 +1249,13 @@ const H = M.EDialog, Re = (i) => {
1249
1249
  if (r?.clearSelection(), !r || !t?.length) return;
1250
1250
  const s = i.option.table?.rowKey, m = l.table.data, c = (u) => {
1251
1251
  const k = (f) => {
1252
- for (const g of f) {
1252
+ for (const y of f) {
1253
1253
  if (s != null && s !== "") {
1254
- if (g[s] === u[s]) return g;
1255
- } else if (g === u)
1256
- return g;
1257
- if (Array.isArray(g.children) && g.children.length) {
1258
- const S = k(g.children);
1254
+ if (y[s] === u[s]) return y;
1255
+ } else if (y === u)
1256
+ return y;
1257
+ if (Array.isArray(y.children) && y.children.length) {
1258
+ const S = k(y.children);
1259
1259
  if (S !== void 0) return S;
1260
1260
  }
1261
1261
  }
@@ -1561,7 +1561,7 @@ const H = M.EDialog, Re = (i) => {
1561
1561
  let c = await s.options?.[s.type]?.dataApi?.(l.update.form, l.update.type);
1562
1562
  if (c) {
1563
1563
  const u = s.options?.[s.type]?.dataPath;
1564
- !Array.isArray(c) && u && (c = ObjectUtil.getPathValue(c, u)), s.options[s.type].data = c, s.options.search[s.type].data = c, s.options.search[s.options.search.type ?? s.type].data = c, s.options.formAdd[s.type].data = c, s.options.formUpdate[s.type].data = c, l.apiDataMap[s.key] = c;
1564
+ !Array.isArray(c) && u && (c = ObjectUtil.getPathValue(c, u)), s.options[s.type].data = c, s.options.search[s.type].data = c, s.options.search[s.options.search.type ?? s.type] || (s.options.search[s.options.search.type ?? s.type] = {}), s.options.search[s.options.search.type ?? s.type].data = c, s.options.formAdd[s.type].data = c, s.options.formUpdate[s.type].data = c, l.apiDataMap[s.key] = c;
1565
1565
  }
1566
1566
  } catch {
1567
1567
  }
@@ -1669,16 +1669,16 @@ const H = M.EDialog, Re = (i) => {
1669
1669
  let m = [];
1670
1670
  const c = (f) => {
1671
1671
  if (f.children) {
1672
- l.table.column.show.list.push(f.key), f.children.forEach((g) => {
1673
- c(g);
1672
+ l.table.column.show.list.push(f.key), f.children.forEach((y) => {
1673
+ c(y);
1674
1674
  });
1675
1675
  return;
1676
1676
  }
1677
1677
  if (l.update.formDefault[f.key] = f.value, f.table.table && (f.show.table && l.table.column.show.list.push(f.key), f.table.table && l.table.column.show.listSource.push(f.key)), !(f.isForm && typeof f.show?.form == "boolean") || f.show?.form) {
1678
1678
  f.form = f.form || { span: s }, f.form.span = f.form.span ?? s;
1679
- let g = f.form.span, S = m.reduce((F, R) => F + R.span, g);
1679
+ let y = f.form.span, S = m.reduce((F, R) => F + R.span, y);
1680
1680
  const B = m.length;
1681
- if (m.push({ item: f, span: g }), (B === 1 && m[0].span === 0 || S >= r || g === 0 && B > 1) && (e.push(m), m = []), f.rules) {
1681
+ if (m.push({ item: f, span: y }), (B === 1 && m[0].span === 0 || S >= r || y === 0 && B > 1) && (e.push(m), m = []), f.rules) {
1682
1682
  const F = {
1683
1683
  input: w.tCurd("placeholderInput"),
1684
1684
  select: w.tCurd("placeholderSelect")
@@ -1692,14 +1692,14 @@ const H = M.EDialog, Re = (i) => {
1692
1692
  ] : f.rules;
1693
1693
  }
1694
1694
  }
1695
- }, u = (f, g) => {
1696
- f.isForm = g, Array.isArray(f.children) && f.children.forEach((S) => u(S, g));
1695
+ }, u = (f, y) => {
1696
+ f.isForm = y, Array.isArray(f.children) && f.children.forEach((S) => u(S, y));
1697
1697
  };
1698
1698
  t.column.forEach((f) => {
1699
1699
  f.isForm = !0, u(f, !0), c(f);
1700
1700
  }), i.option.table?.column?.forEach((f) => {
1701
1701
  u(f, !1), c(f);
1702
- }), l.search.column.list = t.column.concat(t.table?.column || []), l.table.column.list = l.search.column.list.filter((f) => f.table?.table), l.search.column.list.sort((f, g) => f.sort?.search - g.sort?.search), l.table.column.list.sort((f, g) => f.sort?.table - g.sort?.table), m.length > 0 && e.push(m), l.update.formColumn = e;
1702
+ }), l.search.column.list = t.column.concat(t.table?.column || []), l.table.column.list = l.search.column.list.filter((f) => f.table?.table), l.search.column.list.sort((f, y) => f.sort?.search - y.sort?.search), l.table.column.list.sort((f, y) => f.sort?.table - y.sort?.table), m.length > 0 && e.push(m), l.update.formColumn = e;
1703
1703
  const k = i.option.search?.formDefault;
1704
1704
  k && Object.keys(k).forEach((f) => {
1705
1705
  l.search.formDefault[f] = k[f];
@@ -1737,12 +1737,12 @@ const H = M.EDialog, Re = (i) => {
1737
1737
  "close-on-click-modal": !1,
1738
1738
  width: "400px"
1739
1739
  }, {
1740
- footer: y(() => [
1740
+ footer: g(() => [
1741
1741
  U(k, { size: c.size }, {
1742
- default: y(() => [
1742
+ default: g(() => [
1743
1743
  E("span", Ie, [
1744
1744
  U(a(L), { onClick: m }, {
1745
- default: y(() => u[1] || (u[1] = [
1745
+ default: g(() => u[1] || (u[1] = [
1746
1746
  D("取消")
1747
1747
  ])),
1748
1748
  _: 1
@@ -1751,7 +1751,7 @@ const H = M.EDialog, Re = (i) => {
1751
1751
  type: "primary",
1752
1752
  onClick: s
1753
1753
  }, {
1754
- default: y(() => u[2] || (u[2] = [
1754
+ default: g(() => u[2] || (u[2] = [
1755
1755
  D("确认")
1756
1756
  ])),
1757
1757
  _: 1
@@ -1761,7 +1761,7 @@ const H = M.EDialog, Re = (i) => {
1761
1761
  _: 1
1762
1762
  }, 8, ["size"])
1763
1763
  ]),
1764
- default: y(() => [
1764
+ default: g(() => [
1765
1765
  E("div", null, O(l.value), 1)
1766
1766
  ]),
1767
1767
  _: 1
@@ -1858,7 +1858,7 @@ const lt = /* @__PURE__ */ X(tt, [["render", at]]), nt = { class: "row flex-cent
1858
1858
  label: e.label,
1859
1859
  ref_for: !0
1860
1860
  }, e.table), {
1861
- header: y(() => [
1861
+ header: g(() => [
1862
1862
  C(n.$slots, "table-header-" + e.key, { item: e }, () => [
1863
1863
  E("div", nt, [
1864
1864
  e.table?.header?.tooltip ? (d(), h(t, {
@@ -1866,12 +1866,12 @@ const lt = /* @__PURE__ */ X(tt, [["render", at]]), nt = { class: "row flex-cent
1866
1866
  effect: "dark",
1867
1867
  placement: "top"
1868
1868
  }, {
1869
- content: y(() => [
1869
+ content: g(() => [
1870
1870
  E("div", {
1871
1871
  innerHTML: e.table?.header?.tooltip
1872
1872
  }, null, 8, rt)
1873
1873
  ]),
1874
- default: y(() => [
1874
+ default: g(() => [
1875
1875
  E("span", it, [
1876
1876
  U(Ye)
1877
1877
  ])
@@ -1896,7 +1896,7 @@ const lt = /* @__PURE__ */ X(tt, [["render", at]]), nt = { class: "row flex-cent
1896
1896
  ])
1897
1897
  ])
1898
1898
  ]),
1899
- default: y(({ row: r }) => [
1899
+ default: g(({ row: r }) => [
1900
1900
  e.children ? (d(), b($, { key: 0 }, [
1901
1901
  l[0] || (l[0] = D("   ")),
1902
1902
  (d(), h(J(a(p)), {
@@ -1906,7 +1906,7 @@ const lt = /* @__PURE__ */ X(tt, [["render", at]]), nt = { class: "row flex-cent
1906
1906
  }, Q({ _: 2 }, [
1907
1907
  A(n.$slots, (s, m) => ({
1908
1908
  name: m,
1909
- fn: y((c) => [
1909
+ fn: g((c) => [
1910
1910
  C(n.$slots, m, V({ ref_for: !0 }, c || {}))
1911
1911
  ])
1912
1912
  }))
@@ -1931,7 +1931,7 @@ const lt = /* @__PURE__ */ X(tt, [["render", at]]), nt = { class: "row flex-cent
1931
1931
  }, n.conf.update.getBind(e), z(n.conf.update.getOn(e, r))), Q({ _: 2 }, [
1932
1932
  e.options?.input?.prepend ? {
1933
1933
  name: "prepend",
1934
- fn: y(() => [
1934
+ fn: g(() => [
1935
1935
  D(O(typeof e.options?.input?.prepend == "function" ? e.options?.input?.prepend(r) : e.options?.input?.prepend), 1)
1936
1936
  ]),
1937
1937
  key: "0"
@@ -1944,7 +1944,7 @@ const lt = /* @__PURE__ */ X(tt, [["render", at]]), nt = { class: "row flex-cent
1944
1944
  class: "col",
1945
1945
  ref_for: !0
1946
1946
  }, n.conf.update.getBind(e), z(n.conf.update.getOn(e, r))), {
1947
- default: y(() => [
1947
+ default: g(() => [
1948
1948
  (d(!0), b($, null, A(e.options?.search?.select?.data || e.options?.select?.data, (s) => (d(), h(a(N), {
1949
1949
  key: s.value,
1950
1950
  label: s.label,
@@ -1975,7 +1975,7 @@ const lt = /* @__PURE__ */ X(tt, [["render", at]]), nt = { class: "row flex-cent
1975
1975
  }, n.conf.update.getBind(e), z(n.conf.update.getOn(e, r)), { style: { width: "100%" } }), Q({ _: 2 }, [
1976
1976
  e.options?.input?.prepend ? {
1977
1977
  name: "prepend",
1978
- fn: y(() => [
1978
+ fn: g(() => [
1979
1979
  D(O(typeof e.options?.input?.prepend == "function" ? e.options?.input?.prepend(r) : e.options?.input?.prepend), 1)
1980
1980
  ]),
1981
1981
  key: "0"
@@ -1987,7 +1987,7 @@ const lt = /* @__PURE__ */ X(tt, [["render", at]]), nt = { class: "row flex-cent
1987
1987
  disabled: n.conf.update.getDisabled(e, !0),
1988
1988
  ref_for: !0
1989
1989
  }, n.conf.update.getBind(e), z(n.conf.update.getOn(e, r)), { style: { width: "100%" } }), {
1990
- default: y(() => [
1990
+ default: g(() => [
1991
1991
  (d(!0), b($, null, A(e.options?.search?.select?.data || e.options?.select?.data, (s) => (d(), h(a(N), {
1992
1992
  key: s.value,
1993
1993
  label: s.label,
@@ -2044,7 +2044,7 @@ const lt = /* @__PURE__ */ X(tt, [["render", at]]), nt = { class: "row flex-cent
2044
2044
  }), ft = {
2045
2045
  class: "row form-item-content",
2046
2046
  style: { width: "100%" }
2047
- }, ct = { class: "col column form-item-content-item" }, mt = { class: "col" }, ht = ["innerHTML"], gt = /* @__PURE__ */ K({
2047
+ }, ct = { class: "col column form-item-content-item" }, mt = { class: "col" }, ht = ["innerHTML"], yt = /* @__PURE__ */ K({
2048
2048
  __name: "formColumn",
2049
2049
  props: {
2050
2050
  conf: {},
@@ -2056,7 +2056,7 @@ const lt = /* @__PURE__ */ X(tt, [["render", at]]), nt = { class: "row flex-cent
2056
2056
  prop: o.item.item.key,
2057
2057
  "label-width": o.item.item.text?.form?.label == "" ? 0 : o.item.item.form?.labelWidth || o.conf.option.form?.labelWidth
2058
2058
  }, {
2059
- default: y(() => [
2059
+ default: g(() => [
2060
2060
  E("div", ft, [
2061
2061
  C(o.$slots, "form-" + o.item.item.key + "-start", {
2062
2062
  row: o.conf.update.form,
@@ -2077,7 +2077,7 @@ const lt = /* @__PURE__ */ X(tt, [["render", at]]), nt = { class: "row flex-cent
2077
2077
  }), Q({ _: 2 }, [
2078
2078
  o.item.item.options?.input?.prepend ? {
2079
2079
  name: "prepend",
2080
- fn: y(() => [
2080
+ fn: g(() => [
2081
2081
  D(O(typeof o.item.item.options?.input?.prepend == "function" ? o.item.item.options?.input?.prepend(o.conf.update.form) : o.item.item.options?.input?.prepend), 1)
2082
2082
  ]),
2083
2083
  key: "0"
@@ -2096,7 +2096,7 @@ const lt = /* @__PURE__ */ X(tt, [["render", at]]), nt = { class: "row flex-cent
2096
2096
  disabled: o.conf.update.getDisabled(o.item.item),
2097
2097
  style: { width: "100%" }
2098
2098
  }), {
2099
- default: y(() => [
2099
+ default: g(() => [
2100
2100
  (d(!0), b($, null, A(o.conf.update.getBind(o.item.item).data, (n) => (d(), h(a(N), {
2101
2101
  key: n.value,
2102
2102
  label: n.label,
@@ -2112,7 +2112,7 @@ const lt = /* @__PURE__ */ X(tt, [["render", at]]), nt = { class: "row flex-cent
2112
2112
  disabled: o.conf.update.getDisabled(o.item.item),
2113
2113
  style: { width: "100%" }
2114
2114
  }), {
2115
- default: y(() => [
2115
+ default: g(() => [
2116
2116
  (d(!0), b($, null, A(o.conf.update.getBind(o.item.item).data, (n) => (d(), h(a(ne), {
2117
2117
  key: n.value,
2118
2118
  label: n.label,
@@ -2173,7 +2173,7 @@ const lt = /* @__PURE__ */ X(tt, [["render", at]]), nt = { class: "row flex-cent
2173
2173
  _: 3
2174
2174
  }, 8, ["label", "prop", "label-width"]));
2175
2175
  }
2176
- }), yt = {}, bt = {
2176
+ }), gt = {}, bt = {
2177
2177
  xmlns: "http://www.w3.org/2000/svg",
2178
2178
  viewBox: "64 64 896 896"
2179
2179
  };
@@ -2185,7 +2185,7 @@ function wt(i, o) {
2185
2185
  }, null, -1)
2186
2186
  ]));
2187
2187
  }
2188
- const kt = /* @__PURE__ */ X(yt, [["render", wt]]), vt = {}, Ct = {
2188
+ const kt = /* @__PURE__ */ X(gt, [["render", wt]]), vt = {}, Ct = {
2189
2189
  xmlns: "http://www.w3.org/2000/svg",
2190
2190
  viewBox: "64 64 896 896"
2191
2191
  };
@@ -2230,7 +2230,7 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2230
2230
  clearable: "",
2231
2231
  disabled: n.item.disabled?.search
2232
2232
  }, n.item.options?.search?.switch || n.item.options?.switch, z(n.item.options?.search?.switch?.on || n.item.options?.switch?.on || {})), {
2233
- default: y(() => [
2233
+ default: g(() => [
2234
2234
  (d(), h(a(N), {
2235
2235
  key: n.item.options?.switch?.activeValue,
2236
2236
  label: n.item.options?.switch?.activeText,
@@ -2251,7 +2251,7 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2251
2251
  clearable: "",
2252
2252
  disabled: n.item.disabled?.search
2253
2253
  }, n.item.options?.search?.select || n.item.options?.select, z(n.item.options?.search?.select?.on || n.item.options?.select?.on || {})), {
2254
- default: y(() => [
2254
+ default: g(() => [
2255
2255
  (d(!0), b($, null, A(n.item.options?.search?.select?.data || n.item.options?.select?.data || [], (t) => (d(), h(a(N), {
2256
2256
  key: t.value,
2257
2257
  label: t.label,
@@ -2265,7 +2265,7 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2265
2265
  "onUpdate:modelValue": l[4] || (l[4] = (t) => p.value = t),
2266
2266
  disabled: n.item.disabled?.search
2267
2267
  }, n.item.options?.search?.radio || n.item.options?.radio, z(n.item.options?.search?.radio?.on || n.item.options?.radio?.on || {})), {
2268
- default: y(() => [
2268
+ default: g(() => [
2269
2269
  (d(!0), b($, null, A(n.item.options?.radio?.data, (t) => (d(), h(a(ne), {
2270
2270
  key: t.value,
2271
2271
  label: t.label,
@@ -2331,7 +2331,7 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2331
2331
  inline: "",
2332
2332
  size: i.option.size?.search
2333
2333
  }, {
2334
- default: y(() => [
2334
+ default: g(() => [
2335
2335
  C(m.$slots, "search-start", {
2336
2336
  row: a(t).search.form
2337
2337
  }),
@@ -2345,7 +2345,7 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2345
2345
  key: 0,
2346
2346
  label: f.text?.search?.label ?? f.label
2347
2347
  }, {
2348
- default: y(() => [
2348
+ default: g(() => [
2349
2349
  C(m.$slots, "search-" + f.key + "-left", {
2350
2350
  row: a(t).search.form
2351
2351
  }),
@@ -2378,13 +2378,13 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2378
2378
  row: a(t).search.form
2379
2379
  }),
2380
2380
  i.option.tools?.search || i.option.tools?.reset ? (d(), h(a(te), { key: 0 }, {
2381
- default: y(() => [
2381
+ default: g(() => [
2382
2382
  i.option.tools?.search ? (d(), h(a(L), {
2383
2383
  key: 0,
2384
2384
  type: "primary",
2385
2385
  onClick: a(t).search.submit
2386
2386
  }, {
2387
- default: y(() => [
2387
+ default: g(() => [
2388
2388
  D(O(a(w).tCurd("search")), 1)
2389
2389
  ]),
2390
2390
  _: 1
@@ -2393,7 +2393,7 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2393
2393
  key: 1,
2394
2394
  onClick: a(t).search.reset
2395
2395
  }, {
2396
- default: y(() => [
2396
+ default: g(() => [
2397
2397
  D(O(a(w).tCurd("reset")), 1)
2398
2398
  ]),
2399
2399
  _: 1
@@ -2416,7 +2416,7 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2416
2416
  onClick: c[0] || (c[0] = (f) => a(t).update.open(a(p).Add)),
2417
2417
  size: i.option.size?.search
2418
2418
  }, {
2419
- default: y(() => [
2419
+ default: g(() => [
2420
2420
  D(O(a(w).tCurd("add")), 1)
2421
2421
  ]),
2422
2422
  _: 1
@@ -2428,7 +2428,7 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2428
2428
  onClick: c[1] || (c[1] = (f) => a(t).remove.open(a(t).table.selection.list)),
2429
2429
  size: i.option.size?.search
2430
2430
  }, {
2431
- default: y(() => [
2431
+ default: g(() => [
2432
2432
  D(O(a(w).tCurd("delete")), 1)
2433
2433
  ]),
2434
2434
  _: 1
@@ -2440,27 +2440,27 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2440
2440
  onClick: c[2] || (c[2] = (f) => a(t).table.expand.all()),
2441
2441
  size: i.option.size?.search
2442
2442
  }, {
2443
- default: y(() => [
2443
+ default: g(() => [
2444
2444
  D(O(a(w).tCurd("expandCollapse")), 1)
2445
2445
  ]),
2446
2446
  _: 1
2447
2447
  }, 8, ["size"])
2448
2448
  ])) : v("", !0),
2449
2449
  i.option.tools?.export?.show ? (d(), b($, { key: 3 }, [
2450
- i.option.tools?.export?.dropdown?.show ? (d(), h(a(ye), {
2450
+ i.option.tools?.export?.dropdown?.show ? (d(), h(a(ge), {
2451
2451
  key: 0,
2452
2452
  onCommand: a(t).export.click
2453
2453
  }, {
2454
- dropdown: y(() => [
2454
+ dropdown: g(() => [
2455
2455
  U(a(be), {
2456
2456
  size: i.option.size?.search
2457
2457
  }, {
2458
- default: y(() => [
2458
+ default: g(() => [
2459
2459
  i.option.tools?.export?.dropdown?.select && (i.option.table?.selectable || a(l)(i.option.tools?.delete)) ? (d(), h(a(oe), {
2460
2460
  key: 0,
2461
2461
  command: "select"
2462
2462
  }, {
2463
- default: y(() => [
2463
+ default: g(() => [
2464
2464
  D(O(a(w).tCurd("exportSelect")), 1)
2465
2465
  ]),
2466
2466
  _: 1
@@ -2469,7 +2469,7 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2469
2469
  key: 1,
2470
2470
  command: "page"
2471
2471
  }, {
2472
- default: y(() => [
2472
+ default: g(() => [
2473
2473
  D(O(a(w).tCurd("exportPage")), 1)
2474
2474
  ]),
2475
2475
  _: 1
@@ -2478,7 +2478,7 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2478
2478
  key: 2,
2479
2479
  command: "all"
2480
2480
  }, {
2481
- default: y(() => [
2481
+ default: g(() => [
2482
2482
  D(O(a(w).tCurd("exportAll")), 1)
2483
2483
  ]),
2484
2484
  _: 1
@@ -2487,14 +2487,14 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2487
2487
  _: 1
2488
2488
  }, 8, ["size"])
2489
2489
  ]),
2490
- default: y(() => [
2490
+ default: g(() => [
2491
2491
  E("div", Mt, [
2492
2492
  U(a(L), {
2493
2493
  type: "warning",
2494
2494
  loading: a(t).export.loading,
2495
2495
  size: i.option.size?.search
2496
2496
  }, {
2497
- default: y(() => [
2497
+ default: g(() => [
2498
2498
  D(O(a(w).tCurd("export")), 1)
2499
2499
  ]),
2500
2500
  _: 1
@@ -2509,7 +2509,7 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2509
2509
  size: i.option.size?.search,
2510
2510
  onClick: c[3] || (c[3] = (f) => a(t).export.run.start("all"))
2511
2511
  }, {
2512
- default: y(() => [
2512
+ default: g(() => [
2513
2513
  D(O(a(w).tCurd("export")), 1)
2514
2514
  ]),
2515
2515
  _: 1
@@ -2541,7 +2541,7 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2541
2541
  content: a(t).table.header.group.expand ? a(w).tCurd("mergeColumn") : a(w).tCurd("expandColumn"),
2542
2542
  placement: "top"
2543
2543
  }, {
2544
- default: y(() => [
2544
+ default: g(() => [
2545
2545
  E("div", {
2546
2546
  class: I(["refresh-btn", [i.option.size?.search]]),
2547
2547
  onClick: c[6] || (c[6] = //@ts-ignore
@@ -2578,7 +2578,7 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2578
2578
  "expand-row-keys": a(t).table.expand.rowKeys,
2579
2579
  onExpandChange: a(t).table.expand.change
2580
2580
  }, i.option.table, z(i.option.table?.on || {})), {
2581
- default: y(() => [
2581
+ default: g(() => [
2582
2582
  (typeof i.option.table?.selectable == "object" ? i.option.table?.selectable?.show : i.option.table?.selectable) || a(l)(i.option.tools?.delete) || i.option.tools?.export?.show && i.option.tools?.export?.select ? (d(), h(a(ee), V({
2583
2583
  key: 0,
2584
2584
  type: "selection",
@@ -2603,10 +2603,10 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2603
2603
  columnList: a(t).table.column.list,
2604
2604
  option: i.option
2605
2605
  }, Q({ _: 2 }, [
2606
- A(m.$slots, (f, g) => ({
2607
- name: g,
2608
- fn: y((S) => [
2609
- C(m.$slots, g, $e(De(S || {})))
2606
+ A(m.$slots, (f, y) => ({
2607
+ name: y,
2608
+ fn: g((S) => [
2609
+ C(m.$slots, y, $e(De(S || {})))
2610
2610
  ])
2611
2611
  }))
2612
2612
  ]), 1032, ["conf", "columnList", "option"]),
@@ -2617,16 +2617,16 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2617
2617
  align: "center",
2618
2618
  fixed: "right"
2619
2619
  }, i.option.table?.operate, { "show-overflow-tooltip": !1 }), {
2620
- header: y(() => [
2620
+ header: g(() => [
2621
2621
  C(m.$slots, "table-header-op", {}, () => [
2622
2622
  D(O(a(w).tCurd("operation")), 1)
2623
2623
  ])
2624
2624
  ]),
2625
- default: y(({ row: f }) => [
2625
+ default: g(({ row: f }) => [
2626
2626
  U(a(q), {
2627
2627
  size: i.option.size?.table
2628
2628
  }, {
2629
- default: y(() => [
2629
+ default: g(() => [
2630
2630
  C(m.$slots, "table-op-left", { row: f }),
2631
2631
  a(t).update.type === a(p).Update && i.option.table?.inlineEdit && a(t).update.form[n.option.table?.rowKey] === f[n.option.table?.rowKey] ? (d(), b($, { key: 0 }, [
2632
2632
  U(a(L), {
@@ -2634,7 +2634,7 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2634
2634
  type: "info",
2635
2635
  onClick: a(t).update.close
2636
2636
  }, {
2637
- default: y(() => [
2637
+ default: g(() => [
2638
2638
  D(O(a(w).tCurd("cancel")), 1)
2639
2639
  ]),
2640
2640
  _: 1
@@ -2645,7 +2645,7 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2645
2645
  onClick: a(t).update.submit,
2646
2646
  loading: a(t).update.loading
2647
2647
  }, {
2648
- default: y(() => [
2648
+ default: g(() => [
2649
2649
  D(O(a(w).tCurd("confirm")), 1)
2650
2650
  ]),
2651
2651
  _: 1
@@ -2656,9 +2656,9 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2656
2656
  key: 0,
2657
2657
  link: "",
2658
2658
  type: "primary",
2659
- onClick: (g) => a(t).update.open(a(p).Add, f)
2659
+ onClick: (y) => a(t).update.open(a(p).Add, f)
2660
2660
  }, {
2661
- default: y(() => [
2661
+ default: g(() => [
2662
2662
  D(O(a(w).tCurd("add")), 1)
2663
2663
  ]),
2664
2664
  _: 2
@@ -2667,9 +2667,9 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2667
2667
  key: 1,
2668
2668
  link: "",
2669
2669
  type: "primary",
2670
- onClick: (g) => a(t).update.open(a(p).View, f)
2670
+ onClick: (y) => a(t).update.open(a(p).View, f)
2671
2671
  }, {
2672
- default: y(() => [
2672
+ default: g(() => [
2673
2673
  D(O(a(w).tCurd("view")), 1)
2674
2674
  ]),
2675
2675
  _: 2
@@ -2678,9 +2678,9 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2678
2678
  key: 2,
2679
2679
  link: "",
2680
2680
  type: "warning",
2681
- onClick: (g) => a(t).update.open(a(p).Update, f)
2681
+ onClick: (y) => a(t).update.open(a(p).Update, f)
2682
2682
  }, {
2683
- default: y(() => [
2683
+ default: g(() => [
2684
2684
  D(O(a(w).tCurd("edit")), 1)
2685
2685
  ]),
2686
2686
  _: 2
@@ -2689,9 +2689,9 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2689
2689
  key: 3,
2690
2690
  link: "",
2691
2691
  type: "danger",
2692
- onClick: (g) => a(t).remove.open([f])
2692
+ onClick: (y) => a(t).remove.open([f])
2693
2693
  }, {
2694
- default: y(() => [
2694
+ default: g(() => [
2695
2695
  D(O(a(w).tCurd("delete")), 1)
2696
2696
  ]),
2697
2697
  _: 2
@@ -2737,16 +2737,16 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2737
2737
  title: a(t).update.title,
2738
2738
  "before-close": a(t).update.close
2739
2739
  }, i.option.dialog), {
2740
- footer: y(() => [
2740
+ footer: g(() => [
2741
2741
  E("span", Lt, [
2742
2742
  U(a(q), {
2743
2743
  size: i.option.size?.form
2744
2744
  }, {
2745
- default: y(() => [
2745
+ default: g(() => [
2746
2746
  U(a(L), {
2747
2747
  onClick: a(t).update.close
2748
2748
  }, {
2749
- default: y(() => [
2749
+ default: g(() => [
2750
2750
  D(O(a(w).tCurd("close")), 1)
2751
2751
  ]),
2752
2752
  _: 1
@@ -2757,7 +2757,7 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2757
2757
  onClick: a(t).update.submit,
2758
2758
  loading: a(t).update.loading
2759
2759
  }, {
2760
- default: y(() => [
2760
+ default: g(() => [
2761
2761
  D(O(a(w).tCurd("submit")), 1)
2762
2762
  ]),
2763
2763
  _: 1
@@ -2767,7 +2767,7 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2767
2767
  }, 8, ["size"])
2768
2768
  ])
2769
2769
  ]),
2770
- default: y(() => [
2770
+ default: g(() => [
2771
2771
  U(a(q), {
2772
2772
  ref_key: "ruleFormRef",
2773
2773
  ref: r,
@@ -2776,14 +2776,14 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2776
2776
  size: i.option.size?.form,
2777
2777
  class: "update-dialog-form"
2778
2778
  }, {
2779
- default: y(() => [
2779
+ default: g(() => [
2780
2780
  a(t).update.showContent ? (d(!0), b($, { key: 0 }, A(a(t).update.formColumn, (f) => (d(), b($, null, [
2781
2781
  a(l)(
2782
2782
  (() => {
2783
- const g = [], S = (B) => {
2784
- B?.item?.children ? S(B.item.children) : g.push(...B.map((F) => F.item?.show?.form));
2783
+ const y = [], S = (B) => {
2784
+ B?.item?.children ? S(B.item.children) : y.push(...B.map((F) => F.item?.show?.form));
2785
2785
  };
2786
- return S(f), g;
2786
+ return S(f), y;
2787
2787
  })(),
2788
2788
  a(t).update.form,
2789
2789
  a(t).update.type
@@ -2796,19 +2796,19 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2796
2796
  C(m.$slots, "form-start", {
2797
2797
  row: a(t).update.form
2798
2798
  }),
2799
- (d(!0), b($, null, A(f, (g) => (d(), b($, null, [
2800
- a(l)(g.item.show?.form, a(t).update.form, a(t).update.type) ? (d(), b("div", {
2799
+ (d(!0), b($, null, A(f, (y) => (d(), b($, null, [
2800
+ a(l)(y.item.show?.form, a(t).update.form, a(t).update.type) ? (d(), b("div", {
2801
2801
  key: 0,
2802
- class: I([g.item.form.span > 0 ? `col-${a(t).getColumnSpan(g, f)}` : "col", `form-item-col-${g.item.key}`])
2802
+ class: I([y.item.form.span > 0 ? `col-${a(t).getColumnSpan(y, f)}` : "col", `form-item-col-${y.item.key}`])
2803
2803
  }, [
2804
- (d(!0), b($, null, A(g.item.children ? g.children : [g], (S) => (d(), h(gt, {
2804
+ (d(!0), b($, null, A(y.item.children ? y.children : [y], (S) => (d(), h(yt, {
2805
2805
  key: S.item.key,
2806
2806
  conf: a(t),
2807
2807
  item: S
2808
2808
  }, Q({ _: 2 }, [
2809
2809
  A(m.$slots, (B, F) => ({
2810
2810
  name: F,
2811
- fn: y((R) => [
2811
+ fn: g((R) => [
2812
2812
  C(m.$slots, F, V({ ref_for: !0 }, R || {}))
2813
2813
  ])
2814
2814
  }))
@@ -2832,16 +2832,16 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2832
2832
  title: a(t).remove.title,
2833
2833
  "close-on-click-modal": !1
2834
2834
  }, {
2835
- footer: y(() => [
2835
+ footer: g(() => [
2836
2836
  E("span", Rt, [
2837
2837
  U(a(q), {
2838
2838
  size: i.option.size?.form
2839
2839
  }, {
2840
- default: y(() => [
2840
+ default: g(() => [
2841
2841
  U(a(L), {
2842
2842
  onClick: a(t).remove.close
2843
2843
  }, {
2844
- default: y(() => [
2844
+ default: g(() => [
2845
2845
  D(O(a(w).tCurd("close")), 1)
2846
2846
  ]),
2847
2847
  _: 1
@@ -2851,7 +2851,7 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2851
2851
  onClick: a(t).remove.submit,
2852
2852
  loading: a(t).remove.loading
2853
2853
  }, {
2854
- default: y(() => [
2854
+ default: g(() => [
2855
2855
  D(O(a(w).tCurd("confirmDelete")), 1)
2856
2856
  ]),
2857
2857
  _: 1
@@ -2861,7 +2861,7 @@ const zt = /* @__PURE__ */ X(vt, [["render", Vt]]), ue = /* @__PURE__ */ K({
2861
2861
  }, 8, ["size"])
2862
2862
  ])
2863
2863
  ]),
2864
- default: y(() => [
2864
+ default: g(() => [
2865
2865
  i.option.dialog?.delete?.content ? (d(), b("div", jt, [
2866
2866
  U(qe, {
2867
2867
  content: i.option.dialog?.delete?.content,
@@ -1 +1 @@
1
- (function(C,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("element-plus"),require("vue-router"),require("vue")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue-router","vue"],h):(C=typeof globalThis<"u"?globalThis:C||self,h(C.cc1Form={},C.ElementPlus,C.VueRouter,C.Vue))})(this,(function(C,h,Xe,e){"use strict";class b{static router;static routes;static getRouterPath=()=>this.router.currentRoute.value.path;static EDialog={Add:"Add",Update:"Update",View:"View",Remove:"Remove"};static isFun=(n,...c)=>Array.isArray(n)?n.some(l=>typeof l=="function"?l(...c):l):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(!b.moduleObj[n])throw new Error(`模块${n}未加载,请赋值如:TSys.moduleObj = { ${n}: ()=>import('${n}') }`);const c=await b.moduleObj[n]();return c.default??c};static tipMessages={};static tipMessagesGap=500;static showMessage(n,c,l={}){const a=Date.now();if(!this.tipMessages[n]||a-this.tipMessages[n]>this.tipMessagesGap){this.tipMessages[n]=a;const o=Object.assign({message:n,type:c},l);h.ElMessage(o),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=h.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 l=screen.width/2-500,a=screen.height/2-800/2-30;window.open(n,"_blank","toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top="+a+", left="+l)}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,l)=>{let a=document.getElementById(n.id);const o=await b.loadModule("html2canvas");try{o(a,{logging:!1,allowTaint:!0,scale:window.devicePixelRatio,width:n.windowWidth,height:n.windowHeight,windowWidth:n.windowWidth,windowHeight:n.windowHeight,useCORS:!0,backgroundColor:"#ffffff00"}).then(function(t){let i=t.toDataURL("image/png");c(i)})}catch(t){l(t)}})}class w{static config={field:{page:{num:"num",size:"size"},result:{list:"list",pages:"pages",num:"num",size:"size",total:"total"}},dialog:{width:"980px",closeOnClickModal:!1},pagination:{layout:"total, sizes, prev, pager, next, jumper",pageSizes:[10,20,50,100],size:10,pagerCount:7,showTools:!1},size:{table:"default",form:"default",search:"default"},tools:{expandColumn:!1,refresh:!0,expand:!1,search:!0,reset:!0,add:!0,delete:!0,export:{show:!0,dropdown:{show:!0,select:!0,page:!0,all:!0},fileName:"Export Data "}},form:{size:"default",labelWidth:"120px",stripe:!0,editAll:!1,maxSpan:12,defaultSpan:6,openBefore:void 0,openAfter:void 0,closeBefore:void 0,submitBefore:void 0,submitAfter:void 0},table:{index:!1,labelWidth:"100px",size:"default",emptyText:"",headerCellClassName:"table-header",rowKey:"_id",highlightCurrentRow:!0,border:!0,selectable:!1,column:[],showOverflowTooltip:!0,showSummary:!1,summaryMethod:()=>[],inlineEdit:!1,operate:{width:void 0},add:!1,update:!0,delete:!0,sort:{props:{field:"sortField"},order:{field:"sortOrder",asc:"asc",desc:"desc"},resetPage:!1,change:void 0},fitHeight:!0},columnConfig:{type:"input",form:{width:"100%",spanCol:!1},table:{table:!0,minWidth:120,width:void 0,fixed:void 0,align:"center",showOverflowTooltip:!0,format:void 0,click:{callback:void 0,color:"#409EFF"},tooltip:void 0},show:{table:!0,search:!1,form:!0},sort:{search:0,table:0,form:0},disabled:{view:!0},options:{switch:{activeValue:!0,inactiveValue:!1,tableConfig:{change:!0,confirm:!0,loadList:!0}},treeSelect:{multiple:!0,renderAfterExpand:!1,showCheckbox:!0,checkStrictly:!0,checkOnClickNode:!0,props:{label:"title",children:"children"}},datetime:{type:"datetime"},select:{data:[],clearable:!0,filterable:!0,dataPath:"data.data",dataApiConfig:{once:!0,init:!0,create:!0,update:!0}},radio:{data:[],dataPath:"data.data",dataApiConfig:{once:!0,init:!0,create:!0,update:!0}}}}};static setConfig=n=>{w.config=ObjectUtil.deepMerge(w.config,n)}}class B{static customComponent={};static findOptions=(n,c)=>{const l=n.column.find(o=>o.key===c),a=o=>o.replace(/-([a-z])/g,(t,i)=>i.toUpperCase());if(l)return l.options[a(l.type)]};static setOptionsData=(n,c,l)=>{const a=B.findOptions(n,c);a&&(a.data=l)};static form={openBefore:{parentId:(n,c,l,a)=>{const o=w.config.table.rowKey;n?c.type===b.EDialog.Add?(c.form.parentId=n[o],c.form.sort=n.children.length+1):c.form.parentId=n.parentId.substring(n.parentId.lastIndexOf(",")+1):(c.form.parentId="0",c.form.sort=l.length+1),B.setOptionsData(a,"parentId",[{[o]:"0",title:"根",children:l}])}}}}function Ye(r){return r}const H={search:"搜索",add:"新增",edit:"编辑",view:"查看",delete:"删除",export:"导出",exportSelect:"导出选中",exportPage:"导出本页",exportAll:"导出全部",import:"导入",refresh:"刷新",reset:"重置",expandCollapse:"展开/收缩",operation:"操作",close:"关闭",cancel:"取消",submit:"提交",confirm:"确认",deleteTitle:"删除提示",confirmDelete:"确认删除",confirmDeleteMessage:"确认要删除【{count}】条数据吗?",placeholderInput:"请输入",placeholderSelect:"请选择",checkFormData:"请检查表单数据",selectDataToDelete:"请选择要删除的数据",selectDataToExport:"请选择要导出的数据",noData:"暂无数据",operationSuccess:"操作成功",switchOn:"开启",switchOff:"关闭",confirmModify:"确认修改",confirmSwitchMessage:"确认要修改吗?",mergeColumn:"合并栏位",expandColumn:"展开栏位"};class y{static t(n,...c){if(typeof n=="function")return n(...c);n=String(n);let l=0;return n.replace(/{([^}]+)}/g,(a,o)=>l<c.length?String(c[l++]):`{${o}}`)}static setI18n=n=>{y.curd=ObjectUtil.deepMerge(y.curd,n)};static tCurd(n,...c){return this.t(this.curd[n],...c)}static curd=H}class N{static getIdFun=()=>StrUtil.uuid();static setId=(n,c,l)=>{c[n]||(c[n]=[]);const a=w.config.table.rowKey;c[n].forEach(o=>{l.forEach(t=>{let i=t.default??"";t.type==="number"&&(i=t.default??0),t.type==="boolean"&&(i=t.default??!1),t.type==="time"&&(i=t.default??new Date),o[t.value]===void 0&&(o[t.value]=i)}),o[a]||(o[a]=N.getIdFun())})};static add=(n,c,l,a)=>{const o=JSONUtil.cp(l);N.setId(n,c,l);const t=w.config.table.rowKey;c[n].push(o.reduce((i,d)=>{let m=d.default??"";return d.type==="number"&&(m=d.default??0),d.type==="boolean"&&(m=d.default??!1),d.type==="time"&&(m=d.default??new Date),i[d.value]=m,i},{[t]:N.getIdFun()})),a?.(c)};static remove=(n,c,l,a)=>{const o=w.config.table.rowKey;c[n]=c[n].filter(t=>t[o]!==l[o]),a?.(c)};static getNoIdData=(n,c)=>{const l=JSONUtil.cp(n),a=w.config.table.rowKey;return l.forEach(o=>{o[a]&&delete o[a],c&&o[c]&&N.getNoIdData(o[c],c)}),l}}const A={key:0,class:"column curd-form-com-list",style:{width:"100%",gap:"10px"}},j={key:0},I={class:"row items-center",style:{gap:"10px",width:"100%"}},R={key:1},T=e.defineComponent({__name:"list",props:{row:{default:{}},label:{default:"label"},value:{default:"value"},itemFields:{default:[{label:"label",value:"label"},{label:"value",value:"value"}]},field:{default:"value"},inputWidth:{default:"120px"},inputClass:{default:""},addBottom:{default:!1}},emits:["change"],setup(r,{emit:n}){const c=r,l=e.reactive({show:!1,add:(o,t,i)=>{N.add(o,t,i,()=>{a("change")})},remove:(o,t,i)=>{N.remove(o,t,i,()=>{a("change")})}});e.onMounted(()=>{N.setId(c.field,c.row,c.itemFields),l.show=!0});const a=n;return(o,t)=>{const i=e.resolveComponent("el-button"),d=e.resolveComponent("el-input");return l.show?(e.openBlock(),e.createElementBlock("div",A,[e.renderSlot(o.$slots,"list-start",{row:r.row}),r.addBottom?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",j,[e.createVNode(i,{link:"",type:"primary",onClick:t[0]||(t[0]=m=>l.add(r.field,r.row,r.itemFields))},{default:e.withCtx(()=>t[3]||(t[3]=[e.createTextVNode("添加")])),_:1})])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.row[r.field],m=>(e.openBlock(),e.createElementBlock("div",I,[e.renderSlot(o.$slots,"item-start",{item:m,row:r.row}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.itemFields,p=>(e.openBlock(),e.createBlock(d,{modelValue:m[p.value],"onUpdate:modelValue":s=>m[p.value]=s,style:e.normalizeStyle({width:r.inputWidth}),class:e.normalizeClass(r.inputClass),placeholder:p[r.label]||p[r.value],onChange:t[1]||(t[1]=s=>a("change"))},null,8,["modelValue","onUpdate:modelValue","style","class","placeholder"]))),256)),e.renderSlot(o.$slots,"item-end",{item:m,row:r.row}),e.createVNode(i,{link:"",type:"danger",onClick:p=>l.remove(r.field,r.row,m)},{default:e.withCtx(()=>t[4]||(t[4]=[e.createTextVNode("删除")])),_:2},1032,["onClick"])]))),256)),r.addBottom?(e.openBlock(),e.createElementBlock("div",R,[e.createVNode(i,{link:"",type:"primary",onClick:t[2]||(t[2]=m=>l.add(r.field,r.row,r.itemFields))},{default:e.withCtx(()=>t[5]||(t[5]=[e.createTextVNode("添加")])),_:1})])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"list-end",{row:r.row})])):e.createCommentVNode("",!0)}}}),K={class:"row form-item-content",style:{width:"100%"}},x={class:"col"},W={class:"col"},q=["innerHTML"],F=e.defineComponent({__name:"column",props:{option:{default:{}},type:{default:""}},setup(r,{expose:n}){const c=b.isFun,l=b.EDialog,a=e.ref(),o=r,t=e.reactive({rules:{},show:!0,form:{},formDefault:{},type:o.type||l.Add,formColumn:[],getDisabled:i=>t.type===l.View?i.disabled?.view===void 0?!0:i.disabled?.view:i.disabled?.[t.type===l.Add?"create":"update"],getBind:i=>i.options?.[t.type===l.Add?"formAdd":"formUpdate"]?.[i.type]||i.options?.[i.type]||{},getOn:i=>i.options?.[t.type===l.Add?"formAdd":"formUpdate"]?.[i.type]?.on||i.options?.[i.type]?.on||{},getColumnSpan:(i,d)=>{if(i.item.form?.spanCol){const m=o.option.form?.maxSpan||12,p=o.option.form?.defaultSpan||m/2,k=d.filter(f=>!b.isFun(f.item.show?.form,t.form,t.type)).reduce((f,g)=>f+(g.item.form?.span||p),0);return(i.item.form?.span||p)+k}return i.item.form?.span},initColumnForm:()=>{const i=o.option;t.formColumn=[],t.rules={},t.formDefault={};const d=[],m=o.option.form?.maxSpan||12,p=o.option.form?.defaultSpan||m/2;let s=[];const k=g=>{if(g.children){g.children.forEach(u=>{k(u)});return}if(t.formDefault[g.key]=g.value,g.isForm&&(typeof g.show?.form!="boolean"||g.show?.form)){g.form=g.form||{span:p},g.form.span=g.form.span??p;const u=g.form.span,E=s.reduce((S,$)=>S+$.span,u),V=s.length;if(s.push({item:g,span:u}),(V===1&&s[0].span===0||E>=m||u===0&&V>1)&&(d.push(s),s=[]),g.rules){const S={input:y.tCurd("placeholderInput"),select:y.tCurd("placeholderSelect")},$=(S[g.type]||S.input)+g.label;t.rules[g.key]=typeof g.rules=="boolean"?[{required:!0,message:$,trigger:"blur"}]:g.rules}}},f=(g,u)=>{g.isForm=u,Array.isArray(g.children)&&g.children.forEach(E=>f(E,u))};i.column.forEach(g=>{f(g,!0),k(g)}),s.length>0&&d.push(s),t.formColumn=d,t.form=JSONUtil.cp(t.formDefault)}});return t.initColumnForm(),n({ref:a,conf:t}),(i,d)=>(e.openBlock(),e.createBlock(e.unref(h.ElForm),{ref_key:"ruleFormRef",ref:a,model:t.form,rules:t.rules},{default:e.withCtx(()=>[t.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.formColumn,(m,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:p},[e.unref(c)(m.map(s=>s.item?.show?.form),t.form,t.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:r.option.form?.stripe===void 0?!0:r.option.form?.stripe}])},[e.renderSlot(i.$slots,"form-start",{row:t.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m,s=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s.item.key},[e.unref(c)(s.item.show?.form,t.form,t.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([s.item.form.span>0?`col-${t.getColumnSpan(s,m)}`:"col",`form-item-col-${s.item.key}`])},[e.createVNode(e.unref(h.ElFormItem),{label:s.item.text?.form?.label??s.item.label,prop:s.item.key,"label-width":s.item.text?.form?.label==""?0:s.item.form?.labelWidth||r.option.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.createElementVNode("div",K,[e.renderSlot(i.$slots,"form-"+s.item.key+"-start",{row:t.form,item:s.item}),e.createElementVNode("div",x,[e.createElementVNode("div",W,[e.renderSlot(i.$slots,"form-"+s.item.key,{row:t.form,item:s.item},()=>[s.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(h.ElInput),e.mergeProps({key:0,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):s.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(h.ElSwitch),e.mergeProps({key:1,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):s.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:2,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.item.options?.select?.data,k=>(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:k.value,label:k.label,value:k.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):s.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(h.ElRadioGroup),e.mergeProps({key:3,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.item.options?.radio?.data,k=>(e.openBlock(),e.createBlock(e.unref(h.ElRadio),{key:k.value,label:k.label,value:k.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):s.item.type==="list"?(e.openBlock(),e.createBlock(T,e.mergeProps({key:4,row:t.form,field:s.item.key,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):s.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(h.ElTreeSelect),e.mergeProps({key:5,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item),style:{width:"100%"}}),null,16,["modelValue","onUpdate:modelValue","disabled"])):s.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(h.ElDatePicker),e.mergeProps({key:6,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):s.item.type&&(e.unref(B).customComponent[s.item.type]||e.unref(B).customComponent[s.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[s.item.type]?.form||e.unref(B).customComponent[s.item.type]),e.mergeProps({key:7,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(i.$slots,"form-"+s.item.key+"-right",{row:t.form,item:s.item})]),e.renderSlot(i.$slots,"form-"+s.item.key+"-tip",{row:t.form,item:s.item},()=>[s.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof s.item.form?.tipText=="function"?s.item.form?.tipText(t.form,t.type):s.item.form?.tipText},null,8,q)):e.createCommentVNode("",!0)])]),e.renderSlot(i.$slots,"form-"+s.item.key+"-end",{row:t.form,item:s.item})])]),_:2},1032,["label","prop","label-width"])],2)):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(i.$slots,"form-end",{row:t.form})],2)):e.createCommentVNode("",!0)],64))),128)):e.createCommentVNode("",!0)]),_:3},8,["model","rules"]))}});class O{static exportToExcel=async(n,c,l)=>{if(!n||n.length===0)return;const a=await b.loadModule("xlsx"),o=n.map(d=>{const m={};return c.forEach(p=>{m[p.label]=d[p.key]}),m}),t=a.utils.json_to_sheet(o),i=a.utils.book_new();a.utils.book_append_sheet(i,t,"Sheet1"),l?typeof l=="function"&&(l=l()):l=`导出数据_${new Date().Format("yyyy-MM-dd")}_${new Date().getTime()}`,a.writeFile(i,`${l}.xlsx`)}}const D=b.EDialog,G=r=>{const n=e.ref(),c=e.ref(),l=e.ref(),a=e.reactive({option:r.option,search:{column:{list:[]},form:{},formDefault:{},getPlaceholder:(o,t=y.tCurd("placeholderInput"))=>o.text?.search?.placeholder===void 0?`${t}${o.label}`:o.text?.search?.placeholder,getFormData:()=>{let o={};r.option.column.forEach(i=>{(typeof i.show?.search=="function"?i.show?.search(a.search.form):i.show?.search)&&(o[i.key]=a.search.form[i.key])});const t=r.option.search?.before?.(o);return t&&(o=t),o},reset:()=>{const o=a.search.formDefault;Object.keys(o).forEach(t=>{r.option.search?.resetMode==="none"?o[t]=void 0:o[t]=a.search.formDefault[t]}),a.search.form=ObjectUtil.deepMerge(o,{}),a.page.num=1,r.option.init!==!1&&a.table.getList()},submit:()=>{a.page.num=1,a.table.getList()}},page:{num:1,total:0,layout:r.option.page?.layout||w.config.pagination.layout,showTools:r.option.page?.showTools||w.config.pagination.showTools,size:r.option.page?.size||w.config.pagination.size,sizeList:r.option.page?.sizeList||w.config.pagination.pageSizes,pagerCount:r.option.page?.pagerCount||w.config.pagination.pagerCount,getQuery:(o={})=>({[w.config.field.page.size]:o.size||a.page.size,[w.config.field.page.num]:o.num||a.page.num,...a.search.getFormData()})},table:{op:{width:(...o)=>o.filter(i=>i).length*30+60},loading:!1,data:[],expand:{isExpand:!1,rowKeys:[],change:(o,t)=>{},all:()=>{if(a.table.expand.isExpand)a.table.expand.rowKeys=[];else{const o=t=>{let i=[];return t.forEach(d=>{i.push(d[r.option.table.rowKey]),d.children&&d.children.length>0&&(i=i.concat(o(d.children)))}),i};a.table.expand.rowKeys=o(a.table.data)}a.table.expand.isExpand=!a.table.expand.isExpand}},column:{list:[],show:{listSource:[],list:[]}},header:{group:{expand:!1,toggleExpandAll:()=>{const o=!a.table.header.group.expand;a.table.header.group.expand=o;const t=i=>{i.forEach(d=>{d.table?.header?.group!==void 0&&(d.table.header.group=!o),d.table?.header?.groupKey!==void 0&&(d.table.header.show=o),Array.isArray(d.children)&&d.children.length>0&&t(d.children)})};t(a.table.column.list)}}},getList:async()=>{a.table.loading=!0;const o=r.option.api.list;try{await a.initApiData("init");let t={};if(a.table.sort.prop){const{props:g,order:u}=w.config.table.sort;t={[g.field]:a.table.sort.prop,[u.field]:a.table.sort.order}}const i=await o({...a.page.getQuery(),...t}),d=w.config.field.result,m=i.data||{[d.list]:i};let p=(Array.isArray(m[d.list]),m[d.list]);const s=a.update.formColumn.flat(),f=ObjectUtil.deepMerge({data:p},{}).data.map(g=>(Object.keys(g).forEach(E=>{const V=s.find(S=>S.item.key===E);V&&["select","radio"].includes(V.item.type)&&(V.item.table.format||(V.item.table.format=S=>V.item.options[V.item.type].data?.find($=>$.value==S[E])?.label||S[E]))}),g));a.table.data=r.option.data?await r.option.data(f,p):f,a.page.total=m[d.total]||0}catch(t){console.error(t)}finally{a.table.loading=!1}},selection:{list:[],change:o=>{a.table.selection.list=o},setList:(o,t)=>{a.table.selection.list=[];const i=l.value;if(i?.clearSelection(),!i||!o?.length)return;const d=r.option.table?.rowKey,m=a.table.data,p=s=>{const k=f=>{for(const g of f){if(d!=null&&d!==""){if(g[d]===s[d])return g}else if(g===s)return g;if(Array.isArray(g.children)&&g.children.length){const u=k(g.children);if(u!==void 0)return u}}};return k(m)};e.nextTick(()=>{o.forEach(s=>{const k=p(s)??s;if(t){const f=()=>{i.toggleRowSelection(k,!0,!1)};t(s)!==!1&&f()}else i.toggleRowSelection(k,!0,!1)})})}},sort:{prop:"",order:"",change:o=>{w.config.table.sort.resetPage&&(a.page.num=1);const t=w.config.table.sort;if(t.change){t.change(o,a);return}a.table.sort.prop=o.prop,o.order===null?(a.table.sort.order="",a.table.sort.prop=""):a.table.sort.order=o.order==="ascending"?t.order.asc:t.order.desc,a.table.getList()}}},export:{run:{start:async o=>{let t=await a.export.run[o](),i=r.option.column;const d=ObjectUtil.deepMerge({data:t,columns:i},{}),m=r.option.tools?.export||{};m.before&&m.before(d),O.exportToExcel(d.data,d.columns,m.fileName)},select:async()=>{a.export.loading=!0;try{if(r.option.tools?.export?.select){await r.option.tools?.export?.select({...a.page.getQuery(),items:a.table.selection.list});return}if(a.table.selection.list.length===0)throw b.fail(y.tCurd("selectDataToExport")),new Error(y.tCurd("selectDataToExport"));return a.table.selection.list}catch(o){console.error(o)}finally{a.export.loading=!1}},page:async()=>{a.export.loading=!0;try{if(r.option.tools?.export?.page){await r.option.tools?.export?.page({...a.page.getQuery()});return}if(a.table.data.length===0)throw b.fail(y.tCurd("noData")),new Error(y.tCurd("noData"));return a.table.data}catch(o){console.error(o)}finally{a.export.loading=!1}},all:async()=>{a.export.loading=!0;try{if(r.option.tools?.export?.all){await r.option.tools?.export?.all({...a.page.getQuery()});return}const o=r.option.api.list,t=await o({...a.page.getQuery({size:999999,num:1})});return(t.data||{[w.config.field.result.list]:t})[w.config.field.result.list]}catch(o){console.error(o)}finally{a.export.loading=!1}}},loading:!1,click:o=>{a.export.loading||a.export.run.start(o)}},update:{title:"",rules:{},show:!1,showContent:!1,loading:!1,type:D.Update,form:{},formDefault:{},formColumn:[],getDisabled:(o,t=!1)=>r.option.table?.editMode&&t?o.disabled?.table===void 0?!1:o.disabled?.table:a.update.type===D.View?o.disabled?.view===void 0?!0:o.disabled?.view:o.disabled?.[a.update.type===D.Add?"create":"update"],getBind:o=>o.options?.[a.update.type===D.Add?"formAdd":"formUpdate"]?.[o.type]||o.options?.[o.type]||{},getOn:(o,t)=>{const d=o.options?.[a.update.type===D.Add?"formAdd":"formUpdate"]?.[o.type]?.on||o.options?.[o.type]?.on||{},m={};return Object.keys(d).forEach(p=>{const s=d[p];typeof s=="function"?m[p]=function(...k){return s.apply(this,[...k,t||a.update.form,o])}:m[p]=s}),m},getOptions:o=>{try{const i=a.update.formColumn.flat().find(d=>d.item.key===o)?.item;return i?{options:i.options,bind:a.update.getBind(i)}:{options:{},bind:{}}}catch{return{options:{},bind:{}}}},edit:{data:{},getApiData:o=>{if(r.option.form?.editAll)return o;let t={[r.option.table?.rowKey]:a.update.edit.data[r.option.table?.rowKey]};return Object.keys(a.update.edit.data).forEach(i=>{o[i]!==a.update.edit.data[i]&&(t[i]=o[i])}),t}},view:{},open:(o,t)=>{a.update.showContent||FunUtil.throttle(async()=>{b.loading(!0);try{a.update.type=o;const i=o===D.Add;a.update.edit.data=t,a.update.title=y.tCurd(i?"add":o===D.View?"view":"edit"),a.update.form=ObjectUtil.deepMerge(i?a.update.formDefault:t,{}),await a.initApiData("update"),await r.option.form?.openBefore?.(a.update.form,a.update),(!r.option.table?.inlineEdit||i)&&(a.update.show=!0,a.update.showContent=!0),r.option.form?.openAfter?.(a.update.form,a.update)}catch(i){console.error(i)}finally{b.loading(!1)}})},submit:()=>{FunUtil.throttle(async()=>{await c.value?.validate(async(d,m)=>new Promise((p,s)=>{d||(b.fail(y.tCurd("checkFormData")),s(!1)),p()})),a.update.loading=!0;const o=a.update.type===D.Add?r.option.api.create:r.option.api.update;try{await r.option.form?.submitBefore?.(a.update.form,a.update)}catch{a.update.loading=!1;return}let t=ObjectUtil.deepMerge(a.update.form,{});delete t.children;const i=new Set(r.option.column.filter(d=>d.type==="datetime").map(d=>d.key));Object.keys(t).forEach(d=>{if(i.has(d)&&t[d]!=null){const m=new Date(t[d]).getTime();isNaN(m)||(t[d]=m)}});try{if(!o)return;await o({...t}),a.update.close(),await a.table.getList(),r.option.form?.submitAfter?.(t,a.update)}catch(d){console.error(d)}finally{a.update.loading=!1}})},close:()=>{a.update.show=!1,r.option.table?.inlineEdit&&(a.update.form={}),setTimeout(()=>{a.update.showContent=!1},350)}},remove:{title:y.tCurd("deleteTitle"),show:!1,items:[],loading:!1,close:()=>{a.remove.show=!1},open:o=>{if(o.length===0){b.fail(y.tCurd("selectDataToDelete"));return}a.remove.items=o,a.remove.show=!0},submit:()=>{FunUtil.throttle(async()=>{a.remove.loading=!0;const o=r.option.api.delete;try{if(!o)return;await o({[r.option.table?.rowKey]:a.remove.items.map(t=>t[r.option.table?.rowKey]),items:a.remove.items}),b.success(y.tCurd("operationSuccess")),a.table.data.length<=1&&a.page.num>1&&(a.page.num-=1),a.remove.close(),await a.table.getList()}catch(t){console.error(t)}finally{a.remove.loading=!1}})}},init:()=>{a.initCurdConfig(),a.initColumnOptions(),a.initColumnForm()},apiDataMap:{},initApiData:async o=>{const t=[],i=d=>{if(d.children&&d.children.length){d.children.forEach(m=>i(m));return}if(d.options?.[d.type]?.dataApi&&d.options?.[d.type]?.dataApiConfig?.[o]){if(a.apiDataMap[d.key]&&d.options?.[d.type]?.dataApiConfig?.once)return;const m=(async()=>{try{let p=await d.options?.[d.type]?.dataApi?.(a.update.form,a.update.type);if(p){const s=d.options?.[d.type]?.dataPath;!Array.isArray(p)&&s&&(p=ObjectUtil.getPathValue(p,s)),d.options[d.type].data=p,d.options.search[d.type].data=p,d.options.search[d.options.search.type??d.type].data=p,d.options.formAdd[d.type].data=p,d.options.formUpdate[d.type].data=p,a.apiDataMap[d.key]=p}}catch{}})();t.push(m)}};return r.option.column.forEach(d=>{i(d)}),await Promise.all(t),!0},initCurdConfig:()=>{const o=ObjectUtil.deepMerge(w.config,{});o.table.emptyText=y.tCurd("noData"),r.option.size=r.option.size||{},o.table.size=r.option.size.table||o.size.table,o.form.size=r.option.size.form||o.size.form,o.size.search=r.option.size.search||o.size.search;const t=ObjectUtil.deepMerge(o,r.option||{});Object.keys(t).forEach(i=>{r.option[i]=t[i]})},initColumnOptions:()=>{let o=JSONUtil.cp(w.config.columnConfig);o.options=ObjectUtil.deepMerge({switch:{activeText:y.tCurd("switchOn"),inactiveText:y.tCurd("switchOff")}},o.options);const t=i=>{for(const d in o){if(d==="table"){if(i.table=ObjectUtil.deepMerge(o.table,i.table||{}),i.children){i.children.forEach(p=>{t(p)});return}}else d==="type"?i.type=i.type||o.type:i[d]=ObjectUtil.deepMerge(o[d],i[d]||{});i.options=i.options||{},i.options[i.type]=i.options[i.type]||{},i.options[i.type].size=r.option.size.form,["search","formAdd","formUpdate"].forEach(p=>{i.options[p]=i.options[p]||ObjectUtil.deepMerge(i.options,{}),i.options[p][i.type]=i.options[p][i.type]||{},i.options[p][i.type].size=p==="search"?r.option.size.search:r.option.size.form}),i.table=ObjectUtil.deepMerge(i.table,i.options[i.type].table||{})}i.type==="switch"&&(i.options.switch.tableBeforeChange=async(d,m)=>{const p=i.options?.switch;try{p.tableConfig?.confirm&&await n.value?.open({title:y.tCurd("confirmModify"),content:y.tCurd("confirmSwitchMessage")});try{if(!r.option.api.update&&!p.tableConfig?.api)return;const s=m[r.option.table?.rowKey];p.loadingMap||(p.loadingMap={}),p.loadingMap[s]||(p.loadingMap[s]={loading:!1}),p.loadingMap[s].loading=!0;const k=m[d]===p.activeValue?p.inactiveValue:p.activeValue,f=p.tableConfig?.api?p.tableConfig.api:r.option.api.update;if(!f)return;try{await f({...m,[d]:k},"switch")}catch{return!1}finally{p.loadingMap[s].loading=!1}return b.success(y.tCurd("operationSuccess")),p.tableConfig?.loadList&&(a.table.loading=!0,a.table.getList(),a.table.loading=!1),!0}catch(s){return console.error(s),!1}finally{a.table.loading=!1}}catch{return!1}}),i.type==="treeSelect"&&(i.options.treeSelect.rowKey=r.option.table?.rowKey,i.options.treeSelect.nodeKey=r.option.table?.rowKey)};r.option.column.forEach(t),r.option.table?.column?.forEach(t)},getColumnSpan:(o,t)=>{if(o.item.form?.spanCol){const i=w.config.form.defaultSpan,m=t.filter(p=>!b.isFun(p.item.show?.form,a.update.form,a.update.type)).reduce((p,s)=>p+(s.item.form?.span||i),0);return(o.item?.form.span||i)+m}return o.item.form.span},initColumnForm:()=>{const o=r.option;a.update.formColumn=[],a.table.column.show={list:[],listSource:[]};const t=[],i=r.option.form?.maxSpan||12,d=r.option.form?.defaultSpan||i/2;let m=[];const p=f=>{if(f.children){a.table.column.show.list.push(f.key),f.children.forEach(g=>{p(g)});return}if(a.update.formDefault[f.key]=f.value,f.table.table&&(f.show.table&&a.table.column.show.list.push(f.key),f.table.table&&a.table.column.show.listSource.push(f.key)),!(f.isForm&&typeof f.show?.form=="boolean")||f.show?.form){f.form=f.form||{span:d},f.form.span=f.form.span??d;let g=f.form.span,u=m.reduce((V,S)=>V+S.span,g);const E=m.length;if(m.push({item:f,span:g}),(E===1&&m[0].span===0||u>=i||g===0&&E>1)&&(t.push(m),m=[]),f.rules){const V={input:y.tCurd("placeholderInput"),select:y.tCurd("placeholderSelect")},S=(V[f.type]||V.input)+f.label;a.update.rules[f.key]=typeof f.rules=="boolean"?[{required:!0,message:S,trigger:"blur"}]:f.rules}}},s=(f,g)=>{f.isForm=g,Array.isArray(f.children)&&f.children.forEach(u=>s(u,g))};o.column.forEach(f=>{f.isForm=!0,s(f,!0),p(f)}),r.option.table?.column?.forEach(f=>{s(f,!1),p(f)}),a.search.column.list=o.column.concat(o.table?.column||[]),a.table.column.list=a.search.column.list.filter(f=>f.table?.table),a.search.column.list.sort((f,g)=>f.sort?.search-g.sort?.search),a.table.column.list.sort((f,g)=>f.sort?.table-g.sort?.table),m.length>0&&t.push(m),a.update.formColumn=t;const k=r.option.search?.formDefault;k&&Object.keys(k).forEach(f=>{a.search.formDefault[f]=k[f]}),o.column.forEach(f=>{f.show?.search||(a.search.formDefault[f.key]=void 0)}),a.search.form=ObjectUtil.deepMerge(a.search.formDefault,{})}});return a.init(),e.onMounted(()=>{r.option.init!==!1&&a.table.getList()}),{conf:a,switchConfirmRef:n,ruleFormRef:c,tableRef:l}},J={class:"dialog-footer"},Q=e.defineComponent({__name:"switchConfirm",props:{size:{}},setup(r,{expose:n}){const c=e.ref(!1),l=e.ref("确认修改"),a=e.ref("确认要修改状态吗?");let o=null,t=null;const i=p=>(p?.title&&(l.value=p.title),p?.content&&(a.value=p.content),c.value=!0,new Promise((s,k)=>{o=s,t=k})),d=()=>{c.value=!1,o?.(!0),o=null,t=null},m=()=>{c.value=!1,t?.(new Error("用户取消操作")),o=null,t=null};return n({open:i}),(p,s)=>{const k=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(e.unref(h.ElDialog),{modelValue:c.value,"onUpdate:modelValue":s[0]||(s[0]=f=>c.value=f),title:l.value,"close-on-click-modal":!1,width:"400px"},{footer:e.withCtx(()=>[e.createVNode(k,{size:p.size},{default:e.withCtx(()=>[e.createElementVNode("span",J,[e.createVNode(e.unref(h.ElButton),{onClick:m},{default:e.withCtx(()=>s[1]||(s[1]=[e.createTextVNode("取消")])),_:1}),e.createVNode(e.unref(h.ElButton),{type:"primary",onClick:d},{default:e.withCtx(()=>s[2]||(s[2]=[e.createTextVNode("确认")])),_:1})])]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(a.value),1)]),_:1},8,["modelValue","title"])}}}),z=(r,n)=>{const c=r.__vccOpts||r;for(const[l,a]of n)c[l]=a;return c},X={},Y={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function Z(r,n){return e.openBlock(),e.createElementBlock("svg",Y,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 P=z(X,[["render",Z]]),_=["innerHTML"],v=e.defineComponent({__name:"text",props:{content:{},value:{}},setup(r){const n=r,c=e.computed(()=>typeof n.content=="function"?n.content(n.value):n.content);return(l,a)=>typeof c.value=="object"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c.value),{key:0})):(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:c.value},null,8,_))}}),ee={},te={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function oe(r,n){return e.openBlock(),e.createElementBlock("svg",te,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 ne=z(ee,[["render",oe]]),ae={},le={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function re(r,n){return e.openBlock(),e.createElementBlock("svg",le,n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-38.4 409.6H326.4a38.4 38.4 0 1 0 0 76.8h147.2v147.2a38.4 38.4 0 0 0 76.8 0V550.4h147.2a38.4 38.4 0 0 0 0-76.8H550.4V326.4a38.4 38.4 0 1 0-76.8 0z"},null,-1)]))}const ie=z(ae,[["render",re]]),de={},se={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function ce(r,n){return e.openBlock(),e.createElementBlock("svg",se,n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896M288 512a38.4 38.4 0 0 0 38.4 38.4h371.2a38.4 38.4 0 0 0 0-76.8H326.4A38.4 38.4 0 0 0 288 512"},null,-1)]))}const fe=z(de,[["render",ce]]),pe={class:"row flex-center table-header-label inline"},me={class:"table-header-tooltip"},he=["innerHTML"],ge=["onClick"],ye={key:1},ke=["onClick","innerHTML"],be=e.defineComponent({__name:"tableColumn",props:{conf:{},columnList:{},option:{}},setup(r){const n=b.isFun,c=e.getCurrentInstance().type;return(l,a)=>{const o=e.resolveComponent("el-tooltip");return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.columnList,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.key},[l.conf.table.column.show.list.includes(t.key)&&e.unref(n)(t.show?.table,l.conf.table.data)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.table?.header?.groupKey===void 0||t.table.header.show?(e.openBlock(),e.createBlock(e.unref(h.ElTableColumn),e.mergeProps({key:0,prop:t.key,label:t.label,ref_for:!0},t.table),{header:e.withCtx(()=>[e.renderSlot(l.$slots,"table-header-"+t.key,{item:t},()=>[e.createElementVNode("div",pe,[t.table?.header?.tooltip?(e.openBlock(),e.createBlock(o,{key:0,effect:"dark",placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("div",{innerHTML:t.table?.header?.tooltip},null,8,he)]),default:e.withCtx(()=>[e.createElementVNode("span",me,[e.createVNode(ne)])]),_:2},1024)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label)+" ",1),t.table?.header?.group!==void 0?(e.openBlock(),e.createElementBlock("span",{key:1,class:"table-header-plus",onClick:e.withModifiers(()=>{t.table.header.group=!t.table.header.group,l.columnList.forEach(i=>{i.table?.header?.groupKey===t.key&&(i.table.header.show=!t.table.header.group)})},["stop"])},[t.table.header.group?(e.openBlock(),e.createBlock(ie,{key:0})):(e.openBlock(),e.createBlock(fe,{key:1}))],8,ge)):e.createCommentVNode("",!0)])])]),default:e.withCtx(({row:i})=>[t.children?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a[0]||(a[0]=e.createTextVNode("   ")),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(c)),{conf:l.conf,columnList:t.children,option:l.option},e.createSlots({_:2},[e.renderList(l.$slots,(d,m)=>({name:m,fn:e.withCtx(p=>[e.renderSlot(l.$slots,m,e.mergeProps({ref_for:!0},p||{}))])}))]),1032,["conf","columnList","option"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.option.table?.editMode?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row",["table-edit-"+t.key]]),style:{width:"100%"}},[e.renderSlot(l.$slots,"table-edit-left-"+t.key,{row:i,item:t}),t.type==="input"?(e.openBlock(),e.createBlock(e.unref(h.ElInput),e.mergeProps({key:0,modelValue:i[t.key],"onUpdate:modelValue":d=>i[t.key]=d,disabled:l.conf.update.getDisabled(t,!0),class:"col",ref_for:!0},l.conf.update.getBind(t),e.toHandlers(l.conf.update.getOn(t,i))),e.createSlots({_:2},[t.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof t.options?.input?.prepend=="function"?t.options?.input?.prepend(i):t.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="select"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:1,modelValue:i[t.key],"onUpdate:modelValue":d=>i[t.key]=d,disabled:l.conf.update.getDisabled(t,!0),class:"col",ref_for:!0},l.conf.update.getBind(t),e.toHandlers(l.conf.update.getOn(t,i))),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options?.search?.select?.data||t.options?.select?.data,d=>(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="switch"?(e.openBlock(),e.createBlock(e.unref(h.ElSwitch),e.mergeProps({key:2,modelValue:i[t.key],"onUpdate:modelValue":d=>i[t.key]=d,disabled:l.conf.update.getDisabled(t,!0),class:"col",ref_for:!0},l.conf.update.getBind(t),e.toHandlers(l.conf.update.getOn(t,i))),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"table-edit-right-"+t.key,{row:i,item:t})],2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.conf.update.type===e.unref(b).EDialog.Update&&e.unref(n)(t.show?.form,l.conf.update.form,e.unref(b).EDialog.Update)&&l.option.table?.inlineEdit&&l.conf.update.form[l.option.table?.rowKey]===i[l.option.table?.rowKey]&&(t.type==="input"||t.type==="select")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.type==="input"?(e.openBlock(),e.createBlock(e.unref(h.ElInput),e.mergeProps({key:0,modelValue:l.conf.update.form[t.key],"onUpdate:modelValue":d=>l.conf.update.form[t.key]=d,disabled:l.conf.update.getDisabled(t,!0),ref_for:!0},l.conf.update.getBind(t),e.toHandlers(l.conf.update.getOn(t,i)),{style:{width:"100%"}}),e.createSlots({_:2},[t.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof t.options?.input?.prepend=="function"?t.options?.input?.prepend(i):t.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="select"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:1,modelValue:l.conf.update.form[t.key],"onUpdate:modelValue":d=>l.conf.update.form[t.key]=d,disabled:l.conf.update.getDisabled(t,!0),ref_for:!0},l.conf.update.getBind(t),e.toHandlers(l.conf.update.getOn(t,i)),{style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options?.search?.select?.data||t.options?.select?.data,d=>(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="switch"?(e.openBlock(),e.createBlock(e.unref(h.ElSwitch),e.mergeProps({key:2,modelValue:l.conf.update.form[t.key],"onUpdate:modelValue":d=>l.conf.update.form[t.key]=d,ref_for:!0},l.conf.update.getBind(t),e.toHandlers(l.conf.update.getOn(t,i)),{disabled:l.conf.update.getDisabled(t,!0)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)],64)):e.renderSlot(l.$slots,"table-"+t.key,{key:1,row:i,item:t},()=>[e.unref(B).customComponent[t.type??""]?.table?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[t.type??""]?.table),e.mergeProps({key:0,modelValue:i[t.key],"onUpdate:modelValue":d=>i[t.key]=d,ref_for:!0},t.options?.[t.type??""],e.toHandlers(t.options?.[t.type??""]?.on||{})),null,16,["modelValue","onUpdate:modelValue"])):t.type==="switch"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.options?.switch?.tableConfig?.change?(e.openBlock(),e.createBlock(e.unref(h.ElSwitch),e.mergeProps({key:0,modelValue:i[t.key],"onUpdate:modelValue":d=>i[t.key]=d,loading:t.options?.switch?.loadingMap?.[i[l.option.table?.rowKey]]?.loading,"before-change":()=>t.options?.switch?.tableBeforeChange?.(t.key,i),ref_for:!0},t.options?.switch),null,16,["modelValue","onUpdate:modelValue","loading","before-change"])):(e.openBlock(),e.createElementBlock("span",ye,e.toDisplayString(i[t.key]===t.options?.switch?.activeValue?t.options?.switch?.activeText:t.options?.switch?.inactiveText),1))],64)):(e.openBlock(),e.createElementBlock("span",{key:2,style:e.normalizeStyle({"--table-text-click-color":t.table?.click?.color}),class:e.normalizeClass({"table-text-click":t.table?.click?.callback}),onClick:d=>t.table?.click?.callback?.(i),innerHTML:t.table?.format?t.table?.format(i):i[t.key]},null,14,ke))])],64))],64))]),_:2},1040,["prop","label"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),128)}}}),ue={class:"row form-item-content",style:{width:"100%"}},we={class:"col column form-item-content-item"},Ce={class:"col"},Be=["innerHTML"],Ve=e.defineComponent({__name:"formColumn",props:{conf:{},item:{}},setup(r){return(n,c)=>(e.openBlock(),e.createBlock(e.unref(h.ElFormItem),{label:n.item.item.text?.form?.label??n.item.item.label,prop:n.item.item.key,"label-width":n.item.item.text?.form?.label==""?0:n.item.item.form?.labelWidth||n.conf.option.form?.labelWidth},{default:e.withCtx(()=>[e.createElementVNode("div",ue,[e.renderSlot(n.$slots,"form-"+n.item.item.key+"-start",{row:n.conf.update.form,item:n.item.item}),e.createElementVNode("div",we,[e.createElementVNode("div",Ce,[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(h.ElInput),e.mergeProps({key:0,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[0]||(c[0]=l=>n.conf.update.form[n.item.item.key]=l)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),e.createSlots({_:2},[n.item.item.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof n.item.item.options?.input?.prepend=="function"?n.item.item.options?.input?.prepend(n.conf.update.form):n.item.item.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","disabled"])):n.item.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(h.ElSwitch),e.mergeProps({key:1,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[1]||(c[1]=l=>n.conf.update.form[n.item.item.key]=l)},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(h.ElSelect),e.mergeProps({key:2,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[2]||(c[2]=l=>n.conf.update.form[n.item.item.key]=l)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.conf.update.getBind(n.item.item).data,l=>(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):n.item.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(h.ElRadioGroup),e.mergeProps({key:3,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[3]||(c[3]=l=>n.conf.update.form[n.item.item.key]=l)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.conf.update.getBind(n.item.item).data,l=>(e.openBlock(),e.createBlock(e.unref(h.ElRadio),{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):n.item.item.type==="list"?(e.openBlock(),e.createBlock(T,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(h.ElTreeSelect),e.mergeProps({key:5,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[4]||(c[4]=l=>n.conf.update.form[n.item.item.key]=l)},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(h.ElDatePicker),e.mergeProps({key:6,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[5]||(c[5]=l=>n.conf.update.form[n.item.item.key]=l)},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]=l=>n.conf.update.form[n.item.item.key]=l)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(n.$slots,"form-"+n.item.item.key+"-right",{row:n.conf.update.form,item:n.item.item})]),e.renderSlot(n.$slots,"form-"+n.item.item.key+"-tip",{row:n.conf.update.form,item:n.item.item},()=>[n.item.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof n.item.item.form?.tipText=="function"?n.item.item.form?.tipText(n.conf.update.form,n.conf.update.type):n.item.item.form?.tipText},null,8,Be)):e.createCommentVNode("",!0)])]),e.renderSlot(n.$slots,"form-"+n.item.item.key+"-end",{row:n.conf.update.form,item:n.item.item})])]),_:3},8,["label","prop","label-width"]))}}),Ee={},Se={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function Ne(r,n){return e.openBlock(),e.createElementBlock("svg",Se,n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M482.2 508.4L331.3 389c-3-2.4-7.3-.2-7.3 3.6V478H184V184h204v128c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V144c0-15.5-12.5-28-28-28H144c-15.5 0-28 12.5-28 28v736c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v128H184V546h140v85.4c0 3.8 4.4 6 7.3 3.6l150.9-119.4a4.5 4.5 0 000-7.2zM880 116H596c-15.5 0-28 12.5-28 28v168c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V184h204v294H700v-85.4c0-3.8-4.3-6-7.3-3.6l-151 119.4a4.52 4.52 0 000 7.1l151 119.5c2.9 2.3 7.3.2 7.3-3.6V546h140v294H636V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v168c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V144c0-15.5-12.5-28-28-28z"},null,-1)]))}const De=z(Ee,[["render",Ne]]),ze={},$e={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function Te(r,n){return e.openBlock(),e.createElementBlock("svg",$e,n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M180 176h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zm724 0h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zM785.3 504.3L657.7 403.6a7.23 7.23 0 00-11.7 5.7V476H378v-62.8c0-6-7-9.4-11.7-5.7L238.7 508.3a7.14 7.14 0 000 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h268v62.8c0 6 7 9.4 11.7 5.7l127.5-100.8c3.8-2.9 3.8-8.5.2-11.4z"},null,-1)]))}const Fe=z(ze,[["render",Te]]),U=e.defineComponent({__name:"searchField",props:{item:{},conf:{},type:{}},setup(r){const n=r,c=e.computed({get:()=>n.conf.search.form?.[n.item?.key],set:l=>{n.item?.key!==void 0&&(n.conf.search.form[n.item.key]=l)}});return(l,a)=>e.unref(B).customComponent[l.type??""]?.search?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[l.type??""]?.search),e.mergeProps({key:0,modelValue:c.value,"onUpdate:modelValue":a[0]||(a[0]=o=>c.value=o)},l.item.options?.search?.[l.type??""],e.toHandlers(l.item.options?.search?.[l.type??""]?.on||{})),null,16,["modelValue"])):l.type==="input"?(e.openBlock(),e.createBlock(e.unref(h.ElInput),e.mergeProps({key:1,modelValue:c.value,"onUpdate:modelValue":a[1]||(a[1]=o=>c.value=o),placeholder:l.conf.search.getPlaceholder(l.item),clearable:"",disabled:l.item.disabled?.search},l.item.options?.search?.input||l.item.options?.input,e.toHandlers(l.item.options?.search?.input?.on||l.item.options?.input?.on||{})),null,16,["modelValue","placeholder","disabled"])):l.type==="switch"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:2,modelValue:c.value,"onUpdate:modelValue":a[2]||(a[2]=o=>c.value=o),placeholder:l.conf.search.getPlaceholder(l.item,e.unref(y).tCurd("placeholderSelect")),clearable:"",disabled:l.item.disabled?.search},l.item.options?.search?.switch||l.item.options?.switch,e.toHandlers(l.item.options?.search?.switch?.on||l.item.options?.switch?.on||{})),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:l.item.options?.switch?.activeValue,label:l.item.options?.switch?.activeText,value:l.item.options?.switch?.activeValue},null,8,["label","value"])),(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:l.item.options?.switch?.inactiveValue,label:l.item.options?.switch?.inactiveText,value:l.item.options?.switch?.inactiveValue},null,8,["label","value"]))]),_:1},16,["modelValue","placeholder","disabled"])):l.type==="select"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:3,modelValue:c.value,"onUpdate:modelValue":a[3]||(a[3]=o=>c.value=o),placeholder:l.conf.search.getPlaceholder(l.item,e.unref(y).tCurd("placeholderSelect")),clearable:"",disabled:l.item.disabled?.search},l.item.options?.search?.select||l.item.options?.select,e.toHandlers(l.item.options?.search?.select?.on||l.item.options?.select?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.options?.search?.select?.data||l.item.options?.select?.data||[],o=>(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:o.value,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","placeholder","disabled"])):l.type==="radio"?(e.openBlock(),e.createBlock(e.unref(h.ElRadioGroup),e.mergeProps({key:4,modelValue:c.value,"onUpdate:modelValue":a[4]||(a[4]=o=>c.value=o),disabled:l.item.disabled?.search},l.item.options?.search?.radio||l.item.options?.radio,e.toHandlers(l.item.options?.search?.radio?.on||l.item.options?.radio?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.options?.radio?.data,o=>(e.openBlock(),e.createBlock(e.unref(h.ElRadio),{key:o.value,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):l.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(h.ElDatePicker),e.mergeProps({key:5,modelValue:c.value,"onUpdate:modelValue":a[5]||(a[5]=o=>c.value=o),disabled:l.item.disabled?.search},l.item.options?.search?.datetime||l.item.options?.datetime,e.toHandlers(l.item.options?.search?.datetime?.on||l.item.options?.datetime?.on||{})),null,16,["modelValue","disabled"])):l.type&&e.unref(B).customComponent[l.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[l.type]),e.mergeProps({key:6,modelValue:c.value,"onUpdate:modelValue":a[6]||(a[6]=o=>c.value=o)},l.item.options?.search?.[l.type]||l.item.options?.[l.type],e.toHandlers(l.item.options?.search?.[l.type]?.on||l.item.options?.[l.type]?.on||{}),{disabled:l.item.disabled?.search}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)}}),Oe={key:0,class:"relative curd-search fit-width"},Ue={class:"mb-10 flex justify-between items-center fit-width"},Me={class:"flex items-center",style:{gap:"10px"}},Le={key:0},He={key:1},Ae={key:2},je={class:"export-btn"},Ie={key:1,class:"export-btn"},Re={class:"flex items-center table-tools-right",style:{gap:"10px"}},Ke={class:"row justify-end mt-10 mb-10 table-bottom-pagination"},xe={class:"dialog-footer"},We={key:0},qe={key:1},Ge={class:"dialog-footer"},M=e.defineComponent({__name:"index",props:{option:{default:{}}},setup(r,{expose:n}){const c=b.EDialog,l=r,a=b.isFun,{conf:o,switchConfirmRef:t,ruleFormRef:i,tableRef:d}=G(l);return n({conf:o}),(m,p)=>{const s=e.resolveComponent("el-tooltip"),k=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative cc1-form-box",[r.option.table?.fitHeight?"col":"no-min-height"]])},[e.createElementVNode("div",{class:e.normalizeClass(["row",[r.option.table?.fitHeight?"absolute fit":""]]),style:{overflow:"hidden"}},[e.renderSlot(m.$slots,"box-left"),e.createElementVNode("div",{class:e.normalizeClass(["column fit-width no-wrap",[r.option.table?.fitHeight?"col":""]])},[r.option.search?.show!==!1?(e.openBlock(),e.createElementBlock("div",Oe,[e.createVNode(e.unref(h.ElForm),{model:e.unref(o).search.form,inline:"",size:r.option.size?.search},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"search-start",{row:e.unref(o).search.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).search.column.list,f=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:f.key},[e.renderSlot(m.$slots,"search-"+f.key+"-start",{row:e.unref(o).search.form}),(typeof f.show?.search=="function"?f.show?.search(e.unref(o).search.form):f.show?.search)?(e.openBlock(),e.createBlock(e.unref(h.ElFormItem),{key:0,label:f.text?.search?.label??f.label},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"search-"+f.key+"-left",{row:e.unref(o).search.form}),e.renderSlot(m.$slots,"search-"+f.key,{row:e.unref(o).search.form},()=>[f.options?.search?.type?(e.openBlock(),e.createBlock(U,{key:0,item:f,conf:e.unref(o),type:f.options.search.type},null,8,["item","conf","type"])):(e.openBlock(),e.createBlock(U,{key:1,item:f,conf:e.unref(o),type:f.type},null,8,["item","conf","type"]))]),e.renderSlot(m.$slots,"search-"+f.key+"-right",{row:e.unref(o).search.form})]),_:2},1032,["label"])):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"search-"+f.key+"-end",{row:e.unref(o).search.form})],64))),128)),e.renderSlot(m.$slots,"search-center",{row:e.unref(o).search.form}),r.option.tools?.search||r.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(h.ElFormItem),{key:0},{default:e.withCtx(()=>[r.option.tools?.search?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:0,type:"primary",onClick:e.unref(o).search.submit},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("search")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),r.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:1,onClick:e.unref(o).search.reset},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("reset")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"search-end",{row:e.unref(o).search.form})]),_:3},8,["model","size"])])):e.createCommentVNode("",!0),e.createElementVNode("div",Ue,[e.createElementVNode("div",Me,[e.unref(a)(r.option.tools?.add)?(e.openBlock(),e.createElementBlock("div",Le,[e.createVNode(e.unref(h.ElButton),{type:"primary",onClick:p[0]||(p[0]=f=>e.unref(o).update.open(e.unref(c).Add)),size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("add")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),r.option.table?.selectable&&e.unref(a)(r.option.tools?.delete)?(e.openBlock(),e.createElementBlock("div",He,[e.createVNode(e.unref(h.ElButton),{type:"danger",onClick:p[1]||(p[1]=f=>e.unref(o).remove.open(e.unref(o).table.selection.list)),size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("delete")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),r.option.tools?.expand?(e.openBlock(),e.createElementBlock("div",Ae,[e.createVNode(e.unref(h.ElButton),{type:"warning",onClick:p[2]||(p[2]=f=>e.unref(o).table.expand.all()),size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("expandCollapse")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),r.option.tools?.export?.show?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[r.option.tools?.export?.dropdown?.show?(e.openBlock(),e.createBlock(e.unref(h.ElDropdown),{key:0,onCommand:e.unref(o).export.click},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(h.ElDropdownMenu),{size:r.option.size?.search},{default:e.withCtx(()=>[r.option.tools?.export?.dropdown?.select&&(r.option.table?.selectable||e.unref(a)(r.option.tools?.delete))?(e.openBlock(),e.createBlock(e.unref(h.ElDropdownItem),{key:0,command:"select"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("exportSelect")),1)]),_:1})):e.createCommentVNode("",!0),r.option.tools?.export?.dropdown?.page?(e.openBlock(),e.createBlock(e.unref(h.ElDropdownItem),{key:1,command:"page"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("exportPage")),1)]),_:1})):e.createCommentVNode("",!0),r.option.tools?.export?.dropdown?.all?(e.openBlock(),e.createBlock(e.unref(h.ElDropdownItem),{key:2,command:"all"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("exportAll")),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",je,[e.createVNode(e.unref(h.ElButton),{type:"warning",loading:e.unref(o).export.loading,size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("export")),1)]),_:1},8,["loading","size"])])]),_:1},8,["onCommand"])):(e.openBlock(),e.createElementBlock("div",Ie,[e.createVNode(e.unref(h.ElButton),{type:"warning",loading:e.unref(o).export.loading,size:r.option.size?.search,onClick:p[3]||(p[3]=f=>e.unref(o).export.run.start("all"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("export")),1)]),_:1},8,["loading","size"])]))],64)):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"tools-left")]),e.createElementVNode("div",Re,[e.renderSlot(m.$slots,"tools-right"),e.unref(o).page.showTools?(e.openBlock(),e.createBlock(e.unref(h.ElPagination),e.mergeProps({key:0,"current-page":e.unref(o).page.num,"onUpdate:currentPage":p[4]||(p[4]=f=>e.unref(o).page.num=f),"page-size":e.unref(o).page.size,"onUpdate:pageSize":p[5]||(p[5]=f=>e.unref(o).page.size=f),background:"","page-sizes":e.unref(o).page.sizeList,"pager-count":e.unref(o).page.pagerCount,layout:e.unref(o).page.layout,total:e.unref(o).page.total,size:r.option.size?.table,onSizeChange:e.unref(o).table.getList,onCurrentChange:e.unref(o).table.getList},r.option.page?.pagination||{},e.toHandlers(r.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0),r.option.tools?.expandColumn===void 0||r.option.tools?.expandColumn?(e.openBlock(),e.createBlock(s,{key:1,effect:"dark",content:e.unref(o).table.header.group.expand?e.unref(y).tCurd("mergeColumn"):e.unref(y).tCurd("expandColumn"),placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["refresh-btn",[r.option.size?.search]]),onClick:p[6]||(p[6]=(...f)=>e.unref(o).table.header.group.toggleExpandAll&&e.unref(o).table.header.group.toggleExpandAll(...f))},[e.unref(o).table.header.group.expand?(e.openBlock(),e.createBlock(De,{key:0})):(e.openBlock(),e.createBlock(Fe,{key:1}))],2)]),_:1},8,["content"])):e.createCommentVNode("",!0),r.option.tools?.refresh===void 0||r.option.tools?.refresh?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["refresh-btn",[r.option.size?.search]]),onClick:p[7]||(p[7]=(...f)=>e.unref(o).table.getList&&e.unref(o).table.getList(...f))},[e.createVNode(P)],2)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:e.normalizeClass(["fit-width relative form-box",[r.option.table?.fitHeight?"col ":"",r.option.table?.editMode?"edit-mode":""]])},[e.createElementVNode("div",{class:e.normalizeClass(["column form-box-content",[r.option.table?.fitHeight?"absolute fit":""]])},[e.withDirectives((e.openBlock(),e.createBlock(e.unref(h.ElTable),e.mergeProps({ref_key:"tableRef",ref:d,data:e.unref(o).table.data,border:r.option.table?.border===void 0?!0:r.option.table?.border,onSelectionChange:e.unref(o).table.selection.change,onSortChange:e.unref(o).table.sort.change,"expand-row-keys":e.unref(o).table.expand.rowKeys,onExpandChange:e.unref(o).table.expand.change},r.option.table,e.toHandlers(r.option.table?.on||{})),{default:e.withCtx(()=>[(typeof r.option.table?.selectable=="object"?r.option.table?.selectable?.show:r.option.table?.selectable)||e.unref(a)(r.option.tools?.delete)||r.option.tools?.export?.show&&r.option.tools?.export?.select?(e.openBlock(),e.createBlock(e.unref(h.ElTableColumn),e.mergeProps({key:0,type:"selection",width:"40",align:"center",fixed:"left","show-overflow-tooltip":!1,className:"cc1-form-selectable-column"},typeof r.option.table?.selectable=="object"?r.option.table?.selectable:{},e.toHandlers(typeof r.option.table?.selectable=="object"?r.option.table?.selectable?.on||{}:{})),null,16)):e.createCommentVNode("",!0),(typeof r.option.table?.index=="object"?r.option.table?.index?.show:r.option.table?.index)?(e.openBlock(),e.createBlock(e.unref(h.ElTableColumn),e.mergeProps({key:1,type:"index",fixed:"left",width:"40",align:"center",label:"#","show-overflow-tooltip":!1,className:"cc1-form-index-column"},typeof r.option.table?.index=="object"?r.option.table?.index:{},e.toHandlers(typeof r.option.table?.index=="object"?r.option.table?.index?.on||{}:{})),null,16)):e.createCommentVNode("",!0),e.createVNode(be,{conf:e.unref(o),columnList:e.unref(o).table.column.list,option:r.option},e.createSlots({_:2},[e.renderList(m.$slots,(f,g)=>({name:g,fn:e.withCtx(u=>[e.renderSlot(m.$slots,g,e.normalizeProps(e.guardReactiveProps(u||{})))])}))]),1032,["conf","columnList","option"]),e.unref(a)(r.option.table?.add)||e.unref(a)(r.option.table?.update)||e.unref(a)(r.option.table?.delete)||e.unref(a)(r.option.table?.view)||m.$slots["table-op-left"]||m.$slots["table-op-right"]?(e.openBlock(),e.createBlock(e.unref(h.ElTableColumn),e.mergeProps({key:2,width:"auto","max-width":"200",align:"center",fixed:"right"},r.option.table?.operate,{"show-overflow-tooltip":!1}),{header:e.withCtx(()=>[e.renderSlot(m.$slots,"table-header-op",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("operation")),1)])]),default:e.withCtx(({row:f})=>[e.createVNode(e.unref(h.ElForm),{size:r.option.size?.table},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"table-op-left",{row:f}),e.unref(o).update.type===e.unref(c).Update&&r.option.table?.inlineEdit&&e.unref(o).update.form[l.option.table?.rowKey]===f[l.option.table?.rowKey]?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(h.ElButton),{link:"",type:"info",onClick:e.unref(o).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("cancel")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(h.ElButton),{link:"",type:"primary",onClick:e.unref(o).update.submit,loading:e.unref(o).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("confirm")),1)]),_:1},8,["onClick","loading"]),e.renderSlot(m.$slots,"table-op-edit-right",{row:f})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(a)(r.option.table?.add,f)?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:0,link:"",type:"primary",onClick:g=>e.unref(o).update.open(e.unref(c).Add,f)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("add")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(r.option.table?.view,f)?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:1,link:"",type:"primary",onClick:g=>e.unref(o).update.open(e.unref(c).View,f)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("view")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(r.option.table?.update,f)?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:2,link:"",type:"warning",onClick:g=>e.unref(o).update.open(e.unref(c).Update,f)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("edit")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(r.option.table?.delete,f)?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:3,link:"",type:"danger",onClick:g=>e.unref(o).remove.open([f])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("delete")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"table-op-right",{row:f})],64))]),_:2},1032,["size"])]),_:3},16)):e.createCommentVNode("",!0)]),_:3},16,["data","border","onSelectionChange","onSortChange","expand-row-keys","onExpandChange"])),[[k,e.unref(o).table.loading]])],2)],2),e.createElementVNode("div",Ke,[(r.option.page?.show===void 0||r.option.page?.show)&&!e.unref(o).page.showTools?(e.openBlock(),e.createBlock(e.unref(h.ElPagination),e.mergeProps({key:0,"current-page":e.unref(o).page.num,"onUpdate:currentPage":p[8]||(p[8]=f=>e.unref(o).page.num=f),"page-size":e.unref(o).page.size,"onUpdate:pageSize":p[9]||(p[9]=f=>e.unref(o).page.size=f),background:"","page-sizes":e.unref(o).page.sizeList,"pager-count":e.unref(o).page.pagerCount,layout:e.unref(o).page.layout,total:e.unref(o).page.total,size:r.option.size?.table,onSizeChange:e.unref(o).table.getList,onCurrentChange:e.unref(o).table.getList},r.option.page?.pagination||{},e.toHandlers(r.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0)])],2),e.renderSlot(m.$slots,"box-right")],2),e.createVNode(e.unref(h.ElDialog),e.mergeProps({modelValue:e.unref(o).update.show,"onUpdate:modelValue":p[10]||(p[10]=f=>e.unref(o).update.show=f),title:e.unref(o).update.title,"before-close":e.unref(o).update.close},r.option.dialog),{footer:e.withCtx(()=>[e.createElementVNode("span",xe,[e.createVNode(e.unref(h.ElForm),{size:r.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(h.ElButton),{onClick:e.unref(o).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("close")),1)]),_:1},8,["onClick"]),e.unref(o).update.type!==e.unref(c).View?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:0,type:"primary",onClick:e.unref(o).update.submit,loading:e.unref(o).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("submit")),1)]),_:1},8,["onClick","loading"])):e.createCommentVNode("",!0)]),_:1},8,["size"])])]),default:e.withCtx(()=>[e.createVNode(e.unref(h.ElForm),{ref_key:"ruleFormRef",ref:i,model:e.unref(o).update.form,rules:e.unref(o).update.rules,size:r.option.size?.form,class:"update-dialog-form"},{default:e.withCtx(()=>[e.unref(o).update.showContent?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(o).update.formColumn,f=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)((()=>{const g=[],u=E=>{E?.item?.children?u(E.item.children):g.push(...E.map(V=>V.item?.show?.form))};return u(f),g})(),e.unref(o).update.form,e.unref(o).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:r.option.form?.stripe===void 0?!0:r.option.form?.stripe}])},[e.renderSlot(m.$slots,"form-start",{row:e.unref(o).update.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f,g=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)(g.item.show?.form,e.unref(o).update.form,e.unref(o).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([g.item.form.span>0?`col-${e.unref(o).getColumnSpan(g,f)}`:"col",`form-item-col-${g.item.key}`])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.item.children?g.children:[g],u=>(e.openBlock(),e.createBlock(Ve,{key:u.item.key,conf:e.unref(o),item:u},e.createSlots({_:2},[e.renderList(m.$slots,(E,V)=>({name:V,fn:e.withCtx(S=>[e.renderSlot(m.$slots,V,e.mergeProps({ref_for:!0},S||{}))])}))]),1032,["conf","item"]))),128))],2)):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(m.$slots,"form-end",{row:e.unref(o).update.form})],2)):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0)]),_:3},8,["model","rules","size"])]),_:3},16,["modelValue","title","before-close"]),e.createVNode(e.unref(h.ElDialog),{modelValue:e.unref(o).remove.show,"onUpdate:modelValue":p[11]||(p[11]=f=>e.unref(o).remove.show=f),title:e.unref(o).remove.title,"close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createElementVNode("span",Ge,[e.createVNode(e.unref(h.ElForm),{size:r.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(h.ElButton),{onClick:e.unref(o).remove.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("close")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(h.ElButton),{type:"danger",onClick:e.unref(o).remove.submit,loading:e.unref(o).remove.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("confirmDelete")),1)]),_:1},8,["onClick","loading"])]),_:1},8,["size"])])]),default:e.withCtx(()=>[r.option.dialog?.delete?.content?(e.openBlock(),e.createElementBlock("div",We,[e.createVNode(v,{content:r.option.dialog?.delete?.content,value:e.unref(o).remove.items},null,8,["content","value"])])):(e.openBlock(),e.createElementBlock("div",qe,e.toDisplayString(e.unref(y).tCurd("confirmDeleteMessage",e.unref(o).remove.items.length)),1))]),_:1},8,["modelValue","title"]),e.createVNode(Q,{ref_key:"switchConfirmRef",ref:t,size:r.option.size?.form},null,8,["size"])],2)}}});class Je{static async download(n,c="download.png"){const l=document.createElement("a");l.style.display="none",l.href=n,l.setAttribute("download",c),typeof l.download>"u"&&l.setAttribute("target","_blank"),document.body.appendChild(l),l.click(),document.body.removeChild(l),window.URL.revokeObjectURL(n)}static exportJSONFile=(n,c)=>{const l=new Blob([JSON.stringify(n)],{type:"application/json"}),a=URL.createObjectURL(l),o=document.createElement("a");o.href=a,o.download=`${c||"config"}.json`,o.click()};static importFile=async n=>new Promise((c,l)=>{const a=document.createElement("input");a.type="file";const o=n?.accept||".json";a.accept=o,a.style.display="none",a.onchange=t=>{const i=t.target.files[0];if(!i){b.fail("未选择文件"),l("未选择文件");return}const d=new FileReader;d.onload=async m=>{const p=o==".json"?JSON.parse(m.target.result):m.target.result;c(p)},d.onerror=()=>{b.fail("文件读取失败"),l("文件读取失败")},d.readAsText(i),document.body.removeChild(a)},document.body.appendChild(a),a.click()})}const L=(r,n)=>{if(r.component("TCurd",M),r.component("TFormList",T),r.component("TColumn",F),n?.customComponent){B.customComponent=n.customComponent;for(const c in n.customComponent)r.component(c,n.customComponent[c])}},Qe={install:L};C.ArrUtil=N,C.ExcelUtil=O,C.TColumn=F,C.TCurd=M,C.TFile=Je,C.TForm=B,C.TFormConfig=w,C.TFormI18n=y,C.TFormList=T,C.TSys=b,C.default=Qe,C.install=L,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ (function(C,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("element-plus"),require("vue-router"),require("vue")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue-router","vue"],h):(C=typeof globalThis<"u"?globalThis:C||self,h(C.cc1Form={},C.ElementPlus,C.VueRouter,C.Vue))})(this,(function(C,h,Xe,e){"use strict";class b{static router;static routes;static getRouterPath=()=>this.router.currentRoute.value.path;static EDialog={Add:"Add",Update:"Update",View:"View",Remove:"Remove"};static isFun=(n,...c)=>Array.isArray(n)?n.some(l=>typeof l=="function"?l(...c):l):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(!b.moduleObj[n])throw new Error(`模块${n}未加载,请赋值如:TSys.moduleObj = { ${n}: ()=>import('${n}') }`);const c=await b.moduleObj[n]();return c.default??c};static tipMessages={};static tipMessagesGap=500;static showMessage(n,c,l={}){const a=Date.now();if(!this.tipMessages[n]||a-this.tipMessages[n]>this.tipMessagesGap){this.tipMessages[n]=a;const o=Object.assign({message:n,type:c},l);h.ElMessage(o),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=h.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 l=screen.width/2-500,a=screen.height/2-800/2-30;window.open(n,"_blank","toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top="+a+", left="+l)}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,l)=>{let a=document.getElementById(n.id);const o=await b.loadModule("html2canvas");try{o(a,{logging:!1,allowTaint:!0,scale:window.devicePixelRatio,width:n.windowWidth,height:n.windowHeight,windowWidth:n.windowWidth,windowHeight:n.windowHeight,useCORS:!0,backgroundColor:"#ffffff00"}).then(function(t){let i=t.toDataURL("image/png");c(i)})}catch(t){l(t)}})}class w{static config={field:{page:{num:"num",size:"size"},result:{list:"list",pages:"pages",num:"num",size:"size",total:"total"}},dialog:{width:"980px",closeOnClickModal:!1},pagination:{layout:"total, sizes, prev, pager, next, jumper",pageSizes:[10,20,50,100],size:10,pagerCount:7,showTools:!1},size:{table:"default",form:"default",search:"default"},tools:{expandColumn:!1,refresh:!0,expand:!1,search:!0,reset:!0,add:!0,delete:!0,export:{show:!0,dropdown:{show:!0,select:!0,page:!0,all:!0},fileName:"Export Data "}},form:{size:"default",labelWidth:"120px",stripe:!0,editAll:!1,maxSpan:12,defaultSpan:6,openBefore:void 0,openAfter:void 0,closeBefore:void 0,submitBefore:void 0,submitAfter:void 0},table:{index:!1,labelWidth:"100px",size:"default",emptyText:"",headerCellClassName:"table-header",rowKey:"_id",highlightCurrentRow:!0,border:!0,selectable:!1,column:[],showOverflowTooltip:!0,showSummary:!1,summaryMethod:()=>[],inlineEdit:!1,operate:{width:void 0},add:!1,update:!0,delete:!0,sort:{props:{field:"sortField"},order:{field:"sortOrder",asc:"asc",desc:"desc"},resetPage:!1,change:void 0},fitHeight:!0},columnConfig:{type:"input",form:{width:"100%",spanCol:!1},table:{table:!0,minWidth:120,width:void 0,fixed:void 0,align:"center",showOverflowTooltip:!0,format:void 0,click:{callback:void 0,color:"#409EFF"},tooltip:void 0},show:{table:!0,search:!1,form:!0},sort:{search:0,table:0,form:0},disabled:{view:!0},options:{switch:{activeValue:!0,inactiveValue:!1,tableConfig:{change:!0,confirm:!0,loadList:!0}},treeSelect:{multiple:!0,renderAfterExpand:!1,showCheckbox:!0,checkStrictly:!0,checkOnClickNode:!0,props:{label:"title",children:"children"}},datetime:{type:"datetime"},select:{data:[],clearable:!0,filterable:!0,dataPath:"data.data",dataApiConfig:{once:!0,init:!0,create:!0,update:!0}},radio:{data:[],dataPath:"data.data",dataApiConfig:{once:!0,init:!0,create:!0,update:!0}}}}};static setConfig=n=>{w.config=ObjectUtil.deepMerge(w.config,n)}}class B{static customComponent={};static findOptions=(n,c)=>{const l=n.column.find(o=>o.key===c),a=o=>o.replace(/-([a-z])/g,(t,i)=>i.toUpperCase());if(l)return l.options[a(l.type)]};static setOptionsData=(n,c,l)=>{const a=B.findOptions(n,c);a&&(a.data=l)};static form={openBefore:{parentId:(n,c,l,a)=>{const o=w.config.table.rowKey;n?c.type===b.EDialog.Add?(c.form.parentId=n[o],c.form.sort=n.children.length+1):c.form.parentId=n.parentId.substring(n.parentId.lastIndexOf(",")+1):(c.form.parentId="0",c.form.sort=l.length+1),B.setOptionsData(a,"parentId",[{[o]:"0",title:"根",children:l}])}}}}function Ye(r){return r}const H={search:"搜索",add:"新增",edit:"编辑",view:"查看",delete:"删除",export:"导出",exportSelect:"导出选中",exportPage:"导出本页",exportAll:"导出全部",import:"导入",refresh:"刷新",reset:"重置",expandCollapse:"展开/收缩",operation:"操作",close:"关闭",cancel:"取消",submit:"提交",confirm:"确认",deleteTitle:"删除提示",confirmDelete:"确认删除",confirmDeleteMessage:"确认要删除【{count}】条数据吗?",placeholderInput:"请输入",placeholderSelect:"请选择",checkFormData:"请检查表单数据",selectDataToDelete:"请选择要删除的数据",selectDataToExport:"请选择要导出的数据",noData:"暂无数据",operationSuccess:"操作成功",switchOn:"开启",switchOff:"关闭",confirmModify:"确认修改",confirmSwitchMessage:"确认要修改吗?",mergeColumn:"合并栏位",expandColumn:"展开栏位"};class y{static t(n,...c){if(typeof n=="function")return n(...c);n=String(n);let l=0;return n.replace(/{([^}]+)}/g,(a,o)=>l<c.length?String(c[l++]):`{${o}}`)}static setI18n=n=>{y.curd=ObjectUtil.deepMerge(y.curd,n)};static tCurd(n,...c){return this.t(this.curd[n],...c)}static curd=H}class N{static getIdFun=()=>StrUtil.uuid();static setId=(n,c,l)=>{c[n]||(c[n]=[]);const a=w.config.table.rowKey;c[n].forEach(o=>{l.forEach(t=>{let i=t.default??"";t.type==="number"&&(i=t.default??0),t.type==="boolean"&&(i=t.default??!1),t.type==="time"&&(i=t.default??new Date),o[t.value]===void 0&&(o[t.value]=i)}),o[a]||(o[a]=N.getIdFun())})};static add=(n,c,l,a)=>{const o=JSONUtil.cp(l);N.setId(n,c,l);const t=w.config.table.rowKey;c[n].push(o.reduce((i,d)=>{let m=d.default??"";return d.type==="number"&&(m=d.default??0),d.type==="boolean"&&(m=d.default??!1),d.type==="time"&&(m=d.default??new Date),i[d.value]=m,i},{[t]:N.getIdFun()})),a?.(c)};static remove=(n,c,l,a)=>{const o=w.config.table.rowKey;c[n]=c[n].filter(t=>t[o]!==l[o]),a?.(c)};static getNoIdData=(n,c)=>{const l=JSONUtil.cp(n),a=w.config.table.rowKey;return l.forEach(o=>{o[a]&&delete o[a],c&&o[c]&&N.getNoIdData(o[c],c)}),l}}const A={key:0,class:"column curd-form-com-list",style:{width:"100%",gap:"10px"}},j={key:0},I={class:"row items-center",style:{gap:"10px",width:"100%"}},R={key:1},T=e.defineComponent({__name:"list",props:{row:{default:{}},label:{default:"label"},value:{default:"value"},itemFields:{default:[{label:"label",value:"label"},{label:"value",value:"value"}]},field:{default:"value"},inputWidth:{default:"120px"},inputClass:{default:""},addBottom:{default:!1}},emits:["change"],setup(r,{emit:n}){const c=r,l=e.reactive({show:!1,add:(o,t,i)=>{N.add(o,t,i,()=>{a("change")})},remove:(o,t,i)=>{N.remove(o,t,i,()=>{a("change")})}});e.onMounted(()=>{N.setId(c.field,c.row,c.itemFields),l.show=!0});const a=n;return(o,t)=>{const i=e.resolveComponent("el-button"),d=e.resolveComponent("el-input");return l.show?(e.openBlock(),e.createElementBlock("div",A,[e.renderSlot(o.$slots,"list-start",{row:r.row}),r.addBottom?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",j,[e.createVNode(i,{link:"",type:"primary",onClick:t[0]||(t[0]=m=>l.add(r.field,r.row,r.itemFields))},{default:e.withCtx(()=>t[3]||(t[3]=[e.createTextVNode("添加")])),_:1})])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.row[r.field],m=>(e.openBlock(),e.createElementBlock("div",I,[e.renderSlot(o.$slots,"item-start",{item:m,row:r.row}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.itemFields,p=>(e.openBlock(),e.createBlock(d,{modelValue:m[p.value],"onUpdate:modelValue":s=>m[p.value]=s,style:e.normalizeStyle({width:r.inputWidth}),class:e.normalizeClass(r.inputClass),placeholder:p[r.label]||p[r.value],onChange:t[1]||(t[1]=s=>a("change"))},null,8,["modelValue","onUpdate:modelValue","style","class","placeholder"]))),256)),e.renderSlot(o.$slots,"item-end",{item:m,row:r.row}),e.createVNode(i,{link:"",type:"danger",onClick:p=>l.remove(r.field,r.row,m)},{default:e.withCtx(()=>t[4]||(t[4]=[e.createTextVNode("删除")])),_:2},1032,["onClick"])]))),256)),r.addBottom?(e.openBlock(),e.createElementBlock("div",R,[e.createVNode(i,{link:"",type:"primary",onClick:t[2]||(t[2]=m=>l.add(r.field,r.row,r.itemFields))},{default:e.withCtx(()=>t[5]||(t[5]=[e.createTextVNode("添加")])),_:1})])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"list-end",{row:r.row})])):e.createCommentVNode("",!0)}}}),K={class:"row form-item-content",style:{width:"100%"}},x={class:"col"},W={class:"col"},q=["innerHTML"],F=e.defineComponent({__name:"column",props:{option:{default:{}},type:{default:""}},setup(r,{expose:n}){const c=b.isFun,l=b.EDialog,a=e.ref(),o=r,t=e.reactive({rules:{},show:!0,form:{},formDefault:{},type:o.type||l.Add,formColumn:[],getDisabled:i=>t.type===l.View?i.disabled?.view===void 0?!0:i.disabled?.view:i.disabled?.[t.type===l.Add?"create":"update"],getBind:i=>i.options?.[t.type===l.Add?"formAdd":"formUpdate"]?.[i.type]||i.options?.[i.type]||{},getOn:i=>i.options?.[t.type===l.Add?"formAdd":"formUpdate"]?.[i.type]?.on||i.options?.[i.type]?.on||{},getColumnSpan:(i,d)=>{if(i.item.form?.spanCol){const m=o.option.form?.maxSpan||12,p=o.option.form?.defaultSpan||m/2,k=d.filter(f=>!b.isFun(f.item.show?.form,t.form,t.type)).reduce((f,g)=>f+(g.item.form?.span||p),0);return(i.item.form?.span||p)+k}return i.item.form?.span},initColumnForm:()=>{const i=o.option;t.formColumn=[],t.rules={},t.formDefault={};const d=[],m=o.option.form?.maxSpan||12,p=o.option.form?.defaultSpan||m/2;let s=[];const k=g=>{if(g.children){g.children.forEach(u=>{k(u)});return}if(t.formDefault[g.key]=g.value,g.isForm&&(typeof g.show?.form!="boolean"||g.show?.form)){g.form=g.form||{span:p},g.form.span=g.form.span??p;const u=g.form.span,E=s.reduce((S,$)=>S+$.span,u),V=s.length;if(s.push({item:g,span:u}),(V===1&&s[0].span===0||E>=m||u===0&&V>1)&&(d.push(s),s=[]),g.rules){const S={input:y.tCurd("placeholderInput"),select:y.tCurd("placeholderSelect")},$=(S[g.type]||S.input)+g.label;t.rules[g.key]=typeof g.rules=="boolean"?[{required:!0,message:$,trigger:"blur"}]:g.rules}}},f=(g,u)=>{g.isForm=u,Array.isArray(g.children)&&g.children.forEach(E=>f(E,u))};i.column.forEach(g=>{f(g,!0),k(g)}),s.length>0&&d.push(s),t.formColumn=d,t.form=JSONUtil.cp(t.formDefault)}});return t.initColumnForm(),n({ref:a,conf:t}),(i,d)=>(e.openBlock(),e.createBlock(e.unref(h.ElForm),{ref_key:"ruleFormRef",ref:a,model:t.form,rules:t.rules},{default:e.withCtx(()=>[t.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.formColumn,(m,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:p},[e.unref(c)(m.map(s=>s.item?.show?.form),t.form,t.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:r.option.form?.stripe===void 0?!0:r.option.form?.stripe}])},[e.renderSlot(i.$slots,"form-start",{row:t.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m,s=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s.item.key},[e.unref(c)(s.item.show?.form,t.form,t.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([s.item.form.span>0?`col-${t.getColumnSpan(s,m)}`:"col",`form-item-col-${s.item.key}`])},[e.createVNode(e.unref(h.ElFormItem),{label:s.item.text?.form?.label??s.item.label,prop:s.item.key,"label-width":s.item.text?.form?.label==""?0:s.item.form?.labelWidth||r.option.form?.labelWidth||"100px"},{default:e.withCtx(()=>[e.createElementVNode("div",K,[e.renderSlot(i.$slots,"form-"+s.item.key+"-start",{row:t.form,item:s.item}),e.createElementVNode("div",x,[e.createElementVNode("div",W,[e.renderSlot(i.$slots,"form-"+s.item.key,{row:t.form,item:s.item},()=>[s.item.type==="input"?(e.openBlock(),e.createBlock(e.unref(h.ElInput),e.mergeProps({key:0,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):s.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(h.ElSwitch),e.mergeProps({key:1,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):s.item.type==="select"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:2,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.item.options?.select?.data,k=>(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:k.value,label:k.label,value:k.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):s.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(h.ElRadioGroup),e.mergeProps({key:3,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.item.options?.radio?.data,k=>(e.openBlock(),e.createBlock(e.unref(h.ElRadio),{key:k.value,label:k.label,value:k.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):s.item.type==="list"?(e.openBlock(),e.createBlock(T,e.mergeProps({key:4,row:t.form,field:s.item.key,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item),style:{width:"100%"}}),null,16,["row","field","disabled"])):s.item.type==="treeSelect"?(e.openBlock(),e.createBlock(e.unref(h.ElTreeSelect),e.mergeProps({key:5,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item),style:{width:"100%"}}),null,16,["modelValue","onUpdate:modelValue","disabled"])):s.item.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(h.ElDatePicker),e.mergeProps({key:6,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):s.item.type&&(e.unref(B).customComponent[s.item.type]||e.unref(B).customComponent[s.item.type]?.form)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[s.item.type]?.form||e.unref(B).customComponent[s.item.type]),e.mergeProps({key:7,modelValue:t.form[s.item.key],"onUpdate:modelValue":k=>t.form[s.item.key]=k,ref_for:!0},t.getBind(s.item),e.toHandlers(t.getOn(s.item)),{disabled:t.getDisabled(s.item)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(i.$slots,"form-"+s.item.key+"-right",{row:t.form,item:s.item})]),e.renderSlot(i.$slots,"form-"+s.item.key+"-tip",{row:t.form,item:s.item},()=>[s.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof s.item.form?.tipText=="function"?s.item.form?.tipText(t.form,t.type):s.item.form?.tipText},null,8,q)):e.createCommentVNode("",!0)])]),e.renderSlot(i.$slots,"form-"+s.item.key+"-end",{row:t.form,item:s.item})])]),_:2},1032,["label","prop","label-width"])],2)):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(i.$slots,"form-end",{row:t.form})],2)):e.createCommentVNode("",!0)],64))),128)):e.createCommentVNode("",!0)]),_:3},8,["model","rules"]))}});class O{static exportToExcel=async(n,c,l)=>{if(!n||n.length===0)return;const a=await b.loadModule("xlsx"),o=n.map(d=>{const m={};return c.forEach(p=>{m[p.label]=d[p.key]}),m}),t=a.utils.json_to_sheet(o),i=a.utils.book_new();a.utils.book_append_sheet(i,t,"Sheet1"),l?typeof l=="function"&&(l=l()):l=`导出数据_${new Date().Format("yyyy-MM-dd")}_${new Date().getTime()}`,a.writeFile(i,`${l}.xlsx`)}}const D=b.EDialog,G=r=>{const n=e.ref(),c=e.ref(),l=e.ref(),a=e.reactive({option:r.option,search:{column:{list:[]},form:{},formDefault:{},getPlaceholder:(o,t=y.tCurd("placeholderInput"))=>o.text?.search?.placeholder===void 0?`${t}${o.label}`:o.text?.search?.placeholder,getFormData:()=>{let o={};r.option.column.forEach(i=>{(typeof i.show?.search=="function"?i.show?.search(a.search.form):i.show?.search)&&(o[i.key]=a.search.form[i.key])});const t=r.option.search?.before?.(o);return t&&(o=t),o},reset:()=>{const o=a.search.formDefault;Object.keys(o).forEach(t=>{r.option.search?.resetMode==="none"?o[t]=void 0:o[t]=a.search.formDefault[t]}),a.search.form=ObjectUtil.deepMerge(o,{}),a.page.num=1,r.option.init!==!1&&a.table.getList()},submit:()=>{a.page.num=1,a.table.getList()}},page:{num:1,total:0,layout:r.option.page?.layout||w.config.pagination.layout,showTools:r.option.page?.showTools||w.config.pagination.showTools,size:r.option.page?.size||w.config.pagination.size,sizeList:r.option.page?.sizeList||w.config.pagination.pageSizes,pagerCount:r.option.page?.pagerCount||w.config.pagination.pagerCount,getQuery:(o={})=>({[w.config.field.page.size]:o.size||a.page.size,[w.config.field.page.num]:o.num||a.page.num,...a.search.getFormData()})},table:{op:{width:(...o)=>o.filter(i=>i).length*30+60},loading:!1,data:[],expand:{isExpand:!1,rowKeys:[],change:(o,t)=>{},all:()=>{if(a.table.expand.isExpand)a.table.expand.rowKeys=[];else{const o=t=>{let i=[];return t.forEach(d=>{i.push(d[r.option.table.rowKey]),d.children&&d.children.length>0&&(i=i.concat(o(d.children)))}),i};a.table.expand.rowKeys=o(a.table.data)}a.table.expand.isExpand=!a.table.expand.isExpand}},column:{list:[],show:{listSource:[],list:[]}},header:{group:{expand:!1,toggleExpandAll:()=>{const o=!a.table.header.group.expand;a.table.header.group.expand=o;const t=i=>{i.forEach(d=>{d.table?.header?.group!==void 0&&(d.table.header.group=!o),d.table?.header?.groupKey!==void 0&&(d.table.header.show=o),Array.isArray(d.children)&&d.children.length>0&&t(d.children)})};t(a.table.column.list)}}},getList:async()=>{a.table.loading=!0;const o=r.option.api.list;try{await a.initApiData("init");let t={};if(a.table.sort.prop){const{props:g,order:u}=w.config.table.sort;t={[g.field]:a.table.sort.prop,[u.field]:a.table.sort.order}}const i=await o({...a.page.getQuery(),...t}),d=w.config.field.result,m=i.data||{[d.list]:i};let p=(Array.isArray(m[d.list]),m[d.list]);const s=a.update.formColumn.flat(),f=ObjectUtil.deepMerge({data:p},{}).data.map(g=>(Object.keys(g).forEach(E=>{const V=s.find(S=>S.item.key===E);V&&["select","radio"].includes(V.item.type)&&(V.item.table.format||(V.item.table.format=S=>V.item.options[V.item.type].data?.find($=>$.value==S[E])?.label||S[E]))}),g));a.table.data=r.option.data?await r.option.data(f,p):f,a.page.total=m[d.total]||0}catch(t){console.error(t)}finally{a.table.loading=!1}},selection:{list:[],change:o=>{a.table.selection.list=o},setList:(o,t)=>{a.table.selection.list=[];const i=l.value;if(i?.clearSelection(),!i||!o?.length)return;const d=r.option.table?.rowKey,m=a.table.data,p=s=>{const k=f=>{for(const g of f){if(d!=null&&d!==""){if(g[d]===s[d])return g}else if(g===s)return g;if(Array.isArray(g.children)&&g.children.length){const u=k(g.children);if(u!==void 0)return u}}};return k(m)};e.nextTick(()=>{o.forEach(s=>{const k=p(s)??s;if(t){const f=()=>{i.toggleRowSelection(k,!0,!1)};t(s)!==!1&&f()}else i.toggleRowSelection(k,!0,!1)})})}},sort:{prop:"",order:"",change:o=>{w.config.table.sort.resetPage&&(a.page.num=1);const t=w.config.table.sort;if(t.change){t.change(o,a);return}a.table.sort.prop=o.prop,o.order===null?(a.table.sort.order="",a.table.sort.prop=""):a.table.sort.order=o.order==="ascending"?t.order.asc:t.order.desc,a.table.getList()}}},export:{run:{start:async o=>{let t=await a.export.run[o](),i=r.option.column;const d=ObjectUtil.deepMerge({data:t,columns:i},{}),m=r.option.tools?.export||{};m.before&&m.before(d),O.exportToExcel(d.data,d.columns,m.fileName)},select:async()=>{a.export.loading=!0;try{if(r.option.tools?.export?.select){await r.option.tools?.export?.select({...a.page.getQuery(),items:a.table.selection.list});return}if(a.table.selection.list.length===0)throw b.fail(y.tCurd("selectDataToExport")),new Error(y.tCurd("selectDataToExport"));return a.table.selection.list}catch(o){console.error(o)}finally{a.export.loading=!1}},page:async()=>{a.export.loading=!0;try{if(r.option.tools?.export?.page){await r.option.tools?.export?.page({...a.page.getQuery()});return}if(a.table.data.length===0)throw b.fail(y.tCurd("noData")),new Error(y.tCurd("noData"));return a.table.data}catch(o){console.error(o)}finally{a.export.loading=!1}},all:async()=>{a.export.loading=!0;try{if(r.option.tools?.export?.all){await r.option.tools?.export?.all({...a.page.getQuery()});return}const o=r.option.api.list,t=await o({...a.page.getQuery({size:999999,num:1})});return(t.data||{[w.config.field.result.list]:t})[w.config.field.result.list]}catch(o){console.error(o)}finally{a.export.loading=!1}}},loading:!1,click:o=>{a.export.loading||a.export.run.start(o)}},update:{title:"",rules:{},show:!1,showContent:!1,loading:!1,type:D.Update,form:{},formDefault:{},formColumn:[],getDisabled:(o,t=!1)=>r.option.table?.editMode&&t?o.disabled?.table===void 0?!1:o.disabled?.table:a.update.type===D.View?o.disabled?.view===void 0?!0:o.disabled?.view:o.disabled?.[a.update.type===D.Add?"create":"update"],getBind:o=>o.options?.[a.update.type===D.Add?"formAdd":"formUpdate"]?.[o.type]||o.options?.[o.type]||{},getOn:(o,t)=>{const d=o.options?.[a.update.type===D.Add?"formAdd":"formUpdate"]?.[o.type]?.on||o.options?.[o.type]?.on||{},m={};return Object.keys(d).forEach(p=>{const s=d[p];typeof s=="function"?m[p]=function(...k){return s.apply(this,[...k,t||a.update.form,o])}:m[p]=s}),m},getOptions:o=>{try{const i=a.update.formColumn.flat().find(d=>d.item.key===o)?.item;return i?{options:i.options,bind:a.update.getBind(i)}:{options:{},bind:{}}}catch{return{options:{},bind:{}}}},edit:{data:{},getApiData:o=>{if(r.option.form?.editAll)return o;let t={[r.option.table?.rowKey]:a.update.edit.data[r.option.table?.rowKey]};return Object.keys(a.update.edit.data).forEach(i=>{o[i]!==a.update.edit.data[i]&&(t[i]=o[i])}),t}},view:{},open:(o,t)=>{a.update.showContent||FunUtil.throttle(async()=>{b.loading(!0);try{a.update.type=o;const i=o===D.Add;a.update.edit.data=t,a.update.title=y.tCurd(i?"add":o===D.View?"view":"edit"),a.update.form=ObjectUtil.deepMerge(i?a.update.formDefault:t,{}),await a.initApiData("update"),await r.option.form?.openBefore?.(a.update.form,a.update),(!r.option.table?.inlineEdit||i)&&(a.update.show=!0,a.update.showContent=!0),r.option.form?.openAfter?.(a.update.form,a.update)}catch(i){console.error(i)}finally{b.loading(!1)}})},submit:()=>{FunUtil.throttle(async()=>{await c.value?.validate(async(d,m)=>new Promise((p,s)=>{d||(b.fail(y.tCurd("checkFormData")),s(!1)),p()})),a.update.loading=!0;const o=a.update.type===D.Add?r.option.api.create:r.option.api.update;try{await r.option.form?.submitBefore?.(a.update.form,a.update)}catch{a.update.loading=!1;return}let t=ObjectUtil.deepMerge(a.update.form,{});delete t.children;const i=new Set(r.option.column.filter(d=>d.type==="datetime").map(d=>d.key));Object.keys(t).forEach(d=>{if(i.has(d)&&t[d]!=null){const m=new Date(t[d]).getTime();isNaN(m)||(t[d]=m)}});try{if(!o)return;await o({...t}),a.update.close(),await a.table.getList(),r.option.form?.submitAfter?.(t,a.update)}catch(d){console.error(d)}finally{a.update.loading=!1}})},close:()=>{a.update.show=!1,r.option.table?.inlineEdit&&(a.update.form={}),setTimeout(()=>{a.update.showContent=!1},350)}},remove:{title:y.tCurd("deleteTitle"),show:!1,items:[],loading:!1,close:()=>{a.remove.show=!1},open:o=>{if(o.length===0){b.fail(y.tCurd("selectDataToDelete"));return}a.remove.items=o,a.remove.show=!0},submit:()=>{FunUtil.throttle(async()=>{a.remove.loading=!0;const o=r.option.api.delete;try{if(!o)return;await o({[r.option.table?.rowKey]:a.remove.items.map(t=>t[r.option.table?.rowKey]),items:a.remove.items}),b.success(y.tCurd("operationSuccess")),a.table.data.length<=1&&a.page.num>1&&(a.page.num-=1),a.remove.close(),await a.table.getList()}catch(t){console.error(t)}finally{a.remove.loading=!1}})}},init:()=>{a.initCurdConfig(),a.initColumnOptions(),a.initColumnForm()},apiDataMap:{},initApiData:async o=>{const t=[],i=d=>{if(d.children&&d.children.length){d.children.forEach(m=>i(m));return}if(d.options?.[d.type]?.dataApi&&d.options?.[d.type]?.dataApiConfig?.[o]){if(a.apiDataMap[d.key]&&d.options?.[d.type]?.dataApiConfig?.once)return;const m=(async()=>{try{let p=await d.options?.[d.type]?.dataApi?.(a.update.form,a.update.type);if(p){const s=d.options?.[d.type]?.dataPath;!Array.isArray(p)&&s&&(p=ObjectUtil.getPathValue(p,s)),d.options[d.type].data=p,d.options.search[d.type].data=p,d.options.search[d.options.search.type??d.type]||(d.options.search[d.options.search.type??d.type]={}),d.options.search[d.options.search.type??d.type].data=p,d.options.formAdd[d.type].data=p,d.options.formUpdate[d.type].data=p,a.apiDataMap[d.key]=p}}catch{}})();t.push(m)}};return r.option.column.forEach(d=>{i(d)}),await Promise.all(t),!0},initCurdConfig:()=>{const o=ObjectUtil.deepMerge(w.config,{});o.table.emptyText=y.tCurd("noData"),r.option.size=r.option.size||{},o.table.size=r.option.size.table||o.size.table,o.form.size=r.option.size.form||o.size.form,o.size.search=r.option.size.search||o.size.search;const t=ObjectUtil.deepMerge(o,r.option||{});Object.keys(t).forEach(i=>{r.option[i]=t[i]})},initColumnOptions:()=>{let o=JSONUtil.cp(w.config.columnConfig);o.options=ObjectUtil.deepMerge({switch:{activeText:y.tCurd("switchOn"),inactiveText:y.tCurd("switchOff")}},o.options);const t=i=>{for(const d in o){if(d==="table"){if(i.table=ObjectUtil.deepMerge(o.table,i.table||{}),i.children){i.children.forEach(p=>{t(p)});return}}else d==="type"?i.type=i.type||o.type:i[d]=ObjectUtil.deepMerge(o[d],i[d]||{});i.options=i.options||{},i.options[i.type]=i.options[i.type]||{},i.options[i.type].size=r.option.size.form,["search","formAdd","formUpdate"].forEach(p=>{i.options[p]=i.options[p]||ObjectUtil.deepMerge(i.options,{}),i.options[p][i.type]=i.options[p][i.type]||{},i.options[p][i.type].size=p==="search"?r.option.size.search:r.option.size.form}),i.table=ObjectUtil.deepMerge(i.table,i.options[i.type].table||{})}i.type==="switch"&&(i.options.switch.tableBeforeChange=async(d,m)=>{const p=i.options?.switch;try{p.tableConfig?.confirm&&await n.value?.open({title:y.tCurd("confirmModify"),content:y.tCurd("confirmSwitchMessage")});try{if(!r.option.api.update&&!p.tableConfig?.api)return;const s=m[r.option.table?.rowKey];p.loadingMap||(p.loadingMap={}),p.loadingMap[s]||(p.loadingMap[s]={loading:!1}),p.loadingMap[s].loading=!0;const k=m[d]===p.activeValue?p.inactiveValue:p.activeValue,f=p.tableConfig?.api?p.tableConfig.api:r.option.api.update;if(!f)return;try{await f({...m,[d]:k},"switch")}catch{return!1}finally{p.loadingMap[s].loading=!1}return b.success(y.tCurd("operationSuccess")),p.tableConfig?.loadList&&(a.table.loading=!0,a.table.getList(),a.table.loading=!1),!0}catch(s){return console.error(s),!1}finally{a.table.loading=!1}}catch{return!1}}),i.type==="treeSelect"&&(i.options.treeSelect.rowKey=r.option.table?.rowKey,i.options.treeSelect.nodeKey=r.option.table?.rowKey)};r.option.column.forEach(t),r.option.table?.column?.forEach(t)},getColumnSpan:(o,t)=>{if(o.item.form?.spanCol){const i=w.config.form.defaultSpan,m=t.filter(p=>!b.isFun(p.item.show?.form,a.update.form,a.update.type)).reduce((p,s)=>p+(s.item.form?.span||i),0);return(o.item?.form.span||i)+m}return o.item.form.span},initColumnForm:()=>{const o=r.option;a.update.formColumn=[],a.table.column.show={list:[],listSource:[]};const t=[],i=r.option.form?.maxSpan||12,d=r.option.form?.defaultSpan||i/2;let m=[];const p=f=>{if(f.children){a.table.column.show.list.push(f.key),f.children.forEach(g=>{p(g)});return}if(a.update.formDefault[f.key]=f.value,f.table.table&&(f.show.table&&a.table.column.show.list.push(f.key),f.table.table&&a.table.column.show.listSource.push(f.key)),!(f.isForm&&typeof f.show?.form=="boolean")||f.show?.form){f.form=f.form||{span:d},f.form.span=f.form.span??d;let g=f.form.span,u=m.reduce((V,S)=>V+S.span,g);const E=m.length;if(m.push({item:f,span:g}),(E===1&&m[0].span===0||u>=i||g===0&&E>1)&&(t.push(m),m=[]),f.rules){const V={input:y.tCurd("placeholderInput"),select:y.tCurd("placeholderSelect")},S=(V[f.type]||V.input)+f.label;a.update.rules[f.key]=typeof f.rules=="boolean"?[{required:!0,message:S,trigger:"blur"}]:f.rules}}},s=(f,g)=>{f.isForm=g,Array.isArray(f.children)&&f.children.forEach(u=>s(u,g))};o.column.forEach(f=>{f.isForm=!0,s(f,!0),p(f)}),r.option.table?.column?.forEach(f=>{s(f,!1),p(f)}),a.search.column.list=o.column.concat(o.table?.column||[]),a.table.column.list=a.search.column.list.filter(f=>f.table?.table),a.search.column.list.sort((f,g)=>f.sort?.search-g.sort?.search),a.table.column.list.sort((f,g)=>f.sort?.table-g.sort?.table),m.length>0&&t.push(m),a.update.formColumn=t;const k=r.option.search?.formDefault;k&&Object.keys(k).forEach(f=>{a.search.formDefault[f]=k[f]}),o.column.forEach(f=>{f.show?.search||(a.search.formDefault[f.key]=void 0)}),a.search.form=ObjectUtil.deepMerge(a.search.formDefault,{})}});return a.init(),e.onMounted(()=>{r.option.init!==!1&&a.table.getList()}),{conf:a,switchConfirmRef:n,ruleFormRef:c,tableRef:l}},J={class:"dialog-footer"},Q=e.defineComponent({__name:"switchConfirm",props:{size:{}},setup(r,{expose:n}){const c=e.ref(!1),l=e.ref("确认修改"),a=e.ref("确认要修改状态吗?");let o=null,t=null;const i=p=>(p?.title&&(l.value=p.title),p?.content&&(a.value=p.content),c.value=!0,new Promise((s,k)=>{o=s,t=k})),d=()=>{c.value=!1,o?.(!0),o=null,t=null},m=()=>{c.value=!1,t?.(new Error("用户取消操作")),o=null,t=null};return n({open:i}),(p,s)=>{const k=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(e.unref(h.ElDialog),{modelValue:c.value,"onUpdate:modelValue":s[0]||(s[0]=f=>c.value=f),title:l.value,"close-on-click-modal":!1,width:"400px"},{footer:e.withCtx(()=>[e.createVNode(k,{size:p.size},{default:e.withCtx(()=>[e.createElementVNode("span",J,[e.createVNode(e.unref(h.ElButton),{onClick:m},{default:e.withCtx(()=>s[1]||(s[1]=[e.createTextVNode("取消")])),_:1}),e.createVNode(e.unref(h.ElButton),{type:"primary",onClick:d},{default:e.withCtx(()=>s[2]||(s[2]=[e.createTextVNode("确认")])),_:1})])]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(a.value),1)]),_:1},8,["modelValue","title"])}}}),z=(r,n)=>{const c=r.__vccOpts||r;for(const[l,a]of n)c[l]=a;return c},X={},Y={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function Z(r,n){return e.openBlock(),e.createElementBlock("svg",Y,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 P=z(X,[["render",Z]]),_=["innerHTML"],v=e.defineComponent({__name:"text",props:{content:{},value:{}},setup(r){const n=r,c=e.computed(()=>typeof n.content=="function"?n.content(n.value):n.content);return(l,a)=>typeof c.value=="object"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c.value),{key:0})):(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:c.value},null,8,_))}}),ee={},te={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function oe(r,n){return e.openBlock(),e.createElementBlock("svg",te,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 ne=z(ee,[["render",oe]]),ae={},le={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function re(r,n){return e.openBlock(),e.createElementBlock("svg",le,n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-38.4 409.6H326.4a38.4 38.4 0 1 0 0 76.8h147.2v147.2a38.4 38.4 0 0 0 76.8 0V550.4h147.2a38.4 38.4 0 0 0 0-76.8H550.4V326.4a38.4 38.4 0 1 0-76.8 0z"},null,-1)]))}const ie=z(ae,[["render",re]]),de={},se={"data-v-58697b5c":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function ce(r,n){return e.openBlock(),e.createElementBlock("svg",se,n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896M288 512a38.4 38.4 0 0 0 38.4 38.4h371.2a38.4 38.4 0 0 0 0-76.8H326.4A38.4 38.4 0 0 0 288 512"},null,-1)]))}const fe=z(de,[["render",ce]]),pe={class:"row flex-center table-header-label inline"},me={class:"table-header-tooltip"},he=["innerHTML"],ge=["onClick"],ye={key:1},ke=["onClick","innerHTML"],be=e.defineComponent({__name:"tableColumn",props:{conf:{},columnList:{},option:{}},setup(r){const n=b.isFun,c=e.getCurrentInstance().type;return(l,a)=>{const o=e.resolveComponent("el-tooltip");return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.columnList,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.key},[l.conf.table.column.show.list.includes(t.key)&&e.unref(n)(t.show?.table,l.conf.table.data)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.table?.header?.groupKey===void 0||t.table.header.show?(e.openBlock(),e.createBlock(e.unref(h.ElTableColumn),e.mergeProps({key:0,prop:t.key,label:t.label,ref_for:!0},t.table),{header:e.withCtx(()=>[e.renderSlot(l.$slots,"table-header-"+t.key,{item:t},()=>[e.createElementVNode("div",pe,[t.table?.header?.tooltip?(e.openBlock(),e.createBlock(o,{key:0,effect:"dark",placement:"top"},{content:e.withCtx(()=>[e.createElementVNode("div",{innerHTML:t.table?.header?.tooltip},null,8,he)]),default:e.withCtx(()=>[e.createElementVNode("span",me,[e.createVNode(ne)])]),_:2},1024)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label)+" ",1),t.table?.header?.group!==void 0?(e.openBlock(),e.createElementBlock("span",{key:1,class:"table-header-plus",onClick:e.withModifiers(()=>{t.table.header.group=!t.table.header.group,l.columnList.forEach(i=>{i.table?.header?.groupKey===t.key&&(i.table.header.show=!t.table.header.group)})},["stop"])},[t.table.header.group?(e.openBlock(),e.createBlock(ie,{key:0})):(e.openBlock(),e.createBlock(fe,{key:1}))],8,ge)):e.createCommentVNode("",!0)])])]),default:e.withCtx(({row:i})=>[t.children?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a[0]||(a[0]=e.createTextVNode("   ")),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(c)),{conf:l.conf,columnList:t.children,option:l.option},e.createSlots({_:2},[e.renderList(l.$slots,(d,m)=>({name:m,fn:e.withCtx(p=>[e.renderSlot(l.$slots,m,e.mergeProps({ref_for:!0},p||{}))])}))]),1032,["conf","columnList","option"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.option.table?.editMode?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row",["table-edit-"+t.key]]),style:{width:"100%"}},[e.renderSlot(l.$slots,"table-edit-left-"+t.key,{row:i,item:t}),t.type==="input"?(e.openBlock(),e.createBlock(e.unref(h.ElInput),e.mergeProps({key:0,modelValue:i[t.key],"onUpdate:modelValue":d=>i[t.key]=d,disabled:l.conf.update.getDisabled(t,!0),class:"col",ref_for:!0},l.conf.update.getBind(t),e.toHandlers(l.conf.update.getOn(t,i))),e.createSlots({_:2},[t.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof t.options?.input?.prepend=="function"?t.options?.input?.prepend(i):t.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="select"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:1,modelValue:i[t.key],"onUpdate:modelValue":d=>i[t.key]=d,disabled:l.conf.update.getDisabled(t,!0),class:"col",ref_for:!0},l.conf.update.getBind(t),e.toHandlers(l.conf.update.getOn(t,i))),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options?.search?.select?.data||t.options?.select?.data,d=>(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="switch"?(e.openBlock(),e.createBlock(e.unref(h.ElSwitch),e.mergeProps({key:2,modelValue:i[t.key],"onUpdate:modelValue":d=>i[t.key]=d,disabled:l.conf.update.getDisabled(t,!0),class:"col",ref_for:!0},l.conf.update.getBind(t),e.toHandlers(l.conf.update.getOn(t,i))),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"table-edit-right-"+t.key,{row:i,item:t})],2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.conf.update.type===e.unref(b).EDialog.Update&&e.unref(n)(t.show?.form,l.conf.update.form,e.unref(b).EDialog.Update)&&l.option.table?.inlineEdit&&l.conf.update.form[l.option.table?.rowKey]===i[l.option.table?.rowKey]&&(t.type==="input"||t.type==="select")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.type==="input"?(e.openBlock(),e.createBlock(e.unref(h.ElInput),e.mergeProps({key:0,modelValue:l.conf.update.form[t.key],"onUpdate:modelValue":d=>l.conf.update.form[t.key]=d,disabled:l.conf.update.getDisabled(t,!0),ref_for:!0},l.conf.update.getBind(t),e.toHandlers(l.conf.update.getOn(t,i)),{style:{width:"100%"}}),e.createSlots({_:2},[t.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof t.options?.input?.prepend=="function"?t.options?.input?.prepend(i):t.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="select"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:1,modelValue:l.conf.update.form[t.key],"onUpdate:modelValue":d=>l.conf.update.form[t.key]=d,disabled:l.conf.update.getDisabled(t,!0),ref_for:!0},l.conf.update.getBind(t),e.toHandlers(l.conf.update.getOn(t,i)),{style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options?.search?.select?.data||t.options?.select?.data,d=>(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):t.type==="switch"?(e.openBlock(),e.createBlock(e.unref(h.ElSwitch),e.mergeProps({key:2,modelValue:l.conf.update.form[t.key],"onUpdate:modelValue":d=>l.conf.update.form[t.key]=d,ref_for:!0},l.conf.update.getBind(t),e.toHandlers(l.conf.update.getOn(t,i)),{disabled:l.conf.update.getDisabled(t,!0)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)],64)):e.renderSlot(l.$slots,"table-"+t.key,{key:1,row:i,item:t},()=>[e.unref(B).customComponent[t.type??""]?.table?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[t.type??""]?.table),e.mergeProps({key:0,modelValue:i[t.key],"onUpdate:modelValue":d=>i[t.key]=d,ref_for:!0},t.options?.[t.type??""],e.toHandlers(t.options?.[t.type??""]?.on||{})),null,16,["modelValue","onUpdate:modelValue"])):t.type==="switch"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.options?.switch?.tableConfig?.change?(e.openBlock(),e.createBlock(e.unref(h.ElSwitch),e.mergeProps({key:0,modelValue:i[t.key],"onUpdate:modelValue":d=>i[t.key]=d,loading:t.options?.switch?.loadingMap?.[i[l.option.table?.rowKey]]?.loading,"before-change":()=>t.options?.switch?.tableBeforeChange?.(t.key,i),ref_for:!0},t.options?.switch),null,16,["modelValue","onUpdate:modelValue","loading","before-change"])):(e.openBlock(),e.createElementBlock("span",ye,e.toDisplayString(i[t.key]===t.options?.switch?.activeValue?t.options?.switch?.activeText:t.options?.switch?.inactiveText),1))],64)):(e.openBlock(),e.createElementBlock("span",{key:2,style:e.normalizeStyle({"--table-text-click-color":t.table?.click?.color}),class:e.normalizeClass({"table-text-click":t.table?.click?.callback}),onClick:d=>t.table?.click?.callback?.(i),innerHTML:t.table?.format?t.table?.format(i):i[t.key]},null,14,ke))])],64))],64))]),_:2},1040,["prop","label"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),128)}}}),ue={class:"row form-item-content",style:{width:"100%"}},we={class:"col column form-item-content-item"},Ce={class:"col"},Be=["innerHTML"],Ve=e.defineComponent({__name:"formColumn",props:{conf:{},item:{}},setup(r){return(n,c)=>(e.openBlock(),e.createBlock(e.unref(h.ElFormItem),{label:n.item.item.text?.form?.label??n.item.item.label,prop:n.item.item.key,"label-width":n.item.item.text?.form?.label==""?0:n.item.item.form?.labelWidth||n.conf.option.form?.labelWidth},{default:e.withCtx(()=>[e.createElementVNode("div",ue,[e.renderSlot(n.$slots,"form-"+n.item.item.key+"-start",{row:n.conf.update.form,item:n.item.item}),e.createElementVNode("div",we,[e.createElementVNode("div",Ce,[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(h.ElInput),e.mergeProps({key:0,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[0]||(c[0]=l=>n.conf.update.form[n.item.item.key]=l)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),e.createSlots({_:2},[n.item.item.options?.input?.prepend?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(typeof n.item.item.options?.input?.prepend=="function"?n.item.item.options?.input?.prepend(n.conf.update.form):n.item.item.options?.input?.prepend),1)]),key:"0"}:void 0]),1040,["modelValue","disabled"])):n.item.item.type==="switch"?(e.openBlock(),e.createBlock(e.unref(h.ElSwitch),e.mergeProps({key:1,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[1]||(c[1]=l=>n.conf.update.form[n.item.item.key]=l)},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(h.ElSelect),e.mergeProps({key:2,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[2]||(c[2]=l=>n.conf.update.form[n.item.item.key]=l)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.conf.update.getBind(n.item.item).data,l=>(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):n.item.item.type==="radio"?(e.openBlock(),e.createBlock(e.unref(h.ElRadioGroup),e.mergeProps({key:3,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[3]||(c[3]=l=>n.conf.update.form[n.item.item.key]=l)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item),style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.conf.update.getBind(n.item.item).data,l=>(e.openBlock(),e.createBlock(e.unref(h.ElRadio),{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):n.item.item.type==="list"?(e.openBlock(),e.createBlock(T,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(h.ElTreeSelect),e.mergeProps({key:5,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[4]||(c[4]=l=>n.conf.update.form[n.item.item.key]=l)},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(h.ElDatePicker),e.mergeProps({key:6,modelValue:n.conf.update.form[n.item.item.key],"onUpdate:modelValue":c[5]||(c[5]=l=>n.conf.update.form[n.item.item.key]=l)},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]=l=>n.conf.update.form[n.item.item.key]=l)},n.conf.update.getBind(n.item.item),e.toHandlers(n.conf.update.getOn(n.item.item)),{disabled:n.conf.update.getDisabled(n.item.item)}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)]),e.renderSlot(n.$slots,"form-"+n.item.item.key+"-right",{row:n.conf.update.form,item:n.item.item})]),e.renderSlot(n.$slots,"form-"+n.item.item.key+"-tip",{row:n.conf.update.form,item:n.item.item},()=>[n.item.item.form?.tipText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-tip-text",innerHTML:typeof n.item.item.form?.tipText=="function"?n.item.item.form?.tipText(n.conf.update.form,n.conf.update.type):n.item.item.form?.tipText},null,8,Be)):e.createCommentVNode("",!0)])]),e.renderSlot(n.$slots,"form-"+n.item.item.key+"-end",{row:n.conf.update.form,item:n.item.item})])]),_:3},8,["label","prop","label-width"]))}}),Ee={},Se={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function Ne(r,n){return e.openBlock(),e.createElementBlock("svg",Se,n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M482.2 508.4L331.3 389c-3-2.4-7.3-.2-7.3 3.6V478H184V184h204v128c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V144c0-15.5-12.5-28-28-28H144c-15.5 0-28 12.5-28 28v736c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v128H184V546h140v85.4c0 3.8 4.4 6 7.3 3.6l150.9-119.4a4.5 4.5 0 000-7.2zM880 116H596c-15.5 0-28 12.5-28 28v168c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V184h204v294H700v-85.4c0-3.8-4.3-6-7.3-3.6l-151 119.4a4.52 4.52 0 000 7.1l151 119.5c2.9 2.3 7.3.2 7.3-3.6V546h140v294H636V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v168c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V144c0-15.5-12.5-28-28-28z"},null,-1)]))}const De=z(Ee,[["render",Ne]]),ze={},$e={xmlns:"http://www.w3.org/2000/svg",viewBox:"64 64 896 896"};function Te(r,n){return e.openBlock(),e.createElementBlock("svg",$e,n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M180 176h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zm724 0h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zM785.3 504.3L657.7 403.6a7.23 7.23 0 00-11.7 5.7V476H378v-62.8c0-6-7-9.4-11.7-5.7L238.7 508.3a7.14 7.14 0 000 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h268v62.8c0 6 7 9.4 11.7 5.7l127.5-100.8c3.8-2.9 3.8-8.5.2-11.4z"},null,-1)]))}const Fe=z(ze,[["render",Te]]),U=e.defineComponent({__name:"searchField",props:{item:{},conf:{},type:{}},setup(r){const n=r,c=e.computed({get:()=>n.conf.search.form?.[n.item?.key],set:l=>{n.item?.key!==void 0&&(n.conf.search.form[n.item.key]=l)}});return(l,a)=>e.unref(B).customComponent[l.type??""]?.search?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[l.type??""]?.search),e.mergeProps({key:0,modelValue:c.value,"onUpdate:modelValue":a[0]||(a[0]=o=>c.value=o)},l.item.options?.search?.[l.type??""],e.toHandlers(l.item.options?.search?.[l.type??""]?.on||{})),null,16,["modelValue"])):l.type==="input"?(e.openBlock(),e.createBlock(e.unref(h.ElInput),e.mergeProps({key:1,modelValue:c.value,"onUpdate:modelValue":a[1]||(a[1]=o=>c.value=o),placeholder:l.conf.search.getPlaceholder(l.item),clearable:"",disabled:l.item.disabled?.search},l.item.options?.search?.input||l.item.options?.input,e.toHandlers(l.item.options?.search?.input?.on||l.item.options?.input?.on||{})),null,16,["modelValue","placeholder","disabled"])):l.type==="switch"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:2,modelValue:c.value,"onUpdate:modelValue":a[2]||(a[2]=o=>c.value=o),placeholder:l.conf.search.getPlaceholder(l.item,e.unref(y).tCurd("placeholderSelect")),clearable:"",disabled:l.item.disabled?.search},l.item.options?.search?.switch||l.item.options?.switch,e.toHandlers(l.item.options?.search?.switch?.on||l.item.options?.switch?.on||{})),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:l.item.options?.switch?.activeValue,label:l.item.options?.switch?.activeText,value:l.item.options?.switch?.activeValue},null,8,["label","value"])),(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:l.item.options?.switch?.inactiveValue,label:l.item.options?.switch?.inactiveText,value:l.item.options?.switch?.inactiveValue},null,8,["label","value"]))]),_:1},16,["modelValue","placeholder","disabled"])):l.type==="select"?(e.openBlock(),e.createBlock(e.unref(h.ElSelect),e.mergeProps({key:3,modelValue:c.value,"onUpdate:modelValue":a[3]||(a[3]=o=>c.value=o),placeholder:l.conf.search.getPlaceholder(l.item,e.unref(y).tCurd("placeholderSelect")),clearable:"",disabled:l.item.disabled?.search},l.item.options?.search?.select||l.item.options?.select,e.toHandlers(l.item.options?.search?.select?.on||l.item.options?.select?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.options?.search?.select?.data||l.item.options?.select?.data||[],o=>(e.openBlock(),e.createBlock(e.unref(h.ElOption),{key:o.value,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","placeholder","disabled"])):l.type==="radio"?(e.openBlock(),e.createBlock(e.unref(h.ElRadioGroup),e.mergeProps({key:4,modelValue:c.value,"onUpdate:modelValue":a[4]||(a[4]=o=>c.value=o),disabled:l.item.disabled?.search},l.item.options?.search?.radio||l.item.options?.radio,e.toHandlers(l.item.options?.search?.radio?.on||l.item.options?.radio?.on||{})),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.options?.radio?.data,o=>(e.openBlock(),e.createBlock(e.unref(h.ElRadio),{key:o.value,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","disabled"])):l.type==="datetime"?(e.openBlock(),e.createBlock(e.unref(h.ElDatePicker),e.mergeProps({key:5,modelValue:c.value,"onUpdate:modelValue":a[5]||(a[5]=o=>c.value=o),disabled:l.item.disabled?.search},l.item.options?.search?.datetime||l.item.options?.datetime,e.toHandlers(l.item.options?.search?.datetime?.on||l.item.options?.datetime?.on||{})),null,16,["modelValue","disabled"])):l.type&&e.unref(B).customComponent[l.type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(B).customComponent[l.type]),e.mergeProps({key:6,modelValue:c.value,"onUpdate:modelValue":a[6]||(a[6]=o=>c.value=o)},l.item.options?.search?.[l.type]||l.item.options?.[l.type],e.toHandlers(l.item.options?.search?.[l.type]?.on||l.item.options?.[l.type]?.on||{}),{disabled:l.item.disabled?.search}),null,16,["modelValue","disabled"])):e.createCommentVNode("",!0)}}),Oe={key:0,class:"relative curd-search fit-width"},Ue={class:"mb-10 flex justify-between items-center fit-width"},Me={class:"flex items-center",style:{gap:"10px"}},Le={key:0},He={key:1},Ae={key:2},je={class:"export-btn"},Ie={key:1,class:"export-btn"},Re={class:"flex items-center table-tools-right",style:{gap:"10px"}},Ke={class:"row justify-end mt-10 mb-10 table-bottom-pagination"},xe={class:"dialog-footer"},We={key:0},qe={key:1},Ge={class:"dialog-footer"},M=e.defineComponent({__name:"index",props:{option:{default:{}}},setup(r,{expose:n}){const c=b.EDialog,l=r,a=b.isFun,{conf:o,switchConfirmRef:t,ruleFormRef:i,tableRef:d}=G(l);return n({conf:o}),(m,p)=>{const s=e.resolveComponent("el-tooltip"),k=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative cc1-form-box",[r.option.table?.fitHeight?"col":"no-min-height"]])},[e.createElementVNode("div",{class:e.normalizeClass(["row",[r.option.table?.fitHeight?"absolute fit":""]]),style:{overflow:"hidden"}},[e.renderSlot(m.$slots,"box-left"),e.createElementVNode("div",{class:e.normalizeClass(["column fit-width no-wrap",[r.option.table?.fitHeight?"col":""]])},[r.option.search?.show!==!1?(e.openBlock(),e.createElementBlock("div",Oe,[e.createVNode(e.unref(h.ElForm),{model:e.unref(o).search.form,inline:"",size:r.option.size?.search},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"search-start",{row:e.unref(o).search.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).search.column.list,f=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:f.key},[e.renderSlot(m.$slots,"search-"+f.key+"-start",{row:e.unref(o).search.form}),(typeof f.show?.search=="function"?f.show?.search(e.unref(o).search.form):f.show?.search)?(e.openBlock(),e.createBlock(e.unref(h.ElFormItem),{key:0,label:f.text?.search?.label??f.label},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"search-"+f.key+"-left",{row:e.unref(o).search.form}),e.renderSlot(m.$slots,"search-"+f.key,{row:e.unref(o).search.form},()=>[f.options?.search?.type?(e.openBlock(),e.createBlock(U,{key:0,item:f,conf:e.unref(o),type:f.options.search.type},null,8,["item","conf","type"])):(e.openBlock(),e.createBlock(U,{key:1,item:f,conf:e.unref(o),type:f.type},null,8,["item","conf","type"]))]),e.renderSlot(m.$slots,"search-"+f.key+"-right",{row:e.unref(o).search.form})]),_:2},1032,["label"])):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"search-"+f.key+"-end",{row:e.unref(o).search.form})],64))),128)),e.renderSlot(m.$slots,"search-center",{row:e.unref(o).search.form}),r.option.tools?.search||r.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(h.ElFormItem),{key:0},{default:e.withCtx(()=>[r.option.tools?.search?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:0,type:"primary",onClick:e.unref(o).search.submit},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("search")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),r.option.tools?.reset?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:1,onClick:e.unref(o).search.reset},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("reset")),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"search-end",{row:e.unref(o).search.form})]),_:3},8,["model","size"])])):e.createCommentVNode("",!0),e.createElementVNode("div",Ue,[e.createElementVNode("div",Me,[e.unref(a)(r.option.tools?.add)?(e.openBlock(),e.createElementBlock("div",Le,[e.createVNode(e.unref(h.ElButton),{type:"primary",onClick:p[0]||(p[0]=f=>e.unref(o).update.open(e.unref(c).Add)),size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("add")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),r.option.table?.selectable&&e.unref(a)(r.option.tools?.delete)?(e.openBlock(),e.createElementBlock("div",He,[e.createVNode(e.unref(h.ElButton),{type:"danger",onClick:p[1]||(p[1]=f=>e.unref(o).remove.open(e.unref(o).table.selection.list)),size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("delete")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),r.option.tools?.expand?(e.openBlock(),e.createElementBlock("div",Ae,[e.createVNode(e.unref(h.ElButton),{type:"warning",onClick:p[2]||(p[2]=f=>e.unref(o).table.expand.all()),size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("expandCollapse")),1)]),_:1},8,["size"])])):e.createCommentVNode("",!0),r.option.tools?.export?.show?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[r.option.tools?.export?.dropdown?.show?(e.openBlock(),e.createBlock(e.unref(h.ElDropdown),{key:0,onCommand:e.unref(o).export.click},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(h.ElDropdownMenu),{size:r.option.size?.search},{default:e.withCtx(()=>[r.option.tools?.export?.dropdown?.select&&(r.option.table?.selectable||e.unref(a)(r.option.tools?.delete))?(e.openBlock(),e.createBlock(e.unref(h.ElDropdownItem),{key:0,command:"select"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("exportSelect")),1)]),_:1})):e.createCommentVNode("",!0),r.option.tools?.export?.dropdown?.page?(e.openBlock(),e.createBlock(e.unref(h.ElDropdownItem),{key:1,command:"page"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("exportPage")),1)]),_:1})):e.createCommentVNode("",!0),r.option.tools?.export?.dropdown?.all?(e.openBlock(),e.createBlock(e.unref(h.ElDropdownItem),{key:2,command:"all"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("exportAll")),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createElementVNode("div",je,[e.createVNode(e.unref(h.ElButton),{type:"warning",loading:e.unref(o).export.loading,size:r.option.size?.search},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("export")),1)]),_:1},8,["loading","size"])])]),_:1},8,["onCommand"])):(e.openBlock(),e.createElementBlock("div",Ie,[e.createVNode(e.unref(h.ElButton),{type:"warning",loading:e.unref(o).export.loading,size:r.option.size?.search,onClick:p[3]||(p[3]=f=>e.unref(o).export.run.start("all"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("export")),1)]),_:1},8,["loading","size"])]))],64)):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"tools-left")]),e.createElementVNode("div",Re,[e.renderSlot(m.$slots,"tools-right"),e.unref(o).page.showTools?(e.openBlock(),e.createBlock(e.unref(h.ElPagination),e.mergeProps({key:0,"current-page":e.unref(o).page.num,"onUpdate:currentPage":p[4]||(p[4]=f=>e.unref(o).page.num=f),"page-size":e.unref(o).page.size,"onUpdate:pageSize":p[5]||(p[5]=f=>e.unref(o).page.size=f),background:"","page-sizes":e.unref(o).page.sizeList,"pager-count":e.unref(o).page.pagerCount,layout:e.unref(o).page.layout,total:e.unref(o).page.total,size:r.option.size?.table,onSizeChange:e.unref(o).table.getList,onCurrentChange:e.unref(o).table.getList},r.option.page?.pagination||{},e.toHandlers(r.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0),r.option.tools?.expandColumn===void 0||r.option.tools?.expandColumn?(e.openBlock(),e.createBlock(s,{key:1,effect:"dark",content:e.unref(o).table.header.group.expand?e.unref(y).tCurd("mergeColumn"):e.unref(y).tCurd("expandColumn"),placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["refresh-btn",[r.option.size?.search]]),onClick:p[6]||(p[6]=(...f)=>e.unref(o).table.header.group.toggleExpandAll&&e.unref(o).table.header.group.toggleExpandAll(...f))},[e.unref(o).table.header.group.expand?(e.openBlock(),e.createBlock(De,{key:0})):(e.openBlock(),e.createBlock(Fe,{key:1}))],2)]),_:1},8,["content"])):e.createCommentVNode("",!0),r.option.tools?.refresh===void 0||r.option.tools?.refresh?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["refresh-btn",[r.option.size?.search]]),onClick:p[7]||(p[7]=(...f)=>e.unref(o).table.getList&&e.unref(o).table.getList(...f))},[e.createVNode(P)],2)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:e.normalizeClass(["fit-width relative form-box",[r.option.table?.fitHeight?"col ":"",r.option.table?.editMode?"edit-mode":""]])},[e.createElementVNode("div",{class:e.normalizeClass(["column form-box-content",[r.option.table?.fitHeight?"absolute fit":""]])},[e.withDirectives((e.openBlock(),e.createBlock(e.unref(h.ElTable),e.mergeProps({ref_key:"tableRef",ref:d,data:e.unref(o).table.data,border:r.option.table?.border===void 0?!0:r.option.table?.border,onSelectionChange:e.unref(o).table.selection.change,onSortChange:e.unref(o).table.sort.change,"expand-row-keys":e.unref(o).table.expand.rowKeys,onExpandChange:e.unref(o).table.expand.change},r.option.table,e.toHandlers(r.option.table?.on||{})),{default:e.withCtx(()=>[(typeof r.option.table?.selectable=="object"?r.option.table?.selectable?.show:r.option.table?.selectable)||e.unref(a)(r.option.tools?.delete)||r.option.tools?.export?.show&&r.option.tools?.export?.select?(e.openBlock(),e.createBlock(e.unref(h.ElTableColumn),e.mergeProps({key:0,type:"selection",width:"40",align:"center",fixed:"left","show-overflow-tooltip":!1,className:"cc1-form-selectable-column"},typeof r.option.table?.selectable=="object"?r.option.table?.selectable:{},e.toHandlers(typeof r.option.table?.selectable=="object"?r.option.table?.selectable?.on||{}:{})),null,16)):e.createCommentVNode("",!0),(typeof r.option.table?.index=="object"?r.option.table?.index?.show:r.option.table?.index)?(e.openBlock(),e.createBlock(e.unref(h.ElTableColumn),e.mergeProps({key:1,type:"index",fixed:"left",width:"40",align:"center",label:"#","show-overflow-tooltip":!1,className:"cc1-form-index-column"},typeof r.option.table?.index=="object"?r.option.table?.index:{},e.toHandlers(typeof r.option.table?.index=="object"?r.option.table?.index?.on||{}:{})),null,16)):e.createCommentVNode("",!0),e.createVNode(be,{conf:e.unref(o),columnList:e.unref(o).table.column.list,option:r.option},e.createSlots({_:2},[e.renderList(m.$slots,(f,g)=>({name:g,fn:e.withCtx(u=>[e.renderSlot(m.$slots,g,e.normalizeProps(e.guardReactiveProps(u||{})))])}))]),1032,["conf","columnList","option"]),e.unref(a)(r.option.table?.add)||e.unref(a)(r.option.table?.update)||e.unref(a)(r.option.table?.delete)||e.unref(a)(r.option.table?.view)||m.$slots["table-op-left"]||m.$slots["table-op-right"]?(e.openBlock(),e.createBlock(e.unref(h.ElTableColumn),e.mergeProps({key:2,width:"auto","max-width":"200",align:"center",fixed:"right"},r.option.table?.operate,{"show-overflow-tooltip":!1}),{header:e.withCtx(()=>[e.renderSlot(m.$slots,"table-header-op",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("operation")),1)])]),default:e.withCtx(({row:f})=>[e.createVNode(e.unref(h.ElForm),{size:r.option.size?.table},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"table-op-left",{row:f}),e.unref(o).update.type===e.unref(c).Update&&r.option.table?.inlineEdit&&e.unref(o).update.form[l.option.table?.rowKey]===f[l.option.table?.rowKey]?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(h.ElButton),{link:"",type:"info",onClick:e.unref(o).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("cancel")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(h.ElButton),{link:"",type:"primary",onClick:e.unref(o).update.submit,loading:e.unref(o).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("confirm")),1)]),_:1},8,["onClick","loading"]),e.renderSlot(m.$slots,"table-op-edit-right",{row:f})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(a)(r.option.table?.add,f)?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:0,link:"",type:"primary",onClick:g=>e.unref(o).update.open(e.unref(c).Add,f)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("add")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(r.option.table?.view,f)?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:1,link:"",type:"primary",onClick:g=>e.unref(o).update.open(e.unref(c).View,f)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("view")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(r.option.table?.update,f)?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:2,link:"",type:"warning",onClick:g=>e.unref(o).update.open(e.unref(c).Update,f)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("edit")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.unref(a)(r.option.table?.delete,f)?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:3,link:"",type:"danger",onClick:g=>e.unref(o).remove.open([f])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("delete")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"table-op-right",{row:f})],64))]),_:2},1032,["size"])]),_:3},16)):e.createCommentVNode("",!0)]),_:3},16,["data","border","onSelectionChange","onSortChange","expand-row-keys","onExpandChange"])),[[k,e.unref(o).table.loading]])],2)],2),e.createElementVNode("div",Ke,[(r.option.page?.show===void 0||r.option.page?.show)&&!e.unref(o).page.showTools?(e.openBlock(),e.createBlock(e.unref(h.ElPagination),e.mergeProps({key:0,"current-page":e.unref(o).page.num,"onUpdate:currentPage":p[8]||(p[8]=f=>e.unref(o).page.num=f),"page-size":e.unref(o).page.size,"onUpdate:pageSize":p[9]||(p[9]=f=>e.unref(o).page.size=f),background:"","page-sizes":e.unref(o).page.sizeList,"pager-count":e.unref(o).page.pagerCount,layout:e.unref(o).page.layout,total:e.unref(o).page.total,size:r.option.size?.table,onSizeChange:e.unref(o).table.getList,onCurrentChange:e.unref(o).table.getList},r.option.page?.pagination||{},e.toHandlers(r.option.page?.pagination?.on||{})),null,16,["current-page","page-size","page-sizes","pager-count","layout","total","size","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0)])],2),e.renderSlot(m.$slots,"box-right")],2),e.createVNode(e.unref(h.ElDialog),e.mergeProps({modelValue:e.unref(o).update.show,"onUpdate:modelValue":p[10]||(p[10]=f=>e.unref(o).update.show=f),title:e.unref(o).update.title,"before-close":e.unref(o).update.close},r.option.dialog),{footer:e.withCtx(()=>[e.createElementVNode("span",xe,[e.createVNode(e.unref(h.ElForm),{size:r.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(h.ElButton),{onClick:e.unref(o).update.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("close")),1)]),_:1},8,["onClick"]),e.unref(o).update.type!==e.unref(c).View?(e.openBlock(),e.createBlock(e.unref(h.ElButton),{key:0,type:"primary",onClick:e.unref(o).update.submit,loading:e.unref(o).update.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("submit")),1)]),_:1},8,["onClick","loading"])):e.createCommentVNode("",!0)]),_:1},8,["size"])])]),default:e.withCtx(()=>[e.createVNode(e.unref(h.ElForm),{ref_key:"ruleFormRef",ref:i,model:e.unref(o).update.form,rules:e.unref(o).update.rules,size:r.option.size?.form,class:"update-dialog-form"},{default:e.withCtx(()=>[e.unref(o).update.showContent?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(o).update.formColumn,f=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)((()=>{const g=[],u=E=>{E?.item?.children?u(E.item.children):g.push(...E.map(V=>V.item?.show?.form))};return u(f),g})(),e.unref(o).update.form,e.unref(o).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["row curd-row",{stripe:r.option.form?.stripe===void 0?!0:r.option.form?.stripe}])},[e.renderSlot(m.$slots,"form-start",{row:e.unref(o).update.form}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f,g=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)(g.item.show?.form,e.unref(o).update.form,e.unref(o).update.type)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([g.item.form.span>0?`col-${e.unref(o).getColumnSpan(g,f)}`:"col",`form-item-col-${g.item.key}`])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.item.children?g.children:[g],u=>(e.openBlock(),e.createBlock(Ve,{key:u.item.key,conf:e.unref(o),item:u},e.createSlots({_:2},[e.renderList(m.$slots,(E,V)=>({name:V,fn:e.withCtx(S=>[e.renderSlot(m.$slots,V,e.mergeProps({ref_for:!0},S||{}))])}))]),1032,["conf","item"]))),128))],2)):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(m.$slots,"form-end",{row:e.unref(o).update.form})],2)):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0)]),_:3},8,["model","rules","size"])]),_:3},16,["modelValue","title","before-close"]),e.createVNode(e.unref(h.ElDialog),{modelValue:e.unref(o).remove.show,"onUpdate:modelValue":p[11]||(p[11]=f=>e.unref(o).remove.show=f),title:e.unref(o).remove.title,"close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createElementVNode("span",Ge,[e.createVNode(e.unref(h.ElForm),{size:r.option.size?.form},{default:e.withCtx(()=>[e.createVNode(e.unref(h.ElButton),{onClick:e.unref(o).remove.close},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("close")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(h.ElButton),{type:"danger",onClick:e.unref(o).remove.submit,loading:e.unref(o).remove.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y).tCurd("confirmDelete")),1)]),_:1},8,["onClick","loading"])]),_:1},8,["size"])])]),default:e.withCtx(()=>[r.option.dialog?.delete?.content?(e.openBlock(),e.createElementBlock("div",We,[e.createVNode(v,{content:r.option.dialog?.delete?.content,value:e.unref(o).remove.items},null,8,["content","value"])])):(e.openBlock(),e.createElementBlock("div",qe,e.toDisplayString(e.unref(y).tCurd("confirmDeleteMessage",e.unref(o).remove.items.length)),1))]),_:1},8,["modelValue","title"]),e.createVNode(Q,{ref_key:"switchConfirmRef",ref:t,size:r.option.size?.form},null,8,["size"])],2)}}});class Je{static async download(n,c="download.png"){const l=document.createElement("a");l.style.display="none",l.href=n,l.setAttribute("download",c),typeof l.download>"u"&&l.setAttribute("target","_blank"),document.body.appendChild(l),l.click(),document.body.removeChild(l),window.URL.revokeObjectURL(n)}static exportJSONFile=(n,c)=>{const l=new Blob([JSON.stringify(n)],{type:"application/json"}),a=URL.createObjectURL(l),o=document.createElement("a");o.href=a,o.download=`${c||"config"}.json`,o.click()};static importFile=async n=>new Promise((c,l)=>{const a=document.createElement("input");a.type="file";const o=n?.accept||".json";a.accept=o,a.style.display="none",a.onchange=t=>{const i=t.target.files[0];if(!i){b.fail("未选择文件"),l("未选择文件");return}const d=new FileReader;d.onload=async m=>{const p=o==".json"?JSON.parse(m.target.result):m.target.result;c(p)},d.onerror=()=>{b.fail("文件读取失败"),l("文件读取失败")},d.readAsText(i),document.body.removeChild(a)},document.body.appendChild(a),a.click()})}const L=(r,n)=>{if(r.component("TCurd",M),r.component("TFormList",T),r.component("TColumn",F),n?.customComponent){B.customComponent=n.customComponent;for(const c in n.customComponent)r.component(c,n.customComponent[c])}},Qe={install:L};C.ArrUtil=N,C.ExcelUtil=O,C.TColumn=F,C.TCurd=M,C.TFile=Je,C.TForm=B,C.TFormConfig=w,C.TFormI18n=y,C.TFormList=T,C.TSys=b,C.default=Qe,C.install=L,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc1-form",
3
- "version": "1.2.16",
3
+ "version": "1.2.17",
4
4
  "description": "我来助你-表单组件库",
5
5
  "repository": {
6
6
  "type": "git",