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