cc1-form 1.3.7 → 1.3.8

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