cc1-form 1.2.24 → 1.2.25

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