cc1-form 1.1.37 → 1.1.39

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,7 +1,7 @@
1
- import { ElMessage as ue, ElLoading as fe, ElForm as N, ElFormItem as G, ElInput as Q, ElSwitch as ee, ElSelect as W, ElOption as B, ElTreeSelect as ie, ElDatePicker as te, ElDialog as Z, ElButton as F, ElTableColumn as x, ElRadioGroup as ce, ElRadio as pe, ElDropdown as me, ElDropdownMenu as he, ElDropdownItem as Y, ElPagination as ae, ElTable as be } from "element-plus";
1
+ import { ElMessage as ce, ElLoading as me, ElForm as N, ElFormItem as X, ElInput as Y, ElSwitch as oe, ElSelect as W, ElOption as K, ElRadioGroup as re, ElRadio as se, ElTreeSelect as de, ElDatePicker as ae, ElDialog as _, ElButton as A, ElTableColumn as ee, ElDropdown as he, ElDropdownMenu as ge, ElDropdownItem as x, ElPagination as ie, ElTable as be } from "element-plus";
2
2
  import "vue-router";
3
- import { defineComponent as H, reactive as oe, onMounted as ne, resolveComponent as X, createElementBlock as w, createCommentVNode as C, openBlock as f, renderSlot as k, createElementVNode as O, createVNode as V, withCtx as h, createTextVNode as E, Fragment as S, renderList as L, createBlock as b, normalizeClass as R, normalizeStyle as se, ref as J, nextTick as ge, unref as o, mergeProps as v, toHandlers as $, resolveDynamicComponent as q, toDisplayString as U, getCurrentInstance as ye, createSlots as _, withKeys as we, resolveDirective as ke, withDirectives as Ce, normalizeProps as ve, guardReactiveProps as Ve } from "vue";
4
- class D {
3
+ import { defineComponent as J, reactive as le, onMounted as ue, resolveComponent as Q, createElementBlock as y, createCommentVNode as C, openBlock as f, renderSlot as k, createElementVNode as O, createVNode as z, withCtx as m, createTextVNode as E, Fragment as $, renderList as L, createBlock as h, normalizeClass as j, normalizeStyle as fe, ref as H, unref as a, mergeProps as v, toHandlers as S, resolveDynamicComponent as q, toDisplayString as T, getCurrentInstance as ye, createSlots as te, resolveDirective as we, withDirectives as ke, normalizeProps as Ce, guardReactiveProps as ve } from "vue";
4
+ class U {
5
5
  /**
6
6
  * Vue Router 实例,需在应用初始化时赋值
7
7
  */
@@ -15,7 +15,7 @@ class D {
15
15
  */
16
16
  static getRouterPath = () => this.router.currentRoute.value.path;
17
17
  static EDialog = {
18
- Insert: "Insert",
18
+ Add: "Add",
19
19
  Update: "Update",
20
20
  View: "View",
21
21
  Remove: "Remove"
@@ -26,13 +26,13 @@ class D {
26
26
  * @param data 数据
27
27
  * @returns 是否显示
28
28
  */
29
- static isFun = (l, ...d) => Array.isArray(l) ? l.some((e) => typeof e == "function" ? e(...d) : e) : typeof l == "function" ? l(...d) : l;
29
+ static isFun = (o, ...u) => Array.isArray(o) ? o.some((t) => typeof t == "function" ? t(...u) : t) : typeof o == "function" ? o(...u) : o;
30
30
  /**
31
31
  * 获取路由参数,自动获取query、params中的参数, 哪个有就返回哪个
32
32
  */
33
33
  static getRouterParams = () => {
34
- const l = this.router.currentRoute.value.query || {}, d = this.router.currentRoute.value.params || {};
35
- return Object.keys(l).length ? l : Object.keys(d).length ? d : {};
34
+ const o = this.router.currentRoute.value.query || {}, u = this.router.currentRoute.value.params || {};
35
+ return Object.keys(o).length ? o : Object.keys(u).length ? u : {};
36
36
  };
37
37
  /**
38
38
  * 模块赋值
@@ -42,11 +42,11 @@ class D {
42
42
  * 加载模块
43
43
  * @param module
44
44
  */
45
- static loadModule = async (l) => {
46
- if (!D.moduleObj[l])
47
- throw new Error(`模块${l}未加载,请赋值如:TSys.moduleObj = { ${l}: ()=>import('${l}') }`);
48
- const d = await D.moduleObj[l]();
49
- return d.default ?? d;
45
+ static loadModule = async (o) => {
46
+ if (!U.moduleObj[o])
47
+ throw new Error(`模块${o}未加载,请赋值如:TSys.moduleObj = { ${o}: ()=>import('${o}') }`);
48
+ const u = await U.moduleObj[o]();
49
+ return u.default ?? u;
50
50
  };
51
51
  /**
52
52
  * 提示信息对象管理
@@ -62,19 +62,19 @@ class D {
62
62
  * @param type 消息类型
63
63
  * @param options 其他选项
64
64
  */
65
- static showMessage(l, d, e = {}) {
65
+ static showMessage(o, u, t = {}) {
66
66
  const i = Date.now();
67
- if (!this.tipMessages[l] || i - this.tipMessages[l] > this.tipMessagesGap) {
68
- this.tipMessages[l] = i;
69
- const t = Object.assign(
67
+ if (!this.tipMessages[o] || i - this.tipMessages[o] > this.tipMessagesGap) {
68
+ this.tipMessages[o] = i;
69
+ const l = Object.assign(
70
70
  {
71
- message: l,
72
- type: d
71
+ message: o,
72
+ type: u
73
73
  },
74
- e
74
+ t
75
75
  );
76
- ue(t), setTimeout(() => {
77
- delete this.tipMessages[l];
76
+ ce(l), setTimeout(() => {
77
+ delete this.tipMessages[o];
78
78
  }, this.tipMessagesGap);
79
79
  }
80
80
  }
@@ -83,16 +83,16 @@ class D {
83
83
  * @param content
84
84
  * @param options
85
85
  */
86
- static fail = (l, d = {}) => {
87
- this.showMessage(l, "error", d);
86
+ static fail = (o, u = {}) => {
87
+ this.showMessage(o, "error", u);
88
88
  };
89
89
  /**
90
90
  * 成功提示
91
91
  * @param content
92
92
  * @param options
93
93
  */
94
- static success = (l, d = {}) => {
95
- this.showMessage(l, "success", d);
94
+ static success = (o, u = {}) => {
95
+ this.showMessage(o, "success", u);
96
96
  };
97
97
  static loadingObj = null;
98
98
  static loadingTimer = null;
@@ -101,11 +101,11 @@ class D {
101
101
  * @param show
102
102
  * @param text
103
103
  */
104
- static loading = (l = !0, d = "Loading...") => {
104
+ static loading = (o = !0, u = "Loading...") => {
105
105
  Timer.un(this.loadingTimer), this.loadingTimer = Timer.once(() => {
106
- l ? this.loadingObj = fe.service({
106
+ o ? this.loadingObj = me.service({
107
107
  lock: !0,
108
- text: d,
108
+ text: u,
109
109
  background: "rgba(0, 0, 0, 0.3)"
110
110
  }) : this.loadingObj && (this.loadingObj.close(), this.loadingObj = null);
111
111
  }, 50);
@@ -115,46 +115,46 @@ class D {
115
115
  * @param url 地址
116
116
  * @param isCenter 是否居中
117
117
  */
118
- static openUrl = (l, d = !0) => {
119
- if (d) {
120
- let e = screen.width / 2 - 500, i = screen.height / 2 - 800 / 2 - 30;
118
+ static openUrl = (o, u = !0) => {
119
+ if (u) {
120
+ let t = screen.width / 2 - 500, i = screen.height / 2 - 800 / 2 - 30;
121
121
  window.open(
122
- l,
122
+ o,
123
123
  "_blank",
124
- "toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + i + ", left=" + e
124
+ "toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + i + ", left=" + t
125
125
  );
126
126
  } else
127
- window.open(l, "DescriptiveWindowName" + StrUtil.getId(), "resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0");
127
+ window.open(o, "DescriptiveWindowName" + StrUtil.getId(), "resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0");
128
128
  };
129
129
  /**
130
130
  * 根据dom id截图并返回图片数据
131
131
  * @param param
132
132
  * @returns
133
133
  */
134
- static getImgPic = (l) => new Promise(async (d, e) => {
135
- let i = document.getElementById(l.id);
136
- const t = await D.loadModule("html2canvas");
134
+ static getImgPic = (o) => new Promise(async (u, t) => {
135
+ let i = document.getElementById(o.id);
136
+ const l = await U.loadModule("html2canvas");
137
137
  try {
138
- t(i, {
138
+ l(i, {
139
139
  logging: !1,
140
140
  allowTaint: !0,
141
141
  scale: window.devicePixelRatio,
142
- width: l.windowWidth,
143
- height: l.windowHeight,
144
- windowWidth: l.windowWidth,
145
- windowHeight: l.windowHeight,
142
+ width: o.windowWidth,
143
+ height: o.windowHeight,
144
+ windowWidth: o.windowWidth,
145
+ windowHeight: o.windowHeight,
146
146
  useCORS: !0,
147
147
  backgroundColor: "#ffffff00"
148
- }).then(function(a) {
149
- let r = a.toDataURL("image/png");
150
- d(r);
148
+ }).then(function(e) {
149
+ let s = e.toDataURL("image/png");
150
+ u(s);
151
151
  });
152
- } catch (a) {
153
- e(a);
152
+ } catch (e) {
153
+ t(e);
154
154
  }
155
155
  });
156
156
  }
157
- class z {
157
+ class D {
158
158
  /**
159
159
  * 全局配置对象
160
160
  */
@@ -489,11 +489,11 @@ class z {
489
489
  *
490
490
  * @param config - 需要覆盖的配置项(深度 Partial)
491
491
  */
492
- static setConfig = (l) => {
493
- z.config = ObjectUtil.deepMerge(z.config, l);
492
+ static setConfig = (o) => {
493
+ D.config = ObjectUtil.deepMerge(D.config, o);
494
494
  };
495
495
  }
496
- class j {
496
+ class M {
497
497
  /**
498
498
  * 自定义组件映射表,key 为组件名(同时作为 column.type 值),value 为 Vue 组件定义
499
499
  *
@@ -511,10 +511,10 @@ class j {
511
511
  * @param field - 字段的 key 值
512
512
  * @returns 该字段对应类型的 options 配置,如 select 类型返回 `options.select`
513
513
  */
514
- static findOptions = (l, d) => {
515
- const e = l.column.find((t) => t.key === d), i = (t) => t.replace(/-([a-z])/g, (a, r) => r.toUpperCase());
516
- if (e)
517
- return e.options[i(e.type)];
514
+ static findOptions = (o, u) => {
515
+ const t = o.column.find((l) => l.key === u), i = (l) => l.replace(/-([a-z])/g, (e, s) => s.toUpperCase());
516
+ if (t)
517
+ return t.options[i(t.type)];
518
518
  };
519
519
  /**
520
520
  * 更新组件数据
@@ -532,9 +532,9 @@ class j {
532
532
  }))
533
533
  )
534
534
  */
535
- static setOptionsData = (l, d, e) => {
536
- const i = j.findOptions(l, d);
537
- i && (i.data = e);
535
+ static setOptionsData = (o, u, t) => {
536
+ const i = M.findOptions(o, u);
537
+ i && (i.data = t);
538
538
  };
539
539
  static form = {
540
540
  openBefore: {
@@ -545,13 +545,65 @@ class j {
545
545
  * @param treeData 树形数据
546
546
  * @param option 组件配置
547
547
  */
548
- parentId: (l, d, e, i) => {
549
- const t = z.config.table.rowKey;
550
- l ? d.type === D.EDialog.Insert ? (d.form.parentId = l[t], d.form.sort = l.children.length + 1) : d.form.parentId = l.parentId.substring(l.parentId.lastIndexOf(",") + 1) : (d.form.parentId = "0", d.form.sort = e.length + 1), j.setOptionsData(i, "parentId", [{ [t]: "0", title: "根", children: e }]);
548
+ parentId: (o, u, t, i) => {
549
+ const l = D.config.table.rowKey;
550
+ o ? u.type === U.EDialog.Add ? (u.form.parentId = o[l], u.form.sort = o.children.length + 1) : u.form.parentId = o.parentId.substring(o.parentId.lastIndexOf(",") + 1) : (u.form.parentId = "0", u.form.sort = t.length + 1), M.setOptionsData(i, "parentId", [{ [l]: "0", title: "根", children: t }]);
551
551
  }
552
552
  }
553
553
  };
554
554
  }
555
+ const Ve = {
556
+ search: "搜索",
557
+ add: "新增",
558
+ edit: "编辑",
559
+ view: "查看",
560
+ delete: "删除",
561
+ export: "导出",
562
+ exportSelect: "导出选中",
563
+ exportPage: "导出本页",
564
+ exportAll: "导出全部",
565
+ import: "导入",
566
+ refresh: "刷新",
567
+ reset: "重置",
568
+ expandCollapse: "展开/收缩",
569
+ operation: "操作",
570
+ close: "关闭",
571
+ cancel: "取消",
572
+ submit: "提交",
573
+ confirm: "确认",
574
+ confirmDelete: "确认删除",
575
+ confirmDeleteMessage: "确认要删除【{count}】条数据吗?",
576
+ placeholderInput: "请输入",
577
+ placeholderSelect: "请选择",
578
+ checkFormData: "请检查表单数据",
579
+ selectDataToDelete: "请选择要删除的数据",
580
+ selectDataToExport: "请选择要导出的数据",
581
+ noData: "暂无数据",
582
+ operationSuccess: "操作成功",
583
+ switchOn: "开启",
584
+ switchOff: "关闭",
585
+ confirmModify: "确认修改",
586
+ confirmSwitchMessage: "确认要修改吗?"
587
+ };
588
+ class b {
589
+ /** 解析国际化值:函数则执行并返回字符串,字符串则替换 `{key}` 占位符 */
590
+ static t(o, ...u) {
591
+ if (typeof o == "function")
592
+ return o(...u);
593
+ o = String(o);
594
+ let t = 0;
595
+ return o.replace(/{([^}]+)}/g, (i, l) => t < u.length ? String(u[t++]) : `{${l}}`);
596
+ }
597
+ static setI18n = (o) => {
598
+ b.curd = ObjectUtil.deepMerge(b.curd, o);
599
+ };
600
+ /** 解析curd国际化值 */
601
+ static tCurd(o, ...u) {
602
+ return this.t(this.curd[o], ...u);
603
+ }
604
+ /** curd表单 */
605
+ static curd = Ve;
606
+ }
555
607
  class P {
556
608
  /**
557
609
  * ID 生成函数,默认使用 `StrUtil.uuid()`,可覆盖为自定义实现
@@ -562,14 +614,14 @@ class P {
562
614
  * @param field 字段名
563
615
  * @param row 行数据
564
616
  */
565
- static setId = (l, d, e) => {
566
- d[l] || (d[l] = []);
567
- const i = z.config.table.rowKey;
568
- d[l].forEach((t) => {
569
- e.forEach((a) => {
570
- let r = a.default ?? "";
571
- a.type === "number" && (r = a.default ?? 0), a.type === "boolean" && (r = a.default ?? !1), a.type === "time" && (r = a.default ?? /* @__PURE__ */ new Date()), t[a.value] === void 0 && (t[a.value] = r);
572
- }), t[i] || (t[i] = P.getIdFun());
617
+ static setId = (o, u, t) => {
618
+ u[o] || (u[o] = []);
619
+ const i = D.config.table.rowKey;
620
+ u[o].forEach((l) => {
621
+ t.forEach((e) => {
622
+ let s = e.default ?? "";
623
+ e.type === "number" && (s = e.default ?? 0), e.type === "boolean" && (s = e.default ?? !1), e.type === "time" && (s = e.default ?? /* @__PURE__ */ new Date()), l[e.value] === void 0 && (l[e.value] = s);
624
+ }), l[i] || (l[i] = P.getIdFun());
573
625
  });
574
626
  };
575
627
  /**
@@ -579,19 +631,19 @@ class P {
579
631
  * @param itemFields 元素字段-如:[{label:'',value:''}]
580
632
  * @param callback 回调函数
581
633
  */
582
- static add = (l, d, e, i) => {
583
- const t = JSONUtil.cp(e);
584
- P.setId(l, d, e);
585
- const a = z.config.table.rowKey;
586
- d[l].push(
587
- t.reduce(
588
- (r, c) => {
589
- let m = c.default ?? "";
590
- return c.type === "number" && (m = c.default ?? 0), c.type === "boolean" && (m = c.default ?? !1), c.type === "time" && (m = c.default ?? /* @__PURE__ */ new Date()), r[c.value] = m, r;
634
+ static add = (o, u, t, i) => {
635
+ const l = JSONUtil.cp(t);
636
+ P.setId(o, u, t);
637
+ const e = D.config.table.rowKey;
638
+ u[o].push(
639
+ l.reduce(
640
+ (s, p) => {
641
+ let c = p.default ?? "";
642
+ return p.type === "number" && (c = p.default ?? 0), p.type === "boolean" && (c = p.default ?? !1), p.type === "time" && (c = p.default ?? /* @__PURE__ */ new Date()), s[p.value] = c, s;
591
643
  },
592
- { [a]: P.getIdFun() }
644
+ { [e]: P.getIdFun() }
593
645
  )
594
- ), i?.(d);
646
+ ), i?.(u);
595
647
  };
596
648
  /**
597
649
  * 删除数组元素
@@ -600,9 +652,9 @@ class P {
600
652
  * @param item 元素-如:{_id:''}
601
653
  * @param callback 回调函数
602
654
  */
603
- static remove = (l, d, e, i) => {
604
- const t = z.config.table.rowKey;
605
- d[l] = d[l].filter((a) => a[t] !== e[t]), i?.(d);
655
+ static remove = (o, u, t, i) => {
656
+ const l = D.config.table.rowKey;
657
+ u[o] = u[o].filter((e) => e[l] !== t[l]), i?.(u);
606
658
  };
607
659
  /**
608
660
  * 获取没有id的数据
@@ -610,21 +662,21 @@ class P {
610
662
  * @param childernField 子级字段-如:list、children
611
663
  * @returns 没有id的数据
612
664
  */
613
- static getNoIdData = (l, d) => {
614
- const e = JSONUtil.cp(l), i = z.config.table.rowKey;
615
- return e.forEach((t) => {
616
- t[i] && delete t[i], d && t[d] && P.getNoIdData(t[d], d);
617
- }), e;
665
+ static getNoIdData = (o, u) => {
666
+ const t = JSONUtil.cp(o), i = D.config.table.rowKey;
667
+ return t.forEach((l) => {
668
+ l[i] && delete l[i], u && l[u] && P.getNoIdData(l[u], u);
669
+ }), t;
618
670
  };
619
671
  }
620
672
  const ze = {
621
673
  key: 0,
622
674
  class: "column",
623
675
  style: { width: "100%", gap: "10px" }
624
- }, Ee = {
676
+ }, De = {
625
677
  class: "row items-center",
626
678
  style: { gap: "10px", width: "100%" }
627
- }, le = /* @__PURE__ */ H({
679
+ }, ne = /* @__PURE__ */ J({
628
680
  __name: "list",
629
681
  props: {
630
682
  row: {
@@ -659,73 +711,76 @@ const ze = {
659
711
  }
660
712
  },
661
713
  emits: ["change"],
662
- setup(n, { emit: l }) {
663
- const d = n, e = oe({
714
+ setup(r, { emit: o }) {
715
+ const u = r, t = le({
664
716
  show: !1,
665
- add: (t, a, r) => {
666
- P.add(t, a, r, () => {
717
+ add: (l, e, s) => {
718
+ P.add(l, e, s, () => {
667
719
  i("change");
668
720
  });
669
721
  },
670
- remove: (t, a, r) => {
671
- P.remove(t, a, r, () => {
722
+ remove: (l, e, s) => {
723
+ P.remove(l, e, s, () => {
672
724
  i("change");
673
725
  });
674
726
  }
675
727
  });
676
- ne(() => {
677
- P.setId(d.field, d.row, d.itemFields), e.show = !0;
728
+ ue(() => {
729
+ P.setId(u.field, u.row, u.itemFields), t.show = !0;
678
730
  });
679
- const i = l;
680
- return (t, a) => {
681
- const r = X("el-button"), c = X("el-input");
682
- return e.show ? (f(), w("div", ze, [
683
- k(t.$slots, "list-start", { row: n.row }),
731
+ const i = o;
732
+ return (l, e) => {
733
+ const s = Q("el-button"), p = Q("el-input");
734
+ return t.show ? (f(), y("div", ze, [
735
+ k(l.$slots, "list-start", { row: r.row }),
684
736
  O("div", null, [
685
- V(r, {
737
+ z(s, {
686
738
  link: "",
687
739
  type: "primary",
688
- onClick: a[0] || (a[0] = (m) => e.add(n.field, n.row, n.itemFields))
740
+ onClick: e[0] || (e[0] = (c) => t.add(r.field, r.row, r.itemFields))
689
741
  }, {
690
- default: h(() => a[2] || (a[2] = [
742
+ default: m(() => e[2] || (e[2] = [
691
743
  E("添加")
692
744
  ])),
693
745
  _: 1
694
746
  })
695
747
  ]),
696
- (f(!0), w(S, null, L(n.row[n.field], (m) => (f(), w("div", Ee, [
697
- k(t.$slots, "item-start", {
698
- item: m,
699
- row: n.row
748
+ (f(!0), y($, null, L(r.row[r.field], (c) => (f(), y("div", De, [
749
+ k(l.$slots, "item-start", {
750
+ item: c,
751
+ row: r.row
700
752
  }),
701
- (f(!0), w(S, null, L(n.itemFields, (u) => (f(), b(c, {
702
- modelValue: m[u.value],
703
- "onUpdate:modelValue": (s) => m[u.value] = s,
704
- style: se({ width: n.inputWidth }),
705
- class: R(n.inputClass),
706
- placeholder: u[n.label] || u[n.value],
707
- onChange: a[1] || (a[1] = (s) => i("change"))
753
+ (f(!0), y($, null, L(r.itemFields, (g) => (f(), h(p, {
754
+ modelValue: c[g.value],
755
+ "onUpdate:modelValue": (n) => c[g.value] = n,
756
+ style: fe({ width: r.inputWidth }),
757
+ class: j(r.inputClass),
758
+ placeholder: g[r.label] || g[r.value],
759
+ onChange: e[1] || (e[1] = (n) => i("change"))
708
760
  }, null, 8, ["modelValue", "onUpdate:modelValue", "style", "class", "placeholder"]))), 256)),
709
- k(t.$slots, "item-end", {
710
- item: m,
711
- row: n.row
761
+ k(l.$slots, "item-end", {
762
+ item: c,
763
+ row: r.row
712
764
  }),
713
- V(r, {
765
+ z(s, {
714
766
  link: "",
715
767
  type: "danger",
716
- onClick: (u) => e.remove(n.field, n.row, m)
768
+ onClick: (g) => t.remove(r.field, r.row, c)
717
769
  }, {
718
- default: h(() => a[3] || (a[3] = [
770
+ default: m(() => e[3] || (e[3] = [
719
771
  E("删除")
720
772
  ])),
721
773
  _: 2
722
774
  }, 1032, ["onClick"])
723
775
  ]))), 256)),
724
- k(t.$slots, "list-end", { row: n.row })
776
+ k(l.$slots, "list-end", { row: r.row })
725
777
  ])) : C("", !0);
726
778
  };
727
779
  }
728
- }), De = { class: "row curd-row" }, Se = /* @__PURE__ */ H({
780
+ }), Se = {
781
+ class: "row form-item-content",
782
+ style: { width: "100%" }
783
+ }, Ee = { class: "col" }, $e = { class: "col" }, Oe = ["innerHTML"], Ue = /* @__PURE__ */ J({
729
784
  __name: "column",
730
785
  props: {
731
786
  /**
@@ -741,202 +796,229 @@ const ze = {
741
796
  default: ""
742
797
  }
743
798
  },
744
- setup(n, { expose: l }) {
745
- const d = D.isFun, e = D.EDialog, i = J(), t = n, a = oe({
799
+ setup(r, { expose: o }) {
800
+ const u = U.isFun, t = U.EDialog, i = H(), l = r, e = le({
746
801
  rules: {},
747
802
  show: !0,
748
803
  form: {},
749
804
  formDefault: {},
805
+ type: l.type || t.Add,
750
806
  formColumn: [],
751
- getDisabled: (r) => r.disabled?.[(t.type || e.Insert) === e.Insert ? "create" : "update"],
752
- initColumnForm: async () => {
753
- const r = t.option;
754
- a.formColumn = [];
755
- const c = [], m = t.option.form?.maxSpan || 12, u = t.option.form?.defaultSpan || m;
756
- let s = [];
757
- const p = (y) => {
758
- if (a.formDefault[y.key] = y.value, y.isForm) {
759
- y.form = y.form || { span: u }, y.form.span = y.form.span ?? u;
760
- let I = y.form.span, M = s.reduce((A, de) => A + de.span, I);
761
- const T = s.length;
762
- s.push({ item: y, span: I }), (T === 1 && s[0].span === 0 || M >= m || I === 0 && T > 1) && (c.push(s), s = []), y.rules && (a.rules[y.key] = y.rules);
807
+ getDisabled: (s) => e.type === t.View ? s.disabled?.view === void 0 ? !0 : s.disabled?.view : s.disabled?.[e.type === t.Add ? "create" : "update"],
808
+ getBind: (s) => s.options?.[e.type === t.Add ? "formAdd" : "formUpdate"]?.[s.type] || s.options?.[s.type] || {},
809
+ getOn: (s) => s.options?.[e.type === t.Add ? "formAdd" : "formUpdate"]?.[s.type]?.on || s.options?.[s.type]?.on || {},
810
+ getColumnSpan: (s, p) => {
811
+ if (s.item.form?.spanCol) {
812
+ const c = l.option.form?.maxSpan || 12, g = l.option.form?.defaultSpan || c / 2, d = p.filter((V) => !U.isFun(V.item.show?.form, e.form, e.type)).reduce((V, w) => V + (w.item.form?.span || g), 0);
813
+ return (s.item.form?.span || g) + d;
814
+ }
815
+ return s.item.form?.span;
816
+ },
817
+ initColumnForm: () => {
818
+ const s = l.option;
819
+ e.formColumn = [], e.rules = {}, e.formDefault = {};
820
+ const p = [], c = l.option.form?.maxSpan || 12, g = l.option.form?.defaultSpan || c / 2;
821
+ let n = [];
822
+ const d = (w) => {
823
+ if (w.children) {
824
+ w.children.forEach((F) => {
825
+ d(F);
826
+ });
827
+ return;
763
828
  }
829
+ if (e.formDefault[w.key] = w.value, w.isForm && (typeof w.show?.form != "boolean" || w.show?.form)) {
830
+ w.form = w.form || { span: g }, w.form.span = w.form.span ?? g;
831
+ const F = w.form.span, B = n.reduce((G, Z) => G + Z.span, F), R = n.length;
832
+ if (n.push({ item: w, span: F }), (R === 1 && n[0].span === 0 || B >= c || F === 0 && R > 1) && (p.push(n), n = []), w.rules) {
833
+ const G = {
834
+ input: b.tCurd("placeholderInput"),
835
+ select: b.tCurd("placeholderSelect")
836
+ }, Z = (G[w.type] || G.input) + w.label;
837
+ e.rules[w.key] = typeof w.rules == "boolean" ? [
838
+ {
839
+ required: !0,
840
+ message: Z,
841
+ trigger: "blur"
842
+ }
843
+ ] : w.rules;
844
+ }
845
+ }
846
+ }, V = (w, F) => {
847
+ w.isForm = F, Array.isArray(w.children) && w.children.forEach((B) => V(B, F));
764
848
  };
765
- r.column.forEach((y) => {
766
- y.isForm = !0, p(y);
767
- }), s.length > 0 && c.push(s), a.formColumn = c, a.form = JSONUtil.cp(a.formDefault);
768
- },
769
- init: async () => {
770
- a.show = !1, await ge(), a.initColumnForm();
849
+ s.column.forEach((w) => {
850
+ V(w, !0), d(w);
851
+ }), n.length > 0 && p.push(n), e.formColumn = p, e.form = JSONUtil.cp(e.formDefault);
771
852
  }
772
853
  });
773
- return a.initColumnForm(), l({
854
+ return e.initColumnForm(), o({
774
855
  ref: i,
775
- conf: a
776
- }), (r, c) => (f(), b(o(N), {
856
+ conf: e
857
+ }), (s, p) => (f(), h(a(N), {
777
858
  ref_key: "ruleFormRef",
778
859
  ref: i,
779
- model: a.form,
780
- rules: a.rules
860
+ model: e.form,
861
+ rules: e.rules
781
862
  }, {
782
- default: h(() => [
783
- a.show ? (f(!0), w(S, { key: 0 }, L(a.formColumn, (m) => (f(), w("div", De, [
784
- k(r.$slots, "form-start", {
785
- row: a.form
786
- }),
787
- (f(!0), w(S, null, L(m, (u) => (f(), w(S, null, [
788
- o(d)(u.item.show?.form, a.form) ?? !0 ? (f(), w("div", {
789
- key: 0,
790
- class: R(u.item.form.span > 0 ? `col-${u.item.form.span}` : "col")
863
+ default: m(() => [
864
+ e.show ? (f(!0), y($, { key: 0 }, L(e.formColumn, (c, g) => (f(), y($, { key: g }, [
865
+ a(u)(
866
+ c.map((n) => n.item?.show?.form),
867
+ e.form,
868
+ e.type
869
+ ) ? (f(), y("div", {
870
+ key: 0,
871
+ class: j(["row curd-row", {
872
+ stripe: r.option.form?.stripe === void 0 ? !0 : r.option.form?.stripe
873
+ }])
874
+ }, [
875
+ k(s.$slots, "form-start", {
876
+ row: e.form
877
+ }),
878
+ (f(!0), y($, null, L(c, (n) => (f(), y($, {
879
+ key: n.item.key
791
880
  }, [
792
- V(o(G), {
793
- label: u.item.label,
794
- prop: u.item.key,
795
- "label-width": u.item.form?.labelWidth || "100px"
796
- }, {
797
- default: h(() => [
798
- k(r.$slots, "form-" + u.item.key + "-start", {
799
- row: a.form,
800
- item: u.item
881
+ a(u)(n.item.show?.form, e.form, e.type) ? (f(), y("div", {
882
+ key: 0,
883
+ class: j([n.item.form.span > 0 ? `col-${e.getColumnSpan(n, c)}` : "col", `form-item-col-${n.item.key}`])
884
+ }, [
885
+ z(a(X), {
886
+ class: j({
887
+ "hide-label": typeof n.item.text?.form?.label == "boolean" ? !n.item.text?.form?.label : !1
801
888
  }),
802
- k(r.$slots, "form-" + u.item.key, {
803
- row: a.form,
804
- item: u.item
805
- }, () => [
806
- u.item.type === "input" ? (f(), b(o(Q), v({
807
- key: 0,
808
- modelValue: a.form[u.item.key],
809
- "onUpdate:modelValue": (s) => a.form[u.item.key] = s,
810
- ref_for: !0
811
- }, u.item.options?.input, $(u.item.options?.input?.on || {}), {
812
- disabled: a.getDisabled(u.item)
813
- }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "switch" ? (f(), b(o(ee), v({
814
- key: 1,
815
- modelValue: a.form[u.item.key],
816
- "onUpdate:modelValue": (s) => a.form[u.item.key] = s,
817
- ref_for: !0
818
- }, u.item.options?.switch, $(u.item.options?.switch?.on || {}), {
819
- disabled: a.getDisabled(u.item)
820
- }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "select" ? (f(), b(o(W), v({
821
- key: 2,
822
- modelValue: a.form[u.item.key],
823
- "onUpdate:modelValue": (s) => a.form[u.item.key] = s,
824
- ref_for: !0
825
- }, u.item.options?.select, $(u.item.options?.select?.on || {}), {
826
- disabled: a.getDisabled(u.item),
827
- style: { width: "100%" }
828
- }), {
829
- default: h(() => [
830
- (f(!0), w(S, null, L(u.item.options?.select?.data, (s) => (f(), b(o(B), {
831
- key: s.value,
832
- label: s.label,
833
- value: s.value
834
- }, null, 8, ["label", "value"]))), 128))
889
+ label: typeof n.item.text?.form?.label == "string" ? n.item.text?.form?.label : n.item.label,
890
+ prop: n.item.key,
891
+ "label-width": n.item.form?.labelWidth || r.option.form?.labelWidth || "100px"
892
+ }, {
893
+ default: m(() => [
894
+ O("div", Se, [
895
+ k(s.$slots, "form-" + n.item.key + "-start", {
896
+ row: e.form,
897
+ item: n.item
898
+ }),
899
+ O("div", Ee, [
900
+ O("div", $e, [
901
+ k(s.$slots, "form-" + n.item.key, {
902
+ row: e.form,
903
+ item: n.item
904
+ }, () => [
905
+ n.item.type === "input" ? (f(), h(a(Y), v({
906
+ key: 0,
907
+ modelValue: e.form[n.item.key],
908
+ "onUpdate:modelValue": (d) => e.form[n.item.key] = d,
909
+ ref_for: !0
910
+ }, e.getBind(n.item), S(e.getOn(n.item)), {
911
+ disabled: e.getDisabled(n.item)
912
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type === "switch" ? (f(), h(a(oe), v({
913
+ key: 1,
914
+ modelValue: e.form[n.item.key],
915
+ "onUpdate:modelValue": (d) => e.form[n.item.key] = d,
916
+ ref_for: !0
917
+ }, e.getBind(n.item), S(e.getOn(n.item)), {
918
+ disabled: e.getDisabled(n.item)
919
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type === "select" ? (f(), h(a(W), v({
920
+ key: 2,
921
+ modelValue: e.form[n.item.key],
922
+ "onUpdate:modelValue": (d) => e.form[n.item.key] = d,
923
+ ref_for: !0
924
+ }, e.getBind(n.item), S(e.getOn(n.item)), {
925
+ disabled: e.getDisabled(n.item),
926
+ style: { width: "100%" }
927
+ }), {
928
+ default: m(() => [
929
+ (f(!0), y($, null, L(n.item.options?.select?.data, (d) => (f(), h(a(K), {
930
+ key: d.value,
931
+ label: d.label,
932
+ value: d.value
933
+ }, null, 8, ["label", "value"]))), 128))
934
+ ]),
935
+ _: 2
936
+ }, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type === "radio" ? (f(), h(a(re), v({
937
+ key: 3,
938
+ modelValue: e.form[n.item.key],
939
+ "onUpdate:modelValue": (d) => e.form[n.item.key] = d,
940
+ ref_for: !0
941
+ }, e.getBind(n.item), S(e.getOn(n.item)), {
942
+ disabled: e.getDisabled(n.item),
943
+ style: { width: "100%" }
944
+ }), {
945
+ default: m(() => [
946
+ (f(!0), y($, null, L(n.item.options?.radio?.data, (d) => (f(), h(a(se), {
947
+ key: d.value,
948
+ label: d.label,
949
+ value: d.value
950
+ }, null, 8, ["label", "value"]))), 128))
951
+ ]),
952
+ _: 2
953
+ }, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type === "list" ? (f(), h(ne, v({
954
+ key: 4,
955
+ row: e.form,
956
+ field: n.item.key,
957
+ ref_for: !0
958
+ }, e.getBind(n.item), S(e.getOn(n.item)), {
959
+ disabled: e.getDisabled(n.item),
960
+ style: { width: "100%" }
961
+ }), null, 16, ["row", "field", "disabled"])) : n.item.type === "treeSelect" ? (f(), h(a(de), v({
962
+ key: 5,
963
+ modelValue: e.form[n.item.key],
964
+ "onUpdate:modelValue": (d) => e.form[n.item.key] = d,
965
+ ref_for: !0
966
+ }, e.getBind(n.item), S(e.getOn(n.item)), {
967
+ disabled: e.getDisabled(n.item),
968
+ style: { width: "100%" }
969
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type === "datetime" ? (f(), h(a(ae), v({
970
+ key: 6,
971
+ modelValue: e.form[n.item.key],
972
+ "onUpdate:modelValue": (d) => e.form[n.item.key] = d,
973
+ ref_for: !0
974
+ }, e.getBind(n.item), S(e.getOn(n.item)), {
975
+ disabled: e.getDisabled(n.item)
976
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type && (a(M).customComponent[n.item.type] || a(M).customComponent[n.item.type]?.form) ? (f(), h(q(a(M).customComponent[n.item.type]?.form || a(M).customComponent[n.item.type]), v({
977
+ key: 7,
978
+ modelValue: e.form[n.item.key],
979
+ "onUpdate:modelValue": (d) => e.form[n.item.key] = d,
980
+ ref_for: !0
981
+ }, e.getBind(n.item), S(e.getOn(n.item)), {
982
+ disabled: e.getDisabled(n.item)
983
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : C("", !0)
984
+ ]),
985
+ k(s.$slots, "form-" + n.item.key + "-right", {
986
+ row: e.form,
987
+ item: n.item
988
+ })
989
+ ]),
990
+ k(s.$slots, "form-" + n.item.key + "-tip", {
991
+ row: e.form,
992
+ item: n.item
993
+ }, () => [
994
+ n.item.form?.tipText ? (f(), y("div", {
995
+ key: 0,
996
+ class: "form-tip-text",
997
+ innerHTML: typeof n.item.form?.tipText == "function" ? n.item.form?.tipText(e.form, e.type) : n.item.form?.tipText
998
+ }, null, 8, Oe)) : C("", !0)
999
+ ])
835
1000
  ]),
836
- _: 2
837
- }, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "list" ? (f(), b(le, v({
838
- key: 3,
839
- row: a.form,
840
- field: u.item.key,
841
- ref_for: !0
842
- }, u.item.options?.list, $(u.item.options?.list?.on || {}), {
843
- disabled: a.getDisabled(u.item),
844
- style: { width: "100%" }
845
- }), null, 16, ["row", "field", "disabled"])) : u.item.type === "treeSelect" ? (f(), b(o(ie), v({
846
- key: 4,
847
- modelValue: a.form[u.item.key],
848
- "onUpdate:modelValue": (s) => a.form[u.item.key] = s,
849
- ref_for: !0
850
- }, u.item.options?.treeSelect, $(u.item.options?.treeSelect?.on || {}), {
851
- disabled: a.getDisabled(u.item),
852
- style: { width: "100%" }
853
- }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "datetime" ? (f(), b(o(te), v({
854
- key: 5,
855
- modelValue: a.form[u.item.key],
856
- "onUpdate:modelValue": (s) => a.form[u.item.key] = s,
857
- ref_for: !0
858
- }, u.item.options?.datetime, $(u.item.options?.datetime?.on || {}), {
859
- disabled: a.getDisabled(u.item)
860
- }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type && o(j).customComponent[u.item.type] ? (f(), b(q(o(j).customComponent[u.item.type]), v({
861
- key: 6,
862
- modelValue: a.form[u.item.key],
863
- "onUpdate:modelValue": (s) => a.form[u.item.key] = s,
864
- ref_for: !0
865
- }, u.item.options?.[u.item.type], $(u.item.options?.[u.item.type]?.on || {}), {
866
- disabled: a.getDisabled(u.item)
867
- }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : C("", !0)
1001
+ k(s.$slots, "form-" + n.item.key + "-end", {
1002
+ row: e.form,
1003
+ item: n.item
1004
+ })
1005
+ ])
868
1006
  ]),
869
- k(r.$slots, "form-" + u.item.key + "-end", {
870
- row: a.form,
871
- item: u.item
872
- })
873
- ]),
874
- _: 2
875
- }, 1032, ["label", "prop", "label-width"])
876
- ], 2)) : C("", !0)
877
- ], 64))), 256)),
878
- k(r.$slots, "form-end", {
879
- row: a.form
880
- })
881
- ]))), 256)) : C("", !0)
1007
+ _: 2
1008
+ }, 1032, ["class", "label", "prop", "label-width"])
1009
+ ], 2)) : C("", !0)
1010
+ ], 64))), 128)),
1011
+ k(s.$slots, "form-end", {
1012
+ row: e.form
1013
+ })
1014
+ ], 2)) : C("", !0)
1015
+ ], 64))), 128)) : C("", !0)
882
1016
  ]),
883
1017
  _: 3
884
1018
  }, 8, ["model", "rules"]));
885
1019
  }
886
1020
  });
887
- const Ue = {
888
- search: "搜索",
889
- add: "新增",
890
- edit: "编辑",
891
- view: "查看",
892
- delete: "删除",
893
- export: "导出",
894
- exportSelect: "导出选中",
895
- exportPage: "导出本页",
896
- exportAll: "导出全部",
897
- import: "导入",
898
- refresh: "刷新",
899
- reset: "重置",
900
- expandCollapse: "展开/收缩",
901
- operation: "操作",
902
- close: "关闭",
903
- cancel: "取消",
904
- submit: "提交",
905
- confirm: "确认",
906
- confirmDelete: "确认删除",
907
- confirmDeleteMessage: "确认要删除【{count}】条数据吗?",
908
- placeholderInput: "请输入",
909
- placeholderSelect: "请选择",
910
- checkFormData: "请检查表单数据",
911
- selectDataToDelete: "请选择要删除的数据",
912
- selectDataToExport: "请选择要导出的数据",
913
- noData: "暂无数据",
914
- operationSuccess: "操作成功",
915
- switchOn: "开启",
916
- switchOff: "关闭",
917
- confirmModify: "确认修改",
918
- confirmSwitchMessage: "确认要修改吗?"
919
- };
920
- class g {
921
- /** 解析国际化值:函数则执行并返回字符串,字符串则替换 `{key}` 占位符 */
922
- static t(l, ...d) {
923
- if (typeof l == "function")
924
- return l(...d);
925
- l = String(l);
926
- let e = 0;
927
- return l.replace(/{([^}]+)}/g, (i, t) => e < d.length ? String(d[e++]) : `{${t}}`);
928
- }
929
- static setI18n = (l) => {
930
- g.curd = ObjectUtil.deepMerge(g.curd, l);
931
- };
932
- /** 解析curd国际化值 */
933
- static tCurd(l, ...d) {
934
- return this.t(this.curd[l], ...d);
935
- }
936
- /** curd表单 */
937
- static curd = Ue;
938
- }
939
- class $e {
1021
+ class Fe {
940
1022
  /**
941
1023
  * 导出数据为 Excel 文件(.xlsx),自动触发浏览器下载
942
1024
  *
@@ -944,20 +1026,20 @@ class $e {
944
1026
  * @param columns - 列配置数组,需包含 `key`(数据字段)和 `label`(Excel 表头)
945
1027
  * @param fileName - 文件名(不含扩展名),支持字符串或返回字符串的函数;默认生成「导出数据_日期_时间戳」
946
1028
  */
947
- static exportToExcel = async (l, d, e) => {
948
- if (!l || l.length === 0) return;
949
- const i = await D.loadModule("xlsx"), t = l.map((c) => {
950
- const m = {};
951
- return d.forEach((u) => {
952
- m[u.label] = c[u.key];
953
- }), m;
954
- }), a = i.utils.json_to_sheet(t), r = i.utils.book_new();
955
- i.utils.book_append_sheet(r, a, "Sheet1"), e ? typeof e == "function" && (e = e()) : e = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, i.writeFile(r, `${e}.xlsx`);
1029
+ static exportToExcel = async (o, u, t) => {
1030
+ if (!o || o.length === 0) return;
1031
+ const i = await U.loadModule("xlsx"), l = o.map((p) => {
1032
+ const c = {};
1033
+ return u.forEach((g) => {
1034
+ c[g.label] = p[g.key];
1035
+ }), c;
1036
+ }), e = i.utils.json_to_sheet(l), s = i.utils.book_new();
1037
+ i.utils.book_append_sheet(s, e, "Sheet1"), t ? typeof t == "function" && (t = t()) : t = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, i.writeFile(s, `${t}.xlsx`);
956
1038
  };
957
1039
  }
958
- const K = D.EDialog, Oe = (n) => {
959
- const l = J(), d = J(), e = oe({
960
- option: n.option,
1040
+ const I = U.EDialog, Te = (r) => {
1041
+ const o = H(), u = H(), t = le({
1042
+ option: r.option,
961
1043
  /** 查询区域相关配置对象 */
962
1044
  search: {
963
1045
  /** 查询表单列集合 */
@@ -970,26 +1052,26 @@ const K = D.EDialog, Oe = (n) => {
970
1052
  /** 搜索表单默认值 */
971
1053
  formDefault: {},
972
1054
  /** 获取占位符 */
973
- getPlaceholder: (i, t = g.tCurd("placeholderInput")) => i.text?.search?.placeholder === void 0 ? `${t}${i.label}` : i.text?.search?.placeholder,
1055
+ getPlaceholder: (i, l = b.tCurd("placeholderInput")) => i.text?.search?.placeholder === void 0 ? `${l}${i.label}` : i.text?.search?.placeholder,
974
1056
  /** 组装实际要搜索的数据对象 */
975
1057
  getFormData: () => {
976
1058
  let i = {};
977
- n.option.column.forEach((a) => {
978
- (typeof a.show?.search == "function" ? a.show?.search(e.search.form) : a.show?.search) && (i[a.key] = e.search.form[a.key]);
1059
+ r.option.column.forEach((e) => {
1060
+ (typeof e.show?.search == "function" ? e.show?.search(t.search.form) : e.show?.search) && (i[e.key] = t.search.form[e.key]);
979
1061
  });
980
- const t = n.option.search?.before?.(i);
981
- return t && (i = t), i;
1062
+ const l = r.option.search?.before?.(i);
1063
+ return l && (i = l), i;
982
1064
  },
983
1065
  /** 重置搜索表单 */
984
1066
  reset: () => {
985
- const i = e.search.formDefault;
986
- Object.keys(i).forEach((t) => {
987
- n.option.search?.resetMode === "none" ? i[t] = void 0 : i[t] = e.search.formDefault[t];
988
- }), e.search.form = JSONUtil.cp(i), e.page.num = 1, n.option.init !== !1 && e.table.getList();
1067
+ const i = t.search.formDefault;
1068
+ Object.keys(i).forEach((l) => {
1069
+ r.option.search?.resetMode === "none" ? i[l] = void 0 : i[l] = t.search.formDefault[l];
1070
+ }), t.search.form = JSONUtil.cp(i), t.page.num = 1, r.option.init !== !1 && t.table.getList();
989
1071
  },
990
1072
  /** 提交搜索表单 */
991
1073
  submit: () => {
992
- e.page.num = 1, e.table.getList();
1074
+ t.page.num = 1, t.table.getList();
993
1075
  }
994
1076
  },
995
1077
  /** 分页区域相关配置对象 */
@@ -999,22 +1081,22 @@ const K = D.EDialog, Oe = (n) => {
999
1081
  /** 总条数 */
1000
1082
  total: 0,
1001
1083
  /** 分页控件的布局方式 */
1002
- layout: n.option.page?.layout || z.config.pagination.layout,
1084
+ layout: r.option.page?.layout || D.config.pagination.layout,
1003
1085
  /** 是否显示到工具栏 默认不显示 配置后show属性无效 */
1004
- showTools: n.option.page?.showTools || z.config.pagination.showTools,
1086
+ showTools: r.option.page?.showTools || D.config.pagination.showTools,
1005
1087
  /** 当前每页条数 */
1006
- size: n.option.page?.size || z.config.pagination.size,
1088
+ size: r.option.page?.size || D.config.pagination.size,
1007
1089
  /** 支持切换的每页条数选项 */
1008
- sizeList: n.option.page?.sizeList || z.config.pagination.pageSizes,
1090
+ sizeList: r.option.page?.sizeList || D.config.pagination.pageSizes,
1009
1091
  /** 分页器计数 */
1010
- pagerCount: n.option.page?.pagerCount || z.config.pagination.pagerCount
1092
+ pagerCount: r.option.page?.pagerCount || D.config.pagination.pagerCount
1011
1093
  },
1012
1094
  /** 表格区域相关配置对象 */
1013
1095
  table: {
1014
1096
  /** 操作列相关配置 */
1015
1097
  op: {
1016
1098
  /** 动态计算操作列宽度 */
1017
- width: (...i) => i.filter((a) => a).length * 30 + 60
1099
+ width: (...i) => i.filter((e) => e).length * 30 + 60
1018
1100
  },
1019
1101
  /** 表格加载中状态 */
1020
1102
  loading: !1,
@@ -1027,22 +1109,22 @@ const K = D.EDialog, Oe = (n) => {
1027
1109
  /** 已经展开的行key集合 */
1028
1110
  rowKeys: [],
1029
1111
  /** 行展开触发变更函数 */
1030
- change: (i, t) => {
1112
+ change: (i, l) => {
1031
1113
  },
1032
1114
  /** 全部展开/收起 */
1033
1115
  all: () => {
1034
- if (e.table.expand.isExpand)
1035
- e.table.expand.rowKeys = [];
1116
+ if (t.table.expand.isExpand)
1117
+ t.table.expand.rowKeys = [];
1036
1118
  else {
1037
- const i = (t) => {
1038
- let a = [];
1039
- return t.forEach((r) => {
1040
- a.push(r[n.option.table.rowKey]), r.children && r.children.length > 0 && (a = a.concat(i(r.children)));
1041
- }), a;
1119
+ const i = (l) => {
1120
+ let e = [];
1121
+ return l.forEach((s) => {
1122
+ e.push(s[r.option.table.rowKey]), s.children && s.children.length > 0 && (e = e.concat(i(s.children)));
1123
+ }), e;
1042
1124
  };
1043
- e.table.expand.rowKeys = i(e.table.data);
1125
+ t.table.expand.rowKeys = i(t.table.data);
1044
1126
  }
1045
- e.table.expand.isExpand = !e.table.expand.isExpand;
1127
+ t.table.expand.isExpand = !t.table.expand.isExpand;
1046
1128
  }
1047
1129
  },
1048
1130
  /** 表格列相关配置 */
@@ -1059,34 +1141,34 @@ const K = D.EDialog, Oe = (n) => {
1059
1141
  },
1060
1142
  /** 获取数据列表接口实现 */
1061
1143
  getList: async () => {
1062
- e.table.loading = !0;
1063
- const i = n.option.api.list;
1144
+ t.table.loading = !0;
1145
+ const i = r.option.api.list;
1064
1146
  try {
1065
- await e.initApiData("init");
1066
- let t = {};
1067
- if (e.table.sort.prop) {
1068
- const { props: p, order: y } = z.config.table.sort;
1069
- t = {
1070
- [p.field]: e.table.sort.prop,
1071
- [y.field]: e.table.sort.order
1147
+ await t.initApiData("init");
1148
+ let l = {};
1149
+ if (t.table.sort.prop) {
1150
+ const { props: d, order: V } = D.config.table.sort;
1151
+ l = {
1152
+ [d.field]: t.table.sort.prop,
1153
+ [V.field]: t.table.sort.order
1072
1154
  };
1073
1155
  }
1074
- const a = await i({
1075
- [z.config.page.size]: e.page.size,
1076
- [z.config.page.num]: e.page.num,
1077
- ...e.search.getFormData(),
1078
- ...t
1079
- }), r = z.config.result, c = a.data || { [r.list]: a };
1080
- let m = (Array.isArray(c[r.list]), c[r.list]);
1081
- const u = e.update.formColumn.flat(), s = JSONUtil.cp(m).map((p) => (Object.keys(p).forEach((I) => {
1082
- const M = u.find((T) => T.item.key === I);
1083
- M && ["select", "radio"].includes(M.item.type) && (M.item.table.format || (M.item.table.format = (T) => M.item.options[M.item.type].data?.find((A) => A.value == T[I])?.label || T[I]));
1084
- }), p));
1085
- e.table.data = n.option.data ? await n.option.data(s, m) : s, e.page.total = c[r.total] || 0;
1086
- } catch (t) {
1087
- console.error(t);
1156
+ const e = await i({
1157
+ [D.config.page.size]: t.page.size,
1158
+ [D.config.page.num]: t.page.num,
1159
+ ...t.search.getFormData(),
1160
+ ...l
1161
+ }), s = D.config.result, p = e.data || { [s.list]: e };
1162
+ let c = (Array.isArray(p[s.list]), p[s.list]);
1163
+ const g = t.update.formColumn.flat(), n = JSONUtil.cp(c).map((d) => (Object.keys(d).forEach((w) => {
1164
+ const F = g.find((B) => B.item.key === w);
1165
+ F && ["select", "radio"].includes(F.item.type) && (F.item.table.format || (F.item.table.format = (B) => F.item.options[F.item.type].data?.find((R) => R.value == B[w])?.label || B[w]));
1166
+ }), d));
1167
+ t.table.data = r.option.data ? await r.option.data(n, c) : n, t.page.total = p[s.total] || 0;
1168
+ } catch (l) {
1169
+ console.error(l);
1088
1170
  } finally {
1089
- e.table.loading = !1;
1171
+ t.table.loading = !1;
1090
1172
  }
1091
1173
  },
1092
1174
  /** 表格多选相关配置 */
@@ -1095,7 +1177,7 @@ const K = D.EDialog, Oe = (n) => {
1095
1177
  list: [],
1096
1178
  /** 选中状态回调 */
1097
1179
  change: (i) => {
1098
- e.table.selection.list = i;
1180
+ t.table.selection.list = i;
1099
1181
  }
1100
1182
  },
1101
1183
  /** 表格排序相关配置 */
@@ -1106,13 +1188,13 @@ const K = D.EDialog, Oe = (n) => {
1106
1188
  order: "",
1107
1189
  /** 排序变更回调 */
1108
1190
  change: (i) => {
1109
- z.config.table.sort.resetPage && (e.page.num = 1);
1110
- const t = z.config.table.sort;
1111
- if (t.change) {
1112
- t.change(i, e);
1191
+ D.config.table.sort.resetPage && (t.page.num = 1);
1192
+ const l = D.config.table.sort;
1193
+ if (l.change) {
1194
+ l.change(i, t);
1113
1195
  return;
1114
1196
  }
1115
- e.table.sort.prop = i.prop, i.order === null ? e.table.sort.order = "" : e.table.sort.order = i.order === "ascending" ? t.order.asc : t.order.desc, e.table.getList();
1197
+ t.table.sort.prop = i.prop, i.order === null ? t.table.sort.order = "" : t.table.sort.order = i.order === "ascending" ? l.order.asc : l.order.desc, t.table.getList();
1116
1198
  }
1117
1199
  }
1118
1200
  },
@@ -1122,46 +1204,46 @@ const K = D.EDialog, Oe = (n) => {
1122
1204
  run: {
1123
1205
  /** 执行指定方式的导出(如select、page、all) */
1124
1206
  start: async (i) => {
1125
- let t = await e.export.run[i](), a = n.option.column;
1126
- const r = JSONUtil.cp({
1127
- data: t,
1128
- columns: a
1129
- }), c = n.option.tools?.export || {};
1130
- c.before && c.before(r), $e.exportToExcel(r.data, r.columns, c.fileName);
1207
+ let l = await t.export.run[i](), e = r.option.column;
1208
+ const s = JSONUtil.cp({
1209
+ data: l,
1210
+ columns: e
1211
+ }), p = r.option.tools?.export || {};
1212
+ p.before && p.before(s), Fe.exportToExcel(s.data, s.columns, p.fileName);
1131
1213
  },
1132
1214
  /** 获取当前选中项进行导出 */
1133
1215
  select: () => {
1134
- if (e.table.selection.list.length === 0)
1135
- throw D.fail(g.tCurd("selectDataToExport")), new Error(g.tCurd("selectDataToExport"));
1136
- return e.table.selection.list;
1216
+ if (t.table.selection.list.length === 0)
1217
+ throw U.fail(b.tCurd("selectDataToExport")), new Error(b.tCurd("selectDataToExport"));
1218
+ return t.table.selection.list;
1137
1219
  },
1138
1220
  /** 导出当前页的数据 */
1139
1221
  page: () => {
1140
- if (e.table.data.length === 0)
1141
- throw D.fail(g.tCurd("noData")), new Error(g.tCurd("noData"));
1142
- return e.table.data;
1222
+ if (t.table.data.length === 0)
1223
+ throw U.fail(b.tCurd("noData")), new Error(b.tCurd("noData"));
1224
+ return t.table.data;
1143
1225
  },
1144
1226
  /** 导出所有数据 */
1145
1227
  all: async () => {
1146
- e.export.loading = !0;
1228
+ t.export.loading = !0;
1147
1229
  try {
1148
- if (n.option.tools?.export?.all) {
1149
- await n.option.tools?.export?.all({
1150
- [z.config.page.size]: e.page.size,
1151
- [z.config.page.num]: e.page.num,
1152
- ...e.search.getFormData()
1230
+ if (r.option.tools?.export?.all) {
1231
+ await r.option.tools?.export?.all({
1232
+ [D.config.page.size]: t.page.size,
1233
+ [D.config.page.num]: t.page.num,
1234
+ ...t.search.getFormData()
1153
1235
  });
1154
1236
  return;
1155
1237
  }
1156
- const i = n.option.api.list, t = await i({
1157
- [z.config.page.size]: 999999,
1158
- [z.config.page.num]: 1
1238
+ const i = r.option.api.list, l = await i({
1239
+ [D.config.page.size]: 999999,
1240
+ [D.config.page.num]: 1
1159
1241
  });
1160
- return (t.data || { [z.config.result.list]: t })[z.config.result.list];
1242
+ return (l.data || { [D.config.result.list]: l })[D.config.result.list];
1161
1243
  } catch (i) {
1162
1244
  console.error(i);
1163
1245
  } finally {
1164
- e.export.loading = !1;
1246
+ t.export.loading = !1;
1165
1247
  }
1166
1248
  }
1167
1249
  },
@@ -1169,7 +1251,7 @@ const K = D.EDialog, Oe = (n) => {
1169
1251
  loading: !1,
1170
1252
  /** 执行导出操作的触发函数 */
1171
1253
  click: (i) => {
1172
- e.export.loading || e.export.run.start(i);
1254
+ t.export.loading || t.export.run.start(i);
1173
1255
  }
1174
1256
  },
1175
1257
  /** 表单增删改弹窗相关对象 */
@@ -1185,7 +1267,7 @@ const K = D.EDialog, Oe = (n) => {
1185
1267
  /** 弹窗loading */
1186
1268
  loading: !1,
1187
1269
  /** 当前操作类型,插入或修改 */
1188
- type: K.Insert,
1270
+ type: I.Add,
1189
1271
  /** 当前操作表单数据 */
1190
1272
  form: {},
1191
1273
  /** 表单默认值 */
@@ -1193,122 +1275,117 @@ const K = D.EDialog, Oe = (n) => {
1193
1275
  /** 表单所有列,二维数组结构按行分组 */
1194
1276
  formColumn: [],
1195
1277
  /** 判断是否禁用当前字段 */
1196
- getDisabled: (i) => e.update.type === K.View ? i.disabled?.view === void 0 ? !0 : i.disabled?.view : i.disabled?.[e.update.type === K.Insert ? "create" : "update"],
1278
+ getDisabled: (i) => t.update.type === I.View ? i.disabled?.view === void 0 ? !0 : i.disabled?.view : i.disabled?.[t.update.type === I.Add ? "create" : "update"],
1279
+ /** 获取表单组件绑定属性 */
1280
+ getBind: (i) => i.options?.[t.update.type === I.Add ? "formAdd" : "formUpdate"]?.[i.type] || i.options?.[i.type] || {},
1281
+ /** 获取表单组件事件属性 */
1282
+ getOn: (i) => i.options?.[t.update.type === I.Add ? "formAdd" : "formUpdate"]?.[i.type]?.on || i.options?.[i.type]?.on || {},
1283
+ /** 获取表单组件绑定属性和事件 */
1284
+ getBindOnByKey: (i) => {
1285
+ try {
1286
+ const e = t.update.formColumn.flat().find((s) => s.item.key === i)?.item;
1287
+ return e ? {
1288
+ bind: t.update.getBind(e),
1289
+ on: t.update.getOn(e)
1290
+ } : { bind: {}, on: {} };
1291
+ } catch {
1292
+ return { bind: {}, on: {} };
1293
+ }
1294
+ },
1197
1295
  /** 编辑相关数据与方法 */
1198
1296
  edit: {
1199
1297
  /** 当前编辑的数据原始项对象 */
1200
1298
  data: {},
1201
1299
  /** 返回编辑时与原值的变更数据,用于局部更新API */
1202
1300
  getApiData: (i) => {
1203
- if (n.option.form?.editAll)
1301
+ if (r.option.form?.editAll)
1204
1302
  return i;
1205
- let t = {
1206
- [n.option.table?.rowKey]: e.update.edit.data[n.option.table?.rowKey]
1303
+ let l = {
1304
+ [r.option.table?.rowKey]: t.update.edit.data[r.option.table?.rowKey]
1207
1305
  };
1208
- return Object.keys(e.update.edit.data).forEach((a) => {
1209
- i[a] !== e.update.edit.data[a] && (t[a] = i[a]);
1210
- }), t;
1306
+ return Object.keys(t.update.edit.data).forEach((e) => {
1307
+ i[e] !== t.update.edit.data[e] && (l[e] = i[e]);
1308
+ }), l;
1211
1309
  }
1212
1310
  },
1213
1311
  view: {},
1214
1312
  /** 打开增改弹窗 */
1215
- open: (i, t) => {
1216
- e.update.showContent || FunUtil.throttle(async () => {
1217
- D.loading(!0);
1313
+ open: (i, l) => {
1314
+ t.update.showContent || FunUtil.throttle(async () => {
1315
+ U.loading(!0);
1218
1316
  try {
1219
- await e.initApiData("update");
1220
- const a = i === K.Insert;
1221
- if (!a && n.option.table?.inlineEdit) {
1222
- e.inlineEdit.open(t);
1317
+ t.update.type = i, await t.initApiData("update");
1318
+ const e = i === I.Add;
1319
+ if (!e && r.option.table?.inlineEdit) {
1320
+ t.inlineEdit.open(l);
1223
1321
  return;
1224
1322
  }
1225
- e.update.type = i, e.update.edit.data = t, e.update.title = g.tCurd(a ? "add" : i === K.View ? "view" : "edit"), e.update.form = JSONUtil.cp(a ? e.update.formDefault : t), await n.option.form?.openBefore?.(t, e.update), e.update.show = !0, e.update.showContent = !0, n.option.form?.openAfter?.(t, e.update);
1226
- } catch (a) {
1227
- console.error(a);
1323
+ t.update.edit.data = l, t.update.title = b.tCurd(e ? "add" : i === I.View ? "view" : "edit"), t.update.form = JSONUtil.cp(e ? t.update.formDefault : l), await r.option.form?.openBefore?.(l, t.update), t.inlineEdit.data || (t.update.show = !0), t.update.showContent = !0, r.option.form?.openAfter?.(l, t.update);
1324
+ } catch (e) {
1325
+ console.error(e);
1228
1326
  } finally {
1229
- D.loading(!1);
1327
+ U.loading(!1);
1230
1328
  }
1231
1329
  });
1232
1330
  },
1233
1331
  /** 提交增改表单操作 */
1234
1332
  submit: () => {
1235
1333
  FunUtil.throttle(async () => {
1236
- await d.value?.validate(async (r, c) => new Promise((m, u) => {
1237
- r || (D.fail(g.tCurd("checkFormData")), u(!1)), m();
1238
- })), e.update.loading = !0;
1239
- const i = e.update.type === K.Insert ? n.option.api.create : n.option.api.update;
1334
+ await u.value?.validate(async (s, p) => new Promise((c, g) => {
1335
+ s || (U.fail(b.tCurd("checkFormData")), g(!1)), c();
1336
+ })), t.update.loading = !0;
1337
+ const i = t.update.type === I.Add ? r.option.api.create : r.option.api.update;
1240
1338
  try {
1241
- await n.option.form?.submitBefore?.(e.update.form, e.update);
1339
+ await r.option.form?.submitBefore?.(t.update.form, t.update);
1242
1340
  } catch {
1243
- e.update.loading = !1;
1341
+ t.update.loading = !1;
1244
1342
  return;
1245
1343
  }
1246
- let t = JSONUtil.cp(e.update.form);
1247
- delete t.children;
1248
- const a = new Set(n.option.column.filter((r) => r.type === "datetime").map((r) => r.key));
1249
- Object.keys(t).forEach((r) => {
1250
- if (a.has(r) && t[r] != null) {
1251
- const c = new Date(t[r]).getTime();
1252
- isNaN(c) || (t[r] = c);
1344
+ let l = JSONUtil.cp(t.update.form);
1345
+ delete l.children;
1346
+ const e = new Set(r.option.column.filter((s) => s.type === "datetime").map((s) => s.key));
1347
+ Object.keys(l).forEach((s) => {
1348
+ if (e.has(s) && l[s] != null) {
1349
+ const p = new Date(l[s]).getTime();
1350
+ isNaN(p) || (l[s] = p);
1253
1351
  }
1254
1352
  });
1255
1353
  try {
1256
1354
  if (!i) return;
1257
1355
  await i({
1258
- ...t
1259
- }), e.update.close(), await e.table.getList(), n.option.form?.submitAfter?.(t, e.update);
1260
- } catch (r) {
1261
- console.error(r);
1356
+ ...l
1357
+ }), t.update.close(), await t.table.getList(), r.option.form?.submitAfter?.(l, t.update);
1358
+ } catch (s) {
1359
+ console.error(s);
1262
1360
  } finally {
1263
- e.update.loading = !1;
1361
+ t.update.loading = !1;
1264
1362
  }
1265
1363
  });
1266
1364
  },
1267
1365
  /** 关闭弹窗和内容 */
1268
1366
  close: () => {
1269
- e.update.show = !1, setTimeout(() => {
1270
- e.update.showContent = !1;
1367
+ t.update.show = !1, setTimeout(() => {
1368
+ t.update.showContent = !1;
1271
1369
  }, 350);
1272
1370
  }
1273
1371
  },
1274
1372
  /** 行内编辑相关对象 */
1275
1373
  inlineEdit: {
1276
1374
  /** 行内编辑当前行对象 */
1277
- row: null,
1278
- /** 行内编辑表单数据副本 */
1279
- form: {},
1280
- /** 行内编辑loading */
1281
- loading: !1,
1375
+ data: null,
1282
1376
  /** 打开行内编辑 */
1283
1377
  open: (i) => {
1284
- e.inlineEdit.row = i, e.inlineEdit.form = JSONUtil.cp(i);
1378
+ t.inlineEdit.data = i, t.update.open(I.Update, i);
1285
1379
  },
1286
1380
  /** 关闭行内编辑 */
1287
1381
  close: () => {
1288
- e.inlineEdit.row = null, e.inlineEdit.form = {};
1289
- },
1290
- /** 行内保存提交 */
1291
- submit: () => {
1292
- FunUtil.throttle(async () => {
1293
- e.inlineEdit.loading = !0;
1294
- const i = n.option.api.update;
1295
- let t = JSONUtil.cp(e.inlineEdit.form);
1296
- delete t.children;
1297
- try {
1298
- if (!i) return;
1299
- await i({ ...t }), e.inlineEdit.close(), await e.table.getList(), D.success(g.tCurd("operationSuccess"));
1300
- } catch (a) {
1301
- console.error(a);
1302
- } finally {
1303
- e.inlineEdit.loading = !1;
1304
- }
1305
- });
1382
+ t.inlineEdit.data = null, t.update.close();
1306
1383
  }
1307
1384
  },
1308
1385
  /** 删除操作弹窗与数据对象 */
1309
1386
  remove: {
1310
1387
  /** 删除弹窗标题 */
1311
- title: g.tCurd("confirmDelete"),
1388
+ title: b.tCurd("confirmDelete"),
1312
1389
  /** 删除弹窗显示控制 */
1313
1390
  show: !1,
1314
1391
  /** 待删除数据项集合 */
@@ -1317,74 +1394,74 @@ const K = D.EDialog, Oe = (n) => {
1317
1394
  loading: !1,
1318
1395
  /** 关闭删除弹窗 */
1319
1396
  close: () => {
1320
- e.remove.show = !1;
1397
+ t.remove.show = !1;
1321
1398
  },
1322
1399
  /** 打开删除弹窗并设置待删除项 */
1323
1400
  open: (i) => {
1324
1401
  if (i.length === 0) {
1325
- D.fail(g.tCurd("selectDataToDelete"));
1402
+ U.fail(b.tCurd("selectDataToDelete"));
1326
1403
  return;
1327
1404
  }
1328
- e.remove.items = i, e.remove.show = !0;
1405
+ t.remove.items = i, t.remove.show = !0;
1329
1406
  },
1330
1407
  /** 执行删除实际操作 */
1331
1408
  submit: () => {
1332
1409
  FunUtil.throttle(async () => {
1333
- e.remove.loading = !0;
1334
- const i = n.option.api.delete;
1410
+ t.remove.loading = !0;
1411
+ const i = r.option.api.delete;
1335
1412
  try {
1336
1413
  if (!i) return;
1337
1414
  await i({
1338
- [n.option.table?.rowKey]: e.remove.items.map((t) => t[n.option.table?.rowKey]),
1339
- items: e.remove.items
1340
- }), D.success(g.tCurd("operationSuccess")), e.table.data.length <= 1 && e.page.num > 1 && (e.page.num -= 1), e.remove.close(), await e.table.getList();
1341
- } catch (t) {
1342
- console.error(t);
1415
+ [r.option.table?.rowKey]: t.remove.items.map((l) => l[r.option.table?.rowKey]),
1416
+ items: t.remove.items
1417
+ }), U.success(b.tCurd("operationSuccess")), t.table.data.length <= 1 && t.page.num > 1 && (t.page.num -= 1), t.remove.close(), await t.table.getList();
1418
+ } catch (l) {
1419
+ console.error(l);
1343
1420
  } finally {
1344
- e.remove.loading = !1;
1421
+ t.remove.loading = !1;
1345
1422
  }
1346
1423
  });
1347
1424
  }
1348
1425
  },
1349
1426
  /** 初始化curd关联所有默认与依赖配置及表单列 */
1350
1427
  init: () => {
1351
- e.initCurdConfig(), e.initColumnOptions(), e.initColumnForm();
1428
+ t.initCurdConfig(), t.initColumnOptions(), t.initColumnForm();
1352
1429
  },
1353
1430
  /** 下拉请求等数据缓存 */
1354
1431
  apiDataMap: {},
1355
1432
  /** 获取并绑定curd中所有下拉数据等远程依赖 */
1356
1433
  initApiData: async (i) => {
1357
- const t = [], a = (r) => {
1358
- if (r.children && r.children.length) {
1359
- r.children.forEach((c) => a(c));
1434
+ const l = [], e = (s) => {
1435
+ if (s.children && s.children.length) {
1436
+ s.children.forEach((p) => e(p));
1360
1437
  return;
1361
1438
  }
1362
- if (r.type === "select" && r.options?.select?.dataApi && r.options?.select?.dataApiConfig?.[i]) {
1363
- if (e.apiDataMap[r.key] && r.options?.select?.dataApiConfig?.once) return;
1364
- const c = (async () => {
1439
+ if (["select", "radio"].includes(s.type) && s.options?.[s.type]?.dataApi && s.options?.[s.type]?.dataApiConfig?.[i]) {
1440
+ if (t.apiDataMap[s.key] && s.options?.[s.type]?.dataApiConfig?.once) return;
1441
+ const p = (async () => {
1365
1442
  try {
1366
- let m = await r.options?.select?.dataApi?.();
1367
- if (m) {
1368
- const u = r.options?.select?.dataPath;
1369
- u && (m = ObjectUtil.getPathValue(m, u)), r.options.select.data = m, e.apiDataMap[r.key] = m;
1443
+ let c = await s.options?.[s.type]?.dataApi?.(t.update.form, i);
1444
+ if (c) {
1445
+ const g = s.options?.[s.type]?.dataPath;
1446
+ g && (c = ObjectUtil.getPathValue(c, g)), s.options[s.type].data = c, t.apiDataMap[s.key] = c;
1370
1447
  }
1371
1448
  } catch {
1372
1449
  }
1373
1450
  })();
1374
- t.push(c);
1451
+ l.push(p);
1375
1452
  }
1376
1453
  };
1377
- return n.option.column.forEach((r) => {
1378
- a(r);
1379
- }), await Promise.all(t), !0;
1454
+ return r.option.column.forEach((s) => {
1455
+ e(s);
1456
+ }), await Promise.all(l), !0;
1380
1457
  },
1381
1458
  /** 初始化curd配置(option默认值合并等) */
1382
1459
  initCurdConfig: () => {
1383
- const i = JSONUtil.cp(z.config);
1384
- i.table.emptyText = g.tCurd("noData"), n.option.size = n.option.size || {}, i.table.size = n.option.size.table || i.size.table, i.form.size = n.option.size.form || i.size.form, i.size.search = n.option.size.search || i.size.search;
1385
- const t = ObjectUtil.deepMerge(i, n.option || {});
1386
- Object.keys(t).forEach((a) => {
1387
- n.option[a] = t[a];
1460
+ const i = JSONUtil.cp(D.config);
1461
+ i.table.emptyText = b.tCurd("noData"), r.option.size = r.option.size || {}, i.table.size = r.option.size.table || i.size.table, i.form.size = r.option.size.form || i.size.form, i.size.search = r.option.size.search || i.size.search;
1462
+ const l = ObjectUtil.deepMerge(i, r.option || {});
1463
+ Object.keys(l).forEach((e) => {
1464
+ r.option[e] = l[e];
1388
1465
  });
1389
1466
  },
1390
1467
  /**
@@ -1393,153 +1470,155 @@ const K = D.EDialog, Oe = (n) => {
1393
1470
  * @returns
1394
1471
  */
1395
1472
  initColumnOptions: () => {
1396
- let i = JSONUtil.cp(z.config.columnConfig);
1473
+ let i = JSONUtil.cp(D.config.columnConfig);
1397
1474
  i.options = ObjectUtil.deepMerge(i.options, {
1398
1475
  switch: {
1399
- activeLabel: g.tCurd("switchOn"),
1400
- inactiveLabel: g.tCurd("switchOff")
1476
+ activeLabel: b.tCurd("switchOn"),
1477
+ inactiveLabel: b.tCurd("switchOff")
1401
1478
  }
1402
1479
  });
1403
- const t = (a) => {
1404
- for (const r in i) {
1405
- if (r === "table") {
1406
- if (a.table = ObjectUtil.deepMerge(i.table, a.table || {}), a.children) {
1407
- a.children.forEach((c) => {
1408
- t(c);
1480
+ const l = (e) => {
1481
+ for (const s in i) {
1482
+ if (s === "table") {
1483
+ if (e.table = ObjectUtil.deepMerge(i.table, e.table || {}), e.children) {
1484
+ e.children.forEach((c) => {
1485
+ l(c);
1409
1486
  });
1410
1487
  return;
1411
1488
  }
1412
- } else r === "type" ? a.type = a.type || i.type : a[r] = ObjectUtil.deepMerge(i[r], a[r] || {});
1413
- a.options = a.options || {}, a.options[a.type] = a.options[a.type] || {}, a.options[a.type].size = n.option.size.form, a.options.search = a.options.search || JSONUtil.cp(a.options), a.options.search[a.type] = a.options.search[a.type] || {}, a.options.search[a.type].size = n.option.size.search, a.table = ObjectUtil.deepMerge(a.table, a.options[a.type].table || {});
1489
+ } else s === "type" ? e.type = e.type || i.type : e[s] = ObjectUtil.deepMerge(i[s], e[s] || {});
1490
+ e.options = e.options || {}, e.options[e.type] = e.options[e.type] || {}, e.options[e.type].size = r.option.size.form, ["search", "formAdd", "formUpdate"].forEach((c) => {
1491
+ e.options[c] = e.options[c] || JSONUtil.cp(e.options), e.options[c][e.type] = e.options[c][e.type] || {}, e.options[c][e.type].size = c === "search" ? r.option.size.search : r.option.size.form;
1492
+ }), e.table = ObjectUtil.deepMerge(e.table, e.options[e.type].table || {});
1414
1493
  }
1415
- a.type === "switch" && (a.options.switch.tableBeforeChange = async (r, c) => {
1416
- const m = a.options?.switch;
1494
+ e.type === "switch" && (e.options.switch.tableBeforeChange = async (s, p) => {
1495
+ const c = e.options?.switch;
1417
1496
  try {
1418
- await l.value?.open({
1419
- title: g.tCurd("confirmModify"),
1420
- content: g.tCurd("confirmSwitchMessage")
1421
- }), e.table.loading = !0;
1497
+ await o.value?.open({
1498
+ title: b.tCurd("confirmModify"),
1499
+ content: b.tCurd("confirmSwitchMessage")
1500
+ }), t.table.loading = !0;
1422
1501
  try {
1423
- return n.option.api.update ? (await n.option.api.update({
1424
- [n.option.table?.rowKey]: c[n.option.table?.rowKey],
1425
- [r]: c[r] === m.activeValue ? m.inactiveValue : m.activeValue,
1426
- final(u, s, p) {
1427
- e.table.loading = !1;
1502
+ return r.option.api.update ? (await r.option.api.update({
1503
+ [r.option.table?.rowKey]: p[r.option.table?.rowKey],
1504
+ [s]: p[s] === c.activeValue ? c.inactiveValue : c.activeValue,
1505
+ final(g, n, d) {
1506
+ t.table.loading = !1;
1428
1507
  }
1429
- }), e.table.loading = !1, D.success(g.tCurd("operationSuccess")), e.table.getList(), !0) : void 0;
1430
- } catch (u) {
1431
- return console.error(u), !1;
1508
+ }), t.table.loading = !1, U.success(b.tCurd("operationSuccess")), t.table.getList(), !0) : void 0;
1509
+ } catch (g) {
1510
+ return console.error(g), !1;
1432
1511
  } finally {
1433
- e.table.loading = !1;
1512
+ t.table.loading = !1;
1434
1513
  }
1435
1514
  } catch {
1436
1515
  return !1;
1437
1516
  }
1438
- }), a.type === "treeSelect" && (a.options.treeSelect.rowKey = n.option.table?.rowKey, a.options.treeSelect.nodeKey = n.option.table?.rowKey);
1517
+ }), e.type === "treeSelect" && (e.options.treeSelect.rowKey = r.option.table?.rowKey, e.options.treeSelect.nodeKey = r.option.table?.rowKey);
1439
1518
  };
1440
- n.option.column.forEach(t), n.option.table?.column?.forEach(t);
1519
+ r.option.column.forEach(l), r.option.table?.column?.forEach(l);
1441
1520
  },
1442
- getColumnSpan: (i, t) => {
1521
+ getColumnSpan: (i, l) => {
1443
1522
  if (i.item.form?.spanCol) {
1444
- const a = z.config.form.defaultSpan, c = t.filter((m) => !D.isFun(m.item.show?.form, e.update.form, e.update.type)).reduce((m, u) => m + (u.item.form?.span || a), 0);
1445
- return (i.item?.form.span || a) + c;
1523
+ const e = D.config.form.defaultSpan, p = l.filter((c) => !U.isFun(c.item.show?.form, t.update.form, t.update.type)).reduce((c, g) => c + (g.item.form?.span || e), 0);
1524
+ return (i.item?.form.span || e) + p;
1446
1525
  }
1447
1526
  return i.item.form.span;
1448
1527
  },
1449
1528
  /** 初始化配置并生成表单列及默认值及规则 */
1450
1529
  initColumnForm: () => {
1451
- const i = n.option;
1452
- e.update.formColumn = [], e.table.column.show = {
1530
+ const i = r.option;
1531
+ t.update.formColumn = [], t.table.column.show = {
1453
1532
  list: [],
1454
1533
  listSource: []
1455
1534
  };
1456
- const t = [], a = n.option.form?.maxSpan || 12, r = n.option.form?.defaultSpan || a / 2;
1457
- let c = [];
1458
- const m = (p) => {
1459
- if (p.children) {
1460
- e.table.column.show.list.push(p.key), p.children.forEach((y) => {
1461
- m(y);
1535
+ const l = [], e = r.option.form?.maxSpan || 12, s = r.option.form?.defaultSpan || e / 2;
1536
+ let p = [];
1537
+ const c = (d) => {
1538
+ if (d.children) {
1539
+ t.table.column.show.list.push(d.key), d.children.forEach((V) => {
1540
+ c(V);
1462
1541
  });
1463
1542
  return;
1464
1543
  }
1465
- if (e.update.formDefault[p.key] = p.value, p.table.table && (p.show.table && e.table.column.show.list.push(p.key), p.table.table && e.table.column.show.listSource.push(p.key)), !(p.isForm && typeof p.show?.form == "boolean") || p.show?.form) {
1466
- p.form = p.form || { span: r }, p.form.span = p.form.span ?? r;
1467
- let y = p.form.span, I = c.reduce((T, A) => T + A.span, y);
1468
- const M = c.length;
1469
- if (c.push({ item: p, span: y }), (M === 1 && c[0].span === 0 || I >= a || y === 0 && M > 1) && (t.push(c), c = []), p.rules) {
1470
- const T = {
1471
- input: g.tCurd("placeholderInput"),
1472
- select: g.tCurd("placeholderSelect")
1473
- }, A = (T[p.type] || T.input) + p.label;
1474
- e.update.rules[p.key] = typeof p.rules == "boolean" ? [
1544
+ if (t.update.formDefault[d.key] = d.value, d.table.table && (d.show.table && t.table.column.show.list.push(d.key), d.table.table && t.table.column.show.listSource.push(d.key)), !(d.isForm && typeof d.show?.form == "boolean") || d.show?.form) {
1545
+ d.form = d.form || { span: s }, d.form.span = d.form.span ?? s;
1546
+ let V = d.form.span, w = p.reduce((B, R) => B + R.span, V);
1547
+ const F = p.length;
1548
+ if (p.push({ item: d, span: V }), (F === 1 && p[0].span === 0 || w >= e || V === 0 && F > 1) && (l.push(p), p = []), d.rules) {
1549
+ const B = {
1550
+ input: b.tCurd("placeholderInput"),
1551
+ select: b.tCurd("placeholderSelect")
1552
+ }, R = (B[d.type] || B.input) + d.label;
1553
+ t.update.rules[d.key] = typeof d.rules == "boolean" ? [
1475
1554
  {
1476
1555
  required: !0,
1477
- message: A,
1556
+ message: R,
1478
1557
  trigger: "blur"
1479
1558
  }
1480
- ] : p.rules;
1559
+ ] : d.rules;
1481
1560
  }
1482
1561
  }
1483
- }, u = (p, y) => {
1484
- p.isForm = y, Array.isArray(p.children) && p.children.forEach((I) => u(I, y));
1562
+ }, g = (d, V) => {
1563
+ d.isForm = V, Array.isArray(d.children) && d.children.forEach((w) => g(w, V));
1485
1564
  };
1486
- i.column.forEach((p) => {
1487
- p.isForm = !0, u(p, !0), m(p);
1488
- }), n.option.table?.column?.forEach((p) => {
1489
- u(p, !1), m(p);
1490
- }), e.search.column.list = i.column.concat(i.table?.column || []), e.table.column.list = e.search.column.list.filter((p) => p.table?.table), e.search.column.list.sort((p, y) => p.sort?.search - y.sort?.search), e.table.column.list.sort((p, y) => p.sort?.table - y.sort?.table), c.length > 0 && t.push(c), e.update.formColumn = t;
1491
- const s = n.option.search?.formDefault;
1492
- s && Object.keys(s).forEach((p) => {
1493
- e.search.formDefault[p] = s[p];
1494
- }), i.column.forEach((p) => {
1495
- p.show?.search || (e.search.formDefault[p.key] = void 0);
1496
- }), e.search.form = JSONUtil.cp(e.search.formDefault);
1565
+ i.column.forEach((d) => {
1566
+ d.isForm = !0, g(d, !0), c(d);
1567
+ }), r.option.table?.column?.forEach((d) => {
1568
+ g(d, !1), c(d);
1569
+ }), t.search.column.list = i.column.concat(i.table?.column || []), t.table.column.list = t.search.column.list.filter((d) => d.table?.table), t.search.column.list.sort((d, V) => d.sort?.search - V.sort?.search), t.table.column.list.sort((d, V) => d.sort?.table - V.sort?.table), p.length > 0 && l.push(p), t.update.formColumn = l;
1570
+ const n = r.option.search?.formDefault;
1571
+ n && Object.keys(n).forEach((d) => {
1572
+ t.search.formDefault[d] = n[d];
1573
+ }), i.column.forEach((d) => {
1574
+ d.show?.search || (t.search.formDefault[d.key] = void 0);
1575
+ }), t.search.form = JSONUtil.cp(t.search.formDefault);
1497
1576
  }
1498
1577
  });
1499
- return e.init(), ne(() => {
1500
- n.option.init !== !1 && e.table.getList();
1501
- }), { conf: e, switchConfirmRef: l, ruleFormRef: d };
1502
- }, Fe = { class: "dialog-footer" }, Le = /* @__PURE__ */ H({
1578
+ return t.init(), ue(() => {
1579
+ r.option.init !== !1 && t.table.getList();
1580
+ }), { conf: t, switchConfirmRef: o, ruleFormRef: u };
1581
+ }, Ae = { class: "dialog-footer" }, Le = /* @__PURE__ */ J({
1503
1582
  __name: "switchConfirm",
1504
1583
  props: {
1505
1584
  size: {}
1506
1585
  },
1507
- setup(n, { expose: l }) {
1508
- const d = J(!1), e = J("确认修改"), i = J("确认要修改状态吗?");
1509
- let t = null, a = null;
1510
- const r = (u) => (u?.title && (e.value = u.title), u?.content && (i.value = u.content), d.value = !0, new Promise((s, p) => {
1511
- t = s, a = p;
1512
- })), c = () => {
1513
- d.value = !1, t?.(!0), t = null, a = null;
1514
- }, m = () => {
1515
- d.value = !1, a?.(new Error("用户取消操作")), t = null, a = null;
1586
+ setup(r, { expose: o }) {
1587
+ const u = H(!1), t = H("确认修改"), i = H("确认要修改状态吗?");
1588
+ let l = null, e = null;
1589
+ const s = (g) => (g?.title && (t.value = g.title), g?.content && (i.value = g.content), u.value = !0, new Promise((n, d) => {
1590
+ l = n, e = d;
1591
+ })), p = () => {
1592
+ u.value = !1, l?.(!0), l = null, e = null;
1593
+ }, c = () => {
1594
+ u.value = !1, e?.(new Error("用户取消操作")), l = null, e = null;
1516
1595
  };
1517
- return l({
1518
- open: r
1519
- }), (u, s) => {
1520
- const p = X("el-form");
1521
- return f(), b(o(Z), {
1522
- modelValue: d.value,
1523
- "onUpdate:modelValue": s[0] || (s[0] = (y) => d.value = y),
1524
- title: e.value,
1596
+ return o({
1597
+ open: s
1598
+ }), (g, n) => {
1599
+ const d = Q("el-form");
1600
+ return f(), h(a(_), {
1601
+ modelValue: u.value,
1602
+ "onUpdate:modelValue": n[0] || (n[0] = (V) => u.value = V),
1603
+ title: t.value,
1525
1604
  "close-on-click-modal": !1,
1526
1605
  width: "400px"
1527
1606
  }, {
1528
- footer: h(() => [
1529
- V(p, { size: u.size }, {
1530
- default: h(() => [
1531
- O("span", Fe, [
1532
- V(o(F), { onClick: m }, {
1533
- default: h(() => s[1] || (s[1] = [
1607
+ footer: m(() => [
1608
+ z(d, { size: g.size }, {
1609
+ default: m(() => [
1610
+ O("span", Ae, [
1611
+ z(a(A), { onClick: c }, {
1612
+ default: m(() => n[1] || (n[1] = [
1534
1613
  E("取消")
1535
1614
  ])),
1536
1615
  _: 1
1537
1616
  }),
1538
- V(o(F), {
1617
+ z(a(A), {
1539
1618
  type: "primary",
1540
- onClick: c
1619
+ onClick: p
1541
1620
  }, {
1542
- default: h(() => s[2] || (s[2] = [
1621
+ default: m(() => n[2] || (n[2] = [
1543
1622
  E("确认")
1544
1623
  ])),
1545
1624
  _: 1
@@ -1549,152 +1628,145 @@ const K = D.EDialog, Oe = (n) => {
1549
1628
  _: 1
1550
1629
  }, 8, ["size"])
1551
1630
  ]),
1552
- default: h(() => [
1553
- O("div", null, U(i.value), 1)
1631
+ default: m(() => [
1632
+ O("div", null, T(i.value), 1)
1554
1633
  ]),
1555
1634
  _: 1
1556
1635
  }, 8, ["modelValue", "title"]);
1557
1636
  };
1558
1637
  }
1559
- }), re = (n, l) => {
1560
- const d = n.__vccOpts || n;
1561
- for (const [e, i] of l)
1562
- d[e] = i;
1563
- return d;
1564
- }, Ie = {}, Me = {
1638
+ }), pe = (r, o) => {
1639
+ const u = r.__vccOpts || r;
1640
+ for (const [t, i] of o)
1641
+ u[t] = i;
1642
+ return u;
1643
+ }, Me = {}, Be = {
1565
1644
  xmlns: "http://www.w3.org/2000/svg",
1566
1645
  viewBox: "0 0 1024 1024"
1567
1646
  };
1568
- function Te(n, l) {
1569
- return f(), w("svg", Me, l[0] || (l[0] = [
1647
+ function je(r, o) {
1648
+ return f(), y("svg", Be, o[0] || (o[0] = [
1570
1649
  O("path", {
1571
1650
  fill: "currentColor",
1572
1651
  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"
1573
1652
  }, null, -1)
1574
1653
  ]));
1575
1654
  }
1576
- const je = /* @__PURE__ */ re(Ie, [["render", Te]]), Re = {}, Pe = {
1655
+ const Ie = /* @__PURE__ */ pe(Me, [["render", je]]), Re = {}, Pe = {
1577
1656
  "data-v-58697b5c": "",
1578
1657
  xmlns: "http://www.w3.org/2000/svg",
1579
1658
  viewBox: "0 0 1024 1024"
1580
1659
  };
1581
- function Ae(n, l) {
1582
- return f(), w("svg", Pe, l[0] || (l[0] = [
1660
+ function Ne(r, o) {
1661
+ return f(), y("svg", Pe, o[0] || (o[0] = [
1583
1662
  O("path", {
1584
1663
  fill: "currentColor",
1585
1664
  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"
1586
1665
  }, null, -1)
1587
1666
  ]));
1588
1667
  }
1589
- const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-center table-header-label inline" }, Be = { class: "table-header-tooltip" }, Je = ["onClick", "innerHTML"], He = /* @__PURE__ */ H({
1668
+ const Ke = /* @__PURE__ */ pe(Re, [["render", Ne]]), He = { class: "row flex-center table-header-label inline" }, Je = { class: "table-header-tooltip" }, We = ["onClick", "innerHTML"], qe = /* @__PURE__ */ J({
1590
1669
  __name: "tableColumn",
1591
1670
  props: {
1592
1671
  conf: {},
1593
1672
  columnList: {},
1594
1673
  option: {}
1595
1674
  },
1596
- setup(n) {
1597
- const l = D.isFun, d = ye().type;
1598
- return (e, i) => {
1599
- const t = X("el-tooltip");
1600
- return f(!0), w(S, null, L(e.columnList, (a) => (f(), w(S, {
1601
- key: a.key
1675
+ setup(r) {
1676
+ const o = U.isFun, u = ye().type;
1677
+ return (t, i) => {
1678
+ const l = Q("el-tooltip");
1679
+ return f(!0), y($, null, L(t.columnList, (e) => (f(), y($, {
1680
+ key: e.key
1602
1681
  }, [
1603
- e.conf.table.column.show.list.includes(a.key) ? (f(), b(o(x), v({
1682
+ t.conf.table.column.show.list.includes(e.key) ? (f(), h(a(ee), v({
1604
1683
  key: 0,
1605
- prop: a.key,
1606
- label: a.label,
1684
+ prop: e.key,
1685
+ label: e.label,
1607
1686
  ref_for: !0
1608
- }, a.table), {
1609
- header: h(() => [
1610
- k(e.$slots, "table-header-" + a.key, { item: a }, () => [
1611
- O("div", Ne, [
1612
- a.table?.tooltip ? (f(), b(t, {
1687
+ }, e.table), {
1688
+ header: m(() => [
1689
+ k(t.$slots, "table-header-" + e.key, { item: e }, () => [
1690
+ O("div", He, [
1691
+ e.table?.tooltip ? (f(), h(l, {
1613
1692
  key: 0,
1614
1693
  effect: "dark",
1615
- content: a.table?.tooltip,
1694
+ content: e.table?.tooltip,
1616
1695
  placement: "top"
1617
1696
  }, {
1618
- default: h(() => [
1619
- O("span", Be, [
1620
- V(Ke)
1697
+ default: m(() => [
1698
+ O("span", Je, [
1699
+ z(Ke)
1621
1700
  ])
1622
1701
  ]),
1623
1702
  _: 2
1624
1703
  }, 1032, ["content"])) : C("", !0),
1625
- E(" " + U(a.label), 1)
1704
+ E(" " + T(e.label), 1)
1626
1705
  ])
1627
1706
  ])
1628
1707
  ]),
1629
- default: h(({ row: r }) => [
1630
- a.children ? (f(), w(S, { key: 0 }, [
1708
+ default: m(({ row: s }) => [
1709
+ e.children ? (f(), y($, { key: 0 }, [
1631
1710
  i[0] || (i[0] = E("   ")),
1632
- (f(), b(q(o(d)), {
1633
- conf: e.conf,
1634
- columnList: a.children,
1635
- option: e.option
1636
- }, _({ _: 2 }, [
1637
- L(e.$slots, (c, m) => ({
1638
- name: m,
1639
- fn: h((u) => [
1640
- k(e.$slots, m, v({ ref_for: !0 }, u || {}))
1711
+ (f(), h(q(a(u)), {
1712
+ conf: t.conf,
1713
+ columnList: e.children,
1714
+ option: t.option
1715
+ }, te({ _: 2 }, [
1716
+ L(t.$slots, (p, c) => ({
1717
+ name: c,
1718
+ fn: m((g) => [
1719
+ k(t.$slots, c, v({ ref_for: !0 }, g || {}))
1641
1720
  ])
1642
1721
  }))
1643
1722
  ]), 1032, ["conf", "columnList", "option"]))
1644
- ], 64)) : (f(), w(S, { key: 1 }, [
1645
- o(l)(a.show?.form, e.conf.inlineEdit.form, o(D).EDialog.Update) && e.option.table?.inlineEdit && e.conf.inlineEdit.row === r && (a.type === "input" || a.type === "select") ? (f(), w(S, { key: 0 }, [
1646
- a.type === "input" ? (f(), b(o(Q), v({
1723
+ ], 64)) : (f(), y($, { key: 1 }, [
1724
+ a(o)(e.show?.form, t.conf.update.form, a(U).EDialog.Update) && t.option.table?.inlineEdit && t.conf.inlineEdit.data === s && (e.type === "input" || e.type === "select") ? (f(), y($, { key: 0 }, [
1725
+ e.type === "input" ? (f(), h(a(Y), v({
1647
1726
  key: 0,
1648
- modelValue: e.conf.inlineEdit.form[a.key],
1649
- "onUpdate:modelValue": (c) => e.conf.inlineEdit.form[a.key] = c,
1727
+ modelValue: t.conf.update.form[e.key],
1728
+ "onUpdate:modelValue": (p) => t.conf.update.form[e.key] = p,
1650
1729
  ref_for: !0
1651
- }, a.options?.input, {
1652
- size: "small",
1653
- style: { width: "100%" },
1654
- onKeyup: we(e.conf.inlineEdit.submit, ["enter"])
1655
- }), null, 16, ["modelValue", "onUpdate:modelValue", "onKeyup"])) : a.type === "select" ? (f(), b(o(W), v({
1730
+ }, t.conf.update.getBind(e), S(t.conf.update.getOn(e)), { style: { width: "100%" } }), null, 16, ["modelValue", "onUpdate:modelValue"])) : e.type === "select" ? (f(), h(a(W), v({
1656
1731
  key: 1,
1657
- modelValue: e.conf.inlineEdit.form[a.key],
1658
- "onUpdate:modelValue": (c) => e.conf.inlineEdit.form[a.key] = c,
1732
+ modelValue: t.conf.update.form[e.key],
1733
+ "onUpdate:modelValue": (p) => t.conf.update.form[e.key] = p,
1659
1734
  ref_for: !0
1660
- }, a.options?.select, {
1661
- size: "small",
1662
- style: { width: "100%" }
1663
- }), {
1664
- default: h(() => [
1665
- (f(!0), w(S, null, L(a.options?.select?.data, (c) => (f(), b(o(B), {
1666
- key: c.value,
1667
- label: c.label,
1668
- value: c.value
1735
+ }, t.conf.update.getBind(e), S(t.conf.update.getOn(e)), { style: { width: "100%" } }), {
1736
+ default: m(() => [
1737
+ (f(!0), y($, null, L(e.options?.select?.data, (p) => (f(), h(a(K), {
1738
+ key: p.value,
1739
+ label: p.label,
1740
+ value: p.value
1669
1741
  }, null, 8, ["label", "value"]))), 128))
1670
1742
  ]),
1671
1743
  _: 2
1672
1744
  }, 1040, ["modelValue", "onUpdate:modelValue"])) : C("", !0)
1673
- ], 64)) : k(e.$slots, "table-" + a.key, {
1745
+ ], 64)) : k(t.$slots, "table-" + e.key, {
1674
1746
  key: 1,
1675
- row: r,
1676
- item: a
1747
+ row: s,
1748
+ item: e
1677
1749
  }, () => [
1678
- o(j).customComponent[a.type ?? ""]?.table ? (f(), b(q(o(j).customComponent[a.type ?? ""]?.table), v({
1750
+ a(M).customComponent[e.type ?? ""]?.table ? (f(), h(q(a(M).customComponent[e.type ?? ""]?.table), v({
1679
1751
  key: 0,
1680
- modelValue: r[a.key],
1681
- "onUpdate:modelValue": (c) => r[a.key] = c,
1752
+ modelValue: s[e.key],
1753
+ "onUpdate:modelValue": (p) => s[e.key] = p,
1682
1754
  ref_for: !0
1683
- }, a.options?.[a.type ?? ""], $(a.options?.[a.type ?? ""]?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue"])) : a.type === "switch" ? (f(), b(o(ee), v({
1755
+ }, e.options?.[e.type ?? ""], S(e.options?.[e.type ?? ""]?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue"])) : e.type === "switch" ? (f(), h(a(oe), v({
1684
1756
  key: 1,
1685
- modelValue: r[a.key],
1686
- "onUpdate:modelValue": (c) => r[a.key] = c,
1687
- "before-change": () => a.options?.switch?.tableBeforeChange?.(a.key, r),
1757
+ modelValue: s[e.key],
1758
+ "onUpdate:modelValue": (p) => s[e.key] = p,
1759
+ "before-change": () => e.options?.switch?.tableBeforeChange?.(e.key, s),
1688
1760
  ref_for: !0
1689
- }, a.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "before-change"])) : (f(), w("span", {
1761
+ }, e.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "before-change"])) : (f(), y("span", {
1690
1762
  key: 2,
1691
- style: se({
1692
- "--table-text-click-color": a.table?.click?.color
1763
+ style: fe({
1764
+ "--table-text-click-color": e.table?.click?.color
1693
1765
  }),
1694
- class: R({ "table-text-click": a.table?.click?.callback }),
1695
- onClick: (c) => a.table?.click?.callback?.(r),
1696
- innerHTML: a.table?.format ? a.table?.format(r) : r[a.key]
1697
- }, null, 14, Je))
1766
+ class: j({ "table-text-click": e.table?.click?.callback }),
1767
+ onClick: (p) => e.table?.click?.callback?.(s),
1768
+ innerHTML: e.table?.format ? e.table?.format(s) : s[e.key]
1769
+ }, null, 14, We))
1698
1770
  ])
1699
1771
  ], 64))
1700
1772
  ]),
@@ -1703,143 +1775,143 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
1703
1775
  ], 64))), 128);
1704
1776
  };
1705
1777
  }
1706
- }), We = {
1778
+ }), Ge = {
1707
1779
  class: "row form-item-content",
1708
1780
  style: { width: "100%" }
1709
- }, qe = { class: "col" }, Ge = { class: "col" }, Xe = ["innerHTML"], Qe = /* @__PURE__ */ H({
1781
+ }, Xe = { class: "col" }, Qe = { class: "col" }, Ye = ["innerHTML"], Ze = /* @__PURE__ */ J({
1710
1782
  __name: "formColumn",
1711
1783
  props: {
1712
1784
  conf: {},
1713
1785
  item: {}
1714
1786
  },
1715
- setup(n) {
1716
- return (l, d) => (f(), b(o(G), {
1717
- class: R({
1718
- "hide-label": typeof l.item.item.text?.form?.label == "boolean" ? !l.item.item.text?.form?.label : !1
1787
+ setup(r) {
1788
+ return (o, u) => (f(), h(a(X), {
1789
+ class: j({
1790
+ "hide-label": typeof o.item.item.text?.form?.label == "boolean" ? !o.item.item.text?.form?.label : !1
1719
1791
  }),
1720
- label: typeof l.item.item.text?.form?.label == "string" ? l.item.item.text?.form?.label : l.item.item.label,
1721
- prop: l.item.item.key,
1722
- "label-width": l.item.item.form?.labelWidth || l.conf.option.form?.labelWidth
1792
+ label: typeof o.item.item.text?.form?.label == "string" ? o.item.item.text?.form?.label : o.item.item.label,
1793
+ prop: o.item.item.key,
1794
+ "label-width": o.item.item.form?.labelWidth || o.conf.option.form?.labelWidth
1723
1795
  }, {
1724
- default: h(() => [
1725
- O("div", We, [
1726
- k(l.$slots, "form-" + l.item.item.key + "-start", {
1727
- row: l.conf.update.form,
1728
- item: l.item.item
1796
+ default: m(() => [
1797
+ O("div", Ge, [
1798
+ k(o.$slots, "form-" + o.item.item.key + "-start", {
1799
+ row: o.conf.update.form,
1800
+ item: o.item.item
1729
1801
  }),
1730
- O("div", qe, [
1731
- O("div", Ge, [
1732
- k(l.$slots, "form-" + l.item.item.key, {
1733
- row: l.conf.update.form,
1734
- item: l.item.item
1802
+ O("div", Xe, [
1803
+ O("div", Qe, [
1804
+ k(o.$slots, "form-" + o.item.item.key, {
1805
+ row: o.conf.update.form,
1806
+ item: o.item.item
1735
1807
  }, () => [
1736
- l.item.item.type === "input" ? (f(), b(o(Q), v({
1808
+ o.item.item.type === "input" ? (f(), h(a(Y), v({
1737
1809
  key: 0,
1738
- modelValue: l.conf.update.form[l.item.item.key],
1739
- "onUpdate:modelValue": d[0] || (d[0] = (e) => l.conf.update.form[l.item.item.key] = e)
1740
- }, l.item.item.options?.input, $(l.item.item.options?.input?.on || {}), {
1741
- disabled: l.conf.update.getDisabled(l.item.item)
1742
- }), null, 16, ["modelValue", "disabled"])) : l.item.item.type === "switch" ? (f(), b(o(ee), v({
1810
+ modelValue: o.conf.update.form[o.item.item.key],
1811
+ "onUpdate:modelValue": u[0] || (u[0] = (t) => o.conf.update.form[o.item.item.key] = t)
1812
+ }, o.conf.update.getBind(o.item.item), S(o.conf.update.getOn(o.item.item)), {
1813
+ disabled: o.conf.update.getDisabled(o.item.item)
1814
+ }), null, 16, ["modelValue", "disabled"])) : o.item.item.type === "switch" ? (f(), h(a(oe), v({
1743
1815
  key: 1,
1744
- modelValue: l.conf.update.form[l.item.item.key],
1745
- "onUpdate:modelValue": d[1] || (d[1] = (e) => l.conf.update.form[l.item.item.key] = e)
1746
- }, l.item.item.options?.switch, {
1747
- disabled: l.conf.update.getDisabled(l.item.item)
1748
- }), null, 16, ["modelValue", "disabled"])) : l.item.item.type === "select" ? (f(), b(o(W), v({
1816
+ modelValue: o.conf.update.form[o.item.item.key],
1817
+ "onUpdate:modelValue": u[1] || (u[1] = (t) => o.conf.update.form[o.item.item.key] = t)
1818
+ }, o.conf.update.getBind(o.item.item), S(o.conf.update.getOn(o.item.item)), {
1819
+ disabled: o.conf.update.getDisabled(o.item.item)
1820
+ }), null, 16, ["modelValue", "disabled"])) : o.item.item.type === "select" ? (f(), h(a(W), v({
1749
1821
  key: 2,
1750
- modelValue: l.conf.update.form[l.item.item.key],
1751
- "onUpdate:modelValue": d[2] || (d[2] = (e) => l.conf.update.form[l.item.item.key] = e)
1752
- }, l.item.item.options?.select, $(l.item.item.options?.select?.on || {}), {
1753
- disabled: l.conf.update.getDisabled(l.item.item),
1822
+ modelValue: o.conf.update.form[o.item.item.key],
1823
+ "onUpdate:modelValue": u[2] || (u[2] = (t) => o.conf.update.form[o.item.item.key] = t)
1824
+ }, o.conf.update.getBind(o.item.item), S(o.conf.update.getOn(o.item.item)), {
1825
+ disabled: o.conf.update.getDisabled(o.item.item),
1754
1826
  style: { width: "100%" }
1755
1827
  }), {
1756
- default: h(() => [
1757
- (f(!0), w(S, null, L(l.item.item.options?.select?.data, (e) => (f(), b(o(B), {
1758
- key: e.value,
1759
- label: e.label,
1760
- value: e.value
1828
+ default: m(() => [
1829
+ (f(!0), y($, null, L(o.item.item.options?.select?.data, (t) => (f(), h(a(K), {
1830
+ key: t.value,
1831
+ label: t.label,
1832
+ value: t.value
1761
1833
  }, null, 8, ["label", "value"]))), 128))
1762
1834
  ]),
1763
1835
  _: 1
1764
- }, 16, ["modelValue", "disabled"])) : l.item.item.type === "radio" ? (f(), b(o(ce), v({
1836
+ }, 16, ["modelValue", "disabled"])) : o.item.item.type === "radio" ? (f(), h(a(re), v({
1765
1837
  key: 3,
1766
- modelValue: l.conf.update.form[l.item.item.key],
1767
- "onUpdate:modelValue": d[3] || (d[3] = (e) => l.conf.update.form[l.item.item.key] = e)
1768
- }, l.item.item.options?.radio, $(l.item.item.options?.radio?.on || {}), {
1769
- disabled: l.conf.update.getDisabled(l.item.item),
1838
+ modelValue: o.conf.update.form[o.item.item.key],
1839
+ "onUpdate:modelValue": u[3] || (u[3] = (t) => o.conf.update.form[o.item.item.key] = t)
1840
+ }, o.conf.update.getBind(o.item.item), S(o.conf.update.getOn(o.item.item)), {
1841
+ disabled: o.conf.update.getDisabled(o.item.item),
1770
1842
  style: { width: "100%" }
1771
1843
  }), {
1772
- default: h(() => [
1773
- (f(!0), w(S, null, L(l.item.item.options?.radio?.data, (e) => (f(), b(o(pe), {
1774
- key: e.value,
1775
- label: e.label,
1776
- value: e.value
1844
+ default: m(() => [
1845
+ (f(!0), y($, null, L(o.item.item.options?.radio?.data, (t) => (f(), h(a(se), {
1846
+ key: t.value,
1847
+ label: t.label,
1848
+ value: t.value
1777
1849
  }, null, 8, ["label", "value"]))), 128))
1778
1850
  ]),
1779
1851
  _: 1
1780
- }, 16, ["modelValue", "disabled"])) : l.item.item.type === "list" ? (f(), b(le, v({
1852
+ }, 16, ["modelValue", "disabled"])) : o.item.item.type === "list" ? (f(), h(ne, v({
1781
1853
  key: 4,
1782
- row: l.conf.update.form,
1783
- field: l.item.item.key
1784
- }, l.item.item.options?.list, $(l.item.item.options?.list?.on || {}), {
1785
- disabled: l.conf.update.getDisabled(l.item.item),
1854
+ row: o.conf.update.form,
1855
+ field: o.item.item.key
1856
+ }, o.conf.update.getBind(o.item.item), S(o.conf.update.getOn(o.item.item)), {
1857
+ disabled: o.conf.update.getDisabled(o.item.item),
1786
1858
  style: { width: "100%" }
1787
- }), null, 16, ["row", "field", "disabled"])) : l.item.item.type === "treeSelect" ? (f(), b(o(ie), v({
1859
+ }), null, 16, ["row", "field", "disabled"])) : o.item.item.type === "treeSelect" ? (f(), h(a(de), v({
1788
1860
  key: 5,
1789
- modelValue: l.conf.update.form[l.item.item.key],
1790
- "onUpdate:modelValue": d[4] || (d[4] = (e) => l.conf.update.form[l.item.item.key] = e)
1791
- }, l.item.item.options?.treeSelect, $(l.item.item.options?.treeSelect?.on || {}), {
1792
- disabled: l.conf.update.getDisabled(l.item.item),
1861
+ modelValue: o.conf.update.form[o.item.item.key],
1862
+ "onUpdate:modelValue": u[4] || (u[4] = (t) => o.conf.update.form[o.item.item.key] = t)
1863
+ }, o.conf.update.getBind(o.item.item), S(o.conf.update.getOn(o.item.item)), {
1864
+ disabled: o.conf.update.getDisabled(o.item.item),
1793
1865
  style: { width: "100%" }
1794
- }), null, 16, ["modelValue", "disabled"])) : l.item.item.type === "datetime" ? (f(), b(o(te), v({
1866
+ }), null, 16, ["modelValue", "disabled"])) : o.item.item.type === "datetime" ? (f(), h(a(ae), v({
1795
1867
  key: 6,
1796
- modelValue: l.conf.update.form[l.item.item.key],
1797
- "onUpdate:modelValue": d[5] || (d[5] = (e) => l.conf.update.form[l.item.item.key] = e)
1798
- }, l.item.item.options?.datetime, $(l.item.item.options?.datetime?.on || {}), {
1799
- disabled: l.conf.update.getDisabled(l.item.item)
1800
- }), null, 16, ["modelValue", "disabled"])) : l.item.item.type && (o(j).customComponent[l.item.item.type] || o(j).customComponent[l.item.item.type]?.form) ? (f(), b(q(o(j).customComponent[l.item.item.type]?.form || o(j).customComponent[l.item.item.type]), v({
1868
+ modelValue: o.conf.update.form[o.item.item.key],
1869
+ "onUpdate:modelValue": u[5] || (u[5] = (t) => o.conf.update.form[o.item.item.key] = t)
1870
+ }, o.conf.update.getBind(o.item.item), S(o.conf.update.getOn(o.item.item)), {
1871
+ disabled: o.conf.update.getDisabled(o.item.item)
1872
+ }), null, 16, ["modelValue", "disabled"])) : o.item.item.type && (a(M).customComponent[o.item.item.type] || a(M).customComponent[o.item.item.type]?.form) ? (f(), h(q(a(M).customComponent[o.item.item.type]?.form || a(M).customComponent[o.item.item.type]), v({
1801
1873
  key: 7,
1802
- modelValue: l.conf.update.form[l.item.item.key],
1803
- "onUpdate:modelValue": d[6] || (d[6] = (e) => l.conf.update.form[l.item.item.key] = e)
1804
- }, l.item.item.options?.[l.item.item.type], $(l.item.item.options?.[l.item.item.type]?.on || {}), {
1805
- disabled: l.conf.update.getDisabled(l.item.item)
1874
+ modelValue: o.conf.update.form[o.item.item.key],
1875
+ "onUpdate:modelValue": u[6] || (u[6] = (t) => o.conf.update.form[o.item.item.key] = t)
1876
+ }, o.conf.update.getBind(o.item.item), S(o.conf.update.getOn(o.item.item)), {
1877
+ disabled: o.conf.update.getDisabled(o.item.item)
1806
1878
  }), null, 16, ["modelValue", "disabled"])) : C("", !0)
1807
1879
  ]),
1808
- k(l.$slots, "form-" + l.item.item.key + "-right", {
1809
- row: l.conf.update.form,
1810
- item: l.item.item
1880
+ k(o.$slots, "form-" + o.item.item.key + "-right", {
1881
+ row: o.conf.update.form,
1882
+ item: o.item.item
1811
1883
  })
1812
1884
  ]),
1813
- k(l.$slots, "form-" + l.item.item.key + "-tip", {
1814
- row: l.conf.update.form,
1815
- item: l.item.item
1885
+ k(o.$slots, "form-" + o.item.item.key + "-tip", {
1886
+ row: o.conf.update.form,
1887
+ item: o.item.item
1816
1888
  }, () => [
1817
- l.item.item.form?.tipText ? (f(), w("div", {
1889
+ o.item.item.form?.tipText ? (f(), y("div", {
1818
1890
  key: 0,
1819
1891
  class: "form-tip-text",
1820
- innerHTML: l.item.item.form?.tipText
1821
- }, null, 8, Xe)) : C("", !0)
1892
+ innerHTML: typeof o.item.item.form?.tipText == "function" ? o.item.item.form?.tipText(o.conf.update.form, o.conf.update.type) : o.item.item.form?.tipText
1893
+ }, null, 8, Ye)) : C("", !0)
1822
1894
  ])
1823
1895
  ]),
1824
- k(l.$slots, "form-" + l.item.item.key + "-end", {
1825
- row: l.conf.update.form,
1826
- item: l.item.item
1896
+ k(o.$slots, "form-" + o.item.item.key + "-end", {
1897
+ row: o.conf.update.form,
1898
+ item: o.item.item
1827
1899
  })
1828
1900
  ])
1829
1901
  ]),
1830
1902
  _: 3
1831
1903
  }, 8, ["class", "label", "prop", "label-width"]));
1832
1904
  }
1833
- }), Ye = {
1905
+ }), xe = {
1834
1906
  key: 0,
1835
1907
  class: "relative curd-search fit-width"
1836
- }, Ze = { class: "mb-10 flex justify-between items-center fit-width" }, xe = {
1908
+ }, _e = { class: "mb-10 flex justify-between items-center fit-width" }, et = {
1837
1909
  class: "flex items-center",
1838
1910
  style: { gap: "10px" }
1839
- }, _e = { key: 0 }, et = { key: 1 }, tt = { key: 2 }, ot = { class: "export-btn" }, lt = {
1911
+ }, tt = { key: 0 }, ot = { key: 1 }, at = { key: 2 }, lt = { class: "export-btn" }, nt = {
1840
1912
  class: "flex items-center table-tools-right",
1841
1913
  style: { gap: "10px" }
1842
- }, at = { class: "row justify-end mt-10 mb-10 table-bottom-pagination" }, it = { class: "dialog-footer" }, nt = { class: "dialog-footer" }, st = /* @__PURE__ */ H({
1914
+ }, it = { class: "row justify-end mt-10 mb-10 table-bottom-pagination" }, rt = { class: "dialog-footer" }, st = { class: "dialog-footer" }, dt = /* @__PURE__ */ J({
1843
1915
  __name: "index",
1844
1916
  props: {
1845
1917
  /**
@@ -1849,215 +1921,215 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
1849
1921
  default: {}
1850
1922
  }
1851
1923
  },
1852
- setup(n, { expose: l }) {
1853
- const d = D.EDialog, e = n, i = D.isFun, { conf: t, switchConfirmRef: a, ruleFormRef: r } = Oe(e);
1854
- return l({
1855
- conf: t
1856
- }), (c, m) => {
1857
- const u = ke("loading");
1858
- return f(), w("div", {
1859
- class: R(["relative cc1-form-box", [n.option.table?.fitHeight ? "col" : "no-min-height"]])
1924
+ setup(r, { expose: o }) {
1925
+ const u = U.EDialog, t = r, i = U.isFun, { conf: l, switchConfirmRef: e, ruleFormRef: s } = Te(t);
1926
+ return o({
1927
+ conf: l
1928
+ }), (p, c) => {
1929
+ const g = we("loading");
1930
+ return f(), y("div", {
1931
+ class: j(["relative cc1-form-box", [r.option.table?.fitHeight ? "col" : "no-min-height"]])
1860
1932
  }, [
1861
1933
  O("div", {
1862
- class: R(["row", [n.option.table?.fitHeight ? "absolute fit" : ""]]),
1934
+ class: j(["row", [r.option.table?.fitHeight ? "absolute fit" : ""]]),
1863
1935
  style: { overflow: "hidden" }
1864
1936
  }, [
1865
- k(c.$slots, "box-left"),
1937
+ k(p.$slots, "box-left"),
1866
1938
  O("div", {
1867
- class: R(["column fit-width no-wrap", [n.option.table?.fitHeight ? "col" : ""]])
1939
+ class: j(["column fit-width no-wrap", [r.option.table?.fitHeight ? "col" : ""]])
1868
1940
  }, [
1869
- n.option.search?.show !== !1 ? (f(), w("div", Ye, [
1870
- V(o(N), {
1871
- model: o(t).search.form,
1941
+ r.option.search?.show !== !1 ? (f(), y("div", xe, [
1942
+ z(a(N), {
1943
+ model: a(l).search.form,
1872
1944
  inline: "",
1873
- size: n.option.size?.search
1945
+ size: r.option.size?.search
1874
1946
  }, {
1875
- default: h(() => [
1876
- k(c.$slots, "search-start", {
1877
- row: o(t).search.form
1947
+ default: m(() => [
1948
+ k(p.$slots, "search-start", {
1949
+ row: a(l).search.form
1878
1950
  }),
1879
- (f(!0), w(S, null, L(o(t).search.column.list, (s) => (f(), w(S, {
1880
- key: s.key
1951
+ (f(!0), y($, null, L(a(l).search.column.list, (n) => (f(), y($, {
1952
+ key: n.key
1881
1953
  }, [
1882
- (typeof s.show?.search == "function" ? s.show?.search(o(t).search.form) : s.show?.search) ? (f(), b(o(G), {
1954
+ (typeof n.show?.search == "function" ? n.show?.search(a(l).search.form) : n.show?.search) ? (f(), h(a(X), {
1883
1955
  key: 0,
1884
- label: typeof s.text?.search?.label == "string" ? s.text?.search?.label : s.label,
1885
- class: R({
1886
- "hide-label": typeof s.text?.search?.label == "boolean" ? !s.text?.search?.label : !1
1956
+ label: typeof n.text?.search?.label == "string" ? n.text?.search?.label : n.label,
1957
+ class: j({
1958
+ "hide-label": typeof n.text?.search?.label == "boolean" ? !n.text?.search?.label : !1
1887
1959
  })
1888
1960
  }, {
1889
- default: h(() => [
1890
- k(c.$slots, "search-" + s.key, {
1891
- row: o(t).search.form
1961
+ default: m(() => [
1962
+ k(p.$slots, "search-" + n.key, {
1963
+ row: a(l).search.form
1892
1964
  }, () => [
1893
- s.type === "input" ? (f(), b(o(Q), v({
1965
+ n.type === "input" ? (f(), h(a(Y), v({
1894
1966
  key: 0,
1895
- modelValue: o(t).search.form[s.key],
1896
- "onUpdate:modelValue": (p) => o(t).search.form[s.key] = p,
1897
- placeholder: o(t).search.getPlaceholder(s),
1967
+ modelValue: a(l).search.form[n.key],
1968
+ "onUpdate:modelValue": (d) => a(l).search.form[n.key] = d,
1969
+ placeholder: a(l).search.getPlaceholder(n),
1898
1970
  clearable: "",
1899
- disabled: s.disabled?.search,
1971
+ disabled: n.disabled?.search,
1900
1972
  ref_for: !0
1901
- }, s.options?.search?.input || s.options?.input, $(s.options?.search?.input?.on || s.options?.input?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : s.type === "switch" ? (f(), b(o(W), v({
1973
+ }, n.options?.search?.input || n.options?.input, S(n.options?.search?.input?.on || n.options?.input?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : n.type === "switch" ? (f(), h(a(W), v({
1902
1974
  key: 1,
1903
- modelValue: o(t).search.form[s.key],
1904
- "onUpdate:modelValue": (p) => o(t).search.form[s.key] = p,
1905
- placeholder: o(t).search.getPlaceholder(s, o(g).tCurd("placeholderSelect")),
1975
+ modelValue: a(l).search.form[n.key],
1976
+ "onUpdate:modelValue": (d) => a(l).search.form[n.key] = d,
1977
+ placeholder: a(l).search.getPlaceholder(n, a(b).tCurd("placeholderSelect")),
1906
1978
  clearable: "",
1907
- disabled: s.disabled?.search,
1979
+ disabled: n.disabled?.search,
1908
1980
  ref_for: !0
1909
- }, s.options?.search?.switch || s.options?.switch, $(s.options?.search?.switch?.on || s.options?.switch?.on || {})), {
1910
- default: h(() => [
1911
- (f(), b(o(B), {
1912
- key: s.options?.switch?.activeValue,
1913
- label: s.options?.switch?.activeLabel,
1914
- value: s.options?.switch?.activeValue
1981
+ }, n.options?.search?.switch || n.options?.switch, S(n.options?.search?.switch?.on || n.options?.switch?.on || {})), {
1982
+ default: m(() => [
1983
+ (f(), h(a(K), {
1984
+ key: n.options?.switch?.activeValue,
1985
+ label: n.options?.switch?.activeLabel,
1986
+ value: n.options?.switch?.activeValue
1915
1987
  }, null, 8, ["label", "value"])),
1916
- (f(), b(o(B), {
1917
- key: s.options?.switch?.inactiveValue,
1918
- label: s.options?.switch?.inactiveLabel,
1919
- value: s.options?.switch?.inactiveValue
1988
+ (f(), h(a(K), {
1989
+ key: n.options?.switch?.inactiveValue,
1990
+ label: n.options?.switch?.inactiveLabel,
1991
+ value: n.options?.switch?.inactiveValue
1920
1992
  }, null, 8, ["label", "value"]))
1921
1993
  ]),
1922
1994
  _: 2
1923
- }, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : s.type === "select" ? (f(), b(o(W), v({
1995
+ }, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : n.type === "select" ? (f(), h(a(W), v({
1924
1996
  key: 2,
1925
- modelValue: o(t).search.form[s.key],
1926
- "onUpdate:modelValue": (p) => o(t).search.form[s.key] = p,
1927
- placeholder: o(t).search.getPlaceholder(s, o(g).tCurd("placeholderSelect")),
1997
+ modelValue: a(l).search.form[n.key],
1998
+ "onUpdate:modelValue": (d) => a(l).search.form[n.key] = d,
1999
+ placeholder: a(l).search.getPlaceholder(n, a(b).tCurd("placeholderSelect")),
1928
2000
  clearable: "",
1929
- disabled: s.disabled?.search,
2001
+ disabled: n.disabled?.search,
1930
2002
  ref_for: !0
1931
- }, s.options?.search?.select || s.options?.select, $(s.options?.search?.select?.on || s.options?.select?.on || {})), {
1932
- default: h(() => [
1933
- (f(!0), w(S, null, L(s.options?.select?.data, (p) => (f(), b(o(B), {
1934
- key: p.value,
1935
- label: p.label,
1936
- value: p.value
2003
+ }, n.options?.search?.select || n.options?.select, S(n.options?.search?.select?.on || n.options?.select?.on || {})), {
2004
+ default: m(() => [
2005
+ (f(!0), y($, null, L(n.options?.select?.data, (d) => (f(), h(a(K), {
2006
+ key: d.value,
2007
+ label: d.label,
2008
+ value: d.value
1937
2009
  }, null, 8, ["label", "value"]))), 128))
1938
2010
  ]),
1939
2011
  _: 2
1940
- }, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : s.type === "datetime" ? (f(), b(o(te), v({
2012
+ }, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : n.type === "datetime" ? (f(), h(a(ae), v({
1941
2013
  key: 3,
1942
- modelValue: o(t).search.form[s.key],
1943
- "onUpdate:modelValue": (p) => o(t).search.form[s.key] = p,
1944
- disabled: s.disabled?.search,
2014
+ modelValue: a(l).search.form[n.key],
2015
+ "onUpdate:modelValue": (d) => a(l).search.form[n.key] = d,
2016
+ disabled: n.disabled?.search,
1945
2017
  ref_for: !0
1946
- }, s.options?.search?.datetime || s.options?.datetime, $(s.options?.search?.datetime?.on || s.options?.datetime?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : s.type && o(j).customComponent[s.type] ? (f(), b(q(o(j).customComponent[s.type]), v({
2018
+ }, n.options?.search?.datetime || n.options?.datetime, S(n.options?.search?.datetime?.on || n.options?.datetime?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.type && a(M).customComponent[n.type] ? (f(), h(q(a(M).customComponent[n.type]), v({
1947
2019
  key: 4,
1948
- modelValue: o(t).search.form[s.key],
1949
- "onUpdate:modelValue": (p) => o(t).search.form[s.key] = p,
2020
+ modelValue: a(l).search.form[n.key],
2021
+ "onUpdate:modelValue": (d) => a(l).search.form[n.key] = d,
1950
2022
  ref_for: !0
1951
- }, s.options?.search?.[s.type] || s.options?.[s.type], $(s.options?.search?.[s.type]?.on || s.options?.[s.type]?.on || {}), {
1952
- disabled: s.disabled?.search
2023
+ }, n.options?.search?.[n.type] || n.options?.[n.type], S(n.options?.search?.[n.type]?.on || n.options?.[n.type]?.on || {}), {
2024
+ disabled: n.disabled?.search
1953
2025
  }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : C("", !0)
1954
2026
  ]),
1955
- k(c.$slots, "search-" + s.key + "-right", {
1956
- row: o(t).search.form
2027
+ k(p.$slots, "search-" + n.key + "-right", {
2028
+ row: a(l).search.form
1957
2029
  })
1958
2030
  ]),
1959
2031
  _: 2
1960
2032
  }, 1032, ["label", "class"])) : C("", !0)
1961
2033
  ], 64))), 128)),
1962
- k(c.$slots, "search-center", {
1963
- row: o(t).search.form
2034
+ k(p.$slots, "search-center", {
2035
+ row: a(l).search.form
1964
2036
  }),
1965
- n.option.tools?.search || n.option.tools?.reset ? (f(), b(o(G), { key: 0 }, {
1966
- default: h(() => [
1967
- n.option.tools?.search ? (f(), b(o(F), {
2037
+ r.option.tools?.search || r.option.tools?.reset ? (f(), h(a(X), { key: 0 }, {
2038
+ default: m(() => [
2039
+ r.option.tools?.search ? (f(), h(a(A), {
1968
2040
  key: 0,
1969
2041
  type: "primary",
1970
- onClick: o(t).search.submit
2042
+ onClick: a(l).search.submit
1971
2043
  }, {
1972
- default: h(() => [
1973
- E(U(o(g).tCurd("search")), 1)
2044
+ default: m(() => [
2045
+ E(T(a(b).tCurd("search")), 1)
1974
2046
  ]),
1975
2047
  _: 1
1976
2048
  }, 8, ["onClick"])) : C("", !0),
1977
- n.option.tools?.reset ? (f(), b(o(F), {
2049
+ r.option.tools?.reset ? (f(), h(a(A), {
1978
2050
  key: 1,
1979
- onClick: o(t).search.reset
2051
+ onClick: a(l).search.reset
1980
2052
  }, {
1981
- default: h(() => [
1982
- E(U(o(g).tCurd("reset")), 1)
2053
+ default: m(() => [
2054
+ E(T(a(b).tCurd("reset")), 1)
1983
2055
  ]),
1984
2056
  _: 1
1985
2057
  }, 8, ["onClick"])) : C("", !0)
1986
2058
  ]),
1987
2059
  _: 1
1988
2060
  })) : C("", !0),
1989
- k(c.$slots, "search-end", {
1990
- row: o(t).search.form
2061
+ k(p.$slots, "search-end", {
2062
+ row: a(l).search.form
1991
2063
  })
1992
2064
  ]),
1993
2065
  _: 3
1994
2066
  }, 8, ["model", "size"])
1995
2067
  ])) : C("", !0),
1996
- O("div", Ze, [
1997
- O("div", xe, [
1998
- o(i)(n.option.tools?.add) ? (f(), w("div", _e, [
1999
- V(o(F), {
2068
+ O("div", _e, [
2069
+ O("div", et, [
2070
+ a(i)(r.option.tools?.add) ? (f(), y("div", tt, [
2071
+ z(a(A), {
2000
2072
  type: "primary",
2001
- onClick: m[0] || (m[0] = (s) => o(t).update.open(o(d).Insert)),
2002
- size: n.option.size?.search
2073
+ onClick: c[0] || (c[0] = (n) => a(l).update.open(a(u).Add)),
2074
+ size: r.option.size?.search
2003
2075
  }, {
2004
- default: h(() => [
2005
- E(U(o(g).tCurd("add")), 1)
2076
+ default: m(() => [
2077
+ E(T(a(b).tCurd("add")), 1)
2006
2078
  ]),
2007
2079
  _: 1
2008
2080
  }, 8, ["size"])
2009
2081
  ])) : C("", !0),
2010
- n.option.table?.selectable && o(i)(n.option.tools?.delete) ? (f(), w("div", et, [
2011
- V(o(F), {
2082
+ r.option.table?.selectable && a(i)(r.option.tools?.delete) ? (f(), y("div", ot, [
2083
+ z(a(A), {
2012
2084
  type: "danger",
2013
- onClick: m[1] || (m[1] = (s) => o(t).remove.open(o(t).table.selection.list)),
2014
- size: n.option.size?.search
2085
+ onClick: c[1] || (c[1] = (n) => a(l).remove.open(a(l).table.selection.list)),
2086
+ size: r.option.size?.search
2015
2087
  }, {
2016
- default: h(() => [
2017
- E(U(o(g).tCurd("delete")), 1)
2088
+ default: m(() => [
2089
+ E(T(a(b).tCurd("delete")), 1)
2018
2090
  ]),
2019
2091
  _: 1
2020
2092
  }, 8, ["size"])
2021
2093
  ])) : C("", !0),
2022
- n.option.tools?.expand ? (f(), w("div", tt, [
2023
- V(o(F), {
2094
+ r.option.tools?.expand ? (f(), y("div", at, [
2095
+ z(a(A), {
2024
2096
  type: "warning",
2025
- onClick: m[2] || (m[2] = (s) => o(t).table.expand.all()),
2026
- size: n.option.size?.search
2097
+ onClick: c[2] || (c[2] = (n) => a(l).table.expand.all()),
2098
+ size: r.option.size?.search
2027
2099
  }, {
2028
- default: h(() => [
2029
- E(U(o(g).tCurd("expandCollapse")), 1)
2100
+ default: m(() => [
2101
+ E(T(a(b).tCurd("expandCollapse")), 1)
2030
2102
  ]),
2031
2103
  _: 1
2032
2104
  }, 8, ["size"])
2033
2105
  ])) : C("", !0),
2034
- n.option.tools?.export?.show ? (f(), b(o(me), {
2106
+ r.option.tools?.export?.show ? (f(), h(a(he), {
2035
2107
  key: 3,
2036
- onCommand: o(t).export.click
2108
+ onCommand: a(l).export.click
2037
2109
  }, {
2038
- dropdown: h(() => [
2039
- V(o(he), {
2040
- size: n.option.size?.search
2110
+ dropdown: m(() => [
2111
+ z(a(ge), {
2112
+ size: r.option.size?.search
2041
2113
  }, {
2042
- default: h(() => [
2043
- n.option.table?.selectable ? (f(), b(o(Y), {
2114
+ default: m(() => [
2115
+ r.option.table?.selectable ? (f(), h(a(x), {
2044
2116
  key: 0,
2045
2117
  command: "select"
2046
2118
  }, {
2047
- default: h(() => [
2048
- E(U(o(g).tCurd("exportSelect")), 1)
2119
+ default: m(() => [
2120
+ E(T(a(b).tCurd("exportSelect")), 1)
2049
2121
  ]),
2050
2122
  _: 1
2051
2123
  })) : C("", !0),
2052
- V(o(Y), { command: "page" }, {
2053
- default: h(() => [
2054
- E(U(o(g).tCurd("exportPage")), 1)
2124
+ z(a(x), { command: "page" }, {
2125
+ default: m(() => [
2126
+ E(T(a(b).tCurd("exportPage")), 1)
2055
2127
  ]),
2056
2128
  _: 1
2057
2129
  }),
2058
- V(o(Y), { command: "all" }, {
2059
- default: h(() => [
2060
- E(U(o(g).tCurd("exportAll")), 1)
2130
+ z(a(x), { command: "all" }, {
2131
+ default: m(() => [
2132
+ E(T(a(b).tCurd("exportAll")), 1)
2061
2133
  ]),
2062
2134
  _: 1
2063
2135
  })
@@ -2065,15 +2137,15 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
2065
2137
  _: 1
2066
2138
  }, 8, ["size"])
2067
2139
  ]),
2068
- default: h(() => [
2069
- O("div", ot, [
2070
- V(o(F), {
2140
+ default: m(() => [
2141
+ O("div", lt, [
2142
+ z(a(A), {
2071
2143
  type: "warning",
2072
- loading: o(t).export.loading,
2073
- size: n.option.size?.search
2144
+ loading: a(l).export.loading,
2145
+ size: r.option.size?.search
2074
2146
  }, {
2075
- default: h(() => [
2076
- E(U(o(g).tCurd("export")), 1)
2147
+ default: m(() => [
2148
+ E(T(a(b).tCurd("export")), 1)
2077
2149
  ]),
2078
2150
  _: 1
2079
2151
  }, 8, ["loading", "size"])
@@ -2081,157 +2153,157 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
2081
2153
  ]),
2082
2154
  _: 1
2083
2155
  }, 8, ["onCommand"])) : C("", !0),
2084
- k(c.$slots, "tools-left")
2156
+ k(p.$slots, "tools-left")
2085
2157
  ]),
2086
- O("div", lt, [
2087
- k(c.$slots, "tools-right"),
2088
- o(t).page.showTools ? (f(), b(o(ae), v({
2158
+ O("div", nt, [
2159
+ k(p.$slots, "tools-right"),
2160
+ a(l).page.showTools ? (f(), h(a(ie), v({
2089
2161
  key: 0,
2090
- "current-page": o(t).page.num,
2091
- "onUpdate:currentPage": m[3] || (m[3] = (s) => o(t).page.num = s),
2092
- "page-size": o(t).page.size,
2093
- "onUpdate:pageSize": m[4] || (m[4] = (s) => o(t).page.size = s),
2162
+ "current-page": a(l).page.num,
2163
+ "onUpdate:currentPage": c[3] || (c[3] = (n) => a(l).page.num = n),
2164
+ "page-size": a(l).page.size,
2165
+ "onUpdate:pageSize": c[4] || (c[4] = (n) => a(l).page.size = n),
2094
2166
  background: "",
2095
- "page-sizes": o(t).page.sizeList,
2096
- "pager-count": o(t).page.pagerCount,
2097
- layout: o(t).page.layout,
2098
- total: o(t).page.total,
2099
- size: n.option.size?.table,
2100
- onSizeChange: o(t).table.getList,
2101
- onCurrentChange: o(t).table.getList
2102
- }, n.option.page?.pagination || {}, $(n.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : C("", !0),
2103
- n.option.tools?.refresh === void 0 || n.option.tools?.refresh ? (f(), w("div", {
2167
+ "page-sizes": a(l).page.sizeList,
2168
+ "pager-count": a(l).page.pagerCount,
2169
+ layout: a(l).page.layout,
2170
+ total: a(l).page.total,
2171
+ size: r.option.size?.table,
2172
+ onSizeChange: a(l).table.getList,
2173
+ onCurrentChange: a(l).table.getList
2174
+ }, r.option.page?.pagination || {}, S(r.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : C("", !0),
2175
+ r.option.tools?.refresh === void 0 || r.option.tools?.refresh ? (f(), y("div", {
2104
2176
  key: 1,
2105
- class: R(["refresh-btn", [n.option.size?.search]]),
2106
- onClick: m[5] || (m[5] = //@ts-ignore
2107
- (...s) => o(t).table.getList && o(t).table.getList(...s))
2177
+ class: j(["refresh-btn", [r.option.size?.search]]),
2178
+ onClick: c[5] || (c[5] = //@ts-ignore
2179
+ (...n) => a(l).table.getList && a(l).table.getList(...n))
2108
2180
  }, [
2109
- V(je)
2181
+ z(Ie)
2110
2182
  ], 2)) : C("", !0)
2111
2183
  ])
2112
2184
  ]),
2113
2185
  O("div", {
2114
- class: R(["fit-width relative form-box", [n.option.table?.fitHeight ? "col " : ""]])
2186
+ class: j(["fit-width relative form-box", [r.option.table?.fitHeight ? "col " : ""]])
2115
2187
  }, [
2116
2188
  O("div", {
2117
- class: R(["column form-box-content", [n.option.table?.fitHeight ? "absolute fit" : ""]])
2189
+ class: j(["column form-box-content", [r.option.table?.fitHeight ? "absolute fit" : ""]])
2118
2190
  }, [
2119
- Ce((f(), b(o(be), v({
2120
- data: o(t).table.data,
2121
- border: n.option.table?.border === void 0 ? !0 : n.option.table?.border,
2122
- onSelectionChange: o(t).table.selection.change,
2123
- onSortChange: o(t).table.sort.change,
2124
- "expand-row-keys": o(t).table.expand.rowKeys,
2125
- onExpandChange: o(t).table.expand.change
2126
- }, n.option.table, $(n.option.table?.on || {})), {
2127
- default: h(() => [
2128
- n.option.table?.selectable || o(i)(n.option.tools?.delete) || n.option.tools?.export?.show ? (f(), b(o(x), {
2191
+ ke((f(), h(a(be), v({
2192
+ data: a(l).table.data,
2193
+ border: r.option.table?.border === void 0 ? !0 : r.option.table?.border,
2194
+ onSelectionChange: a(l).table.selection.change,
2195
+ onSortChange: a(l).table.sort.change,
2196
+ "expand-row-keys": a(l).table.expand.rowKeys,
2197
+ onExpandChange: a(l).table.expand.change
2198
+ }, r.option.table, S(r.option.table?.on || {})), {
2199
+ default: m(() => [
2200
+ r.option.table?.selectable || a(i)(r.option.tools?.delete) || r.option.tools?.export?.show ? (f(), h(a(ee), {
2129
2201
  key: 0,
2130
2202
  type: "selection",
2131
- selectable: typeof n.option.table?.selectable == "function" ? n.option.table?.selectable : void 0,
2203
+ selectable: typeof r.option.table?.selectable == "function" ? r.option.table?.selectable : void 0,
2132
2204
  width: "40",
2133
2205
  align: "center",
2134
2206
  fixed: "left",
2135
2207
  "show-overflow-tooltip": !1
2136
2208
  }, null, 8, ["selectable"])) : C("", !0),
2137
- V(He, {
2138
- conf: o(t),
2139
- columnList: o(t).table.column.list,
2140
- option: n.option
2141
- }, _({ _: 2 }, [
2142
- L(c.$slots, (s, p) => ({
2143
- name: p,
2144
- fn: h((y) => [
2145
- k(c.$slots, p, ve(Ve(y || {})))
2209
+ z(qe, {
2210
+ conf: a(l),
2211
+ columnList: a(l).table.column.list,
2212
+ option: r.option
2213
+ }, te({ _: 2 }, [
2214
+ L(p.$slots, (n, d) => ({
2215
+ name: d,
2216
+ fn: m((V) => [
2217
+ k(p.$slots, d, Ce(ve(V || {})))
2146
2218
  ])
2147
2219
  }))
2148
2220
  ]), 1032, ["conf", "columnList", "option"]),
2149
- o(i)(n.option.table?.add) || o(i)(n.option.table?.update) || o(i)(n.option.table?.delete) || o(i)(n.option.table?.view) || c.$slots["table-op-left"] || c.$slots["table-op-right"] ? (f(), b(o(x), v({
2221
+ a(i)(r.option.table?.add) || a(i)(r.option.table?.update) || a(i)(r.option.table?.delete) || a(i)(r.option.table?.view) || p.$slots["table-op-left"] || p.$slots["table-op-right"] ? (f(), h(a(ee), v({
2150
2222
  key: 1,
2151
- width: o(t).table.op.width(o(i)(n.option.table?.add), o(i)(n.option.table?.update), o(i)(n.option.table?.delete), o(i)(n.option.table?.view), c.$slots["table-op-left"], c.$slots["table-op-right"]),
2223
+ width: a(l).table.op.width(a(i)(r.option.table?.add), a(i)(r.option.table?.update), a(i)(r.option.table?.delete), a(i)(r.option.table?.view), p.$slots["table-op-left"], p.$slots["table-op-right"]),
2152
2224
  align: "center",
2153
2225
  fixed: "right"
2154
- }, n.option.table?.operate), {
2155
- header: h(() => [
2156
- k(c.$slots, "table-header-op", {}, () => [
2157
- E(U(o(g).tCurd("operation")), 1)
2226
+ }, r.option.table?.operate), {
2227
+ header: m(() => [
2228
+ k(p.$slots, "table-header-op", {}, () => [
2229
+ E(T(a(b).tCurd("operation")), 1)
2158
2230
  ])
2159
2231
  ]),
2160
- default: h(({ row: s }) => [
2161
- V(o(N), {
2162
- size: n.option.size?.table
2232
+ default: m(({ row: n }) => [
2233
+ z(a(N), {
2234
+ size: r.option.size?.table
2163
2235
  }, {
2164
- default: h(() => [
2165
- k(c.$slots, "table-op-left", { row: s }),
2166
- n.option.table?.inlineEdit && o(t).inlineEdit.row === s ? (f(), w(S, { key: 0 }, [
2167
- V(o(F), {
2236
+ default: m(() => [
2237
+ k(p.$slots, "table-op-left", { row: n }),
2238
+ r.option.table?.inlineEdit && a(l).inlineEdit.data === n ? (f(), y($, { key: 0 }, [
2239
+ z(a(A), {
2168
2240
  link: "",
2169
2241
  type: "info",
2170
- onClick: o(t).inlineEdit.close
2242
+ onClick: a(l).inlineEdit.close
2171
2243
  }, {
2172
- default: h(() => [
2173
- E(U(o(g).tCurd("cancel")), 1)
2244
+ default: m(() => [
2245
+ E(T(a(b).tCurd("cancel")), 1)
2174
2246
  ]),
2175
2247
  _: 1
2176
2248
  }, 8, ["onClick"]),
2177
- V(o(F), {
2249
+ z(a(A), {
2178
2250
  link: "",
2179
2251
  type: "primary",
2180
- onClick: o(t).inlineEdit.submit,
2181
- loading: o(t).inlineEdit.loading
2252
+ onClick: a(l).update.submit,
2253
+ loading: a(l).update.loading
2182
2254
  }, {
2183
- default: h(() => [
2184
- E(U(o(g).tCurd("confirm")), 1)
2255
+ default: m(() => [
2256
+ E(T(a(b).tCurd("confirm")), 1)
2185
2257
  ]),
2186
2258
  _: 1
2187
2259
  }, 8, ["onClick", "loading"]),
2188
- k(c.$slots, "table-op-edit-right", { row: s })
2189
- ], 64)) : (f(), w(S, { key: 1 }, [
2190
- o(i)(n.option.table?.add, s) ? (f(), b(o(F), {
2260
+ k(p.$slots, "table-op-edit-right", { row: n })
2261
+ ], 64)) : (f(), y($, { key: 1 }, [
2262
+ a(i)(r.option.table?.add, n) ? (f(), h(a(A), {
2191
2263
  key: 0,
2192
2264
  link: "",
2193
2265
  type: "primary",
2194
- onClick: (p) => o(t).update.open(o(d).Insert, s)
2266
+ onClick: (d) => a(l).update.open(a(u).Add, n)
2195
2267
  }, {
2196
- default: h(() => [
2197
- E(U(o(g).tCurd("add")), 1)
2268
+ default: m(() => [
2269
+ E(T(a(b).tCurd("add")), 1)
2198
2270
  ]),
2199
2271
  _: 2
2200
2272
  }, 1032, ["onClick"])) : C("", !0),
2201
- o(i)(n.option.table?.view, s) ? (f(), b(o(F), {
2273
+ a(i)(r.option.table?.view, n) ? (f(), h(a(A), {
2202
2274
  key: 1,
2203
2275
  link: "",
2204
2276
  type: "primary",
2205
- onClick: (p) => o(t).update.open(o(d).View, s)
2277
+ onClick: (d) => a(l).update.open(a(u).View, n)
2206
2278
  }, {
2207
- default: h(() => [
2208
- E(U(o(g).tCurd("view")), 1)
2279
+ default: m(() => [
2280
+ E(T(a(b).tCurd("view")), 1)
2209
2281
  ]),
2210
2282
  _: 2
2211
2283
  }, 1032, ["onClick"])) : C("", !0),
2212
- o(i)(n.option.table?.update, s) ? (f(), b(o(F), {
2284
+ a(i)(r.option.table?.update, n) ? (f(), h(a(A), {
2213
2285
  key: 2,
2214
2286
  link: "",
2215
2287
  type: "warning",
2216
- onClick: (p) => o(t).update.open(o(d).Update, s)
2288
+ onClick: (d) => a(l).update.open(a(u).Update, n)
2217
2289
  }, {
2218
- default: h(() => [
2219
- E(U(o(g).tCurd("edit")), 1)
2290
+ default: m(() => [
2291
+ E(T(a(b).tCurd("edit")), 1)
2220
2292
  ]),
2221
2293
  _: 2
2222
2294
  }, 1032, ["onClick"])) : C("", !0),
2223
- o(i)(n.option.table?.delete, s) ? (f(), b(o(F), {
2295
+ a(i)(r.option.table?.delete, n) ? (f(), h(a(A), {
2224
2296
  key: 3,
2225
2297
  link: "",
2226
2298
  type: "danger",
2227
- onClick: (p) => o(t).remove.open([s])
2299
+ onClick: (d) => a(l).remove.open([n])
2228
2300
  }, {
2229
- default: h(() => [
2230
- E(U(o(g).tCurd("delete")), 1)
2301
+ default: m(() => [
2302
+ E(T(a(b).tCurd("delete")), 1)
2231
2303
  ]),
2232
2304
  _: 2
2233
2305
  }, 1032, ["onClick"])) : C("", !0),
2234
- k(c.$slots, "table-op-right", { row: s })
2306
+ k(p.$slots, "table-op-right", { row: n })
2235
2307
  ], 64))
2236
2308
  ]),
2237
2309
  _: 2
@@ -2242,58 +2314,58 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
2242
2314
  ]),
2243
2315
  _: 3
2244
2316
  }, 16, ["data", "border", "onSelectionChange", "onSortChange", "expand-row-keys", "onExpandChange"])), [
2245
- [u, o(t).table.loading]
2317
+ [g, a(l).table.loading]
2246
2318
  ])
2247
2319
  ], 2)
2248
2320
  ], 2),
2249
- O("div", at, [
2250
- (n.option.page?.show === void 0 || n.option.page?.show) && !o(t).page.showTools ? (f(), b(o(ae), v({
2321
+ O("div", it, [
2322
+ (r.option.page?.show === void 0 || r.option.page?.show) && !a(l).page.showTools ? (f(), h(a(ie), v({
2251
2323
  key: 0,
2252
- "current-page": o(t).page.num,
2253
- "onUpdate:currentPage": m[6] || (m[6] = (s) => o(t).page.num = s),
2254
- "page-size": o(t).page.size,
2255
- "onUpdate:pageSize": m[7] || (m[7] = (s) => o(t).page.size = s),
2324
+ "current-page": a(l).page.num,
2325
+ "onUpdate:currentPage": c[6] || (c[6] = (n) => a(l).page.num = n),
2326
+ "page-size": a(l).page.size,
2327
+ "onUpdate:pageSize": c[7] || (c[7] = (n) => a(l).page.size = n),
2256
2328
  background: "",
2257
- "page-sizes": o(t).page.sizeList,
2258
- "pager-count": o(t).page.pagerCount,
2259
- layout: o(t).page.layout,
2260
- total: o(t).page.total,
2261
- size: n.option.size?.table,
2262
- onSizeChange: o(t).table.getList,
2263
- onCurrentChange: o(t).table.getList
2264
- }, n.option.page?.pagination || {}, $(n.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : C("", !0)
2329
+ "page-sizes": a(l).page.sizeList,
2330
+ "pager-count": a(l).page.pagerCount,
2331
+ layout: a(l).page.layout,
2332
+ total: a(l).page.total,
2333
+ size: r.option.size?.table,
2334
+ onSizeChange: a(l).table.getList,
2335
+ onCurrentChange: a(l).table.getList
2336
+ }, r.option.page?.pagination || {}, S(r.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : C("", !0)
2265
2337
  ])
2266
2338
  ], 2),
2267
- k(c.$slots, "box-right")
2339
+ k(p.$slots, "box-right")
2268
2340
  ], 2),
2269
- V(o(Z), v({
2270
- modelValue: o(t).update.show,
2271
- "onUpdate:modelValue": m[8] || (m[8] = (s) => o(t).update.show = s),
2272
- title: o(t).update.title,
2273
- "before-close": o(t).update.close
2274
- }, n.option.dialog), {
2275
- footer: h(() => [
2276
- O("span", it, [
2277
- V(o(N), {
2278
- size: n.option.size?.form
2341
+ z(a(_), v({
2342
+ modelValue: a(l).update.show,
2343
+ "onUpdate:modelValue": c[8] || (c[8] = (n) => a(l).update.show = n),
2344
+ title: a(l).update.title,
2345
+ "before-close": a(l).update.close
2346
+ }, r.option.dialog), {
2347
+ footer: m(() => [
2348
+ O("span", rt, [
2349
+ z(a(N), {
2350
+ size: r.option.size?.form
2279
2351
  }, {
2280
- default: h(() => [
2281
- V(o(F), {
2282
- onClick: o(t).update.close
2352
+ default: m(() => [
2353
+ z(a(A), {
2354
+ onClick: a(l).update.close
2283
2355
  }, {
2284
- default: h(() => [
2285
- E(U(o(g).tCurd("close")), 1)
2356
+ default: m(() => [
2357
+ E(T(a(b).tCurd("close")), 1)
2286
2358
  ]),
2287
2359
  _: 1
2288
2360
  }, 8, ["onClick"]),
2289
- o(t).update.type !== o(d).View ? (f(), b(o(F), {
2361
+ a(l).update.type !== a(u).View ? (f(), h(a(A), {
2290
2362
  key: 0,
2291
2363
  type: "primary",
2292
- onClick: o(t).update.submit,
2293
- loading: o(t).update.loading
2364
+ onClick: a(l).update.submit,
2365
+ loading: a(l).update.loading
2294
2366
  }, {
2295
- default: h(() => [
2296
- E(U(o(g).tCurd("submit")), 1)
2367
+ default: m(() => [
2368
+ E(T(a(b).tCurd("submit")), 1)
2297
2369
  ]),
2298
2370
  _: 1
2299
2371
  }, 8, ["onClick", "loading"])) : C("", !0)
@@ -2302,55 +2374,55 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
2302
2374
  }, 8, ["size"])
2303
2375
  ])
2304
2376
  ]),
2305
- default: h(() => [
2306
- V(o(N), {
2377
+ default: m(() => [
2378
+ z(a(N), {
2307
2379
  ref_key: "ruleFormRef",
2308
- ref: r,
2309
- model: o(t).update.form,
2310
- rules: o(t).update.rules,
2311
- size: n.option.size?.form
2380
+ ref: s,
2381
+ model: a(l).update.form,
2382
+ rules: a(l).update.rules,
2383
+ size: r.option.size?.form
2312
2384
  }, {
2313
- default: h(() => [
2314
- o(t).update.showContent ? (f(!0), w(S, { key: 0 }, L(o(t).update.formColumn, (s) => (f(), w(S, null, [
2315
- o(i)(
2385
+ default: m(() => [
2386
+ a(l).update.showContent ? (f(!0), y($, { key: 0 }, L(a(l).update.formColumn, (n) => (f(), y($, null, [
2387
+ a(i)(
2316
2388
  (() => {
2317
- const p = [], y = (I) => {
2318
- I?.item?.children ? y(I.item.children) : p.push(...I.map((M) => M.item?.show?.form));
2389
+ const d = [], V = (w) => {
2390
+ w?.item?.children ? V(w.item.children) : d.push(...w.map((F) => F.item?.show?.form));
2319
2391
  };
2320
- return y(s), p;
2392
+ return V(n), d;
2321
2393
  })(),
2322
- o(t).update.form,
2323
- o(t).update.type
2324
- ) ? (f(), w("div", {
2394
+ a(l).update.form,
2395
+ a(l).update.type
2396
+ ) ? (f(), y("div", {
2325
2397
  key: 0,
2326
- class: R(["row curd-row", {
2327
- stripe: n.option.form?.stripe === void 0 ? !0 : n.option.form?.stripe
2398
+ class: j(["row curd-row", {
2399
+ stripe: r.option.form?.stripe === void 0 ? !0 : r.option.form?.stripe
2328
2400
  }])
2329
2401
  }, [
2330
- k(c.$slots, "form-start", {
2331
- row: o(t).update.form
2402
+ k(p.$slots, "form-start", {
2403
+ row: a(l).update.form
2332
2404
  }),
2333
- (f(!0), w(S, null, L(s, (p) => (f(), w(S, null, [
2334
- o(i)(p.item.show?.form, o(t).update.form, o(t).update.type) ? (f(), w("div", {
2405
+ (f(!0), y($, null, L(n, (d) => (f(), y($, null, [
2406
+ a(i)(d.item.show?.form, a(l).update.form, a(l).update.type) ? (f(), y("div", {
2335
2407
  key: 0,
2336
- class: R([p.item.form.span > 0 ? `col-${o(t).getColumnSpan(p, s)}` : "col", `form-item-col-${p.item.key}`])
2408
+ class: j([d.item.form.span > 0 ? `col-${a(l).getColumnSpan(d, n)}` : "col", `form-item-col-${d.item.key}`])
2337
2409
  }, [
2338
- (f(!0), w(S, null, L(p.item.children ? p.children : [p], (y) => (f(), b(Qe, {
2339
- key: y.item.key,
2340
- conf: o(t),
2341
- item: y
2342
- }, _({ _: 2 }, [
2343
- L(c.$slots, (I, M) => ({
2344
- name: M,
2345
- fn: h((T) => [
2346
- k(c.$slots, M, v({ ref_for: !0 }, T || {}))
2410
+ (f(!0), y($, null, L(d.item.children ? d.children : [d], (V) => (f(), h(Ze, {
2411
+ key: V.item.key,
2412
+ conf: a(l),
2413
+ item: V
2414
+ }, te({ _: 2 }, [
2415
+ L(p.$slots, (w, F) => ({
2416
+ name: F,
2417
+ fn: m((B) => [
2418
+ k(p.$slots, F, v({ ref_for: !0 }, B || {}))
2347
2419
  ])
2348
2420
  }))
2349
2421
  ]), 1032, ["conf", "item"]))), 128))
2350
2422
  ], 2)) : C("", !0)
2351
2423
  ], 64))), 256)),
2352
- k(c.$slots, "form-end", {
2353
- row: o(t).update.form
2424
+ k(p.$slots, "form-end", {
2425
+ row: a(l).update.form
2354
2426
  })
2355
2427
  ], 2)) : C("", !0)
2356
2428
  ], 64))), 256)) : C("", !0)
@@ -2360,33 +2432,33 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
2360
2432
  ]),
2361
2433
  _: 3
2362
2434
  }, 16, ["modelValue", "title", "before-close"]),
2363
- V(o(Z), {
2364
- modelValue: o(t).remove.show,
2365
- "onUpdate:modelValue": m[9] || (m[9] = (s) => o(t).remove.show = s),
2366
- title: o(t).remove.title,
2435
+ z(a(_), {
2436
+ modelValue: a(l).remove.show,
2437
+ "onUpdate:modelValue": c[9] || (c[9] = (n) => a(l).remove.show = n),
2438
+ title: a(l).remove.title,
2367
2439
  "close-on-click-modal": !1
2368
2440
  }, {
2369
- footer: h(() => [
2370
- O("span", nt, [
2371
- V(o(N), {
2372
- size: n.option.size?.form
2441
+ footer: m(() => [
2442
+ O("span", st, [
2443
+ z(a(N), {
2444
+ size: r.option.size?.form
2373
2445
  }, {
2374
- default: h(() => [
2375
- V(o(F), {
2376
- onClick: o(t).remove.close
2446
+ default: m(() => [
2447
+ z(a(A), {
2448
+ onClick: a(l).remove.close
2377
2449
  }, {
2378
- default: h(() => [
2379
- E(U(o(g).tCurd("close")), 1)
2450
+ default: m(() => [
2451
+ E(T(a(b).tCurd("close")), 1)
2380
2452
  ]),
2381
2453
  _: 1
2382
2454
  }, 8, ["onClick"]),
2383
- V(o(F), {
2455
+ z(a(A), {
2384
2456
  type: "danger",
2385
- onClick: o(t).remove.submit,
2386
- loading: o(t).remove.loading
2457
+ onClick: a(l).remove.submit,
2458
+ loading: a(l).remove.loading
2387
2459
  }, {
2388
- default: h(() => [
2389
- E(U(o(g).tCurd("confirmDelete")), 1)
2460
+ default: m(() => [
2461
+ E(T(a(b).tCurd("confirmDelete")), 1)
2390
2462
  ]),
2391
2463
  _: 1
2392
2464
  }, 8, ["onClick", "loading"])
@@ -2395,85 +2467,85 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
2395
2467
  }, 8, ["size"])
2396
2468
  ])
2397
2469
  ]),
2398
- default: h(() => [
2399
- O("div", null, U(o(g).tCurd("confirmDeleteMessage", o(t).remove.items.length)), 1)
2470
+ default: m(() => [
2471
+ O("div", null, T(a(b).tCurd("confirmDeleteMessage", a(l).remove.items.length)), 1)
2400
2472
  ]),
2401
2473
  _: 1
2402
2474
  }, 8, ["modelValue", "title"]),
2403
- V(Le, {
2475
+ z(Le, {
2404
2476
  ref_key: "switchConfirmRef",
2405
- ref: a,
2406
- size: n.option.size?.form
2477
+ ref: e,
2478
+ size: r.option.size?.form
2407
2479
  }, null, 8, ["size"])
2408
2480
  ], 2);
2409
2481
  };
2410
2482
  }
2411
2483
  });
2412
- class ct {
2484
+ class mt {
2413
2485
  /**
2414
2486
  * 通过远程 URL 下载文件,自动创建临时 `<a>` 标签触发浏览器下载
2415
2487
  *
2416
2488
  * @param href - 文件的远程地址
2417
2489
  * @param name - 下载后的文件名,默认 `'download.png'`
2418
2490
  */
2419
- static async download(l, d = "download.png") {
2420
- const e = document.createElement("a");
2421
- e.style.display = "none", e.href = l, e.setAttribute("download", d), typeof e.download > "u" && e.setAttribute("target", "_blank"), document.body.appendChild(e), e.click(), document.body.removeChild(e), window.URL.revokeObjectURL(l);
2491
+ static async download(o, u = "download.png") {
2492
+ const t = document.createElement("a");
2493
+ t.style.display = "none", t.href = o, t.setAttribute("download", u), typeof t.download > "u" && t.setAttribute("target", "_blank"), document.body.appendChild(t), t.click(), document.body.removeChild(t), window.URL.revokeObjectURL(o);
2422
2494
  }
2423
2495
  /**
2424
2496
  * 将json对象或者json数组导出为json文件保存
2425
2497
  * @param data
2426
2498
  * @param name
2427
2499
  */
2428
- static exportJSONFile = (l, d) => {
2429
- const e = new Blob([JSON.stringify(l)], { type: "application/json" }), i = URL.createObjectURL(e), t = document.createElement("a");
2430
- t.href = i, t.download = `${d || "config"}.json`, t.click();
2500
+ static exportJSONFile = (o, u) => {
2501
+ const t = new Blob([JSON.stringify(o)], { type: "application/json" }), i = URL.createObjectURL(t), l = document.createElement("a");
2502
+ l.href = i, l.download = `${u || "config"}.json`, l.click();
2431
2503
  };
2432
2504
  /**
2433
2505
  * 导入文件内容,默认为json
2434
2506
  * @param param
2435
2507
  * @returns
2436
2508
  */
2437
- static importFile = async (l) => new Promise((d, e) => {
2509
+ static importFile = async (o) => new Promise((u, t) => {
2438
2510
  const i = document.createElement("input");
2439
2511
  i.type = "file";
2440
- const t = l?.accept || ".json";
2441
- i.accept = t, i.style.display = "none", i.onchange = (a) => {
2442
- const r = a.target.files[0];
2443
- if (!r) {
2444
- D.fail("未选择文件"), e("未选择文件");
2512
+ const l = o?.accept || ".json";
2513
+ i.accept = l, i.style.display = "none", i.onchange = (e) => {
2514
+ const s = e.target.files[0];
2515
+ if (!s) {
2516
+ U.fail("未选择文件"), t("未选择文件");
2445
2517
  return;
2446
2518
  }
2447
- const c = new FileReader();
2448
- c.onload = async (m) => {
2449
- const u = t == ".json" ? JSON.parse(m.target.result) : m.target.result;
2450
- d(u);
2451
- }, c.onerror = () => {
2452
- D.fail("文件读取失败"), e("文件读取失败");
2453
- }, c.readAsText(r), document.body.removeChild(i);
2519
+ const p = new FileReader();
2520
+ p.onload = async (c) => {
2521
+ const g = l == ".json" ? JSON.parse(c.target.result) : c.target.result;
2522
+ u(g);
2523
+ }, p.onerror = () => {
2524
+ U.fail("文件读取失败"), t("文件读取失败");
2525
+ }, p.readAsText(s), document.body.removeChild(i);
2454
2526
  }, document.body.appendChild(i), i.click();
2455
2527
  });
2456
2528
  }
2457
- const rt = (n, l) => {
2458
- if (n.component("TCurd", st), n.component("TFormList", le), n.component("TColumn", Se), l?.customComponent) {
2459
- j.customComponent = l.customComponent;
2460
- for (const d in l.customComponent)
2461
- n.component(d, l.customComponent[d]);
2529
+ const ut = (r, o) => {
2530
+ if (r.component("TCurd", dt), r.component("TFormList", ne), r.component("TColumn", Ue), o?.customComponent) {
2531
+ M.customComponent = o.customComponent;
2532
+ for (const u in o.customComponent)
2533
+ r.component(u, o.customComponent[u]);
2462
2534
  }
2463
- }, pt = {
2464
- install: rt
2535
+ }, ht = {
2536
+ install: ut
2465
2537
  };
2466
2538
  export {
2467
2539
  P as ArrUtil,
2468
- $e as ExcelUtil,
2469
- Se as TColumn,
2470
- st as TCurd,
2471
- ct as TFile,
2472
- j as TForm,
2473
- z as TFormConfig,
2474
- g as TFormI18n,
2475
- le as TFormList,
2476
- D as TSys,
2477
- pt as default,
2478
- rt as install
2540
+ Fe as ExcelUtil,
2541
+ Ue as TColumn,
2542
+ dt as TCurd,
2543
+ mt as TFile,
2544
+ M as TForm,
2545
+ D as TFormConfig,
2546
+ b as TFormI18n,
2547
+ ne as TFormList,
2548
+ U as TSys,
2549
+ ht as default,
2550
+ ut as install
2479
2551
  };