cc1-form 1.3.0 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cc1-form.js CHANGED
@@ -1,8 +1,8 @@
1
- import { ElMessage as Ke, ElLoading as He, ElFormItem as be, ElInput as _, ElSwitch as se, ElSelect as ne, ElOption as ee, ElRadioGroup as xe, ElRadioButton as Ge, ElRadio as Ve, ElCheckboxGroup as Ne, ElCheckboxButton as We, ElCheckbox as Je, ElColorPicker as Qe, ElSlider as qe, ElTreeSelect as Xe, ElDatePicker as Se, ElForm as Y, ElDialog as ye, ElButton as T, ElTableColumn as ue, ElDropdown as Ye, ElDropdownMenu as Ze, ElDropdownItem as he, ElPagination as ke, ElTable as _e } from "element-plus";
1
+ import { ElMessage as et, ElLoading as tt, ElFormItem as be, ElInput as de, ElInputNumber as ot, ElSwitch as he, ElSelect as ue, ElOption as ne, ElRadioGroup as Ue, ElRadioButton as at, ElRadio as Ae, ElCheckboxGroup as nt, ElCheckboxButton as lt, ElCheckbox as it, ElColorPicker as rt, ElSlider as st, ElTreeSelect as dt, ElDatePicker as Be, ElForm as oe, ElDialog as Ee, ElButton as N, ElTableColumn as ye, ElDropdown as ut, ElDropdownMenu as ct, ElDropdownItem as Se, ElPagination as Oe, ElTable as ft } from "element-plus";
2
2
  import "vue-router";
3
- import { defineComponent as G, reactive as ge, onMounted as ze, resolveComponent as le, openBlock as s, createElementBlock as y, renderSlot as x, createVNode as D, withCtx as b, createTextVNode as $, createCommentVNode as v, Fragment as F, renderList as L, createBlock as h, normalizeClass as I, normalizeStyle as ce, unref as r, createElementVNode as M, mergeProps as k, toHandlers as V, createSlots as J, toDisplayString as O, resolveDynamicComponent as X, computed as Z, ref as q, watch as et, normalizeProps as pe, guardReactiveProps as we, getCurrentInstance as tt, withModifiers as ot, resolveDirective as at, withDirectives as nt } from "vue";
4
- import { Scope as $e } from "cc1-vue3";
5
- class z {
3
+ import { defineComponent as q, reactive as ie, onMounted as Le, resolveComponent as ce, openBlock as g, createElementBlock as v, renderSlot as S, createVNode as F, withCtx as p, createTextVNode as M, createCommentVNode as V, Fragment as B, renderList as G, createBlock as b, normalizeClass as J, normalizeStyle as pe, unref as l, createElementVNode as R, mergeProps as x, toHandlers as E, createSlots as X, toDisplayString as U, resolveDynamicComponent as ee, computed as ae, ref as _, onUnmounted as Te, watch as mt, normalizeProps as $e, guardReactiveProps as ze, getCurrentInstance as je, withModifiers as gt, resolveDirective as ht, withDirectives as yt } from "vue";
4
+ import { Scope as Me } from "cc1-vue3";
5
+ class $ {
6
6
  /**
7
7
  * Vue Router 实例,需在应用初始化时赋值
8
8
  */
@@ -27,13 +27,13 @@ class z {
27
27
  * @param data 数据
28
28
  * @returns 是否显示
29
29
  */
30
- static isFun = (a, ...l) => Array.isArray(a) ? a.some((t) => typeof t == "function" ? t(...l) : t) : typeof a == "function" ? a(...l) : a;
30
+ static isFun = (o, ...a) => Array.isArray(o) ? o.some((t) => typeof t == "function" ? t(...a) : t) : typeof o == "function" ? o(...a) : o;
31
31
  /**
32
32
  * 获取路由参数,自动获取query、params中的参数, 哪个有就返回哪个
33
33
  */
34
34
  static getRouterParams = () => {
35
- const a = this.router.currentRoute.value.query || {}, l = this.router.currentRoute.value.params || {};
36
- return Object.keys(a).length ? a : Object.keys(l).length ? l : {};
35
+ const o = this.router.currentRoute.value.query || {}, a = this.router.currentRoute.value.params || {};
36
+ return Object.keys(o).length ? o : Object.keys(a).length ? a : {};
37
37
  };
38
38
  /**
39
39
  * 模块赋值
@@ -43,11 +43,11 @@ class z {
43
43
  * 加载模块
44
44
  * @param module
45
45
  */
46
- static loadModule = async (a) => {
47
- if (!z.moduleObj[a])
48
- throw new Error(`模块${a}未加载,请赋值如:TSys.moduleObj = { ${a}: ()=>import('${a}') }`);
49
- const l = await z.moduleObj[a]();
50
- return l.default ?? l;
46
+ static loadModule = async (o) => {
47
+ if (!$.moduleObj[o])
48
+ throw new Error(`模块${o}未加载,请赋值如:TSys.moduleObj = { ${o}: ()=>import('${o}') }`);
49
+ const a = await $.moduleObj[o]();
50
+ return a.default ?? a;
51
51
  };
52
52
  /**
53
53
  * 提示信息对象管理
@@ -63,19 +63,19 @@ class z {
63
63
  * @param type 消息类型
64
64
  * @param options 其他选项
65
65
  */
66
- static showMessage(a, l, t = {}) {
67
- const i = Date.now();
68
- if (!this.tipMessages[a] || i - this.tipMessages[a] > this.tipMessagesGap) {
69
- this.tipMessages[a] = i;
66
+ static showMessage(o, a, t = {}) {
67
+ const r = Date.now();
68
+ if (!this.tipMessages[o] || r - this.tipMessages[o] > this.tipMessagesGap) {
69
+ this.tipMessages[o] = r;
70
70
  const n = Object.assign(
71
71
  {
72
- message: a,
73
- type: l
72
+ message: o,
73
+ type: a
74
74
  },
75
75
  t
76
76
  );
77
- Ke(n), setTimeout(() => {
78
- delete this.tipMessages[a];
77
+ et(n), setTimeout(() => {
78
+ delete this.tipMessages[o];
79
79
  }, this.tipMessagesGap);
80
80
  }
81
81
  }
@@ -84,16 +84,16 @@ class z {
84
84
  * @param content
85
85
  * @param options
86
86
  */
87
- static fail = (a, l = {}) => {
88
- this.showMessage(a, "error", l);
87
+ static fail = (o, a = {}) => {
88
+ this.showMessage(o, "error", a);
89
89
  };
90
90
  /**
91
91
  * 成功提示
92
92
  * @param content
93
93
  * @param options
94
94
  */
95
- static success = (a, l = {}) => {
96
- this.showMessage(a, "success", l);
95
+ static success = (o, a = {}) => {
96
+ this.showMessage(o, "success", a);
97
97
  };
98
98
  static loadingObj = null;
99
99
  static loadingTimer = null;
@@ -102,11 +102,11 @@ class z {
102
102
  * @param show
103
103
  * @param text
104
104
  */
105
- static loading = (a = !0, l = "Loading...") => {
105
+ static loading = (o = !0, a = "Loading...") => {
106
106
  Timer.un(this.loadingTimer), this.loadingTimer = Timer.once(() => {
107
- a ? this.loadingObj = He.service({
107
+ o ? this.loadingObj = tt.service({
108
108
  lock: !0,
109
- text: l,
109
+ text: a,
110
110
  background: "rgba(0, 0, 0, 0.3)"
111
111
  }) : this.loadingObj && (this.loadingObj.close(), this.loadingObj = null);
112
112
  }, 50);
@@ -116,46 +116,46 @@ class z {
116
116
  * @param url 地址
117
117
  * @param isCenter 是否居中
118
118
  */
119
- static openUrl = (a, l = !0) => {
120
- if (l) {
121
- let t = screen.width / 2 - 500, i = screen.height / 2 - 800 / 2 - 30;
119
+ static openUrl = (o, a = !0) => {
120
+ if (a) {
121
+ let t = screen.width / 2 - 500, r = screen.height / 2 - 800 / 2 - 30;
122
122
  window.open(
123
- a,
123
+ o,
124
124
  "_blank",
125
- "toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + i + ", left=" + t
125
+ "toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + r + ", left=" + t
126
126
  );
127
127
  } else
128
- window.open(a, "DescriptiveWindowName" + StrUtil.getId(), "resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0");
128
+ window.open(o, "DescriptiveWindowName" + StrUtil.getId(), "resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0");
129
129
  };
130
130
  /**
131
131
  * 根据dom id截图并返回图片数据
132
132
  * @param param
133
133
  * @returns
134
134
  */
135
- static getImgPic = (a) => new Promise(async (l, t) => {
136
- let i = document.getElementById(a.id);
137
- const n = await z.loadModule("html2canvas");
135
+ static getImgPic = (o) => new Promise(async (a, t) => {
136
+ let r = document.getElementById(o.id);
137
+ const n = await $.loadModule("html2canvas");
138
138
  try {
139
- n(i, {
139
+ n(r, {
140
140
  logging: !1,
141
141
  allowTaint: !0,
142
142
  scale: window.devicePixelRatio,
143
- width: a.windowWidth,
144
- height: a.windowHeight,
145
- windowWidth: a.windowWidth,
146
- windowHeight: a.windowHeight,
143
+ width: o.windowWidth,
144
+ height: o.windowHeight,
145
+ windowWidth: o.windowWidth,
146
+ windowHeight: o.windowHeight,
147
147
  useCORS: !0,
148
148
  backgroundColor: "#ffffff00"
149
- }).then(function(o) {
150
- let d = o.toDataURL("image/png");
151
- l(d);
149
+ }).then(function(s) {
150
+ let d = s.toDataURL("image/png");
151
+ a(d);
152
152
  });
153
- } catch (o) {
154
- t(o);
153
+ } catch (s) {
154
+ t(s);
155
155
  }
156
156
  });
157
157
  }
158
- class U {
158
+ class T {
159
159
  /**
160
160
  * 全局配置对象
161
161
  */
@@ -516,11 +516,11 @@ class U {
516
516
  *
517
517
  * @param config - 需要覆盖的配置项(深度 Partial)
518
518
  */
519
- static setConfig = (a) => {
520
- U.config = ObjectUtil.deepMerge(U.config, a);
519
+ static setConfig = (o) => {
520
+ T.config = ObjectUtil.deepMerge(T.config, o);
521
521
  };
522
522
  }
523
- class P {
523
+ class W {
524
524
  /**
525
525
  * 自定义组件映射表,key 为组件名(同时作为 column.type 值),value 为 Vue 组件定义
526
526
  *
@@ -542,10 +542,10 @@ class P {
542
542
  * @param field - 字段的 key 值
543
543
  * @returns 该字段对应类型的 options 配置,如 select 类型返回 `options.select`
544
544
  */
545
- static findOptions = (a, l) => {
546
- const t = a.column.find((n) => n.key === l), i = (n) => n.replace(/-([a-z])/g, (o, d) => d.toUpperCase());
545
+ static findOptions = (o, a) => {
546
+ const t = o.column.find((n) => n.key === a), r = (n) => n.replace(/-([a-z])/g, (s, d) => d.toUpperCase());
547
547
  if (t)
548
- return t.options[i(t.type)];
548
+ return t.options[r(t.type)];
549
549
  };
550
550
  /**
551
551
  * 更新组件数据
@@ -563,9 +563,9 @@ class P {
563
563
  }))
564
564
  )
565
565
  */
566
- static setOptionsData = (a, l, t) => {
567
- const i = P.findOptions(a, l);
568
- i && (i.data = t);
566
+ static setOptionsData = (o, a, t) => {
567
+ const r = W.findOptions(o, a);
568
+ r && (r.data = t);
569
569
  };
570
570
  static form = {
571
571
  openBefore: {
@@ -576,14 +576,14 @@ class P {
576
576
  * @param treeData 树形数据
577
577
  * @param option 组件配置
578
578
  */
579
- parentId: (a, l, t, i) => {
580
- const n = U.config.table.rowKey;
581
- a ? l.type === z.EDialog.Add ? (l.form.parentId = a[n], l.form.sort = a.children.length + 1) : l.form.parentId = a.parentId.substring(a.parentId.lastIndexOf(",") + 1) : (l.form.parentId = "0", l.form.sort = t.length + 1), P.setOptionsData(i, "parentId", [{ [n]: "0", title: "根", children: t }]);
579
+ parentId: (o, a, t, r) => {
580
+ const n = T.config.table.rowKey;
581
+ o ? a.type === $.EDialog.Add ? (a.form.parentId = o[n], a.form.sort = o.children.length + 1) : a.form.parentId = o.parentId.substring(o.parentId.lastIndexOf(",") + 1) : (a.form.parentId = "0", a.form.sort = t.length + 1), W.setOptionsData(r, "parentId", [{ [n]: "0", title: "根", children: t }]);
582
582
  }
583
583
  }
584
584
  };
585
585
  }
586
- class W {
586
+ class Q {
587
587
  /**
588
588
  * ID 生成函数,默认使用 `StrUtil.uuid()`,可覆盖为自定义实现
589
589
  */
@@ -593,14 +593,14 @@ class W {
593
593
  * @param field 字段名
594
594
  * @param row 行数据
595
595
  */
596
- static setId = (a, l, t) => {
597
- l[a] || (l[a] = []);
598
- const i = U.config.table.rowKey;
599
- l[a].forEach((n) => {
600
- t.forEach((o) => {
601
- let d = o.default ?? "";
602
- o.type === "number" && (d = o.default ?? 0), o.type === "boolean" && (d = o.default ?? !1), o.type === "time" && (d = o.default ?? /* @__PURE__ */ new Date()), n[o.value] === void 0 && (n[o.value] = d);
603
- }), n[i] || (n[i] = W.getIdFun());
596
+ static setId = (o, a, t) => {
597
+ a[o] || (a[o] = []);
598
+ const r = T.config.table.rowKey;
599
+ a[o].forEach((n) => {
600
+ t.forEach((s) => {
601
+ let d = s.default ?? "";
602
+ s.type === "number" && (d = s.default ?? 0), s.type === "boolean" && (d = s.default ?? !1), s.type === "time" && (d = s.default ?? /* @__PURE__ */ new Date()), n[s.value] === void 0 && (n[s.value] = d);
603
+ }), n[r] || (n[r] = Q.getIdFun());
604
604
  });
605
605
  };
606
606
  /**
@@ -610,19 +610,19 @@ class W {
610
610
  * @param itemFields 元素字段-如:[{label:'',value:''}]
611
611
  * @param callback 回调函数
612
612
  */
613
- static add = (a, l, t, i) => {
613
+ static add = (o, a, t, r) => {
614
614
  const n = JSONUtil.cp(t);
615
- W.setId(a, l, t);
616
- const o = U.config.table.rowKey;
617
- l[a].push(
615
+ Q.setId(o, a, t);
616
+ const s = T.config.table.rowKey;
617
+ a[o].push(
618
618
  n.reduce(
619
619
  (d, c) => {
620
620
  let u = c.default ?? "";
621
621
  return c.type === "number" && (u = c.default ?? 0), c.type === "boolean" && (u = c.default ?? !1), c.type === "time" && (u = c.default ?? /* @__PURE__ */ new Date()), d[c.value] = u, d;
622
622
  },
623
- { [o]: W.getIdFun() }
623
+ { [s]: Q.getIdFun() }
624
624
  )
625
- ), i?.(l);
625
+ ), r?.(a);
626
626
  };
627
627
  /**
628
628
  * 删除数组元素
@@ -631,9 +631,9 @@ class W {
631
631
  * @param item 元素-如:{_id:''}
632
632
  * @param callback 回调函数
633
633
  */
634
- static remove = (a, l, t, i) => {
635
- const n = U.config.table.rowKey;
636
- l[a] = l[a].filter((o) => o[n] !== t[n]), i?.(l);
634
+ static remove = (o, a, t, r) => {
635
+ const n = T.config.table.rowKey;
636
+ a[o] = a[o].filter((s) => s[n] !== t[n]), r?.(a);
637
637
  };
638
638
  /**
639
639
  * 获取没有id的数据
@@ -641,21 +641,21 @@ class W {
641
641
  * @param childernField 子级字段-如:list、children
642
642
  * @returns 没有id的数据
643
643
  */
644
- static getNoIdData = (a, l) => {
645
- const t = JSONUtil.cp(a), i = U.config.table.rowKey;
644
+ static getNoIdData = (o, a) => {
645
+ const t = JSONUtil.cp(o), r = T.config.table.rowKey;
646
646
  return t.forEach((n) => {
647
- n[i] && delete n[i], l && n[l] && W.getNoIdData(n[l], l);
647
+ n[r] && delete n[r], a && n[a] && Q.getNoIdData(n[a], a);
648
648
  }), t;
649
649
  };
650
650
  }
651
- const lt = {
651
+ const bt = {
652
652
  key: 0,
653
653
  class: "column curd-form-com-list",
654
654
  style: { width: "100%", gap: "10px" }
655
- }, it = { key: 0 }, rt = {
655
+ }, pt = { key: 0 }, wt = {
656
656
  class: "row items-center",
657
657
  style: { gap: "10px", width: "100%" }
658
- }, dt = { key: 1 }, Ee = /* @__PURE__ */ G({
658
+ }, kt = { key: 1 }, Ke = /* @__PURE__ */ q({
659
659
  __name: "list",
660
660
  props: {
661
661
  row: {
@@ -693,88 +693,88 @@ const lt = {
693
693
  }
694
694
  },
695
695
  emits: ["change"],
696
- setup(e, { emit: a }) {
697
- const l = e, t = ge({
696
+ setup(e, { emit: o }) {
697
+ const a = e, t = ie({
698
698
  show: !1,
699
- add: (n, o, d) => {
700
- W.add(n, o, d, () => {
701
- i("change");
699
+ add: (n, s, d) => {
700
+ Q.add(n, s, d, () => {
701
+ r("change");
702
702
  });
703
703
  },
704
- remove: (n, o, d) => {
705
- W.remove(n, o, d, () => {
706
- i("change");
704
+ remove: (n, s, d) => {
705
+ Q.remove(n, s, d, () => {
706
+ r("change");
707
707
  });
708
708
  }
709
709
  });
710
- ze(() => {
711
- W.setId(l.field, l.row, l.itemFields), t.show = !0;
710
+ Le(() => {
711
+ Q.setId(a.field, a.row, a.itemFields), t.show = !0;
712
712
  });
713
- const i = a;
714
- return (n, o) => {
715
- const d = le("el-button"), c = le("el-input");
716
- return t.show ? (s(), y("div", lt, [
717
- x(n.$slots, "list-start", { row: e.row }),
718
- e.addBottom ? v("", !0) : (s(), y("div", it, [
719
- D(d, {
713
+ const r = o;
714
+ return (n, s) => {
715
+ const d = ce("el-button"), c = ce("el-input");
716
+ return t.show ? (g(), v("div", bt, [
717
+ S(n.$slots, "list-start", { row: e.row }),
718
+ e.addBottom ? V("", !0) : (g(), v("div", pt, [
719
+ F(d, {
720
720
  link: "",
721
721
  type: "primary",
722
- onClick: o[0] || (o[0] = (u) => t.add(e.field, e.row, e.itemFields))
722
+ onClick: s[0] || (s[0] = (u) => t.add(e.field, e.row, e.itemFields))
723
723
  }, {
724
- default: b(() => [...o[3] || (o[3] = [
725
- $("添加", -1)
724
+ default: p(() => [...s[3] || (s[3] = [
725
+ M("添加", -1)
726
726
  ])]),
727
727
  _: 1
728
728
  })
729
729
  ])),
730
- (s(!0), y(F, null, L(e.row[e.field], (u) => (s(), y("div", rt, [
731
- x(n.$slots, "item-start", {
730
+ (g(!0), v(B, null, G(e.row[e.field], (u) => (g(), v("div", wt, [
731
+ S(n.$slots, "item-start", {
732
732
  item: u,
733
733
  row: e.row
734
734
  }),
735
- (s(!0), y(F, null, L(e.itemFields, (m) => (s(), h(c, {
736
- modelValue: u[m.value],
737
- "onUpdate:modelValue": (p) => u[m.value] = p,
738
- style: ce({ width: e.inputWidth }),
739
- class: I(e.inputClass),
740
- placeholder: m[e.label] || m[e.value],
741
- onChange: o[1] || (o[1] = (p) => i("change"))
735
+ (g(!0), v(B, null, G(e.itemFields, (i) => (g(), b(c, {
736
+ modelValue: u[i.value],
737
+ "onUpdate:modelValue": (h) => u[i.value] = h,
738
+ style: pe({ width: e.inputWidth }),
739
+ class: J(e.inputClass),
740
+ placeholder: i[e.label] || i[e.value],
741
+ onChange: s[1] || (s[1] = (h) => r("change"))
742
742
  }, null, 8, ["modelValue", "onUpdate:modelValue", "style", "class", "placeholder"]))), 256)),
743
- x(n.$slots, "item-end", {
743
+ S(n.$slots, "item-end", {
744
744
  item: u,
745
745
  row: e.row
746
746
  }),
747
- D(d, {
747
+ F(d, {
748
748
  link: "",
749
749
  type: "danger",
750
- onClick: (m) => t.remove(e.field, e.row, u)
750
+ onClick: (i) => t.remove(e.field, e.row, u)
751
751
  }, {
752
- default: b(() => [...o[4] || (o[4] = [
753
- $("删除", -1)
752
+ default: p(() => [...s[4] || (s[4] = [
753
+ M("删除", -1)
754
754
  ])]),
755
755
  _: 1
756
756
  }, 8, ["onClick"])
757
757
  ]))), 256)),
758
- e.addBottom ? (s(), y("div", dt, [
759
- D(d, {
758
+ e.addBottom ? (g(), v("div", kt, [
759
+ F(d, {
760
760
  link: "",
761
761
  type: "primary",
762
- onClick: o[2] || (o[2] = (u) => t.add(e.field, e.row, e.itemFields))
762
+ onClick: s[2] || (s[2] = (u) => t.add(e.field, e.row, e.itemFields))
763
763
  }, {
764
- default: b(() => [...o[5] || (o[5] = [
765
- $("添加", -1)
764
+ default: p(() => [...s[5] || (s[5] = [
765
+ M("添加", -1)
766
766
  ])]),
767
767
  _: 1
768
768
  })
769
- ])) : v("", !0),
770
- x(n.$slots, "list-end", { row: e.row })
771
- ])) : v("", !0);
769
+ ])) : V("", !0),
770
+ S(n.$slots, "list-end", { row: e.row })
771
+ ])) : V("", !0);
772
772
  };
773
773
  }
774
- }), st = {
774
+ }), vt = {
775
775
  class: "row form-item-content",
776
776
  style: { width: "100%" }
777
- }, ut = { class: "col column form-item-content-item" }, ct = { class: "col" }, ft = ["innerHTML"], mt = /* @__PURE__ */ G({
777
+ }, Ct = { class: "col column form-item-content-item" }, xt = { class: "col" }, Vt = ["innerHTML"], St = /* @__PURE__ */ q({
778
778
  __name: "field",
779
779
  props: {
780
780
  item: {},
@@ -786,166 +786,165 @@ const lt = {
786
786
  getDisabled: { type: Function }
787
787
  },
788
788
  setup(e) {
789
- return (a, l) => (s(), h(r(be), {
789
+ return (o, a) => (g(), b(l(be), {
790
790
  label: e.item.text?.form?.label ?? e.item.label,
791
791
  prop: e.item.key,
792
792
  "label-width": e.item.text?.form?.label == "" ? 0 : e.item.form?.labelWidth || e.labelWidth
793
793
  }, {
794
- default: b(() => [
795
- M("div", st, [
796
- x(a.$slots, "form-" + e.item.key + "-start", {
794
+ default: p(() => [
795
+ R("div", vt, [
796
+ S(o.$slots, "form-" + e.item.key + "-start", {
797
797
  row: e.form,
798
798
  item: e.item
799
799
  }),
800
- M("div", ut, [
801
- M("div", ct, [
802
- x(a.$slots, "form-" + e.item.key, {
800
+ R("div", Ct, [
801
+ R("div", xt, [
802
+ S(o.$slots, "form-" + e.item.key, {
803
803
  row: e.form,
804
804
  item: e.item
805
805
  }, () => [
806
- e.item.type === "input" ? (s(), h(r(_), k({
806
+ e.item.type === "input" ? (g(), b(l(de), x({
807
807
  key: 0,
808
808
  modelValue: e.form[e.item.key],
809
- "onUpdate:modelValue": l[0] || (l[0] = (t) => e.form[e.item.key] = t)
810
- }, e.getBind(e.item), V(e.getOn(e.item)), {
809
+ "onUpdate:modelValue": a[0] || (a[0] = (t) => e.form[e.item.key] = t)
810
+ }, e.getBind(e.item), E(e.getOn(e.item)), {
811
811
  disabled: e.getDisabled(e.item)
812
- }), J({ _: 2 }, [
812
+ }), X({ _: 2 }, [
813
813
  e.getBind(e.item).prepend ? {
814
814
  name: "prepend",
815
- fn: b(() => [
816
- $(O(typeof e.getBind(e.item).prepend == "function" ? e.getBind(e.item).prepend(e.form) : e.getBind(e.item).prepend), 1)
815
+ fn: p(() => [
816
+ M(U(typeof e.getBind(e.item).prepend == "function" ? e.getBind(e.item).prepend(e.form) : e.getBind(e.item).prepend), 1)
817
817
  ]),
818
818
  key: "0"
819
819
  } : void 0
820
- ]), 1040, ["modelValue", "disabled"])) : e.item.type === "number" ? (s(), h(r(_), k({
820
+ ]), 1040, ["modelValue", "disabled"])) : e.item.type === "number" ? (g(), b(l(ot), x({
821
821
  key: 1,
822
- type: "number",
823
822
  modelValue: e.form[e.item.key],
824
- "onUpdate:modelValue": l[1] || (l[1] = (t) => e.form[e.item.key] = t)
825
- }, e.getBind(e.item), V(e.getOn(e.item)), {
823
+ "onUpdate:modelValue": a[1] || (a[1] = (t) => e.form[e.item.key] = t)
824
+ }, e.getBind(e.item), E(e.getOn(e.item)), {
826
825
  disabled: e.getDisabled(e.item)
827
- }), null, 16, ["modelValue", "disabled"])) : e.item.type === "textarea" ? (s(), h(r(_), k({
826
+ }), null, 16, ["modelValue", "disabled"])) : e.item.type === "textarea" ? (g(), b(l(de), x({
828
827
  key: 2,
829
828
  type: "textarea",
830
829
  modelValue: e.form[e.item.key],
831
- "onUpdate:modelValue": l[2] || (l[2] = (t) => e.form[e.item.key] = t)
832
- }, e.getBind(e.item), V(e.getOn(e.item)), {
830
+ "onUpdate:modelValue": a[2] || (a[2] = (t) => e.form[e.item.key] = t)
831
+ }, e.getBind(e.item), E(e.getOn(e.item)), {
833
832
  disabled: e.getDisabled(e.item)
834
- }), null, 16, ["modelValue", "disabled"])) : e.item.type === "switch" ? (s(), h(r(se), k({
833
+ }), null, 16, ["modelValue", "disabled"])) : e.item.type === "switch" ? (g(), b(l(he), x({
835
834
  key: 3,
836
835
  modelValue: e.form[e.item.key],
837
- "onUpdate:modelValue": l[3] || (l[3] = (t) => e.form[e.item.key] = t)
838
- }, e.getBind(e.item), V(e.getOn(e.item)), {
836
+ "onUpdate:modelValue": a[3] || (a[3] = (t) => e.form[e.item.key] = t)
837
+ }, e.getBind(e.item), E(e.getOn(e.item)), {
839
838
  disabled: e.getDisabled(e.item)
840
- }), null, 16, ["modelValue", "disabled"])) : e.item.type === "select" ? (s(), h(r(ne), k({
839
+ }), null, 16, ["modelValue", "disabled"])) : e.item.type === "select" ? (g(), b(l(ue), x({
841
840
  key: 4,
842
841
  modelValue: e.form[e.item.key],
843
- "onUpdate:modelValue": l[4] || (l[4] = (t) => e.form[e.item.key] = t)
844
- }, e.getBind(e.item), V(e.getOn(e.item)), {
842
+ "onUpdate:modelValue": a[4] || (a[4] = (t) => e.form[e.item.key] = t)
843
+ }, e.getBind(e.item), E(e.getOn(e.item)), {
845
844
  disabled: e.getDisabled(e.item),
846
845
  style: { width: "100%" }
847
846
  }), {
848
- default: b(() => [
849
- (s(!0), y(F, null, L(e.getBind(e.item).data || [], (t) => (s(), h(r(ee), k({
847
+ default: p(() => [
848
+ (g(!0), v(B, null, G(e.getBind(e.item).data || [], (t) => (g(), b(l(ne), x({
850
849
  key: t.value
851
- }, { ref_for: !0 }, t, V(t.on || {})), null, 16))), 128))
850
+ }, { ref_for: !0 }, t, E(t.on || {})), null, 16))), 128))
852
851
  ]),
853
852
  _: 1
854
- }, 16, ["modelValue", "disabled"])) : e.item.type === "radio" ? (s(), h(r(xe), k({
853
+ }, 16, ["modelValue", "disabled"])) : e.item.type === "radio" ? (g(), b(l(Ue), x({
855
854
  key: 5,
856
855
  modelValue: e.form[e.item.key],
857
- "onUpdate:modelValue": l[5] || (l[5] = (t) => e.form[e.item.key] = t)
858
- }, e.getBind(e.item), V(e.getOn(e.item)), {
856
+ "onUpdate:modelValue": a[5] || (a[5] = (t) => e.form[e.item.key] = t)
857
+ }, e.getBind(e.item), E(e.getOn(e.item)), {
859
858
  disabled: e.getDisabled(e.item),
860
859
  style: { width: "100%" }
861
860
  }), {
862
- default: b(() => [
863
- e.getBind(e.item).type === "group" ? (s(!0), y(F, { key: 0 }, L(e.getBind(e.item).data || [], (t) => (s(), h(r(Ge), k({
861
+ default: p(() => [
862
+ e.getBind(e.item).type === "group" ? (g(!0), v(B, { key: 0 }, G(e.getBind(e.item).data || [], (t) => (g(), b(l(at), x({
864
863
  key: t.value
865
- }, { ref_for: !0 }, t, V(t.on || {})), null, 16))), 128)) : (s(!0), y(F, { key: 1 }, L(e.getBind(e.item).data || [], (t) => (s(), h(r(Ve), k({
864
+ }, { ref_for: !0 }, t, E(t.on || {})), null, 16))), 128)) : (g(!0), v(B, { key: 1 }, G(e.getBind(e.item).data || [], (t) => (g(), b(l(Ae), x({
866
865
  key: t.value
867
- }, { ref_for: !0 }, t, V(t.on || {})), null, 16))), 128))
866
+ }, { ref_for: !0 }, t, E(t.on || {})), null, 16))), 128))
868
867
  ]),
869
868
  _: 1
870
- }, 16, ["modelValue", "disabled"])) : e.item.type === "checkbox" ? (s(), h(r(Ne), k({
869
+ }, 16, ["modelValue", "disabled"])) : e.item.type === "checkbox" ? (g(), b(l(nt), x({
871
870
  key: 6,
872
871
  modelValue: e.form[e.item.key],
873
- "onUpdate:modelValue": l[6] || (l[6] = (t) => e.form[e.item.key] = t)
874
- }, e.getBind(e.item), V(e.getOn(e.item)), {
872
+ "onUpdate:modelValue": a[6] || (a[6] = (t) => e.form[e.item.key] = t)
873
+ }, e.getBind(e.item), E(e.getOn(e.item)), {
875
874
  disabled: e.getDisabled(e.item),
876
875
  style: { width: "100%" }
877
876
  }), {
878
- default: b(() => [
879
- e.getBind(e.item).type === "group" ? (s(!0), y(F, { key: 0 }, L(e.getBind(e.item).data || [], (t) => (s(), h(r(We), k({
877
+ default: p(() => [
878
+ e.getBind(e.item).type === "group" ? (g(!0), v(B, { key: 0 }, G(e.getBind(e.item).data || [], (t) => (g(), b(l(lt), x({
880
879
  key: t.value
881
- }, { ref_for: !0 }, t, V(t.on || {})), null, 16))), 128)) : (s(!0), y(F, { key: 1 }, L(e.getBind(e.item).data || [], (t) => (s(), h(r(Je), k({
880
+ }, { ref_for: !0 }, t, E(t.on || {})), null, 16))), 128)) : (g(!0), v(B, { key: 1 }, G(e.getBind(e.item).data || [], (t) => (g(), b(l(it), x({
882
881
  key: t.value
883
- }, { ref_for: !0 }, t, V(t.on || {})), null, 16))), 128))
882
+ }, { ref_for: !0 }, t, E(t.on || {})), null, 16))), 128))
884
883
  ]),
885
884
  _: 1
886
- }, 16, ["modelValue", "disabled"])) : e.item.type === "color" ? (s(), h(r(Qe), k({
885
+ }, 16, ["modelValue", "disabled"])) : e.item.type === "color" ? (g(), b(l(rt), x({
887
886
  key: 7,
888
887
  modelValue: e.form[e.item.key],
889
- "onUpdate:modelValue": l[7] || (l[7] = (t) => e.form[e.item.key] = t)
890
- }, e.getBind(e.item), V(e.getOn(e.item)), {
888
+ "onUpdate:modelValue": a[7] || (a[7] = (t) => e.form[e.item.key] = t)
889
+ }, e.getBind(e.item), E(e.getOn(e.item)), {
891
890
  disabled: e.getDisabled(e.item)
892
- }), null, 16, ["modelValue", "disabled"])) : e.item.type === "slider" ? (s(), h(r(qe), k({
891
+ }), null, 16, ["modelValue", "disabled"])) : e.item.type === "slider" ? (g(), b(l(st), x({
893
892
  key: 8,
894
893
  modelValue: e.form[e.item.key],
895
- "onUpdate:modelValue": l[8] || (l[8] = (t) => e.form[e.item.key] = t)
896
- }, e.getBind(e.item), V(e.getOn(e.item)), {
894
+ "onUpdate:modelValue": a[8] || (a[8] = (t) => e.form[e.item.key] = t)
895
+ }, e.getBind(e.item), E(e.getOn(e.item)), {
897
896
  disabled: e.getDisabled(e.item)
898
- }), null, 16, ["modelValue", "disabled"])) : e.item.type === "list" ? (s(), h(Ee, k({
897
+ }), null, 16, ["modelValue", "disabled"])) : e.item.type === "list" ? (g(), b(Ke, x({
899
898
  key: 9,
900
899
  row: e.form,
901
900
  field: e.item.key
902
- }, e.getBind(e.item), V(e.getOn(e.item)), {
901
+ }, e.getBind(e.item), E(e.getOn(e.item)), {
903
902
  disabled: e.getDisabled(e.item),
904
903
  style: { width: "100%" }
905
- }), null, 16, ["row", "field", "disabled"])) : e.item.type === "treeSelect" ? (s(), h(r(Xe), k({
904
+ }), null, 16, ["row", "field", "disabled"])) : e.item.type === "treeSelect" ? (g(), b(l(dt), x({
906
905
  key: 10,
907
906
  modelValue: e.form[e.item.key],
908
- "onUpdate:modelValue": l[9] || (l[9] = (t) => e.form[e.item.key] = t)
909
- }, e.getBind(e.item), V(e.getOn(e.item)), {
907
+ "onUpdate:modelValue": a[9] || (a[9] = (t) => e.form[e.item.key] = t)
908
+ }, e.getBind(e.item), E(e.getOn(e.item)), {
910
909
  disabled: e.getDisabled(e.item),
911
910
  style: { width: "100%" }
912
- }), null, 16, ["modelValue", "disabled"])) : e.item.type === "datetime" ? (s(), h(r(Se), k({
911
+ }), null, 16, ["modelValue", "disabled"])) : e.item.type === "datetime" ? (g(), b(l(Be), x({
913
912
  key: 11,
914
913
  modelValue: e.form[e.item.key],
915
- "onUpdate:modelValue": l[10] || (l[10] = (t) => e.form[e.item.key] = t)
916
- }, e.getBind(e.item), V(e.getOn(e.item)), {
914
+ "onUpdate:modelValue": a[10] || (a[10] = (t) => e.form[e.item.key] = t)
915
+ }, e.getBind(e.item), E(e.getOn(e.item)), {
917
916
  disabled: e.getDisabled(e.item)
918
- }), null, 16, ["modelValue", "disabled"])) : e.item.type && typeof e.item.type == "object" ? (s(), h(X(e.item.type), k({
917
+ }), null, 16, ["modelValue", "disabled"])) : e.item.type && typeof e.item.type == "object" ? (g(), b(ee(e.item.type), x({
919
918
  key: 12,
920
919
  modelValue: e.form[e.item.key],
921
- "onUpdate:modelValue": l[11] || (l[11] = (t) => e.form[e.item.key] = t)
922
- }, e.getBind(e.item), V(e.getOn(e.item)), {
920
+ "onUpdate:modelValue": a[11] || (a[11] = (t) => e.form[e.item.key] = t)
921
+ }, e.getBind(e.item), E(e.getOn(e.item)), {
923
922
  disabled: e.getDisabled(e.item)
924
- }), null, 16, ["modelValue", "disabled"])) : e.item.type && (r(P).customComponent[e.item.type] || r(P).customComponent[e.item.type]?.form) ? (s(), h(X(r(P).customComponent[e.item.type]?.form || r(P).customComponent[e.item.type]), k({
923
+ }), null, 16, ["modelValue", "disabled"])) : e.item.type && (l(W).customComponent[e.item.type] || l(W).customComponent[e.item.type]?.form) ? (g(), b(ee(l(W).customComponent[e.item.type]?.form || l(W).customComponent[e.item.type]), x({
925
924
  key: 13,
926
925
  modelValue: e.form[e.item.key],
927
- "onUpdate:modelValue": l[12] || (l[12] = (t) => e.form[e.item.key] = t)
928
- }, e.getBind(e.item), V(e.getOn(e.item)), {
926
+ "onUpdate:modelValue": a[12] || (a[12] = (t) => e.form[e.item.key] = t)
927
+ }, e.getBind(e.item), E(e.getOn(e.item)), {
929
928
  disabled: e.getDisabled(e.item)
930
- }), null, 16, ["modelValue", "disabled"])) : v("", !0)
929
+ }), null, 16, ["modelValue", "disabled"])) : V("", !0)
931
930
  ]),
932
- x(a.$slots, "form-" + e.item.key + "-right", {
931
+ S(o.$slots, "form-" + e.item.key + "-right", {
933
932
  row: e.form,
934
933
  item: e.item
935
934
  })
936
935
  ]),
937
- x(a.$slots, "form-" + e.item.key + "-tip", {
936
+ S(o.$slots, "form-" + e.item.key + "-tip", {
938
937
  row: e.form,
939
938
  item: e.item
940
939
  }, () => [
941
- e.item.form?.tipText ? (s(), y("div", {
940
+ e.item.form?.tipText ? (g(), v("div", {
942
941
  key: 0,
943
942
  class: "form-tip-text",
944
943
  innerHTML: typeof e.item.form?.tipText == "function" ? e.item.form?.tipText(e.form, e.type) : e.item.form?.tipText
945
- }, null, 8, ft)) : v("", !0)
944
+ }, null, 8, Vt)) : V("", !0)
946
945
  ])
947
946
  ]),
948
- x(a.$slots, "form-" + e.item.key + "-end", {
947
+ S(o.$slots, "form-" + e.item.key + "-end", {
949
948
  row: e.form,
950
949
  item: e.item
951
950
  })
@@ -955,7 +954,7 @@ const lt = {
955
954
  }, 8, ["label", "prop", "label-width"]));
956
955
  }
957
956
  });
958
- const gt = {
957
+ const Et = {
959
958
  search: "搜索",
960
959
  add: "新增",
961
960
  edit: "编辑",
@@ -991,34 +990,34 @@ const gt = {
991
990
  mergeColumn: "合并栏位",
992
991
  expandColumn: "展开栏位"
993
992
  };
994
- class w {
993
+ class C {
995
994
  /** 解析国际化值:函数则执行并返回字符串,字符串则替换 `{key}` 占位符 */
996
- static t(a, ...l) {
997
- if (typeof a == "function")
998
- return a(...l);
999
- a = String(a);
995
+ static t(o, ...a) {
996
+ if (typeof o == "function")
997
+ return o(...a);
998
+ o = String(o);
1000
999
  let t = 0;
1001
- return a.replace(/{([^}]+)}/g, (i, n) => t < l.length ? String(l[t++]) : `{${n}}`);
1000
+ return o.replace(/{([^}]+)}/g, (r, n) => t < a.length ? String(a[t++]) : `{${n}}`);
1002
1001
  }
1003
- static setI18n = (a) => {
1004
- w.curd = ObjectUtil.deepMerge(w.curd, a);
1002
+ static setI18n = (o) => {
1003
+ C.curd = ObjectUtil.deepMerge(C.curd, o);
1005
1004
  };
1006
1005
  /** 解析curd国际化值 */
1007
- static tCurd(a, ...l) {
1008
- return this.t(this.curd[a], ...l);
1006
+ static tCurd(o, ...a) {
1007
+ return this.t(this.curd[o], ...a);
1009
1008
  }
1010
1009
  /** curd表单 */
1011
- static curd = gt;
1010
+ static curd = Et;
1012
1011
  }
1013
- class Q {
1012
+ class Y {
1014
1013
  /**
1015
1014
  * 删除对象所有属性
1016
1015
  * @param obj 对象
1017
1016
  * @returns
1018
1017
  */
1019
- static delAllKey = (a) => {
1020
- Object.keys(a).forEach((l) => {
1021
- delete a[l];
1018
+ static delAllKey = (o) => {
1019
+ Object.keys(o).forEach((a) => {
1020
+ delete o[a];
1022
1021
  });
1023
1022
  };
1024
1023
  /**
@@ -1028,35 +1027,54 @@ class Q {
1028
1027
  * @param delAll 是否删除目标对象所有属性
1029
1028
  * @returns
1030
1029
  */
1031
- static setValue = (a, l, t = !1) => {
1032
- t && Q.delAllKey(a), Object.keys(l).forEach((i) => {
1033
- a[i] !== l[i] && (a[i] = l[i]);
1030
+ static setValue = (o, a, t = !1) => {
1031
+ t && Y.delAllKey(o), Object.keys(a).forEach((r) => {
1032
+ o[r] !== a[r] && (o[r] = a[r]);
1034
1033
  });
1035
1034
  };
1036
1035
  }
1037
- const fe = (e) => {
1038
- const a = ge({}), l = () => typeof e == "function" ? e() : e, t = () => {
1039
- const i = l();
1040
- return i ?? a;
1036
+ const we = (e) => {
1037
+ const o = ie({}), a = () => typeof e == "function" ? e() : e, t = () => {
1038
+ const r = a();
1039
+ return r ?? o;
1041
1040
  };
1042
1041
  return {
1043
- internal: a,
1044
- isExternal: () => l() != null,
1042
+ internal: o,
1043
+ isExternal: () => a() != null,
1045
1044
  get() {
1046
1045
  return t();
1047
1046
  },
1048
- set(i) {
1049
- Q.setValue(t(), i, !0);
1047
+ set(r) {
1048
+ Y.setValue(t(), r, !0);
1050
1049
  },
1051
- merge(i) {
1052
- Q.setValue(t(), i, !1);
1050
+ merge(r) {
1051
+ Y.setValue(t(), r, !1);
1053
1052
  },
1054
1053
  clear() {
1055
- Q.delAllKey(t());
1054
+ Y.delAllKey(t());
1056
1055
  }
1057
1056
  };
1058
- }, de = z.EDialog, te = (e) => typeof e.type == "object" ? "component" : e.type || "input", ht = (e, a, l) => {
1059
- const t = fe(() => a.form);
1057
+ }, fe = (e) => {
1058
+ e.forEach((o) => {
1059
+ console.log({
1060
+ field: o.field || "",
1061
+ error: o.error || ""
1062
+ });
1063
+ });
1064
+ }, $t = (e) => e ? typeof e == "string" ? e : e instanceof Error ? e.message : e.message || String(e) : "", ke = (e) => !e || typeof e != "object" ? [] : Object.keys(e).flatMap((o) => (Array.isArray(e[o]) ? e[o] : [e[o]]).map((t) => ({
1065
+ field: t?.field || o,
1066
+ error: $t(t)
1067
+ }))), ge = $.EDialog, me = (e) => typeof e.type == "object" ? "component" : e.type || "input", zt = (e, o, a) => {
1068
+ const t = we(() => o.form), r = (s) => De(s.update.formGrid || [], s.update.form, s.update.type, s.update.formMaxSpan).map((c) => c.item.key).filter(Boolean), n = async (s) => {
1069
+ const d = a.ruleFormRef.value;
1070
+ if (!d) return !0;
1071
+ const c = r(s), u = Object.keys(s.update.rules || {}).filter((h) => !c.includes(h));
1072
+ if (u.length && d.clearValidate(u), !c.length) return !0;
1073
+ if (!await d.validateField(c, async (h, f) => {
1074
+ h || fe(ke(f));
1075
+ })) throw !1;
1076
+ return !0;
1077
+ };
1060
1078
  return {
1061
1079
  update: {
1062
1080
  title: "",
@@ -1064,37 +1082,37 @@ const fe = (e) => {
1064
1082
  show: !1,
1065
1083
  showContent: !1,
1066
1084
  loading: !1,
1067
- type: de.Update,
1085
+ type: ge.Update,
1068
1086
  get form() {
1069
1087
  return t.get();
1070
1088
  },
1071
- set form(i) {
1072
- t.set(i);
1089
+ set form(s) {
1090
+ t.set(s);
1073
1091
  },
1074
1092
  formDefault: {},
1075
1093
  formColumn: [],
1076
1094
  formGrid: [],
1077
1095
  formMaxSpan: 12,
1078
- getDisabled: (i, n = !1) => {
1079
- const o = e();
1080
- return a.option.table?.editMode && n ? i.disabled?.table === void 0 ? !1 : z.isFun(i.disabled?.table, o.update.form) : De(i, o.update.type, o.update.form);
1096
+ getDisabled: (s, d = !1) => {
1097
+ const c = e();
1098
+ return o.option.table?.editMode && d ? s.disabled?.table === void 0 ? !1 : $.isFun(s.disabled?.table, c.update.form) : Ie(s, c.update.type, c.update.form);
1081
1099
  },
1082
- getBind: (i) => {
1083
- const n = e();
1084
- return Oe(i, n.update.type);
1100
+ getBind: (s) => {
1101
+ const d = e();
1102
+ return Ne(s, d.update.type);
1085
1103
  },
1086
- getOn: (i, n) => {
1087
- const o = e();
1088
- return Me(i, o.update.type, [n || o.update.form, i]);
1104
+ getOn: (s, d) => {
1105
+ const c = e();
1106
+ return Ge(s, c.update.type, [d || c.update.form, s]);
1089
1107
  },
1090
- getOptions: (i) => {
1091
- const n = e();
1108
+ getOptions: (s) => {
1109
+ const d = e();
1092
1110
  try {
1093
- const d = Be(n.update.formGrid?.length ? n.update.formGrid : n.update.formColumn).find((c) => c.item.key === i)?.item;
1094
- return d ? {
1095
- options: d.options,
1111
+ const u = qe(d.update.formGrid?.length ? d.update.formGrid : d.update.formColumn).find((i) => i.item.key === s)?.item;
1112
+ return u ? {
1113
+ options: u.options,
1096
1114
  //@ts-ignore
1097
- bind: n.update.getBind(d)
1115
+ bind: d.update.getBind(u)
1098
1116
  } : { options: {}, bind: {} };
1099
1117
  } catch {
1100
1118
  return { options: {}, bind: {} };
@@ -1102,258 +1120,291 @@ const fe = (e) => {
1102
1120
  },
1103
1121
  edit: {
1104
1122
  data: {},
1105
- getApiData: (i) => {
1106
- const n = e();
1107
- if (a.option.form?.editAll) return i;
1108
- const o = {
1109
- [a.option.table?.rowKey]: n.update.edit.data[a.option.table?.rowKey]
1123
+ getApiData: (s) => {
1124
+ const d = e();
1125
+ if (o.option.form?.editAll) return s;
1126
+ const c = {
1127
+ [o.option.table?.rowKey]: d.update.edit.data[o.option.table?.rowKey]
1110
1128
  };
1111
- return Object.keys(n.update.edit.data).forEach((d) => {
1112
- i[d] !== n.update.edit.data[d] && (o[d] = i[d]);
1113
- }), o;
1129
+ return Object.keys(d.update.edit.data).forEach((u) => {
1130
+ s[u] !== d.update.edit.data[u] && (c[u] = s[u]);
1131
+ }), c;
1114
1132
  }
1115
1133
  },
1116
1134
  view: {},
1117
1135
  openLoading: !1,
1118
- open: async (i, n) => {
1119
- const o = e();
1120
- if (!(o.update.showContent || o.update.openLoading)) {
1121
- z.loading(!0), o.update.openLoading = !0;
1136
+ open: async (s, d) => {
1137
+ const c = e();
1138
+ if (!(c.update.showContent || c.update.openLoading)) {
1139
+ $.loading(!0), c.update.openLoading = !0;
1122
1140
  try {
1123
- o.update.type = i;
1124
- const d = i === de.Add;
1125
- o.update.edit.data = d ? void 0 : JSONUtil.cp(n), o.update.title = w.tCurd(d ? "add" : i === de.View ? "view" : "edit");
1126
- const c = d ? ObjectUtil.deepMerge(JSONUtil.cp(o.update.formDefault), n ? JSONUtil.cp(n) : {}) : JSONUtil.cp(n);
1127
- Q.setValue(o.update.form, c, !0), await o.initApiData("update"), await a.option.form?.openBefore?.(o.update.form, o.update), (!a.option.table?.inlineEdit || d) && (o.update.show = !0, o.update.showContent = !0), a.option.form?.openAfter?.(o.update.form, o.update);
1128
- } catch (d) {
1129
- console.error(d);
1141
+ c.update.type = s;
1142
+ const u = s === ge.Add;
1143
+ c.update.edit.data = u ? void 0 : JSONUtil.cp(d), c.update.title = C.tCurd(u ? "add" : s === ge.View ? "view" : "edit");
1144
+ const i = u ? ObjectUtil.deepMerge(JSONUtil.cp(c.update.formDefault), d ? JSONUtil.cp(d) : {}) : JSONUtil.cp(d);
1145
+ Y.setValue(c.update.form, i, !0), await c.initApiData("update"), await o.option.form?.openBefore?.(c.update.form, c.update), (!o.option.table?.inlineEdit || u) && (c.update.show = !0, c.update.showContent = !0), o.option.form?.openAfter?.(c.update.form, c.update);
1146
+ } catch (u) {
1147
+ console.error(u);
1130
1148
  } finally {
1131
- z.loading(!1), o.update.openLoading = !1;
1149
+ $.loading(!1), c.update.openLoading = !1;
1132
1150
  }
1133
1151
  }
1134
1152
  },
1135
- validate: async () => {
1136
- const i = e();
1153
+ validate: async (s = !0) => {
1154
+ const d = e();
1137
1155
  try {
1156
+ const c = o.option.table?.editMode ? d.tableEditValidate.validate() : n(d);
1138
1157
  return await Promise.all([
1139
- l.ruleFormRef.value?.validate(async (n) => new Promise((o, d) => {
1140
- n || d(!1), o(void 0);
1141
- })),
1142
- i.formRef.validate()
1158
+ c,
1159
+ d.formRef.validate()
1143
1160
  ]), !0;
1144
1161
  } catch {
1145
- z.fail(w.tCurd("checkFormData"));
1162
+ return s && $.fail(C.tCurd("checkFormData")), !1;
1146
1163
  }
1147
1164
  },
1148
1165
  submit: async () => {
1149
- const i = e();
1150
- if (!await i.update.validate() || i.update.loading) return;
1151
- i.update.loading = !0;
1152
- const o = i.update.type === de.Add ? a.option.api.create : a.option.api.update;
1166
+ const s = e();
1167
+ if (!await s.update.validate() || s.update.loading) return;
1168
+ s.update.loading = !0;
1169
+ const c = s.update.type === ge.Add ? o.option.api.create : o.option.api.update;
1153
1170
  try {
1154
- await a.option.form?.submitBefore?.(i.update.form, i.update);
1171
+ await o.option.form?.submitBefore?.(s.update.form, s.update);
1155
1172
  } catch {
1156
- i.update.loading = !1;
1173
+ s.update.loading = !1;
1157
1174
  return;
1158
1175
  }
1159
- let d = ObjectUtil.deepMerge(i.update.form, {});
1160
- delete d.children;
1161
- const c = new Set(a.option.column.filter((u) => u.type === "datetime").map((u) => u.key));
1162
- Object.keys(d).forEach((u) => {
1163
- if (c.has(u) && d[u] != null) {
1164
- const m = new Date(d[u]).getTime();
1165
- isNaN(m) || (d[u] = m);
1176
+ let u = ObjectUtil.deepMerge(s.update.form, {});
1177
+ delete u.children;
1178
+ const i = new Set(o.option.column.filter((h) => h.type === "datetime").map((h) => h.key));
1179
+ Object.keys(u).forEach((h) => {
1180
+ if (i.has(h) && u[h] != null) {
1181
+ const f = new Date(u[h]).getTime();
1182
+ isNaN(f) || (u[h] = f);
1166
1183
  }
1167
1184
  });
1168
1185
  try {
1169
- if (!o) return;
1170
- await o({ ...d }), i.update.close(), await i.table.getList(), a.option.form?.submitAfter?.(d, i.update);
1171
- } catch (u) {
1172
- console.error(u);
1186
+ if (!c) return;
1187
+ await c({ ...u }), s.update.close(), await s.table.getList(), o.option.form?.submitAfter?.(u, s.update);
1188
+ } catch (h) {
1189
+ console.error(h);
1173
1190
  } finally {
1174
- i.update.loading = !1;
1191
+ s.update.loading = !1;
1175
1192
  }
1176
1193
  },
1177
1194
  close: () => {
1178
- const i = e();
1179
- i.update.show = !1, i.update.edit.data = void 0, setTimeout(() => {
1180
- i.update.showContent = !1, l.ruleFormRef.value?.resetFields?.(), t.clear();
1195
+ const s = e();
1196
+ s.update.show = !1, s.update.edit.data = void 0, setTimeout(() => {
1197
+ s.update.showContent = !1, a.ruleFormRef.value?.resetFields?.(), t.clear();
1181
1198
  }, 350);
1182
1199
  }
1183
1200
  }
1184
1201
  };
1185
- }, K = 12, me = (e, a) => {
1186
- e.isForm = a, Array.isArray(e.children) && e.children.forEach((l) => me(l, a));
1187
- }, bt = (e) => e.isForm === !1 ? !1 : typeof e.show?.form == "boolean" ? e.show.form : !0, yt = (e, a, l) => (e.form = e.form || { span: a }, l === "column" ? e.form.span = e.form.span ?? 12 : e.form.span = e.form.span ?? a, e.form.span), ve = (e) => {
1188
- const a = e.form;
1189
- return a?.row != null && a.row > 0 ? a.row : K;
1190
- }, ie = (e) => Math.floor((e.gridRow - 1) / K), De = (e, a, l) => {
1191
- if (a === z.EDialog.View)
1192
- return e.disabled?.view === void 0 ? !0 : z.isFun(e.disabled?.view, l);
1193
- const t = e.disabled?.[a === z.EDialog.Add ? "create" : "update"];
1194
- return z.isFun(t, l);
1195
- }, Oe = (e, a) => {
1196
- const l = te(e);
1197
- return e.options?.[a === z.EDialog.Add ? "formAdd" : "formUpdate"]?.[l] || e.options?.[l] || {};
1198
- }, Me = (e, a, l = []) => {
1199
- const t = te(e), n = e.options?.[a === z.EDialog.Add ? "formAdd" : "formUpdate"]?.[t]?.on || e.options?.[t]?.on || {}, o = {};
1202
+ }, H = 12, ve = (e, o) => {
1203
+ e.isForm = o, Array.isArray(e.children) && e.children.forEach((a) => ve(a, o));
1204
+ }, Mt = (e) => e.isForm === !1 ? !1 : typeof e.show?.form == "boolean" ? e.show.form : !0, Ft = (e, o, a) => (e.form = e.form || { span: o }, a === "column" ? e.form.span = e.form.span ?? 12 : e.form.span = e.form.span ?? o, e.form.span), Pe = (e) => {
1205
+ const o = e.form;
1206
+ return o?.row != null && o.row > 0 ? o.row : H;
1207
+ }, le = (e) => Math.floor((e.gridRow - 1) / H), Ie = (e, o, a) => {
1208
+ if (o === $.EDialog.View)
1209
+ return e.disabled?.view === void 0 ? !0 : $.isFun(e.disabled?.view, a);
1210
+ const t = e.disabled?.[o === $.EDialog.Add ? "create" : "update"];
1211
+ return $.isFun(t, a);
1212
+ }, Ne = (e, o) => {
1213
+ const a = me(e);
1214
+ return e.options?.[o === $.EDialog.Add ? "formAdd" : "formUpdate"]?.[a] || e.options?.[a] || {};
1215
+ }, Ge = (e, o, a = []) => {
1216
+ const t = me(e), n = e.options?.[o === $.EDialog.Add ? "formAdd" : "formUpdate"]?.[t]?.on || e.options?.[t]?.on || {}, s = {};
1200
1217
  return Object.keys(n).forEach((d) => {
1201
1218
  const c = n[d];
1202
- typeof c == "function" ? o[d] = function(...u) {
1203
- return c.apply(this, [...u, ...l]);
1204
- } : o[d] = c;
1205
- }), o;
1206
- }, Fe = (e, a, l, t, i) => {
1207
- const n = e, o = n.colSpan ?? e.span;
1219
+ typeof c == "function" ? s[d] = function(...u) {
1220
+ return c.apply(this, [...u, ...a]);
1221
+ } : s[d] = c;
1222
+ }), s;
1223
+ }, He = (e, o, a, t, r) => {
1224
+ const n = e, s = n.colSpan ?? e.span;
1208
1225
  if (!e.item.form?.spanCol)
1209
- return o;
1210
- const d = i?.maxSpan || 12, c = i?.defaultSpan || d / 2, u = n.gridBand, p = a.filter((f) => u != null ? f.gridBand === u && !z.isFun(f.item.show?.form, l, t) : f.gridRow === n.gridRow && !z.isFun(f.item.show?.form, l, t)).reduce((f, g) => f + (g.colSpan ?? g.span ?? c), 0);
1211
- return o + p;
1212
- }, Ue = (e) => {
1213
- const a = /* @__PURE__ */ new Map();
1214
- return e.forEach((l) => {
1215
- const t = l.gridBand ?? ie(l);
1216
- a.has(t) || a.set(t, []), a.get(t).push(l);
1217
- }), Array.from(a.keys()).sort((l, t) => l - t).map((l) => a.get(l));
1218
- }, Be = (e) => e?.length ? Array.isArray(e[0]) ? e.flat() : e : [], pt = (e, a) => {
1219
- if (!bt(e) || !e.key) return null;
1220
- const l = a.defaultSpan ?? (a.maxSpan || 12) / 2, t = yt(e, l, a.layout);
1221
- return { item: e, span: t };
1222
- }, wt = (e, a = {}) => {
1223
- const l = [], t = (i) => {
1224
- if (i.children?.length) {
1225
- i.children.forEach((o) => t(o));
1226
- return;
1227
- }
1228
- const n = pt(i, a);
1229
- n && l.push(n);
1226
+ return s;
1227
+ const d = r?.maxSpan || 12, c = r?.defaultSpan || d / 2, u = n.gridBand, h = o.filter((f) => u != null ? f.gridBand === u && !$.isFun(f.item.show?.form, a, t) : f.gridRow === n.gridRow && !$.isFun(f.item.show?.form, a, t)).reduce((f, m) => f + (m.colSpan ?? m.span ?? c), 0);
1228
+ return s + h;
1229
+ }, Dt = (e, o) => {
1230
+ const a = (t, r) => {
1231
+ const n = t.gridRow, s = t.gridRow + t.rowSpan - 1, d = r.gridRow, c = r.gridRow + r.rowSpan - 1;
1232
+ return n <= c && d <= s;
1230
1233
  };
1231
- return e.forEach((i) => t(i)), l;
1232
- }, Ae = (e, a = {}) => {
1233
- const l = a.maxSpan ?? 12, t = a.defaultSpan ?? l / 2, i = a.layout ?? "row", o = wt(e, { maxSpan: l, defaultSpan: t, layout: i });
1234
- if (i === "column") {
1235
- const S = [];
1236
- let E = 1;
1237
- return o.forEach((B) => {
1238
- const j = ve(B.item), A = l;
1239
- S.push({
1240
- ...B,
1241
- span: A,
1242
- colSpan: A,
1243
- rowSpan: j,
1244
- gridRow: E,
1245
- gridColumn: 1,
1246
- gridBand: ie({ gridRow: E })
1247
- }), E += j;
1248
- }), { cells: S, maxSpan: l };
1249
- }
1250
- const d = /* @__PURE__ */ new Set(), c = [];
1251
- let u = 0, m = 0;
1252
- const p = (S) => Math.floor(S / K) * K, f = (S, E) => `${S},${E}`, g = (S, E, B, j) => {
1253
- if (E + B > l) return !1;
1254
- for (let A = 0; A < j; A++)
1255
- for (let R = 0; R < B; R++)
1256
- if (d.has(f(S + A, E + R))) return !1;
1234
+ return e.map((t) => e.filter((n) => a(t, n)).length !== 1 || t.colSpan >= o ? t : {
1235
+ ...t,
1236
+ span: o,
1237
+ colSpan: o,
1238
+ gridColumn: 1
1239
+ });
1240
+ }, We = (e, o, a = {}) => {
1241
+ const t = /* @__PURE__ */ new Set(), r = [];
1242
+ let n = 0, s = 0;
1243
+ const d = (m) => Math.floor(m / H) * H, c = (m, w) => `${m},${w}`, u = (m, w, D, L) => {
1244
+ if (w + D > o) return !1;
1245
+ for (let O = 0; O < L; O++)
1246
+ for (let A = 0; A < D; A++)
1247
+ if (t.has(c(m + O, w + A))) return !1;
1257
1248
  return !0;
1258
- }, C = (S, E, B, j) => {
1259
- for (let A = 0; A < j; A++)
1260
- for (let R = 0; R < B; R++)
1261
- d.add(f(S + A, E + R));
1262
- }, H = (S, E, B, j) => {
1263
- for (let R = p(S); R < 500 * K; R += K) {
1264
- const je = R + K, Pe = R === p(S) ? Math.max(R, S) : R;
1265
- for (let ae = Pe; ae < je; ae++) {
1266
- const Ie = ae === S ? E : 0;
1267
- for (let re = Ie; re <= l - B; re++)
1268
- if (g(ae, re, B, j))
1269
- return { tr: ae, tc: re };
1249
+ }, i = (m, w, D, L) => {
1250
+ for (let O = 0; O < L; O++)
1251
+ for (let A = 0; A < D; A++)
1252
+ t.add(c(m + O, w + A));
1253
+ }, h = (m, w, D, L) => {
1254
+ for (let A = d(m); A < 500 * H; A += H) {
1255
+ const se = A + H, Ce = A === d(m) ? Math.max(A, m) : A;
1256
+ for (let Z = Ce; Z < se; Z++) {
1257
+ const xe = Z === m ? w : 0;
1258
+ for (let te = xe; te <= o - D; te++)
1259
+ if (u(Z, te, D, L)) return { tr: Z, tc: te };
1270
1260
  }
1271
1261
  }
1272
- return { tr: S, tc: E };
1273
- }, N = (S, E, B, j) => {
1274
- const A = p(S);
1275
- if (j < K && S + j < A + K) {
1276
- u = S + j, m = E;
1262
+ return { tr: m, tc: w };
1263
+ }, f = (m, w, D, L) => {
1264
+ const O = d(m);
1265
+ if (L < H && m + L < O + H) {
1266
+ n = m + L, s = w;
1267
+ return;
1268
+ }
1269
+ const A = w + D;
1270
+ if (A < o) {
1271
+ s = A, n = O;
1277
1272
  return;
1278
1273
  }
1279
- const R = E + B;
1280
- if (R < l) {
1281
- m = R, u = A;
1274
+ s = 0, n = O + H;
1275
+ };
1276
+ return e.forEach((m) => {
1277
+ const w = m.colSpan ?? (m.span === 0 ? o : m.span), D = m.rowSpan ?? Pe(m.item);
1278
+ m.item.form?.rowBreak && r.length && (s = 0, n = d(n) + H);
1279
+ let { tr: L, tc: O } = u(n, s, w, D) ? { tr: n, tc: s } : h(n, s, w, D);
1280
+ u(L, O, w, D) || ({ tr: L, tc: O } = h(0, 0, w, D)), i(L, O, w, D);
1281
+ const A = L + 1;
1282
+ r.push({
1283
+ ...m,
1284
+ span: w,
1285
+ colSpan: w,
1286
+ rowSpan: D,
1287
+ gridRow: A,
1288
+ gridColumn: O + 1,
1289
+ gridBand: le({ gridRow: A })
1290
+ }), f(L, O, w, D);
1291
+ }), a.fillSingleRows ? Dt(r, o) : r;
1292
+ }, De = (e, o, a, t = H) => {
1293
+ const r = e.filter((d) => $.isFun(d.item.show?.form, o, a)), n = /* @__PURE__ */ new Map();
1294
+ e.forEach((d) => {
1295
+ const u = `${d.gridBand ?? le(d)}:${d.gridColumn}:${d.colSpan}`;
1296
+ n.has(u) || n.set(u, []), n.get(u).push(d);
1297
+ });
1298
+ const s = /* @__PURE__ */ new Map();
1299
+ return n.forEach((d) => {
1300
+ const c = d.reduce((f, m) => f + m.rowSpan, 0);
1301
+ if (!(d.length > 1 && c === H && d.every((f) => f.rowSpan < H))) return;
1302
+ const i = d.filter((f) => $.isFun(f.item.show?.form, o, a));
1303
+ if (i.length !== 1) return;
1304
+ const h = i[0];
1305
+ s.set(h.item.key, {
1306
+ ...h,
1307
+ rowSpan: H
1308
+ });
1309
+ }), We(r.map((d) => s.get(d.item.key) || d), t, {
1310
+ fillSingleRows: !0
1311
+ });
1312
+ }, Je = (e) => {
1313
+ const o = /* @__PURE__ */ new Map();
1314
+ return e.forEach((a) => {
1315
+ const t = a.gridBand ?? le(a);
1316
+ o.has(t) || o.set(t, []), o.get(t).push(a);
1317
+ }), Array.from(o.keys()).sort((a, t) => a - t).map((a) => o.get(a));
1318
+ }, qe = (e) => e?.length ? Array.isArray(e[0]) ? e.flat() : e : [], Ot = (e, o) => {
1319
+ if (!Mt(e) || !e.key) return null;
1320
+ const a = o.defaultSpan ?? (o.maxSpan || 12) / 2, t = Ft(e, a, o.layout);
1321
+ return { item: e, span: t };
1322
+ }, Rt = (e, o = {}) => {
1323
+ const a = [], t = (r) => {
1324
+ if (r.children?.length) {
1325
+ r.children.forEach((s) => t(s));
1282
1326
  return;
1283
1327
  }
1284
- m = 0, u = A + K;
1328
+ const n = Ot(r, o);
1329
+ n && a.push(n);
1285
1330
  };
1286
- for (const S of o) {
1287
- const E = S.span === 0 ? l : S.span, B = ve(S.item);
1288
- S.item.form?.rowBreak && c.length && (m = 0, u = p(u) + K);
1289
- let { tr: j, tc: A } = g(u, m, E, B) ? { tr: u, tc: m } : H(u, m, E, B);
1290
- g(j, A, E, B) || ({ tr: j, tc: A } = H(0, 0, E, B)), C(j, A, E, B);
1291
- const R = j + 1;
1292
- c.push({
1293
- ...S,
1294
- span: E,
1295
- colSpan: E,
1296
- rowSpan: B,
1297
- gridRow: R,
1298
- gridColumn: A + 1,
1299
- gridBand: ie({ gridRow: R })
1300
- }), N(j, A, E, B);
1331
+ return e.forEach((r) => t(r)), a;
1332
+ }, Qe = (e, o = {}) => {
1333
+ const a = o.maxSpan ?? 12, t = o.defaultSpan ?? a / 2, r = o.layout ?? "row", s = Rt(e, { maxSpan: a, defaultSpan: t, layout: r });
1334
+ if (r === "column") {
1335
+ const d = [];
1336
+ let c = 1;
1337
+ return s.forEach((u) => {
1338
+ const i = Pe(u.item), h = a;
1339
+ d.push({
1340
+ ...u,
1341
+ span: h,
1342
+ colSpan: h,
1343
+ rowSpan: i,
1344
+ gridRow: c,
1345
+ gridColumn: 1,
1346
+ gridBand: le({ gridRow: c })
1347
+ }), c += i;
1348
+ }), { cells: d, maxSpan: a };
1301
1349
  }
1302
- return { cells: c, maxSpan: l };
1303
- }, kt = (e) => e.map((a) => a.item?.show?.form), vt = (e, a, l) => {
1350
+ return { cells: We(s, a), maxSpan: a };
1351
+ }, Ut = (e) => e.map((o) => o.item?.show?.form), At = (e, o, a) => {
1304
1352
  if (!e.rules) return;
1305
1353
  const t = typeof e.rules == "boolean" ? [
1306
1354
  {
1307
1355
  required: !0,
1308
- message: a(e),
1356
+ message: o(e),
1309
1357
  trigger: "blur"
1310
1358
  }
1311
1359
  ] : e.rules;
1312
- return l ? t.map((i) => l(i)) : t;
1313
- }, Re = (e) => (a, l) => vt(a, e, (t) => {
1360
+ return a ? t.map((r) => a(r)) : t;
1361
+ }, Xe = (e) => (o, a) => At(o, e, (t) => {
1314
1362
  if (t.validator) {
1315
- const i = t.validator;
1363
+ const r = t.validator;
1316
1364
  return {
1317
1365
  ...t,
1318
- validator: (n, o, d) => i(n, o, d, l)
1366
+ validator: (n, s, d) => {
1367
+ const c = a && Object.prototype.hasOwnProperty.call(a, o.key) ? a[o.key] : s;
1368
+ return r(n, c, d, a);
1369
+ }
1319
1370
  };
1320
1371
  }
1321
1372
  return t;
1322
- }), Ct = (e) => Re((a) => {
1323
- const l = {
1324
- input: w.tCurd("placeholderInput"),
1325
- select: w.tCurd("placeholderSelect")
1326
- }, t = (l[te(a) || "input"] || l.input) + a.label;
1327
- return (e?.error || P.error.callback)?.(a.key, a) || t;
1328
- }), xt = (e, a, l) => {
1329
- const t = {}, i = {}, n = a?.maxSpan || 12, o = a?.defaultSpan || n / 2, d = Ct(a);
1330
- e.forEach((m) => me(m, !0)), Te(e, t, i, (m) => d(m, l));
1331
- const { cells: c, maxSpan: u } = Ae(e, {
1373
+ }), Ye = (e, o) => {
1374
+ const a = {
1375
+ input: C.tCurd("placeholderInput"),
1376
+ select: C.tCurd("placeholderSelect")
1377
+ }, t = (a[me(e) || "input"] || a.input) + e.label;
1378
+ return (o || W.error.callback)?.(e.key, e) || t;
1379
+ }, Ze = (e) => Xe((o) => Ye(o, e?.error)), Bt = (e, o, a) => {
1380
+ const t = {}, r = {}, n = o?.maxSpan || 12, s = o?.defaultSpan || n / 2, d = Ze(o);
1381
+ e.forEach((i) => ve(i, !0)), Fe(e, t, r, (i) => d(i, a));
1382
+ const { cells: c, maxSpan: u } = Qe(e, {
1332
1383
  maxSpan: n,
1333
- defaultSpan: o,
1334
- layout: a?.layout
1384
+ defaultSpan: s,
1385
+ layout: o?.layout
1335
1386
  });
1336
1387
  return {
1337
1388
  formDefault: t,
1338
- rules: i,
1389
+ rules: r,
1339
1390
  formGrid: c,
1340
1391
  formMaxSpan: u,
1341
- formColumn: Ue(c)
1392
+ formColumn: Je(c)
1342
1393
  };
1343
- }, Te = (e, a, l, t) => {
1344
- const i = (n) => {
1394
+ }, Fe = (e, o, a, t) => {
1395
+ const r = (n) => {
1345
1396
  if (n.children?.length) {
1346
- n.children.forEach((o) => i(o));
1397
+ n.children.forEach((s) => r(s));
1347
1398
  return;
1348
1399
  }
1349
1400
  if (n.key) {
1350
- a[n.key] = n.value;
1351
- const o = t(n);
1352
- o && (l[n.key] = o);
1401
+ o[n.key] = n.value;
1402
+ const s = t(n);
1403
+ s && (a[n.key] = s);
1353
1404
  }
1354
1405
  };
1355
- e.forEach(i);
1356
- }, Vt = { class: "curd-form-cell-inner" }, Le = /* @__PURE__ */ G({
1406
+ e.forEach(r);
1407
+ }, Lt = { class: "curd-form-cell-inner" }, _e = /* @__PURE__ */ q({
1357
1408
  __name: "layout",
1358
1409
  props: {
1359
1410
  formGrid: {},
@@ -1368,79 +1419,77 @@ const fe = (e) => {
1368
1419
  getDisabled: { type: Function }
1369
1420
  },
1370
1421
  setup(e) {
1371
- const a = z.isFun, l = e, t = Z(
1372
- () => l.formGrid.filter((f) => a(f.item.show?.form, l.form, l.type))
1373
- ), i = Z(() => {
1422
+ const o = $.isFun, a = e, t = ae(() => De(a.formGrid, a.form, a.type, a.maxSpan)), r = ae(() => {
1374
1423
  const f = Array.from(
1375
1424
  new Set(
1376
- t.value.map((g) => g.gridBand ?? ie(g))
1425
+ t.value.map((m) => m.gridBand ?? le(m))
1377
1426
  )
1378
- ).sort((g, C) => g - C);
1379
- return new Map(f.map((g, C) => [g, C]));
1380
- }), n = Z(() => ({
1381
- gridTemplateColumns: `repeat(${l.maxSpan}, minmax(0, 1fr))`
1382
- })), o = Z(() => {
1427
+ ).sort((m, w) => m - w);
1428
+ return new Map(f.map((m, w) => [m, w]));
1429
+ }), n = ae(() => ({
1430
+ gridTemplateColumns: `repeat(${a.maxSpan}, minmax(0, 1fr))`
1431
+ })), s = ae(() => {
1383
1432
  let f = 0;
1384
- return t.value.forEach((g) => {
1385
- const C = g.gridRow + g.rowSpan - 1;
1386
- C > f && (f = C);
1433
+ return t.value.forEach((m) => {
1434
+ const w = m.gridRow + m.rowSpan - 1;
1435
+ w > f && (f = w);
1387
1436
  }), f;
1388
- }), d = (f) => f.gridRow + f.rowSpan - 1 >= o.value, c = (f) => f.rowSpan >= K, u = (f) => {
1389
- const g = f.gridBand ?? ie(f);
1390
- return i.value.get(g) ?? g;
1391
- }, m = (f) => Fe(f, l.formGrid, l.form, l.type, {
1392
- maxSpan: l.maxSpan,
1393
- defaultSpan: l.formOption?.defaultSpan
1394
- }), p = (f) => {
1395
- const g = m(f) || f.colSpan;
1437
+ }), d = (f) => f.gridRow + f.rowSpan - 1 >= s.value, c = (f) => f.rowSpan >= H, u = (f) => {
1438
+ const m = f.gridBand ?? le(f);
1439
+ return r.value.get(m) ?? m;
1440
+ }, i = (f) => He(f, t.value, a.form, a.type, {
1441
+ maxSpan: a.maxSpan,
1442
+ defaultSpan: a.formOption?.defaultSpan
1443
+ }), h = (f) => {
1444
+ const m = i(f) || f.colSpan;
1396
1445
  return {
1397
1446
  gridRow: `${f.gridRow} / span ${f.rowSpan}`,
1398
- gridColumn: `${f.gridColumn} / span ${g}`
1447
+ gridColumn: `${f.gridColumn} / span ${m}`
1399
1448
  };
1400
1449
  };
1401
- return (f, g) => r(a)(r(kt)(e.formGrid), e.form, e.type) ? (s(), y(F, { key: 0 }, [
1402
- x(f.$slots, "form-start", { row: e.form }),
1403
- M("div", {
1404
- class: I(["curd-form-grid", { stripe: e.stripe !== !1 }]),
1405
- style: ce(n.value)
1450
+ return (f, m) => l(o)(l(Ut)(e.formGrid), e.form, e.type) ? (g(), v(B, { key: 0 }, [
1451
+ S(f.$slots, "form-start", { row: e.form }),
1452
+ R("div", {
1453
+ class: J(["curd-form-grid", { stripe: e.stripe !== !1 }]),
1454
+ style: pe(n.value)
1406
1455
  }, [
1407
- (s(!0), y(F, null, L(t.value, (C) => (s(), y("div", {
1408
- key: C.item.key,
1409
- class: I(["curd-form-grid-cell", [
1410
- e.stripe !== !1 && u(C) % 2 === 0 ? "stripe-band-odd" : "",
1411
- C.gridColumn > 1 ? "has-col-border" : "",
1412
- e.stripe !== !1 && d(C) ? "is-last-row" : "",
1413
- c(C) ? "is-row-span" : "",
1414
- `form-item-col-${C.item.key}`
1456
+ (g(!0), v(B, null, G(t.value, (w) => (g(), v("div", {
1457
+ key: w.item.key,
1458
+ class: J(["curd-form-grid-cell", [
1459
+ e.stripe !== !1 && u(w) % 2 === 0 ? "stripe-band-odd" : "",
1460
+ w.gridColumn > 1 ? "has-col-border" : "",
1461
+ e.stripe !== !1 && d(w) ? "is-last-row" : "",
1462
+ c(w) ? "is-row-span" : "",
1463
+ `form-item-col-${w.item.key}`
1415
1464
  ]]),
1416
- style: ce(p(C))
1465
+ style: pe(h(w))
1417
1466
  }, [
1418
- M("div", Vt, [
1419
- r(a)(C.item.show?.form, e.form, e.type) ? (s(), h(mt, {
1467
+ R("div", Lt, [
1468
+ l(o)(w.item.show?.form, e.form, e.type) ? (g(), b(St, {
1420
1469
  key: 0,
1421
- class: I({ "is-row-span-field": c(C) }),
1422
- item: C.item,
1470
+ class: J({ "is-row-span-field": c(w) }),
1471
+ item: w.item,
1423
1472
  form: e.form,
1424
1473
  type: e.type,
1425
1474
  "label-width": e.labelWidth,
1426
1475
  "get-bind": e.getBind,
1427
1476
  "get-on": e.getOn,
1428
1477
  "get-disabled": e.getDisabled
1429
- }, J({ _: 2 }, [
1430
- L(f.$slots, (H, N) => ({
1431
- name: N,
1432
- fn: b((S) => [
1433
- x(f.$slots, N, k({ ref_for: !0 }, S || {}))
1478
+ }, X({ _: 2 }, [
1479
+ G(f.$slots, (D, L) => ({
1480
+ name: L,
1481
+ fn: p((O) => [
1482
+ S(f.$slots, L, x({ ref_for: !0 }, O || {}))
1434
1483
  ])
1435
1484
  }))
1436
- ]), 1032, ["class", "item", "form", "type", "label-width", "get-bind", "get-on", "get-disabled"])) : v("", !0)
1485
+ ]), 1032, ["class", "item", "form", "type", "label-width", "get-bind", "get-on", "get-disabled"])) : V("", !0)
1437
1486
  ])
1438
1487
  ], 6))), 128))
1439
1488
  ], 6),
1440
- x(f.$slots, "form-end", { row: e.form })
1441
- ], 64)) : v("", !0);
1489
+ S(f.$slots, "form-end", { row: e.form })
1490
+ ], 64)) : V("", !0);
1442
1491
  }
1443
- }), St = /* @__PURE__ */ G({
1492
+ }), Tt = /* @__PURE__ */ q({
1444
1493
  __name: "column",
1445
1494
  props: {
1446
1495
  option: {
@@ -1456,123 +1505,176 @@ const fe = (e) => {
1456
1505
  default: void 0
1457
1506
  }
1458
1507
  },
1459
- setup(e, { expose: a }) {
1460
- const l = z.EDialog, t = q(), i = e;
1461
- let n = fe(i.form);
1462
- const o = $e.getConf();
1463
- o?.formRef?.set("formRef-" + StrUtil.getId(), t);
1464
- const d = ge({
1508
+ setup(e, { expose: o }) {
1509
+ const a = $.EDialog, t = _(), r = e;
1510
+ let n = we(r.form);
1511
+ const s = Me.getConf("curdConf"), d = "formRef-" + StrUtil.getId();
1512
+ Te(() => {
1513
+ s?.formRef?.remove(d);
1514
+ });
1515
+ const c = ie({
1465
1516
  rules: {},
1466
1517
  show: !0,
1467
1518
  formDefault: {},
1468
- type: i.type || o?.update?.type || l.Add,
1519
+ type: r.type || s?.update?.type || a.Add,
1469
1520
  formColumn: [],
1470
1521
  formGrid: [],
1471
1522
  formMaxSpan: 12,
1472
1523
  get form() {
1473
1524
  return n.get();
1474
1525
  },
1475
- set form(c) {
1476
- n.set(c);
1526
+ set form(u) {
1527
+ n.set(u);
1477
1528
  },
1478
- getDisabled: (c) => De(c, d.type, d.form),
1479
- getBind: (c) => Oe(c, d.type),
1480
- getOn: (c) => Me(c, d.type, [d.form, c]),
1529
+ getDisabled: (u) => Ie(u, c.type, c.form),
1530
+ getBind: (u) => Ne(u, c.type),
1531
+ getOn: (u) => Ge(u, c.type, [c.form, u]),
1481
1532
  initColumnForm: () => {
1482
- const c = n, u = xt(i.option.column, i.option.form, c.get());
1483
- d.formDefault = u.formDefault, d.rules = u.rules, d.formGrid = u.formGrid, d.formMaxSpan = u.formMaxSpan, d.formColumn = u.formColumn, d.type === l.Add ? c.isExternal() ? c.merge(JSONUtil.cp(d.formDefault)) : c.set(JSONUtil.cp(d.formDefault)) : !c.isExternal() && i.form && c.set(JSONUtil.cp(i.form));
1533
+ const u = n, i = Bt(r.option.column, r.option.form, u.get());
1534
+ c.formDefault = i.formDefault, c.rules = i.rules, c.formGrid = i.formGrid, c.formMaxSpan = i.formMaxSpan, c.formColumn = i.formColumn, c.type === a.Add ? u.isExternal() ? u.merge(JSONUtil.cp(c.formDefault)) : u.set(JSONUtil.cp(c.formDefault)) : !u.isExternal() && r.form && u.set(JSONUtil.cp(r.form));
1484
1535
  }
1485
1536
  });
1486
- return i.option.form?.initStart?.(d), d.initColumnForm(), i.option.form?.initEnd?.(d), et(
1487
- () => i.form,
1488
- (c) => {
1489
- n = fe(c), d.initColumnForm();
1537
+ return s?.formRef?.set(d, {
1538
+ validate: async (u) => {
1539
+ const i = t.value;
1540
+ if (!i)
1541
+ return u?.(!0), !0;
1542
+ const h = De(c.formGrid || [], c.form, c.type, c.formMaxSpan).map((w) => w.item.key).filter(Boolean), f = Object.keys(c.rules || {}).filter((w) => !h.includes(w));
1543
+ if (f.length && i.clearValidate(f), !h.length)
1544
+ return u?.(!0), !0;
1545
+ const m = await i.validateField(h, async (w, D) => {
1546
+ w || fe(ke(D));
1547
+ });
1548
+ if (u?.(!!m), !m) throw !1;
1549
+ return !0;
1550
+ }
1551
+ }), r.option.form?.initStart?.(c), c.initColumnForm(), r.option.form?.initEnd?.(c), mt(
1552
+ () => r.form,
1553
+ (u) => {
1554
+ n = we(u), c.initColumnForm();
1490
1555
  }
1491
- ), a({ ref: t, conf: d }), (c, u) => (s(), h(r(Y), {
1556
+ ), o({ ref: t, conf: c }), (u, i) => (g(), b(l(oe), {
1492
1557
  ref_key: "ruleFormRef",
1493
1558
  ref: t,
1494
- model: d.form,
1495
- rules: d.rules
1559
+ model: c.form,
1560
+ rules: c.rules
1496
1561
  }, {
1497
- default: b(() => [
1498
- d.show ? (s(), h(Le, {
1562
+ default: p(() => [
1563
+ c.show ? (g(), b(_e, {
1499
1564
  key: 0,
1500
- "form-grid": d.formGrid,
1501
- "max-span": d.formMaxSpan,
1502
- form: d.form,
1503
- type: d.type,
1565
+ "form-grid": c.formGrid,
1566
+ "max-span": c.formMaxSpan,
1567
+ form: c.form,
1568
+ type: c.type,
1504
1569
  stripe: e.option.form?.stripe,
1505
1570
  "label-width": e.option.form?.labelWidth || "100px",
1506
1571
  "form-option": e.option.form,
1507
- "get-bind": d.getBind,
1508
- "get-on": d.getOn,
1509
- "get-disabled": d.getDisabled
1510
- }, J({ _: 2 }, [
1511
- L(c.$slots, (m, p) => ({
1512
- name: p,
1513
- fn: b((f) => [
1514
- x(c.$slots, p, pe(we(f || {})))
1572
+ "get-bind": c.getBind,
1573
+ "get-on": c.getOn,
1574
+ "get-disabled": c.getDisabled
1575
+ }, X({ _: 2 }, [
1576
+ G(u.$slots, (h, f) => ({
1577
+ name: f,
1578
+ fn: p((m) => [
1579
+ S(u.$slots, f, $e(ze(m || {})))
1515
1580
  ])
1516
1581
  }))
1517
- ]), 1032, ["form-grid", "max-span", "form", "type", "stripe", "label-width", "form-option", "get-bind", "get-on", "get-disabled"])) : v("", !0)
1582
+ ]), 1032, ["form-grid", "max-span", "form", "type", "stripe", "label-width", "form-option", "get-bind", "get-on", "get-disabled"])) : V("", !0)
1518
1583
  ]),
1519
1584
  _: 3
1520
1585
  }, 8, ["model", "rules"]));
1521
1586
  }
1522
- }), zt = () => ({
1523
- formRef: {
1524
- map: {},
1525
- set(e, a) {
1526
- this.map[e] = a;
1587
+ }), jt = (e) => e?.value || e, Kt = (e) => {
1588
+ const o = jt(e);
1589
+ return o?.validate ? new Promise((a, t) => {
1590
+ let r = !1;
1591
+ const n = (s, d) => {
1592
+ r || (r = !0, s === !1 ? (fe(ke(d)), t(!1)) : a(!0));
1593
+ };
1594
+ try {
1595
+ const s = o.validate(n);
1596
+ s && typeof s.then == "function" ? s.then((d) => n(d)).catch((d) => {
1597
+ fe(ke(d?.fields || d)), t(d);
1598
+ }) : (s !== void 0 || o.validate.length === 0) && n(s);
1599
+ } catch (s) {
1600
+ t(s);
1601
+ }
1602
+ }) : Promise.resolve(!0);
1603
+ }, Pt = () => {
1604
+ const e = ie({
1605
+ formRef: {
1606
+ map: {},
1607
+ set(o, a) {
1608
+ e.formRef.map[o] = a;
1609
+ },
1610
+ remove(o) {
1611
+ delete e.formRef.map[o];
1612
+ },
1613
+ validate() {
1614
+ const o = Object.keys(e.formRef.map).map((a) => e.formRef.map[a]);
1615
+ return Promise.all(o.map((a) => Kt(a))).then(() => !0);
1616
+ }
1527
1617
  },
1528
- validate() {
1529
- return new Promise(async (e, a) => {
1530
- try {
1531
- const l = Object.keys(this.map);
1532
- await Promise.all(
1533
- l.map(
1534
- (t) => this.map[t]?.validate(async (i) => new Promise((n, o) => {
1535
- i || o(!1), n(!0);
1536
- }))
1537
- )
1538
- ), e(!0);
1539
- } catch (l) {
1540
- a(l);
1618
+ /**
1619
+ * 注册表单引用,用于校验处理
1620
+ * @param formRef 表单引用
1621
+ * @param refKey 表单引用唯一键
1622
+ * @example
1623
+ * <el-form :ref="formRef => regFormRef(formRef, 'formRef-1')" />
1624
+ * 或者直接js模拟函数注册
1625
+ * regFormRef({ validate: (fun) => {
1626
+ * if(val){
1627
+ * fun(true)
1628
+ * } else {
1629
+ * fun(false)
1630
+ * }
1631
+ * } }, 'formRef-1')
1632
+ * @returns
1633
+ */
1634
+ regFormRef(o, a, t) {
1635
+ o ? t ? e.formRef.set(a, {
1636
+ validate: async (r) => {
1637
+ try {
1638
+ r(await t());
1639
+ } catch {
1640
+ r(!1);
1641
+ }
1541
1642
  }
1542
- });
1643
+ }) : e.formRef.set(a, o) : e.formRef.remove(a);
1543
1644
  }
1544
- }
1545
- }), $t = (e, a) => {
1546
- const l = fe(() => a.searchForm);
1645
+ });
1646
+ return e;
1647
+ }, It = (e, o) => {
1648
+ const a = we(() => o.searchForm);
1547
1649
  return {
1548
1650
  search: {
1549
1651
  column: {
1550
1652
  list: []
1551
1653
  },
1552
1654
  get form() {
1553
- return l.get();
1655
+ return a.get();
1554
1656
  },
1555
1657
  set form(t) {
1556
- l.set(t);
1658
+ a.set(t);
1557
1659
  },
1558
1660
  formDefault: {},
1559
- getPlaceholder: (t, i = w.tCurd("placeholderInput")) => t.text?.search?.placeholder === void 0 ? `${i}${t.label}` : t.text?.search?.placeholder,
1661
+ getPlaceholder: (t, r = C.tCurd("placeholderInput")) => t.text?.search?.placeholder === void 0 ? `${r}${t.label}` : t.text?.search?.placeholder,
1560
1662
  getFormData: () => {
1561
1663
  const t = e();
1562
- let i = {};
1563
- a.option.column.forEach((o) => {
1564
- (typeof o.show?.search == "function" ? o.show?.search(t.search.form) : o.show?.search) && (i[o.key] = t.search.form[o.key]);
1664
+ let r = {};
1665
+ o.option.column.forEach((s) => {
1666
+ (typeof s.show?.search == "function" ? s.show?.search(t.search.form) : s.show?.search) && (r[s.key] = t.search.form[s.key]);
1565
1667
  });
1566
- const n = a.option.search?.before?.(i);
1567
- return n && (i = n), i;
1668
+ const n = o.option.search?.before?.(r);
1669
+ return n && (r = n), r;
1568
1670
  },
1569
1671
  reset: () => {
1570
- const t = e(), i = t.search.formDefault;
1571
- Object.keys(i).forEach((o) => {
1572
- a.option.search?.resetMode === "none" ? i[o] = void 0 : i[o] = t.search.formDefault[o];
1672
+ const t = e(), r = t.search.formDefault;
1673
+ Object.keys(r).forEach((s) => {
1674
+ o.option.search?.resetMode === "none" ? r[s] = void 0 : r[s] = t.search.formDefault[s];
1573
1675
  });
1574
- const n = ObjectUtil.deepMerge(i, {});
1575
- Q.setValue(t.search.form, n, !0), t.page.num = 1, a.option.init !== !1 && t.table.getList();
1676
+ const n = ObjectUtil.deepMerge(r, {});
1677
+ Y.setValue(t.search.form, n, !0), t.page.num = 1, o.option.init !== !1 && t.table.getList();
1576
1678
  },
1577
1679
  submit: () => {
1578
1680
  const t = e();
@@ -1580,25 +1682,25 @@ const fe = (e) => {
1580
1682
  }
1581
1683
  }
1582
1684
  };
1583
- }, Et = (e, a) => ({
1685
+ }, Nt = (e, o) => ({
1584
1686
  page: {
1585
1687
  num: 1,
1586
1688
  total: 0,
1587
- layout: a.option.page?.layout || U.config.pagination.layout,
1588
- showTools: a.option.page?.showTools || U.config.pagination.showTools,
1589
- size: a.option.page?.size || U.config.pagination.size,
1590
- sizeList: a.option.page?.sizeList || U.config.pagination.pageSizes,
1591
- pagerCount: a.option.page?.pagerCount || U.config.pagination.pagerCount,
1592
- getQuery: (l = {}) => {
1689
+ layout: o.option.page?.layout || T.config.pagination.layout,
1690
+ showTools: o.option.page?.showTools || T.config.pagination.showTools,
1691
+ size: o.option.page?.size || T.config.pagination.size,
1692
+ sizeList: o.option.page?.sizeList || T.config.pagination.pageSizes,
1693
+ pagerCount: o.option.page?.pagerCount || T.config.pagination.pagerCount,
1694
+ getQuery: (a = {}) => {
1593
1695
  const t = e();
1594
1696
  return {
1595
- [U.config.field.page.size]: l.size || t.page.size,
1596
- [U.config.field.page.num]: l.num || t.page.num,
1697
+ [T.config.field.page.size]: a.size || t.page.size,
1698
+ [T.config.field.page.num]: a.num || t.page.num,
1597
1699
  ...t.search.getFormData()
1598
1700
  };
1599
1701
  }
1600
1702
  }
1601
- }), Dt = (e, a, l) => ({
1703
+ }), Gt = (e, o, a) => ({
1602
1704
  table: {
1603
1705
  op: {
1604
1706
  width: (...t) => t.filter((n) => n).length * 30 + 60
@@ -1608,20 +1710,20 @@ const fe = (e) => {
1608
1710
  expand: {
1609
1711
  isExpand: !1,
1610
1712
  rowKeys: [],
1611
- change: (t, i) => {
1713
+ change: (t, r) => {
1612
1714
  },
1613
1715
  all: () => {
1614
1716
  const t = e();
1615
1717
  if (t.table.expand.isExpand)
1616
1718
  t.table.expand.rowKeys = [];
1617
1719
  else {
1618
- const i = (n) => {
1619
- let o = [];
1720
+ const r = (n) => {
1721
+ let s = [];
1620
1722
  return n.forEach((d) => {
1621
- o.push(d[a.option.table.rowKey]), d.children?.length && (o = o.concat(i(d.children)));
1622
- }), o;
1723
+ s.push(d[o.option.table.rowKey]), d.children?.length && (s = s.concat(r(d.children)));
1724
+ }), s;
1623
1725
  };
1624
- t.table.expand.rowKeys = i(t.table.data);
1726
+ t.table.expand.rowKeys = r(t.table.data);
1625
1727
  }
1626
1728
  t.table.expand.isExpand = !t.table.expand.isExpand;
1627
1729
  }
@@ -1637,11 +1739,11 @@ const fe = (e) => {
1637
1739
  group: {
1638
1740
  expand: !1,
1639
1741
  toggleExpandAll: () => {
1640
- const t = e(), i = !t.table.header.group.expand;
1641
- t.table.header.group.expand = i;
1642
- const n = (o) => {
1643
- o.forEach((d) => {
1644
- d.table?.header?.group !== void 0 && (d.table.header.group = !i), d.table?.header?.groupKey !== void 0 && (d.table.header.show = i), Array.isArray(d.children) && d.children.length && n(d.children);
1742
+ const t = e(), r = !t.table.header.group.expand;
1743
+ t.table.header.group.expand = r;
1744
+ const n = (s) => {
1745
+ s.forEach((d) => {
1746
+ d.table?.header?.group !== void 0 && (d.table.header.group = !r), d.table?.header?.groupKey !== void 0 && (d.table.header.show = r), Array.isArray(d.children) && d.children.length && n(d.children);
1645
1747
  });
1646
1748
  };
1647
1749
  n(t.table.column.list);
@@ -1651,29 +1753,29 @@ const fe = (e) => {
1651
1753
  getList: async () => {
1652
1754
  const t = e();
1653
1755
  t.table.loading = !0;
1654
- const i = a.option.api.list, n = JSONUtil.cp(t.table.selection.list);
1756
+ const r = o.option.api.list, n = JSONUtil.cp(t.table.selection.list);
1655
1757
  try {
1656
1758
  await t.initApiData("init");
1657
- let o = {};
1759
+ let s = {};
1658
1760
  if (t.table.sort.prop) {
1659
- const { props: C, order: H } = U.config.table.sort;
1660
- o = {
1661
- [C.field]: t.table.sort.prop,
1662
- [H.field]: t.table.sort.order
1761
+ const { props: w, order: D } = T.config.table.sort;
1762
+ s = {
1763
+ [w.field]: t.table.sort.prop,
1764
+ [D.field]: t.table.sort.order
1663
1765
  };
1664
1766
  }
1665
- const d = await i({
1767
+ const d = await r({
1666
1768
  ...t.page.getQuery(),
1667
- ...o
1668
- }), c = U.config.field.result, u = d.data || { [c.list]: d }, m = (Array.isArray(u[c.list]), u[c.list]), p = Be(t.update.formGrid?.length ? t.update.formGrid : t.update.formColumn), g = ObjectUtil.deepMerge({ data: m }, {}).data.map((C) => (Object.keys(C).forEach((N) => {
1669
- const S = p.find((E) => E.item.key === N);
1670
- S && ["select", "radio"].includes(S.item.type) && (S.item.table.format || (S.item.table.format = (E) => S.item.options[S.item.type].data?.find((B) => B.value == E[N])?.label || E[N]));
1671
- }), C));
1672
- t.table.data = a.option.data ? await a.option.data(g, m) : g, t.page.total = u[c.total] || 0, setTimeout(() => {
1769
+ ...s
1770
+ }), c = T.config.field.result, u = d.data || { [c.list]: d }, i = (Array.isArray(u[c.list]), u[c.list]), h = qe(t.update.formGrid?.length ? t.update.formGrid : t.update.formColumn), m = ObjectUtil.deepMerge({ data: i }, {}).data.map((w) => (Object.keys(w).forEach((L) => {
1771
+ const O = h.find((A) => A.item.key === L);
1772
+ O && ["select", "radio"].includes(O.item.type) && (O.item.table.format || (O.item.table.format = (A) => O.item.options[O.item.type].data?.find((se) => se.value == A[L])?.label || A[L]));
1773
+ }), w));
1774
+ t.table.data = o.option.data ? await o.option.data(m, i) : m, t.tableEditValidate?.clear?.(), t.page.total = u[c.total] || 0, setTimeout(() => {
1673
1775
  t.table.selection.setList(n);
1674
1776
  }, 20);
1675
- } catch (o) {
1676
- console.error(o);
1777
+ } catch (s) {
1778
+ console.error(s);
1677
1779
  } finally {
1678
1780
  t.table.loading = !1;
1679
1781
  }
@@ -1683,34 +1785,34 @@ const fe = (e) => {
1683
1785
  change: (t) => {
1684
1786
  e().table.selection.list = t;
1685
1787
  },
1686
- setList: (t, i) => {
1788
+ setList: (t, r) => {
1687
1789
  const n = e();
1688
1790
  n.table.selection.list = [];
1689
- const o = l.tableRef.value;
1690
- if (o?.clearSelection(), !o || !t?.length) return;
1691
- const d = a.option.table?.rowKey, c = (u) => {
1692
- const m = (p) => {
1693
- for (const f of p) {
1791
+ const s = a.tableRef.value;
1792
+ if (s?.clearSelection(), !s || !t?.length) return;
1793
+ const d = o.option.table?.rowKey, c = (u) => {
1794
+ const i = (h) => {
1795
+ for (const f of h) {
1694
1796
  if (d != null && d !== "") {
1695
1797
  if (f[d] === u[d]) return f;
1696
1798
  } else if (f === u)
1697
1799
  return f;
1698
1800
  if (Array.isArray(f.children) && f.children.length) {
1699
- const g = m(f.children);
1700
- if (g !== void 0) return g;
1801
+ const m = i(f.children);
1802
+ if (m !== void 0) return m;
1701
1803
  }
1702
1804
  }
1703
1805
  };
1704
- return m(n.table.data);
1806
+ return i(n.table.data);
1705
1807
  };
1706
1808
  t.forEach((u) => {
1707
- const m = c(u);
1708
- if (m)
1709
- if (i) {
1710
- const p = () => o.toggleRowSelection(m, !0, !1);
1711
- i(u) !== !1 && p();
1809
+ const i = c(u);
1810
+ if (i)
1811
+ if (r) {
1812
+ const h = () => s.toggleRowSelection(i, !0, !1);
1813
+ r(u) !== !1 && h();
1712
1814
  } else
1713
- o.toggleRowSelection(m, !0, !1);
1815
+ s.toggleRowSelection(i, !0, !1);
1714
1816
  });
1715
1817
  }
1716
1818
  },
@@ -1718,19 +1820,141 @@ const fe = (e) => {
1718
1820
  prop: "",
1719
1821
  order: "",
1720
1822
  change: (t) => {
1721
- const i = e();
1722
- U.config.table.sort.resetPage && (i.page.num = 1);
1723
- const n = U.config.table.sort;
1823
+ const r = e();
1824
+ T.config.table.sort.resetPage && (r.page.num = 1);
1825
+ const n = T.config.table.sort;
1724
1826
  if (n.change) {
1725
- n.change(t, i);
1827
+ n.change(t, r);
1726
1828
  return;
1727
1829
  }
1728
- i.table.sort.prop = t.prop, t.order === null ? (i.table.sort.order = "", i.table.sort.prop = "") : i.table.sort.order = t.order === "ascending" ? n.order.asc : n.order.desc, i.table.getList();
1830
+ r.table.sort.prop = t.prop, t.order === null ? (r.table.sort.order = "", r.table.sort.prop = "") : r.table.sort.order = t.order === "ascending" ? n.order.asc : n.order.desc, r.table.getList();
1729
1831
  }
1730
1832
  }
1731
1833
  }
1732
- });
1733
- class Ot {
1834
+ }), Ht = (e, o) => {
1835
+ const a = ie({}), t = /* @__PURE__ */ new WeakMap();
1836
+ let r = 0;
1837
+ const n = (y) => {
1838
+ let k = t.get(y);
1839
+ return k || (r += 1, k = `fallback-${r}`, t.set(y, k)), k;
1840
+ }, s = (y) => {
1841
+ const k = o.option.table?.rowKey, z = k ? y[k] : void 0;
1842
+ return z != null && z !== "" ? String(z) : n(y);
1843
+ }, d = (y, k) => `${s(y)}-${k.key}`, c = (y) => Ye(y, o.option.form?.error), u = Xe(c), i = () => {
1844
+ Object.keys(a).forEach((y) => {
1845
+ delete a[y];
1846
+ });
1847
+ }, h = (y, k) => {
1848
+ delete a[d(y, k)];
1849
+ }, f = (y, k) => a[d(y, k)] || "", m = (y, k) => y.message || c(k), w = (y) => y == null || y === "" || Array.isArray(y) && y.length === 0, D = (y) => {
1850
+ if (typeof y == "number") return y;
1851
+ if (typeof y == "string" || Array.isArray(y)) return y.length;
1852
+ }, L = (y, k) => {
1853
+ if (y === "array") return Array.isArray(k);
1854
+ if (y === "integer") return typeof k == "number" && Number.isInteger(k);
1855
+ if (y === "float") return typeof k == "number" && !Number.isInteger(k);
1856
+ if (y === "number") return typeof k == "number" && !Number.isNaN(k);
1857
+ if (y === "boolean") return typeof k == "boolean";
1858
+ if (y === "object") return k !== null && typeof k == "object" && !Array.isArray(k);
1859
+ if (y === "date") return k instanceof Date || !Number.isNaN(new Date(k).getTime());
1860
+ if (y === "email") return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(k));
1861
+ if (y === "url")
1862
+ try {
1863
+ return new URL(String(k)), !0;
1864
+ } catch {
1865
+ return !1;
1866
+ }
1867
+ return y === "string" ? typeof k == "string" : !0;
1868
+ }, O = (y, k, z) => typeof y.validator != "function" ? Promise.resolve(!0) : new Promise((K) => {
1869
+ let P = !1;
1870
+ const j = (I) => {
1871
+ if (!P) {
1872
+ if (P = !0, I == null) {
1873
+ K(!0);
1874
+ return;
1875
+ }
1876
+ if (I instanceof Error) {
1877
+ K(I.message || m(y, z));
1878
+ return;
1879
+ }
1880
+ if (Array.isArray(I)) {
1881
+ const Ve = I[0];
1882
+ K(Ve instanceof Error ? Ve.message : String(Ve || m(y, z)));
1883
+ return;
1884
+ }
1885
+ K(String(I));
1886
+ }
1887
+ };
1888
+ try {
1889
+ const I = y.validator(y, k, j);
1890
+ I && typeof I.then == "function" ? I.then(() => j()).catch(j) : I === !1 ? j(m(y, z)) : typeof I == "string" || I instanceof Error ? j(I) : y.validator.length < 3 && j();
1891
+ } catch (I) {
1892
+ j(I);
1893
+ }
1894
+ }), A = async (y, k, z) => {
1895
+ const K = typeof y.transform == "function" ? y.transform(k) : k, P = w(K);
1896
+ if (y.required && P) return m(y, z);
1897
+ if (P && !y.required) return !0;
1898
+ if (y.whitespace && typeof K == "string" && K.trim() === "" || y.type && !L(y.type, K) || Array.isArray(y.enum) && !y.enum.includes(K) || y.pattern && !new RegExp(y.pattern).test(String(K))) return m(y, z);
1899
+ const j = D(K);
1900
+ return y.len !== void 0 && j !== void 0 && j !== y.len || y.min !== void 0 && j !== void 0 && j < y.min || y.max !== void 0 && j !== void 0 && j > y.max ? m(y, z) : O(y, K, z);
1901
+ }, se = (y) => {
1902
+ const k = e();
1903
+ return !y.key || !k.table.column.show.list.includes(y.key) || y.table?.header?.groupKey !== void 0 && !y.table.header.show ? !1 : y.show?.table !== void 0 ? $.isFun(y.show?.table, k.table.data) : !0;
1904
+ }, Ce = (y, k) => y.show?.form !== void 0 ? $.isFun(y.show.form, k, $.EDialog.Update) : !0, Z = () => {
1905
+ const y = e(), k = [], z = (K) => {
1906
+ K.forEach((P) => {
1907
+ if (se(P)) {
1908
+ if (P.children?.length) {
1909
+ z(P.children);
1910
+ return;
1911
+ }
1912
+ k.push(P);
1913
+ }
1914
+ });
1915
+ };
1916
+ return z(y.table.column.list), k;
1917
+ }, xe = async (y, k) => {
1918
+ if (!Ce(k, y))
1919
+ return h(y, k), !0;
1920
+ const z = u(k, y);
1921
+ if (!z) return !0;
1922
+ h(y, k);
1923
+ const K = Array.isArray(z) ? z : [z];
1924
+ for (const P of K) {
1925
+ const j = await A(P, y[k.key], k);
1926
+ if (j !== !0)
1927
+ return a[d(y, k)] = j, {
1928
+ field: k.key,
1929
+ error: j
1930
+ };
1931
+ }
1932
+ return !0;
1933
+ }, te = (y) => {
1934
+ const k = [], z = (K) => {
1935
+ K.forEach((P) => {
1936
+ k.push(P), Array.isArray(P.children) && P.children.length && z(P.children);
1937
+ });
1938
+ };
1939
+ return z(y), k;
1940
+ };
1941
+ return {
1942
+ tableEditValidate: {
1943
+ errors: a,
1944
+ clear: i,
1945
+ clearField: h,
1946
+ getFieldError: f,
1947
+ validate: async () => {
1948
+ if (i(), !o.option.table?.editMode) return !0;
1949
+ const y = e(), k = Z(), z = te(y.table.data || []), P = (await Promise.all(z.flatMap((j) => k.map((I) => xe(j, I))))).filter((j) => j !== !0);
1950
+ if (P.length)
1951
+ throw fe(P), !1;
1952
+ return !0;
1953
+ }
1954
+ }
1955
+ };
1956
+ };
1957
+ class Wt {
1734
1958
  /**
1735
1959
  * 导出数据为 Excel 文件(.xlsx),自动触发浏览器下载
1736
1960
  *
@@ -1738,134 +1962,134 @@ class Ot {
1738
1962
  * @param columns - 列配置数组,需包含 `key`(数据字段)和 `label`(Excel 表头)
1739
1963
  * @param fileName - 文件名(不含扩展名),支持字符串或返回字符串的函数;默认生成「导出数据_日期_时间戳」
1740
1964
  */
1741
- static exportToExcel = async (a, l, t) => {
1742
- if (!a || a.length === 0) return;
1743
- const i = await z.loadModule("xlsx"), n = a.map((c) => {
1965
+ static exportToExcel = async (o, a, t) => {
1966
+ if (!o || o.length === 0) return;
1967
+ const r = await $.loadModule("xlsx"), n = o.map((c) => {
1744
1968
  const u = {};
1745
- return l.forEach((m) => {
1746
- u[m.label] = c[m.key];
1969
+ return a.forEach((i) => {
1970
+ u[i.label] = c[i.key];
1747
1971
  }), u;
1748
- }), o = i.utils.json_to_sheet(n), d = i.utils.book_new();
1749
- i.utils.book_append_sheet(d, o, "Sheet1"), t ? typeof t == "function" && (t = t()) : t = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, i.writeFile(d, `${t}.xlsx`);
1972
+ }), s = r.utils.json_to_sheet(n), d = r.utils.book_new();
1973
+ r.utils.book_append_sheet(d, s, "Sheet1"), t ? typeof t == "function" && (t = t()) : t = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, r.writeFile(d, `${t}.xlsx`);
1750
1974
  };
1751
1975
  }
1752
- const Mt = (e, a) => ({
1976
+ const Jt = (e, o) => ({
1753
1977
  export: {
1754
1978
  run: {
1755
- start: async (l) => {
1756
- let i = await e().export.run[l]();
1757
- const n = a.option.column, o = ObjectUtil.deepMerge({ data: i, columns: n }, {}), d = a.option.tools?.export || {};
1758
- d.before?.(o), Ot.exportToExcel(o.data, o.columns, d.fileName);
1979
+ start: async (a) => {
1980
+ let r = await e().export.run[a]();
1981
+ const n = o.option.column, s = ObjectUtil.deepMerge({ data: r, columns: n }, {}), d = o.option.tools?.export || {};
1982
+ d.before?.(s), Wt.exportToExcel(s.data, s.columns, d.fileName);
1759
1983
  },
1760
1984
  select: async () => {
1761
- const l = e();
1762
- l.export.loading = !0;
1985
+ const a = e();
1986
+ a.export.loading = !0;
1763
1987
  try {
1764
- if (a.option.tools?.export?.select) {
1765
- await a.option.tools.export.select({
1766
- ...l.page.getQuery(),
1767
- items: l.table.selection.list
1988
+ if (o.option.tools?.export?.select) {
1989
+ await o.option.tools.export.select({
1990
+ ...a.page.getQuery(),
1991
+ items: a.table.selection.list
1768
1992
  });
1769
1993
  return;
1770
1994
  }
1771
- if (l.table.selection.list.length === 0)
1772
- throw z.fail(w.tCurd("selectDataToExport")), new Error(w.tCurd("selectDataToExport"));
1773
- return l.table.selection.list;
1995
+ if (a.table.selection.list.length === 0)
1996
+ throw $.fail(C.tCurd("selectDataToExport")), new Error(C.tCurd("selectDataToExport"));
1997
+ return a.table.selection.list;
1774
1998
  } catch (t) {
1775
1999
  console.error(t);
1776
2000
  } finally {
1777
- l.export.loading = !1;
2001
+ a.export.loading = !1;
1778
2002
  }
1779
2003
  },
1780
2004
  page: async () => {
1781
- const l = e();
1782
- l.export.loading = !0;
2005
+ const a = e();
2006
+ a.export.loading = !0;
1783
2007
  try {
1784
- if (a.option.tools?.export?.page) {
1785
- await a.option.tools.export.page({
1786
- ...l.page.getQuery()
2008
+ if (o.option.tools?.export?.page) {
2009
+ await o.option.tools.export.page({
2010
+ ...a.page.getQuery()
1787
2011
  });
1788
2012
  return;
1789
2013
  }
1790
- if (l.table.data.length === 0)
1791
- throw z.fail(w.tCurd("noData")), new Error(w.tCurd("noData"));
1792
- return l.table.data;
2014
+ if (a.table.data.length === 0)
2015
+ throw $.fail(C.tCurd("noData")), new Error(C.tCurd("noData"));
2016
+ return a.table.data;
1793
2017
  } catch (t) {
1794
2018
  console.error(t);
1795
2019
  } finally {
1796
- l.export.loading = !1;
2020
+ a.export.loading = !1;
1797
2021
  }
1798
2022
  },
1799
2023
  all: async () => {
1800
- const l = e();
1801
- l.export.loading = !0;
2024
+ const a = e();
2025
+ a.export.loading = !0;
1802
2026
  try {
1803
- if (a.option.tools?.export?.all) {
1804
- await a.option.tools.export.all({
1805
- ...l.page.getQuery()
2027
+ if (o.option.tools?.export?.all) {
2028
+ await o.option.tools.export.all({
2029
+ ...a.page.getQuery()
1806
2030
  });
1807
2031
  return;
1808
2032
  }
1809
- const t = a.option.api.list, i = await t({
1810
- ...l.page.getQuery({ size: 999999, num: 1 })
2033
+ const t = o.option.api.list, r = await t({
2034
+ ...a.page.getQuery({ size: 999999, num: 1 })
1811
2035
  });
1812
- return (i.data || { [U.config.field.result.list]: i })[U.config.field.result.list];
2036
+ return (r.data || { [T.config.field.result.list]: r })[T.config.field.result.list];
1813
2037
  } catch (t) {
1814
2038
  console.error(t);
1815
2039
  } finally {
1816
- l.export.loading = !1;
2040
+ a.export.loading = !1;
1817
2041
  }
1818
2042
  }
1819
2043
  },
1820
2044
  loading: !1,
1821
- click: (l) => {
2045
+ click: (a) => {
1822
2046
  const t = e();
1823
- t.export.loading || t.export.run.start(l);
2047
+ t.export.loading || t.export.run.start(a);
1824
2048
  }
1825
2049
  }
1826
- }), Ft = (e, a) => ({
2050
+ }), qt = (e, o) => ({
1827
2051
  remove: {
1828
- title: w.tCurd("deleteTitle"),
2052
+ title: C.tCurd("deleteTitle"),
1829
2053
  show: !1,
1830
2054
  items: [],
1831
2055
  loading: !1,
1832
2056
  close: () => {
1833
2057
  e().remove.show = !1;
1834
2058
  },
1835
- open: (l) => {
1836
- if (l.length === 0) {
1837
- z.fail(w.tCurd("selectDataToDelete"));
2059
+ open: (a) => {
2060
+ if (a.length === 0) {
2061
+ $.fail(C.tCurd("selectDataToDelete"));
1838
2062
  return;
1839
2063
  }
1840
2064
  const t = e();
1841
- t.remove.items = l, t.remove.show = !0;
2065
+ t.remove.items = a, t.remove.show = !0;
1842
2066
  },
1843
2067
  submit: () => {
1844
2068
  FunUtil.throttle(async () => {
1845
- const l = e();
1846
- l.remove.loading = !0;
1847
- const t = a.option.api.delete;
2069
+ const a = e();
2070
+ a.remove.loading = !0;
2071
+ const t = o.option.api.delete;
1848
2072
  try {
1849
2073
  if (!t) return;
1850
2074
  await t({
1851
- [a.option.table?.rowKey]: l.remove.items.map((i) => i[a.option.table?.rowKey]),
1852
- items: l.remove.items
1853
- }), z.success(w.tCurd("operationSuccess")), l.table.data.length <= 1 && l.page.num > 1 && (l.page.num -= 1), l.remove.close(), await l.table.getList();
1854
- } catch (i) {
1855
- console.error(i);
2075
+ [o.option.table?.rowKey]: a.remove.items.map((r) => r[o.option.table?.rowKey]),
2076
+ items: a.remove.items
2077
+ }), $.success(C.tCurd("operationSuccess")), a.table.data.length <= 1 && a.page.num > 1 && (a.page.num -= 1), a.remove.close(), await a.table.getList();
2078
+ } catch (r) {
2079
+ console.error(r);
1856
2080
  } finally {
1857
- l.remove.loading = !1;
2081
+ a.remove.loading = !1;
1858
2082
  }
1859
2083
  });
1860
2084
  }
1861
2085
  }
1862
- }), Ut = (e, a, l) => ({
2086
+ }), Qt = (e, o, a) => ({
1863
2087
  apiDataMap: {},
1864
- getColumnSpan: (t, i) => {
1865
- const n = e(), o = n.update.formGrid?.length ? n.update.formGrid : i || [];
1866
- return Fe(t, o, n.update.form, n.update.type, {
1867
- maxSpan: n.update.formMaxSpan || a.option.form?.maxSpan,
1868
- defaultSpan: a.option.form?.defaultSpan || U.config.form.defaultSpan
2088
+ getColumnSpan: (t, r) => {
2089
+ const n = e(), s = n.update.formGrid?.length ? n.update.formGrid : r || [];
2090
+ return He(t, s, n.update.form, n.update.type, {
2091
+ maxSpan: n.update.formMaxSpan || o.option.form?.maxSpan,
2092
+ defaultSpan: o.option.form?.defaultSpan || T.config.form.defaultSpan
1869
2093
  });
1870
2094
  },
1871
2095
  init: () => {
@@ -1873,20 +2097,20 @@ const Mt = (e, a) => ({
1873
2097
  t.initCurdConfig(), t.initColumnOptions(), t.initColumnForm();
1874
2098
  },
1875
2099
  initApiData: async (t) => {
1876
- const i = e(), n = [], o = (d) => {
2100
+ const r = e(), n = [], s = (d) => {
1877
2101
  if (d.children?.length) {
1878
- d.children.forEach((u) => o(u));
2102
+ d.children.forEach((u) => s(u));
1879
2103
  return;
1880
2104
  }
1881
- const c = te(d);
2105
+ const c = me(d);
1882
2106
  if (d.options?.[c]?.dataApi && d.options?.[c]?.dataApiConfig?.[t]) {
1883
- if (i.apiDataMap[d.key] && d.options?.[c]?.dataApiConfig?.once) return;
2107
+ if (r.apiDataMap[d.key] && d.options?.[c]?.dataApiConfig?.once) return;
1884
2108
  const u = (async () => {
1885
2109
  try {
1886
- let m = await d.options?.[c]?.dataApi?.(i.update.form, i.update.type);
1887
- if (m) {
1888
- const p = d.options?.[c]?.dataPath;
1889
- !Array.isArray(m) && p && (m = ObjectUtil.getPathValue(m, p)), d.options[c].data = m, d.options.search[c].data = m, d.options.search[d.options.search.type ?? c] || (d.options.search[d.options.search.type ?? c] = {}), d.options.search[d.options.search.type ?? c].data = m, d.options.formAdd[c].data = m, d.options.formUpdate[c].data = m, i.apiDataMap[d.key] = m;
2110
+ let i = await d.options?.[c]?.dataApi?.(r.update.form, r.update.type);
2111
+ if (i) {
2112
+ const h = d.options?.[c]?.dataPath;
2113
+ !Array.isArray(i) && h && (i = ObjectUtil.getPathValue(i, h)), d.options[c].data = i, d.options.search[c].data = i, d.options.search[d.options.search.type ?? c] || (d.options.search[d.options.search.type ?? c] = {}), d.options.search[d.options.search.type ?? c].data = i, d.options.formAdd[c].data = i, d.options.formUpdate[c].data = i, r.apiDataMap[d.key] = i;
1890
2114
  }
1891
2115
  } catch {
1892
2116
  }
@@ -1894,62 +2118,62 @@ const Mt = (e, a) => ({
1894
2118
  n.push(u);
1895
2119
  }
1896
2120
  };
1897
- return a.option.column.forEach((d) => o(d)), await Promise.all(n), !0;
2121
+ return o.option.column.forEach((d) => s(d)), await Promise.all(n), !0;
1898
2122
  },
1899
2123
  initCurdConfig: () => {
1900
- const t = ObjectUtil.deepMerge(U.config, {});
1901
- t.table.emptyText = w.tCurd("noData"), a.option.size = a.option.size || {}, t.table.size = a.option.size.table || t.size.table, t.form.size = a.option.size.form || t.size.form, t.size.search = a.option.size.search || t.size.search;
1902
- const i = ObjectUtil.deepMerge(t, a.option || {});
1903
- Object.keys(i).forEach((n) => {
1904
- a.option[n] = i[n];
2124
+ const t = ObjectUtil.deepMerge(T.config, {});
2125
+ t.table.emptyText = C.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;
2126
+ const r = ObjectUtil.deepMerge(t, o.option || {});
2127
+ Object.keys(r).forEach((n) => {
2128
+ o.option[n] = r[n];
1905
2129
  });
1906
2130
  },
1907
2131
  initColumnOptions: () => {
1908
2132
  const t = e();
1909
- let i = JSONUtil.cp(U.config.columnConfig);
1910
- i.options = ObjectUtil.deepMerge(
2133
+ let r = JSONUtil.cp(T.config.columnConfig);
2134
+ r.options = ObjectUtil.deepMerge(
1911
2135
  {
1912
2136
  switch: {
1913
- activeText: w.tCurd("switchOn"),
1914
- inactiveText: w.tCurd("switchOff")
2137
+ activeText: C.tCurd("switchOn"),
2138
+ inactiveText: C.tCurd("switchOff")
1915
2139
  }
1916
2140
  },
1917
- i.options
2141
+ r.options
1918
2142
  );
1919
- const n = (o) => {
1920
- const d = te(o);
1921
- for (const u in i) {
2143
+ const n = (s) => {
2144
+ const d = me(s);
2145
+ for (const u in r) {
1922
2146
  if (u === "table") {
1923
- if (o.table = ObjectUtil.deepMerge(i.table, o.table || {}), o.children) {
1924
- o.children.forEach((m) => n(m));
2147
+ if (s.table = ObjectUtil.deepMerge(r.table, s.table || {}), s.children) {
2148
+ s.children.forEach((i) => n(i));
1925
2149
  return;
1926
2150
  }
1927
- } else u === "type" ? o.type = o.type || i.type : o[u] = ObjectUtil.deepMerge(i[u], o[u] || {});
1928
- o.options = o.options || {}, o.options[d] = o.options[d] || {}, o.options[d].size = a.option.size.form;
2151
+ } else u === "type" ? s.type = s.type || r.type : s[u] = ObjectUtil.deepMerge(r[u], s[u] || {});
2152
+ s.options = s.options || {}, s.options[d] = s.options[d] || {}, s.options[d].size = o.option.size.form;
1929
2153
  }
1930
2154
  ["search", "formAdd", "formUpdate"].forEach((u) => {
1931
- o.options[u] = ObjectUtil.deepMerge(o.options, o.options[u] || {}), u === "search" ? a.option.size.search && (o.options[u][d].size = a.option.size.search) : a.option.size.form && (o.options[u][d].size = a.option.size.form);
1932
- }), o.table = ObjectUtil.deepMerge(o.table, o.options[d].table || {}), d === "switch" && (o.options.switch.tableBeforeChange = async (u, m) => {
1933
- const p = o.options?.switch;
2155
+ s.options[u] = ObjectUtil.deepMerge(s.options, s.options[u] || {}), u === "search" ? o.option.size.search && (s.options[u][d].size = o.option.size.search) : o.option.size.form && (s.options[u][d].size = o.option.size.form);
2156
+ }), s.table = ObjectUtil.deepMerge(s.table, s.options[d].table || {}), d === "switch" && (s.options.switch.tableBeforeChange = async (u, i) => {
2157
+ const h = s.options?.switch;
1934
2158
  try {
1935
- p.tableConfig?.confirm && await l.switchConfirmRef.value?.open({
1936
- title: w.tCurd("confirmModify"),
1937
- content: w.tCurd("confirmSwitchMessage")
2159
+ h.tableConfig?.confirm && await a.switchConfirmRef.value?.open({
2160
+ title: C.tCurd("confirmModify"),
2161
+ content: C.tCurd("confirmSwitchMessage")
1938
2162
  });
1939
2163
  try {
1940
- if (!a.option.api.update && !p.tableConfig?.api) return;
1941
- const f = m[a.option.table?.rowKey];
1942
- p.loadingMap || (p.loadingMap = {}), p.loadingMap[f] || (p.loadingMap[f] = { loading: !1 }), p.loadingMap[f].loading = !0;
1943
- const g = m[u] === p.activeValue ? p.inactiveValue : p.activeValue, C = p.tableConfig?.api ? p.tableConfig.api : a.option.api.update;
1944
- if (!C) return;
2164
+ if (!o.option.api.update && !h.tableConfig?.api) return;
2165
+ const f = i[o.option.table?.rowKey];
2166
+ h.loadingMap || (h.loadingMap = {}), h.loadingMap[f] || (h.loadingMap[f] = { loading: !1 }), h.loadingMap[f].loading = !0;
2167
+ const m = i[u] === h.activeValue ? h.inactiveValue : h.activeValue, w = h.tableConfig?.api ? h.tableConfig.api : o.option.api.update;
2168
+ if (!w) return;
1945
2169
  try {
1946
- await C({ ...m, [u]: g }, "switch");
2170
+ await w({ ...i, [u]: m }, "switch");
1947
2171
  } catch {
1948
2172
  return !1;
1949
2173
  } finally {
1950
- p.loadingMap[f].loading = !1;
2174
+ h.loadingMap[f].loading = !1;
1951
2175
  }
1952
- return z.success(w.tCurd("operationSuccess")), p.tableConfig?.loadList && (t.table.loading = !0, t.table.getList(), t.table.loading = !1), !0;
2176
+ return $.success(C.tCurd("operationSuccess")), h.tableConfig?.loadList && (t.table.loading = !0, t.table.getList(), t.table.loading = !1), !0;
1953
2177
  } catch (f) {
1954
2178
  return console.error(f), !1;
1955
2179
  } finally {
@@ -1958,104 +2182,119 @@ const Mt = (e, a) => ({
1958
2182
  } catch {
1959
2183
  return !1;
1960
2184
  }
1961
- }), d === "treeSelect" && (o.options.treeSelect.rowKey = a.option.table?.rowKey, o.options.treeSelect.nodeKey = a.option.table?.rowKey);
2185
+ }), d === "treeSelect" && (s.options.treeSelect.rowKey = o.option.table?.rowKey, s.options.treeSelect.nodeKey = o.option.table?.rowKey);
1962
2186
  };
1963
- a.option.column.forEach(n), a.option.table?.column?.forEach(n);
2187
+ o.option.column.forEach(n), o.option.table?.column?.forEach(n);
1964
2188
  },
1965
2189
  initColumnForm: () => {
1966
- const t = e(), i = a.option;
2190
+ const t = e(), r = o.option;
1967
2191
  t.update.formColumn = [], t.update.formGrid = [], t.update.formMaxSpan = 12, t.table.column.show = { list: [], listSource: [] };
1968
- const n = a.option.form?.maxSpan || 12, o = a.option.form?.defaultSpan || n / 2, d = Re((f) => {
1969
- const g = {
1970
- input: w.tCurd("placeholderInput"),
1971
- select: w.tCurd("placeholderSelect")
1972
- }, C = (g[te(f) || "input"] || g.input) + f.label;
1973
- return (a.option.form?.error || P.error.callback)?.(f.key, f) || C;
1974
- }), c = (f) => {
2192
+ const n = o.option.form?.maxSpan || 12, s = o.option.form?.defaultSpan || n / 2, d = Ze(o.option.form), c = (f) => {
1975
2193
  if (f.children) {
1976
- t.table.column.show.list.push(f.key), f.children.forEach((g) => c(g));
2194
+ t.table.column.show.list.push(f.key), f.children.forEach((m) => c(m));
1977
2195
  return;
1978
2196
  }
1979
2197
  t.update.formDefault[f.key] = f.value, f.table?.table && (f.show?.table && t.table.column.show.list.push(f.key), t.table.column.show.listSource.push(f.key));
1980
2198
  };
1981
- i.column.forEach((f) => {
1982
- me(f, !0), c(f);
1983
- }), a.option.table?.column?.forEach((f) => {
1984
- me(f, !1), c(f);
1985
- }), t.search.column.list = i.column.concat(i.table?.column || []), t.table.column.list = t.search.column.list.filter((f) => f.table?.table), t.search.column.list.sort((f, g) => f.sort?.search - g.sort?.search), t.table.column.list.sort((f, g) => f.sort?.table - g.sort?.table), t.update.rules = {}, Te(i.column, t.update.formDefault, t.update.rules, (f) => d(f, t.update.form));
1986
- const u = Ae(i.column, {
2199
+ r.column.forEach((f) => {
2200
+ ve(f, !0), c(f);
2201
+ }), o.option.table?.column?.forEach((f) => {
2202
+ ve(f, !1), c(f);
2203
+ }), t.search.column.list = r.column.concat(r.table?.column || []), t.table.column.list = t.search.column.list.filter((f) => f.table?.table), t.search.column.list.sort((f, m) => f.sort?.search - m.sort?.search), t.table.column.list.sort((f, m) => f.sort?.table - m.sort?.table), t.update.rules = {}, Fe(r.column, t.update.formDefault, t.update.rules, (f) => d(f, t.update.form)), r.table?.editMode && Fe(r.table?.column || [], t.update.formDefault, t.update.rules, (f) => d(f, t.update.form));
2204
+ const u = Qe(r.column, {
1987
2205
  maxSpan: n,
1988
- defaultSpan: o,
1989
- layout: a.option.form?.layout
2206
+ defaultSpan: s,
2207
+ layout: o.option.form?.layout
1990
2208
  });
1991
- t.update.formGrid = u.cells, t.update.formMaxSpan = u.maxSpan, t.update.formColumn = Ue(u.cells);
1992
- const m = a.option.search?.formDefault;
1993
- m && Object.keys(m).forEach((f) => {
1994
- t.search.formDefault[f] = m[f];
1995
- }), i.column.forEach((f) => {
2209
+ t.update.formGrid = u.cells, t.update.formMaxSpan = u.maxSpan, t.update.formColumn = Je(u.cells);
2210
+ const i = o.option.search?.formDefault;
2211
+ i && Object.keys(i).forEach((f) => {
2212
+ t.search.formDefault[f] = i[f];
2213
+ }), r.column.forEach((f) => {
1996
2214
  f.show?.search || (t.search.formDefault[f.key] = void 0);
1997
2215
  });
1998
- const p = ObjectUtil.deepMerge(t.search.formDefault, {});
1999
- Q.setValue(t.search.form, p, !0);
2216
+ const h = ObjectUtil.deepMerge(t.search.formDefault, {});
2217
+ Y.setValue(t.search.form, h, !0);
2000
2218
  }
2001
- }), Bt = (e) => {
2002
- const a = q(), l = q(), t = q(), i = { switchConfirmRef: a, ruleFormRef: l, tableRef: t }, n = () => o;
2003
- let o = ge({
2004
- ...zt(),
2219
+ }), Xt = (e) => {
2220
+ const o = _(), a = _(), t = _(), r = { switchConfirmRef: o, ruleFormRef: a, tableRef: t }, n = je(), s = Me.getConf("curdConf");
2221
+ let d;
2222
+ const c = (h) => {
2223
+ h = h || d;
2224
+ let f = h, m = h;
2225
+ for (; f?.parentCurdConf; )
2226
+ m = f.parentCurdConf, f = f.parentCurdConf;
2227
+ return m;
2228
+ }, u = () => d;
2229
+ d = ie({
2230
+ parentCurdConf: s,
2231
+ getCurdConf: c,
2232
+ getRootCurdConf: c,
2233
+ ...Pt(),
2005
2234
  option: e.option,
2006
- ...$t(n, e),
2007
- ...Et(n, e),
2008
- ...Dt(n, e, i),
2009
- ...Mt(n, e),
2010
- ...ht(n, e, i),
2011
- ...Ft(n, e),
2012
- ...Ut(n, e, i)
2013
- });
2014
- return o.init(), ze(() => {
2015
- e.option.init !== !1 && o.table.getList();
2016
- }), $e.setConf(o), { conf: o, switchConfirmRef: a, ruleFormRef: l, tableRef: t };
2017
- }, At = { class: "dialog-footer" }, Rt = /* @__PURE__ */ G({
2235
+ ...It(u, e),
2236
+ ...Nt(u, e),
2237
+ ...Gt(u, e, r),
2238
+ ...Ht(u, e),
2239
+ ...Jt(u, e),
2240
+ ...zt(u, e, r),
2241
+ ...qt(u, e),
2242
+ ...Qt(u, e, r)
2243
+ }), d.init();
2244
+ const i = n ? `curdRef-${n.uid}` : "";
2245
+ return s?.formRef && i && (s.formRef.set(i, {
2246
+ validate: async (h) => {
2247
+ const f = await d.update.validate(!1);
2248
+ if (h?.(!!f), !f) throw !1;
2249
+ return !0;
2250
+ }
2251
+ }), Te(() => {
2252
+ s.formRef.remove(i);
2253
+ })), Le(() => {
2254
+ e.option.init !== !1 && d.table.getList();
2255
+ }), Me.setConf("curdConf", d), { conf: d, switchConfirmRef: o, ruleFormRef: a, tableRef: t };
2256
+ }, Yt = { class: "dialog-footer" }, Zt = /* @__PURE__ */ q({
2018
2257
  __name: "switchConfirm",
2019
2258
  props: {
2020
2259
  size: {}
2021
2260
  },
2022
- setup(e, { expose: a }) {
2023
- const l = q(!1), t = q("确认修改"), i = q("确认要修改状态吗?");
2024
- let n = null, o = null;
2025
- const d = (m) => (m?.title && (t.value = m.title), m?.content && (i.value = m.content), l.value = !0, new Promise((p, f) => {
2026
- n = p, o = f;
2261
+ setup(e, { expose: o }) {
2262
+ const a = _(!1), t = _("确认修改"), r = _("确认要修改状态吗?");
2263
+ let n = null, s = null;
2264
+ const d = (i) => (i?.title && (t.value = i.title), i?.content && (r.value = i.content), a.value = !0, new Promise((h, f) => {
2265
+ n = h, s = f;
2027
2266
  })), c = () => {
2028
- l.value = !1, n?.(!0), n = null, o = null;
2267
+ a.value = !1, n?.(!0), n = null, s = null;
2029
2268
  }, u = () => {
2030
- l.value = !1, o?.(new Error("用户取消操作")), n = null, o = null;
2269
+ a.value = !1, s?.(new Error("用户取消操作")), n = null, s = null;
2031
2270
  };
2032
- return a({
2271
+ return o({
2033
2272
  open: d
2034
- }), (m, p) => {
2035
- const f = le("el-form");
2036
- return s(), h(r(ye), {
2037
- modelValue: l.value,
2038
- "onUpdate:modelValue": p[0] || (p[0] = (g) => l.value = g),
2273
+ }), (i, h) => {
2274
+ const f = ce("el-form");
2275
+ return g(), b(l(Ee), {
2276
+ modelValue: a.value,
2277
+ "onUpdate:modelValue": h[0] || (h[0] = (m) => a.value = m),
2039
2278
  title: t.value,
2040
2279
  "close-on-click-modal": !1,
2041
2280
  width: "400px"
2042
2281
  }, {
2043
- footer: b(() => [
2044
- D(f, { size: e.size }, {
2045
- default: b(() => [
2046
- M("span", At, [
2047
- D(r(T), { onClick: u }, {
2048
- default: b(() => [...p[1] || (p[1] = [
2049
- $("取消", -1)
2282
+ footer: p(() => [
2283
+ F(f, { size: e.size }, {
2284
+ default: p(() => [
2285
+ R("span", Yt, [
2286
+ F(l(N), { onClick: u }, {
2287
+ default: p(() => [...h[1] || (h[1] = [
2288
+ M("取消", -1)
2050
2289
  ])]),
2051
2290
  _: 1
2052
2291
  }),
2053
- D(r(T), {
2292
+ F(l(N), {
2054
2293
  type: "primary",
2055
2294
  onClick: c
2056
2295
  }, {
2057
- default: b(() => [...p[2] || (p[2] = [
2058
- $("确认", -1)
2296
+ default: p(() => [...h[2] || (h[2] = [
2297
+ M("确认", -1)
2059
2298
  ])]),
2060
2299
  _: 1
2061
2300
  })
@@ -2064,27 +2303,27 @@ const Mt = (e, a) => ({
2064
2303
  _: 1
2065
2304
  }, 8, ["size"])
2066
2305
  ]),
2067
- default: b(() => [
2068
- M("div", null, O(i.value), 1)
2306
+ default: p(() => [
2307
+ R("div", null, U(r.value), 1)
2069
2308
  ]),
2070
2309
  _: 1
2071
2310
  }, 8, ["modelValue", "title"]);
2072
2311
  };
2073
2312
  }
2074
- }), Tt = ["innerHTML"], Lt = /* @__PURE__ */ G({
2313
+ }), _t = ["innerHTML"], eo = /* @__PURE__ */ q({
2075
2314
  __name: "text",
2076
2315
  props: {
2077
2316
  content: {},
2078
2317
  value: {}
2079
2318
  },
2080
2319
  setup(e) {
2081
- const a = e, l = Z(() => typeof a.content == "function" ? a.content(a.value) : a.content);
2082
- return (t, i) => typeof l.value == "object" ? (s(), h(X(l.value), { key: 0 })) : (s(), y("div", {
2320
+ const o = e, a = ae(() => typeof o.content == "function" ? o.content(o.value) : o.content);
2321
+ return (t, r) => typeof a.value == "object" ? (g(), b(ee(a.value), { key: 0 })) : (g(), v("div", {
2083
2322
  key: 1,
2084
- innerHTML: l.value
2085
- }, null, 8, Tt));
2323
+ innerHTML: a.value
2324
+ }, null, 8, _t));
2086
2325
  }
2087
- }), Ce = /* @__PURE__ */ G({
2326
+ }), Re = /* @__PURE__ */ q({
2088
2327
  __name: "searchField",
2089
2328
  props: {
2090
2329
  item: {},
@@ -2092,168 +2331,174 @@ const Mt = (e, a) => ({
2092
2331
  type: {}
2093
2332
  },
2094
2333
  setup(e) {
2095
- const a = e, l = Z({
2096
- get: () => a.conf.search.form?.[a.item?.key],
2334
+ const o = e, a = ae({
2335
+ get: () => o.conf.search.form?.[o.item?.key],
2097
2336
  set: (t) => {
2098
- a.item?.key !== void 0 && (a.conf.search.form[a.item.key] = t);
2337
+ o.item?.key !== void 0 && (o.conf.search.form[o.item.key] = t);
2099
2338
  }
2100
2339
  });
2101
- return (t, i) => r(P).customComponent[e.type ?? ""]?.search ? (s(), h(X(r(P).customComponent[e.type ?? ""]?.search), k({
2340
+ return (t, r) => l(W).customComponent[e.type ?? ""]?.search ? (g(), b(ee(l(W).customComponent[e.type ?? ""]?.search), x({
2102
2341
  key: 0,
2103
- modelValue: l.value,
2104
- "onUpdate:modelValue": i[0] || (i[0] = (n) => l.value = n)
2105
- }, e.item.options?.search?.[e.type ?? ""], V(e.item.options?.search?.[e.type ?? ""]?.on || {})), null, 16, ["modelValue"])) : e.type === "input" ? (s(), h(r(_), k({
2342
+ modelValue: a.value,
2343
+ "onUpdate:modelValue": r[0] || (r[0] = (n) => a.value = n)
2344
+ }, e.item.options?.search?.[e.type ?? ""], E(e.item.options?.search?.[e.type ?? ""]?.on || {})), null, 16, ["modelValue"])) : e.type === "input" ? (g(), b(l(de), x({
2106
2345
  key: 1,
2107
- modelValue: l.value,
2108
- "onUpdate:modelValue": i[1] || (i[1] = (n) => l.value = n),
2346
+ modelValue: a.value,
2347
+ "onUpdate:modelValue": r[1] || (r[1] = (n) => a.value = n),
2109
2348
  placeholder: e.conf.search.getPlaceholder(e.item),
2110
2349
  clearable: "",
2111
2350
  disabled: e.item.disabled?.search
2112
- }, e.item.options?.search?.input || e.item.options?.input, V(e.item.options?.search?.input?.on || e.item.options?.input?.on || {})), null, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "switch" ? (s(), h(r(ne), k({
2351
+ }, e.item.options?.search?.input || e.item.options?.input, E(e.item.options?.search?.input?.on || e.item.options?.input?.on || {})), null, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "switch" ? (g(), b(l(ue), x({
2113
2352
  key: 2,
2114
- modelValue: l.value,
2115
- "onUpdate:modelValue": i[2] || (i[2] = (n) => l.value = n),
2116
- placeholder: e.conf.search.getPlaceholder(e.item, r(w).tCurd("placeholderSelect")),
2353
+ modelValue: a.value,
2354
+ "onUpdate:modelValue": r[2] || (r[2] = (n) => a.value = n),
2355
+ placeholder: e.conf.search.getPlaceholder(e.item, l(C).tCurd("placeholderSelect")),
2117
2356
  clearable: "",
2118
2357
  disabled: e.item.disabled?.search
2119
- }, e.item.options?.search?.switch || e.item.options?.switch, V(e.item.options?.search?.switch?.on || e.item.options?.switch?.on || {})), {
2120
- default: b(() => [
2121
- (s(), h(r(ee), {
2358
+ }, e.item.options?.search?.switch || e.item.options?.switch, E(e.item.options?.search?.switch?.on || e.item.options?.switch?.on || {})), {
2359
+ default: p(() => [
2360
+ (g(), b(l(ne), {
2122
2361
  key: e.item.options?.switch?.activeValue,
2123
2362
  label: e.item.options?.switch?.activeText,
2124
2363
  value: e.item.options?.switch?.activeValue
2125
2364
  }, null, 8, ["label", "value"])),
2126
- (s(), h(r(ee), {
2365
+ (g(), b(l(ne), {
2127
2366
  key: e.item.options?.switch?.inactiveValue,
2128
2367
  label: e.item.options?.switch?.inactiveText,
2129
2368
  value: e.item.options?.switch?.inactiveValue
2130
2369
  }, null, 8, ["label", "value"]))
2131
2370
  ]),
2132
2371
  _: 1
2133
- }, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "select" ? (s(), h(r(ne), k({
2372
+ }, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "select" ? (g(), b(l(ue), x({
2134
2373
  key: 3,
2135
- modelValue: l.value,
2136
- "onUpdate:modelValue": i[3] || (i[3] = (n) => l.value = n),
2137
- placeholder: e.conf.search.getPlaceholder(e.item, r(w).tCurd("placeholderSelect")),
2374
+ modelValue: a.value,
2375
+ "onUpdate:modelValue": r[3] || (r[3] = (n) => a.value = n),
2376
+ placeholder: e.conf.search.getPlaceholder(e.item, l(C).tCurd("placeholderSelect")),
2138
2377
  clearable: "",
2139
2378
  disabled: e.item.disabled?.search
2140
- }, e.item.options?.search?.select || e.item.options?.select, V(e.item.options?.search?.select?.on || e.item.options?.select?.on || {})), {
2141
- default: b(() => [
2142
- (s(!0), y(F, null, L(e.item.options?.search?.select?.data || e.item.options?.select?.data || [], (n) => (s(), h(r(ee), {
2379
+ }, e.item.options?.search?.select || e.item.options?.select, E(e.item.options?.search?.select?.on || e.item.options?.select?.on || {})), {
2380
+ default: p(() => [
2381
+ (g(!0), v(B, null, G(e.item.options?.search?.select?.data || e.item.options?.select?.data || [], (n) => (g(), b(l(ne), {
2143
2382
  key: n.value,
2144
2383
  label: n.label,
2145
2384
  value: n.value
2146
2385
  }, null, 8, ["label", "value"]))), 128))
2147
2386
  ]),
2148
2387
  _: 1
2149
- }, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "radio" ? (s(), h(r(xe), k({
2388
+ }, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "radio" ? (g(), b(l(Ue), x({
2150
2389
  key: 4,
2151
- modelValue: l.value,
2152
- "onUpdate:modelValue": i[4] || (i[4] = (n) => l.value = n),
2390
+ modelValue: a.value,
2391
+ "onUpdate:modelValue": r[4] || (r[4] = (n) => a.value = n),
2153
2392
  disabled: e.item.disabled?.search
2154
- }, e.item.options?.search?.radio || e.item.options?.radio, V(e.item.options?.search?.radio?.on || e.item.options?.radio?.on || {})), {
2155
- default: b(() => [
2156
- (s(!0), y(F, null, L(e.item.options?.radio?.data, (n) => (s(), h(r(Ve), {
2393
+ }, e.item.options?.search?.radio || e.item.options?.radio, E(e.item.options?.search?.radio?.on || e.item.options?.radio?.on || {})), {
2394
+ default: p(() => [
2395
+ (g(!0), v(B, null, G(e.item.options?.radio?.data, (n) => (g(), b(l(Ae), {
2157
2396
  key: n.value,
2158
2397
  label: n.label,
2159
2398
  value: n.value
2160
2399
  }, null, 8, ["label", "value"]))), 128))
2161
2400
  ]),
2162
2401
  _: 1
2163
- }, 16, ["modelValue", "disabled"])) : e.type === "datetime" ? (s(), h(r(Se), k({
2402
+ }, 16, ["modelValue", "disabled"])) : e.type === "datetime" ? (g(), b(l(Be), x({
2164
2403
  key: 5,
2165
- modelValue: l.value,
2166
- "onUpdate:modelValue": i[5] || (i[5] = (n) => l.value = n),
2404
+ modelValue: a.value,
2405
+ "onUpdate:modelValue": r[5] || (r[5] = (n) => a.value = n),
2167
2406
  disabled: e.item.disabled?.search
2168
- }, e.item.options?.search?.datetime || e.item.options?.datetime, V(e.item.options?.search?.datetime?.on || e.item.options?.datetime?.on || {})), null, 16, ["modelValue", "disabled"])) : e.type && r(P).customComponent[e.type] ? (s(), h(X(r(P).customComponent[e.type]), k({
2407
+ }, e.item.options?.search?.datetime || e.item.options?.datetime, E(e.item.options?.search?.datetime?.on || e.item.options?.datetime?.on || {})), null, 16, ["modelValue", "disabled"])) : e.type && l(W).customComponent[e.type] ? (g(), b(ee(l(W).customComponent[e.type]), x({
2169
2408
  key: 6,
2170
- modelValue: l.value,
2171
- "onUpdate:modelValue": i[6] || (i[6] = (n) => l.value = n)
2172
- }, e.item.options?.search?.[e.type] || e.item.options?.[e.type], V(e.item.options?.search?.[e.type]?.on || e.item.options?.[e.type]?.on || {}), {
2409
+ modelValue: a.value,
2410
+ "onUpdate:modelValue": r[6] || (r[6] = (n) => a.value = n)
2411
+ }, e.item.options?.search?.[e.type] || e.item.options?.[e.type], E(e.item.options?.search?.[e.type]?.on || e.item.options?.[e.type]?.on || {}), {
2173
2412
  disabled: e.item.disabled?.search
2174
- }), null, 16, ["modelValue", "disabled"])) : v("", !0);
2413
+ }), null, 16, ["modelValue", "disabled"])) : V("", !0);
2175
2414
  }
2176
- }), oe = (e, a) => {
2177
- const l = e.__vccOpts || e;
2178
- for (const [t, i] of a)
2179
- l[t] = i;
2180
- return l;
2181
- }, jt = {}, Pt = {
2415
+ }), re = (e, o) => {
2416
+ const a = e.__vccOpts || e;
2417
+ for (const [t, r] of o)
2418
+ a[t] = r;
2419
+ return a;
2420
+ }, to = {}, oo = {
2182
2421
  xmlns: "http://www.w3.org/2000/svg",
2183
2422
  viewBox: "64 64 896 896"
2184
2423
  };
2185
- function It(e, a) {
2186
- return s(), y("svg", Pt, [...a[0] || (a[0] = [
2187
- M("path", {
2424
+ function ao(e, o) {
2425
+ return g(), v("svg", oo, [...o[0] || (o[0] = [
2426
+ R("path", {
2188
2427
  fill: "currentColor",
2189
2428
  d: "M482.2 508.4L331.3 389c-3-2.4-7.3-.2-7.3 3.6V478H184V184h204v128c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V144c0-15.5-12.5-28-28-28H144c-15.5 0-28 12.5-28 28v736c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v128H184V546h140v85.4c0 3.8 4.4 6 7.3 3.6l150.9-119.4a4.5 4.5 0 000-7.2zM880 116H596c-15.5 0-28 12.5-28 28v168c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V184h204v294H700v-85.4c0-3.8-4.3-6-7.3-3.6l-151 119.4a4.52 4.52 0 000 7.1l151 119.5c2.9 2.3 7.3.2 7.3-3.6V546h140v294H636V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v168c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V144c0-15.5-12.5-28-28-28z"
2190
2429
  }, null, -1)
2191
2430
  ])]);
2192
2431
  }
2193
- const Kt = /* @__PURE__ */ oe(jt, [["render", It]]), Ht = {}, Gt = {
2432
+ const no = /* @__PURE__ */ re(to, [["render", ao]]), lo = {}, io = {
2194
2433
  xmlns: "http://www.w3.org/2000/svg",
2195
2434
  viewBox: "64 64 896 896"
2196
2435
  };
2197
- function Nt(e, a) {
2198
- return s(), y("svg", Gt, [...a[0] || (a[0] = [
2199
- M("path", {
2436
+ function ro(e, o) {
2437
+ return g(), v("svg", io, [...o[0] || (o[0] = [
2438
+ R("path", {
2200
2439
  fill: "currentColor",
2201
2440
  d: "M180 176h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zm724 0h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zM785.3 504.3L657.7 403.6a7.23 7.23 0 00-11.7 5.7V476H378v-62.8c0-6-7-9.4-11.7-5.7L238.7 508.3a7.14 7.14 0 000 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h268v62.8c0 6 7 9.4 11.7 5.7l127.5-100.8c3.8-2.9 3.8-8.5.2-11.4z"
2202
2441
  }, null, -1)
2203
2442
  ])]);
2204
2443
  }
2205
- const Wt = /* @__PURE__ */ oe(Ht, [["render", Nt]]), Jt = {}, Qt = {
2444
+ const so = /* @__PURE__ */ re(lo, [["render", ro]]), uo = {}, co = {
2206
2445
  xmlns: "http://www.w3.org/2000/svg",
2207
2446
  viewBox: "0 0 1024 1024"
2208
2447
  };
2209
- function qt(e, a) {
2210
- return s(), y("svg", Qt, [...a[0] || (a[0] = [
2211
- M("path", {
2448
+ function fo(e, o) {
2449
+ return g(), v("svg", co, [...o[0] || (o[0] = [
2450
+ R("path", {
2212
2451
  fill: "currentColor",
2213
2452
  d: "M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"
2214
2453
  }, null, -1)
2215
2454
  ])]);
2216
2455
  }
2217
- const Xt = /* @__PURE__ */ oe(Jt, [["render", qt]]), Yt = {}, Zt = {
2456
+ const mo = /* @__PURE__ */ re(uo, [["render", fo]]), go = {}, ho = {
2218
2457
  "data-v-58697b5c": "",
2219
2458
  xmlns: "http://www.w3.org/2000/svg",
2220
2459
  viewBox: "0 0 1024 1024"
2221
2460
  };
2222
- function _t(e, a) {
2223
- return s(), y("svg", Zt, [...a[0] || (a[0] = [
2224
- M("path", {
2461
+ function yo(e, o) {
2462
+ return g(), v("svg", ho, [...o[0] || (o[0] = [
2463
+ R("path", {
2225
2464
  fill: "currentColor",
2226
2465
  d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m23.744 191.488c-52.096 0-92.928 14.784-123.2 44.352-30.976 29.568-45.76 70.4-45.76 122.496h80.256c0-29.568 5.632-52.8 17.6-68.992 13.376-19.712 35.2-28.864 66.176-28.864 23.936 0 42.944 6.336 56.32 19.712 12.672 13.376 19.712 31.68 19.712 54.912 0 17.6-6.336 34.496-19.008 49.984l-8.448 9.856c-45.76 40.832-73.216 70.4-82.368 89.408-9.856 19.008-14.08 42.24-14.08 68.992v9.856h80.96v-9.856c0-16.896 3.52-31.68 10.56-45.76 6.336-12.672 15.488-24.64 28.16-35.2 33.792-29.568 54.208-48.576 60.544-55.616 16.896-22.528 26.048-51.392 26.048-86.592q0-64.416-42.24-101.376c-28.16-25.344-65.472-37.312-111.232-37.312m-12.672 406.208a54.27 54.27 0 0 0-38.72 14.784 49.4 49.4 0 0 0-15.488 38.016c0 15.488 4.928 28.16 15.488 38.016A54.85 54.85 0 0 0 523.072 768c15.488 0 28.16-4.928 38.72-14.784a51.52 51.52 0 0 0 16.192-38.72 51.97 51.97 0 0 0-15.488-38.016 55.94 55.94 0 0 0-39.424-14.784"
2227
2466
  }, null, -1)
2228
2467
  ])]);
2229
2468
  }
2230
- const eo = /* @__PURE__ */ oe(Yt, [["render", _t]]), to = {}, oo = {
2469
+ const bo = /* @__PURE__ */ re(go, [["render", yo]]), po = {}, wo = {
2231
2470
  "data-v-58697b5c": "",
2232
2471
  xmlns: "http://www.w3.org/2000/svg",
2233
2472
  viewBox: "0 0 1024 1024"
2234
2473
  };
2235
- function ao(e, a) {
2236
- return s(), y("svg", oo, [...a[0] || (a[0] = [
2237
- M("path", {
2474
+ function ko(e, o) {
2475
+ return g(), v("svg", wo, [...o[0] || (o[0] = [
2476
+ R("path", {
2238
2477
  fill: "currentColor",
2239
2478
  d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-38.4 409.6H326.4a38.4 38.4 0 1 0 0 76.8h147.2v147.2a38.4 38.4 0 0 0 76.8 0V550.4h147.2a38.4 38.4 0 0 0 0-76.8H550.4V326.4a38.4 38.4 0 1 0-76.8 0z"
2240
2479
  }, null, -1)
2241
2480
  ])]);
2242
2481
  }
2243
- const no = /* @__PURE__ */ oe(to, [["render", ao]]), lo = {}, io = {
2482
+ const vo = /* @__PURE__ */ re(po, [["render", ko]]), Co = {}, xo = {
2244
2483
  "data-v-58697b5c": "",
2245
2484
  xmlns: "http://www.w3.org/2000/svg",
2246
2485
  viewBox: "0 0 1024 1024"
2247
2486
  };
2248
- function ro(e, a) {
2249
- return s(), y("svg", io, [...a[0] || (a[0] = [
2250
- M("path", {
2487
+ function Vo(e, o) {
2488
+ return g(), v("svg", xo, [...o[0] || (o[0] = [
2489
+ R("path", {
2251
2490
  fill: "currentColor",
2252
2491
  d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896M288 512a38.4 38.4 0 0 0 38.4 38.4h371.2a38.4 38.4 0 0 0 0-76.8H326.4A38.4 38.4 0 0 0 288 512"
2253
2492
  }, null, -1)
2254
2493
  ])]);
2255
2494
  }
2256
- const so = /* @__PURE__ */ oe(lo, [["render", ro]]), uo = { class: "row flex-center table-header-label inline" }, co = { class: "table-header-tooltip" }, fo = ["innerHTML"], mo = ["onClick"], go = { key: 1 }, ho = ["onClick", "innerHTML"], bo = /* @__PURE__ */ G({
2495
+ const So = /* @__PURE__ */ re(Co, [["render", Vo]]), Eo = { class: "row flex-center table-header-label inline" }, $o = { class: "table-header-tooltip" }, zo = ["innerHTML"], Mo = {
2496
+ key: 1,
2497
+ class: "table-header-required"
2498
+ }, Fo = ["onClick"], Do = {
2499
+ key: 0,
2500
+ class: "table-edit-form"
2501
+ }, Oo = { key: 1 }, Ro = ["onClick", "innerHTML"], Uo = /* @__PURE__ */ q({
2257
2502
  __name: "tableColumn",
2258
2503
  props: {
2259
2504
  conf: {},
@@ -2261,206 +2506,223 @@ const so = /* @__PURE__ */ oe(lo, [["render", ro]]), uo = { class: "row flex-cen
2261
2506
  option: {}
2262
2507
  },
2263
2508
  setup(e) {
2264
- const a = z.isFun, l = tt().type;
2265
- return (t, i) => {
2266
- const n = le("el-tooltip");
2267
- return s(!0), y(F, null, L(e.columnList, (o) => (s(), y(F, {
2268
- key: o.key
2509
+ const o = $.isFun, a = e, r = je().type, n = (d) => d === !0 ? !0 : (Array.isArray(d) ? d : d ? [d] : []).some((u) => u?.required === !0), s = (d) => a.option.table?.editMode ? n(d.rules) || n(a.conf.update.rules?.[d.key]) : !1;
2510
+ return (d, c) => {
2511
+ const u = ce("el-tooltip");
2512
+ return g(!0), v(B, null, G(e.columnList, (i) => (g(), v(B, {
2513
+ key: i.key
2269
2514
  }, [
2270
- e.conf.table.column.show.list.includes(o.key) && (o.show?.table === void 0 || r(a)(o.show?.table, e.conf.table.data)) ? (s(), y(F, { key: 0 }, [
2271
- o.table?.header?.groupKey === void 0 || o.table.header.show ? (s(), h(r(ue), k({
2515
+ e.conf.table.column.show.list.includes(i.key) && (i.show?.table === void 0 || l(o)(i.show?.table, e.conf.table.data)) ? (g(), v(B, { key: 0 }, [
2516
+ i.table?.header?.groupKey === void 0 || i.table.header.show ? (g(), b(l(ye), x({
2272
2517
  key: 0,
2273
- prop: o.key,
2274
- label: o.label
2275
- }, { ref_for: !0 }, o.table), {
2276
- header: b(() => [
2277
- x(t.$slots, "table-header-" + o.key, { item: o }, () => [
2278
- M("div", uo, [
2279
- o.table?.header?.tooltip ? (s(), h(n, {
2518
+ prop: i.key,
2519
+ label: i.label
2520
+ }, { ref_for: !0 }, i.table), {
2521
+ header: p(() => [
2522
+ S(d.$slots, "table-header-" + i.key, { item: i }, () => [
2523
+ R("div", Eo, [
2524
+ i.table?.header?.tooltip ? (g(), b(u, {
2280
2525
  key: 0,
2281
2526
  effect: "dark",
2282
2527
  placement: "top"
2283
2528
  }, {
2284
- content: b(() => [
2285
- M("div", {
2286
- innerHTML: o.table?.header?.tooltip
2287
- }, null, 8, fo)
2529
+ content: p(() => [
2530
+ R("div", {
2531
+ innerHTML: i.table?.header?.tooltip
2532
+ }, null, 8, zo)
2288
2533
  ]),
2289
- default: b(() => [
2290
- M("span", co, [
2291
- D(eo)
2534
+ default: p(() => [
2535
+ R("span", $o, [
2536
+ F(bo)
2292
2537
  ])
2293
2538
  ]),
2294
2539
  _: 2
2295
- }, 1024)) : v("", !0),
2296
- $(" " + O(o.label) + " ", 1),
2297
- o.table?.header?.group !== void 0 ? (s(), y("span", {
2298
- key: 1,
2540
+ }, 1024)) : V("", !0),
2541
+ s(i) ? (g(), v("span", Mo, "*")) : V("", !0),
2542
+ M(" " + U(i.label) + " ", 1),
2543
+ i.table?.header?.group !== void 0 ? (g(), v("span", {
2544
+ key: 2,
2299
2545
  class: "table-header-plus",
2300
- onClick: ot(
2546
+ onClick: gt(
2301
2547
  () => {
2302
- o.table.header.group = !o.table.header.group, e.columnList.forEach((d) => {
2303
- d.table?.header?.groupKey === o.key && (d.table.header.show = !o.table.header.group);
2548
+ i.table.header.group = !i.table.header.group, e.columnList.forEach((h) => {
2549
+ h.table?.header?.groupKey === i.key && (h.table.header.show = !i.table.header.group);
2304
2550
  });
2305
2551
  },
2306
2552
  ["stop"]
2307
2553
  )
2308
2554
  }, [
2309
- o.table.header.group ? (s(), h(no, { key: 0 })) : (s(), h(so, { key: 1 }))
2310
- ], 8, mo)) : v("", !0)
2555
+ i.table.header.group ? (g(), b(vo, { key: 0 })) : (g(), b(So, { key: 1 }))
2556
+ ], 8, Fo)) : V("", !0)
2311
2557
  ])
2312
2558
  ])
2313
2559
  ]),
2314
- default: b(({ row: d }) => [
2315
- o.children ? (s(), y(F, { key: 0 }, [
2316
- i[0] || (i[0] = $("   ", -1)),
2317
- (s(), h(X(r(l)), {
2560
+ default: p(({ row: h }) => [
2561
+ i.children ? (g(), v(B, { key: 0 }, [
2562
+ c[0] || (c[0] = M("   ", -1)),
2563
+ (g(), b(ee(l(r)), {
2318
2564
  conf: e.conf,
2319
- columnList: o.children,
2565
+ columnList: i.children,
2320
2566
  option: e.option
2321
- }, J({ _: 2 }, [
2322
- L(t.$slots, (c, u) => ({
2323
- name: u,
2324
- fn: b((m) => [
2325
- x(t.$slots, u, k({ ref_for: !0 }, m || {}))
2567
+ }, X({ _: 2 }, [
2568
+ G(d.$slots, (f, m) => ({
2569
+ name: m,
2570
+ fn: p((w) => [
2571
+ S(d.$slots, m, x({ ref_for: !0 }, w || {}))
2326
2572
  ])
2327
2573
  }))
2328
2574
  ]), 1032, ["conf", "columnList", "option"]))
2329
- ], 64)) : (s(), y(F, { key: 1 }, [
2330
- e.option.table?.editMode ? (s(), y("div", {
2331
- key: 0,
2332
- class: I(["row", ["table-edit-" + o.key]]),
2333
- style: { width: "100%" }
2334
- }, [
2335
- x(t.$slots, "table-edit-left-" + o.key, {
2336
- row: d,
2337
- item: o
2338
- }),
2339
- o.type === "input" ? (s(), h(r(_), k({
2340
- key: 0,
2341
- modelValue: d[o.key],
2342
- "onUpdate:modelValue": (c) => d[o.key] = c,
2343
- disabled: e.conf.update.getDisabled(o, !0),
2344
- class: "col"
2345
- }, { ref_for: !0 }, e.conf.update.getBind(o), V(e.conf.update.getOn(o, d))), J({ _: 2 }, [
2346
- o.options?.input?.prepend ? {
2347
- name: "prepend",
2348
- fn: b(() => [
2349
- $(O(typeof o.options?.input?.prepend == "function" ? o.options?.input?.prepend(d) : o.options?.input?.prepend), 1)
2350
- ]),
2351
- key: "0"
2352
- } : void 0
2353
- ]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.type === "select" ? (s(), h(r(ne), k({
2354
- key: 1,
2355
- modelValue: d[o.key],
2356
- "onUpdate:modelValue": (c) => d[o.key] = c,
2357
- disabled: e.conf.update.getDisabled(o, !0),
2358
- class: "col"
2359
- }, { ref_for: !0 }, e.conf.update.getBind(o), V(e.conf.update.getOn(o, d))), {
2360
- default: b(() => [
2361
- (s(!0), y(F, null, L(o.options?.search?.select?.data || o.options?.select?.data, (c) => (s(), h(r(ee), {
2362
- key: c.value,
2363
- label: c.label,
2364
- value: c.value
2365
- }, null, 8, ["label", "value"]))), 128))
2575
+ ], 64)) : (g(), v(B, { key: 1 }, [
2576
+ e.option.table?.editMode ? (g(), v("div", Do, [
2577
+ F(l(be), {
2578
+ size: e.option.size?.table,
2579
+ error: e.conf.tableEditValidate.getFieldError(h, i),
2580
+ class: "table-edit-form-item"
2581
+ }, {
2582
+ default: p(() => [
2583
+ R("div", {
2584
+ class: J(["row", ["table-edit-" + i.key]]),
2585
+ style: { width: "100%" }
2586
+ }, [
2587
+ S(d.$slots, "table-edit-left-" + i.key, {
2588
+ row: h,
2589
+ item: i
2590
+ }),
2591
+ i.type === "input" ? (g(), b(l(de), x({
2592
+ key: 0,
2593
+ modelValue: h[i.key],
2594
+ "onUpdate:modelValue": (f) => h[i.key] = f,
2595
+ disabled: e.conf.update.getDisabled(i, !0),
2596
+ class: "col"
2597
+ }, { ref_for: !0 }, e.conf.update.getBind(i), E(e.conf.update.getOn(i, h)), {
2598
+ "onUpdate:modelValue": (f) => e.conf.tableEditValidate.clearField(h, i)
2599
+ }), X({ _: 2 }, [
2600
+ i.options?.input?.prepend ? {
2601
+ name: "prepend",
2602
+ fn: p(() => [
2603
+ M(U(typeof i.options?.input?.prepend == "function" ? i.options?.input?.prepend(h) : i.options?.input?.prepend), 1)
2604
+ ]),
2605
+ key: "0"
2606
+ } : void 0
2607
+ ]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : i.type === "select" ? (g(), b(l(ue), x({
2608
+ key: 1,
2609
+ modelValue: h[i.key],
2610
+ "onUpdate:modelValue": (f) => h[i.key] = f,
2611
+ disabled: e.conf.update.getDisabled(i, !0),
2612
+ class: "col"
2613
+ }, { ref_for: !0 }, e.conf.update.getBind(i), E(e.conf.update.getOn(i, h)), {
2614
+ "onUpdate:modelValue": (f) => e.conf.tableEditValidate.clearField(h, i)
2615
+ }), {
2616
+ default: p(() => [
2617
+ (g(!0), v(B, null, G(i.options?.search?.select?.data || i.options?.select?.data, (f) => (g(), b(l(ne), {
2618
+ key: f.value,
2619
+ label: f.label,
2620
+ value: f.value
2621
+ }, null, 8, ["label", "value"]))), 128))
2622
+ ]),
2623
+ _: 2
2624
+ }, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : i.type === "switch" ? (g(), b(l(he), x({
2625
+ key: 2,
2626
+ modelValue: h[i.key],
2627
+ "onUpdate:modelValue": (f) => h[i.key] = f,
2628
+ disabled: e.conf.update.getDisabled(i, !0),
2629
+ class: "col"
2630
+ }, { ref_for: !0 }, e.conf.update.getBind(i), E(e.conf.update.getOn(i, h)), {
2631
+ "onUpdate:modelValue": (f) => e.conf.tableEditValidate.clearField(h, i)
2632
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : V("", !0),
2633
+ S(d.$slots, "table-edit-right-" + i.key, {
2634
+ row: h,
2635
+ item: i
2636
+ })
2637
+ ], 2)
2366
2638
  ]),
2367
2639
  _: 2
2368
- }, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.type === "switch" ? (s(), h(r(se), k({
2369
- key: 2,
2370
- modelValue: d[o.key],
2371
- "onUpdate:modelValue": (c) => d[o.key] = c,
2372
- disabled: e.conf.update.getDisabled(o, !0),
2373
- class: "col"
2374
- }, { ref_for: !0 }, e.conf.update.getBind(o), V(e.conf.update.getOn(o, d))), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : v("", !0),
2375
- x(t.$slots, "table-edit-right-" + o.key, {
2376
- row: d,
2377
- item: o
2378
- })
2379
- ], 2)) : (s(), y(F, { key: 1 }, [
2380
- e.conf.update.type === r(z).EDialog.Update && r(a)(o.show?.form, e.conf.update.form, r(z).EDialog.Update) && e.option.table?.inlineEdit && e.conf.update.form[e.option.table?.rowKey] === d[e.option.table?.rowKey] && (o.type === "input" || o.type === "select") ? (s(), y(F, { key: 0 }, [
2381
- o.type === "input" ? (s(), h(r(_), k({
2640
+ }, 1032, ["size", "error"])
2641
+ ])) : (g(), v(B, { key: 1 }, [
2642
+ e.conf.update.type === l($).EDialog.Update && l(o)(i.show?.form, e.conf.update.form, l($).EDialog.Update) && e.option.table?.inlineEdit && e.conf.update.form[e.option.table?.rowKey] === h[e.option.table?.rowKey] && (i.type === "input" || i.type === "select") ? (g(), v(B, { key: 0 }, [
2643
+ i.type === "input" ? (g(), b(l(de), x({
2382
2644
  key: 0,
2383
- modelValue: e.conf.update.form[o.key],
2384
- "onUpdate:modelValue": (c) => e.conf.update.form[o.key] = c,
2385
- disabled: e.conf.update.getDisabled(o, !0)
2386
- }, { ref_for: !0 }, e.conf.update.getBind(o), V(e.conf.update.getOn(o, d)), { style: { width: "100%" } }), J({ _: 2 }, [
2387
- o.options?.input?.prepend ? {
2645
+ modelValue: e.conf.update.form[i.key],
2646
+ "onUpdate:modelValue": (f) => e.conf.update.form[i.key] = f,
2647
+ disabled: e.conf.update.getDisabled(i, !0)
2648
+ }, { ref_for: !0 }, e.conf.update.getBind(i), E(e.conf.update.getOn(i, h)), { style: { width: "100%" } }), X({ _: 2 }, [
2649
+ i.options?.input?.prepend ? {
2388
2650
  name: "prepend",
2389
- fn: b(() => [
2390
- $(O(typeof o.options?.input?.prepend == "function" ? o.options?.input?.prepend(d) : o.options?.input?.prepend), 1)
2651
+ fn: p(() => [
2652
+ M(U(typeof i.options?.input?.prepend == "function" ? i.options?.input?.prepend(h) : i.options?.input?.prepend), 1)
2391
2653
  ]),
2392
2654
  key: "0"
2393
2655
  } : void 0
2394
- ]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.type === "select" ? (s(), h(r(ne), k({
2656
+ ]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : i.type === "select" ? (g(), b(l(ue), x({
2395
2657
  key: 1,
2396
- modelValue: e.conf.update.form[o.key],
2397
- "onUpdate:modelValue": (c) => e.conf.update.form[o.key] = c,
2398
- disabled: e.conf.update.getDisabled(o, !0)
2399
- }, { ref_for: !0 }, e.conf.update.getBind(o), V(e.conf.update.getOn(o, d)), { style: { width: "100%" } }), {
2400
- default: b(() => [
2401
- (s(!0), y(F, null, L(o.options?.search?.select?.data || o.options?.select?.data, (c) => (s(), h(r(ee), {
2402
- key: c.value,
2403
- label: c.label,
2404
- value: c.value
2658
+ modelValue: e.conf.update.form[i.key],
2659
+ "onUpdate:modelValue": (f) => e.conf.update.form[i.key] = f,
2660
+ disabled: e.conf.update.getDisabled(i, !0)
2661
+ }, { ref_for: !0 }, e.conf.update.getBind(i), E(e.conf.update.getOn(i, h)), { style: { width: "100%" } }), {
2662
+ default: p(() => [
2663
+ (g(!0), v(B, null, G(i.options?.search?.select?.data || i.options?.select?.data, (f) => (g(), b(l(ne), {
2664
+ key: f.value,
2665
+ label: f.label,
2666
+ value: f.value
2405
2667
  }, null, 8, ["label", "value"]))), 128))
2406
2668
  ]),
2407
2669
  _: 2
2408
- }, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.type === "switch" ? (s(), h(r(se), k({
2670
+ }, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : i.type === "switch" ? (g(), b(l(he), x({
2409
2671
  key: 2,
2410
- modelValue: e.conf.update.form[o.key],
2411
- "onUpdate:modelValue": (c) => e.conf.update.form[o.key] = c
2412
- }, { ref_for: !0 }, e.conf.update.getBind(o), V(e.conf.update.getOn(o, d)), {
2413
- disabled: e.conf.update.getDisabled(o, !0)
2414
- }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : v("", !0)
2415
- ], 64)) : x(t.$slots, "table-" + o.key, {
2672
+ modelValue: e.conf.update.form[i.key],
2673
+ "onUpdate:modelValue": (f) => e.conf.update.form[i.key] = f
2674
+ }, { ref_for: !0 }, e.conf.update.getBind(i), E(e.conf.update.getOn(i, h)), {
2675
+ disabled: e.conf.update.getDisabled(i, !0)
2676
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : V("", !0)
2677
+ ], 64)) : S(d.$slots, "table-" + i.key, {
2416
2678
  key: 1,
2417
- row: d,
2418
- item: o
2679
+ row: h,
2680
+ item: i
2419
2681
  }, () => [
2420
- r(P).customComponent[o.type ?? ""]?.table ? (s(), h(X(r(P).customComponent[o.type ?? ""]?.table), k({
2682
+ l(W).customComponent[i.type ?? ""]?.table ? (g(), b(ee(l(W).customComponent[i.type ?? ""]?.table), x({
2421
2683
  key: 0,
2422
- modelValue: d[o.key],
2423
- "onUpdate:modelValue": (c) => d[o.key] = c
2424
- }, { ref_for: !0 }, o.options?.[o.type ?? ""], V(o.options?.[o.type ?? ""]?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue"])) : o.type === "switch" ? (s(), y(F, { key: 1 }, [
2425
- o.options?.switch?.tableConfig?.change ? (s(), h(r(se), k({
2684
+ modelValue: h[i.key],
2685
+ "onUpdate:modelValue": (f) => h[i.key] = f
2686
+ }, { ref_for: !0 }, i.options?.[i.type ?? ""], E(i.options?.[i.type ?? ""]?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue"])) : i.type === "switch" ? (g(), v(B, { key: 1 }, [
2687
+ i.options?.switch?.tableConfig?.change ? (g(), b(l(he), x({
2426
2688
  key: 0,
2427
- modelValue: d[o.key],
2428
- "onUpdate:modelValue": (c) => d[o.key] = c,
2429
- loading: o.options?.switch?.loadingMap?.[d[e.option.table?.rowKey]]?.loading,
2430
- "before-change": () => o.options?.switch?.tableBeforeChange?.(o.key, d)
2431
- }, { ref_for: !0 }, o.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "loading", "before-change"])) : (s(), y("span", go, O(d[o.key] === o.options?.switch?.activeValue ? o.options?.switch?.activeText : o.options?.switch?.inactiveText), 1))
2432
- ], 64)) : (s(), y("span", {
2689
+ modelValue: h[i.key],
2690
+ "onUpdate:modelValue": (f) => h[i.key] = f,
2691
+ loading: i.options?.switch?.loadingMap?.[h[e.option.table?.rowKey]]?.loading,
2692
+ "before-change": () => i.options?.switch?.tableBeforeChange?.(i.key, h)
2693
+ }, { ref_for: !0 }, i.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "loading", "before-change"])) : (g(), v("span", Oo, U(h[i.key] === i.options?.switch?.activeValue ? i.options?.switch?.activeText : i.options?.switch?.inactiveText), 1))
2694
+ ], 64)) : (g(), v("span", {
2433
2695
  key: 2,
2434
- style: ce({
2435
- "--table-text-click-color": o.table?.click?.color
2696
+ style: pe({
2697
+ "--table-text-click-color": i.table?.click?.color
2436
2698
  }),
2437
- class: I({ "table-text-click": o.table?.click?.callback }),
2438
- onClick: (c) => o.table?.click?.callback?.(d),
2439
- innerHTML: o.table?.format ? o.table?.format(d) : d[o.key]
2440
- }, null, 14, ho))
2699
+ class: J({ "table-text-click": i.table?.click?.callback }),
2700
+ onClick: (f) => i.table?.click?.callback?.(h),
2701
+ innerHTML: i.table?.format ? i.table?.format(h) : h[i.key]
2702
+ }, null, 14, Ro))
2441
2703
  ])
2442
2704
  ], 64))
2443
2705
  ], 64))
2444
2706
  ]),
2445
2707
  _: 2
2446
- }, 1040, ["prop", "label"])) : v("", !0)
2447
- ], 64)) : v("", !0)
2708
+ }, 1040, ["prop", "label"])) : V("", !0)
2709
+ ], 64)) : V("", !0)
2448
2710
  ], 64))), 128);
2449
2711
  };
2450
2712
  }
2451
- }), yo = {
2713
+ }), Ao = {
2452
2714
  key: 0,
2453
2715
  class: "relative curd-search fit-width"
2454
- }, po = { class: "mb-10 flex justify-between items-center fit-width" }, wo = {
2716
+ }, Bo = { class: "mb-10 flex justify-between items-center fit-width" }, Lo = {
2455
2717
  class: "flex items-center",
2456
2718
  style: { gap: "10px" }
2457
- }, ko = { key: 0 }, vo = { key: 1 }, Co = { key: 2 }, xo = { class: "export-btn" }, Vo = {
2719
+ }, To = { key: 0 }, jo = { key: 1 }, Ko = { key: 2 }, Po = { class: "export-btn" }, Io = {
2458
2720
  key: 1,
2459
2721
  class: "export-btn"
2460
- }, So = {
2722
+ }, No = {
2461
2723
  class: "flex items-center table-tools-right",
2462
2724
  style: { gap: "10px" }
2463
- }, zo = { class: "row justify-end mt-10 mb-10 table-bottom-pagination" }, $o = { class: "dialog-footer" }, Eo = { key: 0 }, Do = { key: 1 }, Oo = { class: "dialog-footer" }, Mo = /* @__PURE__ */ G({
2725
+ }, Go = { class: "row justify-end mt-10 mb-10 table-bottom-pagination" }, Ho = { class: "dialog-footer" }, Wo = { key: 0 }, Jo = { key: 1 }, qo = { class: "dialog-footer" }, Qo = /* @__PURE__ */ q({
2464
2726
  __name: "index",
2465
2727
  props: {
2466
2728
  /**
@@ -2482,278 +2744,278 @@ const so = /* @__PURE__ */ oe(lo, [["render", ro]]), uo = { class: "row flex-cen
2482
2744
  default: void 0
2483
2745
  }
2484
2746
  },
2485
- setup(e, { expose: a }) {
2486
- const l = z.EDialog, t = e, i = z.isFun, { conf: n, switchConfirmRef: o, ruleFormRef: d, tableRef: c } = Bt(t);
2487
- return a({
2747
+ setup(e, { expose: o }) {
2748
+ const a = $.EDialog, t = e, r = $.isFun, { conf: n, switchConfirmRef: s, ruleFormRef: d, tableRef: c } = Xt(t);
2749
+ return o({
2488
2750
  conf: n
2489
- }), (u, m) => {
2490
- const p = le("el-tooltip"), f = at("loading");
2491
- return s(), y("div", {
2492
- class: I(["relative cc1-form-box", [e.option.table?.fitHeight ? "col" : "no-min-height"]])
2751
+ }), (u, i) => {
2752
+ const h = ce("el-tooltip"), f = ht("loading");
2753
+ return g(), v("div", {
2754
+ class: J(["relative cc1-form-box", [e.option.table?.fitHeight ? "col" : "no-min-height"]])
2493
2755
  }, [
2494
- M("div", {
2495
- class: I(["row", [e.option.table?.fitHeight ? "absolute fit" : ""]]),
2756
+ R("div", {
2757
+ class: J(["row", [e.option.table?.fitHeight ? "absolute fit" : ""]]),
2496
2758
  style: { overflow: "hidden" }
2497
2759
  }, [
2498
- x(u.$slots, "box-left"),
2499
- M("div", {
2500
- class: I(["column fit-width no-wrap", [e.option.table?.fitHeight ? "col" : ""]])
2760
+ S(u.$slots, "box-left"),
2761
+ R("div", {
2762
+ class: J(["column fit-width no-wrap", [e.option.table?.fitHeight ? "col" : ""]])
2501
2763
  }, [
2502
- e.option.search?.show !== !1 ? (s(), y("div", yo, [
2503
- D(r(Y), {
2504
- model: r(n).search.form,
2764
+ e.option.search?.show !== !1 ? (g(), v("div", Ao, [
2765
+ F(l(oe), {
2766
+ model: l(n).search.form,
2505
2767
  inline: "",
2506
2768
  size: e.option.size?.search
2507
2769
  }, {
2508
- default: b(() => [
2509
- x(u.$slots, "search-start", {
2510
- row: r(n).search.form
2770
+ default: p(() => [
2771
+ S(u.$slots, "search-start", {
2772
+ row: l(n).search.form
2511
2773
  }),
2512
- (s(!0), y(F, null, L(r(n).search.column.list, (g) => (s(), y(F, {
2513
- key: g.key
2774
+ (g(!0), v(B, null, G(l(n).search.column.list, (m) => (g(), v(B, {
2775
+ key: m.key
2514
2776
  }, [
2515
- x(u.$slots, "search-" + g.key + "-start", {
2516
- row: r(n).search.form
2777
+ S(u.$slots, "search-" + m.key + "-start", {
2778
+ row: l(n).search.form
2517
2779
  }),
2518
- (typeof g.show?.search == "function" ? g.show?.search(r(n).search.form) : g.show?.search) ? (s(), h(r(be), {
2780
+ (typeof m.show?.search == "function" ? m.show?.search(l(n).search.form) : m.show?.search) ? (g(), b(l(be), {
2519
2781
  key: 0,
2520
- label: g.text?.search?.label ?? g.label
2782
+ label: m.text?.search?.label ?? m.label
2521
2783
  }, {
2522
- default: b(() => [
2523
- x(u.$slots, "search-" + g.key + "-left", {
2524
- row: r(n).search.form
2784
+ default: p(() => [
2785
+ S(u.$slots, "search-" + m.key + "-left", {
2786
+ row: l(n).search.form
2525
2787
  }),
2526
- x(u.$slots, "search-" + g.key, {
2527
- row: r(n).search.form
2788
+ S(u.$slots, "search-" + m.key, {
2789
+ row: l(n).search.form
2528
2790
  }, () => [
2529
- g.options?.search?.type ? (s(), h(Ce, {
2791
+ m.options?.search?.type ? (g(), b(Re, {
2530
2792
  key: 0,
2531
- item: g,
2532
- conf: r(n),
2533
- type: g.options.search.type
2534
- }, null, 8, ["item", "conf", "type"])) : (s(), h(Ce, {
2793
+ item: m,
2794
+ conf: l(n),
2795
+ type: m.options.search.type
2796
+ }, null, 8, ["item", "conf", "type"])) : (g(), b(Re, {
2535
2797
  key: 1,
2536
- item: g,
2537
- conf: r(n),
2538
- type: g.type
2798
+ item: m,
2799
+ conf: l(n),
2800
+ type: m.type
2539
2801
  }, null, 8, ["item", "conf", "type"]))
2540
2802
  ]),
2541
- x(u.$slots, "search-" + g.key + "-right", {
2542
- row: r(n).search.form
2803
+ S(u.$slots, "search-" + m.key + "-right", {
2804
+ row: l(n).search.form
2543
2805
  })
2544
2806
  ]),
2545
2807
  _: 2
2546
- }, 1032, ["label"])) : v("", !0),
2547
- x(u.$slots, "search-" + g.key + "-end", {
2548
- row: r(n).search.form
2808
+ }, 1032, ["label"])) : V("", !0),
2809
+ S(u.$slots, "search-" + m.key + "-end", {
2810
+ row: l(n).search.form
2549
2811
  })
2550
2812
  ], 64))), 128)),
2551
- x(u.$slots, "search-center", {
2552
- row: r(n).search.form
2813
+ S(u.$slots, "search-center", {
2814
+ row: l(n).search.form
2553
2815
  }),
2554
- e.option.tools?.search || e.option.tools?.reset ? (s(), h(r(be), { key: 0 }, {
2555
- default: b(() => [
2556
- e.option.tools?.search ? (s(), h(r(T), {
2816
+ e.option.tools?.search || e.option.tools?.reset ? (g(), b(l(be), { key: 0 }, {
2817
+ default: p(() => [
2818
+ e.option.tools?.search ? (g(), b(l(N), {
2557
2819
  key: 0,
2558
2820
  type: "primary",
2559
- onClick: r(n).search.submit
2821
+ onClick: l(n).search.submit
2560
2822
  }, {
2561
- default: b(() => [
2562
- $(O(r(w).tCurd("search")), 1)
2823
+ default: p(() => [
2824
+ M(U(l(C).tCurd("search")), 1)
2563
2825
  ]),
2564
2826
  _: 1
2565
- }, 8, ["onClick"])) : v("", !0),
2566
- e.option.tools?.reset ? (s(), h(r(T), {
2827
+ }, 8, ["onClick"])) : V("", !0),
2828
+ e.option.tools?.reset ? (g(), b(l(N), {
2567
2829
  key: 1,
2568
- onClick: r(n).search.reset
2830
+ onClick: l(n).search.reset
2569
2831
  }, {
2570
- default: b(() => [
2571
- $(O(r(w).tCurd("reset")), 1)
2832
+ default: p(() => [
2833
+ M(U(l(C).tCurd("reset")), 1)
2572
2834
  ]),
2573
2835
  _: 1
2574
- }, 8, ["onClick"])) : v("", !0)
2836
+ }, 8, ["onClick"])) : V("", !0)
2575
2837
  ]),
2576
2838
  _: 1
2577
- })) : v("", !0),
2578
- x(u.$slots, "search-end", {
2579
- row: r(n).search.form
2839
+ })) : V("", !0),
2840
+ S(u.$slots, "search-end", {
2841
+ row: l(n).search.form
2580
2842
  })
2581
2843
  ]),
2582
2844
  _: 3
2583
2845
  }, 8, ["model", "size"])
2584
- ])) : v("", !0),
2585
- M("div", po, [
2586
- M("div", wo, [
2587
- r(i)(e.option.tools?.add) ? (s(), y("div", ko, [
2588
- D(r(T), {
2846
+ ])) : V("", !0),
2847
+ R("div", Bo, [
2848
+ R("div", Lo, [
2849
+ l(r)(e.option.tools?.add) ? (g(), v("div", To, [
2850
+ F(l(N), {
2589
2851
  type: "primary",
2590
- onClick: m[0] || (m[0] = (g) => r(n).update.open(r(l).Add)),
2852
+ onClick: i[0] || (i[0] = (m) => l(n).update.open(l(a).Add)),
2591
2853
  size: e.option.size?.search
2592
2854
  }, {
2593
- default: b(() => [
2594
- $(O(r(w).tCurd("add")), 1)
2855
+ default: p(() => [
2856
+ M(U(l(C).tCurd("add")), 1)
2595
2857
  ]),
2596
2858
  _: 1
2597
2859
  }, 8, ["size"])
2598
- ])) : v("", !0),
2599
- e.option.table?.selectable && r(i)(e.option.tools?.delete) ? (s(), y("div", vo, [
2600
- D(r(T), {
2860
+ ])) : V("", !0),
2861
+ e.option.table?.selectable && l(r)(e.option.tools?.delete) ? (g(), v("div", jo, [
2862
+ F(l(N), {
2601
2863
  type: "danger",
2602
- onClick: m[1] || (m[1] = (g) => r(n).remove.open(r(n).table.selection.list)),
2864
+ onClick: i[1] || (i[1] = (m) => l(n).remove.open(l(n).table.selection.list)),
2603
2865
  size: e.option.size?.search
2604
2866
  }, {
2605
- default: b(() => [
2606
- $(O(r(w).tCurd("delete")), 1)
2867
+ default: p(() => [
2868
+ M(U(l(C).tCurd("delete")), 1)
2607
2869
  ]),
2608
2870
  _: 1
2609
2871
  }, 8, ["size"])
2610
- ])) : v("", !0),
2611
- e.option.tools?.expand ? (s(), y("div", Co, [
2612
- D(r(T), {
2872
+ ])) : V("", !0),
2873
+ e.option.tools?.expand ? (g(), v("div", Ko, [
2874
+ F(l(N), {
2613
2875
  type: "warning",
2614
- onClick: m[2] || (m[2] = (g) => r(n).table.expand.all()),
2876
+ onClick: i[2] || (i[2] = (m) => l(n).table.expand.all()),
2615
2877
  size: e.option.size?.search
2616
2878
  }, {
2617
- default: b(() => [
2618
- $(O(r(w).tCurd("expandCollapse")), 1)
2879
+ default: p(() => [
2880
+ M(U(l(C).tCurd("expandCollapse")), 1)
2619
2881
  ]),
2620
2882
  _: 1
2621
2883
  }, 8, ["size"])
2622
- ])) : v("", !0),
2623
- e.option.tools?.export?.show ? (s(), y(F, { key: 3 }, [
2624
- e.option.tools?.export?.dropdown?.show ? (s(), h(r(Ye), {
2884
+ ])) : V("", !0),
2885
+ e.option.tools?.export?.show ? (g(), v(B, { key: 3 }, [
2886
+ e.option.tools?.export?.dropdown?.show ? (g(), b(l(ut), {
2625
2887
  key: 0,
2626
- onCommand: r(n).export.click
2888
+ onCommand: l(n).export.click
2627
2889
  }, {
2628
- dropdown: b(() => [
2629
- D(r(Ze), {
2890
+ dropdown: p(() => [
2891
+ F(l(ct), {
2630
2892
  size: e.option.size?.search
2631
2893
  }, {
2632
- default: b(() => [
2633
- e.option.tools?.export?.dropdown?.select && (e.option.table?.selectable || r(i)(e.option.tools?.delete)) ? (s(), h(r(he), {
2894
+ default: p(() => [
2895
+ e.option.tools?.export?.dropdown?.select && (e.option.table?.selectable || l(r)(e.option.tools?.delete)) ? (g(), b(l(Se), {
2634
2896
  key: 0,
2635
2897
  command: "select"
2636
2898
  }, {
2637
- default: b(() => [
2638
- $(O(r(w).tCurd("exportSelect")), 1)
2899
+ default: p(() => [
2900
+ M(U(l(C).tCurd("exportSelect")), 1)
2639
2901
  ]),
2640
2902
  _: 1
2641
- })) : v("", !0),
2642
- e.option.tools?.export?.dropdown?.page ? (s(), h(r(he), {
2903
+ })) : V("", !0),
2904
+ e.option.tools?.export?.dropdown?.page ? (g(), b(l(Se), {
2643
2905
  key: 1,
2644
2906
  command: "page"
2645
2907
  }, {
2646
- default: b(() => [
2647
- $(O(r(w).tCurd("exportPage")), 1)
2908
+ default: p(() => [
2909
+ M(U(l(C).tCurd("exportPage")), 1)
2648
2910
  ]),
2649
2911
  _: 1
2650
- })) : v("", !0),
2651
- e.option.tools?.export?.dropdown?.all ? (s(), h(r(he), {
2912
+ })) : V("", !0),
2913
+ e.option.tools?.export?.dropdown?.all ? (g(), b(l(Se), {
2652
2914
  key: 2,
2653
2915
  command: "all"
2654
2916
  }, {
2655
- default: b(() => [
2656
- $(O(r(w).tCurd("exportAll")), 1)
2917
+ default: p(() => [
2918
+ M(U(l(C).tCurd("exportAll")), 1)
2657
2919
  ]),
2658
2920
  _: 1
2659
- })) : v("", !0)
2921
+ })) : V("", !0)
2660
2922
  ]),
2661
2923
  _: 1
2662
2924
  }, 8, ["size"])
2663
2925
  ]),
2664
- default: b(() => [
2665
- M("div", xo, [
2666
- D(r(T), {
2926
+ default: p(() => [
2927
+ R("div", Po, [
2928
+ F(l(N), {
2667
2929
  type: "warning",
2668
- loading: r(n).export.loading,
2930
+ loading: l(n).export.loading,
2669
2931
  size: e.option.size?.search
2670
2932
  }, {
2671
- default: b(() => [
2672
- $(O(r(w).tCurd("export")), 1)
2933
+ default: p(() => [
2934
+ M(U(l(C).tCurd("export")), 1)
2673
2935
  ]),
2674
2936
  _: 1
2675
2937
  }, 8, ["loading", "size"])
2676
2938
  ])
2677
2939
  ]),
2678
2940
  _: 1
2679
- }, 8, ["onCommand"])) : (s(), y("div", Vo, [
2680
- D(r(T), {
2941
+ }, 8, ["onCommand"])) : (g(), v("div", Io, [
2942
+ F(l(N), {
2681
2943
  type: "warning",
2682
- loading: r(n).export.loading,
2944
+ loading: l(n).export.loading,
2683
2945
  size: e.option.size?.search,
2684
- onClick: m[3] || (m[3] = (g) => r(n).export.run.start("all"))
2946
+ onClick: i[3] || (i[3] = (m) => l(n).export.run.start("all"))
2685
2947
  }, {
2686
- default: b(() => [
2687
- $(O(r(w).tCurd("export")), 1)
2948
+ default: p(() => [
2949
+ M(U(l(C).tCurd("export")), 1)
2688
2950
  ]),
2689
2951
  _: 1
2690
2952
  }, 8, ["loading", "size"])
2691
2953
  ]))
2692
- ], 64)) : v("", !0),
2693
- x(u.$slots, "tools-left")
2954
+ ], 64)) : V("", !0),
2955
+ S(u.$slots, "tools-left")
2694
2956
  ]),
2695
- M("div", So, [
2696
- x(u.$slots, "tools-right"),
2697
- r(n).page.showTools ? (s(), h(r(ke), k({
2957
+ R("div", No, [
2958
+ S(u.$slots, "tools-right"),
2959
+ l(n).page.showTools ? (g(), b(l(Oe), x({
2698
2960
  key: 0,
2699
- "current-page": r(n).page.num,
2700
- "onUpdate:currentPage": m[4] || (m[4] = (g) => r(n).page.num = g),
2701
- "page-size": r(n).page.size,
2702
- "onUpdate:pageSize": m[5] || (m[5] = (g) => r(n).page.size = g),
2961
+ "current-page": l(n).page.num,
2962
+ "onUpdate:currentPage": i[4] || (i[4] = (m) => l(n).page.num = m),
2963
+ "page-size": l(n).page.size,
2964
+ "onUpdate:pageSize": i[5] || (i[5] = (m) => l(n).page.size = m),
2703
2965
  background: "",
2704
- "page-sizes": r(n).page.sizeList,
2705
- "pager-count": r(n).page.pagerCount,
2706
- layout: r(n).page.layout,
2707
- total: r(n).page.total,
2966
+ "page-sizes": l(n).page.sizeList,
2967
+ "pager-count": l(n).page.pagerCount,
2968
+ layout: l(n).page.layout,
2969
+ total: l(n).page.total,
2708
2970
  size: e.option.size?.table,
2709
- onSizeChange: r(n).table.getList,
2710
- onCurrentChange: r(n).table.getList
2711
- }, e.option.page?.pagination || {}, V(e.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : v("", !0),
2712
- e.option.tools?.expandColumn === void 0 || e.option.tools?.expandColumn ? (s(), h(p, {
2971
+ onSizeChange: l(n).table.getList,
2972
+ onCurrentChange: l(n).table.getList
2973
+ }, e.option.page?.pagination || {}, E(e.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : V("", !0),
2974
+ e.option.tools?.expandColumn === void 0 || e.option.tools?.expandColumn ? (g(), b(h, {
2713
2975
  key: 1,
2714
2976
  effect: "dark",
2715
- content: r(n).table.header.group.expand ? r(w).tCurd("mergeColumn") : r(w).tCurd("expandColumn"),
2977
+ content: l(n).table.header.group.expand ? l(C).tCurd("mergeColumn") : l(C).tCurd("expandColumn"),
2716
2978
  placement: "top"
2717
2979
  }, {
2718
- default: b(() => [
2719
- M("div", {
2720
- class: I(["refresh-btn", [e.option.size?.search]]),
2721
- onClick: m[6] || (m[6] = //@ts-ignore
2722
- (...g) => r(n).table.header.group.toggleExpandAll && r(n).table.header.group.toggleExpandAll(...g))
2980
+ default: p(() => [
2981
+ R("div", {
2982
+ class: J(["refresh-btn", [e.option.size?.search]]),
2983
+ onClick: i[6] || (i[6] = //@ts-ignore
2984
+ (...m) => l(n).table.header.group.toggleExpandAll && l(n).table.header.group.toggleExpandAll(...m))
2723
2985
  }, [
2724
- r(n).table.header.group.expand ? (s(), h(Kt, { key: 0 })) : (s(), h(Wt, { key: 1 }))
2986
+ l(n).table.header.group.expand ? (g(), b(no, { key: 0 })) : (g(), b(so, { key: 1 }))
2725
2987
  ], 2)
2726
2988
  ]),
2727
2989
  _: 1
2728
- }, 8, ["content"])) : v("", !0),
2729
- e.option.tools?.refresh === void 0 || e.option.tools?.refresh ? (s(), y("div", {
2990
+ }, 8, ["content"])) : V("", !0),
2991
+ e.option.tools?.refresh === void 0 || e.option.tools?.refresh ? (g(), v("div", {
2730
2992
  key: 2,
2731
- class: I(["refresh-btn", [e.option.size?.search]]),
2732
- onClick: m[7] || (m[7] = //@ts-ignore
2733
- (...g) => r(n).table.getList && r(n).table.getList(...g))
2993
+ class: J(["refresh-btn", [e.option.size?.search]]),
2994
+ onClick: i[7] || (i[7] = //@ts-ignore
2995
+ (...m) => l(n).table.getList && l(n).table.getList(...m))
2734
2996
  }, [
2735
- D(Xt)
2736
- ], 2)) : v("", !0)
2997
+ F(mo)
2998
+ ], 2)) : V("", !0)
2737
2999
  ])
2738
3000
  ]),
2739
- M("div", {
2740
- class: I(["fit-width relative form-box", [e.option.table?.fitHeight ? "col " : "", e.option.table?.editMode ? "edit-mode" : ""]])
3001
+ R("div", {
3002
+ class: J(["fit-width relative form-box", [e.option.table?.fitHeight ? "col " : "", e.option.table?.editMode ? "edit-mode" : ""]])
2741
3003
  }, [
2742
- M("div", {
2743
- class: I(["column form-box-content", [e.option.table?.fitHeight ? "absolute fit" : ""]])
3004
+ R("div", {
3005
+ class: J(["column form-box-content", [e.option.table?.fitHeight ? "absolute fit" : ""]])
2744
3006
  }, [
2745
- nt((s(), h(r(_e), k({
3007
+ yt((g(), b(l(ft), x({
2746
3008
  ref_key: "tableRef",
2747
3009
  ref: c,
2748
- data: r(n).table.data,
3010
+ data: l(n).table.data,
2749
3011
  border: e.option.table?.border === void 0 ? !0 : e.option.table?.border,
2750
- onSelectionChange: r(n).table.selection.change,
2751
- onSortChange: r(n).table.sort.change,
2752
- "expand-row-keys": r(n).table.expand.rowKeys,
2753
- onExpandChange: r(n).table.expand.change
2754
- }, e.option.table, V(e.option.table?.on || {})), {
2755
- default: b(() => [
2756
- (typeof e.option.table?.selectable == "object" ? e.option.table?.selectable?.show : e.option.table?.selectable) || r(i)(e.option.tools?.delete) || e.option.tools?.export?.show && e.option.tools?.export?.select ? (s(), h(r(ue), k({
3012
+ onSelectionChange: l(n).table.selection.change,
3013
+ onSortChange: l(n).table.sort.change,
3014
+ "expand-row-keys": l(n).table.expand.rowKeys,
3015
+ onExpandChange: l(n).table.expand.change
3016
+ }, e.option.table, E(e.option.table?.on || {})), {
3017
+ default: p(() => [
3018
+ (typeof e.option.table?.selectable == "object" ? e.option.table?.selectable?.show : e.option.table?.selectable) || l(r)(e.option.tools?.delete) || e.option.tools?.export?.show && e.option.tools?.export?.select ? (g(), b(l(ye), x({
2757
3019
  key: 0,
2758
3020
  type: "selection",
2759
3021
  width: "40",
@@ -2761,8 +3023,8 @@ const so = /* @__PURE__ */ oe(lo, [["render", ro]]), uo = { class: "row flex-cen
2761
3023
  fixed: "left",
2762
3024
  "show-overflow-tooltip": !1,
2763
3025
  className: "cc1-form-selectable-column"
2764
- }, typeof e.option.table?.selectable == "object" ? e.option.table?.selectable : {}, V(typeof e.option.table?.selectable == "object" ? e.option.table?.selectable?.on || {} : {})), null, 16)) : v("", !0),
2765
- (typeof e.option.table?.index == "object" ? e.option.table?.index?.show : e.option.table?.index) ? (s(), h(r(ue), k({
3026
+ }, typeof e.option.table?.selectable == "object" ? e.option.table?.selectable : {}, E(typeof e.option.table?.selectable == "object" ? e.option.table?.selectable?.on || {} : {})), null, 16)) : V("", !0),
3027
+ (typeof e.option.table?.index == "object" ? e.option.table?.index?.show : e.option.table?.index) ? (g(), b(l(ye), x({
2766
3028
  key: 1,
2767
3029
  type: "index",
2768
3030
  fixed: "left",
@@ -2771,20 +3033,20 @@ const so = /* @__PURE__ */ oe(lo, [["render", ro]]), uo = { class: "row flex-cen
2771
3033
  label: "#",
2772
3034
  "show-overflow-tooltip": !1,
2773
3035
  className: "cc1-form-index-column"
2774
- }, typeof e.option.table?.index == "object" ? e.option.table?.index : {}, V(typeof e.option.table?.index == "object" ? e.option.table?.index?.on || {} : {})), null, 16)) : v("", !0),
2775
- D(bo, {
2776
- conf: r(n),
2777
- columnList: r(n).table.column.list,
3036
+ }, typeof e.option.table?.index == "object" ? e.option.table?.index : {}, E(typeof e.option.table?.index == "object" ? e.option.table?.index?.on || {} : {})), null, 16)) : V("", !0),
3037
+ F(Uo, {
3038
+ conf: l(n),
3039
+ columnList: l(n).table.column.list,
2778
3040
  option: e.option
2779
- }, J({ _: 2 }, [
2780
- L(u.$slots, (g, C) => ({
2781
- name: C,
2782
- fn: b((H) => [
2783
- x(u.$slots, C, pe(we(H || {})))
3041
+ }, X({ _: 2 }, [
3042
+ G(u.$slots, (m, w) => ({
3043
+ name: w,
3044
+ fn: p((D) => [
3045
+ S(u.$slots, w, $e(ze(D || {})))
2784
3046
  ])
2785
3047
  }))
2786
3048
  ]), 1032, ["conf", "columnList", "option"]),
2787
- r(i)(e.option.table?.add) || r(i)(e.option.table?.update) || r(i)(e.option.table?.delete) || r(i)(e.option.table?.view) || u.$slots["table-op-left"] || u.$slots["table-op-right"] ? (s(), h(r(ue), k({
3049
+ l(r)(e.option.table?.add) || l(r)(e.option.table?.update) || l(r)(e.option.table?.delete) || l(r)(e.option.table?.view) || u.$slots["table-op-left"] || u.$slots["table-op-right"] ? (g(), b(l(ye), x({
2788
3050
  key: 2,
2789
3051
  align: "center",
2790
3052
  fixed: "right"
@@ -2792,229 +3054,229 @@ const so = /* @__PURE__ */ oe(lo, [["render", ro]]), uo = { class: "row flex-cen
2792
3054
  width: e.option.table?.operate?.width || 120,
2793
3055
  "show-overflow-tooltip": !1
2794
3056
  }), {
2795
- header: b(() => [
2796
- x(u.$slots, "table-header-op", {}, () => [
2797
- $(O(r(w).tCurd("operation")), 1)
3057
+ header: p(() => [
3058
+ S(u.$slots, "table-header-op", {}, () => [
3059
+ M(U(l(C).tCurd("operation")), 1)
2798
3060
  ])
2799
3061
  ]),
2800
- default: b(({ row: g }) => [
2801
- D(r(Y), {
3062
+ default: p(({ row: m }) => [
3063
+ F(l(oe), {
2802
3064
  size: e.option.size?.table
2803
3065
  }, {
2804
- default: b(() => [
2805
- x(u.$slots, "table-op-left", { row: g }),
2806
- r(n).update.type === r(l).Update && e.option.table?.inlineEdit && r(n).update.form[t.option.table?.rowKey] === g[t.option.table?.rowKey] ? (s(), y(F, { key: 0 }, [
2807
- D(r(T), {
3066
+ default: p(() => [
3067
+ S(u.$slots, "table-op-left", { row: m }),
3068
+ l(n).update.type === l(a).Update && e.option.table?.inlineEdit && l(n).update.form[t.option.table?.rowKey] === m[t.option.table?.rowKey] ? (g(), v(B, { key: 0 }, [
3069
+ F(l(N), {
2808
3070
  link: "",
2809
3071
  type: "info",
2810
- onClick: r(n).update.close
3072
+ onClick: l(n).update.close
2811
3073
  }, {
2812
- default: b(() => [
2813
- $(O(r(w).tCurd("cancel")), 1)
3074
+ default: p(() => [
3075
+ M(U(l(C).tCurd("cancel")), 1)
2814
3076
  ]),
2815
3077
  _: 1
2816
3078
  }, 8, ["onClick"]),
2817
- D(r(T), {
3079
+ F(l(N), {
2818
3080
  link: "",
2819
3081
  type: "primary",
2820
- onClick: r(n).update.submit,
2821
- loading: r(n).update.loading
3082
+ onClick: l(n).update.submit,
3083
+ loading: l(n).update.loading
2822
3084
  }, {
2823
- default: b(() => [
2824
- $(O(r(w).tCurd("confirm")), 1)
3085
+ default: p(() => [
3086
+ M(U(l(C).tCurd("confirm")), 1)
2825
3087
  ]),
2826
3088
  _: 1
2827
3089
  }, 8, ["onClick", "loading"]),
2828
- x(u.$slots, "table-op-edit-right", { row: g })
2829
- ], 64)) : (s(), y(F, { key: 1 }, [
2830
- r(i)(e.option.table?.add, g) ? (s(), h(r(T), {
3090
+ S(u.$slots, "table-op-edit-right", { row: m })
3091
+ ], 64)) : (g(), v(B, { key: 1 }, [
3092
+ l(r)(e.option.table?.add, m) ? (g(), b(l(N), {
2831
3093
  key: 0,
2832
3094
  link: "",
2833
3095
  type: "primary",
2834
- onClick: (C) => r(n).update.open(r(l).Add, g)
3096
+ onClick: (w) => l(n).update.open(l(a).Add, m)
2835
3097
  }, {
2836
- default: b(() => [
2837
- $(O(r(w).tCurd("add")), 1)
3098
+ default: p(() => [
3099
+ M(U(l(C).tCurd("add")), 1)
2838
3100
  ]),
2839
3101
  _: 1
2840
- }, 8, ["onClick"])) : v("", !0),
2841
- r(i)(e.option.table?.view, g) ? (s(), h(r(T), {
3102
+ }, 8, ["onClick"])) : V("", !0),
3103
+ l(r)(e.option.table?.view, m) ? (g(), b(l(N), {
2842
3104
  key: 1,
2843
3105
  link: "",
2844
3106
  type: "primary",
2845
- onClick: (C) => r(n).update.open(r(l).View, g)
3107
+ onClick: (w) => l(n).update.open(l(a).View, m)
2846
3108
  }, {
2847
- default: b(() => [
2848
- $(O(r(w).tCurd("view")), 1)
3109
+ default: p(() => [
3110
+ M(U(l(C).tCurd("view")), 1)
2849
3111
  ]),
2850
3112
  _: 1
2851
- }, 8, ["onClick"])) : v("", !0),
2852
- r(i)(e.option.table?.update, g) ? (s(), h(r(T), {
3113
+ }, 8, ["onClick"])) : V("", !0),
3114
+ l(r)(e.option.table?.update, m) ? (g(), b(l(N), {
2853
3115
  key: 2,
2854
3116
  link: "",
2855
3117
  type: "warning",
2856
- onClick: (C) => r(n).update.open(r(l).Update, g)
3118
+ onClick: (w) => l(n).update.open(l(a).Update, m)
2857
3119
  }, {
2858
- default: b(() => [
2859
- $(O(r(w).tCurd("edit")), 1)
3120
+ default: p(() => [
3121
+ M(U(l(C).tCurd("edit")), 1)
2860
3122
  ]),
2861
3123
  _: 1
2862
- }, 8, ["onClick"])) : v("", !0),
2863
- r(i)(e.option.table?.delete, g) ? (s(), h(r(T), {
3124
+ }, 8, ["onClick"])) : V("", !0),
3125
+ l(r)(e.option.table?.delete, m) ? (g(), b(l(N), {
2864
3126
  key: 3,
2865
3127
  link: "",
2866
3128
  type: "danger",
2867
- onClick: (C) => r(n).remove.open([g])
3129
+ onClick: (w) => l(n).remove.open([m])
2868
3130
  }, {
2869
- default: b(() => [
2870
- $(O(r(w).tCurd("delete")), 1)
3131
+ default: p(() => [
3132
+ M(U(l(C).tCurd("delete")), 1)
2871
3133
  ]),
2872
3134
  _: 1
2873
- }, 8, ["onClick"])) : v("", !0),
2874
- x(u.$slots, "table-op-right", { row: g })
3135
+ }, 8, ["onClick"])) : V("", !0),
3136
+ S(u.$slots, "table-op-right", { row: m })
2875
3137
  ], 64))
2876
3138
  ]),
2877
3139
  _: 2
2878
3140
  }, 1032, ["size"])
2879
3141
  ]),
2880
3142
  _: 3
2881
- }, 16, ["width"])) : v("", !0)
3143
+ }, 16, ["width"])) : V("", !0)
2882
3144
  ]),
2883
3145
  _: 3
2884
3146
  }, 16, ["data", "border", "onSelectionChange", "onSortChange", "expand-row-keys", "onExpandChange"])), [
2885
- [f, r(n).table.loading]
3147
+ [f, l(n).table.loading]
2886
3148
  ])
2887
3149
  ], 2)
2888
3150
  ], 2),
2889
- M("div", zo, [
2890
- (e.option.page?.show === void 0 || e.option.page?.show) && !r(n).page.showTools ? (s(), h(r(ke), k({
3151
+ R("div", Go, [
3152
+ (e.option.page?.show === void 0 || e.option.page?.show) && !l(n).page.showTools ? (g(), b(l(Oe), x({
2891
3153
  key: 0,
2892
- "current-page": r(n).page.num,
2893
- "onUpdate:currentPage": m[8] || (m[8] = (g) => r(n).page.num = g),
2894
- "page-size": r(n).page.size,
2895
- "onUpdate:pageSize": m[9] || (m[9] = (g) => r(n).page.size = g),
3154
+ "current-page": l(n).page.num,
3155
+ "onUpdate:currentPage": i[8] || (i[8] = (m) => l(n).page.num = m),
3156
+ "page-size": l(n).page.size,
3157
+ "onUpdate:pageSize": i[9] || (i[9] = (m) => l(n).page.size = m),
2896
3158
  background: "",
2897
- "page-sizes": r(n).page.sizeList,
2898
- "pager-count": r(n).page.pagerCount,
2899
- layout: r(n).page.layout,
2900
- total: r(n).page.total,
3159
+ "page-sizes": l(n).page.sizeList,
3160
+ "pager-count": l(n).page.pagerCount,
3161
+ layout: l(n).page.layout,
3162
+ total: l(n).page.total,
2901
3163
  size: e.option.size?.table,
2902
- onSizeChange: r(n).table.getList,
2903
- onCurrentChange: r(n).table.getList
2904
- }, e.option.page?.pagination || {}, V(e.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : v("", !0)
3164
+ onSizeChange: l(n).table.getList,
3165
+ onCurrentChange: l(n).table.getList
3166
+ }, e.option.page?.pagination || {}, E(e.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : V("", !0)
2905
3167
  ])
2906
3168
  ], 2),
2907
- x(u.$slots, "box-right")
3169
+ S(u.$slots, "box-right")
2908
3170
  ], 2),
2909
- D(r(ye), k({
2910
- modelValue: r(n).update.show,
2911
- "onUpdate:modelValue": m[10] || (m[10] = (g) => r(n).update.show = g),
2912
- title: r(n).update.title,
2913
- "before-close": r(n).update.close
3171
+ F(l(Ee), x({
3172
+ modelValue: l(n).update.show,
3173
+ "onUpdate:modelValue": i[10] || (i[10] = (m) => l(n).update.show = m),
3174
+ title: l(n).update.title,
3175
+ "before-close": l(n).update.close
2914
3176
  }, e.option.dialog), {
2915
- footer: b(() => [
2916
- M("span", $o, [
2917
- D(r(Y), {
3177
+ footer: p(() => [
3178
+ R("span", Ho, [
3179
+ F(l(oe), {
2918
3180
  size: e.option.size?.form
2919
3181
  }, {
2920
- default: b(() => [
2921
- x(u.$slots, "dialog-footer", {
2922
- row: r(n).update
3182
+ default: p(() => [
3183
+ S(u.$slots, "dialog-footer", {
3184
+ row: l(n).update
2923
3185
  }, () => [
2924
- D(r(T), {
2925
- onClick: r(n).update.close
3186
+ F(l(N), {
3187
+ onClick: l(n).update.close
2926
3188
  }, {
2927
- default: b(() => [
2928
- $(O(r(w).tCurd("close")), 1)
3189
+ default: p(() => [
3190
+ M(U(l(C).tCurd("close")), 1)
2929
3191
  ]),
2930
3192
  _: 1
2931
3193
  }, 8, ["onClick"]),
2932
- r(n).update.type !== r(l).View ? (s(), h(r(T), {
3194
+ l(n).update.type !== l(a).View ? (g(), b(l(N), {
2933
3195
  key: 0,
2934
3196
  type: "primary",
2935
- onClick: r(n).update.submit,
2936
- loading: r(n).update.loading
3197
+ onClick: l(n).update.submit,
3198
+ loading: l(n).update.loading
2937
3199
  }, {
2938
- default: b(() => [
2939
- $(O(r(w).tCurd("submit")), 1)
3200
+ default: p(() => [
3201
+ M(U(l(C).tCurd("submit")), 1)
2940
3202
  ]),
2941
3203
  _: 1
2942
- }, 8, ["onClick", "loading"])) : v("", !0)
3204
+ }, 8, ["onClick", "loading"])) : V("", !0)
2943
3205
  ])
2944
3206
  ]),
2945
3207
  _: 3
2946
3208
  }, 8, ["size"])
2947
3209
  ])
2948
3210
  ]),
2949
- default: b(() => [
2950
- x(u.$slots, "dialog-start", {
2951
- row: r(n).update
3211
+ default: p(() => [
3212
+ S(u.$slots, "dialog-start", {
3213
+ row: l(n).update
2952
3214
  }),
2953
- D(r(Y), {
3215
+ F(l(oe), {
2954
3216
  ref_key: "ruleFormRef",
2955
3217
  ref: d,
2956
- model: r(n).update.form,
2957
- rules: r(n).update.rules,
3218
+ model: l(n).update.form,
3219
+ rules: l(n).update.rules,
2958
3220
  size: e.option.size?.form,
2959
3221
  class: "update-dialog-form"
2960
3222
  }, {
2961
- default: b(() => [
2962
- r(n).update.showContent ? (s(), h(Le, {
3223
+ default: p(() => [
3224
+ l(n).update.showContent ? (g(), b(_e, {
2963
3225
  key: 0,
2964
- "form-grid": r(n).update.formGrid,
2965
- "max-span": r(n).update.formMaxSpan,
2966
- form: r(n).update.form,
2967
- type: r(n).update.type,
3226
+ "form-grid": l(n).update.formGrid,
3227
+ "max-span": l(n).update.formMaxSpan,
3228
+ form: l(n).update.form,
3229
+ type: l(n).update.type,
2968
3230
  stripe: e.option.form?.stripe,
2969
3231
  "label-width": e.option.form?.labelWidth,
2970
3232
  "form-option": e.option.form,
2971
- "get-bind": r(n).update.getBind,
2972
- "get-on": r(n).update.getOn,
2973
- "get-disabled": r(n).update.getDisabled
2974
- }, J({ _: 2 }, [
2975
- L(u.$slots, (g, C) => ({
2976
- name: C,
2977
- fn: b((H) => [
2978
- x(u.$slots, C, pe(we(H || {})))
3233
+ "get-bind": l(n).update.getBind,
3234
+ "get-on": l(n).update.getOn,
3235
+ "get-disabled": l(n).update.getDisabled
3236
+ }, X({ _: 2 }, [
3237
+ G(u.$slots, (m, w) => ({
3238
+ name: w,
3239
+ fn: p((D) => [
3240
+ S(u.$slots, w, $e(ze(D || {})))
2979
3241
  ])
2980
3242
  }))
2981
- ]), 1032, ["form-grid", "max-span", "form", "type", "stripe", "label-width", "form-option", "get-bind", "get-on", "get-disabled"])) : v("", !0)
3243
+ ]), 1032, ["form-grid", "max-span", "form", "type", "stripe", "label-width", "form-option", "get-bind", "get-on", "get-disabled"])) : V("", !0)
2982
3244
  ]),
2983
3245
  _: 3
2984
3246
  }, 8, ["model", "rules", "size"]),
2985
- x(u.$slots, "dialog-end", {
2986
- row: r(n).update
3247
+ S(u.$slots, "dialog-end", {
3248
+ row: l(n).update
2987
3249
  })
2988
3250
  ]),
2989
3251
  _: 3
2990
3252
  }, 16, ["modelValue", "title", "before-close"]),
2991
- D(r(ye), {
2992
- modelValue: r(n).remove.show,
2993
- "onUpdate:modelValue": m[11] || (m[11] = (g) => r(n).remove.show = g),
2994
- title: r(n).remove.title,
3253
+ F(l(Ee), {
3254
+ modelValue: l(n).remove.show,
3255
+ "onUpdate:modelValue": i[11] || (i[11] = (m) => l(n).remove.show = m),
3256
+ title: l(n).remove.title,
2995
3257
  "close-on-click-modal": !1
2996
3258
  }, {
2997
- footer: b(() => [
2998
- M("span", Oo, [
2999
- D(r(Y), {
3259
+ footer: p(() => [
3260
+ R("span", qo, [
3261
+ F(l(oe), {
3000
3262
  size: e.option.size?.form
3001
3263
  }, {
3002
- default: b(() => [
3003
- D(r(T), {
3004
- onClick: r(n).remove.close
3264
+ default: p(() => [
3265
+ F(l(N), {
3266
+ onClick: l(n).remove.close
3005
3267
  }, {
3006
- default: b(() => [
3007
- $(O(r(w).tCurd("close")), 1)
3268
+ default: p(() => [
3269
+ M(U(l(C).tCurd("close")), 1)
3008
3270
  ]),
3009
3271
  _: 1
3010
3272
  }, 8, ["onClick"]),
3011
- D(r(T), {
3273
+ F(l(N), {
3012
3274
  type: "danger",
3013
- onClick: r(n).remove.submit,
3014
- loading: r(n).remove.loading
3275
+ onClick: l(n).remove.submit,
3276
+ loading: l(n).remove.loading
3015
3277
  }, {
3016
- default: b(() => [
3017
- $(O(r(w).tCurd("confirmDelete")), 1)
3278
+ default: p(() => [
3279
+ M(U(l(C).tCurd("confirmDelete")), 1)
3018
3280
  ]),
3019
3281
  _: 1
3020
3282
  }, 8, ["onClick", "loading"])
@@ -3023,90 +3285,90 @@ const so = /* @__PURE__ */ oe(lo, [["render", ro]]), uo = { class: "row flex-cen
3023
3285
  }, 8, ["size"])
3024
3286
  ])
3025
3287
  ]),
3026
- default: b(() => [
3027
- e.option.dialog?.delete?.content ? (s(), y("div", Eo, [
3028
- D(Lt, {
3288
+ default: p(() => [
3289
+ e.option.dialog?.delete?.content ? (g(), v("div", Wo, [
3290
+ F(eo, {
3029
3291
  content: e.option.dialog?.delete?.content,
3030
- value: r(n).remove.items
3292
+ value: l(n).remove.items
3031
3293
  }, null, 8, ["content", "value"])
3032
- ])) : (s(), y("div", Do, O(r(w).tCurd("confirmDeleteMessage", r(n).remove.items.length)), 1))
3294
+ ])) : (g(), v("div", Jo, U(l(C).tCurd("confirmDeleteMessage", l(n).remove.items.length)), 1))
3033
3295
  ]),
3034
3296
  _: 1
3035
3297
  }, 8, ["modelValue", "title"]),
3036
- D(Rt, {
3298
+ F(Zt, {
3037
3299
  ref_key: "switchConfirmRef",
3038
- ref: o,
3300
+ ref: s,
3039
3301
  size: e.option.size?.form
3040
3302
  }, null, 8, ["size"])
3041
3303
  ], 2);
3042
3304
  };
3043
3305
  }
3044
3306
  });
3045
- class To {
3307
+ class ta {
3046
3308
  /**
3047
3309
  * 通过远程 URL 下载文件,自动创建临时 `<a>` 标签触发浏览器下载
3048
3310
  *
3049
3311
  * @param href - 文件的远程地址
3050
3312
  * @param name - 下载后的文件名,默认 `'download.png'`
3051
3313
  */
3052
- static async download(a, l = "download.png") {
3314
+ static async download(o, a = "download.png") {
3053
3315
  const t = document.createElement("a");
3054
- t.style.display = "none", t.href = a, t.setAttribute("download", l), typeof t.download > "u" && t.setAttribute("target", "_blank"), document.body.appendChild(t), t.click(), document.body.removeChild(t), window.URL.revokeObjectURL(a);
3316
+ t.style.display = "none", t.href = o, t.setAttribute("download", a), typeof t.download > "u" && t.setAttribute("target", "_blank"), document.body.appendChild(t), t.click(), document.body.removeChild(t), window.URL.revokeObjectURL(o);
3055
3317
  }
3056
3318
  /**
3057
3319
  * 将json对象或者json数组导出为json文件保存
3058
3320
  * @param data
3059
3321
  * @param name
3060
3322
  */
3061
- static exportJSONFile = (a, l) => {
3062
- const t = new Blob([JSON.stringify(a)], { type: "application/json" }), i = URL.createObjectURL(t), n = document.createElement("a");
3063
- n.href = i, n.download = `${l || "config"}.json`, n.click();
3323
+ static exportJSONFile = (o, a) => {
3324
+ const t = new Blob([JSON.stringify(o)], { type: "application/json" }), r = URL.createObjectURL(t), n = document.createElement("a");
3325
+ n.href = r, n.download = `${a || "config"}.json`, n.click();
3064
3326
  };
3065
3327
  /**
3066
3328
  * 导入文件内容,默认为json
3067
3329
  * @param param
3068
3330
  * @returns
3069
3331
  */
3070
- static importFile = async (a) => new Promise((l, t) => {
3071
- const i = document.createElement("input");
3072
- i.type = "file";
3073
- const n = a?.accept || ".json";
3074
- i.accept = n, i.style.display = "none", i.onchange = (o) => {
3075
- const d = o.target.files[0];
3332
+ static importFile = async (o) => new Promise((a, t) => {
3333
+ const r = document.createElement("input");
3334
+ r.type = "file";
3335
+ const n = o?.accept || ".json";
3336
+ r.accept = n, r.style.display = "none", r.onchange = (s) => {
3337
+ const d = s.target.files[0];
3076
3338
  if (!d) {
3077
- z.fail("未选择文件"), t("未选择文件");
3339
+ $.fail("未选择文件"), t("未选择文件");
3078
3340
  return;
3079
3341
  }
3080
3342
  const c = new FileReader();
3081
3343
  c.onload = async (u) => {
3082
- const m = n == ".json" ? JSON.parse(u.target.result) : u.target.result;
3083
- l(m);
3344
+ const i = n == ".json" ? JSON.parse(u.target.result) : u.target.result;
3345
+ a(i);
3084
3346
  }, c.onerror = () => {
3085
- z.fail("文件读取失败"), t("文件读取失败");
3086
- }, c.readAsText(d), document.body.removeChild(i);
3087
- }, document.body.appendChild(i), i.click();
3347
+ $.fail("文件读取失败"), t("文件读取失败");
3348
+ }, c.readAsText(d), document.body.removeChild(r);
3349
+ }, document.body.appendChild(r), r.click();
3088
3350
  });
3089
3351
  }
3090
- const Fo = (e, a) => {
3091
- if (e.component("TCurd", Mo), e.component("TFormList", Ee), e.component("TColumn", St), a?.customComponent) {
3092
- P.customComponent = a.customComponent;
3093
- for (const l in a.customComponent)
3094
- e.component(l, a.customComponent[l]);
3352
+ const Xo = (e, o) => {
3353
+ if (e.component("TCurd", Qo), e.component("TFormList", Ke), e.component("TColumn", Tt), o?.customComponent) {
3354
+ W.customComponent = o.customComponent;
3355
+ for (const a in o.customComponent)
3356
+ e.component(a, o.customComponent[a]);
3095
3357
  }
3096
- }, Lo = {
3097
- install: Fo
3358
+ }, oa = {
3359
+ install: Xo
3098
3360
  };
3099
3361
  export {
3100
- W as ArrUtil,
3101
- Ot as ExcelUtil,
3102
- St as TColumn,
3103
- Mo as TCurd,
3104
- To as TFile,
3105
- P as TForm,
3106
- U as TFormConfig,
3107
- w as TFormI18n,
3108
- Ee as TFormList,
3109
- z as TSys,
3110
- Lo as default,
3111
- Fo as install
3362
+ Q as ArrUtil,
3363
+ Wt as ExcelUtil,
3364
+ Tt as TColumn,
3365
+ Qo as TCurd,
3366
+ ta as TFile,
3367
+ W as TForm,
3368
+ T as TFormConfig,
3369
+ C as TFormI18n,
3370
+ Ke as TFormList,
3371
+ $ as TSys,
3372
+ oa as default,
3373
+ Xo as install
3112
3374
  };