cc1-form 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cc1-form.js CHANGED
@@ -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 Xe, ElLoading as Ye, ElFormItem as he, ElInput as se, ElInputNumber as Ze, ElSwitch as me, ElSelect as de, ElOption as ae, ElRadioGroup as Fe, ElRadioButton as _e, ElRadio as De, ElCheckboxGroup as et, ElCheckboxButton as tt, ElCheckbox as ot, ElColorPicker as at, ElSlider as nt, ElTreeSelect as lt, ElDatePicker as Oe, ElForm as te, ElDialog as xe, ElButton as I, ElTableColumn as ge, ElDropdown as it, ElDropdownMenu as rt, ElDropdownItem as Ce, ElPagination as ze, ElTable as st } 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 le, onMounted as Re, resolveComponent as ue, openBlock as m, createElementBlock as v, renderSlot as S, createVNode as F, withCtx as p, createTextVNode as M, createCommentVNode as V, Fragment as B, renderList as N, createBlock as y, normalizeClass as J, normalizeStyle as be, unref as i, createElementVNode as O, mergeProps as x, toHandlers as E, createSlots as X, toDisplayString as R, resolveDynamicComponent as ee, computed as oe, ref as _, onUnmounted as Ue, watch as dt, normalizeProps as Ve, guardReactiveProps as Se, getCurrentInstance as Ae, withModifiers as ut, resolveDirective as ct, withDirectives as ft } from "vue";
4
+ import { Scope as Ee } 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, ...n) => Array.isArray(o) ? o.some((t) => typeof t == "function" ? t(...n) : t) : typeof o == "function" ? o(...n) : 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 || {}, n = this.router.currentRoute.value.params || {};
36
+ return Object.keys(o).length ? o : Object.keys(n).length ? n : {};
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 n = await $.moduleObj[o]();
50
+ return n.default ?? n;
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;
70
- const n = Object.assign(
66
+ static showMessage(o, n, t = {}) {
67
+ const l = Date.now();
68
+ if (!this.tipMessages[o] || l - this.tipMessages[o] > this.tipMessagesGap) {
69
+ this.tipMessages[o] = l;
70
+ const a = Object.assign(
71
71
  {
72
- message: a,
73
- type: l
72
+ message: o,
73
+ type: n
74
74
  },
75
75
  t
76
76
  );
77
- Ke(n), setTimeout(() => {
78
- delete this.tipMessages[a];
77
+ Xe(a), 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, n = {}) => {
88
+ this.showMessage(o, "error", n);
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, n = {}) => {
96
+ this.showMessage(o, "success", n);
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, n = "Loading...") => {
106
106
  Timer.un(this.loadingTimer), this.loadingTimer = Timer.once(() => {
107
- a ? this.loadingObj = He.service({
107
+ o ? this.loadingObj = Ye.service({
108
108
  lock: !0,
109
- text: l,
109
+ text: n,
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, n = !0) => {
120
+ if (n) {
121
+ let t = screen.width / 2 - 500, l = 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=" + l + ", 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 (n, t) => {
136
+ let l = document.getElementById(o.id);
137
+ const a = await $.loadModule("html2canvas");
138
138
  try {
139
- n(i, {
139
+ a(l, {
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
+ n(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, n) => {
546
+ const t = o.column.find((a) => a.key === n), l = (a) => a.replace(/-([a-z])/g, (s, d) => d.toUpperCase());
547
547
  if (t)
548
- return t.options[i(t.type)];
548
+ return t.options[l(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, n, t) => {
567
+ const l = W.findOptions(o, n);
568
+ l && (l.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, n, t, l) => {
580
+ const a = T.config.table.rowKey;
581
+ o ? n.type === $.EDialog.Add ? (n.form.parentId = o[a], n.form.sort = o.children.length + 1) : n.form.parentId = o.parentId.substring(o.parentId.lastIndexOf(",") + 1) : (n.form.parentId = "0", n.form.sort = t.length + 1), W.setOptionsData(l, "parentId", [{ [a]: "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, n, t) => {
597
+ n[o] || (n[o] = []);
598
+ const l = T.config.table.rowKey;
599
+ n[o].forEach((a) => {
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()), a[s.value] === void 0 && (a[s.value] = d);
603
+ }), a[l] || (a[l] = 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) => {
614
- const n = JSONUtil.cp(t);
615
- W.setId(a, l, t);
616
- const o = U.config.table.rowKey;
617
- l[a].push(
618
- n.reduce(
619
- (d, c) => {
620
- let u = c.default ?? "";
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;
613
+ static add = (o, n, t, l) => {
614
+ const a = JSONUtil.cp(t);
615
+ Q.setId(o, n, t);
616
+ const s = T.config.table.rowKey;
617
+ n[o].push(
618
+ a.reduce(
619
+ (d, g) => {
620
+ let u = g.default ?? "";
621
+ return g.type === "number" && (u = g.default ?? 0), g.type === "boolean" && (u = g.default ?? !1), g.type === "time" && (u = g.default ?? /* @__PURE__ */ new Date()), d[g.value] = u, d;
622
622
  },
623
- { [o]: W.getIdFun() }
623
+ { [s]: Q.getIdFun() }
624
624
  )
625
- ), i?.(l);
625
+ ), l?.(n);
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, n, t, l) => {
635
+ const a = T.config.table.rowKey;
636
+ n[o] = n[o].filter((s) => s[a] !== t[a]), l?.(n);
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;
646
- return t.forEach((n) => {
647
- n[i] && delete n[i], l && n[l] && W.getNoIdData(n[l], l);
644
+ static getNoIdData = (o, n) => {
645
+ const t = JSONUtil.cp(o), l = T.config.table.rowKey;
646
+ return t.forEach((a) => {
647
+ a[l] && delete a[l], n && a[n] && Q.getNoIdData(a[n], n);
648
648
  }), t;
649
649
  };
650
650
  }
651
- const lt = {
651
+ const mt = {
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
+ }, gt = { key: 0 }, ht = {
656
656
  class: "row items-center",
657
657
  style: { gap: "10px", width: "100%" }
658
- }, dt = { key: 1 }, Ee = /* @__PURE__ */ G({
658
+ }, bt = { key: 1 }, Be = /* @__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 n = e, t = le({
698
698
  show: !1,
699
- add: (n, o, d) => {
700
- W.add(n, o, d, () => {
701
- i("change");
699
+ add: (a, s, d) => {
700
+ Q.add(a, s, d, () => {
701
+ l("change");
702
702
  });
703
703
  },
704
- remove: (n, o, d) => {
705
- W.remove(n, o, d, () => {
706
- i("change");
704
+ remove: (a, s, d) => {
705
+ Q.remove(a, s, d, () => {
706
+ l("change");
707
707
  });
708
708
  }
709
709
  });
710
- ze(() => {
711
- W.setId(l.field, l.row, l.itemFields), t.show = !0;
710
+ Re(() => {
711
+ Q.setId(n.field, n.row, n.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 l = o;
714
+ return (a, s) => {
715
+ const d = ue("el-button"), g = ue("el-input");
716
+ return t.show ? (m(), v("div", mt, [
717
+ S(a.$slots, "list-start", { row: e.row }),
718
+ e.addBottom ? V("", !0) : (m(), v("div", gt, [
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
+ (m(!0), v(B, null, N(e.row[e.field], (u) => (m(), v("div", ht, [
731
+ S(a.$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
+ (m(!0), v(B, null, N(e.itemFields, (r) => (m(), y(g, {
736
+ modelValue: u[r.value],
737
+ "onUpdate:modelValue": (h) => u[r.value] = h,
738
+ style: be({ width: e.inputWidth }),
739
+ class: J(e.inputClass),
740
+ placeholder: r[e.label] || r[e.value],
741
+ onChange: s[1] || (s[1] = (h) => l("change"))
742
742
  }, null, 8, ["modelValue", "onUpdate:modelValue", "style", "class", "placeholder"]))), 256)),
743
- x(n.$slots, "item-end", {
743
+ S(a.$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: (r) => 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 ? (m(), v("div", bt, [
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(a.$slots, "list-end", { row: e.row })
771
+ ])) : V("", !0);
772
772
  };
773
773
  }
774
- }), st = {
774
+ }), yt = {
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
+ }, pt = { class: "col column form-item-content-item" }, wt = { class: "col" }, kt = ["innerHTML"], vt = /* @__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, n) => (m(), y(i(he), {
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
+ O("div", yt, [
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
+ O("div", pt, [
801
+ O("div", wt, [
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" ? (m(), y(i(se), 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": n[0] || (n[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(R(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" ? (m(), y(i(Ze), 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": n[1] || (n[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" ? (m(), y(i(se), 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": n[2] || (n[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" ? (m(), y(i(me), 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": n[3] || (n[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" ? (m(), y(i(de), 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": n[4] || (n[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
+ (m(!0), v(B, null, N(e.getBind(e.item).data || [], (t) => (m(), y(i(ae), 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" ? (m(), y(i(Fe), 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": n[5] || (n[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" ? (m(!0), v(B, { key: 0 }, N(e.getBind(e.item).data || [], (t) => (m(), y(i(_e), 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)) : (m(!0), v(B, { key: 1 }, N(e.getBind(e.item).data || [], (t) => (m(), y(i(De), 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" ? (m(), y(i(et), 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": n[6] || (n[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" ? (m(!0), v(B, { key: 0 }, N(e.getBind(e.item).data || [], (t) => (m(), y(i(tt), 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)) : (m(!0), v(B, { key: 1 }, N(e.getBind(e.item).data || [], (t) => (m(), y(i(ot), 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" ? (m(), y(i(at), 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": n[7] || (n[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" ? (m(), y(i(nt), 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": n[8] || (n[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" ? (m(), y(Be, 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" ? (m(), y(i(lt), 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": n[9] || (n[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" ? (m(), y(i(Oe), 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": n[10] || (n[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" ? (m(), y(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": n[11] || (n[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 && (i(W).customComponent[e.item.type] || i(W).customComponent[e.item.type]?.form) ? (m(), y(ee(i(W).customComponent[e.item.type]?.form || i(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": n[12] || (n[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 ? (m(), 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, kt)) : 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 Ct = {
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, ...n) {
996
+ if (typeof o == "function")
997
+ return o(...n);
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, (l, a) => t < n.length ? String(n[t++]) : `{${a}}`);
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, ...n) {
1007
+ return this.t(this.curd[o], ...n);
1009
1008
  }
1010
1009
  /** curd表单 */
1011
- static curd = gt;
1010
+ static curd = Ct;
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((n) => {
1020
+ delete o[n];
1022
1021
  });
1023
1022
  };
1024
1023
  /**
@@ -1028,35 +1027,35 @@ 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, n, t = !1) => {
1031
+ t && Y.delAllKey(o), Object.keys(n).forEach((l) => {
1032
+ o[l] !== n[l] && (o[l] = n[l]);
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 ye = (e) => {
1037
+ const o = le({}), n = () => typeof e == "function" ? e() : e, t = () => {
1038
+ const l = n();
1039
+ return l ?? o;
1041
1040
  };
1042
1041
  return {
1043
- internal: a,
1044
- isExternal: () => l() != null,
1042
+ internal: o,
1043
+ isExternal: () => n() != null,
1045
1044
  get() {
1046
1045
  return t();
1047
1046
  },
1048
- set(i) {
1049
- Q.setValue(t(), i, !0);
1047
+ set(l) {
1048
+ Y.setValue(t(), l, !0);
1050
1049
  },
1051
- merge(i) {
1052
- Q.setValue(t(), i, !1);
1050
+ merge(l) {
1051
+ Y.setValue(t(), l, !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 = $.EDialog, ce = (e) => typeof e.type == "object" ? "component" : e.type || "input", xt = (e, o, n) => {
1058
+ const t = ye(() => o.form);
1060
1059
  return {
1061
1060
  update: {
1062
1061
  title: "",
@@ -1064,37 +1063,37 @@ const fe = (e) => {
1064
1063
  show: !1,
1065
1064
  showContent: !1,
1066
1065
  loading: !1,
1067
- type: de.Update,
1066
+ type: fe.Update,
1068
1067
  get form() {
1069
1068
  return t.get();
1070
1069
  },
1071
- set form(i) {
1072
- t.set(i);
1070
+ set form(l) {
1071
+ t.set(l);
1073
1072
  },
1074
1073
  formDefault: {},
1075
1074
  formColumn: [],
1076
1075
  formGrid: [],
1077
1076
  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);
1077
+ getDisabled: (l, a = !1) => {
1078
+ const s = e();
1079
+ return o.option.table?.editMode && a ? l.disabled?.table === void 0 ? !1 : $.isFun(l.disabled?.table, s.update.form) : Te(l, s.update.type, s.update.form);
1081
1080
  },
1082
- getBind: (i) => {
1083
- const n = e();
1084
- return Oe(i, n.update.type);
1081
+ getBind: (l) => {
1082
+ const a = e();
1083
+ return je(l, a.update.type);
1085
1084
  },
1086
- getOn: (i, n) => {
1087
- const o = e();
1088
- return Me(i, o.update.type, [n || o.update.form, i]);
1085
+ getOn: (l, a) => {
1086
+ const s = e();
1087
+ return Ke(l, s.update.type, [a || s.update.form, l]);
1089
1088
  },
1090
- getOptions: (i) => {
1091
- const n = e();
1089
+ getOptions: (l) => {
1090
+ const a = e();
1092
1091
  try {
1093
- const d = Be(n.update.formGrid?.length ? n.update.formGrid : n.update.formColumn).find((c) => c.item.key === i)?.item;
1092
+ const d = Ge(a.update.formGrid?.length ? a.update.formGrid : a.update.formColumn).find((g) => g.item.key === l)?.item;
1094
1093
  return d ? {
1095
1094
  options: d.options,
1096
1095
  //@ts-ignore
1097
- bind: n.update.getBind(d)
1096
+ bind: a.update.getBind(d)
1098
1097
  } : { options: {}, bind: {} };
1099
1098
  } catch {
1100
1099
  return { options: {}, bind: {} };
@@ -1102,258 +1101,290 @@ const fe = (e) => {
1102
1101
  },
1103
1102
  edit: {
1104
1103
  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]
1104
+ getApiData: (l) => {
1105
+ const a = e();
1106
+ if (o.option.form?.editAll) return l;
1107
+ const s = {
1108
+ [o.option.table?.rowKey]: a.update.edit.data[o.option.table?.rowKey]
1110
1109
  };
1111
- return Object.keys(n.update.edit.data).forEach((d) => {
1112
- i[d] !== n.update.edit.data[d] && (o[d] = i[d]);
1113
- }), o;
1110
+ return Object.keys(a.update.edit.data).forEach((d) => {
1111
+ l[d] !== a.update.edit.data[d] && (s[d] = l[d]);
1112
+ }), s;
1114
1113
  }
1115
1114
  },
1116
1115
  view: {},
1117
1116
  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;
1117
+ open: async (l, a) => {
1118
+ const s = e();
1119
+ if (!(s.update.showContent || s.update.openLoading)) {
1120
+ $.loading(!0), s.update.openLoading = !0;
1122
1121
  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);
1122
+ s.update.type = l;
1123
+ const d = l === fe.Add;
1124
+ s.update.edit.data = d ? void 0 : JSONUtil.cp(a), s.update.title = C.tCurd(d ? "add" : l === fe.View ? "view" : "edit");
1125
+ const g = d ? ObjectUtil.deepMerge(JSONUtil.cp(s.update.formDefault), a ? JSONUtil.cp(a) : {}) : JSONUtil.cp(a);
1126
+ Y.setValue(s.update.form, g, !0), await s.initApiData("update"), await o.option.form?.openBefore?.(s.update.form, s.update), (!o.option.table?.inlineEdit || d) && (s.update.show = !0, s.update.showContent = !0), o.option.form?.openAfter?.(s.update.form, s.update);
1128
1127
  } catch (d) {
1129
1128
  console.error(d);
1130
1129
  } finally {
1131
- z.loading(!1), o.update.openLoading = !1;
1130
+ $.loading(!1), s.update.openLoading = !1;
1132
1131
  }
1133
1132
  }
1134
1133
  },
1135
- validate: async () => {
1136
- const i = e();
1134
+ validate: async (l = !0) => {
1135
+ const a = e();
1137
1136
  try {
1137
+ const s = o.option.table?.editMode ? a.tableEditValidate.validate() : n.ruleFormRef.value?.validate(async (d) => new Promise((g, u) => {
1138
+ d || u(!1), g(void 0);
1139
+ }));
1138
1140
  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()
1141
+ s,
1142
+ a.formRef.validate()
1143
1143
  ]), !0;
1144
1144
  } catch {
1145
- z.fail(w.tCurd("checkFormData"));
1145
+ return l && $.fail(C.tCurd("checkFormData")), !1;
1146
1146
  }
1147
1147
  },
1148
1148
  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;
1149
+ const l = e();
1150
+ if (!await l.update.validate() || l.update.loading) return;
1151
+ l.update.loading = !0;
1152
+ const s = l.update.type === fe.Add ? o.option.api.create : o.option.api.update;
1153
1153
  try {
1154
- await a.option.form?.submitBefore?.(i.update.form, i.update);
1154
+ await o.option.form?.submitBefore?.(l.update.form, l.update);
1155
1155
  } catch {
1156
- i.update.loading = !1;
1156
+ l.update.loading = !1;
1157
1157
  return;
1158
1158
  }
1159
- let d = ObjectUtil.deepMerge(i.update.form, {});
1159
+ let d = ObjectUtil.deepMerge(l.update.form, {});
1160
1160
  delete d.children;
1161
- const c = new Set(a.option.column.filter((u) => u.type === "datetime").map((u) => u.key));
1161
+ const g = new Set(o.option.column.filter((u) => u.type === "datetime").map((u) => u.key));
1162
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);
1163
+ if (g.has(u) && d[u] != null) {
1164
+ const r = new Date(d[u]).getTime();
1165
+ isNaN(r) || (d[u] = r);
1166
1166
  }
1167
1167
  });
1168
1168
  try {
1169
- if (!o) return;
1170
- await o({ ...d }), i.update.close(), await i.table.getList(), a.option.form?.submitAfter?.(d, i.update);
1169
+ if (!s) return;
1170
+ await s({ ...d }), l.update.close(), await l.table.getList(), o.option.form?.submitAfter?.(d, l.update);
1171
1171
  } catch (u) {
1172
1172
  console.error(u);
1173
1173
  } finally {
1174
- i.update.loading = !1;
1174
+ l.update.loading = !1;
1175
1175
  }
1176
1176
  },
1177
1177
  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();
1178
+ const l = e();
1179
+ l.update.show = !1, l.update.edit.data = void 0, setTimeout(() => {
1180
+ l.update.showContent = !1, n.ruleFormRef.value?.resetFields?.(), t.clear();
1181
1181
  }, 350);
1182
1182
  }
1183
1183
  }
1184
1184
  };
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 = {};
1200
- return Object.keys(n).forEach((d) => {
1201
- 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;
1185
+ }, H = 12, pe = (e, o) => {
1186
+ e.isForm = o, Array.isArray(e.children) && e.children.forEach((n) => pe(n, o));
1187
+ }, Vt = (e) => e.isForm === !1 ? !1 : typeof e.show?.form == "boolean" ? e.show.form : !0, St = (e, o, n) => (e.form = e.form || { span: o }, n === "column" ? e.form.span = e.form.span ?? 12 : e.form.span = e.form.span ?? o, e.form.span), Le = (e) => {
1188
+ const o = e.form;
1189
+ return o?.row != null && o.row > 0 ? o.row : H;
1190
+ }, ne = (e) => Math.floor((e.gridRow - 1) / H), Te = (e, o, n) => {
1191
+ if (o === $.EDialog.View)
1192
+ return e.disabled?.view === void 0 ? !0 : $.isFun(e.disabled?.view, n);
1193
+ const t = e.disabled?.[o === $.EDialog.Add ? "create" : "update"];
1194
+ return $.isFun(t, n);
1195
+ }, je = (e, o) => {
1196
+ const n = ce(e);
1197
+ return e.options?.[o === $.EDialog.Add ? "formAdd" : "formUpdate"]?.[n] || e.options?.[n] || {};
1198
+ }, Ke = (e, o, n = []) => {
1199
+ const t = ce(e), a = e.options?.[o === $.EDialog.Add ? "formAdd" : "formUpdate"]?.[t]?.on || e.options?.[t]?.on || {}, s = {};
1200
+ return Object.keys(a).forEach((d) => {
1201
+ const g = a[d];
1202
+ typeof g == "function" ? s[d] = function(...u) {
1203
+ return g.apply(this, [...u, ...n]);
1204
+ } : s[d] = g;
1205
+ }), s;
1206
+ }, Pe = (e, o, n, t, l) => {
1207
+ const a = e, s = a.colSpan ?? e.span;
1208
1208
  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);
1209
+ return s;
1210
+ const d = l?.maxSpan || 12, g = l?.defaultSpan || d / 2, u = a.gridBand, h = o.filter((c) => u != null ? c.gridBand === u && !$.isFun(c.item.show?.form, n, t) : c.gridRow === a.gridRow && !$.isFun(c.item.show?.form, n, t)).reduce((c, f) => c + (f.colSpan ?? f.span ?? g), 0);
1211
+ return s + h;
1212
+ }, Et = (e, o) => {
1213
+ const n = (t, l) => {
1214
+ const a = t.gridRow, s = t.gridRow + t.rowSpan - 1, d = l.gridRow, g = l.gridRow + l.rowSpan - 1;
1215
+ return a <= g && d <= s;
1230
1216
  };
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;
1217
+ return e.map((t) => e.filter((a) => n(t, a)).length !== 1 || t.colSpan >= o ? t : {
1218
+ ...t,
1219
+ span: o,
1220
+ colSpan: o,
1221
+ gridColumn: 1
1222
+ });
1223
+ }, Ie = (e, o, n = {}) => {
1224
+ const t = /* @__PURE__ */ new Set(), l = [];
1225
+ let a = 0, s = 0;
1226
+ const d = (f) => Math.floor(f / H) * H, g = (f, w) => `${f},${w}`, u = (f, w, U, L) => {
1227
+ if (w + U > o) return !1;
1228
+ for (let D = 0; D < L; D++)
1229
+ for (let A = 0; A < U; A++)
1230
+ if (t.has(g(f + D, w + A))) return !1;
1257
1231
  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 };
1232
+ }, r = (f, w, U, L) => {
1233
+ for (let D = 0; D < L; D++)
1234
+ for (let A = 0; A < U; A++)
1235
+ t.add(g(f + D, w + A));
1236
+ }, h = (f, w, U, L) => {
1237
+ for (let A = d(f); A < 500 * H; A += H) {
1238
+ const re = A + H, we = A === d(f) ? Math.max(A, f) : A;
1239
+ for (let Z = we; Z < re; Z++) {
1240
+ const ke = Z === f ? w : 0;
1241
+ for (let b = ke; b <= o - U; b++)
1242
+ if (u(Z, b, U, L)) return { tr: Z, tc: b };
1270
1243
  }
1271
1244
  }
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;
1245
+ return { tr: f, tc: w };
1246
+ }, c = (f, w, U, L) => {
1247
+ const D = d(f);
1248
+ if (L < H && f + L < D + H) {
1249
+ a = f + L, s = w;
1277
1250
  return;
1278
1251
  }
1279
- const R = E + B;
1280
- if (R < l) {
1281
- m = R, u = A;
1252
+ const A = w + U;
1253
+ if (A < o) {
1254
+ s = A, a = D;
1282
1255
  return;
1283
1256
  }
1284
- m = 0, u = A + K;
1257
+ s = 0, a = D + H;
1285
1258
  };
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);
1259
+ return e.forEach((f) => {
1260
+ const w = f.colSpan ?? (f.span === 0 ? o : f.span), U = f.rowSpan ?? Le(f.item);
1261
+ f.item.form?.rowBreak && l.length && (s = 0, a = d(a) + H);
1262
+ let { tr: L, tc: D } = u(a, s, w, U) ? { tr: a, tc: s } : h(a, s, w, U);
1263
+ u(L, D, w, U) || ({ tr: L, tc: D } = h(0, 0, w, U)), r(L, D, w, U);
1264
+ const A = L + 1;
1265
+ l.push({
1266
+ ...f,
1267
+ span: w,
1268
+ colSpan: w,
1269
+ rowSpan: U,
1270
+ gridRow: A,
1271
+ gridColumn: D + 1,
1272
+ gridBand: ne({ gridRow: A })
1273
+ }), c(L, D, w, U);
1274
+ }), n.fillSingleRows ? Et(l, o) : l;
1275
+ }, $t = (e, o, n, t = H) => {
1276
+ const l = e.filter((d) => $.isFun(d.item.show?.form, o, n)), a = /* @__PURE__ */ new Map();
1277
+ e.forEach((d) => {
1278
+ const u = `${d.gridBand ?? ne(d)}:${d.gridColumn}:${d.colSpan}`;
1279
+ a.has(u) || a.set(u, []), a.get(u).push(d);
1280
+ });
1281
+ const s = /* @__PURE__ */ new Map();
1282
+ return a.forEach((d) => {
1283
+ const g = d.reduce((c, f) => c + f.rowSpan, 0);
1284
+ if (!(d.length > 1 && g === H && d.every((c) => c.rowSpan < H))) return;
1285
+ const r = d.filter((c) => $.isFun(c.item.show?.form, o, n));
1286
+ if (r.length !== 1) return;
1287
+ const h = r[0];
1288
+ s.set(h.item.key, {
1289
+ ...h,
1290
+ rowSpan: H
1291
+ });
1292
+ }), Ie(l.map((d) => s.get(d.item.key) || d), t, {
1293
+ fillSingleRows: !0
1294
+ });
1295
+ }, Ne = (e) => {
1296
+ const o = /* @__PURE__ */ new Map();
1297
+ return e.forEach((n) => {
1298
+ const t = n.gridBand ?? ne(n);
1299
+ o.has(t) || o.set(t, []), o.get(t).push(n);
1300
+ }), Array.from(o.keys()).sort((n, t) => n - t).map((n) => o.get(n));
1301
+ }, Ge = (e) => e?.length ? Array.isArray(e[0]) ? e.flat() : e : [], zt = (e, o) => {
1302
+ if (!Vt(e) || !e.key) return null;
1303
+ const n = o.defaultSpan ?? (o.maxSpan || 12) / 2, t = St(e, n, o.layout);
1304
+ return { item: e, span: t };
1305
+ }, Mt = (e, o = {}) => {
1306
+ const n = [], t = (l) => {
1307
+ if (l.children?.length) {
1308
+ l.children.forEach((s) => t(s));
1309
+ return;
1310
+ }
1311
+ const a = zt(l, o);
1312
+ a && n.push(a);
1313
+ };
1314
+ return e.forEach((l) => t(l)), n;
1315
+ }, He = (e, o = {}) => {
1316
+ const n = o.maxSpan ?? 12, t = o.defaultSpan ?? n / 2, l = o.layout ?? "row", s = Mt(e, { maxSpan: n, defaultSpan: t, layout: l });
1317
+ if (l === "column") {
1318
+ const d = [];
1319
+ let g = 1;
1320
+ return s.forEach((u) => {
1321
+ const r = Le(u.item), h = n;
1322
+ d.push({
1323
+ ...u,
1324
+ span: h,
1325
+ colSpan: h,
1326
+ rowSpan: r,
1327
+ gridRow: g,
1328
+ gridColumn: 1,
1329
+ gridBand: ne({ gridRow: g })
1330
+ }), g += r;
1331
+ }), { cells: d, maxSpan: n };
1301
1332
  }
1302
- return { cells: c, maxSpan: l };
1303
- }, kt = (e) => e.map((a) => a.item?.show?.form), vt = (e, a, l) => {
1333
+ return { cells: Ie(s, n), maxSpan: n };
1334
+ }, Ft = (e) => e.map((o) => o.item?.show?.form), Dt = (e, o, n) => {
1304
1335
  if (!e.rules) return;
1305
1336
  const t = typeof e.rules == "boolean" ? [
1306
1337
  {
1307
1338
  required: !0,
1308
- message: a(e),
1339
+ message: o(e),
1309
1340
  trigger: "blur"
1310
1341
  }
1311
1342
  ] : e.rules;
1312
- return l ? t.map((i) => l(i)) : t;
1313
- }, Re = (e) => (a, l) => vt(a, e, (t) => {
1343
+ return n ? t.map((l) => n(l)) : t;
1344
+ }, We = (e) => (o, n) => Dt(o, e, (t) => {
1314
1345
  if (t.validator) {
1315
- const i = t.validator;
1346
+ const l = t.validator;
1316
1347
  return {
1317
1348
  ...t,
1318
- validator: (n, o, d) => i(n, o, d, l)
1349
+ validator: (a, s, d) => l(a, s, d, n)
1319
1350
  };
1320
1351
  }
1321
1352
  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, {
1332
- maxSpan: n,
1333
- defaultSpan: o,
1334
- layout: a?.layout
1353
+ }), Je = (e, o) => {
1354
+ const n = {
1355
+ input: C.tCurd("placeholderInput"),
1356
+ select: C.tCurd("placeholderSelect")
1357
+ }, t = (n[ce(e) || "input"] || n.input) + e.label;
1358
+ return (o || W.error.callback)?.(e.key, e) || t;
1359
+ }, qe = (e) => We((o) => Je(o, e?.error)), Ot = (e, o, n) => {
1360
+ const t = {}, l = {}, a = o?.maxSpan || 12, s = o?.defaultSpan || a / 2, d = qe(o);
1361
+ e.forEach((r) => pe(r, !0)), $e(e, t, l, (r) => d(r, n));
1362
+ const { cells: g, maxSpan: u } = He(e, {
1363
+ maxSpan: a,
1364
+ defaultSpan: s,
1365
+ layout: o?.layout
1335
1366
  });
1336
1367
  return {
1337
1368
  formDefault: t,
1338
- rules: i,
1339
- formGrid: c,
1369
+ rules: l,
1370
+ formGrid: g,
1340
1371
  formMaxSpan: u,
1341
- formColumn: Ue(c)
1372
+ formColumn: Ne(g)
1342
1373
  };
1343
- }, Te = (e, a, l, t) => {
1344
- const i = (n) => {
1345
- if (n.children?.length) {
1346
- n.children.forEach((o) => i(o));
1374
+ }, $e = (e, o, n, t) => {
1375
+ const l = (a) => {
1376
+ if (a.children?.length) {
1377
+ a.children.forEach((s) => l(s));
1347
1378
  return;
1348
1379
  }
1349
- if (n.key) {
1350
- a[n.key] = n.value;
1351
- const o = t(n);
1352
- o && (l[n.key] = o);
1380
+ if (a.key) {
1381
+ o[a.key] = a.value;
1382
+ const s = t(a);
1383
+ s && (n[a.key] = s);
1353
1384
  }
1354
1385
  };
1355
- e.forEach(i);
1356
- }, Vt = { class: "curd-form-cell-inner" }, Le = /* @__PURE__ */ G({
1386
+ e.forEach(l);
1387
+ }, Rt = { class: "curd-form-cell-inner" }, Qe = /* @__PURE__ */ q({
1357
1388
  __name: "layout",
1358
1389
  props: {
1359
1390
  formGrid: {},
@@ -1368,79 +1399,77 @@ const fe = (e) => {
1368
1399
  getDisabled: { type: Function }
1369
1400
  },
1370
1401
  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(() => {
1374
- const f = Array.from(
1402
+ const o = $.isFun, n = e, t = oe(() => $t(n.formGrid, n.form, n.type, n.maxSpan)), l = oe(() => {
1403
+ const c = Array.from(
1375
1404
  new Set(
1376
- t.value.map((g) => g.gridBand ?? ie(g))
1405
+ t.value.map((f) => f.gridBand ?? ne(f))
1377
1406
  )
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(() => {
1383
- let f = 0;
1384
- return t.value.forEach((g) => {
1385
- const C = g.gridRow + g.rowSpan - 1;
1386
- C > f && (f = C);
1387
- }), 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;
1407
+ ).sort((f, w) => f - w);
1408
+ return new Map(c.map((f, w) => [f, w]));
1409
+ }), a = oe(() => ({
1410
+ gridTemplateColumns: `repeat(${n.maxSpan}, minmax(0, 1fr))`
1411
+ })), s = oe(() => {
1412
+ let c = 0;
1413
+ return t.value.forEach((f) => {
1414
+ const w = f.gridRow + f.rowSpan - 1;
1415
+ w > c && (c = w);
1416
+ }), c;
1417
+ }), d = (c) => c.gridRow + c.rowSpan - 1 >= s.value, g = (c) => c.rowSpan >= H, u = (c) => {
1418
+ const f = c.gridBand ?? ne(c);
1419
+ return l.value.get(f) ?? f;
1420
+ }, r = (c) => Pe(c, t.value, n.form, n.type, {
1421
+ maxSpan: n.maxSpan,
1422
+ defaultSpan: n.formOption?.defaultSpan
1423
+ }), h = (c) => {
1424
+ const f = r(c) || c.colSpan;
1396
1425
  return {
1397
- gridRow: `${f.gridRow} / span ${f.rowSpan}`,
1398
- gridColumn: `${f.gridColumn} / span ${g}`
1426
+ gridRow: `${c.gridRow} / span ${c.rowSpan}`,
1427
+ gridColumn: `${c.gridColumn} / span ${f}`
1399
1428
  };
1400
1429
  };
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)
1430
+ return (c, f) => i(o)(i(Ft)(e.formGrid), e.form, e.type) ? (m(), v(B, { key: 0 }, [
1431
+ S(c.$slots, "form-start", { row: e.form }),
1432
+ O("div", {
1433
+ class: J(["curd-form-grid", { stripe: e.stripe !== !1 }]),
1434
+ style: be(a.value)
1406
1435
  }, [
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}`
1436
+ (m(!0), v(B, null, N(t.value, (w) => (m(), v("div", {
1437
+ key: w.item.key,
1438
+ class: J(["curd-form-grid-cell", [
1439
+ e.stripe !== !1 && u(w) % 2 === 0 ? "stripe-band-odd" : "",
1440
+ w.gridColumn > 1 ? "has-col-border" : "",
1441
+ e.stripe !== !1 && d(w) ? "is-last-row" : "",
1442
+ g(w) ? "is-row-span" : "",
1443
+ `form-item-col-${w.item.key}`
1415
1444
  ]]),
1416
- style: ce(p(C))
1445
+ style: be(h(w))
1417
1446
  }, [
1418
- M("div", Vt, [
1419
- r(a)(C.item.show?.form, e.form, e.type) ? (s(), h(mt, {
1447
+ O("div", Rt, [
1448
+ i(o)(w.item.show?.form, e.form, e.type) ? (m(), y(vt, {
1420
1449
  key: 0,
1421
- class: I({ "is-row-span-field": c(C) }),
1422
- item: C.item,
1450
+ class: J({ "is-row-span-field": g(w) }),
1451
+ item: w.item,
1423
1452
  form: e.form,
1424
1453
  type: e.type,
1425
1454
  "label-width": e.labelWidth,
1426
1455
  "get-bind": e.getBind,
1427
1456
  "get-on": e.getOn,
1428
1457
  "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 || {}))
1458
+ }, X({ _: 2 }, [
1459
+ N(c.$slots, (U, L) => ({
1460
+ name: L,
1461
+ fn: p((D) => [
1462
+ S(c.$slots, L, x({ ref_for: !0 }, D || {}))
1434
1463
  ])
1435
1464
  }))
1436
- ]), 1032, ["class", "item", "form", "type", "label-width", "get-bind", "get-on", "get-disabled"])) : v("", !0)
1465
+ ]), 1032, ["class", "item", "form", "type", "label-width", "get-bind", "get-on", "get-disabled"])) : V("", !0)
1437
1466
  ])
1438
1467
  ], 6))), 128))
1439
1468
  ], 6),
1440
- x(f.$slots, "form-end", { row: e.form })
1441
- ], 64)) : v("", !0);
1469
+ S(c.$slots, "form-end", { row: e.form })
1470
+ ], 64)) : V("", !0);
1442
1471
  }
1443
- }), St = /* @__PURE__ */ G({
1472
+ }), Ut = /* @__PURE__ */ q({
1444
1473
  __name: "column",
1445
1474
  props: {
1446
1475
  option: {
@@ -1456,123 +1485,160 @@ const fe = (e) => {
1456
1485
  default: void 0
1457
1486
  }
1458
1487
  },
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({
1488
+ setup(e, { expose: o }) {
1489
+ const n = $.EDialog, t = _(), l = e;
1490
+ let a = ye(l.form);
1491
+ const s = Ee.getConf("curdConf"), d = "formRef-" + StrUtil.getId();
1492
+ s?.formRef?.set(d, t), Ue(() => {
1493
+ s?.formRef?.remove(d);
1494
+ });
1495
+ const g = le({
1465
1496
  rules: {},
1466
1497
  show: !0,
1467
1498
  formDefault: {},
1468
- type: i.type || o?.update?.type || l.Add,
1499
+ type: l.type || s?.update?.type || n.Add,
1469
1500
  formColumn: [],
1470
1501
  formGrid: [],
1471
1502
  formMaxSpan: 12,
1472
1503
  get form() {
1473
- return n.get();
1504
+ return a.get();
1474
1505
  },
1475
- set form(c) {
1476
- n.set(c);
1506
+ set form(u) {
1507
+ a.set(u);
1477
1508
  },
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]),
1509
+ getDisabled: (u) => Te(u, g.type, g.form),
1510
+ getBind: (u) => je(u, g.type),
1511
+ getOn: (u) => Ke(u, g.type, [g.form, u]),
1481
1512
  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));
1513
+ const u = a, r = Ot(l.option.column, l.option.form, u.get());
1514
+ g.formDefault = r.formDefault, g.rules = r.rules, g.formGrid = r.formGrid, g.formMaxSpan = r.formMaxSpan, g.formColumn = r.formColumn, g.type === n.Add ? u.isExternal() ? u.merge(JSONUtil.cp(g.formDefault)) : u.set(JSONUtil.cp(g.formDefault)) : !u.isExternal() && l.form && u.set(JSONUtil.cp(l.form));
1484
1515
  }
1485
1516
  });
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();
1517
+ return l.option.form?.initStart?.(g), g.initColumnForm(), l.option.form?.initEnd?.(g), dt(
1518
+ () => l.form,
1519
+ (u) => {
1520
+ a = ye(u), g.initColumnForm();
1490
1521
  }
1491
- ), a({ ref: t, conf: d }), (c, u) => (s(), h(r(Y), {
1522
+ ), o({ ref: t, conf: g }), (u, r) => (m(), y(i(te), {
1492
1523
  ref_key: "ruleFormRef",
1493
1524
  ref: t,
1494
- model: d.form,
1495
- rules: d.rules
1525
+ model: g.form,
1526
+ rules: g.rules
1496
1527
  }, {
1497
- default: b(() => [
1498
- d.show ? (s(), h(Le, {
1528
+ default: p(() => [
1529
+ g.show ? (m(), y(Qe, {
1499
1530
  key: 0,
1500
- "form-grid": d.formGrid,
1501
- "max-span": d.formMaxSpan,
1502
- form: d.form,
1503
- type: d.type,
1531
+ "form-grid": g.formGrid,
1532
+ "max-span": g.formMaxSpan,
1533
+ form: g.form,
1534
+ type: g.type,
1504
1535
  stripe: e.option.form?.stripe,
1505
1536
  "label-width": e.option.form?.labelWidth || "100px",
1506
1537
  "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 || {})))
1538
+ "get-bind": g.getBind,
1539
+ "get-on": g.getOn,
1540
+ "get-disabled": g.getDisabled
1541
+ }, X({ _: 2 }, [
1542
+ N(u.$slots, (h, c) => ({
1543
+ name: c,
1544
+ fn: p((f) => [
1545
+ S(u.$slots, c, Ve(Se(f || {})))
1515
1546
  ])
1516
1547
  }))
1517
- ]), 1032, ["form-grid", "max-span", "form", "type", "stripe", "label-width", "form-option", "get-bind", "get-on", "get-disabled"])) : v("", !0)
1548
+ ]), 1032, ["form-grid", "max-span", "form", "type", "stripe", "label-width", "form-option", "get-bind", "get-on", "get-disabled"])) : V("", !0)
1518
1549
  ]),
1519
1550
  _: 3
1520
1551
  }, 8, ["model", "rules"]));
1521
1552
  }
1522
- }), zt = () => ({
1523
- formRef: {
1524
- map: {},
1525
- set(e, a) {
1526
- this.map[e] = a;
1553
+ }), At = (e) => e?.value || e, Bt = (e) => {
1554
+ const o = At(e);
1555
+ return o?.validate ? new Promise((n, t) => {
1556
+ let l = !1;
1557
+ const a = (s) => {
1558
+ l || (l = !0, s === !1 ? t(!1) : n(!0));
1559
+ };
1560
+ try {
1561
+ const s = o.validate(a);
1562
+ s && typeof s.then == "function" ? s.then((d) => a(d)).catch(t) : o.validate.length === 0 && a(s);
1563
+ } catch (s) {
1564
+ t(s);
1565
+ }
1566
+ }) : Promise.resolve(!0);
1567
+ }, Lt = () => {
1568
+ const e = le({
1569
+ formRef: {
1570
+ map: {},
1571
+ set(o, n) {
1572
+ e.formRef.map[o] = n;
1573
+ },
1574
+ remove(o) {
1575
+ delete e.formRef.map[o];
1576
+ },
1577
+ validate() {
1578
+ const o = Object.keys(e.formRef.map).map((n) => e.formRef.map[n]);
1579
+ return Promise.all(o.map((n) => Bt(n))).then(() => !0);
1580
+ }
1527
1581
  },
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);
1582
+ /**
1583
+ * 注册表单引用,用于校验处理
1584
+ * @param formRef 表单引用
1585
+ * @param refKey 表单引用唯一键
1586
+ * @example
1587
+ * <el-form :ref="formRef => regFormRef(formRef, 'formRef-1')" />
1588
+ * 或者直接js模拟函数注册
1589
+ * regFormRef({ validate: (fun) => {
1590
+ * if(val){
1591
+ * fun(true)
1592
+ * } else {
1593
+ * fun(false)
1594
+ * }
1595
+ * } }, 'formRef-1')
1596
+ * @returns
1597
+ */
1598
+ regFormRef(o, n, t) {
1599
+ o ? t ? e.formRef.set(n, {
1600
+ validate: async (l) => {
1601
+ try {
1602
+ l(await t());
1603
+ } catch {
1604
+ l(!1);
1605
+ }
1541
1606
  }
1542
- });
1607
+ }) : e.formRef.set(n, o) : e.formRef.remove(n);
1543
1608
  }
1544
- }
1545
- }), $t = (e, a) => {
1546
- const l = fe(() => a.searchForm);
1609
+ });
1610
+ return e;
1611
+ }, Tt = (e, o) => {
1612
+ const n = ye(() => o.searchForm);
1547
1613
  return {
1548
1614
  search: {
1549
1615
  column: {
1550
1616
  list: []
1551
1617
  },
1552
1618
  get form() {
1553
- return l.get();
1619
+ return n.get();
1554
1620
  },
1555
1621
  set form(t) {
1556
- l.set(t);
1622
+ n.set(t);
1557
1623
  },
1558
1624
  formDefault: {},
1559
- getPlaceholder: (t, i = w.tCurd("placeholderInput")) => t.text?.search?.placeholder === void 0 ? `${i}${t.label}` : t.text?.search?.placeholder,
1625
+ getPlaceholder: (t, l = C.tCurd("placeholderInput")) => t.text?.search?.placeholder === void 0 ? `${l}${t.label}` : t.text?.search?.placeholder,
1560
1626
  getFormData: () => {
1561
1627
  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]);
1628
+ let l = {};
1629
+ o.option.column.forEach((s) => {
1630
+ (typeof s.show?.search == "function" ? s.show?.search(t.search.form) : s.show?.search) && (l[s.key] = t.search.form[s.key]);
1565
1631
  });
1566
- const n = a.option.search?.before?.(i);
1567
- return n && (i = n), i;
1632
+ const a = o.option.search?.before?.(l);
1633
+ return a && (l = a), l;
1568
1634
  },
1569
1635
  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];
1636
+ const t = e(), l = t.search.formDefault;
1637
+ Object.keys(l).forEach((s) => {
1638
+ o.option.search?.resetMode === "none" ? l[s] = void 0 : l[s] = t.search.formDefault[s];
1573
1639
  });
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();
1640
+ const a = ObjectUtil.deepMerge(l, {});
1641
+ Y.setValue(t.search.form, a, !0), t.page.num = 1, o.option.init !== !1 && t.table.getList();
1576
1642
  },
1577
1643
  submit: () => {
1578
1644
  const t = e();
@@ -1580,48 +1646,48 @@ const fe = (e) => {
1580
1646
  }
1581
1647
  }
1582
1648
  };
1583
- }, Et = (e, a) => ({
1649
+ }, jt = (e, o) => ({
1584
1650
  page: {
1585
1651
  num: 1,
1586
1652
  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 = {}) => {
1653
+ layout: o.option.page?.layout || T.config.pagination.layout,
1654
+ showTools: o.option.page?.showTools || T.config.pagination.showTools,
1655
+ size: o.option.page?.size || T.config.pagination.size,
1656
+ sizeList: o.option.page?.sizeList || T.config.pagination.pageSizes,
1657
+ pagerCount: o.option.page?.pagerCount || T.config.pagination.pagerCount,
1658
+ getQuery: (n = {}) => {
1593
1659
  const t = e();
1594
1660
  return {
1595
- [U.config.field.page.size]: l.size || t.page.size,
1596
- [U.config.field.page.num]: l.num || t.page.num,
1661
+ [T.config.field.page.size]: n.size || t.page.size,
1662
+ [T.config.field.page.num]: n.num || t.page.num,
1597
1663
  ...t.search.getFormData()
1598
1664
  };
1599
1665
  }
1600
1666
  }
1601
- }), Dt = (e, a, l) => ({
1667
+ }), Kt = (e, o, n) => ({
1602
1668
  table: {
1603
1669
  op: {
1604
- width: (...t) => t.filter((n) => n).length * 30 + 60
1670
+ width: (...t) => t.filter((a) => a).length * 30 + 60
1605
1671
  },
1606
1672
  loading: !1,
1607
1673
  data: [],
1608
1674
  expand: {
1609
1675
  isExpand: !1,
1610
1676
  rowKeys: [],
1611
- change: (t, i) => {
1677
+ change: (t, l) => {
1612
1678
  },
1613
1679
  all: () => {
1614
1680
  const t = e();
1615
1681
  if (t.table.expand.isExpand)
1616
1682
  t.table.expand.rowKeys = [];
1617
1683
  else {
1618
- const i = (n) => {
1619
- let o = [];
1620
- return n.forEach((d) => {
1621
- o.push(d[a.option.table.rowKey]), d.children?.length && (o = o.concat(i(d.children)));
1622
- }), o;
1684
+ const l = (a) => {
1685
+ let s = [];
1686
+ return a.forEach((d) => {
1687
+ s.push(d[o.option.table.rowKey]), d.children?.length && (s = s.concat(l(d.children)));
1688
+ }), s;
1623
1689
  };
1624
- t.table.expand.rowKeys = i(t.table.data);
1690
+ t.table.expand.rowKeys = l(t.table.data);
1625
1691
  }
1626
1692
  t.table.expand.isExpand = !t.table.expand.isExpand;
1627
1693
  }
@@ -1637,43 +1703,43 @@ const fe = (e) => {
1637
1703
  group: {
1638
1704
  expand: !1,
1639
1705
  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);
1706
+ const t = e(), l = !t.table.header.group.expand;
1707
+ t.table.header.group.expand = l;
1708
+ const a = (s) => {
1709
+ s.forEach((d) => {
1710
+ d.table?.header?.group !== void 0 && (d.table.header.group = !l), d.table?.header?.groupKey !== void 0 && (d.table.header.show = l), Array.isArray(d.children) && d.children.length && a(d.children);
1645
1711
  });
1646
1712
  };
1647
- n(t.table.column.list);
1713
+ a(t.table.column.list);
1648
1714
  }
1649
1715
  }
1650
1716
  },
1651
1717
  getList: async () => {
1652
1718
  const t = e();
1653
1719
  t.table.loading = !0;
1654
- const i = a.option.api.list, n = JSONUtil.cp(t.table.selection.list);
1720
+ const l = o.option.api.list, a = JSONUtil.cp(t.table.selection.list);
1655
1721
  try {
1656
1722
  await t.initApiData("init");
1657
- let o = {};
1723
+ let s = {};
1658
1724
  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
1725
+ const { props: w, order: U } = T.config.table.sort;
1726
+ s = {
1727
+ [w.field]: t.table.sort.prop,
1728
+ [U.field]: t.table.sort.order
1663
1729
  };
1664
1730
  }
1665
- const d = await i({
1731
+ const d = await l({
1666
1732
  ...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(() => {
1673
- t.table.selection.setList(n);
1733
+ ...s
1734
+ }), g = T.config.field.result, u = d.data || { [g.list]: d }, r = (Array.isArray(u[g.list]), u[g.list]), h = Ge(t.update.formGrid?.length ? t.update.formGrid : t.update.formColumn), f = ObjectUtil.deepMerge({ data: r }, {}).data.map((w) => (Object.keys(w).forEach((L) => {
1735
+ const D = h.find((A) => A.item.key === L);
1736
+ D && ["select", "radio"].includes(D.item.type) && (D.item.table.format || (D.item.table.format = (A) => D.item.options[D.item.type].data?.find((re) => re.value == A[L])?.label || A[L]));
1737
+ }), w));
1738
+ t.table.data = o.option.data ? await o.option.data(f, r) : f, t.tableEditValidate?.clear?.(), t.page.total = u[g.total] || 0, setTimeout(() => {
1739
+ t.table.selection.setList(a);
1674
1740
  }, 20);
1675
- } catch (o) {
1676
- console.error(o);
1741
+ } catch (s) {
1742
+ console.error(s);
1677
1743
  } finally {
1678
1744
  t.table.loading = !1;
1679
1745
  }
@@ -1683,34 +1749,34 @@ const fe = (e) => {
1683
1749
  change: (t) => {
1684
1750
  e().table.selection.list = t;
1685
1751
  },
1686
- setList: (t, i) => {
1687
- const n = e();
1688
- 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) {
1752
+ setList: (t, l) => {
1753
+ const a = e();
1754
+ a.table.selection.list = [];
1755
+ const s = n.tableRef.value;
1756
+ if (s?.clearSelection(), !s || !t?.length) return;
1757
+ const d = o.option.table?.rowKey, g = (u) => {
1758
+ const r = (h) => {
1759
+ for (const c of h) {
1694
1760
  if (d != null && d !== "") {
1695
- if (f[d] === u[d]) return f;
1696
- } else if (f === u)
1697
- return f;
1698
- if (Array.isArray(f.children) && f.children.length) {
1699
- const g = m(f.children);
1700
- if (g !== void 0) return g;
1761
+ if (c[d] === u[d]) return c;
1762
+ } else if (c === u)
1763
+ return c;
1764
+ if (Array.isArray(c.children) && c.children.length) {
1765
+ const f = r(c.children);
1766
+ if (f !== void 0) return f;
1701
1767
  }
1702
1768
  }
1703
1769
  };
1704
- return m(n.table.data);
1770
+ return r(a.table.data);
1705
1771
  };
1706
1772
  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();
1773
+ const r = g(u);
1774
+ if (r)
1775
+ if (l) {
1776
+ const h = () => s.toggleRowSelection(r, !0, !1);
1777
+ l(u) !== !1 && h();
1712
1778
  } else
1713
- o.toggleRowSelection(m, !0, !1);
1779
+ s.toggleRowSelection(r, !0, !1);
1714
1780
  });
1715
1781
  }
1716
1782
  },
@@ -1718,19 +1784,135 @@ const fe = (e) => {
1718
1784
  prop: "",
1719
1785
  order: "",
1720
1786
  change: (t) => {
1721
- const i = e();
1722
- U.config.table.sort.resetPage && (i.page.num = 1);
1723
- const n = U.config.table.sort;
1724
- if (n.change) {
1725
- n.change(t, i);
1787
+ const l = e();
1788
+ T.config.table.sort.resetPage && (l.page.num = 1);
1789
+ const a = T.config.table.sort;
1790
+ if (a.change) {
1791
+ a.change(t, l);
1726
1792
  return;
1727
1793
  }
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();
1794
+ l.table.sort.prop = t.prop, t.order === null ? (l.table.sort.order = "", l.table.sort.prop = "") : l.table.sort.order = t.order === "ascending" ? a.order.asc : a.order.desc, l.table.getList();
1729
1795
  }
1730
1796
  }
1731
1797
  }
1732
- });
1733
- class Ot {
1798
+ }), Pt = (e, o) => {
1799
+ const n = le({}), t = /* @__PURE__ */ new WeakMap();
1800
+ let l = 0;
1801
+ const a = (b) => {
1802
+ let k = t.get(b);
1803
+ return k || (l += 1, k = `fallback-${l}`, t.set(b, k)), k;
1804
+ }, s = (b) => {
1805
+ const k = o.option.table?.rowKey, z = k ? b[k] : void 0;
1806
+ return z != null && z !== "" ? String(z) : a(b);
1807
+ }, d = (b, k) => `${s(b)}-${k.key}`, g = (b) => Je(b, o.option.form?.error), u = We(g), r = () => {
1808
+ Object.keys(n).forEach((b) => {
1809
+ delete n[b];
1810
+ });
1811
+ }, h = (b, k) => {
1812
+ delete n[d(b, k)];
1813
+ }, c = (b, k) => n[d(b, k)] || "", f = (b, k) => b.message || g(k), w = (b) => b == null || b === "" || Array.isArray(b) && b.length === 0, U = (b) => {
1814
+ if (typeof b == "number") return b;
1815
+ if (typeof b == "string" || Array.isArray(b)) return b.length;
1816
+ }, L = (b, k) => {
1817
+ if (b === "array") return Array.isArray(k);
1818
+ if (b === "integer") return typeof k == "number" && Number.isInteger(k);
1819
+ if (b === "float") return typeof k == "number" && !Number.isInteger(k);
1820
+ if (b === "number") return typeof k == "number" && !Number.isNaN(k);
1821
+ if (b === "boolean") return typeof k == "boolean";
1822
+ if (b === "object") return k !== null && typeof k == "object" && !Array.isArray(k);
1823
+ if (b === "date") return k instanceof Date || !Number.isNaN(new Date(k).getTime());
1824
+ if (b === "email") return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(k));
1825
+ if (b === "url")
1826
+ try {
1827
+ return new URL(String(k)), !0;
1828
+ } catch {
1829
+ return !1;
1830
+ }
1831
+ return b === "string" ? typeof k == "string" : !0;
1832
+ }, D = (b, k, z) => typeof b.validator != "function" ? Promise.resolve(!0) : new Promise((K) => {
1833
+ let j = !1;
1834
+ const P = (G) => {
1835
+ if (!j) {
1836
+ if (j = !0, !G) {
1837
+ K(!0);
1838
+ return;
1839
+ }
1840
+ if (G instanceof Error) {
1841
+ K(G.message || f(b, z));
1842
+ return;
1843
+ }
1844
+ if (Array.isArray(G)) {
1845
+ const ve = G[0];
1846
+ K(ve instanceof Error ? ve.message : String(ve || f(b, z)));
1847
+ return;
1848
+ }
1849
+ K(String(G));
1850
+ }
1851
+ };
1852
+ try {
1853
+ const G = b.validator(b, k, P);
1854
+ G && typeof G.then == "function" ? G.then(() => P()).catch(P) : G === !1 ? P(f(b, z)) : typeof G == "string" || G instanceof Error ? P(G) : b.validator.length < 3 && P();
1855
+ } catch (G) {
1856
+ P(G);
1857
+ }
1858
+ }), A = async (b, k, z) => {
1859
+ const K = typeof b.transform == "function" ? b.transform(k) : k, j = w(K);
1860
+ if (b.required && j) return f(b, z);
1861
+ if (j && !b.required) return !0;
1862
+ if (b.whitespace && typeof K == "string" && K.trim() === "" || b.type && !L(b.type, K) || Array.isArray(b.enum) && !b.enum.includes(K) || b.pattern && !new RegExp(b.pattern).test(String(K))) return f(b, z);
1863
+ const P = U(K);
1864
+ return b.len !== void 0 && P !== void 0 && P !== b.len || b.min !== void 0 && P !== void 0 && P < b.min || b.max !== void 0 && P !== void 0 && P > b.max ? f(b, z) : D(b, K, z);
1865
+ }, re = (b) => {
1866
+ const k = e();
1867
+ return !b.key || !k.table.column.show.list.includes(b.key) || b.table?.header?.groupKey !== void 0 && !b.table.header.show ? !1 : b.show?.table !== void 0 ? $.isFun(b.show?.table, k.table.data) : !0;
1868
+ }, we = () => {
1869
+ const b = e(), k = [], z = (K) => {
1870
+ K.forEach((j) => {
1871
+ if (re(j)) {
1872
+ if (j.children?.length) {
1873
+ z(j.children);
1874
+ return;
1875
+ }
1876
+ k.push(j);
1877
+ }
1878
+ });
1879
+ };
1880
+ return z(b.table.column.list), k;
1881
+ }, Z = async (b, k) => {
1882
+ const z = u(k, b);
1883
+ if (!z) return !0;
1884
+ h(b, k);
1885
+ const K = Array.isArray(z) ? z : [z];
1886
+ for (const j of K) {
1887
+ const P = await A(j, b[k.key], k);
1888
+ if (P !== !0)
1889
+ return n[d(b, k)] = P, !1;
1890
+ }
1891
+ return !0;
1892
+ }, ke = (b) => {
1893
+ const k = [], z = (K) => {
1894
+ K.forEach((j) => {
1895
+ k.push(j), Array.isArray(j.children) && j.children.length && z(j.children);
1896
+ });
1897
+ };
1898
+ return z(b), k;
1899
+ };
1900
+ return {
1901
+ tableEditValidate: {
1902
+ errors: n,
1903
+ clear: r,
1904
+ clearField: h,
1905
+ getFieldError: c,
1906
+ validate: async () => {
1907
+ if (r(), !o.option.table?.editMode) return !0;
1908
+ const b = e(), k = we(), z = ke(b.table.data || []);
1909
+ if ((await Promise.all(z.flatMap((j) => k.map((P) => Z(j, P))))).some((j) => !j)) throw !1;
1910
+ return !0;
1911
+ }
1912
+ }
1913
+ };
1914
+ };
1915
+ class It {
1734
1916
  /**
1735
1917
  * 导出数据为 Excel 文件(.xlsx),自动触发浏览器下载
1736
1918
  *
@@ -1738,134 +1920,134 @@ class Ot {
1738
1920
  * @param columns - 列配置数组,需包含 `key`(数据字段)和 `label`(Excel 表头)
1739
1921
  * @param fileName - 文件名(不含扩展名),支持字符串或返回字符串的函数;默认生成「导出数据_日期_时间戳」
1740
1922
  */
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) => {
1923
+ static exportToExcel = async (o, n, t) => {
1924
+ if (!o || o.length === 0) return;
1925
+ const l = await $.loadModule("xlsx"), a = o.map((g) => {
1744
1926
  const u = {};
1745
- return l.forEach((m) => {
1746
- u[m.label] = c[m.key];
1927
+ return n.forEach((r) => {
1928
+ u[r.label] = g[r.key];
1747
1929
  }), 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`);
1930
+ }), s = l.utils.json_to_sheet(a), d = l.utils.book_new();
1931
+ l.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()}`, l.writeFile(d, `${t}.xlsx`);
1750
1932
  };
1751
1933
  }
1752
- const Mt = (e, a) => ({
1934
+ const Nt = (e, o) => ({
1753
1935
  export: {
1754
1936
  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);
1937
+ start: async (n) => {
1938
+ let l = await e().export.run[n]();
1939
+ const a = o.option.column, s = ObjectUtil.deepMerge({ data: l, columns: a }, {}), d = o.option.tools?.export || {};
1940
+ d.before?.(s), It.exportToExcel(s.data, s.columns, d.fileName);
1759
1941
  },
1760
1942
  select: async () => {
1761
- const l = e();
1762
- l.export.loading = !0;
1943
+ const n = e();
1944
+ n.export.loading = !0;
1763
1945
  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
1946
+ if (o.option.tools?.export?.select) {
1947
+ await o.option.tools.export.select({
1948
+ ...n.page.getQuery(),
1949
+ items: n.table.selection.list
1768
1950
  });
1769
1951
  return;
1770
1952
  }
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;
1953
+ if (n.table.selection.list.length === 0)
1954
+ throw $.fail(C.tCurd("selectDataToExport")), new Error(C.tCurd("selectDataToExport"));
1955
+ return n.table.selection.list;
1774
1956
  } catch (t) {
1775
1957
  console.error(t);
1776
1958
  } finally {
1777
- l.export.loading = !1;
1959
+ n.export.loading = !1;
1778
1960
  }
1779
1961
  },
1780
1962
  page: async () => {
1781
- const l = e();
1782
- l.export.loading = !0;
1963
+ const n = e();
1964
+ n.export.loading = !0;
1783
1965
  try {
1784
- if (a.option.tools?.export?.page) {
1785
- await a.option.tools.export.page({
1786
- ...l.page.getQuery()
1966
+ if (o.option.tools?.export?.page) {
1967
+ await o.option.tools.export.page({
1968
+ ...n.page.getQuery()
1787
1969
  });
1788
1970
  return;
1789
1971
  }
1790
- if (l.table.data.length === 0)
1791
- throw z.fail(w.tCurd("noData")), new Error(w.tCurd("noData"));
1792
- return l.table.data;
1972
+ if (n.table.data.length === 0)
1973
+ throw $.fail(C.tCurd("noData")), new Error(C.tCurd("noData"));
1974
+ return n.table.data;
1793
1975
  } catch (t) {
1794
1976
  console.error(t);
1795
1977
  } finally {
1796
- l.export.loading = !1;
1978
+ n.export.loading = !1;
1797
1979
  }
1798
1980
  },
1799
1981
  all: async () => {
1800
- const l = e();
1801
- l.export.loading = !0;
1982
+ const n = e();
1983
+ n.export.loading = !0;
1802
1984
  try {
1803
- if (a.option.tools?.export?.all) {
1804
- await a.option.tools.export.all({
1805
- ...l.page.getQuery()
1985
+ if (o.option.tools?.export?.all) {
1986
+ await o.option.tools.export.all({
1987
+ ...n.page.getQuery()
1806
1988
  });
1807
1989
  return;
1808
1990
  }
1809
- const t = a.option.api.list, i = await t({
1810
- ...l.page.getQuery({ size: 999999, num: 1 })
1991
+ const t = o.option.api.list, l = await t({
1992
+ ...n.page.getQuery({ size: 999999, num: 1 })
1811
1993
  });
1812
- return (i.data || { [U.config.field.result.list]: i })[U.config.field.result.list];
1994
+ return (l.data || { [T.config.field.result.list]: l })[T.config.field.result.list];
1813
1995
  } catch (t) {
1814
1996
  console.error(t);
1815
1997
  } finally {
1816
- l.export.loading = !1;
1998
+ n.export.loading = !1;
1817
1999
  }
1818
2000
  }
1819
2001
  },
1820
2002
  loading: !1,
1821
- click: (l) => {
2003
+ click: (n) => {
1822
2004
  const t = e();
1823
- t.export.loading || t.export.run.start(l);
2005
+ t.export.loading || t.export.run.start(n);
1824
2006
  }
1825
2007
  }
1826
- }), Ft = (e, a) => ({
2008
+ }), Gt = (e, o) => ({
1827
2009
  remove: {
1828
- title: w.tCurd("deleteTitle"),
2010
+ title: C.tCurd("deleteTitle"),
1829
2011
  show: !1,
1830
2012
  items: [],
1831
2013
  loading: !1,
1832
2014
  close: () => {
1833
2015
  e().remove.show = !1;
1834
2016
  },
1835
- open: (l) => {
1836
- if (l.length === 0) {
1837
- z.fail(w.tCurd("selectDataToDelete"));
2017
+ open: (n) => {
2018
+ if (n.length === 0) {
2019
+ $.fail(C.tCurd("selectDataToDelete"));
1838
2020
  return;
1839
2021
  }
1840
2022
  const t = e();
1841
- t.remove.items = l, t.remove.show = !0;
2023
+ t.remove.items = n, t.remove.show = !0;
1842
2024
  },
1843
2025
  submit: () => {
1844
2026
  FunUtil.throttle(async () => {
1845
- const l = e();
1846
- l.remove.loading = !0;
1847
- const t = a.option.api.delete;
2027
+ const n = e();
2028
+ n.remove.loading = !0;
2029
+ const t = o.option.api.delete;
1848
2030
  try {
1849
2031
  if (!t) return;
1850
2032
  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);
2033
+ [o.option.table?.rowKey]: n.remove.items.map((l) => l[o.option.table?.rowKey]),
2034
+ items: n.remove.items
2035
+ }), $.success(C.tCurd("operationSuccess")), n.table.data.length <= 1 && n.page.num > 1 && (n.page.num -= 1), n.remove.close(), await n.table.getList();
2036
+ } catch (l) {
2037
+ console.error(l);
1856
2038
  } finally {
1857
- l.remove.loading = !1;
2039
+ n.remove.loading = !1;
1858
2040
  }
1859
2041
  });
1860
2042
  }
1861
2043
  }
1862
- }), Ut = (e, a, l) => ({
2044
+ }), Ht = (e, o, n) => ({
1863
2045
  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
2046
+ getColumnSpan: (t, l) => {
2047
+ const a = e(), s = a.update.formGrid?.length ? a.update.formGrid : l || [];
2048
+ return Pe(t, s, a.update.form, a.update.type, {
2049
+ maxSpan: a.update.formMaxSpan || o.option.form?.maxSpan,
2050
+ defaultSpan: o.option.form?.defaultSpan || T.config.form.defaultSpan
1869
2051
  });
1870
2052
  },
1871
2053
  init: () => {
@@ -1873,189 +2055,204 @@ const Mt = (e, a) => ({
1873
2055
  t.initCurdConfig(), t.initColumnOptions(), t.initColumnForm();
1874
2056
  },
1875
2057
  initApiData: async (t) => {
1876
- const i = e(), n = [], o = (d) => {
2058
+ const l = e(), a = [], s = (d) => {
1877
2059
  if (d.children?.length) {
1878
- d.children.forEach((u) => o(u));
2060
+ d.children.forEach((u) => s(u));
1879
2061
  return;
1880
2062
  }
1881
- const c = te(d);
1882
- if (d.options?.[c]?.dataApi && d.options?.[c]?.dataApiConfig?.[t]) {
1883
- if (i.apiDataMap[d.key] && d.options?.[c]?.dataApiConfig?.once) return;
2063
+ const g = ce(d);
2064
+ if (d.options?.[g]?.dataApi && d.options?.[g]?.dataApiConfig?.[t]) {
2065
+ if (l.apiDataMap[d.key] && d.options?.[g]?.dataApiConfig?.once) return;
1884
2066
  const u = (async () => {
1885
2067
  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;
2068
+ let r = await d.options?.[g]?.dataApi?.(l.update.form, l.update.type);
2069
+ if (r) {
2070
+ const h = d.options?.[g]?.dataPath;
2071
+ !Array.isArray(r) && h && (r = ObjectUtil.getPathValue(r, h)), d.options[g].data = r, d.options.search[g].data = r, d.options.search[d.options.search.type ?? g] || (d.options.search[d.options.search.type ?? g] = {}), d.options.search[d.options.search.type ?? g].data = r, d.options.formAdd[g].data = r, d.options.formUpdate[g].data = r, l.apiDataMap[d.key] = r;
1890
2072
  }
1891
2073
  } catch {
1892
2074
  }
1893
2075
  })();
1894
- n.push(u);
2076
+ a.push(u);
1895
2077
  }
1896
2078
  };
1897
- return a.option.column.forEach((d) => o(d)), await Promise.all(n), !0;
2079
+ return o.option.column.forEach((d) => s(d)), await Promise.all(a), !0;
1898
2080
  },
1899
2081
  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];
2082
+ const t = ObjectUtil.deepMerge(T.config, {});
2083
+ 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;
2084
+ const l = ObjectUtil.deepMerge(t, o.option || {});
2085
+ Object.keys(l).forEach((a) => {
2086
+ o.option[a] = l[a];
1905
2087
  });
1906
2088
  },
1907
2089
  initColumnOptions: () => {
1908
2090
  const t = e();
1909
- let i = JSONUtil.cp(U.config.columnConfig);
1910
- i.options = ObjectUtil.deepMerge(
2091
+ let l = JSONUtil.cp(T.config.columnConfig);
2092
+ l.options = ObjectUtil.deepMerge(
1911
2093
  {
1912
2094
  switch: {
1913
- activeText: w.tCurd("switchOn"),
1914
- inactiveText: w.tCurd("switchOff")
2095
+ activeText: C.tCurd("switchOn"),
2096
+ inactiveText: C.tCurd("switchOff")
1915
2097
  }
1916
2098
  },
1917
- i.options
2099
+ l.options
1918
2100
  );
1919
- const n = (o) => {
1920
- const d = te(o);
1921
- for (const u in i) {
2101
+ const a = (s) => {
2102
+ const d = ce(s);
2103
+ for (const u in l) {
1922
2104
  if (u === "table") {
1923
- if (o.table = ObjectUtil.deepMerge(i.table, o.table || {}), o.children) {
1924
- o.children.forEach((m) => n(m));
2105
+ if (s.table = ObjectUtil.deepMerge(l.table, s.table || {}), s.children) {
2106
+ s.children.forEach((r) => a(r));
1925
2107
  return;
1926
2108
  }
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;
2109
+ } else u === "type" ? s.type = s.type || l.type : s[u] = ObjectUtil.deepMerge(l[u], s[u] || {});
2110
+ s.options = s.options || {}, s.options[d] = s.options[d] || {}, s.options[d].size = o.option.size.form;
1929
2111
  }
1930
2112
  ["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;
2113
+ 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);
2114
+ }), s.table = ObjectUtil.deepMerge(s.table, s.options[d].table || {}), d === "switch" && (s.options.switch.tableBeforeChange = async (u, r) => {
2115
+ const h = s.options?.switch;
1934
2116
  try {
1935
- p.tableConfig?.confirm && await l.switchConfirmRef.value?.open({
1936
- title: w.tCurd("confirmModify"),
1937
- content: w.tCurd("confirmSwitchMessage")
2117
+ h.tableConfig?.confirm && await n.switchConfirmRef.value?.open({
2118
+ title: C.tCurd("confirmModify"),
2119
+ content: C.tCurd("confirmSwitchMessage")
1938
2120
  });
1939
2121
  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;
2122
+ if (!o.option.api.update && !h.tableConfig?.api) return;
2123
+ const c = r[o.option.table?.rowKey];
2124
+ h.loadingMap || (h.loadingMap = {}), h.loadingMap[c] || (h.loadingMap[c] = { loading: !1 }), h.loadingMap[c].loading = !0;
2125
+ const f = r[u] === h.activeValue ? h.inactiveValue : h.activeValue, w = h.tableConfig?.api ? h.tableConfig.api : o.option.api.update;
2126
+ if (!w) return;
1945
2127
  try {
1946
- await C({ ...m, [u]: g }, "switch");
2128
+ await w({ ...r, [u]: f }, "switch");
1947
2129
  } catch {
1948
2130
  return !1;
1949
2131
  } finally {
1950
- p.loadingMap[f].loading = !1;
2132
+ h.loadingMap[c].loading = !1;
1951
2133
  }
1952
- return z.success(w.tCurd("operationSuccess")), p.tableConfig?.loadList && (t.table.loading = !0, t.table.getList(), t.table.loading = !1), !0;
1953
- } catch (f) {
1954
- return console.error(f), !1;
2134
+ return $.success(C.tCurd("operationSuccess")), h.tableConfig?.loadList && (t.table.loading = !0, t.table.getList(), t.table.loading = !1), !0;
2135
+ } catch (c) {
2136
+ return console.error(c), !1;
1955
2137
  } finally {
1956
2138
  t.table.loading = !1;
1957
2139
  }
1958
2140
  } catch {
1959
2141
  return !1;
1960
2142
  }
1961
- }), d === "treeSelect" && (o.options.treeSelect.rowKey = a.option.table?.rowKey, o.options.treeSelect.nodeKey = a.option.table?.rowKey);
2143
+ }), d === "treeSelect" && (s.options.treeSelect.rowKey = o.option.table?.rowKey, s.options.treeSelect.nodeKey = o.option.table?.rowKey);
1962
2144
  };
1963
- a.option.column.forEach(n), a.option.table?.column?.forEach(n);
2145
+ o.option.column.forEach(a), o.option.table?.column?.forEach(a);
1964
2146
  },
1965
2147
  initColumnForm: () => {
1966
- const t = e(), i = a.option;
2148
+ const t = e(), l = o.option;
1967
2149
  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) => {
1975
- if (f.children) {
1976
- t.table.column.show.list.push(f.key), f.children.forEach((g) => c(g));
2150
+ const a = o.option.form?.maxSpan || 12, s = o.option.form?.defaultSpan || a / 2, d = qe(o.option.form), g = (c) => {
2151
+ if (c.children) {
2152
+ t.table.column.show.list.push(c.key), c.children.forEach((f) => g(f));
1977
2153
  return;
1978
2154
  }
1979
- 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));
2155
+ t.update.formDefault[c.key] = c.value, c.table?.table && (c.show?.table && t.table.column.show.list.push(c.key), t.table.column.show.listSource.push(c.key));
1980
2156
  };
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, {
1987
- maxSpan: n,
1988
- defaultSpan: o,
1989
- layout: a.option.form?.layout
2157
+ l.column.forEach((c) => {
2158
+ pe(c, !0), g(c);
2159
+ }), o.option.table?.column?.forEach((c) => {
2160
+ pe(c, !1), g(c);
2161
+ }), t.search.column.list = l.column.concat(l.table?.column || []), t.table.column.list = t.search.column.list.filter((c) => c.table?.table), t.search.column.list.sort((c, f) => c.sort?.search - f.sort?.search), t.table.column.list.sort((c, f) => c.sort?.table - f.sort?.table), t.update.rules = {}, $e(l.column, t.update.formDefault, t.update.rules, (c) => d(c, t.update.form)), l.table?.editMode && $e(l.table?.column || [], t.update.formDefault, t.update.rules, (c) => d(c, t.update.form));
2162
+ const u = He(l.column, {
2163
+ maxSpan: a,
2164
+ defaultSpan: s,
2165
+ layout: o.option.form?.layout
1990
2166
  });
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) => {
1996
- f.show?.search || (t.search.formDefault[f.key] = void 0);
2167
+ t.update.formGrid = u.cells, t.update.formMaxSpan = u.maxSpan, t.update.formColumn = Ne(u.cells);
2168
+ const r = o.option.search?.formDefault;
2169
+ r && Object.keys(r).forEach((c) => {
2170
+ t.search.formDefault[c] = r[c];
2171
+ }), l.column.forEach((c) => {
2172
+ c.show?.search || (t.search.formDefault[c.key] = void 0);
1997
2173
  });
1998
- const p = ObjectUtil.deepMerge(t.search.formDefault, {});
1999
- Q.setValue(t.search.form, p, !0);
2174
+ const h = ObjectUtil.deepMerge(t.search.formDefault, {});
2175
+ Y.setValue(t.search.form, h, !0);
2000
2176
  }
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(),
2177
+ }), Wt = (e) => {
2178
+ const o = _(), n = _(), t = _(), l = { switchConfirmRef: o, ruleFormRef: n, tableRef: t }, a = Ae(), s = Ee.getConf("curdConf");
2179
+ let d;
2180
+ const g = (h) => {
2181
+ h = h || d;
2182
+ let c = h, f = h;
2183
+ for (; c?.parentCurdConf; )
2184
+ f = c.parentCurdConf, c = c.parentCurdConf;
2185
+ return f;
2186
+ }, u = () => d;
2187
+ d = le({
2188
+ parentCurdConf: s,
2189
+ getCurdConf: g,
2190
+ getRootCurdConf: g,
2191
+ ...Lt(),
2005
2192
  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({
2193
+ ...Tt(u, e),
2194
+ ...jt(u, e),
2195
+ ...Kt(u, e, l),
2196
+ ...Pt(u, e),
2197
+ ...Nt(u, e),
2198
+ ...xt(u, e, l),
2199
+ ...Gt(u, e),
2200
+ ...Ht(u, e, l)
2201
+ }), d.init();
2202
+ const r = a ? `curdRef-${a.uid}` : "";
2203
+ return s?.formRef && r && (s.formRef.set(r, {
2204
+ validate: async (h) => {
2205
+ const c = await d.update.validate(!1);
2206
+ if (h?.(!!c), !c) throw !1;
2207
+ return !0;
2208
+ }
2209
+ }), Ue(() => {
2210
+ s.formRef.remove(r);
2211
+ })), Re(() => {
2212
+ e.option.init !== !1 && d.table.getList();
2213
+ }), Ee.setConf("curdConf", d), { conf: d, switchConfirmRef: o, ruleFormRef: n, tableRef: t };
2214
+ }, Jt = { class: "dialog-footer" }, qt = /* @__PURE__ */ q({
2018
2215
  __name: "switchConfirm",
2019
2216
  props: {
2020
2217
  size: {}
2021
2218
  },
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;
2027
- })), c = () => {
2028
- l.value = !1, n?.(!0), n = null, o = null;
2219
+ setup(e, { expose: o }) {
2220
+ const n = _(!1), t = _("确认修改"), l = _("确认要修改状态吗?");
2221
+ let a = null, s = null;
2222
+ const d = (r) => (r?.title && (t.value = r.title), r?.content && (l.value = r.content), n.value = !0, new Promise((h, c) => {
2223
+ a = h, s = c;
2224
+ })), g = () => {
2225
+ n.value = !1, a?.(!0), a = null, s = null;
2029
2226
  }, u = () => {
2030
- l.value = !1, o?.(new Error("用户取消操作")), n = null, o = null;
2227
+ n.value = !1, s?.(new Error("用户取消操作")), a = null, s = null;
2031
2228
  };
2032
- return a({
2229
+ return o({
2033
2230
  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),
2231
+ }), (r, h) => {
2232
+ const c = ue("el-form");
2233
+ return m(), y(i(xe), {
2234
+ modelValue: n.value,
2235
+ "onUpdate:modelValue": h[0] || (h[0] = (f) => n.value = f),
2039
2236
  title: t.value,
2040
2237
  "close-on-click-modal": !1,
2041
2238
  width: "400px"
2042
2239
  }, {
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)
2240
+ footer: p(() => [
2241
+ F(c, { size: e.size }, {
2242
+ default: p(() => [
2243
+ O("span", Jt, [
2244
+ F(i(I), { onClick: u }, {
2245
+ default: p(() => [...h[1] || (h[1] = [
2246
+ M("取消", -1)
2050
2247
  ])]),
2051
2248
  _: 1
2052
2249
  }),
2053
- D(r(T), {
2250
+ F(i(I), {
2054
2251
  type: "primary",
2055
- onClick: c
2252
+ onClick: g
2056
2253
  }, {
2057
- default: b(() => [...p[2] || (p[2] = [
2058
- $("确认", -1)
2254
+ default: p(() => [...h[2] || (h[2] = [
2255
+ M("确认", -1)
2059
2256
  ])]),
2060
2257
  _: 1
2061
2258
  })
@@ -2064,27 +2261,27 @@ const Mt = (e, a) => ({
2064
2261
  _: 1
2065
2262
  }, 8, ["size"])
2066
2263
  ]),
2067
- default: b(() => [
2068
- M("div", null, O(i.value), 1)
2264
+ default: p(() => [
2265
+ O("div", null, R(l.value), 1)
2069
2266
  ]),
2070
2267
  _: 1
2071
2268
  }, 8, ["modelValue", "title"]);
2072
2269
  };
2073
2270
  }
2074
- }), Tt = ["innerHTML"], Lt = /* @__PURE__ */ G({
2271
+ }), Qt = ["innerHTML"], Xt = /* @__PURE__ */ q({
2075
2272
  __name: "text",
2076
2273
  props: {
2077
2274
  content: {},
2078
2275
  value: {}
2079
2276
  },
2080
2277
  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", {
2278
+ const o = e, n = oe(() => typeof o.content == "function" ? o.content(o.value) : o.content);
2279
+ return (t, l) => typeof n.value == "object" ? (m(), y(ee(n.value), { key: 0 })) : (m(), v("div", {
2083
2280
  key: 1,
2084
- innerHTML: l.value
2085
- }, null, 8, Tt));
2281
+ innerHTML: n.value
2282
+ }, null, 8, Qt));
2086
2283
  }
2087
- }), Ce = /* @__PURE__ */ G({
2284
+ }), Me = /* @__PURE__ */ q({
2088
2285
  __name: "searchField",
2089
2286
  props: {
2090
2287
  item: {},
@@ -2092,168 +2289,174 @@ const Mt = (e, a) => ({
2092
2289
  type: {}
2093
2290
  },
2094
2291
  setup(e) {
2095
- const a = e, l = Z({
2096
- get: () => a.conf.search.form?.[a.item?.key],
2292
+ const o = e, n = oe({
2293
+ get: () => o.conf.search.form?.[o.item?.key],
2097
2294
  set: (t) => {
2098
- a.item?.key !== void 0 && (a.conf.search.form[a.item.key] = t);
2295
+ o.item?.key !== void 0 && (o.conf.search.form[o.item.key] = t);
2099
2296
  }
2100
2297
  });
2101
- return (t, i) => r(P).customComponent[e.type ?? ""]?.search ? (s(), h(X(r(P).customComponent[e.type ?? ""]?.search), k({
2298
+ return (t, l) => i(W).customComponent[e.type ?? ""]?.search ? (m(), y(ee(i(W).customComponent[e.type ?? ""]?.search), x({
2102
2299
  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({
2300
+ modelValue: n.value,
2301
+ "onUpdate:modelValue": l[0] || (l[0] = (a) => n.value = a)
2302
+ }, e.item.options?.search?.[e.type ?? ""], E(e.item.options?.search?.[e.type ?? ""]?.on || {})), null, 16, ["modelValue"])) : e.type === "input" ? (m(), y(i(se), x({
2106
2303
  key: 1,
2107
- modelValue: l.value,
2108
- "onUpdate:modelValue": i[1] || (i[1] = (n) => l.value = n),
2304
+ modelValue: n.value,
2305
+ "onUpdate:modelValue": l[1] || (l[1] = (a) => n.value = a),
2109
2306
  placeholder: e.conf.search.getPlaceholder(e.item),
2110
2307
  clearable: "",
2111
2308
  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({
2309
+ }, 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" ? (m(), y(i(de), x({
2113
2310
  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")),
2311
+ modelValue: n.value,
2312
+ "onUpdate:modelValue": l[2] || (l[2] = (a) => n.value = a),
2313
+ placeholder: e.conf.search.getPlaceholder(e.item, i(C).tCurd("placeholderSelect")),
2117
2314
  clearable: "",
2118
2315
  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), {
2316
+ }, e.item.options?.search?.switch || e.item.options?.switch, E(e.item.options?.search?.switch?.on || e.item.options?.switch?.on || {})), {
2317
+ default: p(() => [
2318
+ (m(), y(i(ae), {
2122
2319
  key: e.item.options?.switch?.activeValue,
2123
2320
  label: e.item.options?.switch?.activeText,
2124
2321
  value: e.item.options?.switch?.activeValue
2125
2322
  }, null, 8, ["label", "value"])),
2126
- (s(), h(r(ee), {
2323
+ (m(), y(i(ae), {
2127
2324
  key: e.item.options?.switch?.inactiveValue,
2128
2325
  label: e.item.options?.switch?.inactiveText,
2129
2326
  value: e.item.options?.switch?.inactiveValue
2130
2327
  }, null, 8, ["label", "value"]))
2131
2328
  ]),
2132
2329
  _: 1
2133
- }, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "select" ? (s(), h(r(ne), k({
2330
+ }, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "select" ? (m(), y(i(de), x({
2134
2331
  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")),
2332
+ modelValue: n.value,
2333
+ "onUpdate:modelValue": l[3] || (l[3] = (a) => n.value = a),
2334
+ placeholder: e.conf.search.getPlaceholder(e.item, i(C).tCurd("placeholderSelect")),
2138
2335
  clearable: "",
2139
2336
  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), {
2143
- key: n.value,
2144
- label: n.label,
2145
- value: n.value
2337
+ }, e.item.options?.search?.select || e.item.options?.select, E(e.item.options?.search?.select?.on || e.item.options?.select?.on || {})), {
2338
+ default: p(() => [
2339
+ (m(!0), v(B, null, N(e.item.options?.search?.select?.data || e.item.options?.select?.data || [], (a) => (m(), y(i(ae), {
2340
+ key: a.value,
2341
+ label: a.label,
2342
+ value: a.value
2146
2343
  }, null, 8, ["label", "value"]))), 128))
2147
2344
  ]),
2148
2345
  _: 1
2149
- }, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "radio" ? (s(), h(r(xe), k({
2346
+ }, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "radio" ? (m(), y(i(Fe), x({
2150
2347
  key: 4,
2151
- modelValue: l.value,
2152
- "onUpdate:modelValue": i[4] || (i[4] = (n) => l.value = n),
2348
+ modelValue: n.value,
2349
+ "onUpdate:modelValue": l[4] || (l[4] = (a) => n.value = a),
2153
2350
  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), {
2157
- key: n.value,
2158
- label: n.label,
2159
- value: n.value
2351
+ }, e.item.options?.search?.radio || e.item.options?.radio, E(e.item.options?.search?.radio?.on || e.item.options?.radio?.on || {})), {
2352
+ default: p(() => [
2353
+ (m(!0), v(B, null, N(e.item.options?.radio?.data, (a) => (m(), y(i(De), {
2354
+ key: a.value,
2355
+ label: a.label,
2356
+ value: a.value
2160
2357
  }, null, 8, ["label", "value"]))), 128))
2161
2358
  ]),
2162
2359
  _: 1
2163
- }, 16, ["modelValue", "disabled"])) : e.type === "datetime" ? (s(), h(r(Se), k({
2360
+ }, 16, ["modelValue", "disabled"])) : e.type === "datetime" ? (m(), y(i(Oe), x({
2164
2361
  key: 5,
2165
- modelValue: l.value,
2166
- "onUpdate:modelValue": i[5] || (i[5] = (n) => l.value = n),
2362
+ modelValue: n.value,
2363
+ "onUpdate:modelValue": l[5] || (l[5] = (a) => n.value = a),
2167
2364
  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({
2365
+ }, 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 && i(W).customComponent[e.type] ? (m(), y(ee(i(W).customComponent[e.type]), x({
2169
2366
  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 || {}), {
2367
+ modelValue: n.value,
2368
+ "onUpdate:modelValue": l[6] || (l[6] = (a) => n.value = a)
2369
+ }, 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
2370
  disabled: e.item.disabled?.search
2174
- }), null, 16, ["modelValue", "disabled"])) : v("", !0);
2371
+ }), null, 16, ["modelValue", "disabled"])) : V("", !0);
2175
2372
  }
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 = {
2373
+ }), ie = (e, o) => {
2374
+ const n = e.__vccOpts || e;
2375
+ for (const [t, l] of o)
2376
+ n[t] = l;
2377
+ return n;
2378
+ }, Yt = {}, Zt = {
2182
2379
  xmlns: "http://www.w3.org/2000/svg",
2183
2380
  viewBox: "64 64 896 896"
2184
2381
  };
2185
- function It(e, a) {
2186
- return s(), y("svg", Pt, [...a[0] || (a[0] = [
2187
- M("path", {
2382
+ function _t(e, o) {
2383
+ return m(), v("svg", Zt, [...o[0] || (o[0] = [
2384
+ O("path", {
2188
2385
  fill: "currentColor",
2189
2386
  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
2387
  }, null, -1)
2191
2388
  ])]);
2192
2389
  }
2193
- const Kt = /* @__PURE__ */ oe(jt, [["render", It]]), Ht = {}, Gt = {
2390
+ const eo = /* @__PURE__ */ ie(Yt, [["render", _t]]), to = {}, oo = {
2194
2391
  xmlns: "http://www.w3.org/2000/svg",
2195
2392
  viewBox: "64 64 896 896"
2196
2393
  };
2197
- function Nt(e, a) {
2198
- return s(), y("svg", Gt, [...a[0] || (a[0] = [
2199
- M("path", {
2394
+ function ao(e, o) {
2395
+ return m(), v("svg", oo, [...o[0] || (o[0] = [
2396
+ O("path", {
2200
2397
  fill: "currentColor",
2201
2398
  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
2399
  }, null, -1)
2203
2400
  ])]);
2204
2401
  }
2205
- const Wt = /* @__PURE__ */ oe(Ht, [["render", Nt]]), Jt = {}, Qt = {
2402
+ const no = /* @__PURE__ */ ie(to, [["render", ao]]), lo = {}, io = {
2206
2403
  xmlns: "http://www.w3.org/2000/svg",
2207
2404
  viewBox: "0 0 1024 1024"
2208
2405
  };
2209
- function qt(e, a) {
2210
- return s(), y("svg", Qt, [...a[0] || (a[0] = [
2211
- M("path", {
2406
+ function ro(e, o) {
2407
+ return m(), v("svg", io, [...o[0] || (o[0] = [
2408
+ O("path", {
2212
2409
  fill: "currentColor",
2213
2410
  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
2411
  }, null, -1)
2215
2412
  ])]);
2216
2413
  }
2217
- const Xt = /* @__PURE__ */ oe(Jt, [["render", qt]]), Yt = {}, Zt = {
2414
+ const so = /* @__PURE__ */ ie(lo, [["render", ro]]), uo = {}, co = {
2218
2415
  "data-v-58697b5c": "",
2219
2416
  xmlns: "http://www.w3.org/2000/svg",
2220
2417
  viewBox: "0 0 1024 1024"
2221
2418
  };
2222
- function _t(e, a) {
2223
- return s(), y("svg", Zt, [...a[0] || (a[0] = [
2224
- M("path", {
2419
+ function fo(e, o) {
2420
+ return m(), v("svg", co, [...o[0] || (o[0] = [
2421
+ O("path", {
2225
2422
  fill: "currentColor",
2226
2423
  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
2424
  }, null, -1)
2228
2425
  ])]);
2229
2426
  }
2230
- const eo = /* @__PURE__ */ oe(Yt, [["render", _t]]), to = {}, oo = {
2427
+ const mo = /* @__PURE__ */ ie(uo, [["render", fo]]), go = {}, ho = {
2231
2428
  "data-v-58697b5c": "",
2232
2429
  xmlns: "http://www.w3.org/2000/svg",
2233
2430
  viewBox: "0 0 1024 1024"
2234
2431
  };
2235
- function ao(e, a) {
2236
- return s(), y("svg", oo, [...a[0] || (a[0] = [
2237
- M("path", {
2432
+ function bo(e, o) {
2433
+ return m(), v("svg", ho, [...o[0] || (o[0] = [
2434
+ O("path", {
2238
2435
  fill: "currentColor",
2239
2436
  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
2437
  }, null, -1)
2241
2438
  ])]);
2242
2439
  }
2243
- const no = /* @__PURE__ */ oe(to, [["render", ao]]), lo = {}, io = {
2440
+ const yo = /* @__PURE__ */ ie(go, [["render", bo]]), po = {}, wo = {
2244
2441
  "data-v-58697b5c": "",
2245
2442
  xmlns: "http://www.w3.org/2000/svg",
2246
2443
  viewBox: "0 0 1024 1024"
2247
2444
  };
2248
- function ro(e, a) {
2249
- return s(), y("svg", io, [...a[0] || (a[0] = [
2250
- M("path", {
2445
+ function ko(e, o) {
2446
+ return m(), v("svg", wo, [...o[0] || (o[0] = [
2447
+ O("path", {
2251
2448
  fill: "currentColor",
2252
2449
  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
2450
  }, null, -1)
2254
2451
  ])]);
2255
2452
  }
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({
2453
+ const vo = /* @__PURE__ */ ie(po, [["render", ko]]), Co = { class: "row flex-center table-header-label inline" }, xo = { class: "table-header-tooltip" }, Vo = ["innerHTML"], So = {
2454
+ key: 1,
2455
+ class: "table-header-required"
2456
+ }, Eo = ["onClick"], $o = {
2457
+ key: 0,
2458
+ class: "table-edit-form"
2459
+ }, zo = { key: 1 }, Mo = ["onClick", "innerHTML"], Fo = /* @__PURE__ */ q({
2257
2460
  __name: "tableColumn",
2258
2461
  props: {
2259
2462
  conf: {},
@@ -2261,206 +2464,223 @@ const so = /* @__PURE__ */ oe(lo, [["render", ro]]), uo = { class: "row flex-cen
2261
2464
  option: {}
2262
2465
  },
2263
2466
  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
2467
+ const o = $.isFun, n = e, l = Ae().type, a = (d) => d === !0 ? !0 : (Array.isArray(d) ? d : d ? [d] : []).some((u) => u?.required === !0), s = (d) => n.option.table?.editMode ? a(d.rules) || a(n.conf.update.rules?.[d.key]) : !1;
2468
+ return (d, g) => {
2469
+ const u = ue("el-tooltip");
2470
+ return m(!0), v(B, null, N(e.columnList, (r) => (m(), v(B, {
2471
+ key: r.key
2269
2472
  }, [
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({
2473
+ e.conf.table.column.show.list.includes(r.key) && (r.show?.table === void 0 || i(o)(r.show?.table, e.conf.table.data)) ? (m(), v(B, { key: 0 }, [
2474
+ r.table?.header?.groupKey === void 0 || r.table.header.show ? (m(), y(i(ge), x({
2272
2475
  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, {
2476
+ prop: r.key,
2477
+ label: r.label
2478
+ }, { ref_for: !0 }, r.table), {
2479
+ header: p(() => [
2480
+ S(d.$slots, "table-header-" + r.key, { item: r }, () => [
2481
+ O("div", Co, [
2482
+ r.table?.header?.tooltip ? (m(), y(u, {
2280
2483
  key: 0,
2281
2484
  effect: "dark",
2282
2485
  placement: "top"
2283
2486
  }, {
2284
- content: b(() => [
2285
- M("div", {
2286
- innerHTML: o.table?.header?.tooltip
2287
- }, null, 8, fo)
2487
+ content: p(() => [
2488
+ O("div", {
2489
+ innerHTML: r.table?.header?.tooltip
2490
+ }, null, 8, Vo)
2288
2491
  ]),
2289
- default: b(() => [
2290
- M("span", co, [
2291
- D(eo)
2492
+ default: p(() => [
2493
+ O("span", xo, [
2494
+ F(mo)
2292
2495
  ])
2293
2496
  ]),
2294
2497
  _: 2
2295
- }, 1024)) : v("", !0),
2296
- $(" " + O(o.label) + " ", 1),
2297
- o.table?.header?.group !== void 0 ? (s(), y("span", {
2298
- key: 1,
2498
+ }, 1024)) : V("", !0),
2499
+ s(r) ? (m(), v("span", So, "*")) : V("", !0),
2500
+ M(" " + R(r.label) + " ", 1),
2501
+ r.table?.header?.group !== void 0 ? (m(), v("span", {
2502
+ key: 2,
2299
2503
  class: "table-header-plus",
2300
- onClick: ot(
2504
+ onClick: ut(
2301
2505
  () => {
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);
2506
+ r.table.header.group = !r.table.header.group, e.columnList.forEach((h) => {
2507
+ h.table?.header?.groupKey === r.key && (h.table.header.show = !r.table.header.group);
2304
2508
  });
2305
2509
  },
2306
2510
  ["stop"]
2307
2511
  )
2308
2512
  }, [
2309
- o.table.header.group ? (s(), h(no, { key: 0 })) : (s(), h(so, { key: 1 }))
2310
- ], 8, mo)) : v("", !0)
2513
+ r.table.header.group ? (m(), y(yo, { key: 0 })) : (m(), y(vo, { key: 1 }))
2514
+ ], 8, Eo)) : V("", !0)
2311
2515
  ])
2312
2516
  ])
2313
2517
  ]),
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)), {
2518
+ default: p(({ row: h }) => [
2519
+ r.children ? (m(), v(B, { key: 0 }, [
2520
+ g[0] || (g[0] = M("   ", -1)),
2521
+ (m(), y(ee(i(l)), {
2318
2522
  conf: e.conf,
2319
- columnList: o.children,
2523
+ columnList: r.children,
2320
2524
  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 || {}))
2525
+ }, X({ _: 2 }, [
2526
+ N(d.$slots, (c, f) => ({
2527
+ name: f,
2528
+ fn: p((w) => [
2529
+ S(d.$slots, f, x({ ref_for: !0 }, w || {}))
2326
2530
  ])
2327
2531
  }))
2328
2532
  ]), 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))
2533
+ ], 64)) : (m(), v(B, { key: 1 }, [
2534
+ e.option.table?.editMode ? (m(), v("div", $o, [
2535
+ F(i(he), {
2536
+ size: e.option.size?.table,
2537
+ error: e.conf.tableEditValidate.getFieldError(h, r),
2538
+ class: "table-edit-form-item"
2539
+ }, {
2540
+ default: p(() => [
2541
+ O("div", {
2542
+ class: J(["row", ["table-edit-" + r.key]]),
2543
+ style: { width: "100%" }
2544
+ }, [
2545
+ S(d.$slots, "table-edit-left-" + r.key, {
2546
+ row: h,
2547
+ item: r
2548
+ }),
2549
+ r.type === "input" ? (m(), y(i(se), x({
2550
+ key: 0,
2551
+ modelValue: h[r.key],
2552
+ "onUpdate:modelValue": (c) => h[r.key] = c,
2553
+ disabled: e.conf.update.getDisabled(r, !0),
2554
+ class: "col"
2555
+ }, { ref_for: !0 }, e.conf.update.getBind(r), E(e.conf.update.getOn(r, h)), {
2556
+ "onUpdate:modelValue": (c) => e.conf.tableEditValidate.clearField(h, r)
2557
+ }), X({ _: 2 }, [
2558
+ r.options?.input?.prepend ? {
2559
+ name: "prepend",
2560
+ fn: p(() => [
2561
+ M(R(typeof r.options?.input?.prepend == "function" ? r.options?.input?.prepend(h) : r.options?.input?.prepend), 1)
2562
+ ]),
2563
+ key: "0"
2564
+ } : void 0
2565
+ ]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : r.type === "select" ? (m(), y(i(de), x({
2566
+ key: 1,
2567
+ modelValue: h[r.key],
2568
+ "onUpdate:modelValue": (c) => h[r.key] = c,
2569
+ disabled: e.conf.update.getDisabled(r, !0),
2570
+ class: "col"
2571
+ }, { ref_for: !0 }, e.conf.update.getBind(r), E(e.conf.update.getOn(r, h)), {
2572
+ "onUpdate:modelValue": (c) => e.conf.tableEditValidate.clearField(h, r)
2573
+ }), {
2574
+ default: p(() => [
2575
+ (m(!0), v(B, null, N(r.options?.search?.select?.data || r.options?.select?.data, (c) => (m(), y(i(ae), {
2576
+ key: c.value,
2577
+ label: c.label,
2578
+ value: c.value
2579
+ }, null, 8, ["label", "value"]))), 128))
2580
+ ]),
2581
+ _: 2
2582
+ }, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : r.type === "switch" ? (m(), y(i(me), x({
2583
+ key: 2,
2584
+ modelValue: h[r.key],
2585
+ "onUpdate:modelValue": (c) => h[r.key] = c,
2586
+ disabled: e.conf.update.getDisabled(r, !0),
2587
+ class: "col"
2588
+ }, { ref_for: !0 }, e.conf.update.getBind(r), E(e.conf.update.getOn(r, h)), {
2589
+ "onUpdate:modelValue": (c) => e.conf.tableEditValidate.clearField(h, r)
2590
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : V("", !0),
2591
+ S(d.$slots, "table-edit-right-" + r.key, {
2592
+ row: h,
2593
+ item: r
2594
+ })
2595
+ ], 2)
2366
2596
  ]),
2367
2597
  _: 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({
2598
+ }, 1032, ["size", "error"])
2599
+ ])) : (m(), v(B, { key: 1 }, [
2600
+ e.conf.update.type === i($).EDialog.Update && i(o)(r.show?.form, e.conf.update.form, i($).EDialog.Update) && e.option.table?.inlineEdit && e.conf.update.form[e.option.table?.rowKey] === h[e.option.table?.rowKey] && (r.type === "input" || r.type === "select") ? (m(), v(B, { key: 0 }, [
2601
+ r.type === "input" ? (m(), y(i(se), x({
2382
2602
  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 ? {
2603
+ modelValue: e.conf.update.form[r.key],
2604
+ "onUpdate:modelValue": (c) => e.conf.update.form[r.key] = c,
2605
+ disabled: e.conf.update.getDisabled(r, !0)
2606
+ }, { ref_for: !0 }, e.conf.update.getBind(r), E(e.conf.update.getOn(r, h)), { style: { width: "100%" } }), X({ _: 2 }, [
2607
+ r.options?.input?.prepend ? {
2388
2608
  name: "prepend",
2389
- fn: b(() => [
2390
- $(O(typeof o.options?.input?.prepend == "function" ? o.options?.input?.prepend(d) : o.options?.input?.prepend), 1)
2609
+ fn: p(() => [
2610
+ M(R(typeof r.options?.input?.prepend == "function" ? r.options?.input?.prepend(h) : r.options?.input?.prepend), 1)
2391
2611
  ]),
2392
2612
  key: "0"
2393
2613
  } : void 0
2394
- ]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.type === "select" ? (s(), h(r(ne), k({
2614
+ ]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : r.type === "select" ? (m(), y(i(de), x({
2395
2615
  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), {
2616
+ modelValue: e.conf.update.form[r.key],
2617
+ "onUpdate:modelValue": (c) => e.conf.update.form[r.key] = c,
2618
+ disabled: e.conf.update.getDisabled(r, !0)
2619
+ }, { ref_for: !0 }, e.conf.update.getBind(r), E(e.conf.update.getOn(r, h)), { style: { width: "100%" } }), {
2620
+ default: p(() => [
2621
+ (m(!0), v(B, null, N(r.options?.search?.select?.data || r.options?.select?.data, (c) => (m(), y(i(ae), {
2402
2622
  key: c.value,
2403
2623
  label: c.label,
2404
2624
  value: c.value
2405
2625
  }, null, 8, ["label", "value"]))), 128))
2406
2626
  ]),
2407
2627
  _: 2
2408
- }, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.type === "switch" ? (s(), h(r(se), k({
2628
+ }, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : r.type === "switch" ? (m(), y(i(me), x({
2409
2629
  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, {
2630
+ modelValue: e.conf.update.form[r.key],
2631
+ "onUpdate:modelValue": (c) => e.conf.update.form[r.key] = c
2632
+ }, { ref_for: !0 }, e.conf.update.getBind(r), E(e.conf.update.getOn(r, h)), {
2633
+ disabled: e.conf.update.getDisabled(r, !0)
2634
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : V("", !0)
2635
+ ], 64)) : S(d.$slots, "table-" + r.key, {
2416
2636
  key: 1,
2417
- row: d,
2418
- item: o
2637
+ row: h,
2638
+ item: r
2419
2639
  }, () => [
2420
- r(P).customComponent[o.type ?? ""]?.table ? (s(), h(X(r(P).customComponent[o.type ?? ""]?.table), k({
2640
+ i(W).customComponent[r.type ?? ""]?.table ? (m(), y(ee(i(W).customComponent[r.type ?? ""]?.table), x({
2421
2641
  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({
2642
+ modelValue: h[r.key],
2643
+ "onUpdate:modelValue": (c) => h[r.key] = c
2644
+ }, { ref_for: !0 }, r.options?.[r.type ?? ""], E(r.options?.[r.type ?? ""]?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue"])) : r.type === "switch" ? (m(), v(B, { key: 1 }, [
2645
+ r.options?.switch?.tableConfig?.change ? (m(), y(i(me), x({
2426
2646
  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", {
2647
+ modelValue: h[r.key],
2648
+ "onUpdate:modelValue": (c) => h[r.key] = c,
2649
+ loading: r.options?.switch?.loadingMap?.[h[e.option.table?.rowKey]]?.loading,
2650
+ "before-change": () => r.options?.switch?.tableBeforeChange?.(r.key, h)
2651
+ }, { ref_for: !0 }, r.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "loading", "before-change"])) : (m(), v("span", zo, R(h[r.key] === r.options?.switch?.activeValue ? r.options?.switch?.activeText : r.options?.switch?.inactiveText), 1))
2652
+ ], 64)) : (m(), v("span", {
2433
2653
  key: 2,
2434
- style: ce({
2435
- "--table-text-click-color": o.table?.click?.color
2654
+ style: be({
2655
+ "--table-text-click-color": r.table?.click?.color
2436
2656
  }),
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))
2657
+ class: J({ "table-text-click": r.table?.click?.callback }),
2658
+ onClick: (c) => r.table?.click?.callback?.(h),
2659
+ innerHTML: r.table?.format ? r.table?.format(h) : h[r.key]
2660
+ }, null, 14, Mo))
2441
2661
  ])
2442
2662
  ], 64))
2443
2663
  ], 64))
2444
2664
  ]),
2445
2665
  _: 2
2446
- }, 1040, ["prop", "label"])) : v("", !0)
2447
- ], 64)) : v("", !0)
2666
+ }, 1040, ["prop", "label"])) : V("", !0)
2667
+ ], 64)) : V("", !0)
2448
2668
  ], 64))), 128);
2449
2669
  };
2450
2670
  }
2451
- }), yo = {
2671
+ }), Do = {
2452
2672
  key: 0,
2453
2673
  class: "relative curd-search fit-width"
2454
- }, po = { class: "mb-10 flex justify-between items-center fit-width" }, wo = {
2674
+ }, Oo = { class: "mb-10 flex justify-between items-center fit-width" }, Ro = {
2455
2675
  class: "flex items-center",
2456
2676
  style: { gap: "10px" }
2457
- }, ko = { key: 0 }, vo = { key: 1 }, Co = { key: 2 }, xo = { class: "export-btn" }, Vo = {
2677
+ }, Uo = { key: 0 }, Ao = { key: 1 }, Bo = { key: 2 }, Lo = { class: "export-btn" }, To = {
2458
2678
  key: 1,
2459
2679
  class: "export-btn"
2460
- }, So = {
2680
+ }, jo = {
2461
2681
  class: "flex items-center table-tools-right",
2462
2682
  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({
2683
+ }, Ko = { class: "row justify-end mt-10 mb-10 table-bottom-pagination" }, Po = { class: "dialog-footer" }, Io = { key: 0 }, No = { key: 1 }, Go = { class: "dialog-footer" }, Ho = /* @__PURE__ */ q({
2464
2684
  __name: "index",
2465
2685
  props: {
2466
2686
  /**
@@ -2482,278 +2702,278 @@ const so = /* @__PURE__ */ oe(lo, [["render", ro]]), uo = { class: "row flex-cen
2482
2702
  default: void 0
2483
2703
  }
2484
2704
  },
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({
2488
- 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"]])
2705
+ setup(e, { expose: o }) {
2706
+ const n = $.EDialog, t = e, l = $.isFun, { conf: a, switchConfirmRef: s, ruleFormRef: d, tableRef: g } = Wt(t);
2707
+ return o({
2708
+ conf: a
2709
+ }), (u, r) => {
2710
+ const h = ue("el-tooltip"), c = ct("loading");
2711
+ return m(), v("div", {
2712
+ class: J(["relative cc1-form-box", [e.option.table?.fitHeight ? "col" : "no-min-height"]])
2493
2713
  }, [
2494
- M("div", {
2495
- class: I(["row", [e.option.table?.fitHeight ? "absolute fit" : ""]]),
2714
+ O("div", {
2715
+ class: J(["row", [e.option.table?.fitHeight ? "absolute fit" : ""]]),
2496
2716
  style: { overflow: "hidden" }
2497
2717
  }, [
2498
- x(u.$slots, "box-left"),
2499
- M("div", {
2500
- class: I(["column fit-width no-wrap", [e.option.table?.fitHeight ? "col" : ""]])
2718
+ S(u.$slots, "box-left"),
2719
+ O("div", {
2720
+ class: J(["column fit-width no-wrap", [e.option.table?.fitHeight ? "col" : ""]])
2501
2721
  }, [
2502
- e.option.search?.show !== !1 ? (s(), y("div", yo, [
2503
- D(r(Y), {
2504
- model: r(n).search.form,
2722
+ e.option.search?.show !== !1 ? (m(), v("div", Do, [
2723
+ F(i(te), {
2724
+ model: i(a).search.form,
2505
2725
  inline: "",
2506
2726
  size: e.option.size?.search
2507
2727
  }, {
2508
- default: b(() => [
2509
- x(u.$slots, "search-start", {
2510
- row: r(n).search.form
2728
+ default: p(() => [
2729
+ S(u.$slots, "search-start", {
2730
+ row: i(a).search.form
2511
2731
  }),
2512
- (s(!0), y(F, null, L(r(n).search.column.list, (g) => (s(), y(F, {
2513
- key: g.key
2732
+ (m(!0), v(B, null, N(i(a).search.column.list, (f) => (m(), v(B, {
2733
+ key: f.key
2514
2734
  }, [
2515
- x(u.$slots, "search-" + g.key + "-start", {
2516
- row: r(n).search.form
2735
+ S(u.$slots, "search-" + f.key + "-start", {
2736
+ row: i(a).search.form
2517
2737
  }),
2518
- (typeof g.show?.search == "function" ? g.show?.search(r(n).search.form) : g.show?.search) ? (s(), h(r(be), {
2738
+ (typeof f.show?.search == "function" ? f.show?.search(i(a).search.form) : f.show?.search) ? (m(), y(i(he), {
2519
2739
  key: 0,
2520
- label: g.text?.search?.label ?? g.label
2740
+ label: f.text?.search?.label ?? f.label
2521
2741
  }, {
2522
- default: b(() => [
2523
- x(u.$slots, "search-" + g.key + "-left", {
2524
- row: r(n).search.form
2742
+ default: p(() => [
2743
+ S(u.$slots, "search-" + f.key + "-left", {
2744
+ row: i(a).search.form
2525
2745
  }),
2526
- x(u.$slots, "search-" + g.key, {
2527
- row: r(n).search.form
2746
+ S(u.$slots, "search-" + f.key, {
2747
+ row: i(a).search.form
2528
2748
  }, () => [
2529
- g.options?.search?.type ? (s(), h(Ce, {
2749
+ f.options?.search?.type ? (m(), y(Me, {
2530
2750
  key: 0,
2531
- item: g,
2532
- conf: r(n),
2533
- type: g.options.search.type
2534
- }, null, 8, ["item", "conf", "type"])) : (s(), h(Ce, {
2751
+ item: f,
2752
+ conf: i(a),
2753
+ type: f.options.search.type
2754
+ }, null, 8, ["item", "conf", "type"])) : (m(), y(Me, {
2535
2755
  key: 1,
2536
- item: g,
2537
- conf: r(n),
2538
- type: g.type
2756
+ item: f,
2757
+ conf: i(a),
2758
+ type: f.type
2539
2759
  }, null, 8, ["item", "conf", "type"]))
2540
2760
  ]),
2541
- x(u.$slots, "search-" + g.key + "-right", {
2542
- row: r(n).search.form
2761
+ S(u.$slots, "search-" + f.key + "-right", {
2762
+ row: i(a).search.form
2543
2763
  })
2544
2764
  ]),
2545
2765
  _: 2
2546
- }, 1032, ["label"])) : v("", !0),
2547
- x(u.$slots, "search-" + g.key + "-end", {
2548
- row: r(n).search.form
2766
+ }, 1032, ["label"])) : V("", !0),
2767
+ S(u.$slots, "search-" + f.key + "-end", {
2768
+ row: i(a).search.form
2549
2769
  })
2550
2770
  ], 64))), 128)),
2551
- x(u.$slots, "search-center", {
2552
- row: r(n).search.form
2771
+ S(u.$slots, "search-center", {
2772
+ row: i(a).search.form
2553
2773
  }),
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), {
2774
+ e.option.tools?.search || e.option.tools?.reset ? (m(), y(i(he), { key: 0 }, {
2775
+ default: p(() => [
2776
+ e.option.tools?.search ? (m(), y(i(I), {
2557
2777
  key: 0,
2558
2778
  type: "primary",
2559
- onClick: r(n).search.submit
2779
+ onClick: i(a).search.submit
2560
2780
  }, {
2561
- default: b(() => [
2562
- $(O(r(w).tCurd("search")), 1)
2781
+ default: p(() => [
2782
+ M(R(i(C).tCurd("search")), 1)
2563
2783
  ]),
2564
2784
  _: 1
2565
- }, 8, ["onClick"])) : v("", !0),
2566
- e.option.tools?.reset ? (s(), h(r(T), {
2785
+ }, 8, ["onClick"])) : V("", !0),
2786
+ e.option.tools?.reset ? (m(), y(i(I), {
2567
2787
  key: 1,
2568
- onClick: r(n).search.reset
2788
+ onClick: i(a).search.reset
2569
2789
  }, {
2570
- default: b(() => [
2571
- $(O(r(w).tCurd("reset")), 1)
2790
+ default: p(() => [
2791
+ M(R(i(C).tCurd("reset")), 1)
2572
2792
  ]),
2573
2793
  _: 1
2574
- }, 8, ["onClick"])) : v("", !0)
2794
+ }, 8, ["onClick"])) : V("", !0)
2575
2795
  ]),
2576
2796
  _: 1
2577
- })) : v("", !0),
2578
- x(u.$slots, "search-end", {
2579
- row: r(n).search.form
2797
+ })) : V("", !0),
2798
+ S(u.$slots, "search-end", {
2799
+ row: i(a).search.form
2580
2800
  })
2581
2801
  ]),
2582
2802
  _: 3
2583
2803
  }, 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), {
2804
+ ])) : V("", !0),
2805
+ O("div", Oo, [
2806
+ O("div", Ro, [
2807
+ i(l)(e.option.tools?.add) ? (m(), v("div", Uo, [
2808
+ F(i(I), {
2589
2809
  type: "primary",
2590
- onClick: m[0] || (m[0] = (g) => r(n).update.open(r(l).Add)),
2810
+ onClick: r[0] || (r[0] = (f) => i(a).update.open(i(n).Add)),
2591
2811
  size: e.option.size?.search
2592
2812
  }, {
2593
- default: b(() => [
2594
- $(O(r(w).tCurd("add")), 1)
2813
+ default: p(() => [
2814
+ M(R(i(C).tCurd("add")), 1)
2595
2815
  ]),
2596
2816
  _: 1
2597
2817
  }, 8, ["size"])
2598
- ])) : v("", !0),
2599
- e.option.table?.selectable && r(i)(e.option.tools?.delete) ? (s(), y("div", vo, [
2600
- D(r(T), {
2818
+ ])) : V("", !0),
2819
+ e.option.table?.selectable && i(l)(e.option.tools?.delete) ? (m(), v("div", Ao, [
2820
+ F(i(I), {
2601
2821
  type: "danger",
2602
- onClick: m[1] || (m[1] = (g) => r(n).remove.open(r(n).table.selection.list)),
2822
+ onClick: r[1] || (r[1] = (f) => i(a).remove.open(i(a).table.selection.list)),
2603
2823
  size: e.option.size?.search
2604
2824
  }, {
2605
- default: b(() => [
2606
- $(O(r(w).tCurd("delete")), 1)
2825
+ default: p(() => [
2826
+ M(R(i(C).tCurd("delete")), 1)
2607
2827
  ]),
2608
2828
  _: 1
2609
2829
  }, 8, ["size"])
2610
- ])) : v("", !0),
2611
- e.option.tools?.expand ? (s(), y("div", Co, [
2612
- D(r(T), {
2830
+ ])) : V("", !0),
2831
+ e.option.tools?.expand ? (m(), v("div", Bo, [
2832
+ F(i(I), {
2613
2833
  type: "warning",
2614
- onClick: m[2] || (m[2] = (g) => r(n).table.expand.all()),
2834
+ onClick: r[2] || (r[2] = (f) => i(a).table.expand.all()),
2615
2835
  size: e.option.size?.search
2616
2836
  }, {
2617
- default: b(() => [
2618
- $(O(r(w).tCurd("expandCollapse")), 1)
2837
+ default: p(() => [
2838
+ M(R(i(C).tCurd("expandCollapse")), 1)
2619
2839
  ]),
2620
2840
  _: 1
2621
2841
  }, 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), {
2842
+ ])) : V("", !0),
2843
+ e.option.tools?.export?.show ? (m(), v(B, { key: 3 }, [
2844
+ e.option.tools?.export?.dropdown?.show ? (m(), y(i(it), {
2625
2845
  key: 0,
2626
- onCommand: r(n).export.click
2846
+ onCommand: i(a).export.click
2627
2847
  }, {
2628
- dropdown: b(() => [
2629
- D(r(Ze), {
2848
+ dropdown: p(() => [
2849
+ F(i(rt), {
2630
2850
  size: e.option.size?.search
2631
2851
  }, {
2632
- default: b(() => [
2633
- e.option.tools?.export?.dropdown?.select && (e.option.table?.selectable || r(i)(e.option.tools?.delete)) ? (s(), h(r(he), {
2852
+ default: p(() => [
2853
+ e.option.tools?.export?.dropdown?.select && (e.option.table?.selectable || i(l)(e.option.tools?.delete)) ? (m(), y(i(Ce), {
2634
2854
  key: 0,
2635
2855
  command: "select"
2636
2856
  }, {
2637
- default: b(() => [
2638
- $(O(r(w).tCurd("exportSelect")), 1)
2857
+ default: p(() => [
2858
+ M(R(i(C).tCurd("exportSelect")), 1)
2639
2859
  ]),
2640
2860
  _: 1
2641
- })) : v("", !0),
2642
- e.option.tools?.export?.dropdown?.page ? (s(), h(r(he), {
2861
+ })) : V("", !0),
2862
+ e.option.tools?.export?.dropdown?.page ? (m(), y(i(Ce), {
2643
2863
  key: 1,
2644
2864
  command: "page"
2645
2865
  }, {
2646
- default: b(() => [
2647
- $(O(r(w).tCurd("exportPage")), 1)
2866
+ default: p(() => [
2867
+ M(R(i(C).tCurd("exportPage")), 1)
2648
2868
  ]),
2649
2869
  _: 1
2650
- })) : v("", !0),
2651
- e.option.tools?.export?.dropdown?.all ? (s(), h(r(he), {
2870
+ })) : V("", !0),
2871
+ e.option.tools?.export?.dropdown?.all ? (m(), y(i(Ce), {
2652
2872
  key: 2,
2653
2873
  command: "all"
2654
2874
  }, {
2655
- default: b(() => [
2656
- $(O(r(w).tCurd("exportAll")), 1)
2875
+ default: p(() => [
2876
+ M(R(i(C).tCurd("exportAll")), 1)
2657
2877
  ]),
2658
2878
  _: 1
2659
- })) : v("", !0)
2879
+ })) : V("", !0)
2660
2880
  ]),
2661
2881
  _: 1
2662
2882
  }, 8, ["size"])
2663
2883
  ]),
2664
- default: b(() => [
2665
- M("div", xo, [
2666
- D(r(T), {
2884
+ default: p(() => [
2885
+ O("div", Lo, [
2886
+ F(i(I), {
2667
2887
  type: "warning",
2668
- loading: r(n).export.loading,
2888
+ loading: i(a).export.loading,
2669
2889
  size: e.option.size?.search
2670
2890
  }, {
2671
- default: b(() => [
2672
- $(O(r(w).tCurd("export")), 1)
2891
+ default: p(() => [
2892
+ M(R(i(C).tCurd("export")), 1)
2673
2893
  ]),
2674
2894
  _: 1
2675
2895
  }, 8, ["loading", "size"])
2676
2896
  ])
2677
2897
  ]),
2678
2898
  _: 1
2679
- }, 8, ["onCommand"])) : (s(), y("div", Vo, [
2680
- D(r(T), {
2899
+ }, 8, ["onCommand"])) : (m(), v("div", To, [
2900
+ F(i(I), {
2681
2901
  type: "warning",
2682
- loading: r(n).export.loading,
2902
+ loading: i(a).export.loading,
2683
2903
  size: e.option.size?.search,
2684
- onClick: m[3] || (m[3] = (g) => r(n).export.run.start("all"))
2904
+ onClick: r[3] || (r[3] = (f) => i(a).export.run.start("all"))
2685
2905
  }, {
2686
- default: b(() => [
2687
- $(O(r(w).tCurd("export")), 1)
2906
+ default: p(() => [
2907
+ M(R(i(C).tCurd("export")), 1)
2688
2908
  ]),
2689
2909
  _: 1
2690
2910
  }, 8, ["loading", "size"])
2691
2911
  ]))
2692
- ], 64)) : v("", !0),
2693
- x(u.$slots, "tools-left")
2912
+ ], 64)) : V("", !0),
2913
+ S(u.$slots, "tools-left")
2694
2914
  ]),
2695
- M("div", So, [
2696
- x(u.$slots, "tools-right"),
2697
- r(n).page.showTools ? (s(), h(r(ke), k({
2915
+ O("div", jo, [
2916
+ S(u.$slots, "tools-right"),
2917
+ i(a).page.showTools ? (m(), y(i(ze), x({
2698
2918
  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),
2919
+ "current-page": i(a).page.num,
2920
+ "onUpdate:currentPage": r[4] || (r[4] = (f) => i(a).page.num = f),
2921
+ "page-size": i(a).page.size,
2922
+ "onUpdate:pageSize": r[5] || (r[5] = (f) => i(a).page.size = f),
2703
2923
  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,
2924
+ "page-sizes": i(a).page.sizeList,
2925
+ "pager-count": i(a).page.pagerCount,
2926
+ layout: i(a).page.layout,
2927
+ total: i(a).page.total,
2708
2928
  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, {
2929
+ onSizeChange: i(a).table.getList,
2930
+ onCurrentChange: i(a).table.getList
2931
+ }, 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),
2932
+ e.option.tools?.expandColumn === void 0 || e.option.tools?.expandColumn ? (m(), y(h, {
2713
2933
  key: 1,
2714
2934
  effect: "dark",
2715
- content: r(n).table.header.group.expand ? r(w).tCurd("mergeColumn") : r(w).tCurd("expandColumn"),
2935
+ content: i(a).table.header.group.expand ? i(C).tCurd("mergeColumn") : i(C).tCurd("expandColumn"),
2716
2936
  placement: "top"
2717
2937
  }, {
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))
2938
+ default: p(() => [
2939
+ O("div", {
2940
+ class: J(["refresh-btn", [e.option.size?.search]]),
2941
+ onClick: r[6] || (r[6] = //@ts-ignore
2942
+ (...f) => i(a).table.header.group.toggleExpandAll && i(a).table.header.group.toggleExpandAll(...f))
2723
2943
  }, [
2724
- r(n).table.header.group.expand ? (s(), h(Kt, { key: 0 })) : (s(), h(Wt, { key: 1 }))
2944
+ i(a).table.header.group.expand ? (m(), y(eo, { key: 0 })) : (m(), y(no, { key: 1 }))
2725
2945
  ], 2)
2726
2946
  ]),
2727
2947
  _: 1
2728
- }, 8, ["content"])) : v("", !0),
2729
- e.option.tools?.refresh === void 0 || e.option.tools?.refresh ? (s(), y("div", {
2948
+ }, 8, ["content"])) : V("", !0),
2949
+ e.option.tools?.refresh === void 0 || e.option.tools?.refresh ? (m(), v("div", {
2730
2950
  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))
2951
+ class: J(["refresh-btn", [e.option.size?.search]]),
2952
+ onClick: r[7] || (r[7] = //@ts-ignore
2953
+ (...f) => i(a).table.getList && i(a).table.getList(...f))
2734
2954
  }, [
2735
- D(Xt)
2736
- ], 2)) : v("", !0)
2955
+ F(so)
2956
+ ], 2)) : V("", !0)
2737
2957
  ])
2738
2958
  ]),
2739
- M("div", {
2740
- class: I(["fit-width relative form-box", [e.option.table?.fitHeight ? "col " : "", e.option.table?.editMode ? "edit-mode" : ""]])
2959
+ O("div", {
2960
+ class: J(["fit-width relative form-box", [e.option.table?.fitHeight ? "col " : "", e.option.table?.editMode ? "edit-mode" : ""]])
2741
2961
  }, [
2742
- M("div", {
2743
- class: I(["column form-box-content", [e.option.table?.fitHeight ? "absolute fit" : ""]])
2962
+ O("div", {
2963
+ class: J(["column form-box-content", [e.option.table?.fitHeight ? "absolute fit" : ""]])
2744
2964
  }, [
2745
- nt((s(), h(r(_e), k({
2965
+ ft((m(), y(i(st), x({
2746
2966
  ref_key: "tableRef",
2747
- ref: c,
2748
- data: r(n).table.data,
2967
+ ref: g,
2968
+ data: i(a).table.data,
2749
2969
  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({
2970
+ onSelectionChange: i(a).table.selection.change,
2971
+ onSortChange: i(a).table.sort.change,
2972
+ "expand-row-keys": i(a).table.expand.rowKeys,
2973
+ onExpandChange: i(a).table.expand.change
2974
+ }, e.option.table, E(e.option.table?.on || {})), {
2975
+ default: p(() => [
2976
+ (typeof e.option.table?.selectable == "object" ? e.option.table?.selectable?.show : e.option.table?.selectable) || i(l)(e.option.tools?.delete) || e.option.tools?.export?.show && e.option.tools?.export?.select ? (m(), y(i(ge), x({
2757
2977
  key: 0,
2758
2978
  type: "selection",
2759
2979
  width: "40",
@@ -2761,8 +2981,8 @@ const so = /* @__PURE__ */ oe(lo, [["render", ro]]), uo = { class: "row flex-cen
2761
2981
  fixed: "left",
2762
2982
  "show-overflow-tooltip": !1,
2763
2983
  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({
2984
+ }, 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),
2985
+ (typeof e.option.table?.index == "object" ? e.option.table?.index?.show : e.option.table?.index) ? (m(), y(i(ge), x({
2766
2986
  key: 1,
2767
2987
  type: "index",
2768
2988
  fixed: "left",
@@ -2771,20 +2991,20 @@ const so = /* @__PURE__ */ oe(lo, [["render", ro]]), uo = { class: "row flex-cen
2771
2991
  label: "#",
2772
2992
  "show-overflow-tooltip": !1,
2773
2993
  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,
2994
+ }, 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),
2995
+ F(Fo, {
2996
+ conf: i(a),
2997
+ columnList: i(a).table.column.list,
2778
2998
  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 || {})))
2999
+ }, X({ _: 2 }, [
3000
+ N(u.$slots, (f, w) => ({
3001
+ name: w,
3002
+ fn: p((U) => [
3003
+ S(u.$slots, w, Ve(Se(U || {})))
2784
3004
  ])
2785
3005
  }))
2786
3006
  ]), 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({
3007
+ i(l)(e.option.table?.add) || i(l)(e.option.table?.update) || i(l)(e.option.table?.delete) || i(l)(e.option.table?.view) || u.$slots["table-op-left"] || u.$slots["table-op-right"] ? (m(), y(i(ge), x({
2788
3008
  key: 2,
2789
3009
  align: "center",
2790
3010
  fixed: "right"
@@ -2792,229 +3012,229 @@ const so = /* @__PURE__ */ oe(lo, [["render", ro]]), uo = { class: "row flex-cen
2792
3012
  width: e.option.table?.operate?.width || 120,
2793
3013
  "show-overflow-tooltip": !1
2794
3014
  }), {
2795
- header: b(() => [
2796
- x(u.$slots, "table-header-op", {}, () => [
2797
- $(O(r(w).tCurd("operation")), 1)
3015
+ header: p(() => [
3016
+ S(u.$slots, "table-header-op", {}, () => [
3017
+ M(R(i(C).tCurd("operation")), 1)
2798
3018
  ])
2799
3019
  ]),
2800
- default: b(({ row: g }) => [
2801
- D(r(Y), {
3020
+ default: p(({ row: f }) => [
3021
+ F(i(te), {
2802
3022
  size: e.option.size?.table
2803
3023
  }, {
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), {
3024
+ default: p(() => [
3025
+ S(u.$slots, "table-op-left", { row: f }),
3026
+ i(a).update.type === i(n).Update && e.option.table?.inlineEdit && i(a).update.form[t.option.table?.rowKey] === f[t.option.table?.rowKey] ? (m(), v(B, { key: 0 }, [
3027
+ F(i(I), {
2808
3028
  link: "",
2809
3029
  type: "info",
2810
- onClick: r(n).update.close
3030
+ onClick: i(a).update.close
2811
3031
  }, {
2812
- default: b(() => [
2813
- $(O(r(w).tCurd("cancel")), 1)
3032
+ default: p(() => [
3033
+ M(R(i(C).tCurd("cancel")), 1)
2814
3034
  ]),
2815
3035
  _: 1
2816
3036
  }, 8, ["onClick"]),
2817
- D(r(T), {
3037
+ F(i(I), {
2818
3038
  link: "",
2819
3039
  type: "primary",
2820
- onClick: r(n).update.submit,
2821
- loading: r(n).update.loading
3040
+ onClick: i(a).update.submit,
3041
+ loading: i(a).update.loading
2822
3042
  }, {
2823
- default: b(() => [
2824
- $(O(r(w).tCurd("confirm")), 1)
3043
+ default: p(() => [
3044
+ M(R(i(C).tCurd("confirm")), 1)
2825
3045
  ]),
2826
3046
  _: 1
2827
3047
  }, 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), {
3048
+ S(u.$slots, "table-op-edit-right", { row: f })
3049
+ ], 64)) : (m(), v(B, { key: 1 }, [
3050
+ i(l)(e.option.table?.add, f) ? (m(), y(i(I), {
2831
3051
  key: 0,
2832
3052
  link: "",
2833
3053
  type: "primary",
2834
- onClick: (C) => r(n).update.open(r(l).Add, g)
3054
+ onClick: (w) => i(a).update.open(i(n).Add, f)
2835
3055
  }, {
2836
- default: b(() => [
2837
- $(O(r(w).tCurd("add")), 1)
3056
+ default: p(() => [
3057
+ M(R(i(C).tCurd("add")), 1)
2838
3058
  ]),
2839
3059
  _: 1
2840
- }, 8, ["onClick"])) : v("", !0),
2841
- r(i)(e.option.table?.view, g) ? (s(), h(r(T), {
3060
+ }, 8, ["onClick"])) : V("", !0),
3061
+ i(l)(e.option.table?.view, f) ? (m(), y(i(I), {
2842
3062
  key: 1,
2843
3063
  link: "",
2844
3064
  type: "primary",
2845
- onClick: (C) => r(n).update.open(r(l).View, g)
3065
+ onClick: (w) => i(a).update.open(i(n).View, f)
2846
3066
  }, {
2847
- default: b(() => [
2848
- $(O(r(w).tCurd("view")), 1)
3067
+ default: p(() => [
3068
+ M(R(i(C).tCurd("view")), 1)
2849
3069
  ]),
2850
3070
  _: 1
2851
- }, 8, ["onClick"])) : v("", !0),
2852
- r(i)(e.option.table?.update, g) ? (s(), h(r(T), {
3071
+ }, 8, ["onClick"])) : V("", !0),
3072
+ i(l)(e.option.table?.update, f) ? (m(), y(i(I), {
2853
3073
  key: 2,
2854
3074
  link: "",
2855
3075
  type: "warning",
2856
- onClick: (C) => r(n).update.open(r(l).Update, g)
3076
+ onClick: (w) => i(a).update.open(i(n).Update, f)
2857
3077
  }, {
2858
- default: b(() => [
2859
- $(O(r(w).tCurd("edit")), 1)
3078
+ default: p(() => [
3079
+ M(R(i(C).tCurd("edit")), 1)
2860
3080
  ]),
2861
3081
  _: 1
2862
- }, 8, ["onClick"])) : v("", !0),
2863
- r(i)(e.option.table?.delete, g) ? (s(), h(r(T), {
3082
+ }, 8, ["onClick"])) : V("", !0),
3083
+ i(l)(e.option.table?.delete, f) ? (m(), y(i(I), {
2864
3084
  key: 3,
2865
3085
  link: "",
2866
3086
  type: "danger",
2867
- onClick: (C) => r(n).remove.open([g])
3087
+ onClick: (w) => i(a).remove.open([f])
2868
3088
  }, {
2869
- default: b(() => [
2870
- $(O(r(w).tCurd("delete")), 1)
3089
+ default: p(() => [
3090
+ M(R(i(C).tCurd("delete")), 1)
2871
3091
  ]),
2872
3092
  _: 1
2873
- }, 8, ["onClick"])) : v("", !0),
2874
- x(u.$slots, "table-op-right", { row: g })
3093
+ }, 8, ["onClick"])) : V("", !0),
3094
+ S(u.$slots, "table-op-right", { row: f })
2875
3095
  ], 64))
2876
3096
  ]),
2877
3097
  _: 2
2878
3098
  }, 1032, ["size"])
2879
3099
  ]),
2880
3100
  _: 3
2881
- }, 16, ["width"])) : v("", !0)
3101
+ }, 16, ["width"])) : V("", !0)
2882
3102
  ]),
2883
3103
  _: 3
2884
3104
  }, 16, ["data", "border", "onSelectionChange", "onSortChange", "expand-row-keys", "onExpandChange"])), [
2885
- [f, r(n).table.loading]
3105
+ [c, i(a).table.loading]
2886
3106
  ])
2887
3107
  ], 2)
2888
3108
  ], 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({
3109
+ O("div", Ko, [
3110
+ (e.option.page?.show === void 0 || e.option.page?.show) && !i(a).page.showTools ? (m(), y(i(ze), x({
2891
3111
  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),
3112
+ "current-page": i(a).page.num,
3113
+ "onUpdate:currentPage": r[8] || (r[8] = (f) => i(a).page.num = f),
3114
+ "page-size": i(a).page.size,
3115
+ "onUpdate:pageSize": r[9] || (r[9] = (f) => i(a).page.size = f),
2896
3116
  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,
3117
+ "page-sizes": i(a).page.sizeList,
3118
+ "pager-count": i(a).page.pagerCount,
3119
+ layout: i(a).page.layout,
3120
+ total: i(a).page.total,
2901
3121
  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)
3122
+ onSizeChange: i(a).table.getList,
3123
+ onCurrentChange: i(a).table.getList
3124
+ }, 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
3125
  ])
2906
3126
  ], 2),
2907
- x(u.$slots, "box-right")
3127
+ S(u.$slots, "box-right")
2908
3128
  ], 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
3129
+ F(i(xe), x({
3130
+ modelValue: i(a).update.show,
3131
+ "onUpdate:modelValue": r[10] || (r[10] = (f) => i(a).update.show = f),
3132
+ title: i(a).update.title,
3133
+ "before-close": i(a).update.close
2914
3134
  }, e.option.dialog), {
2915
- footer: b(() => [
2916
- M("span", $o, [
2917
- D(r(Y), {
3135
+ footer: p(() => [
3136
+ O("span", Po, [
3137
+ F(i(te), {
2918
3138
  size: e.option.size?.form
2919
3139
  }, {
2920
- default: b(() => [
2921
- x(u.$slots, "dialog-footer", {
2922
- row: r(n).update
3140
+ default: p(() => [
3141
+ S(u.$slots, "dialog-footer", {
3142
+ row: i(a).update
2923
3143
  }, () => [
2924
- D(r(T), {
2925
- onClick: r(n).update.close
3144
+ F(i(I), {
3145
+ onClick: i(a).update.close
2926
3146
  }, {
2927
- default: b(() => [
2928
- $(O(r(w).tCurd("close")), 1)
3147
+ default: p(() => [
3148
+ M(R(i(C).tCurd("close")), 1)
2929
3149
  ]),
2930
3150
  _: 1
2931
3151
  }, 8, ["onClick"]),
2932
- r(n).update.type !== r(l).View ? (s(), h(r(T), {
3152
+ i(a).update.type !== i(n).View ? (m(), y(i(I), {
2933
3153
  key: 0,
2934
3154
  type: "primary",
2935
- onClick: r(n).update.submit,
2936
- loading: r(n).update.loading
3155
+ onClick: i(a).update.submit,
3156
+ loading: i(a).update.loading
2937
3157
  }, {
2938
- default: b(() => [
2939
- $(O(r(w).tCurd("submit")), 1)
3158
+ default: p(() => [
3159
+ M(R(i(C).tCurd("submit")), 1)
2940
3160
  ]),
2941
3161
  _: 1
2942
- }, 8, ["onClick", "loading"])) : v("", !0)
3162
+ }, 8, ["onClick", "loading"])) : V("", !0)
2943
3163
  ])
2944
3164
  ]),
2945
3165
  _: 3
2946
3166
  }, 8, ["size"])
2947
3167
  ])
2948
3168
  ]),
2949
- default: b(() => [
2950
- x(u.$slots, "dialog-start", {
2951
- row: r(n).update
3169
+ default: p(() => [
3170
+ S(u.$slots, "dialog-start", {
3171
+ row: i(a).update
2952
3172
  }),
2953
- D(r(Y), {
3173
+ F(i(te), {
2954
3174
  ref_key: "ruleFormRef",
2955
3175
  ref: d,
2956
- model: r(n).update.form,
2957
- rules: r(n).update.rules,
3176
+ model: i(a).update.form,
3177
+ rules: i(a).update.rules,
2958
3178
  size: e.option.size?.form,
2959
3179
  class: "update-dialog-form"
2960
3180
  }, {
2961
- default: b(() => [
2962
- r(n).update.showContent ? (s(), h(Le, {
3181
+ default: p(() => [
3182
+ i(a).update.showContent ? (m(), y(Qe, {
2963
3183
  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,
3184
+ "form-grid": i(a).update.formGrid,
3185
+ "max-span": i(a).update.formMaxSpan,
3186
+ form: i(a).update.form,
3187
+ type: i(a).update.type,
2968
3188
  stripe: e.option.form?.stripe,
2969
3189
  "label-width": e.option.form?.labelWidth,
2970
3190
  "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 || {})))
3191
+ "get-bind": i(a).update.getBind,
3192
+ "get-on": i(a).update.getOn,
3193
+ "get-disabled": i(a).update.getDisabled
3194
+ }, X({ _: 2 }, [
3195
+ N(u.$slots, (f, w) => ({
3196
+ name: w,
3197
+ fn: p((U) => [
3198
+ S(u.$slots, w, Ve(Se(U || {})))
2979
3199
  ])
2980
3200
  }))
2981
- ]), 1032, ["form-grid", "max-span", "form", "type", "stripe", "label-width", "form-option", "get-bind", "get-on", "get-disabled"])) : v("", !0)
3201
+ ]), 1032, ["form-grid", "max-span", "form", "type", "stripe", "label-width", "form-option", "get-bind", "get-on", "get-disabled"])) : V("", !0)
2982
3202
  ]),
2983
3203
  _: 3
2984
3204
  }, 8, ["model", "rules", "size"]),
2985
- x(u.$slots, "dialog-end", {
2986
- row: r(n).update
3205
+ S(u.$slots, "dialog-end", {
3206
+ row: i(a).update
2987
3207
  })
2988
3208
  ]),
2989
3209
  _: 3
2990
3210
  }, 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,
3211
+ F(i(xe), {
3212
+ modelValue: i(a).remove.show,
3213
+ "onUpdate:modelValue": r[11] || (r[11] = (f) => i(a).remove.show = f),
3214
+ title: i(a).remove.title,
2995
3215
  "close-on-click-modal": !1
2996
3216
  }, {
2997
- footer: b(() => [
2998
- M("span", Oo, [
2999
- D(r(Y), {
3217
+ footer: p(() => [
3218
+ O("span", Go, [
3219
+ F(i(te), {
3000
3220
  size: e.option.size?.form
3001
3221
  }, {
3002
- default: b(() => [
3003
- D(r(T), {
3004
- onClick: r(n).remove.close
3222
+ default: p(() => [
3223
+ F(i(I), {
3224
+ onClick: i(a).remove.close
3005
3225
  }, {
3006
- default: b(() => [
3007
- $(O(r(w).tCurd("close")), 1)
3226
+ default: p(() => [
3227
+ M(R(i(C).tCurd("close")), 1)
3008
3228
  ]),
3009
3229
  _: 1
3010
3230
  }, 8, ["onClick"]),
3011
- D(r(T), {
3231
+ F(i(I), {
3012
3232
  type: "danger",
3013
- onClick: r(n).remove.submit,
3014
- loading: r(n).remove.loading
3233
+ onClick: i(a).remove.submit,
3234
+ loading: i(a).remove.loading
3015
3235
  }, {
3016
- default: b(() => [
3017
- $(O(r(w).tCurd("confirmDelete")), 1)
3236
+ default: p(() => [
3237
+ M(R(i(C).tCurd("confirmDelete")), 1)
3018
3238
  ]),
3019
3239
  _: 1
3020
3240
  }, 8, ["onClick", "loading"])
@@ -3023,90 +3243,90 @@ const so = /* @__PURE__ */ oe(lo, [["render", ro]]), uo = { class: "row flex-cen
3023
3243
  }, 8, ["size"])
3024
3244
  ])
3025
3245
  ]),
3026
- default: b(() => [
3027
- e.option.dialog?.delete?.content ? (s(), y("div", Eo, [
3028
- D(Lt, {
3246
+ default: p(() => [
3247
+ e.option.dialog?.delete?.content ? (m(), v("div", Io, [
3248
+ F(Xt, {
3029
3249
  content: e.option.dialog?.delete?.content,
3030
- value: r(n).remove.items
3250
+ value: i(a).remove.items
3031
3251
  }, null, 8, ["content", "value"])
3032
- ])) : (s(), y("div", Do, O(r(w).tCurd("confirmDeleteMessage", r(n).remove.items.length)), 1))
3252
+ ])) : (m(), v("div", No, R(i(C).tCurd("confirmDeleteMessage", i(a).remove.items.length)), 1))
3033
3253
  ]),
3034
3254
  _: 1
3035
3255
  }, 8, ["modelValue", "title"]),
3036
- D(Rt, {
3256
+ F(qt, {
3037
3257
  ref_key: "switchConfirmRef",
3038
- ref: o,
3258
+ ref: s,
3039
3259
  size: e.option.size?.form
3040
3260
  }, null, 8, ["size"])
3041
3261
  ], 2);
3042
3262
  };
3043
3263
  }
3044
3264
  });
3045
- class To {
3265
+ class Yo {
3046
3266
  /**
3047
3267
  * 通过远程 URL 下载文件,自动创建临时 `<a>` 标签触发浏览器下载
3048
3268
  *
3049
3269
  * @param href - 文件的远程地址
3050
3270
  * @param name - 下载后的文件名,默认 `'download.png'`
3051
3271
  */
3052
- static async download(a, l = "download.png") {
3272
+ static async download(o, n = "download.png") {
3053
3273
  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);
3274
+ t.style.display = "none", t.href = o, t.setAttribute("download", n), typeof t.download > "u" && t.setAttribute("target", "_blank"), document.body.appendChild(t), t.click(), document.body.removeChild(t), window.URL.revokeObjectURL(o);
3055
3275
  }
3056
3276
  /**
3057
3277
  * 将json对象或者json数组导出为json文件保存
3058
3278
  * @param data
3059
3279
  * @param name
3060
3280
  */
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();
3281
+ static exportJSONFile = (o, n) => {
3282
+ const t = new Blob([JSON.stringify(o)], { type: "application/json" }), l = URL.createObjectURL(t), a = document.createElement("a");
3283
+ a.href = l, a.download = `${n || "config"}.json`, a.click();
3064
3284
  };
3065
3285
  /**
3066
3286
  * 导入文件内容,默认为json
3067
3287
  * @param param
3068
3288
  * @returns
3069
3289
  */
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];
3290
+ static importFile = async (o) => new Promise((n, t) => {
3291
+ const l = document.createElement("input");
3292
+ l.type = "file";
3293
+ const a = o?.accept || ".json";
3294
+ l.accept = a, l.style.display = "none", l.onchange = (s) => {
3295
+ const d = s.target.files[0];
3076
3296
  if (!d) {
3077
- z.fail("未选择文件"), t("未选择文件");
3297
+ $.fail("未选择文件"), t("未选择文件");
3078
3298
  return;
3079
3299
  }
3080
- const c = new FileReader();
3081
- c.onload = async (u) => {
3082
- const m = n == ".json" ? JSON.parse(u.target.result) : u.target.result;
3083
- l(m);
3084
- }, c.onerror = () => {
3085
- z.fail("文件读取失败"), t("文件读取失败");
3086
- }, c.readAsText(d), document.body.removeChild(i);
3087
- }, document.body.appendChild(i), i.click();
3300
+ const g = new FileReader();
3301
+ g.onload = async (u) => {
3302
+ const r = a == ".json" ? JSON.parse(u.target.result) : u.target.result;
3303
+ n(r);
3304
+ }, g.onerror = () => {
3305
+ $.fail("文件读取失败"), t("文件读取失败");
3306
+ }, g.readAsText(d), document.body.removeChild(l);
3307
+ }, document.body.appendChild(l), l.click();
3088
3308
  });
3089
3309
  }
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]);
3310
+ const Wo = (e, o) => {
3311
+ if (e.component("TCurd", Ho), e.component("TFormList", Be), e.component("TColumn", Ut), o?.customComponent) {
3312
+ W.customComponent = o.customComponent;
3313
+ for (const n in o.customComponent)
3314
+ e.component(n, o.customComponent[n]);
3095
3315
  }
3096
- }, Lo = {
3097
- install: Fo
3316
+ }, Zo = {
3317
+ install: Wo
3098
3318
  };
3099
3319
  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
3320
+ Q as ArrUtil,
3321
+ It as ExcelUtil,
3322
+ Ut as TColumn,
3323
+ Ho as TCurd,
3324
+ Yo as TFile,
3325
+ W as TForm,
3326
+ T as TFormConfig,
3327
+ C as TFormI18n,
3328
+ Be as TFormList,
3329
+ $ as TSys,
3330
+ Zo as default,
3331
+ Wo as install
3112
3332
  };