cc1-form 1.3.9 → 1.4.1

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
@@ -73,9 +73,9 @@ class E {
73
73
  * @param options 其他选项
74
74
  */
75
75
  static showMessage(o, s, t = {}) {
76
- const n = Date.now();
77
- if (!this.tipMessages[o] || n - this.tipMessages[o] > this.tipMessagesGap) {
78
- this.tipMessages[o] = n;
76
+ const l = Date.now();
77
+ if (!this.tipMessages[o] || l - this.tipMessages[o] > this.tipMessagesGap) {
78
+ this.tipMessages[o] = l;
79
79
  const e = Object.assign(
80
80
  {
81
81
  message: o,
@@ -127,11 +127,11 @@ class E {
127
127
  */
128
128
  static openUrl = (o, s = !0) => {
129
129
  if (s) {
130
- let t = screen.width / 2 - 500, n = screen.height / 2 - 800 / 2 - 30;
130
+ let t = screen.width / 2 - 500, l = screen.height / 2 - 800 / 2 - 30;
131
131
  window.open(
132
132
  o,
133
133
  "_blank",
134
- "toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + n + ", left=" + t
134
+ "toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + l + ", left=" + t
135
135
  );
136
136
  } else
137
137
  window.open(o, "DescriptiveWindowName" + StrUtil.getId(), "resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0");
@@ -142,10 +142,10 @@ class E {
142
142
  * @returns
143
143
  */
144
144
  static getImgPic = (o) => new Promise(async (s, t) => {
145
- let n = document.getElementById(o.id);
145
+ let l = document.getElementById(o.id);
146
146
  const e = await E.loadModule("html2canvas");
147
147
  try {
148
- e(n, {
148
+ e(l, {
149
149
  logging: !1,
150
150
  allowTaint: !0,
151
151
  scale: window.devicePixelRatio,
@@ -156,8 +156,8 @@ class E {
156
156
  useCORS: !0,
157
157
  backgroundColor: "#ffffff00"
158
158
  }).then(function(r) {
159
- let l = r.toDataURL("image/png");
160
- s(l);
159
+ let n = r.toDataURL("image/png");
160
+ s(n);
161
161
  });
162
162
  } catch (r) {
163
163
  t(r);
@@ -565,9 +565,9 @@ class q {
565
565
  * @returns 该字段对应类型的 options 配置,如 select 类型返回 `options.select`
566
566
  */
567
567
  static findOptions = (o, s) => {
568
- const t = o.column.find((e) => e.key === s), n = (e) => e.replace(/-([a-z])/g, (r, l) => l.toUpperCase());
568
+ const t = o.column.find((e) => e.key === s), l = (e) => e.replace(/-([a-z])/g, (r, n) => n.toUpperCase());
569
569
  if (t)
570
- return t.options[n(t.type)];
570
+ return t.options[l(t.type)];
571
571
  };
572
572
  /**
573
573
  * 更新组件数据
@@ -586,8 +586,8 @@ class q {
586
586
  )
587
587
  */
588
588
  static setOptionsData = (o, s, t) => {
589
- const n = q.findOptions(o, s);
590
- n && (n.data = t);
589
+ const l = q.findOptions(o, s);
590
+ l && (l.data = t);
591
591
  };
592
592
  static form = {
593
593
  openBefore: {
@@ -598,9 +598,9 @@ class q {
598
598
  * @param treeData 树形数据
599
599
  * @param option 组件配置
600
600
  */
601
- parentId: (o, s, t, n) => {
601
+ parentId: (o, s, t, l) => {
602
602
  const e = T.config.table.rowKey;
603
- o ? s.type === E.EDialog.Add ? (s.form.parentId = o[e], s.form.sort = o.children.length + 1) : s.form.parentId = o.parentId.substring(o.parentId.lastIndexOf(",") + 1) : (s.form.parentId = "0", s.form.sort = t.length + 1), q.setOptionsData(n, "parentId", [{ [e]: "0", title: "根", children: t }]);
603
+ o ? s.type === E.EDialog.Add ? (s.form.parentId = o[e], s.form.sort = o.children.length + 1) : s.form.parentId = o.parentId.substring(o.parentId.lastIndexOf(",") + 1) : (s.form.parentId = "0", s.form.sort = t.length + 1), q.setOptionsData(l, "parentId", [{ [e]: "0", title: "根", children: t }]);
604
604
  }
605
605
  }
606
606
  };
@@ -617,12 +617,12 @@ class X {
617
617
  */
618
618
  static setId = (o, s, t) => {
619
619
  s[o] || (s[o] = []);
620
- const n = T.config.table.rowKey;
620
+ const l = T.config.table.rowKey;
621
621
  s[o].forEach((e) => {
622
622
  t.forEach((r) => {
623
- let l = r.default ?? "";
624
- r.type === "number" && (l = r.default ?? 0), r.type === "boolean" && (l = r.default ?? !1), r.type === "time" && (l = r.default ?? /* @__PURE__ */ new Date()), e[r.value] === void 0 && (e[r.value] = l);
625
- }), e[n] || (e[n] = X.getIdFun());
623
+ let n = r.default ?? "";
624
+ r.type === "number" && (n = r.default ?? 0), r.type === "boolean" && (n = r.default ?? !1), r.type === "time" && (n = r.default ?? /* @__PURE__ */ new Date()), e[r.value] === void 0 && (e[r.value] = n);
625
+ }), e[l] || (e[l] = X.getIdFun());
626
626
  });
627
627
  };
628
628
  /**
@@ -632,19 +632,19 @@ class X {
632
632
  * @param itemFields 元素字段-如:[{label:'',value:''}]
633
633
  * @param callback 回调函数
634
634
  */
635
- static add = (o, s, t, n) => {
635
+ static add = (o, s, t, l) => {
636
636
  const e = JSONUtil.cp(t);
637
637
  X.setId(o, s, t);
638
638
  const r = T.config.table.rowKey;
639
639
  s[o].push(
640
640
  e.reduce(
641
- (l, u) => {
641
+ (n, u) => {
642
642
  let f = u.default ?? "";
643
- return u.type === "number" && (f = u.default ?? 0), u.type === "boolean" && (f = u.default ?? !1), u.type === "time" && (f = u.default ?? /* @__PURE__ */ new Date()), l[u.value] = f, l;
643
+ return u.type === "number" && (f = u.default ?? 0), u.type === "boolean" && (f = u.default ?? !1), u.type === "time" && (f = u.default ?? /* @__PURE__ */ new Date()), n[u.value] = f, n;
644
644
  },
645
645
  { [r]: X.getIdFun() }
646
646
  )
647
- ), n?.(s);
647
+ ), l?.(s);
648
648
  };
649
649
  /**
650
650
  * 删除数组元素
@@ -653,9 +653,9 @@ class X {
653
653
  * @param item 元素-如:{_id:''}
654
654
  * @param callback 回调函数
655
655
  */
656
- static remove = (o, s, t, n) => {
656
+ static remove = (o, s, t, l) => {
657
657
  const e = T.config.table.rowKey;
658
- s[o] = s[o].filter((r) => r[e] !== t[e]), n?.(s);
658
+ s[o] = s[o].filter((r) => r[e] !== t[e]), l?.(s);
659
659
  };
660
660
  /**
661
661
  * 获取没有id的数据
@@ -664,9 +664,9 @@ class X {
664
664
  * @returns 没有id的数据
665
665
  */
666
666
  static getNoIdData = (o, s) => {
667
- const t = JSONUtil.cp(o), n = T.config.table.rowKey;
667
+ const t = JSONUtil.cp(o), l = T.config.table.rowKey;
668
668
  return t.forEach((e) => {
669
- e[n] && delete e[n], s && e[s] && X.getNoIdData(e[s], s);
669
+ e[l] && delete e[l], s && e[s] && X.getNoIdData(e[s], s);
670
670
  }), t;
671
671
  };
672
672
  }
@@ -718,27 +718,27 @@ const Ct = {
718
718
  setup(a, { emit: o }) {
719
719
  const s = a, t = ie({
720
720
  show: !1,
721
- add: (e, r, l) => {
722
- X.add(e, r, l, () => {
723
- n("change");
721
+ add: (e, r, n) => {
722
+ X.add(e, r, n, () => {
723
+ l("change");
724
724
  });
725
725
  },
726
- remove: (e, r, l) => {
727
- X.remove(e, r, l, () => {
728
- n("change");
726
+ remove: (e, r, n) => {
727
+ X.remove(e, r, n, () => {
728
+ l("change");
729
729
  });
730
730
  }
731
731
  });
732
732
  He(() => {
733
733
  X.setId(s.field, s.row, s.itemFields), t.show = !0;
734
734
  });
735
- const n = o;
735
+ const l = o;
736
736
  return (e, r) => {
737
- const l = pe("el-button"), u = pe("el-input");
737
+ const n = pe("el-button"), u = pe("el-input");
738
738
  return t.show ? (m(), C("div", Ct, [
739
739
  z(e.$slots, "list-start", { row: a.row }),
740
740
  a.addBottom ? V("", !0) : (m(), C("div", Vt, [
741
- M(l, {
741
+ M(n, {
742
742
  link: "",
743
743
  type: "primary",
744
744
  onClick: r[0] || (r[0] = (f) => t.add(a.field, a.row, a.itemFields))
@@ -760,13 +760,13 @@ const Ct = {
760
760
  style: ye({ width: a.inputWidth }),
761
761
  class: J(a.inputClass),
762
762
  placeholder: d[a.label] || d[a.value],
763
- onChange: r[1] || (r[1] = (b) => n("change"))
763
+ onChange: r[1] || (r[1] = (b) => l("change"))
764
764
  }, null, 8, ["modelValue", "onUpdate:modelValue", "style", "class", "placeholder"]))), 256)),
765
765
  z(e.$slots, "item-end", {
766
766
  item: f,
767
767
  row: a.row
768
768
  }),
769
- M(l, {
769
+ M(n, {
770
770
  link: "",
771
771
  type: "danger",
772
772
  onClick: (d) => t.remove(a.field, a.row, f)
@@ -778,7 +778,7 @@ const Ct = {
778
778
  }, 1032, ["onClick"])
779
779
  ]))), 256)),
780
780
  a.addBottom ? (m(), C("div", Et, [
781
- M(l, {
781
+ M(n, {
782
782
  link: "",
783
783
  type: "primary",
784
784
  onClick: r[2] || (r[2] = (f) => t.add(a.field, a.row, a.itemFields))
@@ -811,13 +811,13 @@ const Ct = {
811
811
  const o = a, s = Y(), t = () => {
812
812
  const e = s.value?.validateState;
813
813
  return e && typeof e == "object" && "value" in e ? e.value : e;
814
- }, n = () => {
814
+ }, l = () => {
815
815
  t() === "error" && s.value?.clearValidate?.();
816
816
  };
817
817
  return Ne(
818
818
  () => o.form?.[o.item.key],
819
819
  () => {
820
- n(), Ce(() => n());
820
+ l(), Ce(() => l());
821
821
  },
822
822
  { deep: !0, flush: "post" }
823
823
  ), (e, r) => (m(), y(i(he), {
@@ -842,7 +842,7 @@ const Ct = {
842
842
  e.item.type === "input" ? (m(), y(i(fe), S({
843
843
  key: 0,
844
844
  modelValue: e.form[e.item.key],
845
- "onUpdate:modelValue": r[0] || (r[0] = (l) => e.form[e.item.key] = l)
845
+ "onUpdate:modelValue": r[0] || (r[0] = (n) => e.form[e.item.key] = n)
846
846
  }, e.getBind(e.item), $(e.getOn(e.item)), {
847
847
  disabled: e.getDisabled(e.item)
848
848
  }), Z({ _: 2 }, [
@@ -856,83 +856,83 @@ const Ct = {
856
856
  ]), 1040, ["modelValue", "disabled"])) : e.item.type === "number" ? (m(), y(i(dt), S({
857
857
  key: 1,
858
858
  modelValue: e.form[e.item.key],
859
- "onUpdate:modelValue": r[1] || (r[1] = (l) => e.form[e.item.key] = l)
859
+ "onUpdate:modelValue": r[1] || (r[1] = (n) => e.form[e.item.key] = n)
860
860
  }, e.getBind(e.item), $(e.getOn(e.item)), {
861
861
  disabled: e.getDisabled(e.item)
862
862
  }), null, 16, ["modelValue", "disabled"])) : e.item.type === "textarea" ? (m(), y(i(fe), S({
863
863
  key: 2,
864
864
  type: "textarea",
865
865
  modelValue: e.form[e.item.key],
866
- "onUpdate:modelValue": r[2] || (r[2] = (l) => e.form[e.item.key] = l)
866
+ "onUpdate:modelValue": r[2] || (r[2] = (n) => e.form[e.item.key] = n)
867
867
  }, e.getBind(e.item), $(e.getOn(e.item)), {
868
868
  disabled: e.getDisabled(e.item)
869
869
  }), null, 16, ["modelValue", "disabled"])) : e.item.type === "switch" ? (m(), y(i(ge), S({
870
870
  key: 3,
871
871
  modelValue: e.form[e.item.key],
872
- "onUpdate:modelValue": r[3] || (r[3] = (l) => e.form[e.item.key] = l)
872
+ "onUpdate:modelValue": r[3] || (r[3] = (n) => e.form[e.item.key] = n)
873
873
  }, e.getBind(e.item), $(e.getOn(e.item)), {
874
874
  disabled: e.getDisabled(e.item)
875
875
  }), null, 16, ["modelValue", "disabled"])) : e.item.type === "select" ? (m(), y(i(ce), S({
876
876
  key: 4,
877
877
  modelValue: e.form[e.item.key],
878
- "onUpdate:modelValue": r[4] || (r[4] = (l) => e.form[e.item.key] = l)
878
+ "onUpdate:modelValue": r[4] || (r[4] = (n) => e.form[e.item.key] = n)
879
879
  }, e.getBind(e.item), $(e.getOn(e.item)), {
880
880
  disabled: e.getDisabled(e.item),
881
881
  style: { width: "100%" }
882
882
  }), {
883
883
  default: h(() => [
884
- (m(!0), C(A, null, G(e.getBind(e.item).data || [], (l) => (m(), y(i(ne), S({
885
- key: l.value,
884
+ (m(!0), C(A, null, G(e.getBind(e.item).data || [], (n) => (m(), y(i(ne), S({
885
+ key: n.value,
886
886
  ref_for: !0
887
- }, l, $(l.on || {})), null, 16))), 128))
887
+ }, n, $(n.on || {})), null, 16))), 128))
888
888
  ]),
889
889
  _: 1
890
890
  }, 16, ["modelValue", "disabled"])) : e.item.type === "radio" ? (m(), y(i(je), S({
891
891
  key: 5,
892
892
  modelValue: e.form[e.item.key],
893
- "onUpdate:modelValue": r[5] || (r[5] = (l) => e.form[e.item.key] = l)
893
+ "onUpdate:modelValue": r[5] || (r[5] = (n) => e.form[e.item.key] = n)
894
894
  }, e.getBind(e.item), $(e.getOn(e.item)), {
895
895
  disabled: e.getDisabled(e.item),
896
896
  style: { width: "100%" }
897
897
  }), {
898
898
  default: h(() => [
899
- e.getBind(e.item).type === "group" ? (m(!0), C(A, { key: 0 }, G(e.getBind(e.item).data || [], (l) => (m(), y(i(ut), S({
900
- key: l.value,
899
+ e.getBind(e.item).type === "group" ? (m(!0), C(A, { key: 0 }, G(e.getBind(e.item).data || [], (n) => (m(), y(i(ut), S({
900
+ key: n.value,
901
901
  ref_for: !0
902
- }, l, $(l.on || {})), null, 16))), 128)) : (m(!0), C(A, { key: 1 }, G(e.getBind(e.item).data || [], (l) => (m(), y(i(Pe), S({
903
- key: l.value,
902
+ }, n, $(n.on || {})), null, 16))), 128)) : (m(!0), C(A, { key: 1 }, G(e.getBind(e.item).data || [], (n) => (m(), y(i(Pe), S({
903
+ key: n.value,
904
904
  ref_for: !0
905
- }, l, $(l.on || {})), null, 16))), 128))
905
+ }, n, $(n.on || {})), null, 16))), 128))
906
906
  ]),
907
907
  _: 1
908
908
  }, 16, ["modelValue", "disabled"])) : e.item.type === "checkbox" ? (m(), y(i(ft), S({
909
909
  key: 6,
910
910
  modelValue: e.form[e.item.key],
911
- "onUpdate:modelValue": r[6] || (r[6] = (l) => e.form[e.item.key] = l)
911
+ "onUpdate:modelValue": r[6] || (r[6] = (n) => e.form[e.item.key] = n)
912
912
  }, e.getBind(e.item), $(e.getOn(e.item)), {
913
913
  disabled: e.getDisabled(e.item),
914
914
  style: { width: "100%" }
915
915
  }), {
916
916
  default: h(() => [
917
- e.getBind(e.item).type === "group" ? (m(!0), C(A, { key: 0 }, G(e.getBind(e.item).data || [], (l) => (m(), y(i(ct), S({
918
- key: l.value,
917
+ e.getBind(e.item).type === "group" ? (m(!0), C(A, { key: 0 }, G(e.getBind(e.item).data || [], (n) => (m(), y(i(ct), S({
918
+ key: n.value,
919
919
  ref_for: !0
920
- }, l, $(l.on || {})), null, 16))), 128)) : (m(!0), C(A, { key: 1 }, G(e.getBind(e.item).data || [], (l) => (m(), y(i(pt), S({
921
- key: l.value,
920
+ }, n, $(n.on || {})), null, 16))), 128)) : (m(!0), C(A, { key: 1 }, G(e.getBind(e.item).data || [], (n) => (m(), y(i(pt), S({
921
+ key: n.value,
922
922
  ref_for: !0
923
- }, l, $(l.on || {})), null, 16))), 128))
923
+ }, n, $(n.on || {})), null, 16))), 128))
924
924
  ]),
925
925
  _: 1
926
926
  }, 16, ["modelValue", "disabled"])) : e.item.type === "color" ? (m(), y(i(mt), S({
927
927
  key: 7,
928
928
  modelValue: e.form[e.item.key],
929
- "onUpdate:modelValue": r[7] || (r[7] = (l) => e.form[e.item.key] = l)
929
+ "onUpdate:modelValue": r[7] || (r[7] = (n) => e.form[e.item.key] = n)
930
930
  }, e.getBind(e.item), $(e.getOn(e.item)), {
931
931
  disabled: e.getDisabled(e.item)
932
932
  }), null, 16, ["modelValue", "disabled"])) : e.item.type === "slider" ? (m(), y(i(bt), S({
933
933
  key: 8,
934
934
  modelValue: e.form[e.item.key],
935
- "onUpdate:modelValue": r[8] || (r[8] = (l) => e.form[e.item.key] = l)
935
+ "onUpdate:modelValue": r[8] || (r[8] = (n) => e.form[e.item.key] = n)
936
936
  }, e.getBind(e.item), $(e.getOn(e.item)), {
937
937
  disabled: e.getDisabled(e.item)
938
938
  }), null, 16, ["modelValue", "disabled"])) : e.item.type === "list" ? (m(), y(We, S({
@@ -945,26 +945,26 @@ const Ct = {
945
945
  }), null, 16, ["row", "field", "disabled"])) : e.item.type === "treeSelect" ? (m(), y(i(gt), S({
946
946
  key: 10,
947
947
  modelValue: e.form[e.item.key],
948
- "onUpdate:modelValue": r[9] || (r[9] = (l) => e.form[e.item.key] = l)
948
+ "onUpdate:modelValue": r[9] || (r[9] = (n) => e.form[e.item.key] = n)
949
949
  }, e.getBind(e.item), $(e.getOn(e.item)), {
950
950
  disabled: e.getDisabled(e.item),
951
951
  style: { width: "100%" }
952
952
  }), null, 16, ["modelValue", "disabled"])) : e.item.type === "datetime" ? (m(), y(i(Ke), S({
953
953
  key: 11,
954
954
  modelValue: e.form[e.item.key],
955
- "onUpdate:modelValue": r[10] || (r[10] = (l) => e.form[e.item.key] = l)
955
+ "onUpdate:modelValue": r[10] || (r[10] = (n) => e.form[e.item.key] = n)
956
956
  }, e.getBind(e.item), $(e.getOn(e.item)), {
957
957
  disabled: e.getDisabled(e.item)
958
958
  }), null, 16, ["modelValue", "disabled"])) : e.item.type && typeof e.item.type == "object" ? (m(), y(ee(e.item.type), S({
959
959
  key: 12,
960
960
  modelValue: e.form[e.item.key],
961
- "onUpdate:modelValue": r[11] || (r[11] = (l) => e.form[e.item.key] = l)
961
+ "onUpdate:modelValue": r[11] || (r[11] = (n) => e.form[e.item.key] = n)
962
962
  }, e.getBind(e.item), $(e.getOn(e.item)), {
963
963
  disabled: e.getDisabled(e.item)
964
964
  }), null, 16, ["modelValue", "disabled"])) : e.item.type && (i(q).customComponent[e.item.type] || i(q).customComponent[e.item.type]?.form) ? (m(), y(ee(i(q).customComponent[e.item.type]?.form || i(q).customComponent[e.item.type]), S({
965
965
  key: 13,
966
966
  modelValue: e.form[e.item.key],
967
- "onUpdate:modelValue": r[12] || (r[12] = (l) => e.form[e.item.key] = l)
967
+ "onUpdate:modelValue": r[12] || (r[12] = (n) => e.form[e.item.key] = n)
968
968
  }, e.getBind(e.item), $(e.getOn(e.item)), {
969
969
  disabled: e.getDisabled(e.item)
970
970
  }), null, 16, ["modelValue", "disabled"])) : V("", !0)
@@ -1044,7 +1044,7 @@ class k {
1044
1044
  return o(...s);
1045
1045
  o = String(o);
1046
1046
  let t = 0;
1047
- return o.replace(/{([^}]+)}/g, (n, e) => t < s.length ? String(s[t++]) : `{${e}}`);
1047
+ return o.replace(/{([^}]+)}/g, (l, e) => t < s.length ? String(s[t++]) : `{${e}}`);
1048
1048
  }
1049
1049
  static setI18n = (o) => {
1050
1050
  k.curd = ObjectUtil.deepMerge(k.curd, o);
@@ -1075,15 +1075,15 @@ class x {
1075
1075
  * @returns
1076
1076
  */
1077
1077
  static setValue = (o, s, t = !1) => {
1078
- t && x.delAllKey(o), Object.keys(s).forEach((n) => {
1079
- o[n] !== s[n] && (o[n] = s[n]);
1078
+ t && x.delAllKey(o), Object.keys(s).forEach((l) => {
1079
+ o[l] !== s[l] && (o[l] = s[l]);
1080
1080
  });
1081
1081
  };
1082
1082
  }
1083
1083
  const we = (a) => {
1084
1084
  const o = ie({}), s = () => typeof a == "function" ? a() : a, t = () => {
1085
- const n = s();
1086
- return n ?? o;
1085
+ const l = s();
1086
+ return l ?? o;
1087
1087
  };
1088
1088
  return {
1089
1089
  internal: o,
@@ -1091,11 +1091,11 @@ const we = (a) => {
1091
1091
  get() {
1092
1092
  return t();
1093
1093
  },
1094
- set(n) {
1095
- x.setValue(t(), n, !0);
1094
+ set(l) {
1095
+ x.setValue(t(), l, !0);
1096
1096
  },
1097
- merge(n) {
1098
- x.setValue(t(), n, !1);
1097
+ merge(l) {
1098
+ x.setValue(t(), l, !1);
1099
1099
  },
1100
1100
  clear() {
1101
1101
  x.delAllKey(t());
@@ -1112,13 +1112,13 @@ const we = (a) => {
1112
1112
  field: t?.field || o,
1113
1113
  error: Dt(t)
1114
1114
  }))), be = E.EDialog, le = (a) => typeof a.type == "object" ? "component" : a.type || "input", Ut = (a, o, s) => {
1115
- const t = we(() => o.form), n = (r) => De(r.update.formGrid || [], r.update.form, r.update.type, r.update.formMaxSpan).map((u) => u.item.key).filter(Boolean), e = async (r) => {
1116
- const l = s.ruleFormRef.value;
1117
- if (!l) return !0;
1115
+ const t = we(() => o.form), l = (r) => De(r.update.formGrid || [], r.update.form, r.update.type, r.update.formMaxSpan).map((u) => u.item.key).filter(Boolean), e = async (r) => {
1116
+ const n = s.ruleFormRef.value;
1117
+ if (!n) return !0;
1118
1118
  await Ce();
1119
- const u = n(r), f = Object.keys(r.update.rules || {}).filter((b) => !u.includes(b));
1120
- if (f.length && l.clearValidate(f), !u.length) return !0;
1121
- if (!await l.validateField(u, async (b, c) => {
1119
+ const u = l(r), f = Object.keys(r.update.rules || {}).filter((b) => !u.includes(b));
1120
+ if (f.length && n.clearValidate(f), !u.length) return !0;
1121
+ if (!await n.validateField(u, async (b, c) => {
1122
1122
  b || me(ve(c));
1123
1123
  })) throw !1;
1124
1124
  return !0;
@@ -1141,26 +1141,26 @@ const we = (a) => {
1141
1141
  formColumn: [],
1142
1142
  formGrid: [],
1143
1143
  formMaxSpan: 12,
1144
- getDisabled: (r, l = !1) => {
1144
+ getDisabled: (r, n = !1) => {
1145
1145
  const u = a();
1146
- return o.option.table?.editMode && l ? r.disabled?.table === void 0 ? !1 : E.isFun(r.disabled?.table, u.update.form) : Qe(r, u.update.type, u.update.form);
1146
+ return o.option.table?.editMode && n ? r.disabled?.table === void 0 ? !1 : E.isFun(r.disabled?.table, u.update.form) : Qe(r, u.update.type, u.update.form);
1147
1147
  },
1148
1148
  getBind: (r) => {
1149
- const l = a();
1150
- return Xe(r, l.update.type);
1149
+ const n = a();
1150
+ return Xe(r, n.update.type);
1151
1151
  },
1152
- getOn: (r, l) => {
1152
+ getOn: (r, n) => {
1153
1153
  const u = a();
1154
- return Ye(r, u.update.type, [l || u.update.form, r]);
1154
+ return Ye(r, u.update.type, [n || u.update.form, r]);
1155
1155
  },
1156
1156
  getOptions: (r) => {
1157
- const l = a();
1157
+ const n = a();
1158
1158
  try {
1159
- const f = et(l.update.formGrid?.length ? l.update.formGrid : l.update.formColumn).find((d) => d.item.key === r)?.item;
1159
+ const f = et(n.update.formGrid?.length ? n.update.formGrid : n.update.formColumn).find((d) => d.item.key === r)?.item;
1160
1160
  return f ? {
1161
1161
  options: f.options,
1162
1162
  //@ts-ignore
1163
- bind: l.update.getBind(f)
1163
+ bind: n.update.getBind(f)
1164
1164
  } : { options: {}, bind: {} };
1165
1165
  } catch {
1166
1166
  return { options: {}, bind: {} };
@@ -1169,27 +1169,27 @@ const we = (a) => {
1169
1169
  edit: {
1170
1170
  data: {},
1171
1171
  getApiData: (r) => {
1172
- const l = a();
1172
+ const n = a();
1173
1173
  if (o.option.form?.editAll) return r;
1174
1174
  const u = {
1175
- [o.option.table?.rowKey]: l.update.edit.data[o.option.table?.rowKey]
1175
+ [o.option.table?.rowKey]: n.update.edit.data[o.option.table?.rowKey]
1176
1176
  };
1177
- return Object.keys(l.update.edit.data).forEach((f) => {
1178
- r[f] !== l.update.edit.data[f] && (u[f] = r[f]);
1177
+ return Object.keys(n.update.edit.data).forEach((f) => {
1178
+ r[f] !== n.update.edit.data[f] && (u[f] = r[f]);
1179
1179
  }), u;
1180
1180
  }
1181
1181
  },
1182
1182
  view: {},
1183
1183
  openLoading: !1,
1184
- open: async (r, l) => {
1184
+ open: async (r, n) => {
1185
1185
  const u = a();
1186
1186
  if (!(u.update.showContent || u.update.openLoading)) {
1187
1187
  E.loading(!0), u.update.openLoading = !0;
1188
1188
  try {
1189
1189
  u.update.type = r;
1190
1190
  const f = r === be.Add;
1191
- u.update.edit.data = f ? void 0 : JSONUtil.cp(l), u.update.title = k.tCurd(f ? "add" : r === be.View ? "view" : "edit");
1192
- const d = f ? ObjectUtil.deepMerge(JSONUtil.cp(u.update.formDefault), l ? JSONUtil.cp(l) : {}) : JSONUtil.cp(l);
1191
+ u.update.edit.data = f ? void 0 : JSONUtil.cp(n), u.update.title = k.tCurd(f ? "add" : r === be.View ? "view" : "edit");
1192
+ const d = f ? ObjectUtil.deepMerge(JSONUtil.cp(u.update.formDefault), n ? JSONUtil.cp(n) : {}) : JSONUtil.cp(n);
1193
1193
  x.setValue(u.update.form, d, !0), await u.initApiData("update"), await o.option.form?.openBefore?.(u.update.form, u.update), (!o.option.table?.inlineEdit || f) && (u.update.show = !0, u.update.showContent = !0), o.option.form?.openAfter?.(u.update.form, u.update);
1194
1194
  } catch (f) {
1195
1195
  console.error(f);
@@ -1198,16 +1198,20 @@ const we = (a) => {
1198
1198
  }
1199
1199
  }
1200
1200
  },
1201
+ /** 临时错误信息,直接赋值会取最后一个完成校验的错误信息,使用setErrorText方法只会提示第一个设置的错误信息 */
1202
+ errorText: "",
1203
+ /** 设置临时错误信息,只会提示第一个设置的错误信息 */
1204
+ setErrorText: (r) => {
1205
+ const n = a();
1206
+ n.update.errorText || (n.update.errorText = r);
1207
+ },
1201
1208
  validate: async (r = !0) => {
1202
- const l = a();
1209
+ const n = a();
1203
1210
  try {
1204
- const u = o.option.table?.editMode ? l.tableEditValidate.validate() : e(l);
1205
- return await Promise.all([
1206
- u,
1207
- l.formRef.validate()
1208
- ]), !0;
1211
+ const u = o.option.table?.editMode ? n.tableEditValidate.validate() : e(n);
1212
+ return await Promise.all([u, n.formRef.validate()]), !0;
1209
1213
  } catch {
1210
- return r && E.fail(k.tCurd("checkFormData")), !1;
1214
+ return r && E.fail(n.update.errorText || k.tCurd("checkFormData")), n.update.errorText = "", !1;
1211
1215
  }
1212
1216
  },
1213
1217
  submit: async () => {
@@ -1262,22 +1266,22 @@ const we = (a) => {
1262
1266
  return a.options?.[o === E.EDialog.Add ? "formAdd" : "formUpdate"]?.[s] || a.options?.[s] || {};
1263
1267
  }, Ye = (a, o, s = []) => {
1264
1268
  const t = le(a), e = a.options?.[o === E.EDialog.Add ? "formAdd" : "formUpdate"]?.[t]?.on || a.options?.[t]?.on || {}, r = {};
1265
- return Object.keys(e).forEach((l) => {
1266
- const u = e[l];
1267
- typeof u == "function" ? r[l] = function(...f) {
1269
+ return Object.keys(e).forEach((n) => {
1270
+ const u = e[n];
1271
+ typeof u == "function" ? r[n] = function(...f) {
1268
1272
  return u.apply(this, [...f, ...s]);
1269
- } : r[l] = u;
1273
+ } : r[n] = u;
1270
1274
  }), r;
1271
- }, Ze = (a, o, s, t, n) => {
1275
+ }, Ze = (a, o, s, t, l) => {
1272
1276
  const e = a, r = e.colSpan ?? a.span;
1273
1277
  if (!a.item.form?.spanCol)
1274
1278
  return r;
1275
- const l = n?.maxSpan || 12, u = n?.defaultSpan || l / 2, f = e.gridBand, b = o.filter((c) => f != null ? c.gridBand === f && !E.isFun(c.item.show?.form, s, t) : c.gridRow === e.gridRow && !E.isFun(c.item.show?.form, s, t)).reduce((c, p) => c + (p.colSpan ?? p.span ?? u), 0);
1279
+ const n = l?.maxSpan || 12, u = l?.defaultSpan || n / 2, f = e.gridBand, b = o.filter((c) => f != null ? c.gridBand === f && !E.isFun(c.item.show?.form, s, t) : c.gridRow === e.gridRow && !E.isFun(c.item.show?.form, s, t)).reduce((c, p) => c + (p.colSpan ?? p.span ?? u), 0);
1276
1280
  return r + b;
1277
1281
  }, Lt = (a, o) => {
1278
- const s = (t, n) => {
1279
- const e = t.gridRow, r = t.gridRow + t.rowSpan - 1, l = n.gridRow, u = n.gridRow + n.rowSpan - 1;
1280
- return e <= u && l <= r;
1282
+ const s = (t, l) => {
1283
+ const e = t.gridRow, r = t.gridRow + t.rowSpan - 1, n = l.gridRow, u = l.gridRow + l.rowSpan - 1;
1284
+ return e <= u && n <= r;
1281
1285
  };
1282
1286
  return a.map((t) => a.filter((e) => s(t, e)).length !== 1 || t.colSpan >= o ? t : {
1283
1287
  ...t,
@@ -1286,9 +1290,9 @@ const we = (a) => {
1286
1290
  gridColumn: 1
1287
1291
  });
1288
1292
  }, xe = (a, o, s = {}) => {
1289
- const t = /* @__PURE__ */ new Set(), n = [];
1293
+ const t = /* @__PURE__ */ new Set(), l = [];
1290
1294
  let e = 0, r = 0;
1291
- const l = (p) => Math.floor(p / W) * W, u = (p, w) => `${p},${w}`, f = (p, w, F, B) => {
1295
+ const n = (p) => Math.floor(p / W) * W, u = (p, w) => `${p},${w}`, f = (p, w, F, B) => {
1292
1296
  if (w + F > o) return !1;
1293
1297
  for (let L = 0; L < B; L++)
1294
1298
  for (let j = 0; j < F; j++)
@@ -1299,8 +1303,8 @@ const we = (a) => {
1299
1303
  for (let j = 0; j < F; j++)
1300
1304
  t.add(u(p + L, w + j));
1301
1305
  }, b = (p, w, F, B) => {
1302
- for (let j = l(p); j < 500 * W; j += W) {
1303
- const Ve = j + W, Se = j === l(p) ? Math.max(j, p) : j;
1306
+ for (let j = n(p); j < 500 * W; j += W) {
1307
+ const Ve = j + W, Se = j === n(p) ? Math.max(j, p) : j;
1304
1308
  for (let _ = Se; _ < Ve; _++) {
1305
1309
  const Ee = _ === p ? w : 0;
1306
1310
  for (let te = Ee; te <= o - F; te++)
@@ -1309,7 +1313,7 @@ const we = (a) => {
1309
1313
  }
1310
1314
  return { tr: p, tc: w };
1311
1315
  }, c = (p, w, F, B) => {
1312
- const L = l(p);
1316
+ const L = n(p);
1313
1317
  if (B < W && p + B < L + W) {
1314
1318
  e = p + B, r = w;
1315
1319
  return;
@@ -1323,11 +1327,11 @@ const we = (a) => {
1323
1327
  };
1324
1328
  return a.forEach((p) => {
1325
1329
  const w = p.colSpan ?? (p.span === 0 ? o : p.span), F = p.rowSpan ?? Je(p.item);
1326
- p.item.form?.rowBreak && n.length && (r = 0, e = l(e) + W);
1330
+ p.item.form?.rowBreak && l.length && (r = 0, e = n(e) + W);
1327
1331
  let { tr: B, tc: L } = f(e, r, w, F) ? { tr: e, tc: r } : b(e, r, w, F);
1328
1332
  f(B, L, w, F) || ({ tr: B, tc: L } = b(0, 0, w, F)), d(B, L, w, F);
1329
1333
  const j = B + 1;
1330
- n.push({
1334
+ l.push({
1331
1335
  ...p,
1332
1336
  span: w,
1333
1337
  colSpan: w,
@@ -1336,25 +1340,25 @@ const we = (a) => {
1336
1340
  gridColumn: L + 1,
1337
1341
  gridBand: re({ gridRow: j })
1338
1342
  }), c(B, L, w, F);
1339
- }), s.fillSingleRows ? Lt(n, o) : n;
1343
+ }), s.fillSingleRows ? Lt(l, o) : l;
1340
1344
  }, De = (a, o, s, t = W) => {
1341
- const n = a.filter((l) => E.isFun(l.item.show?.form, o, s)), e = /* @__PURE__ */ new Map();
1342
- a.forEach((l) => {
1343
- const f = `${l.gridBand ?? re(l)}:${l.gridColumn}:${l.colSpan}`;
1344
- e.has(f) || e.set(f, []), e.get(f).push(l);
1345
+ const l = a.filter((n) => E.isFun(n.item.show?.form, o, s)), e = /* @__PURE__ */ new Map();
1346
+ a.forEach((n) => {
1347
+ const f = `${n.gridBand ?? re(n)}:${n.gridColumn}:${n.colSpan}`;
1348
+ e.has(f) || e.set(f, []), e.get(f).push(n);
1345
1349
  });
1346
1350
  const r = /* @__PURE__ */ new Map();
1347
- return e.forEach((l) => {
1348
- const u = l.reduce((c, p) => c + p.rowSpan, 0);
1349
- if (!(l.length > 1 && u === W && l.every((c) => c.rowSpan < W))) return;
1350
- const d = l.filter((c) => E.isFun(c.item.show?.form, o, s));
1351
+ return e.forEach((n) => {
1352
+ const u = n.reduce((c, p) => c + p.rowSpan, 0);
1353
+ if (!(n.length > 1 && u === W && n.every((c) => c.rowSpan < W))) return;
1354
+ const d = n.filter((c) => E.isFun(c.item.show?.form, o, s));
1351
1355
  if (d.length !== 1) return;
1352
1356
  const b = d[0];
1353
1357
  r.set(b.item.key, {
1354
1358
  ...b,
1355
1359
  rowSpan: W
1356
1360
  });
1357
- }), xe(n.map((l) => r.get(l.item.key) || l), t, {
1361
+ }), xe(l.map((n) => r.get(n.item.key) || n), t, {
1358
1362
  fillSingleRows: !0
1359
1363
  });
1360
1364
  }, _e = (a) => {
@@ -1368,23 +1372,23 @@ const we = (a) => {
1368
1372
  const s = o.defaultSpan ?? (o.maxSpan || 12) / 2, t = Bt(a, s, o.layout);
1369
1373
  return { item: a, span: t };
1370
1374
  }, jt = (a, o = {}) => {
1371
- const s = [], t = (n) => {
1372
- if (n.children?.length) {
1373
- n.children.forEach((r) => t(r));
1375
+ const s = [], t = (l) => {
1376
+ if (l.children?.length) {
1377
+ l.children.forEach((r) => t(r));
1374
1378
  return;
1375
1379
  }
1376
- const e = Tt(n, o);
1380
+ const e = Tt(l, o);
1377
1381
  e && s.push(e);
1378
1382
  };
1379
- return a.forEach((n) => t(n)), s;
1383
+ return a.forEach((l) => t(l)), s;
1380
1384
  }, tt = (a, o = {}) => {
1381
- const s = o.maxSpan ?? 12, t = o.defaultSpan ?? s / 2, n = o.layout ?? "row", r = jt(a, { maxSpan: s, defaultSpan: t, layout: n });
1382
- if (n === "column") {
1383
- const l = [];
1385
+ const s = o.maxSpan ?? 12, t = o.defaultSpan ?? s / 2, l = o.layout ?? "row", r = jt(a, { maxSpan: s, defaultSpan: t, layout: l });
1386
+ if (l === "column") {
1387
+ const n = [];
1384
1388
  let u = 1;
1385
1389
  return r.forEach((f) => {
1386
1390
  const d = Je(f.item), b = s;
1387
- l.push({
1391
+ n.push({
1388
1392
  ...f,
1389
1393
  span: b,
1390
1394
  colSpan: b,
@@ -1393,7 +1397,7 @@ const we = (a) => {
1393
1397
  gridColumn: 1,
1394
1398
  gridBand: re({ gridRow: u })
1395
1399
  }), u += d;
1396
- }), { cells: l, maxSpan: s };
1400
+ }), { cells: n, maxSpan: s };
1397
1401
  }
1398
1402
  return { cells: xe(r, s), maxSpan: s };
1399
1403
  }, Pt = (a) => a.map((o) => o.item?.show?.form), Kt = (a, o, s) => {
@@ -1402,23 +1406,23 @@ const we = (a) => {
1402
1406
  required: !0,
1403
1407
  message: o(a),
1404
1408
  trigger: "blur"
1405
- }, n = le(a), e = a.options?.datetime?.type, r = n === "datetime" && typeof e == "string" && e.includes("range"), l = n === "select" && !!a.options?.select?.multiple;
1406
- (r || n === "checkbox" || l) && (t.type = "array", t.min = r ? 2 : 1);
1409
+ }, l = le(a), e = a.options?.datetime?.type, r = l === "datetime" && typeof e == "string" && e.includes("range"), n = l === "select" && !!a.options?.select?.multiple;
1410
+ (r || l === "checkbox" || n) && (t.type = "array", t.min = r ? 2 : 1);
1407
1411
  const u = typeof a.rules == "boolean" ? [t] : a.rules;
1408
1412
  return s ? u.map((f) => s(f)) : u;
1409
1413
  }, Le = (a) => typeof a == "function" ? a() : a, ot = (a) => (o, s) => Kt(o, a, (t) => {
1410
- const n = (e, r) => {
1414
+ const l = (e, r) => {
1411
1415
  if (r && Object.prototype.hasOwnProperty.call(r, o.key) && r[o.key] !== void 0) return r[o.key];
1412
- const l = Le(s);
1413
- return l && Object.prototype.hasOwnProperty.call(l, o.key) ? l[o.key] : e;
1416
+ const n = Le(s);
1417
+ return n && Object.prototype.hasOwnProperty.call(n, o.key) ? n[o.key] : e;
1414
1418
  };
1415
1419
  if (t.validator) {
1416
1420
  const e = t.validator;
1417
1421
  return {
1418
1422
  ...t,
1419
- validator: (r, l, u, f) => {
1423
+ validator: (r, n, u, f) => {
1420
1424
  const d = Le(s);
1421
- return e(r, n(l, f), u, d || f);
1425
+ return e(r, l(n, f), u, d || f);
1422
1426
  }
1423
1427
  };
1424
1428
  }
@@ -1430,8 +1434,8 @@ const we = (a) => {
1430
1434
  }, t = (s[le(a) || "input"] || s.input) + a.label;
1431
1435
  return (o || q.error.callback)?.(a.key, a) || t;
1432
1436
  }, nt = (a) => ot((o) => at(o, a?.error)), Ht = (a, o, s) => {
1433
- const t = {}, n = {}, e = o?.maxSpan || 12, r = o?.defaultSpan || e / 2, l = nt(o);
1434
- a.forEach((d) => ke(d, !0)), Re(a, t, n, (d) => l(d, s));
1437
+ const t = {}, l = {}, e = o?.maxSpan || 12, r = o?.defaultSpan || e / 2, n = nt(o);
1438
+ a.forEach((d) => ke(d, !0)), Re(a, t, l, (d) => n(d, s));
1435
1439
  const { cells: u, maxSpan: f } = tt(a, {
1436
1440
  maxSpan: e,
1437
1441
  defaultSpan: r,
@@ -1439,15 +1443,15 @@ const we = (a) => {
1439
1443
  });
1440
1444
  return {
1441
1445
  formDefault: t,
1442
- rules: n,
1446
+ rules: l,
1443
1447
  formGrid: u,
1444
1448
  formMaxSpan: f,
1445
1449
  formColumn: _e(u)
1446
1450
  };
1447
1451
  }, Re = (a, o, s, t) => {
1448
- const n = (e) => {
1452
+ const l = (e) => {
1449
1453
  if (e.children?.length) {
1450
- e.children.forEach((r) => n(r));
1454
+ e.children.forEach((r) => l(r));
1451
1455
  return;
1452
1456
  }
1453
1457
  if (e.key) {
@@ -1456,7 +1460,7 @@ const we = (a) => {
1456
1460
  r && (s[e.key] = r);
1457
1461
  }
1458
1462
  };
1459
- a.forEach(n);
1463
+ a.forEach(l);
1460
1464
  }, Nt = { class: "curd-form-cell-inner" }, lt = /* @__PURE__ */ Q({
1461
1465
  __name: "layout",
1462
1466
  props: {
@@ -1472,7 +1476,7 @@ const we = (a) => {
1472
1476
  getDisabled: { type: Function }
1473
1477
  },
1474
1478
  setup(a) {
1475
- const o = E.isFun, s = a, t = ae(() => De(s.formGrid, s.form, s.type, s.maxSpan)), n = ae(() => {
1479
+ const o = E.isFun, s = a, t = ae(() => De(s.formGrid, s.form, s.type, s.maxSpan)), l = ae(() => {
1476
1480
  const c = Array.from(
1477
1481
  new Set(
1478
1482
  t.value.map((p) => p.gridBand ?? re(p))
@@ -1487,9 +1491,9 @@ const we = (a) => {
1487
1491
  const w = p.gridRow + p.rowSpan - 1;
1488
1492
  w > c && (c = w);
1489
1493
  }), c;
1490
- }), l = (c) => c.gridRow + c.rowSpan - 1 >= r.value, u = (c) => c.rowSpan >= W, f = (c) => {
1494
+ }), n = (c) => c.gridRow + c.rowSpan - 1 >= r.value, u = (c) => c.rowSpan >= W, f = (c) => {
1491
1495
  const p = c.gridBand ?? re(c);
1492
- return n.value.get(p) ?? p;
1496
+ return l.value.get(p) ?? p;
1493
1497
  }, d = (c) => Ze(c, t.value, s.form, s.type, {
1494
1498
  maxSpan: s.maxSpan,
1495
1499
  defaultSpan: s.formOption?.defaultSpan
@@ -1511,7 +1515,7 @@ const we = (a) => {
1511
1515
  class: J(["curd-form-grid-cell", [
1512
1516
  c.stripe !== !1 && f(w) % 2 === 0 ? "stripe-band-odd" : "",
1513
1517
  w.gridColumn > 1 ? "has-col-border" : "",
1514
- c.stripe !== !1 && l(w) ? "is-last-row" : "",
1518
+ c.stripe !== !1 && n(w) ? "is-last-row" : "",
1515
1519
  u(w) ? "is-row-span" : "",
1516
1520
  `form-item-col-${w.item.key}`
1517
1521
  ]]),
@@ -1559,17 +1563,17 @@ const we = (a) => {
1559
1563
  }
1560
1564
  },
1561
1565
  setup(a, { expose: o }) {
1562
- const s = E.EDialog, t = Y(), n = a;
1563
- let e = we(n.form);
1564
- const r = Fe.getConf("curdConf"), l = "formRef-" + StrUtil.getId();
1566
+ const s = E.EDialog, t = Y(), l = a;
1567
+ let e = we(l.form);
1568
+ const r = Fe.getConf("curdConf"), n = "formRef-" + StrUtil.getId();
1565
1569
  Ie(() => {
1566
- r?.formRef?.remove(l);
1570
+ r?.formRef?.remove(n);
1567
1571
  });
1568
1572
  const u = ie({
1569
1573
  rules: {},
1570
1574
  show: !0,
1571
1575
  formDefault: {},
1572
- type: n.type || r?.update?.type || s.Add,
1576
+ type: l.type || r?.update?.type || s.Add,
1573
1577
  formColumn: [],
1574
1578
  formGrid: [],
1575
1579
  formMaxSpan: 12,
@@ -1583,11 +1587,11 @@ const we = (a) => {
1583
1587
  getBind: (f) => Xe(f, u.type),
1584
1588
  getOn: (f) => Ye(f, u.type, [u.form, f]),
1585
1589
  initColumnForm: () => {
1586
- const f = e, d = Ht(n.option.column, n.option.form, () => f.get());
1587
- u.formDefault = d.formDefault, u.rules = d.rules, u.formGrid = d.formGrid, u.formMaxSpan = d.formMaxSpan, u.formColumn = d.formColumn, u.type === s.Add ? f.isExternal() ? f.merge(JSONUtil.cp(u.formDefault)) : f.set(JSONUtil.cp(u.formDefault)) : !f.isExternal() && n.form && f.set(JSONUtil.cp(n.form));
1590
+ const f = e, d = Ht(l.option.column, l.option.form, () => f.get());
1591
+ u.formDefault = d.formDefault, u.rules = d.rules, u.formGrid = d.formGrid, u.formMaxSpan = d.formMaxSpan, u.formColumn = d.formColumn, u.type === s.Add ? f.isExternal() ? f.merge(JSONUtil.cp(u.formDefault)) : f.set(JSONUtil.cp(u.formDefault)) : !f.isExternal() && l.form && f.set(JSONUtil.cp(l.form));
1588
1592
  }
1589
1593
  });
1590
- return r?.formRef?.set(l, {
1594
+ return r?.formRef?.set(n, {
1591
1595
  validate: async (f) => {
1592
1596
  const d = t.value;
1593
1597
  if (!d)
@@ -1602,8 +1606,8 @@ const we = (a) => {
1602
1606
  if (f?.(!!p), !p) throw !1;
1603
1607
  return !0;
1604
1608
  }
1605
- }), n.option.form?.initStart?.(u), u.initColumnForm(), n.option.form?.initEnd?.(u), Ne(
1606
- () => n.form,
1609
+ }), l.option.form?.initStart?.(u), u.initColumnForm(), l.option.form?.initEnd?.(u), Ne(
1610
+ () => l.form,
1607
1611
  (f) => {
1608
1612
  e = we(f), u.initColumnForm();
1609
1613
  }
@@ -1641,14 +1645,14 @@ const we = (a) => {
1641
1645
  }), Gt = (a) => a?.value || a, Wt = (a) => {
1642
1646
  const o = Gt(a);
1643
1647
  return o?.validate ? new Promise((s, t) => {
1644
- let n = !1;
1645
- const e = (r, l) => {
1646
- n || (n = !0, r === !1 ? (me(ve(l)), t(!1)) : s(!0));
1648
+ let l = !1;
1649
+ const e = (r, n) => {
1650
+ l || (l = !0, r === !1 ? (me(ve(n)), t(!1)) : s(!0));
1647
1651
  };
1648
1652
  try {
1649
1653
  const r = o.validate(e);
1650
- r && typeof r.then == "function" ? r.then((l) => e(l)).catch((l) => {
1651
- me(ve(l?.fields || l)), t(l);
1654
+ r && typeof r.then == "function" ? r.then((n) => e(n)).catch((n) => {
1655
+ me(ve(n?.fields || n)), t(n);
1652
1656
  }) : (r !== void 0 || o.validate.length === 0) && e(r);
1653
1657
  } catch (r) {
1654
1658
  t(r);
@@ -1687,11 +1691,11 @@ const we = (a) => {
1687
1691
  */
1688
1692
  regFormRef(o, s, t) {
1689
1693
  o ? t ? a.formRef.set(s, {
1690
- validate: async (n) => {
1694
+ validate: async (l) => {
1691
1695
  try {
1692
- n(await t());
1696
+ l(await t());
1693
1697
  } catch {
1694
- n(!1);
1698
+ l(!1);
1695
1699
  }
1696
1700
  }
1697
1701
  }) : a.formRef.set(s, o) : a.formRef.remove(s);
@@ -1712,22 +1716,22 @@ const we = (a) => {
1712
1716
  s.set(t);
1713
1717
  },
1714
1718
  formDefault: {},
1715
- getPlaceholder: (t, n = k.tCurd("placeholderInput")) => t.text?.search?.placeholder === void 0 ? `${n}${t.label}` : t.text?.search?.placeholder,
1719
+ getPlaceholder: (t, l = k.tCurd("placeholderInput")) => t.text?.search?.placeholder === void 0 ? `${l}${t.label}` : t.text?.search?.placeholder,
1716
1720
  getFormData: () => {
1717
1721
  const t = a();
1718
- let n = {};
1722
+ let l = {};
1719
1723
  o.option.column.forEach((r) => {
1720
- (typeof r.show?.search == "function" ? r.show?.search(t.search.form) : r.show?.search) && (n[r.key] = t.search.form[r.key]);
1724
+ (typeof r.show?.search == "function" ? r.show?.search(t.search.form) : r.show?.search) && (l[r.key] = t.search.form[r.key]);
1721
1725
  });
1722
- const e = o.option.search?.before?.(n);
1723
- return e && (n = e), n;
1726
+ const e = o.option.search?.before?.(l);
1727
+ return e && (l = e), l;
1724
1728
  },
1725
1729
  reset: () => {
1726
- const t = a(), n = t.search.formDefault;
1727
- Object.keys(n).forEach((r) => {
1728
- o.option.search?.resetMode === "none" ? n[r] = void 0 : n[r] = t.search.formDefault[r];
1730
+ const t = a(), l = t.search.formDefault;
1731
+ Object.keys(l).forEach((r) => {
1732
+ o.option.search?.resetMode === "none" ? l[r] = void 0 : l[r] = t.search.formDefault[r];
1729
1733
  });
1730
- const e = ObjectUtil.deepMerge(n, {});
1734
+ const e = ObjectUtil.deepMerge(l, {});
1731
1735
  x.setValue(t.search.form, e, !0), t.page.num = 1, o.option.init !== !1 && t.table.getList();
1732
1736
  },
1733
1737
  submit: () => {
@@ -1759,29 +1763,29 @@ const we = (a) => {
1759
1763
  return {
1760
1764
  table: {
1761
1765
  op: {
1762
- width: (...n) => n.filter((r) => r).length * 30 + 60
1766
+ width: (...l) => l.filter((r) => r).length * 30 + 60
1763
1767
  },
1764
1768
  loading: !1,
1765
1769
  data: [],
1766
1770
  expand: {
1767
1771
  isExpand: !1,
1768
1772
  rowKeys: [],
1769
- change: (n, e) => {
1773
+ change: (l, e) => {
1770
1774
  },
1771
1775
  all: () => {
1772
- const n = t();
1773
- if (n.table.expand.isExpand)
1774
- n.table.expand.rowKeys = [];
1776
+ const l = t();
1777
+ if (l.table.expand.isExpand)
1778
+ l.table.expand.rowKeys = [];
1775
1779
  else {
1776
1780
  const e = (r) => {
1777
- let l = [];
1781
+ let n = [];
1778
1782
  return r.forEach((u) => {
1779
- l.push(u[o.option.table.rowKey]), u.children?.length && (l = l.concat(e(u.children)));
1780
- }), l;
1783
+ n.push(u[o.option.table.rowKey]), u.children?.length && (n = n.concat(e(u.children)));
1784
+ }), n;
1781
1785
  };
1782
- n.table.expand.rowKeys = e(n.table.data);
1786
+ l.table.expand.rowKeys = e(l.table.data);
1783
1787
  }
1784
- n.table.expand.isExpand = !n.table.expand.isExpand;
1788
+ l.table.expand.isExpand = !l.table.expand.isExpand;
1785
1789
  }
1786
1790
  },
1787
1791
  column: {
@@ -1798,70 +1802,70 @@ const we = (a) => {
1798
1802
  modulePromise: void 0,
1799
1803
  getOption: () => o.option.table?.sortable || {},
1800
1804
  showTriggerButton: () => {
1801
- const n = t();
1802
- return o.option.table?.sortable?.button && !n.table.sortable.mode;
1805
+ const l = t();
1806
+ return o.option.table?.sortable?.button && !l.table.sortable.mode;
1803
1807
  },
1804
1808
  showActionButton: () => {
1805
- const n = t();
1806
- return o.option.table?.sortable?.button && n.table.sortable.mode;
1809
+ const l = t();
1810
+ return o.option.table?.sortable?.button && l.table.sortable.mode;
1807
1811
  },
1808
1812
  showSaveButton: () => !o.option.table?.sortable?.button && o.option.table?.sortable?.show && o.option.table?.sortable?.saveButton,
1809
1813
  isActive: () => {
1810
- const n = t(), e = n.table.sortable.getOption();
1811
- return e.button ? n.table.sortable.mode : !!e.show;
1814
+ const l = t(), e = l.table.sortable.getOption();
1815
+ return e.button ? l.table.sortable.mode : !!e.show;
1812
1816
  },
1813
1817
  showPagination: () => {
1814
- const n = t();
1815
- return !n.table.sortable.isActive() || n.table.sortable.getOption().page;
1818
+ const l = t();
1819
+ return !l.table.sortable.isActive() || l.table.sortable.getOption().page;
1816
1820
  },
1817
1821
  disableScroll: () => {
1818
- const n = t(), e = n.table.sortable.getOption();
1819
- return n.table.sortable.isActive() && !e.page && !e.scroll;
1822
+ const l = t(), e = l.table.sortable.getOption();
1823
+ return l.table.sortable.isActive() && !e.page && !e.scroll;
1820
1824
  },
1821
1825
  getTableBindOption: () => {
1822
- const n = t();
1826
+ const l = t();
1823
1827
  return {
1824
1828
  ...o.option.table || {},
1825
- ...n.table.sortable.disableScroll() ? {
1829
+ ...l.table.sortable.disableScroll() ? {
1826
1830
  height: void 0,
1827
1831
  maxHeight: void 0
1828
1832
  } : {}
1829
1833
  };
1830
1834
  },
1831
1835
  getColumnBind: () => {
1832
- const { show: n, button: e, page: r, scroll: l, field: u, rule: f, api: d, onEnd: b, ...c } = t().table.sortable.getOption();
1836
+ const { show: l, button: e, page: r, scroll: n, field: u, rule: f, api: d, onEnd: b, ...c } = t().table.sortable.getOption();
1833
1837
  return c;
1834
1838
  },
1835
1839
  destroy: () => {
1836
- const n = t();
1837
- n.table.sortable.instance?.destroy(), n.table.sortable.instance = void 0;
1840
+ const l = t();
1841
+ l.table.sortable.instance?.destroy(), l.table.sortable.instance = void 0;
1838
1842
  },
1839
1843
  getBody: () => s.tableRef.value?.$el?.querySelector(".el-table__body-wrapper tbody"),
1840
1844
  loadModule: async () => {
1841
- const n = t();
1842
- n.table.sortable.modulePromise ??= E.loadModule("sortablejs");
1843
- const e = await n.table.sortable.modulePromise;
1845
+ const l = t();
1846
+ l.table.sortable.modulePromise ??= E.loadModule("sortablejs");
1847
+ const e = await l.table.sortable.modulePromise;
1844
1848
  return e.default || e;
1845
1849
  },
1846
- applyRule: (n, e, r, l) => {
1850
+ applyRule: (l, e, r, n) => {
1847
1851
  if (r === "value") {
1848
- n.forEach((u, f) => {
1849
- u[e] = l[f];
1852
+ l.forEach((u, f) => {
1853
+ u[e] = n[f];
1850
1854
  });
1851
1855
  return;
1852
1856
  }
1853
- n.forEach((u, f) => {
1857
+ l.forEach((u, f) => {
1854
1858
  u[e] = f + 1;
1855
1859
  });
1856
1860
  },
1857
1861
  sync: async () => {
1858
- const n = t();
1859
- if (n.table.sortable.destroy(), !n.table.sortable.isActive() || n.table.loading) return;
1862
+ const l = t();
1863
+ if (l.table.sortable.destroy(), !l.table.sortable.isActive() || l.table.loading) return;
1860
1864
  await Ce();
1861
- const e = n.table.sortable.getBody();
1865
+ const e = l.table.sortable.getBody();
1862
1866
  if (!e) return;
1863
- const r = await n.table.sortable.loadModule(), l = n.table.sortable.getOption();
1864
- n.table.sortable.instance = r.create(e, {
1867
+ const r = await l.table.sortable.loadModule(), n = l.table.sortable.getOption();
1868
+ l.table.sortable.instance = r.create(e, {
1865
1869
  animation: 150,
1866
1870
  handle: ".cc1-form-drag-handle",
1867
1871
  draggable: ".el-table__row",
@@ -1870,43 +1874,43 @@ const we = (a) => {
1870
1874
  if (!Number.isInteger(p) || !Number.isInteger(w) || p === w || p < 0 || w < 0 || p >= c.length || w >= c.length) return;
1871
1875
  const F = c.splice(p, 1)[0];
1872
1876
  c.splice(w, 0, F);
1873
- }, b = n.table.data.map((c) => c?.[l.field]);
1874
- d(n.table.data, u, f), l.onEnd ? l.onEnd(n.table.data) : n.table.sortable.applyRule(n.table.data, l.field, l.rule, b);
1877
+ }, b = l.table.data.map((c) => c?.[n.field]);
1878
+ d(l.table.data, u, f), n.onEnd ? n.onEnd(l.table.data) : l.table.sortable.applyRule(l.table.data, n.field, n.rule, b);
1875
1879
  }
1876
1880
  });
1877
1881
  },
1878
1882
  refreshList: async () => {
1879
- const n = t();
1880
- await n.table.getList(n.table.sortable.isActive() ? "sortable" : void 0), n.table.sortable.sync();
1883
+ const l = t();
1884
+ await l.table.getList(l.table.sortable.isActive() ? "sortable" : void 0), l.table.sortable.sync();
1881
1885
  },
1882
1886
  /** 临时保存fitHeight,用于排序时临时关闭 */
1883
1887
  fitHeight: !1,
1884
1888
  start: async () => {
1885
- const n = t(), e = n.table?.sortable.getOption();
1886
- n.table.sortable.fitHeight = o.option.table.fitHeight, e.scroll || (o.option.table.fitHeight = !1), n.table.sortable.mode = !0, await n.table.sortable.refreshList();
1889
+ const l = t(), e = l.table?.sortable.getOption();
1890
+ l.table.sortable.fitHeight = o.option.table.fitHeight, e.scroll || (o.option.table.fitHeight = !1), l.table.sortable.mode = !0, await l.table.sortable.refreshList();
1887
1891
  },
1888
1892
  exit: async () => {
1889
- const n = t();
1890
- o.option.table.fitHeight = n.table.sortable.fitHeight, await n.table.getList(), n.table.sortable.mode = !1, n.table.sortable.destroy();
1893
+ const l = t();
1894
+ o.option.table.fitHeight = l.table.sortable.fitHeight, await l.table.getList(), l.table.sortable.mode = !1, l.table.sortable.destroy();
1891
1895
  },
1892
1896
  save: async () => {
1893
- const n = t(), r = n.table.sortable.getOption().api?.update || o.option.api.update;
1897
+ const l = t(), r = l.table.sortable.getOption().api?.update || o.option.api.update;
1894
1898
  if (!r) {
1895
1899
  E.fail(k.tCurd("sortableUpdateApiRequired"));
1896
1900
  return;
1897
1901
  }
1898
- n.table.sortable.actionLoading = !0, n.table.loading = !0;
1902
+ l.table.sortable.actionLoading = !0, l.table.loading = !0;
1899
1903
  try {
1900
- await r(n.table.data, "sortable"), E.success(k.tCurd("operationSuccess")), await n.table.sortable.exit();
1901
- } catch (l) {
1902
- console.error(l);
1904
+ await r(l.table.data, "sortable"), E.success(k.tCurd("operationSuccess")), await l.table.sortable.exit();
1905
+ } catch (n) {
1906
+ console.error(n);
1903
1907
  } finally {
1904
- n.table.sortable.actionLoading = !1, n.table.loading = !1;
1908
+ l.table.sortable.actionLoading = !1, l.table.loading = !1;
1905
1909
  }
1906
1910
  },
1907
- command: async (n) => {
1911
+ command: async (l) => {
1908
1912
  const e = t();
1909
- if (n === "save") {
1913
+ if (l === "save") {
1910
1914
  await e.table.sortable.save();
1911
1915
  return;
1912
1916
  }
@@ -1917,35 +1921,35 @@ const we = (a) => {
1917
1921
  group: {
1918
1922
  expand: !1,
1919
1923
  toggleExpandAll: () => {
1920
- const n = t(), e = !n.table.header.group.expand;
1921
- n.table.header.group.expand = e;
1922
- const r = (l) => {
1923
- l.forEach((u) => {
1924
+ const l = t(), e = !l.table.header.group.expand;
1925
+ l.table.header.group.expand = e;
1926
+ const r = (n) => {
1927
+ n.forEach((u) => {
1924
1928
  u.table?.header?.group !== void 0 && (u.table.header.group = !e), u.table?.header?.groupKey !== void 0 && (u.table.header.show = e), Array.isArray(u.children) && u.children.length && r(u.children);
1925
1929
  });
1926
1930
  };
1927
- r(n.table.column.list);
1931
+ r(l.table.column.list);
1928
1932
  }
1929
1933
  }
1930
1934
  },
1931
- parseListResult: async (n) => {
1932
- const e = t(), r = T.config.field.result, l = n?.data || { [r.list]: n }, u = (Array.isArray(l[r.list]), l[r.list]), f = et(e.update.formGrid?.length ? e.update.formGrid : e.update.formColumn), b = ObjectUtil.deepMerge({ data: u }, {}).data.map((c) => (Object.keys(c).forEach((w) => {
1935
+ parseListResult: async (l) => {
1936
+ const e = t(), r = T.config.field.result, n = l?.data || { [r.list]: l }, u = Array.isArray(n) ? n : (Array.isArray(n[r.list]), n[r.list]), f = et(e.update.formGrid?.length ? e.update.formGrid : e.update.formColumn), b = ObjectUtil.deepMerge({ data: u }, {}).data.map((c) => (Object.keys(c).forEach((w) => {
1933
1937
  const F = f.find((B) => B.item.key === w);
1934
1938
  F && ["select", "radio"].includes(F.item.type) && (F.item.table.format || (F.item.table.format = (B) => F.item.options[F.item.type].data?.find((L) => L.value == B[w])?.label || B[w]));
1935
1939
  }), c));
1936
1940
  return {
1937
1941
  data: o.option.data ? await o.option.data(b, u) : b,
1938
- total: l[r.total] || 0
1942
+ total: n[r.total] || 0
1939
1943
  };
1940
1944
  },
1941
- applyListResult: async (n, e) => {
1942
- const r = t(), l = await r.table.parseListResult(n);
1943
- return r.table.data = l.data, r.page.total = e ?? l.total, r.tableEditValidate?.clear?.(), l;
1945
+ applyListResult: async (l, e) => {
1946
+ const r = t(), n = await r.table.parseListResult(l);
1947
+ return r.table.data = n.data, r.page.total = e ?? n.total, r.tableEditValidate?.clear?.(), n;
1944
1948
  },
1945
- getList: async (n) => {
1949
+ getList: async (l) => {
1946
1950
  const e = t();
1947
1951
  e.table.loading = !0;
1948
- const r = o.option.table?.sortable, l = n === "sortable" && r?.api?.list || o.option.api.list, u = JSONUtil.cp(e.table.selection.list);
1952
+ const r = o.option.table?.sortable, n = l === "sortable" && r?.api?.list || o.option.api.list, u = JSONUtil.cp(e.table.selection.list);
1949
1953
  try {
1950
1954
  await e.initApiData("init");
1951
1955
  let f = {};
@@ -1956,17 +1960,17 @@ const we = (a) => {
1956
1960
  [p.field]: e.table.sort.order
1957
1961
  };
1958
1962
  }
1959
- const d = n === "sortable" && r?.page === !1 ? e.page.getQuery({
1963
+ const d = l === "sortable" && r?.page === !1 ? e.page.getQuery({
1960
1964
  num: 1,
1961
1965
  size: e.page.total || 999999
1962
- }) : e.page.getQuery(), b = await l(
1966
+ }) : e.page.getQuery(), b = await n(
1963
1967
  {
1964
1968
  ...d,
1965
1969
  ...f
1966
1970
  },
1967
- n
1971
+ l
1968
1972
  );
1969
- await e.table.applyListResult(b, n === "sortable" && r?.page === !1 ? e.page.total : void 0), setTimeout(() => {
1973
+ await e.table.applyListResult(b, l === "sortable" && r?.page === !1 ? e.page.total : void 0), setTimeout(() => {
1970
1974
  e.table.selection.setList(u), o.option.table?.sortable?.show && !o.option.table?.sortable?.button && e.table.sortable.sync();
1971
1975
  }, 20);
1972
1976
  } catch (f) {
@@ -1977,14 +1981,14 @@ const we = (a) => {
1977
1981
  },
1978
1982
  selection: {
1979
1983
  list: [],
1980
- change: (n) => {
1981
- t().table.selection.list = n;
1984
+ change: (l) => {
1985
+ t().table.selection.list = l;
1982
1986
  },
1983
- setList: (n, e) => {
1987
+ setList: (l, e) => {
1984
1988
  const r = t();
1985
1989
  r.table.selection.list = [];
1986
- const l = s.tableRef.value;
1987
- if (l?.clearSelection(), !l || !n?.length) return;
1990
+ const n = s.tableRef.value;
1991
+ if (n?.clearSelection(), !n || !l?.length) return;
1988
1992
  const u = o.option.table?.rowKey, f = (d) => {
1989
1993
  const b = (c) => {
1990
1994
  for (const p of c) {
@@ -2000,49 +2004,49 @@ const we = (a) => {
2000
2004
  };
2001
2005
  return b(r.table.data);
2002
2006
  };
2003
- n.forEach((d) => {
2007
+ l.forEach((d) => {
2004
2008
  const b = f(d);
2005
2009
  if (b)
2006
2010
  if (e) {
2007
- const c = () => l.toggleRowSelection(b, !0, !1);
2011
+ const c = () => n.toggleRowSelection(b, !0, !1);
2008
2012
  e(d) !== !1 && c();
2009
2013
  } else
2010
- l.toggleRowSelection(b, !0, !1);
2014
+ n.toggleRowSelection(b, !0, !1);
2011
2015
  });
2012
2016
  }
2013
2017
  },
2014
2018
  sort: {
2015
2019
  prop: "",
2016
2020
  order: "",
2017
- change: (n) => {
2021
+ change: (l) => {
2018
2022
  const e = t();
2019
2023
  T.config.table.sort.resetPage && (e.page.num = 1);
2020
2024
  const r = T.config.table.sort;
2021
2025
  if (r.change) {
2022
- r.change(n, e);
2026
+ r.change(l, e);
2023
2027
  return;
2024
2028
  }
2025
- e.table.sort.prop = n.prop, n.order === null ? (e.table.sort.order = "", e.table.sort.prop = "") : e.table.sort.order = n.order === "ascending" ? r.order.asc : r.order.desc, e.table.getList();
2029
+ e.table.sort.prop = l.prop, l.order === null ? (e.table.sort.order = "", e.table.sort.prop = "") : e.table.sort.order = l.order === "ascending" ? r.order.asc : r.order.desc, e.table.getList();
2026
2030
  }
2027
2031
  }
2028
2032
  }
2029
2033
  };
2030
2034
  }, Yt = (a, o) => {
2031
2035
  const s = ie({}), t = /* @__PURE__ */ new WeakMap();
2032
- let n = 0;
2036
+ let l = 0;
2033
2037
  const e = (g) => {
2034
2038
  let v = t.get(g);
2035
- return v || (n += 1, v = `fallback-${n}`, t.set(g, v)), v;
2039
+ return v || (l += 1, v = `fallback-${l}`, t.set(g, v)), v;
2036
2040
  }, r = (g) => {
2037
2041
  const v = o.option.table?.rowKey, U = v ? g[v] : void 0;
2038
2042
  return U != null && U !== "" ? String(U) : e(g);
2039
- }, l = (g, v) => `${r(g)}-${v.key}`, u = (g) => at(g, o.option.form?.error), f = ot(u), d = () => {
2043
+ }, n = (g, v) => `${r(g)}-${v.key}`, u = (g) => at(g, o.option.form?.error), f = ot(u), d = () => {
2040
2044
  Object.keys(s).forEach((g) => {
2041
2045
  delete s[g];
2042
2046
  });
2043
2047
  }, b = (g, v) => {
2044
- delete s[l(g, v)];
2045
- }, c = (g, v) => s[l(g, v)] || "", p = (g, v) => g.message || u(v), w = (g) => g == null || g === "" || Array.isArray(g) && g.length === 0, F = (g) => {
2048
+ delete s[n(g, v)];
2049
+ }, c = (g, v) => s[n(g, v)] || "", p = (g, v) => g.message || u(v), w = (g) => g == null || g === "" || Array.isArray(g) && g.length === 0, F = (g) => {
2046
2050
  if (typeof g == "number") return g;
2047
2051
  if (typeof g == "string" || Array.isArray(g)) return g.length;
2048
2052
  }, B = (g, v) => {
@@ -2120,7 +2124,7 @@ const we = (a) => {
2120
2124
  for (const N of H) {
2121
2125
  const P = await j(N, g[v.key], v);
2122
2126
  if (P !== !0)
2123
- return s[l(g, v)] = P, {
2127
+ return s[n(g, v)] = P, {
2124
2128
  field: v.key,
2125
2129
  error: P
2126
2130
  };
@@ -2160,22 +2164,22 @@ class Zt {
2160
2164
  */
2161
2165
  static exportToExcel = async (o, s, t) => {
2162
2166
  if (!o || o.length === 0) return;
2163
- const n = await E.loadModule("xlsx"), e = o.map((u) => {
2167
+ const l = await E.loadModule("xlsx"), e = o.map((u) => {
2164
2168
  const f = {};
2165
2169
  return s.forEach((d) => {
2166
2170
  f[d.label] = u[d.key];
2167
2171
  }), f;
2168
- }), r = n.utils.json_to_sheet(e), l = n.utils.book_new();
2169
- n.utils.book_append_sheet(l, r, "Sheet1"), t ? typeof t == "function" && (t = t()) : t = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, n.writeFile(l, `${t}.xlsx`);
2172
+ }), r = l.utils.json_to_sheet(e), n = l.utils.book_new();
2173
+ l.utils.book_append_sheet(n, r, "Sheet1"), t ? typeof t == "function" && (t = t()) : t = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, l.writeFile(n, `${t}.xlsx`);
2170
2174
  };
2171
2175
  }
2172
2176
  const xt = (a, o) => ({
2173
2177
  export: {
2174
2178
  run: {
2175
2179
  start: async (s) => {
2176
- let n = await a().export.run[s]();
2177
- const e = o.option.column, r = ObjectUtil.deepMerge({ data: n, columns: e }, {}), l = o.option.tools?.export || {};
2178
- l.before?.(r), Zt.exportToExcel(r.data, r.columns, l.fileName);
2180
+ let l = await a().export.run[s]();
2181
+ const e = o.option.column, r = ObjectUtil.deepMerge({ data: l, columns: e }, {}), n = o.option.tools?.export || {};
2182
+ n.before?.(r), Zt.exportToExcel(r.data, r.columns, n.fileName);
2179
2183
  },
2180
2184
  select: async () => {
2181
2185
  const s = a();
@@ -2226,10 +2230,10 @@ const xt = (a, o) => ({
2226
2230
  });
2227
2231
  return;
2228
2232
  }
2229
- const t = o.option.api.list, n = await t({
2233
+ const t = o.option.api.list, l = await t({
2230
2234
  ...s.page.getQuery({ size: 999999, num: 1 })
2231
2235
  });
2232
- return (n.data || { [T.config.field.result.list]: n })[T.config.field.result.list];
2236
+ return (l.data || { [T.config.field.result.list]: l })[T.config.field.result.list];
2233
2237
  } catch (t) {
2234
2238
  console.error(t);
2235
2239
  } finally {
@@ -2268,11 +2272,11 @@ const xt = (a, o) => ({
2268
2272
  try {
2269
2273
  if (!t) return;
2270
2274
  await t({
2271
- [o.option.table?.rowKey]: s.remove.items.map((n) => n[o.option.table?.rowKey]),
2275
+ [o.option.table?.rowKey]: s.remove.items.map((l) => l[o.option.table?.rowKey]),
2272
2276
  items: s.remove.items
2273
2277
  }), E.success(k.tCurd("operationSuccess")), s.table.data.length <= 1 && s.page.num > 1 && (s.page.num -= 1), s.remove.close(), await s.table.getList();
2274
- } catch (n) {
2275
- console.error(n);
2278
+ } catch (l) {
2279
+ console.error(l);
2276
2280
  } finally {
2277
2281
  s.remove.loading = !1;
2278
2282
  }
@@ -2281,8 +2285,8 @@ const xt = (a, o) => ({
2281
2285
  }
2282
2286
  }), eo = (a, o, s) => ({
2283
2287
  apiDataMap: {},
2284
- getColumnSpan: (t, n) => {
2285
- const e = a(), r = e.update.formGrid?.length ? e.update.formGrid : n || [];
2288
+ getColumnSpan: (t, l) => {
2289
+ const e = a(), r = e.update.formGrid?.length ? e.update.formGrid : l || [];
2286
2290
  return Ze(t, r, e.update.form, e.update.type, {
2287
2291
  maxSpan: e.update.formMaxSpan || o.option.form?.maxSpan,
2288
2292
  defaultSpan: o.option.form?.defaultSpan || T.config.form.defaultSpan
@@ -2293,20 +2297,20 @@ const xt = (a, o) => ({
2293
2297
  t.initCurdConfig(), t.initColumnOptions(), t.initColumnForm();
2294
2298
  },
2295
2299
  initApiData: async (t) => {
2296
- const n = a(), e = [], r = (l) => {
2297
- if (l.children?.length) {
2298
- l.children.forEach((f) => r(f));
2300
+ const l = a(), e = [], r = (n) => {
2301
+ if (n.children?.length) {
2302
+ n.children.forEach((f) => r(f));
2299
2303
  return;
2300
2304
  }
2301
- const u = le(l);
2302
- if (l.options?.[u]?.dataApi && l.options?.[u]?.dataApiConfig?.[t]) {
2303
- if (n.apiDataMap[l.key] && l.options?.[u]?.dataApiConfig?.once) return;
2305
+ const u = le(n);
2306
+ if (n.options?.[u]?.dataApi && n.options?.[u]?.dataApiConfig?.[t]) {
2307
+ if (l.apiDataMap[n.key] && n.options?.[u]?.dataApiConfig?.once) return;
2304
2308
  const f = (async () => {
2305
2309
  try {
2306
- let d = await l.options?.[u]?.dataApi?.(n.update.form, n.update.type);
2310
+ let d = await n.options?.[u]?.dataApi?.(l.update.form, l.update.type);
2307
2311
  if (d) {
2308
- const b = l.options?.[u]?.dataPath;
2309
- !Array.isArray(d) && b && (d = ObjectUtil.getPathValue(d, b)), l.options[u].data = d, l.options.search[u].data = d, l.options.search[l.options.search.type ?? u] || (l.options.search[l.options.search.type ?? u] = {}), l.options.search[l.options.search.type ?? u].data = d, l.options.formAdd[u].data = d, l.options.formUpdate[u].data = d, n.apiDataMap[l.key] = d;
2312
+ const b = n.options?.[u]?.dataPath;
2313
+ !Array.isArray(d) && b && (d = ObjectUtil.getPathValue(d, b)), n.options[u].data = d, n.options.search[u].data = d, n.options.search[n.options.search.type ?? u] || (n.options.search[n.options.search.type ?? u] = {}), n.options.search[n.options.search.type ?? u].data = d, n.options.formAdd[u].data = d, n.options.formUpdate[u].data = d, l.apiDataMap[n.key] = d;
2310
2314
  }
2311
2315
  } catch {
2312
2316
  }
@@ -2314,42 +2318,42 @@ const xt = (a, o) => ({
2314
2318
  e.push(f);
2315
2319
  }
2316
2320
  };
2317
- return o.option.column.forEach((l) => r(l)), await Promise.all(e), !0;
2321
+ return o.option.column.forEach((n) => r(n)), await Promise.all(e), !0;
2318
2322
  },
2319
2323
  initCurdConfig: () => {
2320
2324
  const t = ObjectUtil.deepMerge(T.config, {});
2321
2325
  t.table.emptyText = k.tCurd("noData"), o.option.size = o.option.size || {}, t.table.size = o.option.size.table || t.size.table, t.form.size = o.option.size.form || t.size.form, t.size.search = o.option.size.search || t.size.search;
2322
- const n = ObjectUtil.deepMerge(t, o.option || {});
2323
- Object.keys(n).forEach((e) => {
2324
- o.option[e] = n[e];
2326
+ const l = ObjectUtil.deepMerge(t, o.option || {});
2327
+ Object.keys(l).forEach((e) => {
2328
+ o.option[e] = l[e];
2325
2329
  });
2326
2330
  },
2327
2331
  initColumnOptions: () => {
2328
2332
  const t = a();
2329
- let n = JSONUtil.cp(T.config.columnConfig);
2330
- n.options = ObjectUtil.deepMerge(
2333
+ let l = JSONUtil.cp(T.config.columnConfig);
2334
+ l.options = ObjectUtil.deepMerge(
2331
2335
  {
2332
2336
  switch: {
2333
2337
  activeText: k.tCurd("switchOn"),
2334
2338
  inactiveText: k.tCurd("switchOff")
2335
2339
  }
2336
2340
  },
2337
- n.options
2341
+ l.options
2338
2342
  );
2339
2343
  const e = (r) => {
2340
- const l = le(r);
2341
- for (const f in n) {
2344
+ const n = le(r);
2345
+ for (const f in l) {
2342
2346
  if (f === "table") {
2343
- if (r.table = ObjectUtil.deepMerge(n.table, r.table || {}), r.children) {
2347
+ if (r.table = ObjectUtil.deepMerge(l.table, r.table || {}), r.children) {
2344
2348
  r.children.forEach((d) => e(d));
2345
2349
  return;
2346
2350
  }
2347
- } else f === "type" ? r.type = r.type || n.type : r[f] = ObjectUtil.deepMerge(n[f], r[f] || {});
2348
- r.options = r.options || {}, r.options[l] = r.options[l] || {}, r.options[l].size = o.option.size.form;
2351
+ } else f === "type" ? r.type = r.type || l.type : r[f] = ObjectUtil.deepMerge(l[f], r[f] || {});
2352
+ r.options = r.options || {}, r.options[n] = r.options[n] || {}, r.options[n].size = o.option.size.form;
2349
2353
  }
2350
2354
  ["search", "formAdd", "formUpdate"].forEach((f) => {
2351
- r.options[f] = ObjectUtil.deepMerge(r.options, r.options[f] || {}), f === "search" ? o.option.size.search && (r.options[f][l].size = o.option.size.search) : o.option.size.form && (r.options[f][l].size = o.option.size.form);
2352
- }), r.table = ObjectUtil.deepMerge(r.table, r.options[l].table || {}), l === "switch" && (r.options.switch.tableBeforeChange = async (f, d) => {
2355
+ r.options[f] = ObjectUtil.deepMerge(r.options, r.options[f] || {}), f === "search" ? o.option.size.search && (r.options[f][n].size = o.option.size.search) : o.option.size.form && (r.options[f][n].size = o.option.size.form);
2356
+ }), r.table = ObjectUtil.deepMerge(r.table, r.options[n].table || {}), n === "switch" && (r.options.switch.tableBeforeChange = async (f, d) => {
2353
2357
  const b = r.options?.switch;
2354
2358
  try {
2355
2359
  b.tableConfig?.confirm && await s.switchConfirmRef.value?.open({
@@ -2378,26 +2382,26 @@ const xt = (a, o) => ({
2378
2382
  } catch {
2379
2383
  return !1;
2380
2384
  }
2381
- }), l === "treeSelect" && (r.options.treeSelect.rowKey = o.option.table?.rowKey, r.options.treeSelect.nodeKey = o.option.table?.rowKey);
2385
+ }), n === "treeSelect" && (r.options.treeSelect.rowKey = o.option.table?.rowKey, r.options.treeSelect.nodeKey = o.option.table?.rowKey);
2382
2386
  };
2383
2387
  o.option.column.forEach(e), o.option.table?.column?.forEach(e);
2384
2388
  },
2385
2389
  initColumnForm: () => {
2386
- const t = a(), n = o.option;
2390
+ const t = a(), l = o.option;
2387
2391
  t.update.formColumn = [], t.update.formGrid = [], t.update.formMaxSpan = 12, t.table.column.show = { list: [], listSource: [] };
2388
- const e = o.option.form?.maxSpan || 12, r = o.option.form?.defaultSpan || e / 2, l = nt(o.option.form), u = (c) => {
2392
+ const e = o.option.form?.maxSpan || 12, r = o.option.form?.defaultSpan || e / 2, n = nt(o.option.form), u = (c) => {
2389
2393
  if (c.children) {
2390
2394
  t.table.column.show.list.push(c.key), c.children.forEach((p) => u(p));
2391
2395
  return;
2392
2396
  }
2393
2397
  t.update.formDefault[c.key] = c.value, c.table?.table && (c.show?.table && t.table.column.show.list.push(c.key), t.table.column.show.listSource.push(c.key));
2394
2398
  };
2395
- n.column.forEach((c) => {
2399
+ l.column.forEach((c) => {
2396
2400
  ke(c, !0), u(c);
2397
2401
  }), o.option.table?.column?.forEach((c) => {
2398
2402
  ke(c, !1), u(c);
2399
- }), t.search.column.list = n.column.concat(n.table?.column || []), t.table.column.list = t.search.column.list.filter((c) => c.table?.table), t.search.column.list.sort((c, p) => c.sort?.search - p.sort?.search), t.table.column.list.sort((c, p) => c.sort?.table - p.sort?.table), t.update.rules = {}, Re(n.column, t.update.formDefault, t.update.rules, (c) => l(c, () => t.update.form)), n.table?.editMode && Re(n.table?.column || [], t.update.formDefault, t.update.rules, (c) => l(c, () => t.update.form));
2400
- const f = tt(n.column, {
2403
+ }), t.search.column.list = l.column.concat(l.table?.column || []), t.table.column.list = t.search.column.list.filter((c) => c.table?.table), t.search.column.list.sort((c, p) => c.sort?.search - p.sort?.search), t.table.column.list.sort((c, p) => c.sort?.table - p.sort?.table), t.update.rules = {}, Re(l.column, t.update.formDefault, t.update.rules, (c) => n(c, () => t.update.form)), l.table?.editMode && Re(l.table?.column || [], t.update.formDefault, t.update.rules, (c) => n(c, () => t.update.form));
2404
+ const f = tt(l.column, {
2401
2405
  maxSpan: e,
2402
2406
  defaultSpan: r,
2403
2407
  layout: o.option.form?.layout
@@ -2406,14 +2410,14 @@ const xt = (a, o) => ({
2406
2410
  const d = o.option.search?.formDefault;
2407
2411
  d && Object.keys(d).forEach((c) => {
2408
2412
  t.search.formDefault[c] = d[c];
2409
- }), n.column.forEach((c) => {
2413
+ }), l.column.forEach((c) => {
2410
2414
  c.show?.search || (t.search.formDefault[c.key] = void 0);
2411
2415
  });
2412
2416
  const b = ObjectUtil.deepMerge(t.search.formDefault, {});
2413
2417
  x.setValue(t.search.form, b, !0);
2414
2418
  }
2415
2419
  }), to = (a) => {
2416
- const o = Y(), s = Y(), t = Y(), n = { switchConfirmRef: o, ruleFormRef: s, tableRef: t }, e = Ge(), r = Fe.getConf("curdConf"), l = (b) => {
2420
+ const o = Y(), s = Y(), t = Y(), l = { switchConfirmRef: o, ruleFormRef: s, tableRef: t }, e = Ge(), r = Fe.getConf("curdConf"), n = (b) => {
2417
2421
  b = b || f;
2418
2422
  let c = b, p = b;
2419
2423
  for (; c?.parentCurdConf; )
@@ -2422,18 +2426,18 @@ const xt = (a, o) => ({
2422
2426
  }, u = () => f;
2423
2427
  let f = ie({
2424
2428
  parentCurdConf: r,
2425
- getCurdConf: l,
2426
- getRootCurdConf: l,
2429
+ getCurdConf: n,
2430
+ getRootCurdConf: n,
2427
2431
  ...qt(),
2428
2432
  option: a.option,
2429
2433
  ...Jt(u, a),
2430
2434
  ...Qt(u, a),
2431
- ...Xt(u, a, n),
2435
+ ...Xt(u, a, l),
2432
2436
  ...Yt(u, a),
2433
2437
  ...xt(u, a),
2434
- ...Ut(u, a, n),
2438
+ ...Ut(u, a, l),
2435
2439
  ..._t(u, a),
2436
- ...eo(u, a, n)
2440
+ ...eo(u, a, l)
2437
2441
  });
2438
2442
  f.init();
2439
2443
  const d = e ? `curdRef-${e.uid}` : "";
@@ -2462,9 +2466,9 @@ const xt = (a, o) => ({
2462
2466
  size: {}
2463
2467
  },
2464
2468
  setup(a, { expose: o }) {
2465
- const s = Y(!1), t = Y("确认修改"), n = Y("确认要修改状态吗?");
2469
+ const s = Y(!1), t = Y("确认修改"), l = Y("确认要修改状态吗?");
2466
2470
  let e = null, r = null;
2467
- const l = (d) => (d?.title && (t.value = d.title), d?.content && (n.value = d.content), s.value = !0, new Promise((b, c) => {
2471
+ const n = (d) => (d?.title && (t.value = d.title), d?.content && (l.value = d.content), s.value = !0, new Promise((b, c) => {
2468
2472
  e = b, r = c;
2469
2473
  })), u = () => {
2470
2474
  s.value = !1, e?.(!0), e = null, r = null;
@@ -2472,7 +2476,7 @@ const xt = (a, o) => ({
2472
2476
  s.value = !1, r?.(new Error("用户取消操作")), e = null, r = null;
2473
2477
  };
2474
2478
  return o({
2475
- open: l
2479
+ open: n
2476
2480
  }), (d, b) => {
2477
2481
  const c = pe("el-form");
2478
2482
  return m(), y(i($e), {
@@ -2507,7 +2511,7 @@ const xt = (a, o) => ({
2507
2511
  }, 8, ["size"])
2508
2512
  ]),
2509
2513
  default: h(() => [
2510
- D("div", null, R(n.value), 1)
2514
+ D("div", null, R(l.value), 1)
2511
2515
  ]),
2512
2516
  _: 1
2513
2517
  }, 8, ["modelValue", "title"]);
@@ -2521,7 +2525,7 @@ const xt = (a, o) => ({
2521
2525
  },
2522
2526
  setup(a) {
2523
2527
  const o = a, s = ae(() => typeof o.content == "function" ? o.content(o.value) : o.content);
2524
- return (t, n) => typeof s.value == "object" ? (m(), y(ee(s.value), { key: 0 })) : (m(), C("div", {
2528
+ return (t, l) => typeof s.value == "object" ? (m(), y(ee(s.value), { key: 0 })) : (m(), C("div", {
2525
2529
  key: 1,
2526
2530
  innerHTML: s.value
2527
2531
  }, null, 8, no));
@@ -2540,21 +2544,21 @@ const xt = (a, o) => ({
2540
2544
  o.item?.key !== void 0 && (o.conf.search.form[o.item.key] = t);
2541
2545
  }
2542
2546
  });
2543
- return (t, n) => i(q).customComponent[t.type ?? ""]?.search ? (m(), y(ee(i(q).customComponent[t.type ?? ""]?.search), S({
2547
+ return (t, l) => i(q).customComponent[t.type ?? ""]?.search ? (m(), y(ee(i(q).customComponent[t.type ?? ""]?.search), S({
2544
2548
  key: 0,
2545
2549
  modelValue: s.value,
2546
- "onUpdate:modelValue": n[0] || (n[0] = (e) => s.value = e)
2550
+ "onUpdate:modelValue": l[0] || (l[0] = (e) => s.value = e)
2547
2551
  }, t.item.options?.search?.[t.type ?? ""], $(t.item.options?.search?.[t.type ?? ""]?.on || {})), null, 16, ["modelValue"])) : t.type === "input" ? (m(), y(i(fe), S({
2548
2552
  key: 1,
2549
2553
  modelValue: s.value,
2550
- "onUpdate:modelValue": n[1] || (n[1] = (e) => s.value = e),
2554
+ "onUpdate:modelValue": l[1] || (l[1] = (e) => s.value = e),
2551
2555
  placeholder: t.conf.search.getPlaceholder(t.item),
2552
2556
  clearable: "",
2553
2557
  disabled: t.item.disabled?.search
2554
2558
  }, t.item.options?.search?.input || t.item.options?.input, $(t.item.options?.search?.input?.on || t.item.options?.input?.on || {})), null, 16, ["modelValue", "placeholder", "disabled"])) : t.type === "switch" ? (m(), y(i(ce), S({
2555
2559
  key: 2,
2556
2560
  modelValue: s.value,
2557
- "onUpdate:modelValue": n[2] || (n[2] = (e) => s.value = e),
2561
+ "onUpdate:modelValue": l[2] || (l[2] = (e) => s.value = e),
2558
2562
  placeholder: t.conf.search.getPlaceholder(t.item, i(k).tCurd("placeholderSelect")),
2559
2563
  clearable: "",
2560
2564
  disabled: t.item.disabled?.search
@@ -2575,7 +2579,7 @@ const xt = (a, o) => ({
2575
2579
  }, 16, ["modelValue", "placeholder", "disabled"])) : t.type === "select" ? (m(), y(i(ce), S({
2576
2580
  key: 3,
2577
2581
  modelValue: s.value,
2578
- "onUpdate:modelValue": n[3] || (n[3] = (e) => s.value = e),
2582
+ "onUpdate:modelValue": l[3] || (l[3] = (e) => s.value = e),
2579
2583
  placeholder: t.conf.search.getPlaceholder(t.item, i(k).tCurd("placeholderSelect")),
2580
2584
  clearable: "",
2581
2585
  disabled: t.item.disabled?.search
@@ -2591,7 +2595,7 @@ const xt = (a, o) => ({
2591
2595
  }, 16, ["modelValue", "placeholder", "disabled"])) : t.type === "radio" ? (m(), y(i(je), S({
2592
2596
  key: 4,
2593
2597
  modelValue: s.value,
2594
- "onUpdate:modelValue": n[4] || (n[4] = (e) => s.value = e),
2598
+ "onUpdate:modelValue": l[4] || (l[4] = (e) => s.value = e),
2595
2599
  disabled: t.item.disabled?.search
2596
2600
  }, t.item.options?.search?.radio || t.item.options?.radio, $(t.item.options?.search?.radio?.on || t.item.options?.radio?.on || {})), {
2597
2601
  default: h(() => [
@@ -2605,20 +2609,20 @@ const xt = (a, o) => ({
2605
2609
  }, 16, ["modelValue", "disabled"])) : t.type === "datetime" ? (m(), y(i(Ke), S({
2606
2610
  key: 5,
2607
2611
  modelValue: s.value,
2608
- "onUpdate:modelValue": n[5] || (n[5] = (e) => s.value = e),
2612
+ "onUpdate:modelValue": l[5] || (l[5] = (e) => s.value = e),
2609
2613
  disabled: t.item.disabled?.search
2610
2614
  }, t.item.options?.search?.datetime || t.item.options?.datetime, $(t.item.options?.search?.datetime?.on || t.item.options?.datetime?.on || {})), null, 16, ["modelValue", "disabled"])) : t.type && i(q).customComponent[t.type] ? (m(), y(ee(i(q).customComponent[t.type]), S({
2611
2615
  key: 6,
2612
2616
  modelValue: s.value,
2613
- "onUpdate:modelValue": n[6] || (n[6] = (e) => s.value = e)
2617
+ "onUpdate:modelValue": l[6] || (l[6] = (e) => s.value = e)
2614
2618
  }, t.item.options?.search?.[t.type] || t.item.options?.[t.type], $(t.item.options?.search?.[t.type]?.on || t.item.options?.[t.type]?.on || {}), {
2615
2619
  disabled: t.item.disabled?.search
2616
2620
  }), null, 16, ["modelValue", "disabled"])) : V("", !0);
2617
2621
  }
2618
2622
  }), se = (a, o) => {
2619
2623
  const s = a.__vccOpts || a;
2620
- for (const [t, n] of o)
2621
- s[t] = n;
2624
+ for (const [t, l] of o)
2625
+ s[t] = l;
2622
2626
  return s;
2623
2627
  }, ro = {}, io = {
2624
2628
  xmlns: "http://www.w3.org/2000/svg",
@@ -2709,13 +2713,13 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
2709
2713
  option: {}
2710
2714
  },
2711
2715
  setup(a) {
2712
- const o = E.isFun, s = a, n = Ge().type, e = (l) => l === !0 ? !0 : (Array.isArray(l) ? l : l ? [l] : []).some((f) => f?.required === !0), r = (l) => s.option.table?.editMode ? e(l.rules) || e(s.conf.update.rules?.[l.key]) : !1;
2713
- return (l, u) => {
2716
+ const o = E.isFun, s = a, l = Ge().type, e = (n) => n === !0 ? !0 : (Array.isArray(n) ? n : n ? [n] : []).some((f) => f?.required === !0), r = (n) => s.option.table?.editMode ? e(n.rules) || e(s.conf.update.rules?.[n.key]) : !1;
2717
+ return (n, u) => {
2714
2718
  const f = pe("el-tooltip");
2715
- return m(!0), C(A, null, G(l.columnList, (d) => (m(), C(A, {
2719
+ return m(!0), C(A, null, G(n.columnList, (d) => (m(), C(A, {
2716
2720
  key: d.key
2717
2721
  }, [
2718
- l.conf.table.column.show.list.includes(d.key) && (d.show?.table === void 0 || i(o)(d.show?.table, l.conf.table.data)) ? (m(), C(A, { key: 0 }, [
2722
+ n.conf.table.column.show.list.includes(d.key) && (d.show?.table === void 0 || i(o)(d.show?.table, n.conf.table.data)) ? (m(), C(A, { key: 0 }, [
2719
2723
  d.table?.header?.groupKey === void 0 || d.table.header.show ? (m(), y(i(ue), S({
2720
2724
  key: 0,
2721
2725
  prop: d.key,
@@ -2723,7 +2727,7 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
2723
2727
  ref_for: !0
2724
2728
  }, d.table), {
2725
2729
  header: h(() => [
2726
- z(l.$slots, "table-header-" + d.key, { item: d }, () => [
2730
+ z(n.$slots, "table-header-" + d.key, { item: d }, () => [
2727
2731
  D("div", Fo, [
2728
2732
  d.table?.header?.tooltip ? (m(), y(f, {
2729
2733
  key: 0,
@@ -2749,7 +2753,7 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
2749
2753
  class: "table-header-plus",
2750
2754
  onClick: wt(
2751
2755
  () => {
2752
- d.table.header.group = !d.table.header.group, l.columnList.forEach((b) => {
2756
+ d.table.header.group = !d.table.header.group, n.columnList.forEach((b) => {
2753
2757
  b.table?.header?.groupKey === d.key && (b.table.header.show = !d.table.header.group);
2754
2758
  });
2755
2759
  },
@@ -2764,23 +2768,23 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
2764
2768
  default: h(({ row: b }) => [
2765
2769
  d.children ? (m(), C(A, { key: 0 }, [
2766
2770
  u[0] || (u[0] = O("   ")),
2767
- (m(), y(ee(i(n)), {
2768
- conf: l.conf,
2771
+ (m(), y(ee(i(l)), {
2772
+ conf: n.conf,
2769
2773
  columnList: d.children,
2770
- option: l.option
2774
+ option: n.option
2771
2775
  }, Z({ _: 2 }, [
2772
- G(l.$slots, (c, p) => ({
2776
+ G(n.$slots, (c, p) => ({
2773
2777
  name: p,
2774
2778
  fn: h((w) => [
2775
- z(l.$slots, p, S({ ref_for: !0 }, w || {}))
2779
+ z(n.$slots, p, S({ ref_for: !0 }, w || {}))
2776
2780
  ])
2777
2781
  }))
2778
2782
  ]), 1032, ["conf", "columnList", "option"]))
2779
2783
  ], 64)) : (m(), C(A, { key: 1 }, [
2780
- l.option.table?.editMode ? (m(), C("div", Bo, [
2784
+ n.option.table?.editMode ? (m(), C("div", Bo, [
2781
2785
  M(i(he), {
2782
- size: l.option.size?.table,
2783
- error: l.conf.tableEditValidate.getFieldError(b, d),
2786
+ size: n.option.size?.table,
2787
+ error: n.conf.tableEditValidate.getFieldError(b, d),
2784
2788
  class: "table-edit-form-item"
2785
2789
  }, {
2786
2790
  default: h(() => [
@@ -2788,7 +2792,7 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
2788
2792
  class: J(["row", ["table-edit-" + d.key]]),
2789
2793
  style: { width: "100%" }
2790
2794
  }, [
2791
- z(l.$slots, "table-edit-left-" + d.key, {
2795
+ z(n.$slots, "table-edit-left-" + d.key, {
2792
2796
  row: b,
2793
2797
  item: d
2794
2798
  }),
@@ -2796,11 +2800,11 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
2796
2800
  key: 0,
2797
2801
  modelValue: b[d.key],
2798
2802
  "onUpdate:modelValue": (c) => b[d.key] = c,
2799
- disabled: l.conf.update.getDisabled(d, !0),
2803
+ disabled: n.conf.update.getDisabled(d, !0),
2800
2804
  class: "col",
2801
2805
  ref_for: !0
2802
- }, l.conf.update.getBind(d), $(l.conf.update.getOn(d, b)), {
2803
- "onUpdate:modelValue": (c) => l.conf.tableEditValidate.clearField(b, d)
2806
+ }, n.conf.update.getBind(d), $(n.conf.update.getOn(d, b)), {
2807
+ "onUpdate:modelValue": (c) => n.conf.tableEditValidate.clearField(b, d)
2804
2808
  }), Z({ _: 2 }, [
2805
2809
  d.options?.input?.prepend ? {
2806
2810
  name: "prepend",
@@ -2813,11 +2817,11 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
2813
2817
  key: 1,
2814
2818
  modelValue: b[d.key],
2815
2819
  "onUpdate:modelValue": (c) => b[d.key] = c,
2816
- disabled: l.conf.update.getDisabled(d, !0),
2820
+ disabled: n.conf.update.getDisabled(d, !0),
2817
2821
  class: "col",
2818
2822
  ref_for: !0
2819
- }, l.conf.update.getBind(d), $(l.conf.update.getOn(d, b)), {
2820
- "onUpdate:modelValue": (c) => l.conf.tableEditValidate.clearField(b, d)
2823
+ }, n.conf.update.getBind(d), $(n.conf.update.getOn(d, b)), {
2824
+ "onUpdate:modelValue": (c) => n.conf.tableEditValidate.clearField(b, d)
2821
2825
  }), {
2822
2826
  default: h(() => [
2823
2827
  (m(!0), C(A, null, G(d.options?.search?.select?.data || d.options?.select?.data, (c) => (m(), y(i(ne), {
@@ -2831,13 +2835,13 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
2831
2835
  key: 2,
2832
2836
  modelValue: b[d.key],
2833
2837
  "onUpdate:modelValue": (c) => b[d.key] = c,
2834
- disabled: l.conf.update.getDisabled(d, !0),
2838
+ disabled: n.conf.update.getDisabled(d, !0),
2835
2839
  class: "col",
2836
2840
  ref_for: !0
2837
- }, l.conf.update.getBind(d), $(l.conf.update.getOn(d, b)), {
2838
- "onUpdate:modelValue": (c) => l.conf.tableEditValidate.clearField(b, d)
2841
+ }, n.conf.update.getBind(d), $(n.conf.update.getOn(d, b)), {
2842
+ "onUpdate:modelValue": (c) => n.conf.tableEditValidate.clearField(b, d)
2839
2843
  }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : V("", !0),
2840
- z(l.$slots, "table-edit-right-" + d.key, {
2844
+ z(n.$slots, "table-edit-right-" + d.key, {
2841
2845
  row: b,
2842
2846
  item: d
2843
2847
  })
@@ -2846,14 +2850,14 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
2846
2850
  _: 2
2847
2851
  }, 1032, ["size", "error"])
2848
2852
  ])) : (m(), C(A, { key: 1 }, [
2849
- l.conf.update.type === i(E).EDialog.Update && i(o)(d.show?.form, l.conf.update.form, i(E).EDialog.Update) && l.option.table?.inlineEdit && l.conf.update.form[l.option.table?.rowKey] === b[l.option.table?.rowKey] && (d.type === "input" || d.type === "select") ? (m(), C(A, { key: 0 }, [
2853
+ n.conf.update.type === i(E).EDialog.Update && i(o)(d.show?.form, n.conf.update.form, i(E).EDialog.Update) && n.option.table?.inlineEdit && n.conf.update.form[n.option.table?.rowKey] === b[n.option.table?.rowKey] && (d.type === "input" || d.type === "select") ? (m(), C(A, { key: 0 }, [
2850
2854
  d.type === "input" ? (m(), y(i(fe), S({
2851
2855
  key: 0,
2852
- modelValue: l.conf.update.form[d.key],
2853
- "onUpdate:modelValue": (c) => l.conf.update.form[d.key] = c,
2854
- disabled: l.conf.update.getDisabled(d, !0),
2856
+ modelValue: n.conf.update.form[d.key],
2857
+ "onUpdate:modelValue": (c) => n.conf.update.form[d.key] = c,
2858
+ disabled: n.conf.update.getDisabled(d, !0),
2855
2859
  ref_for: !0
2856
- }, l.conf.update.getBind(d), $(l.conf.update.getOn(d, b)), { style: { width: "100%" } }), Z({ _: 2 }, [
2860
+ }, n.conf.update.getBind(d), $(n.conf.update.getOn(d, b)), { style: { width: "100%" } }), Z({ _: 2 }, [
2857
2861
  d.options?.input?.prepend ? {
2858
2862
  name: "prepend",
2859
2863
  fn: h(() => [
@@ -2863,11 +2867,11 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
2863
2867
  } : void 0
2864
2868
  ]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : d.type === "select" ? (m(), y(i(ce), S({
2865
2869
  key: 1,
2866
- modelValue: l.conf.update.form[d.key],
2867
- "onUpdate:modelValue": (c) => l.conf.update.form[d.key] = c,
2868
- disabled: l.conf.update.getDisabled(d, !0),
2870
+ modelValue: n.conf.update.form[d.key],
2871
+ "onUpdate:modelValue": (c) => n.conf.update.form[d.key] = c,
2872
+ disabled: n.conf.update.getDisabled(d, !0),
2869
2873
  ref_for: !0
2870
- }, l.conf.update.getBind(d), $(l.conf.update.getOn(d, b)), { style: { width: "100%" } }), {
2874
+ }, n.conf.update.getBind(d), $(n.conf.update.getOn(d, b)), { style: { width: "100%" } }), {
2871
2875
  default: h(() => [
2872
2876
  (m(!0), C(A, null, G(d.options?.search?.select?.data || d.options?.select?.data, (c) => (m(), y(i(ne), {
2873
2877
  key: c.value,
@@ -2878,13 +2882,13 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
2878
2882
  _: 2
2879
2883
  }, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : d.type === "switch" ? (m(), y(i(ge), S({
2880
2884
  key: 2,
2881
- modelValue: l.conf.update.form[d.key],
2882
- "onUpdate:modelValue": (c) => l.conf.update.form[d.key] = c,
2885
+ modelValue: n.conf.update.form[d.key],
2886
+ "onUpdate:modelValue": (c) => n.conf.update.form[d.key] = c,
2883
2887
  ref_for: !0
2884
- }, l.conf.update.getBind(d), $(l.conf.update.getOn(d, b)), {
2885
- disabled: l.conf.update.getDisabled(d, !0)
2888
+ }, n.conf.update.getBind(d), $(n.conf.update.getOn(d, b)), {
2889
+ disabled: n.conf.update.getDisabled(d, !0)
2886
2890
  }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : V("", !0)
2887
- ], 64)) : z(l.$slots, "table-" + d.key, {
2891
+ ], 64)) : z(n.$slots, "table-" + d.key, {
2888
2892
  key: 1,
2889
2893
  row: b,
2890
2894
  item: d
@@ -2899,7 +2903,7 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
2899
2903
  key: 0,
2900
2904
  modelValue: b[d.key],
2901
2905
  "onUpdate:modelValue": (c) => b[d.key] = c,
2902
- loading: d.options?.switch?.loadingMap?.[b[l.option.table?.rowKey]]?.loading,
2906
+ loading: d.options?.switch?.loadingMap?.[b[n.option.table?.rowKey]]?.loading,
2903
2907
  "before-change": () => d.options?.switch?.tableBeforeChange?.(d.key, b),
2904
2908
  ref_for: !0
2905
2909
  }, d.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "loading", "before-change"])) : (m(), C("span", Lo, R(b[d.key] === d.options?.switch?.activeValue ? d.options?.switch?.activeText : d.options?.switch?.inactiveText), 1))
@@ -2957,7 +2961,7 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
2957
2961
  }
2958
2962
  },
2959
2963
  setup(a, { expose: o }) {
2960
- const s = E.EDialog, t = a, n = E.isFun, { conf: e, switchConfirmRef: r, ruleFormRef: l, tableRef: u } = to(t);
2964
+ const s = E.EDialog, t = a, l = E.isFun, { conf: e, switchConfirmRef: r, ruleFormRef: n, tableRef: u } = to(t);
2961
2965
  return o({
2962
2966
  conf: e
2963
2967
  }), (f, d) => {
@@ -3058,7 +3062,7 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
3058
3062
  ])) : V("", !0),
3059
3063
  D("div", Ko, [
3060
3064
  D("div", Ho, [
3061
- i(n)(a.option.tools?.add) ? (m(), C("div", No, [
3065
+ i(l)(a.option.tools?.add) ? (m(), C("div", No, [
3062
3066
  M(i(K), {
3063
3067
  type: "primary",
3064
3068
  onClick: d[0] || (d[0] = (p) => i(e).update.open(i(s).Add)),
@@ -3070,7 +3074,7 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
3070
3074
  _: 1
3071
3075
  }, 8, ["size"])
3072
3076
  ])) : V("", !0),
3073
- a.option.table?.selectable && i(n)(a.option.tools?.delete) ? (m(), C("div", Io, [
3077
+ i(l)(a.option.tools?.delete) ? (m(), C("div", Io, [
3074
3078
  M(i(K), {
3075
3079
  type: "danger",
3076
3080
  onClick: d[1] || (d[1] = (p) => i(e).remove.open(i(e).table.selection.list)),
@@ -3104,7 +3108,7 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
3104
3108
  size: a.option.size?.search
3105
3109
  }, {
3106
3110
  default: h(() => [
3107
- a.option.tools?.export?.dropdown?.select && (a.option.table?.selectable || i(n)(a.option.tools?.delete)) ? (m(), y(i(de), {
3111
+ a.option.tools?.export?.dropdown?.select && (a.option.table?.selectable || i(l)(a.option.tools?.delete)) ? (m(), y(i(de), {
3108
3112
  key: 0,
3109
3113
  command: "select"
3110
3114
  }, {
@@ -3291,7 +3295,7 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
3291
3295
  onExpandChange: i(e).table.expand.change
3292
3296
  }, i(e).table.sortable.getTableBindOption(), $(a.option.table?.on || {})), {
3293
3297
  default: h(() => [
3294
- (typeof a.option.table?.selectable == "object" ? a.option.table?.selectable?.show : a.option.table?.selectable) || i(n)(a.option.tools?.delete) || a.option.tools?.export?.show && a.option.tools?.export?.select ? (m(), y(i(ue), S({
3298
+ (typeof a.option.table?.selectable == "object" ? a.option.table?.selectable?.show : a.option.table?.selectable) || i(l)(a.option.tools?.delete) || a.option.tools?.export?.show && a.option.tools?.export?.select ? (m(), y(i(ue), S({
3295
3299
  key: 0,
3296
3300
  type: "selection",
3297
3301
  width: "40",
@@ -3353,7 +3357,7 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
3353
3357
  ])
3354
3358
  }))
3355
3359
  ]), 1032, ["conf", "columnList", "option"]),
3356
- i(n)(a.option.table?.add) || i(n)(a.option.table?.update) || i(n)(a.option.table?.delete) || i(n)(a.option.table?.view) || f.$slots["table-op-left"] || f.$slots["table-op-right"] ? (m(), y(i(ue), S({
3360
+ i(l)(a.option.table?.add) || i(l)(a.option.table?.update) || i(l)(a.option.table?.delete) || i(l)(a.option.table?.view) || f.$slots["table-op-left"] || f.$slots["table-op-right"] ? (m(), y(i(ue), S({
3357
3361
  key: 3,
3358
3362
  align: "center",
3359
3363
  fixed: "right"
@@ -3396,7 +3400,7 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
3396
3400
  }, 8, ["onClick", "loading"]),
3397
3401
  z(f.$slots, "table-op-edit-right", { row: p })
3398
3402
  ], 64)) : (m(), C(A, { key: 1 }, [
3399
- i(n)(a.option.table?.add, p) ? (m(), y(i(K), {
3403
+ i(l)(a.option.table?.add, p) ? (m(), y(i(K), {
3400
3404
  key: 0,
3401
3405
  link: "",
3402
3406
  type: "primary",
@@ -3407,7 +3411,7 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
3407
3411
  ]),
3408
3412
  _: 2
3409
3413
  }, 1032, ["onClick"])) : V("", !0),
3410
- i(n)(a.option.table?.view, p) ? (m(), y(i(K), {
3414
+ i(l)(a.option.table?.view, p) ? (m(), y(i(K), {
3411
3415
  key: 1,
3412
3416
  link: "",
3413
3417
  type: "primary",
@@ -3418,7 +3422,7 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
3418
3422
  ]),
3419
3423
  _: 2
3420
3424
  }, 1032, ["onClick"])) : V("", !0),
3421
- i(n)(a.option.table?.update, p) ? (m(), y(i(K), {
3425
+ i(l)(a.option.table?.update, p) ? (m(), y(i(K), {
3422
3426
  key: 2,
3423
3427
  link: "",
3424
3428
  type: "warning",
@@ -3429,7 +3433,7 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
3429
3433
  ]),
3430
3434
  _: 2
3431
3435
  }, 1032, ["onClick"])) : V("", !0),
3432
- i(n)(a.option.table?.delete, p) ? (m(), y(i(K), {
3436
+ i(l)(a.option.table?.delete, p) ? (m(), y(i(K), {
3433
3437
  key: 3,
3434
3438
  link: "",
3435
3439
  type: "danger",
@@ -3521,7 +3525,7 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
3521
3525
  }),
3522
3526
  M(i(oe), {
3523
3527
  ref_key: "ruleFormRef",
3524
- ref: l,
3528
+ ref: n,
3525
3529
  model: i(e).update.form,
3526
3530
  rules: i(e).update.rules,
3527
3531
  size: a.option.size?.form,
@@ -3628,8 +3632,8 @@ class ia {
3628
3632
  * @param name
3629
3633
  */
3630
3634
  static exportJSONFile = (o, s) => {
3631
- const t = new Blob([JSON.stringify(o)], { type: "application/json" }), n = URL.createObjectURL(t), e = document.createElement("a");
3632
- e.href = n, e.download = `${s || "config"}.json`, e.click();
3635
+ const t = new Blob([JSON.stringify(o)], { type: "application/json" }), l = URL.createObjectURL(t), e = document.createElement("a");
3636
+ e.href = l, e.download = `${s || "config"}.json`, e.click();
3633
3637
  };
3634
3638
  /**
3635
3639
  * 导入文件内容,默认为json
@@ -3637,12 +3641,12 @@ class ia {
3637
3641
  * @returns
3638
3642
  */
3639
3643
  static importFile = async (o) => new Promise((s, t) => {
3640
- const n = document.createElement("input");
3641
- n.type = "file";
3644
+ const l = document.createElement("input");
3645
+ l.type = "file";
3642
3646
  const e = o?.accept || ".json";
3643
- n.accept = e, n.style.display = "none", n.onchange = (r) => {
3644
- const l = r.target.files[0];
3645
- if (!l) {
3647
+ l.accept = e, l.style.display = "none", l.onchange = (r) => {
3648
+ const n = r.target.files[0];
3649
+ if (!n) {
3646
3650
  E.fail("未选择文件"), t("未选择文件");
3647
3651
  return;
3648
3652
  }
@@ -3652,8 +3656,8 @@ class ia {
3652
3656
  s(d);
3653
3657
  }, u.onerror = () => {
3654
3658
  E.fail("文件读取失败"), t("文件读取失败");
3655
- }, u.readAsText(l), document.body.removeChild(n);
3656
- }, document.body.appendChild(n), n.click();
3659
+ }, u.readAsText(n), document.body.removeChild(l);
3660
+ }, document.body.appendChild(l), l.click();
3657
3661
  });
3658
3662
  }
3659
3663
  const oa = (a, o) => {