cc1-form 1.2.24 → 1.2.26

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((a) => typeof a == "function" ? a(...l) : a) : 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, a = {}) {
67
+ const i = Date.now();
68
+ if (!this.tipMessages[n] || i - this.tipMessages[n] > this.tipMessagesGap) {
69
+ this.tipMessages[n] = i;
70
+ const o = Object.assign(
71
71
  {
72
- message: r,
73
- type: s
72
+ message: n,
73
+ type: l
74
74
  },
75
- c
75
+ a
76
76
  );
77
- xe(t), setTimeout(() => {
78
- delete this.tipMessages[r];
77
+ Ie(o), 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 a = 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=" + a
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, a) => {
136
+ let i = document.getElementById(n.id);
137
+ const o = await S.loadModule("html2canvas");
138
138
  try {
139
- t(o, {
139
+ o(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
+ a(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 a = n.column.find((o) => o.key === l), i = (o) => o.replace(/-([a-z])/g, (t, s) => s.toUpperCase());
543
+ if (a)
544
+ return a.options[i(a.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, a) => {
563
+ const i = P.findOptions(n, l);
564
+ i && (i.data = a);
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, a, i) => {
576
+ const o = M.config.table.rowKey;
577
+ n ? l.type === S.EDialog.Add ? (l.form.parentId = n[o], l.form.sort = n.children.length + 1) : l.form.parentId = n.parentId.substring(n.parentId.lastIndexOf(",") + 1) : (l.form.parentId = "0", l.form.sort = a.length + 1), P.setOptionsData(i, "parentId", [{ [o]: "0", title: "根", children: a }]);
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, a) => {
593
+ l[n] || (l[n] = []);
594
+ const i = M.config.table.rowKey;
595
+ l[n].forEach((o) => {
596
+ a.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()), o[t.value] === void 0 && (o[t.value] = s);
599
+ }), o[i] || (o[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, a, i) => {
610
+ const o = JSONUtil.cp(a);
611
+ N.setId(n, l, a);
612
+ const t = M.config.table.rowKey;
613
+ l[n].push(
614
+ o.reduce(
615
+ (s, f) => {
616
+ let d = f.default ?? "";
617
+ return f.type === "number" && (d = f.default ?? 0), f.type === "boolean" && (d = f.default ?? !1), f.type === "time" && (d = f.default ?? /* @__PURE__ */ new Date()), s[f.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, a, i) => {
631
+ const o = M.config.table.rowKey;
632
+ l[n] = l[n].filter((t) => t[o] !== a[o]), 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 a = JSONUtil.cp(n), i = M.config.table.rowKey;
642
+ return a.forEach((o) => {
643
+ o[i] && delete o[i], l && o[l] && N.getNoIdData(o[l], l);
644
+ }), a;
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, a = me({
749
694
  show: !1,
750
- add: (t, n, a) => {
751
- H.add(t, n, a, () => {
752
- o("change");
695
+ add: (o, t, s) => {
696
+ N.add(o, 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: (o, t, s) => {
701
+ N.remove(o, 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), a.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 (o, t) => {
711
+ const s = ae("el-button"), f = ae("el-input");
712
+ return a.show ? (u(), p("div", Ze, [
713
+ k(o.$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) => a.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(o.$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, (c) => (u(), h(f, {
732
+ modelValue: d[c.value],
733
+ "onUpdate:modelValue": (v) => d[c.value] = v,
734
+ style: de({ width: e.inputWidth }),
735
+ class: I(e.inputClass),
736
+ placeholder: c[e.label] || c[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(o.$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: (c) => a.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) => a.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(o.$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] = (a) => e.form[e.item.key] = a)
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] = (a) => e.form[e.item.key] = a)
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] = (a) => e.form[e.item.key] = a)
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 || [], (a) => (u(), h(r(X), C({
832
+ key: a.value
833
+ }, { ref_for: !0 }, a, E(a.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] = (a) => e.form[e.item.key] = a)
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 || [], (a) => (u(), h(r(xe), C({
846
+ key: a.value
847
+ }, { ref_for: !0 }, a, E(a.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] = (a) => e.form[e.item.key] = a)
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] = (a) => e.form[e.item.key] = a)
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] = (a) => e.form[e.item.key] = a)
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 a = 0;
947
+ return n.replace(/{([^}]+)}/g, (i, o) => a < l.length ? String(l[a++]) : `{${o}}`);
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, ue = (e, n) => {
960
+ e.isForm = n, Array.isArray(e.children) && e.children.forEach((l) => ue(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
+ }, ce = (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 a = e.disabled?.[n === S.EDialog.Add ? "create" : "update"];
968
+ return S.isFun(a, 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 || {}, o = {};
971
+ return Object.keys(i).forEach((t) => {
972
+ const s = i[t];
973
+ typeof s == "function" ? o[t] = function(...f) {
974
+ return s.apply(this, [...f, ...l]);
975
+ } : o[t] = s;
976
+ }), o;
977
+ }, Me = (e, n, l, a, i) => {
978
+ const o = e, t = o.colSpan ?? e.span;
979
+ if (!e.item.form?.spanCol)
980
+ return t;
981
+ const s = i?.maxSpan || 12, f = i?.defaultSpan || s / 2, d = o.gridBand, v = n.filter((m) => d != null ? m.gridBand === d && !S.isFun(m.item.show?.form, l, a) : m.gridRow === o.gridRow && !S.isFun(m.item.show?.form, l, a)).reduce((m, g) => m + (g.colSpan ?? g.span ?? f), 0);
982
+ return t + v;
983
+ }, Fe = (e) => {
984
+ const n = /* @__PURE__ */ new Map();
985
+ return e.forEach((l) => {
986
+ const a = l.gridBand ?? ce(l);
987
+ n.has(a) || n.set(a, []), n.get(a).push(l);
988
+ }), Array.from(n.keys()).sort((l, a) => l - a).map((l) => n.get(l));
989
+ }, Ue = (e) => e?.length ? Array.isArray(e[0]) ? e.flat() : e : [], ut = (e, n) => {
990
+ if (!st(e) || !e.key) return null;
991
+ const l = n.defaultSpan ?? (n.maxSpan || 12) / 2, a = dt(e, l, n.layout);
992
+ return { item: e, span: a };
993
+ }, ct = (e, n = {}) => {
994
+ const l = [], a = (i) => {
995
+ if (i.children?.length) {
996
+ i.children.forEach((t) => a(t));
997
+ return;
998
+ }
999
+ const o = ut(i, n);
1000
+ o && l.push(o);
1001
+ };
1002
+ return e.forEach((i) => a(i)), l;
1003
+ }, Ae = (e, n = {}) => {
1004
+ const l = n.maxSpan ?? 12, a = n.defaultSpan ?? l / 2, i = n.layout ?? "row", t = ct(e, { maxSpan: l, defaultSpan: a, 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: ce({ gridRow: z })
1018
+ }), z += L;
1019
+ }), { cells: x, maxSpan: l };
1020
+ }
1021
+ const s = /* @__PURE__ */ new Set(), f = [];
1022
+ let d = 0, c = 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, c = z;
1048
+ return;
1049
+ }
1050
+ const R = z + U;
1051
+ if (R < l) {
1052
+ c = R, d = A;
1053
+ return;
1054
+ }
1055
+ c = 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 && f.length && (c = 0, d = v(d) + K);
1060
+ let { tr: L, tc: A } = g(d, c, z, U) ? { tr: d, tc: c } : H(d, c, 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
+ f.push({
1064
+ ...x,
1065
+ span: z,
1066
+ colSpan: z,
1067
+ rowSpan: U,
1068
+ gridRow: R,
1069
+ gridColumn: A + 1,
1070
+ gridBand: ce({ gridRow: R })
1071
+ }), _(L, A, z, U);
1072
+ }
1073
+ return { cells: f, maxSpan: l };
1074
+ }, ft = (e) => e.map((n) => n.item?.show?.form), mt = (e, n, l) => {
1075
+ if (!e.rules) return;
1076
+ const a = typeof e.rules == "boolean" ? [
1077
+ {
1078
+ required: !0,
1079
+ message: n(e),
1080
+ trigger: "blur"
1081
+ }
1082
+ ] : e.rules;
1083
+ return l ? a.map((i) => l(i)) : a;
1084
+ }, Re = (e) => (n, l) => mt(n, e, (a) => {
1085
+ if (a.validator) {
1086
+ const i = a.validator;
1087
+ return {
1088
+ ...a,
1089
+ validator: (o, t, s) => i(o, t, s, l)
1090
+ };
1091
+ }
1092
+ return a;
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 a = {}, i = {}, o = n?.maxSpan || 12, t = n?.defaultSpan || o / 2, s = gt();
1101
+ e.forEach((c) => ue(c, !0)), Be(e, a, i, (c) => s(c, l));
1102
+ const { cells: f, maxSpan: d } = Ae(e, {
1103
+ maxSpan: o,
1104
+ defaultSpan: t,
1105
+ layout: n?.layout
1106
+ });
1107
+ return {
1108
+ formDefault: a,
1109
+ rules: i,
1110
+ formGrid: f,
1111
+ formMaxSpan: d,
1112
+ formColumn: Fe(f)
1113
+ };
1114
+ }, Be = (e, n, l, a) => {
1115
+ const i = (o) => {
1116
+ if (o.children?.length) {
1117
+ o.children.forEach((t) => i(t));
1118
+ return;
1119
+ }
1120
+ if (o.key) {
1121
+ n[o.key] = o.value;
1122
+ const t = a(o);
1123
+ t && (l[o.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, a = te(
1143
+ () => l.formGrid.filter((c) => n(c.item.show?.form, l.form, l.type))
1144
+ ), i = te(() => ({
1145
+ gridTemplateColumns: `repeat(${l.maxSpan}, minmax(0, 1fr))`
1146
+ })), o = te(() => {
1147
+ let c = 0;
1148
+ return a.value.forEach((v) => {
1149
+ const m = v.gridRow + v.rowSpan - 1;
1150
+ m > c && (c = m);
1151
+ }), c;
1152
+ }), t = (c) => c.gridRow + c.rowSpan - 1 >= o.value, s = (c) => c.rowSpan >= K, f = (c) => Me(c, l.formGrid, l.form, l.type, {
1153
+ maxSpan: l.maxSpan,
1154
+ defaultSpan: l.formOption?.defaultSpan
1155
+ }), d = (c) => {
1156
+ const v = f(c) || c.colSpan;
1157
+ return {
1158
+ gridRow: `${c.gridRow} / span ${c.rowSpan}`,
1159
+ gridColumn: `${c.gridColumn} / span ${v}`
1160
+ };
1161
+ };
1162
+ return (c, v) => r(n)(r(ft)(e.formGrid), e.form, e.type) ? (u(), p(F, { key: 0 }, [
1163
+ k(c.$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(a.value, (m) => (u(), p("div", {
1169
+ key: m.item.key,
1170
+ class: I(["curd-form-grid-cell", [
1171
+ e.stripe !== !1 && r(ce)(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(c.$slots, (g, B) => ({
1192
+ name: B,
1193
+ fn: y((H) => [
1194
+ k(c.$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(c.$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,776 @@ 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, a = !1) => {
1224
+ a && 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, a = () => {
1231
+ const i = l();
1232
+ return i ?? n;
1233
+ };
1234
+ return {
1235
+ internal: n,
1236
+ isExternal: () => l() != null,
1237
+ get() {
1238
+ return a();
1239
+ },
1240
+ set(i) {
1241
+ J.setValue(a(), i, !0);
1242
+ },
1243
+ merge(i) {
1244
+ J.setValue(a(), i, !1);
1245
+ },
1246
+ clear() {
1247
+ J.delAllKey(a());
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, a = Q(), i = e;
1268
+ let o = fe(i.form);
1269
+ const t = ze.getConf();
1270
+ t?.formRef?.set("formRef-" + StrUtil.getId(), a);
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 o.get();
1281
+ },
1282
+ set form(f) {
1283
+ o.set(f);
1126
1284
  },
1127
- validate: () => new Promise(async (t, n) => {
1285
+ getDisabled: (f) => Ee(f, s.type, s.form),
1286
+ getBind: (f) => De(f, s.type),
1287
+ getOn: (f) => Oe(f, s.type, [s.form, f]),
1288
+ initColumnForm: () => {
1289
+ const f = o, d = ht(i.option.column, i.option.form, f.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 ? f.isExternal() ? f.merge(JSONUtil.cp(s.formDefault)) : f.set(JSONUtil.cp(s.formDefault)) : !f.isExternal() && i.form && f.set(JSONUtil.cp(i.form));
1291
+ }
1292
+ });
1293
+ return s.initColumnForm(), Je(
1294
+ () => i.form,
1295
+ (f) => {
1296
+ o = fe(f), s.initColumnForm();
1297
+ }
1298
+ ), n({ ref: a, conf: s }), (f, d) => (u(), h(r(q), {
1299
+ ref_key: "ruleFormRef",
1300
+ ref: a,
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(f.$slots, (c, v) => ({
1319
+ name: v,
1320
+ fn: y((m) => [
1321
+ k(f.$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
+ (a) => this.map[a]?.validate(async (i) => new Promise((o, t) => {
1342
+ i || t(!1), o(!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(a) {
1363
+ l.set(a);
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: (a, i = b.tCurd("placeholderInput")) => a.text?.search?.placeholder === void 0 ? `${i}${a.label}` : a.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 a = e();
1369
+ let i = {};
1370
+ n.option.column.forEach((t) => {
1371
+ (typeof t.show?.search == "function" ? t.show?.search(a.search.form) : t.show?.search) && (i[t.key] = a.search.form[t.key]);
1161
1372
  });
1162
- const n = e.option.search?.before?.(t);
1163
- return n && (t = n), t;
1373
+ const o = n.option.search?.before?.(i);
1374
+ return o && (i = o), 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 a = e(), i = a.search.formDefault;
1378
+ Object.keys(i).forEach((t) => {
1379
+ n.option.search?.resetMode === "none" ? i[t] = void 0 : i[t] = a.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 o = ObjectUtil.deepMerge(i, {});
1382
+ J.setValue(a.search.form, o, !0), a.page.num = 1, n.option.init !== !1 && a.table.getList();
1173
1383
  },
1174
- /** 提交搜索表单 */
1175
1384
  submit: () => {
1176
- o.page.num = 1, o.table.getList();
1385
+ const a = e();
1386
+ a.page.num = 1, a.table.getList();
1177
1387
  }
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 a = e();
1401
+ return {
1402
+ [M.config.field.page.size]: l.size || a.page.size,
1403
+ [M.config.field.page.num]: l.num || a.page.num,
1404
+ ...a.search.getFormData()
1405
+ };
1406
+ }
1407
+ }
1408
+ }), kt = (e, n, l) => ({
1409
+ table: {
1410
+ op: {
1411
+ width: (...a) => a.filter((o) => o).length * 30 + 60
1178
1412
  },
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,
1199
- ...o.search.getFormData()
1200
- })
1201
- },
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: (a, 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 a = e();
1422
+ if (a.table.expand.isExpand)
1423
+ a.table.expand.rowKeys = [];
1424
+ else {
1425
+ const i = (o) => {
1426
+ let t = [];
1427
+ return o.forEach((s) => {
1428
+ t.push(s[n.option.table.rowKey]), s.children?.length && (t = t.concat(i(s.children)));
1429
+ }), t;
1430
+ };
1431
+ a.table.expand.rowKeys = i(a.table.data);
1236
1432
  }
1237
- },
1238
- /** 表格列相关配置 */
1239
- column: {
1240
- /** 表格全部列(渲染用) */
1241
- list: [],
1242
- /** 表格可见列控制集合 */
1243
- show: {
1244
- /** 表格列f原始源数据key数组 */
1245
- listSource: [],
1246
- /** 当前显示表格列数据key数组 */
1247
- list: []
1433
+ a.table.expand.isExpand = !a.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 a = e(), i = !a.table.header.group.expand;
1448
+ a.table.header.group.expand = i;
1449
+ const o = (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 && o(s.children);
1452
+ });
1453
+ };
1454
+ o(a.table.column.list);
1455
+ }
1456
+ }
1457
+ },
1458
+ getList: async () => {
1459
+ const a = e();
1460
+ a.table.loading = !0;
1461
+ const i = n.option.api.list, o = JSONUtil.cp(a.table.selection.list);
1462
+ try {
1463
+ await a.initApiData("init");
1464
+ let t = {};
1465
+ if (a.table.sort.prop) {
1466
+ const { props: B, order: H } = M.config.table.sort;
1467
+ t = {
1468
+ [B.field]: a.table.sort.prop,
1469
+ [H.field]: a.table.sort.order
1470
+ };
1248
1471
  }
1472
+ const s = await i({
1473
+ ...a.page.getQuery(),
1474
+ ...t
1475
+ }), f = M.config.field.result, d = s.data || { [f.list]: s }, c = (Array.isArray(d[f.list]), d[f.list]), v = Ue(a.update.formGrid?.length ? a.update.formGrid : a.update.formColumn), g = ObjectUtil.deepMerge({ data: c }, {}).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
+ a.table.data = n.option.data ? await n.option.data(g, c) : g, a.page.total = d[f.total] || 0, setTimeout(() => {
1480
+ a.table.selection.setList(o);
1481
+ }, 20);
1482
+ } catch (t) {
1483
+ console.error(t);
1484
+ } finally {
1485
+ a.table.loading = !1;
1486
+ }
1487
+ },
1488
+ selection: {
1489
+ list: [],
1490
+ change: (a) => {
1491
+ e().table.selection.list = a;
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: (a, i) => {
1494
+ const o = e();
1495
+ o.table.selection.list = [];
1496
+ const t = l.tableRef.value;
1497
+ if (t?.clearSelection(), !t || !a?.length) return;
1498
+ const s = n.option.table?.rowKey, f = (d) => {
1499
+ const c = (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 = c(m.children);
1507
+ if (g !== void 0) return g;
1508
+ }
1509
+ }
1510
+ };
1511
+ return c(o.table.data);
1512
+ };
1513
+ a.forEach((d) => {
1514
+ const c = f(d);
1515
+ if (c)
1516
+ if (i) {
1517
+ const v = () => t.toggleRowSelection(c, !0, !1);
1518
+ i(d) !== !1 && v();
1519
+ } else
1520
+ t.toggleRowSelection(c, !0, !1);
1521
+ });
1522
+ }
1523
+ },
1524
+ sort: {
1525
+ prop: "",
1526
+ order: "",
1527
+ change: (a) => {
1528
+ const i = e();
1529
+ M.config.table.sort.resetPage && (i.page.num = 1);
1530
+ const o = M.config.table.sort;
1531
+ if (o.change) {
1532
+ o.change(a, i);
1533
+ return;
1266
1534
  }
1535
+ i.table.sort.prop = a.prop, a.order === null ? (i.table.sort.order = "", i.table.sort.prop = "") : i.table.sort.order = a.order === "ascending" ? o.order.asc : o.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, a) => {
1549
+ if (!n || n.length === 0) return;
1550
+ const i = await S.loadModule("xlsx"), o = n.map((f) => {
1551
+ const d = {};
1552
+ return l.forEach((c) => {
1553
+ d[c.label] = f[c.key];
1554
+ }), d;
1555
+ }), t = i.utils.json_to_sheet(o), s = i.utils.book_new();
1556
+ i.utils.book_append_sheet(s, t, "Sheet1"), a ? typeof a == "function" && (a = a()) : a = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, i.writeFile(s, `${a}.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 o = n.option.column, t = ObjectUtil.deepMerge({ data: i, columns: o }, {}), 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);
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;
1294
1581
  } catch (a) {
1295
1582
  console.error(a);
1296
1583
  } finally {
1297
- o.table.loading = !1;
1298
- }
1299
- },
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
- });
1584
+ l.export.loading = !1;
1339
1585
  }
1340
1586
  },
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 (a) {
1601
+ console.error(a);
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 a = n.option.api.list, i = await a({
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 (a) {
1621
+ console.error(a);
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 a = e();
1630
+ a.export.loading || a.export.run.start(l);
1631
+ }
1632
+ }
1633
+ }), le = S.EDialog, St = (e, n, l) => {
1634
+ const a = 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 a.get();
1645
+ },
1646
+ set form(i) {
1647
+ a.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, o = !1) => {
1654
+ const t = e();
1655
+ return n.option.table?.editMode && o ? i.disabled?.table === void 0 ? !1 : S.isFun(i.disabled?.table, t.update.form) : Ee(i, t.update.type, t.update.form);
1473
1656
  },
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;
1657
+ getBind: (i) => {
1658
+ const o = e();
1659
+ return De(i, o.update.type);
1485
1660
  },
1486
- /** 获取表单组件绑定属性和事件 */
1487
- getOptions: (t) => {
1661
+ getOn: (i, o) => {
1662
+ const t = e();
1663
+ return Oe(i, t.update.type, [o || t.update.form, i]);
1664
+ },
1665
+ getOptions: (i) => {
1666
+ const o = 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(o.update.formGrid?.length ? o.update.formGrid : o.update.formColumn).find((f) => f.item.key === i)?.item;
1669
+ return s ? {
1670
+ options: s.options,
1671
+ //@ts-ignore
1672
+ bind: o.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 o = e();
1682
+ if (n.option.form?.editAll) return i;
1683
+ const t = {
1684
+ [n.option.table?.rowKey]: o.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(o.update.edit.data).forEach((s) => {
1687
+ i[s] !== o.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, o) => {
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(o), t.update.title = b.tCurd(s ? "add" : i === le.View ? "view" : "edit");
1700
+ const f = s ? ObjectUtil.deepMerge(JSONUtil.cp(t.update.formDefault), o ? JSONUtil.cp(o) : {}) : JSONUtil.cp(o);
1701
+ J.setValue(t.update.form, f, !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
- /** 提交增改表单操作 */
1709
+ validate: async () => {
1710
+ const i = e();
1711
+ try {
1712
+ return await Promise.all([
1713
+ l.ruleFormRef.value?.validate(async (o) => new Promise((t, s) => {
1714
+ o || s(!1), t(void 0);
1715
+ })),
1716
+ i.formRef.validate()
1717
+ ]), !0;
1718
+ } catch {
1719
+ S.fail(b.tCurd("checkFormData"));
1720
+ }
1721
+ },
1534
1722
  submit: () => {
1535
1723
  FunUtil.throttle(async () => {
1724
+ const i = e();
1725
+ if (!await i.update.validate()) return;
1726
+ i.update.loading = !0;
1727
+ const t = i.update.type === le.Add ? n.option.api.create : n.option.api.update;
1536
1728
  try {
1537
- await Promise.all([
1538
- s.value?.validate(async (i, m) => new Promise((u, w) => {
1539
- i || w(!1), u();
1540
- })),
1541
- o.formRef.validate()
1542
- ]);
1543
- } catch {
1544
- D.fail(v.tCurd("checkFormData"));
1545
- return;
1546
- }
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;
1551
- try {
1552
- await e.option.form?.submitBefore?.(o.update.form, o.update);
1729
+ await n.option.form?.submitBefore?.(i.update.form, i.update);
1553
1730
  } catch {
1554
- o.update.loading = !1;
1731
+ i.update.loading = !1;
1555
1732
  return;
1556
1733
  }
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);
1734
+ let s = ObjectUtil.deepMerge(i.update.form, {});
1735
+ delete s.children;
1736
+ const f = new Set(n.option.column.filter((d) => d.type === "datetime").map((d) => d.key));
1737
+ Object.keys(s).forEach((d) => {
1738
+ if (f.has(d) && s[d] != null) {
1739
+ const c = new Date(s[d]).getTime();
1740
+ isNaN(c) || (s[d] = c);
1564
1741
  }
1565
1742
  });
1566
1743
  try {
1567
1744
  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);
1745
+ await t({ ...s }), i.update.close(), await i.table.getList(), n.option.form?.submitAfter?.(s, i.update);
1746
+ } catch (d) {
1747
+ console.error(d);
1573
1748
  } finally {
1574
- o.update.loading = !1;
1749
+ i.update.loading = !1;
1575
1750
  }
1576
1751
  });
1577
1752
  },
1578
- /** 关闭弹窗和内容 */
1579
1753
  close: () => {
1580
- o.update.show = !1, e.option.table?.inlineEdit && (o.update.form = {}), setTimeout(() => {
1581
- o.update.showContent = !1;
1754
+ const i = e();
1755
+ i.update.show = !1, i.update.edit.data = void 0, setTimeout(() => {
1756
+ i.update.showContent = !1, l.ruleFormRef.value?.resetFields?.(), a.clear();
1582
1757
  }, 350);
1583
1758
  }
1759
+ }
1760
+ };
1761
+ }, Vt = (e, n) => ({
1762
+ remove: {
1763
+ title: b.tCurd("deleteTitle"),
1764
+ show: !1,
1765
+ items: [],
1766
+ loading: !1,
1767
+ close: () => {
1768
+ e().remove.show = !1;
1584
1769
  },
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
- });
1770
+ open: (l) => {
1771
+ if (l.length === 0) {
1772
+ S.fail(b.tCurd("selectDataToDelete"));
1773
+ return;
1624
1774
  }
1775
+ const a = e();
1776
+ a.remove.items = l, a.remove.show = !0;
1625
1777
  },
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);
1778
+ submit: () => {
1779
+ FunUtil.throttle(async () => {
1780
+ const l = e();
1781
+ l.remove.loading = !0;
1782
+ const a = n.option.api.delete;
1783
+ try {
1784
+ if (!a) return;
1785
+ await a({
1786
+ [n.option.table?.rowKey]: l.remove.items.map((i) => i[n.option.table?.rowKey]),
1787
+ items: l.remove.items
1788
+ }), 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();
1789
+ } catch (i) {
1790
+ console.error(i);
1791
+ } finally {
1792
+ l.remove.loading = !1;
1652
1793
  }
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
1794
  });
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;
1795
+ }
1796
+ }
1797
+ }), zt = (e, n, l) => ({
1798
+ apiDataMap: {},
1799
+ getColumnSpan: (a, i) => {
1800
+ const o = e(), t = o.update.formGrid?.length ? o.update.formGrid : i || [];
1801
+ return Me(a, t, o.update.form, o.update.type, {
1802
+ maxSpan: o.update.formMaxSpan || n.option.form?.maxSpan,
1803
+ defaultSpan: n.option.form?.defaultSpan || M.config.form.defaultSpan
1804
+ });
1805
+ },
1806
+ init: () => {
1807
+ const a = e();
1808
+ a.initCurdConfig(), a.initColumnOptions(), a.initColumnForm();
1809
+ },
1810
+ initApiData: async (a) => {
1811
+ const i = e(), o = [], t = (s) => {
1812
+ if (s.children?.length) {
1813
+ s.children.forEach((f) => t(f));
1814
+ return;
1815
+ }
1816
+ if (s.options?.[s.type]?.dataApi && s.options?.[s.type]?.dataApiConfig?.[a]) {
1817
+ if (i.apiDataMap[s.key] && s.options?.[s.type]?.dataApiConfig?.once) return;
1818
+ const f = (async () => {
1819
+ try {
1820
+ let d = await s.options?.[s.type]?.dataApi?.(i.update.form, i.update.type);
1821
+ if (d) {
1822
+ const c = s.options?.[s.type]?.dataPath;
1823
+ !Array.isArray(d) && c && (d = ObjectUtil.getPathValue(d, c)), 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;
1691
1824
  }
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 || {});
1825
+ } catch {
1826
+ }
1827
+ })();
1828
+ o.push(f);
1829
+ }
1830
+ };
1831
+ return n.option.column.forEach((s) => t(s)), await Promise.all(o), !0;
1832
+ },
1833
+ initCurdConfig: () => {
1834
+ const a = ObjectUtil.deepMerge(M.config, {});
1835
+ a.table.emptyText = b.tCurd("noData"), n.option.size = n.option.size || {}, a.table.size = n.option.size.table || a.size.table, a.form.size = n.option.size.form || a.size.form, a.size.search = n.option.size.search || a.size.search;
1836
+ const i = ObjectUtil.deepMerge(a, n.option || {});
1837
+ Object.keys(i).forEach((o) => {
1838
+ n.option[o] = i[o];
1839
+ });
1840
+ },
1841
+ initColumnOptions: () => {
1842
+ const a = e();
1843
+ let i = JSONUtil.cp(M.config.columnConfig);
1844
+ i.options = ObjectUtil.deepMerge(
1845
+ {
1846
+ switch: {
1847
+ activeText: b.tCurd("switchOn"),
1848
+ inactiveText: b.tCurd("switchOff")
1696
1849
  }
1697
- a.type === "switch" && (a.options.switch.tableBeforeChange = async (i, m) => {
1698
- const u = a.options?.switch;
1850
+ },
1851
+ i.options
1852
+ );
1853
+ const o = (t) => {
1854
+ for (const s in i) {
1855
+ if (s === "table") {
1856
+ if (t.table = ObjectUtil.deepMerge(i.table, t.table || {}), t.children) {
1857
+ t.children.forEach((d) => o(d));
1858
+ return;
1859
+ }
1860
+ } else s === "type" ? t.type = t.type || i.type : t[s] = ObjectUtil.deepMerge(i[s], t[s] || {});
1861
+ 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) => {
1862
+ 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;
1863
+ }), t.table = ObjectUtil.deepMerge(t.table, t.options[t.type].table || {});
1864
+ }
1865
+ t.type === "switch" && (t.options.switch.tableBeforeChange = async (s, f) => {
1866
+ const d = t.options?.switch;
1867
+ try {
1868
+ d.tableConfig?.confirm && await l.switchConfirmRef.value?.open({
1869
+ title: b.tCurd("confirmModify"),
1870
+ content: b.tCurd("confirmSwitchMessage")
1871
+ });
1699
1872
  try {
1700
- u.tableConfig?.confirm && await r.value?.open({
1701
- title: v.tCurd("confirmModify"),
1702
- content: v.tCurd("confirmSwitchMessage")
1703
- });
1873
+ if (!n.option.api.update && !d.tableConfig?.api) return;
1874
+ const c = f[n.option.table?.rowKey];
1875
+ d.loadingMap || (d.loadingMap = {}), d.loadingMap[c] || (d.loadingMap[c] = { loading: !1 }), d.loadingMap[c].loading = !0;
1876
+ const v = f[s] === d.activeValue ? d.inactiveValue : d.activeValue, m = d.tableConfig?.api ? d.tableConfig.api : n.option.api.update;
1877
+ if (!m) return;
1704
1878
  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;
1879
+ await m({ ...f, [s]: v }, "switch");
1880
+ } catch {
1881
+ return !1;
1726
1882
  } finally {
1727
- o.table.loading = !1;
1883
+ d.loadingMap[c].loading = !1;
1728
1884
  }
1729
- } catch {
1730
- return !1;
1731
- }
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;
1740
- }
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;
1758
- }
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
- });
1885
+ return S.success(b.tCurd("operationSuccess")), d.tableConfig?.loadList && (a.table.loading = !0, a.table.getList(), a.table.loading = !1), !0;
1886
+ } catch (c) {
1887
+ return console.error(c), !1;
1888
+ } finally {
1889
+ a.table.loading = !1;
1784
1890
  }
1891
+ } catch {
1892
+ return !1;
1785
1893
  }
1786
- }, w = (p, k) => {
1787
- p.isForm = k, Array.isArray(p.children) && p.children.forEach((F) => w(F, k));
1894
+ }), t.type === "treeSelect" && (t.options.treeSelect.rowKey = n.option.table?.rowKey, t.options.treeSelect.nodeKey = n.option.table?.rowKey);
1895
+ };
1896
+ n.option.column.forEach(o), n.option.table?.column?.forEach(o);
1897
+ },
1898
+ initColumnForm: () => {
1899
+ const a = e(), i = n.option;
1900
+ a.update.formColumn = [], a.update.formGrid = [], a.update.formMaxSpan = 12, a.table.column.show = { list: [], listSource: [] };
1901
+ const o = n.option.form?.maxSpan || 12, t = n.option.form?.defaultSpan || o / 2, s = Re((m) => {
1902
+ const g = {
1903
+ input: b.tCurd("placeholderInput"),
1904
+ select: b.tCurd("placeholderSelect")
1788
1905
  };
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(() => {
1906
+ return (g[m.type || "input"] || g.input) + m.label;
1907
+ }), f = (m) => {
1908
+ if (m.children) {
1909
+ a.table.column.show.list.push(m.key), m.children.forEach((g) => f(g));
1910
+ return;
1911
+ }
1912
+ a.update.formDefault[m.key] = m.value, m.table?.table && (m.show?.table && a.table.column.show.list.push(m.key), a.table.column.show.listSource.push(m.key));
1913
+ };
1914
+ i.column.forEach((m) => {
1915
+ ue(m, !0), f(m);
1916
+ }), n.option.table?.column?.forEach((m) => {
1917
+ ue(m, !1), f(m);
1918
+ }), a.search.column.list = i.column.concat(i.table?.column || []), a.table.column.list = a.search.column.list.filter((m) => m.table?.table), a.search.column.list.sort((m, g) => m.sort?.search - g.sort?.search), a.table.column.list.sort((m, g) => m.sort?.table - g.sort?.table), a.update.rules = {}, Be(i.column, a.update.formDefault, a.update.rules, (m) => s(m, a.update.form));
1919
+ const d = Ae(i.column, {
1920
+ maxSpan: o,
1921
+ defaultSpan: t,
1922
+ layout: n.option.form?.layout
1923
+ });
1924
+ a.update.formGrid = d.cells, a.update.formMaxSpan = d.maxSpan, a.update.formColumn = Fe(d.cells);
1925
+ const c = n.option.search?.formDefault;
1926
+ c && Object.keys(c).forEach((m) => {
1927
+ a.search.formDefault[m] = c[m];
1928
+ }), i.column.forEach((m) => {
1929
+ m.show?.search || (a.search.formDefault[m.key] = void 0);
1930
+ });
1931
+ const v = ObjectUtil.deepMerge(a.search.formDefault, {});
1932
+ J.setValue(a.search.form, v, !0);
1933
+ }
1934
+ }), $t = (e) => {
1935
+ const n = Q(), l = Q(), a = Q(), i = { switchConfirmRef: n, ruleFormRef: l, tableRef: a };
1936
+ let o;
1937
+ const t = () => o;
1938
+ return o = me({
1939
+ ...pt(),
1940
+ option: e.option,
1941
+ ...wt(t, e),
1942
+ ...vt(t, e),
1943
+ ...kt(t, e, i),
1944
+ ...xt(t, e),
1945
+ ...St(t, e, i),
1946
+ ...Vt(t, e),
1947
+ ...zt(t, e, i)
1948
+ }), o.init(), Ve(() => {
1805
1949
  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({
1950
+ }), ze.setConf(o), { conf: o, switchConfirmRef: n, ruleFormRef: l, tableRef: a };
1951
+ }, Et = { class: "dialog-footer" }, Dt = /* @__PURE__ */ G({
1830
1952
  __name: "switchConfirm",
1831
1953
  props: {
1832
1954
  size: {}
1833
1955
  },
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;
1956
+ setup(e, { expose: n }) {
1957
+ const l = Q(!1), a = Q("确认修改"), i = Q("确认要修改状态吗?");
1958
+ let o = null, t = null;
1959
+ const s = (c) => (c?.title && (a.value = c.title), c?.content && (i.value = c.content), l.value = !0, new Promise((v, m) => {
1960
+ o = v, t = m;
1961
+ })), f = () => {
1962
+ l.value = !1, o?.(!0), o = null, t = null;
1963
+ }, d = () => {
1964
+ l.value = !1, t?.(new Error("用户取消操作")), o = null, t = null;
1843
1965
  };
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,
1966
+ return n({
1967
+ open: s
1968
+ }), (c, v) => {
1969
+ const m = ae("el-form");
1970
+ return u(), h(r(ye), {
1971
+ modelValue: l.value,
1972
+ "onUpdate:modelValue": v[0] || (v[0] = (g) => l.value = g),
1973
+ title: a.value,
1852
1974
  "close-on-click-modal": !1,
1853
1975
  width: "400px"
1854
1976
  }, {
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)
1977
+ footer: y(() => [
1978
+ $(m, { size: e.size }, {
1979
+ default: y(() => [
1980
+ O("span", Et, [
1981
+ $(r(T), { onClick: d }, {
1982
+ default: y(() => [...v[1] || (v[1] = [
1983
+ V("取消", -1)
1862
1984
  ])]),
1863
1985
  _: 1
1864
1986
  }),
1865
- E(l(T), {
1987
+ $(r(T), {
1866
1988
  type: "primary",
1867
- onClick: i
1989
+ onClick: f
1868
1990
  }, {
1869
- default: g(() => [...w[2] || (w[2] = [
1870
- O("确认", -1)
1991
+ default: y(() => [...v[2] || (v[2] = [
1992
+ V("确认", -1)
1871
1993
  ])]),
1872
1994
  _: 1
1873
1995
  })
@@ -1876,83 +1998,196 @@ const P = D.EDialog, Je = (e) => {
1876
1998
  _: 1
1877
1999
  }, 8, ["size"])
1878
2000
  ]),
1879
- default: g(() => [
1880
- U("div", null, S(o.value), 1)
2001
+ default: y(() => [
2002
+ O("div", null, D(i.value), 1)
1881
2003
  ]),
1882
2004
  _: 1
1883
2005
  }, 8, ["modelValue", "title"]);
1884
2006
  };
1885
2007
  }
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 = {
1892
- xmlns: "http://www.w3.org/2000/svg",
1893
- viewBox: "0 0 1024 1024"
1894
- };
1895
- function Ye(e, r) {
1896
- return d(), b("svg", Xe, [...r[0] || (r[0] = [
1897
- U("path", {
1898
- fill: "currentColor",
1899
- 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
- }, null, -1)
1901
- ])]);
1902
- }
1903
- const Ze = /* @__PURE__ */ Y(Ge, [["render", Ye]]), _e = ["innerHTML"], et = /* @__PURE__ */ K({
2008
+ }), Ot = ["innerHTML"], Mt = /* @__PURE__ */ G({
1904
2009
  __name: "text",
1905
2010
  props: {
1906
2011
  content: {},
1907
2012
  value: {}
1908
2013
  },
1909
2014
  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", {
2015
+ const n = e, l = te(() => typeof n.content == "function" ? n.content(n.value) : n.content);
2016
+ return (a, i) => typeof l.value == "object" ? (u(), h(Y(l.value), { key: 0 })) : (u(), p("div", {
2017
+ key: 1,
2018
+ innerHTML: l.value
2019
+ }, null, 8, Ot));
2020
+ }
2021
+ }), ke = /* @__PURE__ */ G({
2022
+ __name: "searchField",
2023
+ props: {
2024
+ item: {},
2025
+ conf: {},
2026
+ type: {}
2027
+ },
2028
+ setup(e) {
2029
+ const n = e, l = te({
2030
+ get: () => n.conf.search.form?.[n.item?.key],
2031
+ set: (a) => {
2032
+ n.item?.key !== void 0 && (n.conf.search.form[n.item.key] = a);
2033
+ }
2034
+ });
2035
+ return (a, i) => r(P).customComponent[e.type ?? ""]?.search ? (u(), h(Y(r(P).customComponent[e.type ?? ""]?.search), C({
2036
+ key: 0,
2037
+ modelValue: l.value,
2038
+ "onUpdate:modelValue": i[0] || (i[0] = (o) => l.value = o)
2039
+ }, 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({
1912
2040
  key: 1,
1913
- innerHTML: s.value
1914
- }, null, 8, _e));
2041
+ modelValue: l.value,
2042
+ "onUpdate:modelValue": i[1] || (i[1] = (o) => l.value = o),
2043
+ placeholder: e.conf.search.getPlaceholder(e.item),
2044
+ clearable: "",
2045
+ disabled: e.item.disabled?.search
2046
+ }, 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({
2047
+ key: 2,
2048
+ modelValue: l.value,
2049
+ "onUpdate:modelValue": i[2] || (i[2] = (o) => l.value = o),
2050
+ placeholder: e.conf.search.getPlaceholder(e.item, r(b).tCurd("placeholderSelect")),
2051
+ clearable: "",
2052
+ disabled: e.item.disabled?.search
2053
+ }, e.item.options?.search?.switch || e.item.options?.switch, E(e.item.options?.search?.switch?.on || e.item.options?.switch?.on || {})), {
2054
+ default: y(() => [
2055
+ (u(), h(r(X), {
2056
+ key: e.item.options?.switch?.activeValue,
2057
+ label: e.item.options?.switch?.activeText,
2058
+ value: e.item.options?.switch?.activeValue
2059
+ }, null, 8, ["label", "value"])),
2060
+ (u(), h(r(X), {
2061
+ key: e.item.options?.switch?.inactiveValue,
2062
+ label: e.item.options?.switch?.inactiveText,
2063
+ value: e.item.options?.switch?.inactiveValue
2064
+ }, null, 8, ["label", "value"]))
2065
+ ]),
2066
+ _: 1
2067
+ }, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "select" ? (u(), h(r(oe), C({
2068
+ key: 3,
2069
+ modelValue: l.value,
2070
+ "onUpdate:modelValue": i[3] || (i[3] = (o) => l.value = o),
2071
+ placeholder: e.conf.search.getPlaceholder(e.item, r(b).tCurd("placeholderSelect")),
2072
+ clearable: "",
2073
+ disabled: e.item.disabled?.search
2074
+ }, e.item.options?.search?.select || e.item.options?.select, E(e.item.options?.search?.select?.on || e.item.options?.select?.on || {})), {
2075
+ default: y(() => [
2076
+ (u(!0), p(F, null, j(e.item.options?.search?.select?.data || e.item.options?.select?.data || [], (o) => (u(), h(r(X), {
2077
+ key: o.value,
2078
+ label: o.label,
2079
+ value: o.value
2080
+ }, null, 8, ["label", "value"]))), 128))
2081
+ ]),
2082
+ _: 1
2083
+ }, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "radio" ? (u(), h(r(Ce), C({
2084
+ key: 4,
2085
+ modelValue: l.value,
2086
+ "onUpdate:modelValue": i[4] || (i[4] = (o) => l.value = o),
2087
+ disabled: e.item.disabled?.search
2088
+ }, e.item.options?.search?.radio || e.item.options?.radio, E(e.item.options?.search?.radio?.on || e.item.options?.radio?.on || {})), {
2089
+ default: y(() => [
2090
+ (u(!0), p(F, null, j(e.item.options?.radio?.data, (o) => (u(), h(r(xe), {
2091
+ key: o.value,
2092
+ label: o.label,
2093
+ value: o.value
2094
+ }, null, 8, ["label", "value"]))), 128))
2095
+ ]),
2096
+ _: 1
2097
+ }, 16, ["modelValue", "disabled"])) : e.type === "datetime" ? (u(), h(r(Se), C({
2098
+ key: 5,
2099
+ modelValue: l.value,
2100
+ "onUpdate:modelValue": i[5] || (i[5] = (o) => l.value = o),
2101
+ disabled: e.item.disabled?.search
2102
+ }, 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({
2103
+ key: 6,
2104
+ modelValue: l.value,
2105
+ "onUpdate:modelValue": i[6] || (i[6] = (o) => l.value = o)
2106
+ }, 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 || {}), {
2107
+ disabled: e.item.disabled?.search
2108
+ }), null, 16, ["modelValue", "disabled"])) : w("", !0);
1915
2109
  }
1916
- }), tt = {}, ot = {
2110
+ }), Z = (e, n) => {
2111
+ const l = e.__vccOpts || e;
2112
+ for (const [a, i] of n)
2113
+ l[a] = i;
2114
+ return l;
2115
+ }, Ft = {}, Ut = {
2116
+ xmlns: "http://www.w3.org/2000/svg",
2117
+ viewBox: "64 64 896 896"
2118
+ };
2119
+ function At(e, n) {
2120
+ return u(), p("svg", Ut, [...n[0] || (n[0] = [
2121
+ O("path", {
2122
+ fill: "currentColor",
2123
+ 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"
2124
+ }, null, -1)
2125
+ ])]);
2126
+ }
2127
+ const Rt = /* @__PURE__ */ Z(Ft, [["render", At]]), Bt = {}, Tt = {
2128
+ xmlns: "http://www.w3.org/2000/svg",
2129
+ viewBox: "64 64 896 896"
2130
+ };
2131
+ function Lt(e, n) {
2132
+ return u(), p("svg", Tt, [...n[0] || (n[0] = [
2133
+ O("path", {
2134
+ fill: "currentColor",
2135
+ 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"
2136
+ }, null, -1)
2137
+ ])]);
2138
+ }
2139
+ const jt = /* @__PURE__ */ Z(Bt, [["render", Lt]]), Pt = {}, It = {
2140
+ xmlns: "http://www.w3.org/2000/svg",
2141
+ viewBox: "0 0 1024 1024"
2142
+ };
2143
+ function Kt(e, n) {
2144
+ return u(), p("svg", It, [...n[0] || (n[0] = [
2145
+ O("path", {
2146
+ fill: "currentColor",
2147
+ 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"
2148
+ }, null, -1)
2149
+ ])]);
2150
+ }
2151
+ const Ht = /* @__PURE__ */ Z(Pt, [["render", Kt]]), Gt = {}, Nt = {
1917
2152
  "data-v-58697b5c": "",
1918
2153
  xmlns: "http://www.w3.org/2000/svg",
1919
2154
  viewBox: "0 0 1024 1024"
1920
2155
  };
1921
- function at(e, r) {
1922
- return d(), b("svg", ot, [...r[0] || (r[0] = [
1923
- U("path", {
2156
+ function Wt(e, n) {
2157
+ return u(), p("svg", Nt, [...n[0] || (n[0] = [
2158
+ O("path", {
1924
2159
  fill: "currentColor",
1925
2160
  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
2161
  }, null, -1)
1927
2162
  ])]);
1928
2163
  }
1929
- const lt = /* @__PURE__ */ Y(tt, [["render", at]]), nt = {}, it = {
2164
+ const Jt = /* @__PURE__ */ Z(Gt, [["render", Wt]]), Qt = {}, qt = {
1930
2165
  "data-v-58697b5c": "",
1931
2166
  xmlns: "http://www.w3.org/2000/svg",
1932
2167
  viewBox: "0 0 1024 1024"
1933
2168
  };
1934
- function rt(e, r) {
1935
- return d(), b("svg", it, [...r[0] || (r[0] = [
1936
- U("path", {
2169
+ function Xt(e, n) {
2170
+ return u(), p("svg", qt, [...n[0] || (n[0] = [
2171
+ O("path", {
1937
2172
  fill: "currentColor",
1938
2173
  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
2174
  }, null, -1)
1940
2175
  ])]);
1941
2176
  }
1942
- const dt = /* @__PURE__ */ Y(nt, [["render", rt]]), st = {}, ut = {
2177
+ const Yt = /* @__PURE__ */ Z(Qt, [["render", Xt]]), Zt = {}, _t = {
1943
2178
  "data-v-58697b5c": "",
1944
2179
  xmlns: "http://www.w3.org/2000/svg",
1945
2180
  viewBox: "0 0 1024 1024"
1946
2181
  };
1947
- function ct(e, r) {
1948
- return d(), b("svg", ut, [...r[0] || (r[0] = [
1949
- U("path", {
2182
+ function eo(e, n) {
2183
+ return u(), p("svg", _t, [...n[0] || (n[0] = [
2184
+ O("path", {
1950
2185
  fill: "currentColor",
1951
2186
  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
2187
  }, null, -1)
1953
2188
  ])]);
1954
2189
  }
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({
2190
+ const to = /* @__PURE__ */ Z(Zt, [["render", eo]]), oo = { class: "row flex-center table-header-label inline" }, ao = { class: "table-header-tooltip" }, no = ["innerHTML"], lo = ["onClick"], io = { key: 1 }, ro = ["onClick", "innerHTML"], so = /* @__PURE__ */ G({
1956
2191
  __name: "tableColumn",
1957
2192
  props: {
1958
2193
  conf: {},
@@ -1960,447 +2195,206 @@ const ft = /* @__PURE__ */ Y(st, [["render", ct]]), mt = { class: "row flex-cent
1960
2195
  option: {}
1961
2196
  },
1962
2197
  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
2198
+ const n = S.isFun, l = Qe().type;
2199
+ return (a, i) => {
2200
+ const o = ae("el-tooltip");
2201
+ return u(!0), p(F, null, j(e.columnList, (t) => (u(), p(F, {
2202
+ key: t.key
1968
2203
  }, [
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({
2204
+ 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 }, [
2205
+ t.table?.header?.groupKey === void 0 || t.table.header.show ? (u(), h(r(re), C({
1971
2206
  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, {
2207
+ prop: t.key,
2208
+ label: t.label
2209
+ }, { ref_for: !0 }, t.table), {
2210
+ header: y(() => [
2211
+ k(a.$slots, "table-header-" + t.key, { item: t }, () => [
2212
+ O("div", oo, [
2213
+ t.table?.header?.tooltip ? (u(), h(o, {
1979
2214
  key: 0,
1980
2215
  effect: "dark",
1981
2216
  placement: "top"
1982
2217
  }, {
1983
- content: g(() => [
1984
- U("div", {
1985
- innerHTML: n.table?.header?.tooltip
1986
- }, null, 8, pt)
2218
+ content: y(() => [
2219
+ O("div", {
2220
+ innerHTML: t.table?.header?.tooltip
2221
+ }, null, 8, no)
1987
2222
  ]),
1988
- default: g(() => [
1989
- U("span", ht, [
1990
- E(lt)
2223
+ default: y(() => [
2224
+ O("span", ao, [
2225
+ $(Jt)
1991
2226
  ])
1992
2227
  ]),
1993
2228
  _: 2
1994
- }, 1024)) : C("", !0),
1995
- O(" " + S(n.label) + " ", 1),
1996
- n.table?.header?.group !== void 0 ? (d(), b("span", {
2229
+ }, 1024)) : w("", !0),
2230
+ V(" " + D(t.label) + " ", 1),
2231
+ t.table?.header?.group !== void 0 ? (u(), p("span", {
1997
2232
  key: 1,
1998
2233
  class: "table-header-plus",
1999
- onClick: Ue(
2234
+ onClick: qe(
2000
2235
  () => {
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);
2236
+ t.table.header.group = !t.table.header.group, e.columnList.forEach((s) => {
2237
+ s.table?.header?.groupKey === t.key && (s.table.header.show = !t.table.header.group);
2003
2238
  });
2004
2239
  },
2005
2240
  ["stop"]
2006
2241
  )
2007
2242
  }, [
2008
- n.table.header.group ? (d(), y(dt, { key: 0 })) : (d(), y(ft, { key: 1 }))
2009
- ], 8, yt)) : C("", !0)
2243
+ t.table.header.group ? (u(), h(Yt, { key: 0 })) : (u(), h(to, { key: 1 }))
2244
+ ], 8, lo)) : w("", !0)
2010
2245
  ])
2011
2246
  ])
2012
2247
  ]),
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)), {
2248
+ default: y(({ row: s }) => [
2249
+ t.children ? (u(), p(F, { key: 0 }, [
2250
+ i[0] || (i[0] = V("   ", -1)),
2251
+ (u(), h(Y(r(l)), {
2017
2252
  conf: e.conf,
2018
- columnList: n.children,
2253
+ columnList: t.children,
2019
2254
  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 || {}))
2255
+ }, W({ _: 2 }, [
2256
+ j(a.$slots, (f, d) => ({
2257
+ name: d,
2258
+ fn: y((c) => [
2259
+ k(a.$slots, d, C({ ref_for: !0 }, c || {}))
2025
2260
  ])
2026
2261
  }))
2027
2262
  ]), 1032, ["conf", "columnList", "option"]))
2028
- ], 64)) : (d(), b($, { key: 1 }, [
2029
- e.option.table?.editMode ? (d(), b("div", {
2263
+ ], 64)) : (u(), p(F, { key: 1 }, [
2264
+ e.option.table?.editMode ? (u(), p("div", {
2030
2265
  key: 0,
2031
- class: R(["row", ["table-edit-" + n.key]]),
2266
+ class: I(["row", ["table-edit-" + t.key]]),
2032
2267
  style: { width: "100%" }
2033
2268
  }, [
2034
- x(c.$slots, "table-edit-left-" + n.key, {
2035
- row: a,
2036
- item: n
2269
+ k(a.$slots, "table-edit-left-" + t.key, {
2270
+ row: s,
2271
+ item: t
2037
2272
  }),
2038
- n.type === "input" ? (d(), y(l(ee), V({
2273
+ t.type === "input" ? (u(), h(r(se), C({
2039
2274
  key: 0,
2040
- modelValue: a[n.key],
2041
- "onUpdate:modelValue": (i) => a[n.key] = i,
2042
- disabled: e.conf.update.getDisabled(n, !0),
2275
+ modelValue: s[t.key],
2276
+ "onUpdate:modelValue": (f) => s[t.key] = f,
2277
+ disabled: e.conf.update.getDisabled(t, !0),
2043
2278
  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 ? {
2279
+ }, { ref_for: !0 }, e.conf.update.getBind(t), E(e.conf.update.getOn(t, s))), W({ _: 2 }, [
2280
+ t.options?.input?.prepend ? {
2046
2281
  name: "prepend",
2047
- fn: g(() => [
2048
- O(S(typeof n.options?.input?.prepend == "function" ? n.options?.input?.prepend(a) : n.options?.input?.prepend), 1)
2282
+ fn: y(() => [
2283
+ V(D(typeof t.options?.input?.prepend == "function" ? t.options?.input?.prepend(s) : t.options?.input?.prepend), 1)
2049
2284
  ]),
2050
2285
  key: "0"
2051
2286
  } : void 0
2052
- ]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.type === "select" ? (d(), y(l(X), V({
2287
+ ]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : t.type === "select" ? (u(), h(r(oe), C({
2053
2288
  key: 1,
2054
- modelValue: a[n.key],
2055
- "onUpdate:modelValue": (i) => a[n.key] = i,
2056
- disabled: e.conf.update.getDisabled(n, !0),
2289
+ modelValue: s[t.key],
2290
+ "onUpdate:modelValue": (f) => s[t.key] = f,
2291
+ disabled: e.conf.update.getDisabled(t, !0),
2057
2292
  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
2293
+ }, { ref_for: !0 }, e.conf.update.getBind(t), E(e.conf.update.getOn(t, s))), {
2294
+ default: y(() => [
2295
+ (u(!0), p(F, null, j(t.options?.search?.select?.data || t.options?.select?.data, (f) => (u(), h(r(X), {
2296
+ key: f.value,
2297
+ label: f.label,
2298
+ value: f.value
2064
2299
  }, null, 8, ["label", "value"]))), 128))
2065
2300
  ]),
2066
2301
  _: 2
2067
- }, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.type === "switch" ? (d(), y(l(Z), V({
2302
+ }, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : t.type === "switch" ? (u(), h(r(ie), C({
2068
2303
  key: 2,
2069
- modelValue: a[n.key],
2070
- "onUpdate:modelValue": (i) => a[n.key] = i,
2071
- disabled: e.conf.update.getDisabled(n, !0),
2304
+ modelValue: s[t.key],
2305
+ "onUpdate:modelValue": (f) => s[t.key] = f,
2306
+ disabled: e.conf.update.getDisabled(t, !0),
2072
2307
  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
2308
+ }, { ref_for: !0 }, e.conf.update.getBind(t), E(e.conf.update.getOn(t, s))), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : w("", !0),
2309
+ k(a.$slots, "table-edit-right-" + t.key, {
2310
+ row: s,
2311
+ item: t
2077
2312
  })
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({
2313
+ ], 2)) : (u(), p(F, { key: 1 }, [
2314
+ 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 }, [
2315
+ t.type === "input" ? (u(), h(r(se), C({
2081
2316
  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 ? {
2317
+ modelValue: e.conf.update.form[t.key],
2318
+ "onUpdate:modelValue": (f) => e.conf.update.form[t.key] = f,
2319
+ disabled: e.conf.update.getDisabled(t, !0)
2320
+ }, { ref_for: !0 }, e.conf.update.getBind(t), E(e.conf.update.getOn(t, s)), { style: { width: "100%" } }), W({ _: 2 }, [
2321
+ t.options?.input?.prepend ? {
2087
2322
  name: "prepend",
2088
- fn: g(() => [
2089
- O(S(typeof n.options?.input?.prepend == "function" ? n.options?.input?.prepend(a) : n.options?.input?.prepend), 1)
2323
+ fn: y(() => [
2324
+ V(D(typeof t.options?.input?.prepend == "function" ? t.options?.input?.prepend(s) : t.options?.input?.prepend), 1)
2090
2325
  ]),
2091
2326
  key: "0"
2092
2327
  } : void 0
2093
- ]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.type === "select" ? (d(), y(l(X), V({
2328
+ ]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : t.type === "select" ? (u(), h(r(oe), C({
2094
2329
  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
2330
+ modelValue: e.conf.update.form[t.key],
2331
+ "onUpdate:modelValue": (f) => e.conf.update.form[t.key] = f,
2332
+ disabled: e.conf.update.getDisabled(t, !0)
2333
+ }, { ref_for: !0 }, e.conf.update.getBind(t), E(e.conf.update.getOn(t, s)), { style: { width: "100%" } }), {
2334
+ default: y(() => [
2335
+ (u(!0), p(F, null, j(t.options?.search?.select?.data || t.options?.select?.data, (f) => (u(), h(r(X), {
2336
+ key: f.value,
2337
+ label: f.label,
2338
+ value: f.value
2104
2339
  }, null, 8, ["label", "value"]))), 128))
2105
2340
  ]),
2106
2341
  _: 2
2107
- }, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.type === "switch" ? (d(), y(l(Z), V({
2342
+ }, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : t.type === "switch" ? (u(), h(r(ie), C({
2108
2343
  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, {
2344
+ modelValue: e.conf.update.form[t.key],
2345
+ "onUpdate:modelValue": (f) => e.conf.update.form[t.key] = f
2346
+ }, { ref_for: !0 }, e.conf.update.getBind(t), E(e.conf.update.getOn(t, s)), {
2347
+ disabled: e.conf.update.getDisabled(t, !0)
2348
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : w("", !0)
2349
+ ], 64)) : k(a.$slots, "table-" + t.key, {
2115
2350
  key: 1,
2116
- row: a,
2117
- item: n
2351
+ row: s,
2352
+ item: t
2118
2353
  }, () => [
2119
- l(j).customComponent[n.type ?? ""]?.table ? (d(), y(q(l(j).customComponent[n.type ?? ""]?.table), V({
2354
+ r(P).customComponent[t.type ?? ""]?.table ? (u(), h(Y(r(P).customComponent[t.type ?? ""]?.table), C({
2120
2355
  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({
2356
+ modelValue: s[t.key],
2357
+ "onUpdate:modelValue": (f) => s[t.key] = f
2358
+ }, { 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 }, [
2359
+ t.options?.switch?.tableConfig?.change ? (u(), h(r(ie), C({
2125
2360
  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", {
2361
+ modelValue: s[t.key],
2362
+ "onUpdate:modelValue": (f) => s[t.key] = f,
2363
+ loading: t.options?.switch?.loadingMap?.[s[e.option.table?.rowKey]]?.loading,
2364
+ "before-change": () => t.options?.switch?.tableBeforeChange?.(t.key, s)
2365
+ }, { ref_for: !0 }, t.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "loading", "before-change"])) : (u(), p("span", io, D(s[t.key] === t.options?.switch?.activeValue ? t.options?.switch?.activeText : t.options?.switch?.inactiveText), 1))
2366
+ ], 64)) : (u(), p("span", {
2132
2367
  key: 2,
2133
- style: ge({
2134
- "--table-text-click-color": n.table?.click?.color
2368
+ style: de({
2369
+ "--table-text-click-color": t.table?.click?.color
2135
2370
  }),
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))
2371
+ class: I({ "table-text-click": t.table?.click?.callback }),
2372
+ onClick: (f) => t.table?.click?.callback?.(s),
2373
+ innerHTML: t.table?.format ? t.table?.format(s) : s[t.key]
2374
+ }, null, 14, ro))
2140
2375
  ])
2141
2376
  ], 64))
2142
2377
  ], 64))
2143
2378
  ]),
2144
2379
  _: 2
2145
- }, 1040, ["prop", "label"])) : C("", !0)
2146
- ], 64)) : C("", !0)
2380
+ }, 1040, ["prop", "label"])) : w("", !0)
2381
+ ], 64)) : w("", !0)
2147
2382
  ], 64))), 128);
2148
2383
  };
2149
2384
  }
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 = {
2279
- xmlns: "http://www.w3.org/2000/svg",
2280
- viewBox: "64 64 896 896"
2281
- };
2282
- function Ot(e, r) {
2283
- return d(), b("svg", $t, [...r[0] || (r[0] = [
2284
- U("path", {
2285
- fill: "currentColor",
2286
- 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
- }, null, -1)
2288
- ])]);
2289
- }
2290
- const Dt = /* @__PURE__ */ Y(zt, [["render", Ot]]), Et = {}, Ut = {
2291
- xmlns: "http://www.w3.org/2000/svg",
2292
- viewBox: "64 64 896 896"
2293
- };
2294
- function St(e, r) {
2295
- return d(), b("svg", Ut, [...r[0] || (r[0] = [
2296
- U("path", {
2297
- fill: "currentColor",
2298
- 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
- }, null, -1)
2300
- ])]);
2301
- }
2302
- const Mt = /* @__PURE__ */ Y(Et, [["render", St]]), he = /* @__PURE__ */ K({
2303
- __name: "searchField",
2304
- props: {
2305
- item: {},
2306
- conf: {},
2307
- type: {}
2308
- },
2309
- 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);
2314
- }
2315
- });
2316
- return (c, o) => l(j).customComponent[e.type ?? ""]?.search ? (d(), y(q(l(j).customComponent[e.type ?? ""]?.search), V({
2317
- 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({
2321
- key: 1,
2322
- modelValue: s.value,
2323
- "onUpdate:modelValue": o[1] || (o[1] = (t) => s.value = t),
2324
- placeholder: e.conf.search.getPlaceholder(e.item),
2325
- clearable: "",
2326
- 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({
2328
- 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")),
2332
- clearable: "",
2333
- 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), {
2337
- key: e.item.options?.switch?.activeValue,
2338
- label: e.item.options?.switch?.activeText,
2339
- value: e.item.options?.switch?.activeValue
2340
- }, null, 8, ["label", "value"])),
2341
- (d(), y(l(W), {
2342
- key: e.item.options?.switch?.inactiveValue,
2343
- label: e.item.options?.switch?.inactiveText,
2344
- value: e.item.options?.switch?.inactiveValue
2345
- }, null, 8, ["label", "value"]))
2346
- ]),
2347
- _: 1
2348
- }, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "select" ? (d(), y(l(X), V({
2349
- 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")),
2353
- clearable: "",
2354
- 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
2361
- }, null, 8, ["label", "value"]))), 128))
2362
- ]),
2363
- _: 1
2364
- }, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "radio" ? (d(), y(l(de), V({
2365
- key: 4,
2366
- modelValue: s.value,
2367
- "onUpdate:modelValue": o[4] || (o[4] = (t) => s.value = t),
2368
- 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
2375
- }, null, 8, ["label", "value"]))), 128))
2376
- ]),
2377
- _: 1
2378
- }, 16, ["modelValue", "disabled"])) : e.type === "datetime" ? (d(), y(l(ue), V({
2379
- key: 5,
2380
- modelValue: s.value,
2381
- "onUpdate:modelValue": o[5] || (o[5] = (t) => s.value = t),
2382
- 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({
2384
- 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 || {}), {
2388
- disabled: e.item.disabled?.search
2389
- }), null, 16, ["modelValue", "disabled"])) : C("", !0);
2390
- }
2391
- }), Ft = {
2385
+ }), uo = {
2392
2386
  key: 0,
2393
2387
  class: "relative curd-search fit-width"
2394
- }, At = { class: "mb-10 flex justify-between items-center fit-width" }, Tt = {
2388
+ }, co = { class: "mb-10 flex justify-between items-center fit-width" }, fo = {
2395
2389
  class: "flex items-center",
2396
2390
  style: { gap: "10px" }
2397
- }, jt = { key: 0 }, Lt = { key: 1 }, Bt = { key: 2 }, Rt = { class: "export-btn" }, It = {
2391
+ }, mo = { key: 0 }, go = { key: 1 }, ho = { key: 2 }, yo = { class: "export-btn" }, bo = {
2398
2392
  key: 1,
2399
2393
  class: "export-btn"
2400
- }, Pt = {
2394
+ }, po = {
2401
2395
  class: "flex items-center table-tools-right",
2402
2396
  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({
2397
+ }, 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
2398
  __name: "index",
2405
2399
  props: {
2406
2400
  /**
@@ -2413,287 +2407,287 @@ const Mt = /* @__PURE__ */ Y(Et, [["render", St]]), he = /* @__PURE__ */ K({
2413
2407
  * 表单值对象
2414
2408
  */
2415
2409
  form: {
2416
- default: {}
2410
+ default: void 0
2417
2411
  },
2418
2412
  /**
2419
2413
  * 搜索栏值对象
2420
2414
  */
2421
2415
  searchForm: {
2422
- default: {}
2416
+ default: void 0
2423
2417
  }
2424
2418
  },
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"]])
2419
+ setup(e, { expose: n }) {
2420
+ const l = S.EDialog, a = e, i = S.isFun, { conf: o, switchConfirmRef: t, ruleFormRef: s, tableRef: f } = $t(a);
2421
+ return n({
2422
+ conf: o
2423
+ }), (d, c) => {
2424
+ const v = ae("el-tooltip"), m = Xe("loading");
2425
+ return u(), p("div", {
2426
+ class: I(["relative cc1-form-box", [e.option.table?.fitHeight ? "col" : "no-min-height"]])
2433
2427
  }, [
2434
- U("div", {
2435
- class: R(["row", [e.option.table?.fitHeight ? "absolute fit" : ""]]),
2428
+ O("div", {
2429
+ class: I(["row", [e.option.table?.fitHeight ? "absolute fit" : ""]]),
2436
2430
  style: { overflow: "hidden" }
2437
2431
  }, [
2438
- x(m.$slots, "box-left"),
2439
- U("div", {
2440
- class: R(["column fit-width no-wrap", [e.option.table?.fitHeight ? "col" : ""]])
2432
+ k(d.$slots, "box-left"),
2433
+ O("div", {
2434
+ class: I(["column fit-width no-wrap", [e.option.table?.fitHeight ? "col" : ""]])
2441
2435
  }, [
2442
- e.option.search?.show !== !1 ? (d(), b("div", Ft, [
2443
- E(l(Q), {
2444
- model: l(t).search.form,
2436
+ e.option.search?.show !== !1 ? (u(), p("div", uo, [
2437
+ $(r(q), {
2438
+ model: r(o).search.form,
2445
2439
  inline: "",
2446
2440
  size: e.option.size?.search
2447
2441
  }, {
2448
- default: g(() => [
2449
- x(m.$slots, "search-start", {
2450
- row: l(t).search.form
2442
+ default: y(() => [
2443
+ k(d.$slots, "search-start", {
2444
+ row: r(o).search.form
2451
2445
  }),
2452
- (d(!0), b($, null, A(l(t).search.column.list, (h) => (d(), b($, {
2453
- key: h.key
2446
+ (u(!0), p(F, null, j(r(o).search.column.list, (g) => (u(), p(F, {
2447
+ key: g.key
2454
2448
  }, [
2455
- x(m.$slots, "search-" + h.key + "-start", {
2456
- row: l(t).search.form
2449
+ k(d.$slots, "search-" + g.key + "-start", {
2450
+ row: r(o).search.form
2457
2451
  }),
2458
- (typeof h.show?.search == "function" ? h.show?.search(l(t).search.form) : h.show?.search) ? (d(), y(l(le), {
2452
+ (typeof g.show?.search == "function" ? g.show?.search(r(o).search.form) : g.show?.search) ? (u(), h(r(he), {
2459
2453
  key: 0,
2460
- label: h.text?.search?.label ?? h.label
2454
+ label: g.text?.search?.label ?? g.label
2461
2455
  }, {
2462
- default: g(() => [
2463
- x(m.$slots, "search-" + h.key + "-left", {
2464
- row: l(t).search.form
2456
+ default: y(() => [
2457
+ k(d.$slots, "search-" + g.key + "-left", {
2458
+ row: r(o).search.form
2465
2459
  }),
2466
- x(m.$slots, "search-" + h.key, {
2467
- row: l(t).search.form
2460
+ k(d.$slots, "search-" + g.key, {
2461
+ row: r(o).search.form
2468
2462
  }, () => [
2469
- h.options?.search?.type ? (d(), y(he, {
2463
+ g.options?.search?.type ? (u(), h(ke, {
2470
2464
  key: 0,
2471
- item: h,
2472
- conf: l(t),
2473
- type: h.options.search.type
2474
- }, null, 8, ["item", "conf", "type"])) : (d(), y(he, {
2465
+ item: g,
2466
+ conf: r(o),
2467
+ type: g.options.search.type
2468
+ }, null, 8, ["item", "conf", "type"])) : (u(), h(ke, {
2475
2469
  key: 1,
2476
- item: h,
2477
- conf: l(t),
2478
- type: h.type
2470
+ item: g,
2471
+ conf: r(o),
2472
+ type: g.type
2479
2473
  }, null, 8, ["item", "conf", "type"]))
2480
2474
  ]),
2481
- x(m.$slots, "search-" + h.key + "-right", {
2482
- row: l(t).search.form
2475
+ k(d.$slots, "search-" + g.key + "-right", {
2476
+ row: r(o).search.form
2483
2477
  })
2484
2478
  ]),
2485
2479
  _: 2
2486
- }, 1032, ["label"])) : C("", !0),
2487
- x(m.$slots, "search-" + h.key + "-end", {
2488
- row: l(t).search.form
2480
+ }, 1032, ["label"])) : w("", !0),
2481
+ k(d.$slots, "search-" + g.key + "-end", {
2482
+ row: r(o).search.form
2489
2483
  })
2490
2484
  ], 64))), 128)),
2491
- x(m.$slots, "search-center", {
2492
- row: l(t).search.form
2485
+ k(d.$slots, "search-center", {
2486
+ row: r(o).search.form
2493
2487
  }),
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), {
2488
+ e.option.tools?.search || e.option.tools?.reset ? (u(), h(r(he), { key: 0 }, {
2489
+ default: y(() => [
2490
+ e.option.tools?.search ? (u(), h(r(T), {
2497
2491
  key: 0,
2498
2492
  type: "primary",
2499
- onClick: l(t).search.submit
2493
+ onClick: r(o).search.submit
2500
2494
  }, {
2501
- default: g(() => [
2502
- O(S(l(v).tCurd("search")), 1)
2495
+ default: y(() => [
2496
+ V(D(r(b).tCurd("search")), 1)
2503
2497
  ]),
2504
2498
  _: 1
2505
- }, 8, ["onClick"])) : C("", !0),
2506
- e.option.tools?.reset ? (d(), y(l(T), {
2499
+ }, 8, ["onClick"])) : w("", !0),
2500
+ e.option.tools?.reset ? (u(), h(r(T), {
2507
2501
  key: 1,
2508
- onClick: l(t).search.reset
2502
+ onClick: r(o).search.reset
2509
2503
  }, {
2510
- default: g(() => [
2511
- O(S(l(v).tCurd("reset")), 1)
2504
+ default: y(() => [
2505
+ V(D(r(b).tCurd("reset")), 1)
2512
2506
  ]),
2513
2507
  _: 1
2514
- }, 8, ["onClick"])) : C("", !0)
2508
+ }, 8, ["onClick"])) : w("", !0)
2515
2509
  ]),
2516
2510
  _: 1
2517
- })) : C("", !0),
2518
- x(m.$slots, "search-end", {
2519
- row: l(t).search.form
2511
+ })) : w("", !0),
2512
+ k(d.$slots, "search-end", {
2513
+ row: r(o).search.form
2520
2514
  })
2521
2515
  ]),
2522
2516
  _: 3
2523
2517
  }, 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), {
2518
+ ])) : w("", !0),
2519
+ O("div", co, [
2520
+ O("div", fo, [
2521
+ r(i)(e.option.tools?.add) ? (u(), p("div", mo, [
2522
+ $(r(T), {
2529
2523
  type: "primary",
2530
- onClick: u[0] || (u[0] = (h) => l(t).update.open(l(s).Add)),
2524
+ onClick: c[0] || (c[0] = (g) => r(o).update.open(r(l).Add)),
2531
2525
  size: e.option.size?.search
2532
2526
  }, {
2533
- default: g(() => [
2534
- O(S(l(v).tCurd("add")), 1)
2527
+ default: y(() => [
2528
+ V(D(r(b).tCurd("add")), 1)
2535
2529
  ]),
2536
2530
  _: 1
2537
2531
  }, 8, ["size"])
2538
- ])) : C("", !0),
2539
- e.option.table?.selectable && l(o)(e.option.tools?.delete) ? (d(), b("div", Lt, [
2540
- E(l(T), {
2532
+ ])) : w("", !0),
2533
+ e.option.table?.selectable && r(i)(e.option.tools?.delete) ? (u(), p("div", go, [
2534
+ $(r(T), {
2541
2535
  type: "danger",
2542
- onClick: u[1] || (u[1] = (h) => l(t).remove.open(l(t).table.selection.list)),
2536
+ onClick: c[1] || (c[1] = (g) => r(o).remove.open(r(o).table.selection.list)),
2543
2537
  size: e.option.size?.search
2544
2538
  }, {
2545
- default: g(() => [
2546
- O(S(l(v).tCurd("delete")), 1)
2539
+ default: y(() => [
2540
+ V(D(r(b).tCurd("delete")), 1)
2547
2541
  ]),
2548
2542
  _: 1
2549
2543
  }, 8, ["size"])
2550
- ])) : C("", !0),
2551
- e.option.tools?.expand ? (d(), b("div", Bt, [
2552
- E(l(T), {
2544
+ ])) : w("", !0),
2545
+ e.option.tools?.expand ? (u(), p("div", ho, [
2546
+ $(r(T), {
2553
2547
  type: "warning",
2554
- onClick: u[2] || (u[2] = (h) => l(t).table.expand.all()),
2548
+ onClick: c[2] || (c[2] = (g) => r(o).table.expand.all()),
2555
2549
  size: e.option.size?.search
2556
2550
  }, {
2557
- default: g(() => [
2558
- O(S(l(v).tCurd("expandCollapse")), 1)
2551
+ default: y(() => [
2552
+ V(D(r(b).tCurd("expandCollapse")), 1)
2559
2553
  ]),
2560
2554
  _: 1
2561
2555
  }, 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), {
2556
+ ])) : w("", !0),
2557
+ e.option.tools?.export?.show ? (u(), p(F, { key: 3 }, [
2558
+ e.option.tools?.export?.dropdown?.show ? (u(), h(r(Ge), {
2565
2559
  key: 0,
2566
- onCommand: l(t).export.click
2560
+ onCommand: r(o).export.click
2567
2561
  }, {
2568
- dropdown: g(() => [
2569
- E(l(Oe), {
2562
+ dropdown: y(() => [
2563
+ $(r(Ne), {
2570
2564
  size: e.option.size?.search
2571
2565
  }, {
2572
- default: g(() => [
2573
- e.option.tools?.export?.dropdown?.select && (e.option.table?.selectable || l(o)(e.option.tools?.delete)) ? (d(), y(l(ne), {
2566
+ default: y(() => [
2567
+ e.option.tools?.export?.dropdown?.select && (e.option.table?.selectable || r(i)(e.option.tools?.delete)) ? (u(), h(r(ge), {
2574
2568
  key: 0,
2575
2569
  command: "select"
2576
2570
  }, {
2577
- default: g(() => [
2578
- O(S(l(v).tCurd("exportSelect")), 1)
2571
+ default: y(() => [
2572
+ V(D(r(b).tCurd("exportSelect")), 1)
2579
2573
  ]),
2580
2574
  _: 1
2581
- })) : C("", !0),
2582
- e.option.tools?.export?.dropdown?.page ? (d(), y(l(ne), {
2575
+ })) : w("", !0),
2576
+ e.option.tools?.export?.dropdown?.page ? (u(), h(r(ge), {
2583
2577
  key: 1,
2584
2578
  command: "page"
2585
2579
  }, {
2586
- default: g(() => [
2587
- O(S(l(v).tCurd("exportPage")), 1)
2580
+ default: y(() => [
2581
+ V(D(r(b).tCurd("exportPage")), 1)
2588
2582
  ]),
2589
2583
  _: 1
2590
- })) : C("", !0),
2591
- e.option.tools?.export?.dropdown?.all ? (d(), y(l(ne), {
2584
+ })) : w("", !0),
2585
+ e.option.tools?.export?.dropdown?.all ? (u(), h(r(ge), {
2592
2586
  key: 2,
2593
2587
  command: "all"
2594
2588
  }, {
2595
- default: g(() => [
2596
- O(S(l(v).tCurd("exportAll")), 1)
2589
+ default: y(() => [
2590
+ V(D(r(b).tCurd("exportAll")), 1)
2597
2591
  ]),
2598
2592
  _: 1
2599
- })) : C("", !0)
2593
+ })) : w("", !0)
2600
2594
  ]),
2601
2595
  _: 1
2602
2596
  }, 8, ["size"])
2603
2597
  ]),
2604
- default: g(() => [
2605
- U("div", Rt, [
2606
- E(l(T), {
2598
+ default: y(() => [
2599
+ O("div", yo, [
2600
+ $(r(T), {
2607
2601
  type: "warning",
2608
- loading: l(t).export.loading,
2602
+ loading: r(o).export.loading,
2609
2603
  size: e.option.size?.search
2610
2604
  }, {
2611
- default: g(() => [
2612
- O(S(l(v).tCurd("export")), 1)
2605
+ default: y(() => [
2606
+ V(D(r(b).tCurd("export")), 1)
2613
2607
  ]),
2614
2608
  _: 1
2615
2609
  }, 8, ["loading", "size"])
2616
2610
  ])
2617
2611
  ]),
2618
2612
  _: 1
2619
- }, 8, ["onCommand"])) : (d(), b("div", It, [
2620
- E(l(T), {
2613
+ }, 8, ["onCommand"])) : (u(), p("div", bo, [
2614
+ $(r(T), {
2621
2615
  type: "warning",
2622
- loading: l(t).export.loading,
2616
+ loading: r(o).export.loading,
2623
2617
  size: e.option.size?.search,
2624
- onClick: u[3] || (u[3] = (h) => l(t).export.run.start("all"))
2618
+ onClick: c[3] || (c[3] = (g) => r(o).export.run.start("all"))
2625
2619
  }, {
2626
- default: g(() => [
2627
- O(S(l(v).tCurd("export")), 1)
2620
+ default: y(() => [
2621
+ V(D(r(b).tCurd("export")), 1)
2628
2622
  ]),
2629
2623
  _: 1
2630
2624
  }, 8, ["loading", "size"])
2631
2625
  ]))
2632
- ], 64)) : C("", !0),
2633
- x(m.$slots, "tools-left")
2626
+ ], 64)) : w("", !0),
2627
+ k(d.$slots, "tools-left")
2634
2628
  ]),
2635
- U("div", Pt, [
2636
- x(m.$slots, "tools-right"),
2637
- l(t).page.showTools ? (d(), y(l(me), V({
2629
+ O("div", po, [
2630
+ k(d.$slots, "tools-right"),
2631
+ r(o).page.showTools ? (u(), h(r(we), C({
2638
2632
  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),
2633
+ "current-page": r(o).page.num,
2634
+ "onUpdate:currentPage": c[4] || (c[4] = (g) => r(o).page.num = g),
2635
+ "page-size": r(o).page.size,
2636
+ "onUpdate:pageSize": c[5] || (c[5] = (g) => r(o).page.size = g),
2643
2637
  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,
2638
+ "page-sizes": r(o).page.sizeList,
2639
+ "pager-count": r(o).page.pagerCount,
2640
+ layout: r(o).page.layout,
2641
+ total: r(o).page.total,
2648
2642
  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, {
2643
+ onSizeChange: r(o).table.getList,
2644
+ onCurrentChange: r(o).table.getList
2645
+ }, 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),
2646
+ e.option.tools?.expandColumn === void 0 || e.option.tools?.expandColumn ? (u(), h(v, {
2653
2647
  key: 1,
2654
2648
  effect: "dark",
2655
- content: l(t).table.header.group.expand ? l(v).tCurd("mergeColumn") : l(v).tCurd("expandColumn"),
2649
+ content: r(o).table.header.group.expand ? r(b).tCurd("mergeColumn") : r(b).tCurd("expandColumn"),
2656
2650
  placement: "top"
2657
2651
  }, {
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))
2652
+ default: y(() => [
2653
+ O("div", {
2654
+ class: I(["refresh-btn", [e.option.size?.search]]),
2655
+ onClick: c[6] || (c[6] = //@ts-ignore
2656
+ (...g) => r(o).table.header.group.toggleExpandAll && r(o).table.header.group.toggleExpandAll(...g))
2663
2657
  }, [
2664
- l(t).table.header.group.expand ? (d(), y(Dt, { key: 0 })) : (d(), y(Mt, { key: 1 }))
2658
+ r(o).table.header.group.expand ? (u(), h(Rt, { key: 0 })) : (u(), h(jt, { key: 1 }))
2665
2659
  ], 2)
2666
2660
  ]),
2667
2661
  _: 1
2668
- }, 8, ["content"])) : C("", !0),
2669
- e.option.tools?.refresh === void 0 || e.option.tools?.refresh ? (d(), b("div", {
2662
+ }, 8, ["content"])) : w("", !0),
2663
+ e.option.tools?.refresh === void 0 || e.option.tools?.refresh ? (u(), p("div", {
2670
2664
  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))
2665
+ class: I(["refresh-btn", [e.option.size?.search]]),
2666
+ onClick: c[7] || (c[7] = //@ts-ignore
2667
+ (...g) => r(o).table.getList && r(o).table.getList(...g))
2674
2668
  }, [
2675
- E(Ze)
2676
- ], 2)) : C("", !0)
2669
+ $(Ht)
2670
+ ], 2)) : w("", !0)
2677
2671
  ])
2678
2672
  ]),
2679
- U("div", {
2680
- class: R(["fit-width relative form-box", [e.option.table?.fitHeight ? "col " : "", e.option.table?.editMode ? "edit-mode" : ""]])
2673
+ O("div", {
2674
+ class: I(["fit-width relative form-box", [e.option.table?.fitHeight ? "col " : "", e.option.table?.editMode ? "edit-mode" : ""]])
2681
2675
  }, [
2682
- U("div", {
2683
- class: R(["column form-box-content", [e.option.table?.fitHeight ? "absolute fit" : ""]])
2676
+ O("div", {
2677
+ class: I(["column form-box-content", [e.option.table?.fitHeight ? "absolute fit" : ""]])
2684
2678
  }, [
2685
- Me((d(), y(l(De), V({
2679
+ Ye((u(), h(r(We), C({
2686
2680
  ref_key: "tableRef",
2687
- ref: i,
2688
- data: l(t).table.data,
2681
+ ref: f,
2682
+ data: r(o).table.data,
2689
2683
  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({
2684
+ onSelectionChange: r(o).table.selection.change,
2685
+ onSortChange: r(o).table.sort.change,
2686
+ "expand-row-keys": r(o).table.expand.rowKeys,
2687
+ onExpandChange: r(o).table.expand.change
2688
+ }, e.option.table, E(e.option.table?.on || {})), {
2689
+ default: y(() => [
2690
+ (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
2691
  key: 0,
2698
2692
  type: "selection",
2699
2693
  width: "40",
@@ -2701,8 +2695,8 @@ const Mt = /* @__PURE__ */ Y(Et, [["render", St]]), he = /* @__PURE__ */ K({
2701
2695
  fixed: "left",
2702
2696
  "show-overflow-tooltip": !1,
2703
2697
  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({
2698
+ }, 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),
2699
+ (typeof e.option.table?.index == "object" ? e.option.table?.index?.show : e.option.table?.index) ? (u(), h(r(re), C({
2706
2700
  key: 1,
2707
2701
  type: "index",
2708
2702
  fixed: "left",
@@ -2711,262 +2705,250 @@ const Mt = /* @__PURE__ */ Y(Et, [["render", St]]), he = /* @__PURE__ */ K({
2711
2705
  label: "#",
2712
2706
  "show-overflow-tooltip": !1,
2713
2707
  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,
2708
+ }, 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),
2709
+ $(so, {
2710
+ conf: r(o),
2711
+ columnList: r(o).table.column.list,
2718
2712
  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 || {})))
2713
+ }, W({ _: 2 }, [
2714
+ j(d.$slots, (g, B) => ({
2715
+ name: B,
2716
+ fn: y((H) => [
2717
+ k(d.$slots, B, be(pe(H || {})))
2724
2718
  ])
2725
2719
  }))
2726
2720
  ]), 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({
2721
+ 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
2722
  key: 2,
2729
- width: "auto",
2730
- "max-width": "200",
2731
2723
  align: "center",
2732
2724
  fixed: "right"
2733
- }, 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
+ }, e.option.table?.operate, {
2726
+ width: e.option.table?.operate?.width || 120,
2727
+ "show-overflow-tooltip": !1
2728
+ }), {
2729
+ header: y(() => [
2730
+ k(d.$slots, "table-header-op", {}, () => [
2731
+ V(D(r(b).tCurd("operation")), 1)
2737
2732
  ])
2738
2733
  ]),
2739
- default: g(({ row: h }) => [
2740
- E(l(Q), {
2734
+ default: y(({ row: g }) => [
2735
+ $(r(q), {
2741
2736
  size: e.option.size?.table
2742
2737
  }, {
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), {
2738
+ default: y(() => [
2739
+ k(d.$slots, "table-op-left", { row: g }),
2740
+ r(o).update.type === r(l).Update && e.option.table?.inlineEdit && r(o).update.form[a.option.table?.rowKey] === g[a.option.table?.rowKey] ? (u(), p(F, { key: 0 }, [
2741
+ $(r(T), {
2747
2742
  link: "",
2748
2743
  type: "info",
2749
- onClick: l(t).update.close
2744
+ onClick: r(o).update.close
2750
2745
  }, {
2751
- default: g(() => [
2752
- O(S(l(v).tCurd("cancel")), 1)
2746
+ default: y(() => [
2747
+ V(D(r(b).tCurd("cancel")), 1)
2753
2748
  ]),
2754
2749
  _: 1
2755
2750
  }, 8, ["onClick"]),
2756
- E(l(T), {
2751
+ $(r(T), {
2757
2752
  link: "",
2758
2753
  type: "primary",
2759
- onClick: l(t).update.submit,
2760
- loading: l(t).update.loading
2754
+ onClick: r(o).update.submit,
2755
+ loading: r(o).update.loading
2761
2756
  }, {
2762
- default: g(() => [
2763
- O(S(l(v).tCurd("confirm")), 1)
2757
+ default: y(() => [
2758
+ V(D(r(b).tCurd("confirm")), 1)
2764
2759
  ]),
2765
2760
  _: 1
2766
2761
  }, 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), {
2762
+ k(d.$slots, "table-op-edit-right", { row: g })
2763
+ ], 64)) : (u(), p(F, { key: 1 }, [
2764
+ r(i)(e.option.table?.add, g) ? (u(), h(r(T), {
2770
2765
  key: 0,
2771
2766
  link: "",
2772
2767
  type: "primary",
2773
- onClick: (p) => l(t).update.open(l(s).Add, h)
2768
+ onClick: (B) => r(o).update.open(r(l).Add, g)
2774
2769
  }, {
2775
- default: g(() => [
2776
- O(S(l(v).tCurd("add")), 1)
2770
+ default: y(() => [
2771
+ V(D(r(b).tCurd("add")), 1)
2777
2772
  ]),
2778
2773
  _: 1
2779
- }, 8, ["onClick"])) : C("", !0),
2780
- l(o)(e.option.table?.view, h) ? (d(), y(l(T), {
2774
+ }, 8, ["onClick"])) : w("", !0),
2775
+ r(i)(e.option.table?.view, g) ? (u(), h(r(T), {
2781
2776
  key: 1,
2782
2777
  link: "",
2783
2778
  type: "primary",
2784
- onClick: (p) => l(t).update.open(l(s).View, h)
2779
+ onClick: (B) => r(o).update.open(r(l).View, g)
2785
2780
  }, {
2786
- default: g(() => [
2787
- O(S(l(v).tCurd("view")), 1)
2781
+ default: y(() => [
2782
+ V(D(r(b).tCurd("view")), 1)
2788
2783
  ]),
2789
2784
  _: 1
2790
- }, 8, ["onClick"])) : C("", !0),
2791
- l(o)(e.option.table?.update, h) ? (d(), y(l(T), {
2785
+ }, 8, ["onClick"])) : w("", !0),
2786
+ r(i)(e.option.table?.update, g) ? (u(), h(r(T), {
2792
2787
  key: 2,
2793
2788
  link: "",
2794
2789
  type: "warning",
2795
- onClick: (p) => l(t).update.open(l(s).Update, h)
2790
+ onClick: (B) => r(o).update.open(r(l).Update, g)
2796
2791
  }, {
2797
- default: g(() => [
2798
- O(S(l(v).tCurd("edit")), 1)
2792
+ default: y(() => [
2793
+ V(D(r(b).tCurd("edit")), 1)
2799
2794
  ]),
2800
2795
  _: 1
2801
- }, 8, ["onClick"])) : C("", !0),
2802
- l(o)(e.option.table?.delete, h) ? (d(), y(l(T), {
2796
+ }, 8, ["onClick"])) : w("", !0),
2797
+ r(i)(e.option.table?.delete, g) ? (u(), h(r(T), {
2803
2798
  key: 3,
2804
2799
  link: "",
2805
2800
  type: "danger",
2806
- onClick: (p) => l(t).remove.open([h])
2801
+ onClick: (B) => r(o).remove.open([g])
2807
2802
  }, {
2808
- default: g(() => [
2809
- O(S(l(v).tCurd("delete")), 1)
2803
+ default: y(() => [
2804
+ V(D(r(b).tCurd("delete")), 1)
2810
2805
  ]),
2811
2806
  _: 1
2812
- }, 8, ["onClick"])) : C("", !0),
2813
- x(m.$slots, "table-op-right", { row: h })
2807
+ }, 8, ["onClick"])) : w("", !0),
2808
+ k(d.$slots, "table-op-right", { row: g })
2814
2809
  ], 64))
2815
2810
  ]),
2816
2811
  _: 2
2817
2812
  }, 1032, ["size"])
2818
2813
  ]),
2819
2814
  _: 3
2820
- }, 16)) : C("", !0)
2815
+ }, 16, ["width"])) : w("", !0)
2821
2816
  ]),
2822
2817
  _: 3
2823
2818
  }, 16, ["data", "border", "onSelectionChange", "onSortChange", "expand-row-keys", "onExpandChange"])), [
2824
- [f, l(t).table.loading]
2819
+ [m, r(o).table.loading]
2825
2820
  ])
2826
2821
  ], 2)
2827
2822
  ], 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({
2823
+ O("div", wo, [
2824
+ (e.option.page?.show === void 0 || e.option.page?.show) && !r(o).page.showTools ? (u(), h(r(we), C({
2830
2825
  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),
2826
+ "current-page": r(o).page.num,
2827
+ "onUpdate:currentPage": c[8] || (c[8] = (g) => r(o).page.num = g),
2828
+ "page-size": r(o).page.size,
2829
+ "onUpdate:pageSize": c[9] || (c[9] = (g) => r(o).page.size = g),
2835
2830
  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,
2831
+ "page-sizes": r(o).page.sizeList,
2832
+ "pager-count": r(o).page.pagerCount,
2833
+ layout: r(o).page.layout,
2834
+ total: r(o).page.total,
2840
2835
  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)
2836
+ onSizeChange: r(o).table.getList,
2837
+ onCurrentChange: r(o).table.getList
2838
+ }, 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
2839
  ])
2845
2840
  ], 2),
2846
- x(m.$slots, "box-right")
2841
+ k(d.$slots, "box-right")
2847
2842
  ], 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
2843
+ $(r(ye), C({
2844
+ modelValue: r(o).update.show,
2845
+ "onUpdate:modelValue": c[10] || (c[10] = (g) => r(o).update.show = g),
2846
+ title: r(o).update.title,
2847
+ "before-close": r(o).update.close
2853
2848
  }, e.option.dialog), {
2854
- footer: g(() => [
2855
- U("span", Kt, [
2856
- E(l(Q), {
2849
+ footer: y(() => [
2850
+ O("span", vo, [
2851
+ $(r(q), {
2857
2852
  size: e.option.size?.form
2858
2853
  }, {
2859
- default: g(() => [
2860
- E(l(T), {
2861
- onClick: l(t).update.close
2862
- }, {
2863
- default: g(() => [
2864
- O(S(l(v).tCurd("close")), 1)
2865
- ]),
2866
- _: 1
2867
- }, 8, ["onClick"]),
2868
- l(t).update.type !== l(s).View ? (d(), y(l(T), {
2869
- key: 0,
2870
- type: "primary",
2871
- onClick: l(t).update.submit,
2872
- loading: l(t).update.loading
2873
- }, {
2874
- default: g(() => [
2875
- O(S(l(v).tCurd("submit")), 1)
2876
- ]),
2877
- _: 1
2878
- }, 8, ["onClick", "loading"])) : C("", !0)
2854
+ default: y(() => [
2855
+ k(d.$slots, "dialog-footer", {
2856
+ row: r(o).update
2857
+ }, () => [
2858
+ $(r(T), {
2859
+ onClick: r(o).update.close
2860
+ }, {
2861
+ default: y(() => [
2862
+ V(D(r(b).tCurd("close")), 1)
2863
+ ]),
2864
+ _: 1
2865
+ }, 8, ["onClick"]),
2866
+ r(o).update.type !== r(l).View ? (u(), h(r(T), {
2867
+ key: 0,
2868
+ type: "primary",
2869
+ onClick: r(o).update.submit,
2870
+ loading: r(o).update.loading
2871
+ }, {
2872
+ default: y(() => [
2873
+ V(D(r(b).tCurd("submit")), 1)
2874
+ ]),
2875
+ _: 1
2876
+ }, 8, ["onClick", "loading"])) : w("", !0)
2877
+ ])
2879
2878
  ]),
2880
- _: 1
2879
+ _: 3
2881
2880
  }, 8, ["size"])
2882
2881
  ])
2883
2882
  ]),
2884
- default: g(() => [
2885
- E(l(Q), {
2883
+ default: y(() => [
2884
+ k(d.$slots, "dialog-start", {
2885
+ row: r(o).update
2886
+ }),
2887
+ $(r(q), {
2886
2888
  ref_key: "ruleFormRef",
2887
- ref: a,
2888
- model: l(t).update.form,
2889
- rules: l(t).update.rules,
2889
+ ref: s,
2890
+ model: r(o).update.form,
2891
+ rules: r(o).update.rules,
2890
2892
  size: e.option.size?.form,
2891
2893
  class: "update-dialog-form"
2892
2894
  }, {
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)
2895
+ default: y(() => [
2896
+ r(o).update.showContent ? (u(), h(Te, {
2897
+ key: 0,
2898
+ "form-grid": r(o).update.formGrid,
2899
+ "max-span": r(o).update.formMaxSpan,
2900
+ form: r(o).update.form,
2901
+ type: r(o).update.type,
2902
+ stripe: e.option.form?.stripe,
2903
+ "label-width": e.option.form?.labelWidth,
2904
+ "form-option": e.option.form,
2905
+ "get-bind": r(o).update.getBind,
2906
+ "get-on": r(o).update.getOn,
2907
+ "get-disabled": r(o).update.getDisabled
2908
+ }, W({ _: 2 }, [
2909
+ j(d.$slots, (g, B) => ({
2910
+ name: B,
2911
+ fn: y((H) => [
2912
+ k(d.$slots, B, be(pe(H || {})))
2913
+ ])
2914
+ }))
2915
+ ]), 1032, ["form-grid", "max-span", "form", "type", "stripe", "label-width", "form-option", "get-bind", "get-on", "get-disabled"])) : w("", !0)
2937
2916
  ]),
2938
2917
  _: 3
2939
- }, 8, ["model", "rules", "size"])
2918
+ }, 8, ["model", "rules", "size"]),
2919
+ k(d.$slots, "dialog-end", {
2920
+ row: r(o).update
2921
+ })
2940
2922
  ]),
2941
2923
  _: 3
2942
2924
  }, 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,
2925
+ $(r(ye), {
2926
+ modelValue: r(o).remove.show,
2927
+ "onUpdate:modelValue": c[11] || (c[11] = (g) => r(o).remove.show = g),
2928
+ title: r(o).remove.title,
2947
2929
  "close-on-click-modal": !1
2948
2930
  }, {
2949
- footer: g(() => [
2950
- U("span", Jt, [
2951
- E(l(Q), {
2931
+ footer: y(() => [
2932
+ O("span", xo, [
2933
+ $(r(q), {
2952
2934
  size: e.option.size?.form
2953
2935
  }, {
2954
- default: g(() => [
2955
- E(l(T), {
2956
- onClick: l(t).remove.close
2936
+ default: y(() => [
2937
+ $(r(T), {
2938
+ onClick: r(o).remove.close
2957
2939
  }, {
2958
- default: g(() => [
2959
- O(S(l(v).tCurd("close")), 1)
2940
+ default: y(() => [
2941
+ V(D(r(b).tCurd("close")), 1)
2960
2942
  ]),
2961
2943
  _: 1
2962
2944
  }, 8, ["onClick"]),
2963
- E(l(T), {
2945
+ $(r(T), {
2964
2946
  type: "danger",
2965
- onClick: l(t).remove.submit,
2966
- loading: l(t).remove.loading
2947
+ onClick: r(o).remove.submit,
2948
+ loading: r(o).remove.loading
2967
2949
  }, {
2968
- default: g(() => [
2969
- O(S(l(v).tCurd("confirmDelete")), 1)
2950
+ default: y(() => [
2951
+ V(D(r(b).tCurd("confirmDelete")), 1)
2970
2952
  ]),
2971
2953
  _: 1
2972
2954
  }, 8, ["onClick", "loading"])
@@ -2975,90 +2957,90 @@ const Mt = /* @__PURE__ */ Y(Et, [["render", St]]), he = /* @__PURE__ */ K({
2975
2957
  }, 8, ["size"])
2976
2958
  ])
2977
2959
  ]),
2978
- default: g(() => [
2979
- e.option.dialog?.delete?.content ? (d(), b("div", Nt, [
2980
- E(et, {
2960
+ default: y(() => [
2961
+ e.option.dialog?.delete?.content ? (u(), p("div", ko, [
2962
+ $(Mt, {
2981
2963
  content: e.option.dialog?.delete?.content,
2982
- value: l(t).remove.items
2964
+ value: r(o).remove.items
2983
2965
  }, null, 8, ["content", "value"])
2984
- ])) : (d(), b("div", Wt, S(l(v).tCurd("confirmDeleteMessage", l(t).remove.items.length)), 1))
2966
+ ])) : (u(), p("div", Co, D(r(b).tCurd("confirmDeleteMessage", r(o).remove.items.length)), 1))
2985
2967
  ]),
2986
2968
  _: 1
2987
2969
  }, 8, ["modelValue", "title"]),
2988
- E(Qe, {
2970
+ $(Dt, {
2989
2971
  ref_key: "switchConfirmRef",
2990
- ref: n,
2972
+ ref: t,
2991
2973
  size: e.option.size?.form
2992
2974
  }, null, 8, ["size"])
2993
2975
  ], 2);
2994
2976
  };
2995
2977
  }
2996
2978
  });
2997
- class _t {
2979
+ class Oo {
2998
2980
  /**
2999
2981
  * 通过远程 URL 下载文件,自动创建临时 `<a>` 标签触发浏览器下载
3000
2982
  *
3001
2983
  * @param href - 文件的远程地址
3002
2984
  * @param name - 下载后的文件名,默认 `'download.png'`
3003
2985
  */
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);
2986
+ static async download(n, l = "download.png") {
2987
+ const a = document.createElement("a");
2988
+ a.style.display = "none", a.href = n, a.setAttribute("download", l), typeof a.download > "u" && a.setAttribute("target", "_blank"), document.body.appendChild(a), a.click(), document.body.removeChild(a), window.URL.revokeObjectURL(n);
3007
2989
  }
3008
2990
  /**
3009
2991
  * 将json对象或者json数组导出为json文件保存
3010
2992
  * @param data
3011
2993
  * @param name
3012
2994
  */
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();
2995
+ static exportJSONFile = (n, l) => {
2996
+ const a = new Blob([JSON.stringify(n)], { type: "application/json" }), i = URL.createObjectURL(a), o = document.createElement("a");
2997
+ o.href = i, o.download = `${l || "config"}.json`, o.click();
3016
2998
  };
3017
2999
  /**
3018
3000
  * 导入文件内容,默认为json
3019
3001
  * @param param
3020
3002
  * @returns
3021
3003
  */
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("未选择文件");
3004
+ static importFile = async (n) => new Promise((l, a) => {
3005
+ const i = document.createElement("input");
3006
+ i.type = "file";
3007
+ const o = n?.accept || ".json";
3008
+ i.accept = o, i.style.display = "none", i.onchange = (t) => {
3009
+ const s = t.target.files[0];
3010
+ if (!s) {
3011
+ S.fail("未选择文件"), a("未选择文件");
3030
3012
  return;
3031
3013
  }
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();
3014
+ const f = new FileReader();
3015
+ f.onload = async (d) => {
3016
+ const c = o == ".json" ? JSON.parse(d.target.result) : d.target.result;
3017
+ l(c);
3018
+ }, f.onerror = () => {
3019
+ S.fail("文件读取失败"), a("文件读取失败");
3020
+ }, f.readAsText(s), document.body.removeChild(i);
3021
+ }, document.body.appendChild(i), i.click();
3040
3022
  });
3041
3023
  }
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]);
3024
+ const Vo = (e, n) => {
3025
+ if (e.component("TCurd", So), e.component("TFormList", $e), e.component("TColumn", bt), n?.customComponent) {
3026
+ P.customComponent = n.customComponent;
3027
+ for (const l in n.customComponent)
3028
+ e.component(l, n.customComponent[l]);
3047
3029
  }
3048
- }, eo = {
3049
- install: Qt
3030
+ }, Mo = {
3031
+ install: Vo
3050
3032
  };
3051
3033
  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,
3034
+ N as ArrUtil,
3035
+ Ct as ExcelUtil,
3036
+ bt as TColumn,
3037
+ So as TCurd,
3038
+ Oo as TFile,
3039
+ P as TForm,
3058
3040
  M as TFormConfig,
3059
- v as TFormI18n,
3060
- fe as TFormList,
3061
- D as TSys,
3062
- eo as default,
3063
- Qt as install
3041
+ b as TFormI18n,
3042
+ $e as TFormList,
3043
+ S as TSys,
3044
+ Mo as default,
3045
+ Vo as install
3064
3046
  };