cc1-form 1.2.25 → 1.2.27
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 +708 -695
- package/dist/cc1-form.umd.cjs +1 -1
- package/dist/components/TCurd/core/update.d.ts +1 -0
- package/dist/components/TCurd/index.d.ts +2784 -1
- package/dist/components/TCurd/index.vue.d.ts +8264 -24
- package/dist/components/TCurd/indexType.d.ts +5 -0
- package/package.json +1 -1
package/dist/cc1-form.js
CHANGED
|
@@ -27,7 +27,7 @@ class S {
|
|
|
27
27
|
* @param data 数据
|
|
28
28
|
* @returns 是否显示
|
|
29
29
|
*/
|
|
30
|
-
static isFun = (n, ...l) => Array.isArray(n) ? n.some((
|
|
30
|
+
static isFun = (n, ...l) => Array.isArray(n) ? n.some((a) => typeof a == "function" ? a(...l) : a) : typeof n == "function" ? n(...l) : n;
|
|
31
31
|
/**
|
|
32
32
|
* 获取路由参数,自动获取query、params中的参数, 哪个有就返回哪个
|
|
33
33
|
*/
|
|
@@ -63,18 +63,18 @@ class S {
|
|
|
63
63
|
* @param type 消息类型
|
|
64
64
|
* @param options 其他选项
|
|
65
65
|
*/
|
|
66
|
-
static showMessage(n, l,
|
|
66
|
+
static showMessage(n, l, a = {}) {
|
|
67
67
|
const i = Date.now();
|
|
68
68
|
if (!this.tipMessages[n] || i - this.tipMessages[n] > this.tipMessagesGap) {
|
|
69
69
|
this.tipMessages[n] = i;
|
|
70
|
-
const
|
|
70
|
+
const o = Object.assign(
|
|
71
71
|
{
|
|
72
72
|
message: n,
|
|
73
73
|
type: l
|
|
74
74
|
},
|
|
75
|
-
|
|
75
|
+
a
|
|
76
76
|
);
|
|
77
|
-
Ie(
|
|
77
|
+
Ie(o), setTimeout(() => {
|
|
78
78
|
delete this.tipMessages[n];
|
|
79
79
|
}, this.tipMessagesGap);
|
|
80
80
|
}
|
|
@@ -118,11 +118,11 @@ class S {
|
|
|
118
118
|
*/
|
|
119
119
|
static openUrl = (n, l = !0) => {
|
|
120
120
|
if (l) {
|
|
121
|
-
let
|
|
121
|
+
let a = screen.width / 2 - 500, i = screen.height / 2 - 800 / 2 - 30;
|
|
122
122
|
window.open(
|
|
123
123
|
n,
|
|
124
124
|
"_blank",
|
|
125
|
-
"toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + i + ", left=" +
|
|
125
|
+
"toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + i + ", left=" + a
|
|
126
126
|
);
|
|
127
127
|
} else
|
|
128
128
|
window.open(n, "DescriptiveWindowName" + StrUtil.getId(), "resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0");
|
|
@@ -132,11 +132,11 @@ class S {
|
|
|
132
132
|
* @param param
|
|
133
133
|
* @returns
|
|
134
134
|
*/
|
|
135
|
-
static getImgPic = (n) => new Promise(async (l,
|
|
135
|
+
static getImgPic = (n) => new Promise(async (l, a) => {
|
|
136
136
|
let i = document.getElementById(n.id);
|
|
137
|
-
const
|
|
137
|
+
const o = await S.loadModule("html2canvas");
|
|
138
138
|
try {
|
|
139
|
-
|
|
139
|
+
o(i, {
|
|
140
140
|
logging: !1,
|
|
141
141
|
allowTaint: !0,
|
|
142
142
|
scale: window.devicePixelRatio,
|
|
@@ -151,7 +151,7 @@ class S {
|
|
|
151
151
|
l(s);
|
|
152
152
|
});
|
|
153
153
|
} catch (t) {
|
|
154
|
-
|
|
154
|
+
a(t);
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
157
|
}
|
|
@@ -539,9 +539,9 @@ class P {
|
|
|
539
539
|
* @returns 该字段对应类型的 options 配置,如 select 类型返回 `options.select`
|
|
540
540
|
*/
|
|
541
541
|
static findOptions = (n, l) => {
|
|
542
|
-
const
|
|
543
|
-
if (
|
|
544
|
-
return
|
|
542
|
+
const a = n.column.find((o) => o.key === l), i = (o) => o.replace(/-([a-z])/g, (t, s) => s.toUpperCase());
|
|
543
|
+
if (a)
|
|
544
|
+
return a.options[i(a.type)];
|
|
545
545
|
};
|
|
546
546
|
/**
|
|
547
547
|
* 更新组件数据
|
|
@@ -559,9 +559,9 @@ class P {
|
|
|
559
559
|
}))
|
|
560
560
|
)
|
|
561
561
|
*/
|
|
562
|
-
static setOptionsData = (n, l,
|
|
562
|
+
static setOptionsData = (n, l, a) => {
|
|
563
563
|
const i = P.findOptions(n, l);
|
|
564
|
-
i && (i.data =
|
|
564
|
+
i && (i.data = a);
|
|
565
565
|
};
|
|
566
566
|
static form = {
|
|
567
567
|
openBefore: {
|
|
@@ -572,9 +572,9 @@ class P {
|
|
|
572
572
|
* @param treeData 树形数据
|
|
573
573
|
* @param option 组件配置
|
|
574
574
|
*/
|
|
575
|
-
parentId: (n, l,
|
|
576
|
-
const
|
|
577
|
-
n ? l.type === S.EDialog.Add ? (l.form.parentId = n[
|
|
575
|
+
parentId: (n, l, a, i) => {
|
|
576
|
+
const o = M.config.table.rowKey;
|
|
577
|
+
n ? l.type === S.EDialog.Add ? (l.form.parentId = n[o], l.form.sort = n.children.length + 1) : l.form.parentId = n.parentId.substring(n.parentId.lastIndexOf(",") + 1) : (l.form.parentId = "0", l.form.sort = a.length + 1), P.setOptionsData(i, "parentId", [{ [o]: "0", title: "根", children: a }]);
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
580
|
};
|
|
@@ -589,14 +589,14 @@ class N {
|
|
|
589
589
|
* @param field 字段名
|
|
590
590
|
* @param row 行数据
|
|
591
591
|
*/
|
|
592
|
-
static setId = (n, l,
|
|
592
|
+
static setId = (n, l, a) => {
|
|
593
593
|
l[n] || (l[n] = []);
|
|
594
594
|
const i = M.config.table.rowKey;
|
|
595
|
-
l[n].forEach((
|
|
596
|
-
|
|
595
|
+
l[n].forEach((o) => {
|
|
596
|
+
a.forEach((t) => {
|
|
597
597
|
let s = t.default ?? "";
|
|
598
|
-
t.type === "number" && (s = t.default ?? 0), t.type === "boolean" && (s = t.default ?? !1), t.type === "time" && (s = t.default ?? /* @__PURE__ */ new Date()),
|
|
599
|
-
}),
|
|
598
|
+
t.type === "number" && (s = t.default ?? 0), t.type === "boolean" && (s = t.default ?? !1), t.type === "time" && (s = t.default ?? /* @__PURE__ */ new Date()), o[t.value] === void 0 && (o[t.value] = s);
|
|
599
|
+
}), o[i] || (o[i] = N.getIdFun());
|
|
600
600
|
});
|
|
601
601
|
};
|
|
602
602
|
/**
|
|
@@ -606,15 +606,15 @@ class N {
|
|
|
606
606
|
* @param itemFields 元素字段-如:[{label:'',value:''}]
|
|
607
607
|
* @param callback 回调函数
|
|
608
608
|
*/
|
|
609
|
-
static add = (n, l,
|
|
610
|
-
const
|
|
611
|
-
N.setId(n, l,
|
|
609
|
+
static add = (n, l, a, i) => {
|
|
610
|
+
const o = JSONUtil.cp(a);
|
|
611
|
+
N.setId(n, l, a);
|
|
612
612
|
const t = M.config.table.rowKey;
|
|
613
613
|
l[n].push(
|
|
614
|
-
|
|
615
|
-
(s,
|
|
616
|
-
let d =
|
|
617
|
-
return
|
|
614
|
+
o.reduce(
|
|
615
|
+
(s, f) => {
|
|
616
|
+
let d = f.default ?? "";
|
|
617
|
+
return f.type === "number" && (d = f.default ?? 0), f.type === "boolean" && (d = f.default ?? !1), f.type === "time" && (d = f.default ?? /* @__PURE__ */ new Date()), s[f.value] = d, s;
|
|
618
618
|
},
|
|
619
619
|
{ [t]: N.getIdFun() }
|
|
620
620
|
)
|
|
@@ -627,9 +627,9 @@ class N {
|
|
|
627
627
|
* @param item 元素-如:{_id:''}
|
|
628
628
|
* @param callback 回调函数
|
|
629
629
|
*/
|
|
630
|
-
static remove = (n, l,
|
|
631
|
-
const
|
|
632
|
-
l[n] = l[n].filter((t) => t[
|
|
630
|
+
static remove = (n, l, a, i) => {
|
|
631
|
+
const o = M.config.table.rowKey;
|
|
632
|
+
l[n] = l[n].filter((t) => t[o] !== a[o]), i?.(l);
|
|
633
633
|
};
|
|
634
634
|
/**
|
|
635
635
|
* 获取没有id的数据
|
|
@@ -638,10 +638,10 @@ class N {
|
|
|
638
638
|
* @returns 没有id的数据
|
|
639
639
|
*/
|
|
640
640
|
static getNoIdData = (n, l) => {
|
|
641
|
-
const
|
|
642
|
-
return
|
|
643
|
-
|
|
644
|
-
}),
|
|
641
|
+
const a = JSONUtil.cp(n), i = M.config.table.rowKey;
|
|
642
|
+
return a.forEach((o) => {
|
|
643
|
+
o[i] && delete o[i], l && o[l] && N.getNoIdData(o[l], l);
|
|
644
|
+
}), a;
|
|
645
645
|
};
|
|
646
646
|
}
|
|
647
647
|
const Ze = {
|
|
@@ -690,32 +690,32 @@ const Ze = {
|
|
|
690
690
|
},
|
|
691
691
|
emits: ["change"],
|
|
692
692
|
setup(e, { emit: n }) {
|
|
693
|
-
const l = e,
|
|
693
|
+
const l = e, a = me({
|
|
694
694
|
show: !1,
|
|
695
|
-
add: (
|
|
696
|
-
N.add(
|
|
695
|
+
add: (o, t, s) => {
|
|
696
|
+
N.add(o, t, s, () => {
|
|
697
697
|
i("change");
|
|
698
698
|
});
|
|
699
699
|
},
|
|
700
|
-
remove: (
|
|
701
|
-
N.remove(
|
|
700
|
+
remove: (o, t, s) => {
|
|
701
|
+
N.remove(o, t, s, () => {
|
|
702
702
|
i("change");
|
|
703
703
|
});
|
|
704
704
|
}
|
|
705
705
|
});
|
|
706
706
|
Ve(() => {
|
|
707
|
-
N.setId(l.field, l.row, l.itemFields),
|
|
707
|
+
N.setId(l.field, l.row, l.itemFields), a.show = !0;
|
|
708
708
|
});
|
|
709
709
|
const i = n;
|
|
710
|
-
return (
|
|
711
|
-
const s = ae("el-button"),
|
|
712
|
-
return
|
|
713
|
-
k(
|
|
710
|
+
return (o, t) => {
|
|
711
|
+
const s = ae("el-button"), f = ae("el-input");
|
|
712
|
+
return a.show ? (u(), p("div", Ze, [
|
|
713
|
+
k(o.$slots, "list-start", { row: e.row }),
|
|
714
714
|
e.addBottom ? w("", !0) : (u(), p("div", _e, [
|
|
715
715
|
$(s, {
|
|
716
716
|
link: "",
|
|
717
717
|
type: "primary",
|
|
718
|
-
onClick: t[0] || (t[0] = (d) =>
|
|
718
|
+
onClick: t[0] || (t[0] = (d) => a.add(e.field, e.row, e.itemFields))
|
|
719
719
|
}, {
|
|
720
720
|
default: y(() => [...t[3] || (t[3] = [
|
|
721
721
|
V("添加", -1)
|
|
@@ -724,26 +724,26 @@ const Ze = {
|
|
|
724
724
|
})
|
|
725
725
|
])),
|
|
726
726
|
(u(!0), p(F, null, j(e.row[e.field], (d) => (u(), p("div", et, [
|
|
727
|
-
k(
|
|
727
|
+
k(o.$slots, "item-start", {
|
|
728
728
|
item: d,
|
|
729
729
|
row: e.row
|
|
730
730
|
}),
|
|
731
|
-
(u(!0), p(F, null, j(e.itemFields, (
|
|
732
|
-
modelValue: d[
|
|
733
|
-
"onUpdate:modelValue": (v) => d[
|
|
731
|
+
(u(!0), p(F, null, j(e.itemFields, (c) => (u(), h(f, {
|
|
732
|
+
modelValue: d[c.value],
|
|
733
|
+
"onUpdate:modelValue": (v) => d[c.value] = v,
|
|
734
734
|
style: de({ width: e.inputWidth }),
|
|
735
735
|
class: I(e.inputClass),
|
|
736
|
-
placeholder:
|
|
736
|
+
placeholder: c[e.label] || c[e.value],
|
|
737
737
|
onChange: t[1] || (t[1] = (v) => i("change"))
|
|
738
738
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "style", "class", "placeholder"]))), 256)),
|
|
739
|
-
k(
|
|
739
|
+
k(o.$slots, "item-end", {
|
|
740
740
|
item: d,
|
|
741
741
|
row: e.row
|
|
742
742
|
}),
|
|
743
743
|
$(s, {
|
|
744
744
|
link: "",
|
|
745
745
|
type: "danger",
|
|
746
|
-
onClick: (
|
|
746
|
+
onClick: (c) => a.remove(e.field, e.row, d)
|
|
747
747
|
}, {
|
|
748
748
|
default: y(() => [...t[4] || (t[4] = [
|
|
749
749
|
V("删除", -1)
|
|
@@ -755,7 +755,7 @@ const Ze = {
|
|
|
755
755
|
$(s, {
|
|
756
756
|
link: "",
|
|
757
757
|
type: "primary",
|
|
758
|
-
onClick: t[2] || (t[2] = (d) =>
|
|
758
|
+
onClick: t[2] || (t[2] = (d) => a.add(e.field, e.row, e.itemFields))
|
|
759
759
|
}, {
|
|
760
760
|
default: y(() => [...t[5] || (t[5] = [
|
|
761
761
|
V("添加", -1)
|
|
@@ -763,7 +763,7 @@ const Ze = {
|
|
|
763
763
|
_: 1
|
|
764
764
|
})
|
|
765
765
|
])) : w("", !0),
|
|
766
|
-
k(
|
|
766
|
+
k(o.$slots, "list-end", { row: e.row })
|
|
767
767
|
])) : w("", !0);
|
|
768
768
|
};
|
|
769
769
|
}
|
|
@@ -802,7 +802,7 @@ const Ze = {
|
|
|
802
802
|
e.item.type === "input" ? (u(), h(r(se), C({
|
|
803
803
|
key: 0,
|
|
804
804
|
modelValue: e.form[e.item.key],
|
|
805
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
805
|
+
"onUpdate:modelValue": l[0] || (l[0] = (a) => e.form[e.item.key] = a)
|
|
806
806
|
}, e.getBind(e.item), E(e.getOn(e.item)), {
|
|
807
807
|
disabled: e.getDisabled(e.item)
|
|
808
808
|
}), W({ _: 2 }, [
|
|
@@ -816,35 +816,35 @@ const Ze = {
|
|
|
816
816
|
]), 1040, ["modelValue", "disabled"])) : e.item.type === "switch" ? (u(), h(r(ie), C({
|
|
817
817
|
key: 1,
|
|
818
818
|
modelValue: e.form[e.item.key],
|
|
819
|
-
"onUpdate:modelValue": l[1] || (l[1] = (
|
|
819
|
+
"onUpdate:modelValue": l[1] || (l[1] = (a) => e.form[e.item.key] = a)
|
|
820
820
|
}, e.getBind(e.item), E(e.getOn(e.item)), {
|
|
821
821
|
disabled: e.getDisabled(e.item)
|
|
822
822
|
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "select" ? (u(), h(r(oe), C({
|
|
823
823
|
key: 2,
|
|
824
824
|
modelValue: e.form[e.item.key],
|
|
825
|
-
"onUpdate:modelValue": l[2] || (l[2] = (
|
|
825
|
+
"onUpdate:modelValue": l[2] || (l[2] = (a) => e.form[e.item.key] = a)
|
|
826
826
|
}, e.getBind(e.item), E(e.getOn(e.item)), {
|
|
827
827
|
disabled: e.getDisabled(e.item),
|
|
828
828
|
style: { width: "100%" }
|
|
829
829
|
}), {
|
|
830
830
|
default: y(() => [
|
|
831
|
-
(u(!0), p(F, null, j(e.getBind(e.item).data || [], (
|
|
832
|
-
key:
|
|
833
|
-
}, { ref_for: !0 },
|
|
831
|
+
(u(!0), p(F, null, j(e.getBind(e.item).data || [], (a) => (u(), h(r(X), C({
|
|
832
|
+
key: a.value
|
|
833
|
+
}, { ref_for: !0 }, a, E(a.on || {})), null, 16))), 128))
|
|
834
834
|
]),
|
|
835
835
|
_: 1
|
|
836
836
|
}, 16, ["modelValue", "disabled"])) : e.item.type === "radio" ? (u(), h(r(Ce), C({
|
|
837
837
|
key: 3,
|
|
838
838
|
modelValue: e.form[e.item.key],
|
|
839
|
-
"onUpdate:modelValue": l[3] || (l[3] = (
|
|
839
|
+
"onUpdate:modelValue": l[3] || (l[3] = (a) => e.form[e.item.key] = a)
|
|
840
840
|
}, e.getBind(e.item), E(e.getOn(e.item)), {
|
|
841
841
|
disabled: e.getDisabled(e.item),
|
|
842
842
|
style: { width: "100%" }
|
|
843
843
|
}), {
|
|
844
844
|
default: y(() => [
|
|
845
|
-
(u(!0), p(F, null, j(e.getBind(e.item).data || [], (
|
|
846
|
-
key:
|
|
847
|
-
}, { ref_for: !0 },
|
|
845
|
+
(u(!0), p(F, null, j(e.getBind(e.item).data || [], (a) => (u(), h(r(xe), C({
|
|
846
|
+
key: a.value
|
|
847
|
+
}, { ref_for: !0 }, a, E(a.on || {})), null, 16))), 128))
|
|
848
848
|
]),
|
|
849
849
|
_: 1
|
|
850
850
|
}, 16, ["modelValue", "disabled"])) : e.item.type === "list" ? (u(), h($e, C({
|
|
@@ -857,20 +857,20 @@ const Ze = {
|
|
|
857
857
|
}), null, 16, ["row", "field", "disabled"])) : e.item.type === "treeSelect" ? (u(), h(r(He), C({
|
|
858
858
|
key: 5,
|
|
859
859
|
modelValue: e.form[e.item.key],
|
|
860
|
-
"onUpdate:modelValue": l[4] || (l[4] = (
|
|
860
|
+
"onUpdate:modelValue": l[4] || (l[4] = (a) => e.form[e.item.key] = a)
|
|
861
861
|
}, e.getBind(e.item), E(e.getOn(e.item)), {
|
|
862
862
|
disabled: e.getDisabled(e.item),
|
|
863
863
|
style: { width: "100%" }
|
|
864
864
|
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "datetime" ? (u(), h(r(Se), C({
|
|
865
865
|
key: 6,
|
|
866
866
|
modelValue: e.form[e.item.key],
|
|
867
|
-
"onUpdate:modelValue": l[5] || (l[5] = (
|
|
867
|
+
"onUpdate:modelValue": l[5] || (l[5] = (a) => e.form[e.item.key] = a)
|
|
868
868
|
}, e.getBind(e.item), E(e.getOn(e.item)), {
|
|
869
869
|
disabled: e.getDisabled(e.item)
|
|
870
870
|
}), null, 16, ["modelValue", "disabled"])) : e.item.type && (r(P).customComponent[e.item.type] || r(P).customComponent[e.item.type]?.form) ? (u(), h(Y(r(P).customComponent[e.item.type]?.form || r(P).customComponent[e.item.type]), C({
|
|
871
871
|
key: 7,
|
|
872
872
|
modelValue: e.form[e.item.key],
|
|
873
|
-
"onUpdate:modelValue": l[6] || (l[6] = (
|
|
873
|
+
"onUpdate:modelValue": l[6] || (l[6] = (a) => e.form[e.item.key] = a)
|
|
874
874
|
}, e.getBind(e.item), E(e.getOn(e.item)), {
|
|
875
875
|
disabled: e.getDisabled(e.item)
|
|
876
876
|
}), null, 16, ["modelValue", "disabled"])) : w("", !0)
|
|
@@ -943,8 +943,8 @@ class b {
|
|
|
943
943
|
if (typeof n == "function")
|
|
944
944
|
return n(...l);
|
|
945
945
|
n = String(n);
|
|
946
|
-
let
|
|
947
|
-
return n.replace(/{([^}]+)}/g, (i,
|
|
946
|
+
let a = 0;
|
|
947
|
+
return n.replace(/{([^}]+)}/g, (i, o) => a < l.length ? String(l[a++]) : `{${o}}`);
|
|
948
948
|
}
|
|
949
949
|
static setI18n = (n) => {
|
|
950
950
|
b.curd = ObjectUtil.deepMerge(b.curd, n);
|
|
@@ -956,52 +956,52 @@ class b {
|
|
|
956
956
|
/** curd表单 */
|
|
957
957
|
static curd = rt;
|
|
958
958
|
}
|
|
959
|
-
const K = 12,
|
|
960
|
-
e.isForm = n, Array.isArray(e.children) && e.children.forEach((l) =>
|
|
959
|
+
const K = 12, ue = (e, n) => {
|
|
960
|
+
e.isForm = n, Array.isArray(e.children) && e.children.forEach((l) => ue(l, n));
|
|
961
961
|
}, st = (e) => e.isForm === !1 ? !1 : typeof e.show?.form == "boolean" ? e.show.form : !0, dt = (e, n, l) => (e.form = e.form || { span: n }, l === "column" ? e.form.span = e.form.span ?? 12 : e.form.span = e.form.span ?? n, e.form.span), ve = (e) => {
|
|
962
962
|
const n = e.form;
|
|
963
963
|
return n?.row != null && n.row > 0 ? n.row : K;
|
|
964
|
-
},
|
|
964
|
+
}, ce = (e) => Math.floor((e.gridRow - 1) / K), Ee = (e, n, l) => {
|
|
965
965
|
if (n === S.EDialog.View)
|
|
966
966
|
return e.disabled?.view === void 0 ? !0 : S.isFun(e.disabled?.view, l);
|
|
967
|
-
const
|
|
968
|
-
return S.isFun(
|
|
967
|
+
const a = e.disabled?.[n === S.EDialog.Add ? "create" : "update"];
|
|
968
|
+
return S.isFun(a, l);
|
|
969
969
|
}, De = (e, n) => e.options?.[n === S.EDialog.Add ? "formAdd" : "formUpdate"]?.[e.type] || e.options?.[e.type] || {}, Oe = (e, n, l = []) => {
|
|
970
|
-
const i = e.options?.[n === S.EDialog.Add ? "formAdd" : "formUpdate"]?.[e.type]?.on || e.options?.[e.type]?.on || {},
|
|
970
|
+
const i = e.options?.[n === S.EDialog.Add ? "formAdd" : "formUpdate"]?.[e.type]?.on || e.options?.[e.type]?.on || {}, o = {};
|
|
971
971
|
return Object.keys(i).forEach((t) => {
|
|
972
972
|
const s = i[t];
|
|
973
|
-
typeof s == "function" ?
|
|
974
|
-
return s.apply(this, [...
|
|
975
|
-
} :
|
|
976
|
-
}),
|
|
977
|
-
}, Me = (e, n, l,
|
|
978
|
-
const
|
|
973
|
+
typeof s == "function" ? o[t] = function(...f) {
|
|
974
|
+
return s.apply(this, [...f, ...l]);
|
|
975
|
+
} : o[t] = s;
|
|
976
|
+
}), o;
|
|
977
|
+
}, Me = (e, n, l, a, i) => {
|
|
978
|
+
const o = e, t = o.colSpan ?? e.span;
|
|
979
979
|
if (!e.item.form?.spanCol)
|
|
980
980
|
return t;
|
|
981
|
-
const s = i?.maxSpan || 12,
|
|
981
|
+
const s = i?.maxSpan || 12, f = i?.defaultSpan || s / 2, d = o.gridBand, v = n.filter((m) => d != null ? m.gridBand === d && !S.isFun(m.item.show?.form, l, a) : m.gridRow === o.gridRow && !S.isFun(m.item.show?.form, l, a)).reduce((m, g) => m + (g.colSpan ?? g.span ?? f), 0);
|
|
982
982
|
return t + v;
|
|
983
983
|
}, Fe = (e) => {
|
|
984
984
|
const n = /* @__PURE__ */ new Map();
|
|
985
985
|
return e.forEach((l) => {
|
|
986
|
-
const
|
|
987
|
-
n.has(
|
|
988
|
-
}), Array.from(n.keys()).sort((l,
|
|
989
|
-
}, Ue = (e) => e?.length ? Array.isArray(e[0]) ? e.flat() : e : [],
|
|
986
|
+
const a = l.gridBand ?? ce(l);
|
|
987
|
+
n.has(a) || n.set(a, []), n.get(a).push(l);
|
|
988
|
+
}), Array.from(n.keys()).sort((l, a) => l - a).map((l) => n.get(l));
|
|
989
|
+
}, Ue = (e) => e?.length ? Array.isArray(e[0]) ? e.flat() : e : [], ut = (e, n) => {
|
|
990
990
|
if (!st(e) || !e.key) return null;
|
|
991
|
-
const l = n.defaultSpan ?? (n.maxSpan || 12) / 2,
|
|
992
|
-
return { item: e, span:
|
|
993
|
-
},
|
|
994
|
-
const l = [],
|
|
991
|
+
const l = n.defaultSpan ?? (n.maxSpan || 12) / 2, a = dt(e, l, n.layout);
|
|
992
|
+
return { item: e, span: a };
|
|
993
|
+
}, ct = (e, n = {}) => {
|
|
994
|
+
const l = [], a = (i) => {
|
|
995
995
|
if (i.children?.length) {
|
|
996
|
-
i.children.forEach((t) =>
|
|
996
|
+
i.children.forEach((t) => a(t));
|
|
997
997
|
return;
|
|
998
998
|
}
|
|
999
|
-
const
|
|
1000
|
-
|
|
999
|
+
const o = ut(i, n);
|
|
1000
|
+
o && l.push(o);
|
|
1001
1001
|
};
|
|
1002
|
-
return e.forEach((i) =>
|
|
1002
|
+
return e.forEach((i) => a(i)), l;
|
|
1003
1003
|
}, Ae = (e, n = {}) => {
|
|
1004
|
-
const l = n.maxSpan ?? 12,
|
|
1004
|
+
const l = n.maxSpan ?? 12, a = n.defaultSpan ?? l / 2, i = n.layout ?? "row", t = ct(e, { maxSpan: l, defaultSpan: a, layout: i });
|
|
1005
1005
|
if (i === "column") {
|
|
1006
1006
|
const x = [];
|
|
1007
1007
|
let z = 1;
|
|
@@ -1014,12 +1014,12 @@ const K = 12, ce = (e, n) => {
|
|
|
1014
1014
|
rowSpan: L,
|
|
1015
1015
|
gridRow: z,
|
|
1016
1016
|
gridColumn: 1,
|
|
1017
|
-
gridBand:
|
|
1017
|
+
gridBand: ce({ gridRow: z })
|
|
1018
1018
|
}), z += L;
|
|
1019
1019
|
}), { cells: x, maxSpan: l };
|
|
1020
1020
|
}
|
|
1021
|
-
const s = /* @__PURE__ */ new Set(),
|
|
1022
|
-
let d = 0,
|
|
1021
|
+
const s = /* @__PURE__ */ new Set(), f = [];
|
|
1022
|
+
let d = 0, c = 0;
|
|
1023
1023
|
const v = (x) => Math.floor(x / K) * K, m = (x, z) => `${x},${z}`, g = (x, z, U, L) => {
|
|
1024
1024
|
if (z + U > l) return !1;
|
|
1025
1025
|
for (let A = 0; A < L; A++)
|
|
@@ -1044,52 +1044,52 @@ const K = 12, ce = (e, n) => {
|
|
|
1044
1044
|
}, _ = (x, z, U, L) => {
|
|
1045
1045
|
const A = v(x);
|
|
1046
1046
|
if (L < K && x + L < A + K) {
|
|
1047
|
-
d = x + L,
|
|
1047
|
+
d = x + L, c = z;
|
|
1048
1048
|
return;
|
|
1049
1049
|
}
|
|
1050
1050
|
const R = z + U;
|
|
1051
1051
|
if (R < l) {
|
|
1052
|
-
|
|
1052
|
+
c = R, d = A;
|
|
1053
1053
|
return;
|
|
1054
1054
|
}
|
|
1055
|
-
|
|
1055
|
+
c = 0, d = A + K;
|
|
1056
1056
|
};
|
|
1057
1057
|
for (const x of t) {
|
|
1058
1058
|
const z = x.span === 0 ? l : x.span, U = ve(x.item);
|
|
1059
|
-
x.item.form?.rowBreak &&
|
|
1060
|
-
let { tr: L, tc: A } = g(d,
|
|
1059
|
+
x.item.form?.rowBreak && f.length && (c = 0, d = v(d) + K);
|
|
1060
|
+
let { tr: L, tc: A } = g(d, c, z, U) ? { tr: d, tc: c } : H(d, c, z, U);
|
|
1061
1061
|
g(L, A, z, U) || ({ tr: L, tc: A } = H(0, 0, z, U)), B(L, A, z, U);
|
|
1062
1062
|
const R = L + 1;
|
|
1063
|
-
|
|
1063
|
+
f.push({
|
|
1064
1064
|
...x,
|
|
1065
1065
|
span: z,
|
|
1066
1066
|
colSpan: z,
|
|
1067
1067
|
rowSpan: U,
|
|
1068
1068
|
gridRow: R,
|
|
1069
1069
|
gridColumn: A + 1,
|
|
1070
|
-
gridBand:
|
|
1070
|
+
gridBand: ce({ gridRow: R })
|
|
1071
1071
|
}), _(L, A, z, U);
|
|
1072
1072
|
}
|
|
1073
|
-
return { cells:
|
|
1073
|
+
return { cells: f, maxSpan: l };
|
|
1074
1074
|
}, ft = (e) => e.map((n) => n.item?.show?.form), mt = (e, n, l) => {
|
|
1075
1075
|
if (!e.rules) return;
|
|
1076
|
-
const
|
|
1076
|
+
const a = typeof e.rules == "boolean" ? [
|
|
1077
1077
|
{
|
|
1078
1078
|
required: !0,
|
|
1079
1079
|
message: n(e),
|
|
1080
1080
|
trigger: "blur"
|
|
1081
1081
|
}
|
|
1082
1082
|
] : e.rules;
|
|
1083
|
-
return l ?
|
|
1084
|
-
}, Re = (e) => (n, l) => mt(n, e, (
|
|
1085
|
-
if (
|
|
1086
|
-
const i =
|
|
1083
|
+
return l ? a.map((i) => l(i)) : a;
|
|
1084
|
+
}, Re = (e) => (n, l) => mt(n, e, (a) => {
|
|
1085
|
+
if (a.validator) {
|
|
1086
|
+
const i = a.validator;
|
|
1087
1087
|
return {
|
|
1088
|
-
...
|
|
1089
|
-
validator: (
|
|
1088
|
+
...a,
|
|
1089
|
+
validator: (o, t, s) => i(o, t, s, l)
|
|
1090
1090
|
};
|
|
1091
1091
|
}
|
|
1092
|
-
return
|
|
1092
|
+
return a;
|
|
1093
1093
|
}), gt = () => Re((e) => {
|
|
1094
1094
|
const n = {
|
|
1095
1095
|
input: b.tCurd("placeholderInput"),
|
|
@@ -1097,30 +1097,30 @@ const K = 12, ce = (e, n) => {
|
|
|
1097
1097
|
};
|
|
1098
1098
|
return (n[e.type || "input"] || n.input) + e.label;
|
|
1099
1099
|
}), ht = (e, n, l) => {
|
|
1100
|
-
const
|
|
1101
|
-
e.forEach((
|
|
1102
|
-
const { cells:
|
|
1103
|
-
maxSpan:
|
|
1100
|
+
const a = {}, i = {}, o = n?.maxSpan || 12, t = n?.defaultSpan || o / 2, s = gt();
|
|
1101
|
+
e.forEach((c) => ue(c, !0)), Be(e, a, i, (c) => s(c, l));
|
|
1102
|
+
const { cells: f, maxSpan: d } = Ae(e, {
|
|
1103
|
+
maxSpan: o,
|
|
1104
1104
|
defaultSpan: t,
|
|
1105
1105
|
layout: n?.layout
|
|
1106
1106
|
});
|
|
1107
1107
|
return {
|
|
1108
|
-
formDefault:
|
|
1108
|
+
formDefault: a,
|
|
1109
1109
|
rules: i,
|
|
1110
|
-
formGrid:
|
|
1110
|
+
formGrid: f,
|
|
1111
1111
|
formMaxSpan: d,
|
|
1112
|
-
formColumn: Fe(
|
|
1112
|
+
formColumn: Fe(f)
|
|
1113
1113
|
};
|
|
1114
|
-
}, Be = (e, n, l,
|
|
1115
|
-
const i = (
|
|
1116
|
-
if (
|
|
1117
|
-
|
|
1114
|
+
}, Be = (e, n, l, a) => {
|
|
1115
|
+
const i = (o) => {
|
|
1116
|
+
if (o.children?.length) {
|
|
1117
|
+
o.children.forEach((t) => i(t));
|
|
1118
1118
|
return;
|
|
1119
1119
|
}
|
|
1120
|
-
if (
|
|
1121
|
-
n[
|
|
1122
|
-
const t = o
|
|
1123
|
-
t && (l[
|
|
1120
|
+
if (o.key) {
|
|
1121
|
+
n[o.key] = o.value;
|
|
1122
|
+
const t = a(o);
|
|
1123
|
+
t && (l[o.key] = t);
|
|
1124
1124
|
}
|
|
1125
1125
|
};
|
|
1126
1126
|
e.forEach(i);
|
|
@@ -1139,36 +1139,36 @@ const K = 12, ce = (e, n) => {
|
|
|
1139
1139
|
getDisabled: { type: Function }
|
|
1140
1140
|
},
|
|
1141
1141
|
setup(e) {
|
|
1142
|
-
const n = S.isFun, l = e,
|
|
1143
|
-
() => l.formGrid.filter((
|
|
1142
|
+
const n = S.isFun, l = e, a = te(
|
|
1143
|
+
() => l.formGrid.filter((c) => n(c.item.show?.form, l.form, l.type))
|
|
1144
1144
|
), i = te(() => ({
|
|
1145
1145
|
gridTemplateColumns: `repeat(${l.maxSpan}, minmax(0, 1fr))`
|
|
1146
|
-
})),
|
|
1147
|
-
let
|
|
1148
|
-
return
|
|
1146
|
+
})), o = te(() => {
|
|
1147
|
+
let c = 0;
|
|
1148
|
+
return a.value.forEach((v) => {
|
|
1149
1149
|
const m = v.gridRow + v.rowSpan - 1;
|
|
1150
|
-
m >
|
|
1151
|
-
}),
|
|
1152
|
-
}), t = (
|
|
1150
|
+
m > c && (c = m);
|
|
1151
|
+
}), c;
|
|
1152
|
+
}), t = (c) => c.gridRow + c.rowSpan - 1 >= o.value, s = (c) => c.rowSpan >= K, f = (c) => Me(c, l.formGrid, l.form, l.type, {
|
|
1153
1153
|
maxSpan: l.maxSpan,
|
|
1154
1154
|
defaultSpan: l.formOption?.defaultSpan
|
|
1155
|
-
}), d = (
|
|
1156
|
-
const v = c
|
|
1155
|
+
}), d = (c) => {
|
|
1156
|
+
const v = f(c) || c.colSpan;
|
|
1157
1157
|
return {
|
|
1158
|
-
gridRow: `${
|
|
1159
|
-
gridColumn: `${
|
|
1158
|
+
gridRow: `${c.gridRow} / span ${c.rowSpan}`,
|
|
1159
|
+
gridColumn: `${c.gridColumn} / span ${v}`
|
|
1160
1160
|
};
|
|
1161
1161
|
};
|
|
1162
|
-
return (
|
|
1163
|
-
k(
|
|
1162
|
+
return (c, v) => r(n)(r(ft)(e.formGrid), e.form, e.type) ? (u(), p(F, { key: 0 }, [
|
|
1163
|
+
k(c.$slots, "form-start", { row: e.form }),
|
|
1164
1164
|
O("div", {
|
|
1165
1165
|
class: I(["curd-form-grid", { stripe: e.stripe !== !1 }]),
|
|
1166
1166
|
style: de(i.value)
|
|
1167
1167
|
}, [
|
|
1168
|
-
(u(!0), p(F, null, j(
|
|
1168
|
+
(u(!0), p(F, null, j(a.value, (m) => (u(), p("div", {
|
|
1169
1169
|
key: m.item.key,
|
|
1170
1170
|
class: I(["curd-form-grid-cell", [
|
|
1171
|
-
e.stripe !== !1 && r(
|
|
1171
|
+
e.stripe !== !1 && r(ce)(m) % 2 === 0 ? "stripe-band-odd" : "",
|
|
1172
1172
|
m.gridColumn > 1 ? "has-col-border" : "",
|
|
1173
1173
|
e.stripe !== !1 && t(m) ? "is-last-row" : "",
|
|
1174
1174
|
s(m) ? "is-row-span" : "",
|
|
@@ -1188,17 +1188,17 @@ const K = 12, ce = (e, n) => {
|
|
|
1188
1188
|
"get-on": e.getOn,
|
|
1189
1189
|
"get-disabled": e.getDisabled
|
|
1190
1190
|
}, W({ _: 2 }, [
|
|
1191
|
-
j(
|
|
1191
|
+
j(c.$slots, (g, B) => ({
|
|
1192
1192
|
name: B,
|
|
1193
1193
|
fn: y((H) => [
|
|
1194
|
-
k(
|
|
1194
|
+
k(c.$slots, B, C({ ref_for: !0 }, H || {}))
|
|
1195
1195
|
])
|
|
1196
1196
|
}))
|
|
1197
1197
|
]), 1032, ["class", "item", "form", "type", "label-width", "get-bind", "get-on", "get-disabled"])) : w("", !0)
|
|
1198
1198
|
])
|
|
1199
1199
|
], 6))), 128))
|
|
1200
1200
|
], 6),
|
|
1201
|
-
k(
|
|
1201
|
+
k(c.$slots, "form-end", { row: e.form })
|
|
1202
1202
|
], 64)) : w("", !0);
|
|
1203
1203
|
}
|
|
1204
1204
|
});
|
|
@@ -1220,14 +1220,14 @@ class J {
|
|
|
1220
1220
|
* @param delAll 是否删除目标对象所有属性
|
|
1221
1221
|
* @returns
|
|
1222
1222
|
*/
|
|
1223
|
-
static setValue = (n, l,
|
|
1224
|
-
|
|
1223
|
+
static setValue = (n, l, a = !1) => {
|
|
1224
|
+
a && J.delAllKey(n), Object.keys(l).forEach((i) => {
|
|
1225
1225
|
n[i] !== l[i] && (n[i] = l[i]);
|
|
1226
1226
|
});
|
|
1227
1227
|
};
|
|
1228
1228
|
}
|
|
1229
1229
|
const fe = (e) => {
|
|
1230
|
-
const n = me({}), l = () => typeof e == "function" ? e() : e,
|
|
1230
|
+
const n = me({}), l = () => typeof e == "function" ? e() : e, a = () => {
|
|
1231
1231
|
const i = l();
|
|
1232
1232
|
return i ?? n;
|
|
1233
1233
|
};
|
|
@@ -1235,16 +1235,16 @@ const fe = (e) => {
|
|
|
1235
1235
|
internal: n,
|
|
1236
1236
|
isExternal: () => l() != null,
|
|
1237
1237
|
get() {
|
|
1238
|
-
return
|
|
1238
|
+
return a();
|
|
1239
1239
|
},
|
|
1240
1240
|
set(i) {
|
|
1241
|
-
J.setValue(
|
|
1241
|
+
J.setValue(a(), i, !0);
|
|
1242
1242
|
},
|
|
1243
1243
|
merge(i) {
|
|
1244
|
-
J.setValue(
|
|
1244
|
+
J.setValue(a(), i, !1);
|
|
1245
1245
|
},
|
|
1246
1246
|
clear() {
|
|
1247
|
-
J.delAllKey(
|
|
1247
|
+
J.delAllKey(a());
|
|
1248
1248
|
}
|
|
1249
1249
|
};
|
|
1250
1250
|
}, bt = /* @__PURE__ */ G({
|
|
@@ -1264,10 +1264,10 @@ const fe = (e) => {
|
|
|
1264
1264
|
}
|
|
1265
1265
|
},
|
|
1266
1266
|
setup(e, { expose: n }) {
|
|
1267
|
-
const l = S.EDialog,
|
|
1268
|
-
let
|
|
1267
|
+
const l = S.EDialog, a = Q(), i = e;
|
|
1268
|
+
let o = fe(i.form);
|
|
1269
1269
|
const t = ze.getConf();
|
|
1270
|
-
t?.formRef?.set("formRef-" + StrUtil.getId(),
|
|
1270
|
+
t?.formRef?.set("formRef-" + StrUtil.getId(), a);
|
|
1271
1271
|
const s = me({
|
|
1272
1272
|
rules: {},
|
|
1273
1273
|
show: !0,
|
|
@@ -1277,27 +1277,27 @@ const fe = (e) => {
|
|
|
1277
1277
|
formGrid: [],
|
|
1278
1278
|
formMaxSpan: 12,
|
|
1279
1279
|
get form() {
|
|
1280
|
-
return
|
|
1280
|
+
return o.get();
|
|
1281
1281
|
},
|
|
1282
|
-
set form(
|
|
1283
|
-
|
|
1282
|
+
set form(f) {
|
|
1283
|
+
o.set(f);
|
|
1284
1284
|
},
|
|
1285
|
-
getDisabled: (
|
|
1286
|
-
getBind: (
|
|
1287
|
-
getOn: (
|
|
1285
|
+
getDisabled: (f) => Ee(f, s.type, s.form),
|
|
1286
|
+
getBind: (f) => De(f, s.type),
|
|
1287
|
+
getOn: (f) => Oe(f, s.type, [s.form, f]),
|
|
1288
1288
|
initColumnForm: () => {
|
|
1289
|
-
const
|
|
1290
|
-
s.formDefault = d.formDefault, s.rules = d.rules, s.formGrid = d.formGrid, s.formMaxSpan = d.formMaxSpan, s.formColumn = d.formColumn, s.type === l.Add ?
|
|
1289
|
+
const f = o, d = ht(i.option.column, i.option.form, f.get());
|
|
1290
|
+
s.formDefault = d.formDefault, s.rules = d.rules, s.formGrid = d.formGrid, s.formMaxSpan = d.formMaxSpan, s.formColumn = d.formColumn, s.type === l.Add ? f.isExternal() ? f.merge(JSONUtil.cp(s.formDefault)) : f.set(JSONUtil.cp(s.formDefault)) : !f.isExternal() && i.form && f.set(JSONUtil.cp(i.form));
|
|
1291
1291
|
}
|
|
1292
1292
|
});
|
|
1293
1293
|
return s.initColumnForm(), Je(
|
|
1294
1294
|
() => i.form,
|
|
1295
|
-
(
|
|
1296
|
-
|
|
1295
|
+
(f) => {
|
|
1296
|
+
o = fe(f), s.initColumnForm();
|
|
1297
1297
|
}
|
|
1298
|
-
), n({ ref:
|
|
1298
|
+
), n({ ref: a, conf: s }), (f, d) => (u(), h(r(q), {
|
|
1299
1299
|
ref_key: "ruleFormRef",
|
|
1300
|
-
ref:
|
|
1300
|
+
ref: a,
|
|
1301
1301
|
model: s.form,
|
|
1302
1302
|
rules: s.rules
|
|
1303
1303
|
}, {
|
|
@@ -1315,10 +1315,10 @@ const fe = (e) => {
|
|
|
1315
1315
|
"get-on": s.getOn,
|
|
1316
1316
|
"get-disabled": s.getDisabled
|
|
1317
1317
|
}, W({ _: 2 }, [
|
|
1318
|
-
j(
|
|
1318
|
+
j(f.$slots, (c, v) => ({
|
|
1319
1319
|
name: v,
|
|
1320
1320
|
fn: y((m) => [
|
|
1321
|
-
k(
|
|
1321
|
+
k(f.$slots, v, be(pe(m || {})))
|
|
1322
1322
|
])
|
|
1323
1323
|
}))
|
|
1324
1324
|
]), 1032, ["form-grid", "max-span", "form", "type", "stripe", "label-width", "form-option", "get-bind", "get-on", "get-disabled"])) : w("", !0)
|
|
@@ -1338,8 +1338,8 @@ const fe = (e) => {
|
|
|
1338
1338
|
const l = Object.keys(this.map);
|
|
1339
1339
|
await Promise.all(
|
|
1340
1340
|
l.map(
|
|
1341
|
-
(
|
|
1342
|
-
i || t(!1),
|
|
1341
|
+
(a) => this.map[a]?.validate(async (i) => new Promise((o, t) => {
|
|
1342
|
+
i || t(!1), o(!0);
|
|
1343
1343
|
}))
|
|
1344
1344
|
)
|
|
1345
1345
|
), e(!0);
|
|
@@ -1359,31 +1359,31 @@ const fe = (e) => {
|
|
|
1359
1359
|
get form() {
|
|
1360
1360
|
return l.get();
|
|
1361
1361
|
},
|
|
1362
|
-
set form(
|
|
1363
|
-
l.set(
|
|
1362
|
+
set form(a) {
|
|
1363
|
+
l.set(a);
|
|
1364
1364
|
},
|
|
1365
1365
|
formDefault: {},
|
|
1366
|
-
getPlaceholder: (
|
|
1366
|
+
getPlaceholder: (a, i = b.tCurd("placeholderInput")) => a.text?.search?.placeholder === void 0 ? `${i}${a.label}` : a.text?.search?.placeholder,
|
|
1367
1367
|
getFormData: () => {
|
|
1368
|
-
const
|
|
1368
|
+
const a = e();
|
|
1369
1369
|
let i = {};
|
|
1370
1370
|
n.option.column.forEach((t) => {
|
|
1371
|
-
(typeof t.show?.search == "function" ? t.show?.search(
|
|
1371
|
+
(typeof t.show?.search == "function" ? t.show?.search(a.search.form) : t.show?.search) && (i[t.key] = a.search.form[t.key]);
|
|
1372
1372
|
});
|
|
1373
|
-
const
|
|
1374
|
-
return
|
|
1373
|
+
const o = n.option.search?.before?.(i);
|
|
1374
|
+
return o && (i = o), i;
|
|
1375
1375
|
},
|
|
1376
1376
|
reset: () => {
|
|
1377
|
-
const
|
|
1377
|
+
const a = e(), i = a.search.formDefault;
|
|
1378
1378
|
Object.keys(i).forEach((t) => {
|
|
1379
|
-
n.option.search?.resetMode === "none" ? i[t] = void 0 : i[t] =
|
|
1379
|
+
n.option.search?.resetMode === "none" ? i[t] = void 0 : i[t] = a.search.formDefault[t];
|
|
1380
1380
|
});
|
|
1381
|
-
const
|
|
1382
|
-
J.setValue(
|
|
1381
|
+
const o = ObjectUtil.deepMerge(i, {});
|
|
1382
|
+
J.setValue(a.search.form, o, !0), a.page.num = 1, n.option.init !== !1 && a.table.getList();
|
|
1383
1383
|
},
|
|
1384
1384
|
submit: () => {
|
|
1385
|
-
const
|
|
1386
|
-
|
|
1385
|
+
const a = e();
|
|
1386
|
+
a.page.num = 1, a.table.getList();
|
|
1387
1387
|
}
|
|
1388
1388
|
}
|
|
1389
1389
|
};
|
|
@@ -1397,40 +1397,40 @@ const fe = (e) => {
|
|
|
1397
1397
|
sizeList: n.option.page?.sizeList || M.config.pagination.pageSizes,
|
|
1398
1398
|
pagerCount: n.option.page?.pagerCount || M.config.pagination.pagerCount,
|
|
1399
1399
|
getQuery: (l = {}) => {
|
|
1400
|
-
const
|
|
1400
|
+
const a = e();
|
|
1401
1401
|
return {
|
|
1402
|
-
[M.config.field.page.size]: l.size ||
|
|
1403
|
-
[M.config.field.page.num]: l.num ||
|
|
1404
|
-
...
|
|
1402
|
+
[M.config.field.page.size]: l.size || a.page.size,
|
|
1403
|
+
[M.config.field.page.num]: l.num || a.page.num,
|
|
1404
|
+
...a.search.getFormData()
|
|
1405
1405
|
};
|
|
1406
1406
|
}
|
|
1407
1407
|
}
|
|
1408
1408
|
}), kt = (e, n, l) => ({
|
|
1409
1409
|
table: {
|
|
1410
1410
|
op: {
|
|
1411
|
-
width: (...
|
|
1411
|
+
width: (...a) => a.filter((o) => o).length * 30 + 60
|
|
1412
1412
|
},
|
|
1413
1413
|
loading: !1,
|
|
1414
1414
|
data: [],
|
|
1415
1415
|
expand: {
|
|
1416
1416
|
isExpand: !1,
|
|
1417
1417
|
rowKeys: [],
|
|
1418
|
-
change: (
|
|
1418
|
+
change: (a, i) => {
|
|
1419
1419
|
},
|
|
1420
1420
|
all: () => {
|
|
1421
|
-
const
|
|
1422
|
-
if (
|
|
1423
|
-
|
|
1421
|
+
const a = e();
|
|
1422
|
+
if (a.table.expand.isExpand)
|
|
1423
|
+
a.table.expand.rowKeys = [];
|
|
1424
1424
|
else {
|
|
1425
|
-
const i = (
|
|
1425
|
+
const i = (o) => {
|
|
1426
1426
|
let t = [];
|
|
1427
|
-
return
|
|
1427
|
+
return o.forEach((s) => {
|
|
1428
1428
|
t.push(s[n.option.table.rowKey]), s.children?.length && (t = t.concat(i(s.children)));
|
|
1429
1429
|
}), t;
|
|
1430
1430
|
};
|
|
1431
|
-
|
|
1431
|
+
a.table.expand.rowKeys = i(a.table.data);
|
|
1432
1432
|
}
|
|
1433
|
-
|
|
1433
|
+
a.table.expand.isExpand = !a.table.expand.isExpand;
|
|
1434
1434
|
}
|
|
1435
1435
|
},
|
|
1436
1436
|
column: {
|
|
@@ -1444,95 +1444,95 @@ const fe = (e) => {
|
|
|
1444
1444
|
group: {
|
|
1445
1445
|
expand: !1,
|
|
1446
1446
|
toggleExpandAll: () => {
|
|
1447
|
-
const
|
|
1448
|
-
|
|
1449
|
-
const
|
|
1447
|
+
const a = e(), i = !a.table.header.group.expand;
|
|
1448
|
+
a.table.header.group.expand = i;
|
|
1449
|
+
const o = (t) => {
|
|
1450
1450
|
t.forEach((s) => {
|
|
1451
|
-
s.table?.header?.group !== void 0 && (s.table.header.group = !i), s.table?.header?.groupKey !== void 0 && (s.table.header.show = i), Array.isArray(s.children) && s.children.length &&
|
|
1451
|
+
s.table?.header?.group !== void 0 && (s.table.header.group = !i), s.table?.header?.groupKey !== void 0 && (s.table.header.show = i), Array.isArray(s.children) && s.children.length && o(s.children);
|
|
1452
1452
|
});
|
|
1453
1453
|
};
|
|
1454
|
-
a
|
|
1454
|
+
o(a.table.column.list);
|
|
1455
1455
|
}
|
|
1456
1456
|
}
|
|
1457
1457
|
},
|
|
1458
1458
|
getList: async () => {
|
|
1459
|
-
const
|
|
1460
|
-
|
|
1461
|
-
const i = n.option.api.list,
|
|
1459
|
+
const a = e();
|
|
1460
|
+
a.table.loading = !0;
|
|
1461
|
+
const i = n.option.api.list, o = JSONUtil.cp(a.table.selection.list);
|
|
1462
1462
|
try {
|
|
1463
|
-
await
|
|
1463
|
+
await a.initApiData("init");
|
|
1464
1464
|
let t = {};
|
|
1465
|
-
if (
|
|
1465
|
+
if (a.table.sort.prop) {
|
|
1466
1466
|
const { props: B, order: H } = M.config.table.sort;
|
|
1467
1467
|
t = {
|
|
1468
|
-
[B.field]:
|
|
1469
|
-
[H.field]:
|
|
1468
|
+
[B.field]: a.table.sort.prop,
|
|
1469
|
+
[H.field]: a.table.sort.order
|
|
1470
1470
|
};
|
|
1471
1471
|
}
|
|
1472
1472
|
const s = await i({
|
|
1473
|
-
...
|
|
1473
|
+
...a.page.getQuery(),
|
|
1474
1474
|
...t
|
|
1475
|
-
}),
|
|
1475
|
+
}), f = M.config.field.result, d = s.data || { [f.list]: s }, c = (Array.isArray(d[f.list]), d[f.list]), v = Ue(a.update.formGrid?.length ? a.update.formGrid : a.update.formColumn), g = ObjectUtil.deepMerge({ data: c }, {}).data.map((B) => (Object.keys(B).forEach((_) => {
|
|
1476
1476
|
const x = v.find((z) => z.item.key === _);
|
|
1477
1477
|
x && ["select", "radio"].includes(x.item.type) && (x.item.table.format || (x.item.table.format = (z) => x.item.options[x.item.type].data?.find((U) => U.value == z[_])?.label || z[_]));
|
|
1478
1478
|
}), B));
|
|
1479
|
-
|
|
1480
|
-
|
|
1479
|
+
a.table.data = n.option.data ? await n.option.data(g, c) : g, a.page.total = d[f.total] || 0, setTimeout(() => {
|
|
1480
|
+
a.table.selection.setList(o);
|
|
1481
1481
|
}, 20);
|
|
1482
1482
|
} catch (t) {
|
|
1483
1483
|
console.error(t);
|
|
1484
1484
|
} finally {
|
|
1485
|
-
|
|
1485
|
+
a.table.loading = !1;
|
|
1486
1486
|
}
|
|
1487
1487
|
},
|
|
1488
1488
|
selection: {
|
|
1489
1489
|
list: [],
|
|
1490
|
-
change: (
|
|
1491
|
-
e().table.selection.list =
|
|
1490
|
+
change: (a) => {
|
|
1491
|
+
e().table.selection.list = a;
|
|
1492
1492
|
},
|
|
1493
|
-
setList: (
|
|
1494
|
-
const
|
|
1495
|
-
|
|
1493
|
+
setList: (a, i) => {
|
|
1494
|
+
const o = e();
|
|
1495
|
+
o.table.selection.list = [];
|
|
1496
1496
|
const t = l.tableRef.value;
|
|
1497
|
-
if (t?.clearSelection(), !t || !
|
|
1498
|
-
const s = n.option.table?.rowKey,
|
|
1499
|
-
const
|
|
1497
|
+
if (t?.clearSelection(), !t || !a?.length) return;
|
|
1498
|
+
const s = n.option.table?.rowKey, f = (d) => {
|
|
1499
|
+
const c = (v) => {
|
|
1500
1500
|
for (const m of v) {
|
|
1501
1501
|
if (s != null && s !== "") {
|
|
1502
1502
|
if (m[s] === d[s]) return m;
|
|
1503
1503
|
} else if (m === d)
|
|
1504
1504
|
return m;
|
|
1505
1505
|
if (Array.isArray(m.children) && m.children.length) {
|
|
1506
|
-
const g =
|
|
1506
|
+
const g = c(m.children);
|
|
1507
1507
|
if (g !== void 0) return g;
|
|
1508
1508
|
}
|
|
1509
1509
|
}
|
|
1510
1510
|
};
|
|
1511
|
-
return
|
|
1511
|
+
return c(o.table.data);
|
|
1512
1512
|
};
|
|
1513
|
-
|
|
1514
|
-
const
|
|
1515
|
-
if (
|
|
1513
|
+
a.forEach((d) => {
|
|
1514
|
+
const c = f(d);
|
|
1515
|
+
if (c)
|
|
1516
1516
|
if (i) {
|
|
1517
|
-
const v = () => t.toggleRowSelection(
|
|
1517
|
+
const v = () => t.toggleRowSelection(c, !0, !1);
|
|
1518
1518
|
i(d) !== !1 && v();
|
|
1519
1519
|
} else
|
|
1520
|
-
t.toggleRowSelection(
|
|
1520
|
+
t.toggleRowSelection(c, !0, !1);
|
|
1521
1521
|
});
|
|
1522
1522
|
}
|
|
1523
1523
|
},
|
|
1524
1524
|
sort: {
|
|
1525
1525
|
prop: "",
|
|
1526
1526
|
order: "",
|
|
1527
|
-
change: (
|
|
1527
|
+
change: (a) => {
|
|
1528
1528
|
const i = e();
|
|
1529
1529
|
M.config.table.sort.resetPage && (i.page.num = 1);
|
|
1530
|
-
const
|
|
1531
|
-
if (
|
|
1532
|
-
|
|
1530
|
+
const o = M.config.table.sort;
|
|
1531
|
+
if (o.change) {
|
|
1532
|
+
o.change(a, i);
|
|
1533
1533
|
return;
|
|
1534
1534
|
}
|
|
1535
|
-
i.table.sort.prop =
|
|
1535
|
+
i.table.sort.prop = a.prop, a.order === null ? (i.table.sort.order = "", i.table.sort.prop = "") : i.table.sort.order = a.order === "ascending" ? o.order.asc : o.order.desc, i.table.getList();
|
|
1536
1536
|
}
|
|
1537
1537
|
}
|
|
1538
1538
|
}
|
|
@@ -1545,15 +1545,15 @@ class Ct {
|
|
|
1545
1545
|
* @param columns - 列配置数组,需包含 `key`(数据字段)和 `label`(Excel 表头)
|
|
1546
1546
|
* @param fileName - 文件名(不含扩展名),支持字符串或返回字符串的函数;默认生成「导出数据_日期_时间戳」
|
|
1547
1547
|
*/
|
|
1548
|
-
static exportToExcel = async (n, l,
|
|
1548
|
+
static exportToExcel = async (n, l, a) => {
|
|
1549
1549
|
if (!n || n.length === 0) return;
|
|
1550
|
-
const i = await S.loadModule("xlsx"),
|
|
1550
|
+
const i = await S.loadModule("xlsx"), o = n.map((f) => {
|
|
1551
1551
|
const d = {};
|
|
1552
|
-
return l.forEach((
|
|
1553
|
-
d[
|
|
1552
|
+
return l.forEach((c) => {
|
|
1553
|
+
d[c.label] = f[c.key];
|
|
1554
1554
|
}), d;
|
|
1555
|
-
}), t = i.utils.json_to_sheet(
|
|
1556
|
-
i.utils.book_append_sheet(s, t, "Sheet1"),
|
|
1555
|
+
}), t = i.utils.json_to_sheet(o), s = i.utils.book_new();
|
|
1556
|
+
i.utils.book_append_sheet(s, t, "Sheet1"), a ? typeof a == "function" && (a = a()) : a = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, i.writeFile(s, `${a}.xlsx`);
|
|
1557
1557
|
};
|
|
1558
1558
|
}
|
|
1559
1559
|
const xt = (e, n) => ({
|
|
@@ -1561,7 +1561,7 @@ const xt = (e, n) => ({
|
|
|
1561
1561
|
run: {
|
|
1562
1562
|
start: async (l) => {
|
|
1563
1563
|
let i = await e().export.run[l]();
|
|
1564
|
-
const
|
|
1564
|
+
const o = n.option.column, t = ObjectUtil.deepMerge({ data: i, columns: o }, {}), s = n.option.tools?.export || {};
|
|
1565
1565
|
s.before?.(t), Ct.exportToExcel(t.data, t.columns, s.fileName);
|
|
1566
1566
|
},
|
|
1567
1567
|
select: async () => {
|
|
@@ -1578,8 +1578,8 @@ const xt = (e, n) => ({
|
|
|
1578
1578
|
if (l.table.selection.list.length === 0)
|
|
1579
1579
|
throw S.fail(b.tCurd("selectDataToExport")), new Error(b.tCurd("selectDataToExport"));
|
|
1580
1580
|
return l.table.selection.list;
|
|
1581
|
-
} catch (
|
|
1582
|
-
console.error(
|
|
1581
|
+
} catch (a) {
|
|
1582
|
+
console.error(a);
|
|
1583
1583
|
} finally {
|
|
1584
1584
|
l.export.loading = !1;
|
|
1585
1585
|
}
|
|
@@ -1597,8 +1597,8 @@ const xt = (e, n) => ({
|
|
|
1597
1597
|
if (l.table.data.length === 0)
|
|
1598
1598
|
throw S.fail(b.tCurd("noData")), new Error(b.tCurd("noData"));
|
|
1599
1599
|
return l.table.data;
|
|
1600
|
-
} catch (
|
|
1601
|
-
console.error(
|
|
1600
|
+
} catch (a) {
|
|
1601
|
+
console.error(a);
|
|
1602
1602
|
} finally {
|
|
1603
1603
|
l.export.loading = !1;
|
|
1604
1604
|
}
|
|
@@ -1613,12 +1613,12 @@ const xt = (e, n) => ({
|
|
|
1613
1613
|
});
|
|
1614
1614
|
return;
|
|
1615
1615
|
}
|
|
1616
|
-
const
|
|
1616
|
+
const a = n.option.api.list, i = await a({
|
|
1617
1617
|
...l.page.getQuery({ size: 999999, num: 1 })
|
|
1618
1618
|
});
|
|
1619
1619
|
return (i.data || { [M.config.field.result.list]: i })[M.config.field.result.list];
|
|
1620
|
-
} catch (
|
|
1621
|
-
console.error(
|
|
1620
|
+
} catch (a) {
|
|
1621
|
+
console.error(a);
|
|
1622
1622
|
} finally {
|
|
1623
1623
|
l.export.loading = !1;
|
|
1624
1624
|
}
|
|
@@ -1626,12 +1626,12 @@ const xt = (e, n) => ({
|
|
|
1626
1626
|
},
|
|
1627
1627
|
loading: !1,
|
|
1628
1628
|
click: (l) => {
|
|
1629
|
-
const
|
|
1630
|
-
|
|
1629
|
+
const a = e();
|
|
1630
|
+
a.export.loading || a.export.run.start(l);
|
|
1631
1631
|
}
|
|
1632
1632
|
}
|
|
1633
1633
|
}), le = S.EDialog, St = (e, n, l) => {
|
|
1634
|
-
const
|
|
1634
|
+
const a = fe(() => n.form);
|
|
1635
1635
|
return {
|
|
1636
1636
|
update: {
|
|
1637
1637
|
title: "",
|
|
@@ -1641,35 +1641,35 @@ const xt = (e, n) => ({
|
|
|
1641
1641
|
loading: !1,
|
|
1642
1642
|
type: le.Update,
|
|
1643
1643
|
get form() {
|
|
1644
|
-
return
|
|
1644
|
+
return a.get();
|
|
1645
1645
|
},
|
|
1646
1646
|
set form(i) {
|
|
1647
|
-
|
|
1647
|
+
a.set(i);
|
|
1648
1648
|
},
|
|
1649
1649
|
formDefault: {},
|
|
1650
1650
|
formColumn: [],
|
|
1651
1651
|
formGrid: [],
|
|
1652
1652
|
formMaxSpan: 12,
|
|
1653
|
-
getDisabled: (i,
|
|
1653
|
+
getDisabled: (i, o = !1) => {
|
|
1654
1654
|
const t = e();
|
|
1655
|
-
return n.option.table?.editMode &&
|
|
1655
|
+
return n.option.table?.editMode && o ? i.disabled?.table === void 0 ? !1 : S.isFun(i.disabled?.table, t.update.form) : Ee(i, t.update.type, t.update.form);
|
|
1656
1656
|
},
|
|
1657
1657
|
getBind: (i) => {
|
|
1658
|
-
const
|
|
1659
|
-
return De(i,
|
|
1658
|
+
const o = e();
|
|
1659
|
+
return De(i, o.update.type);
|
|
1660
1660
|
},
|
|
1661
|
-
getOn: (i,
|
|
1661
|
+
getOn: (i, o) => {
|
|
1662
1662
|
const t = e();
|
|
1663
|
-
return Oe(i, t.update.type, [
|
|
1663
|
+
return Oe(i, t.update.type, [o || t.update.form, i]);
|
|
1664
1664
|
},
|
|
1665
1665
|
getOptions: (i) => {
|
|
1666
|
-
const
|
|
1666
|
+
const o = e();
|
|
1667
1667
|
try {
|
|
1668
|
-
const s = Ue(
|
|
1668
|
+
const s = Ue(o.update.formGrid?.length ? o.update.formGrid : o.update.formColumn).find((f) => f.item.key === i)?.item;
|
|
1669
1669
|
return s ? {
|
|
1670
1670
|
options: s.options,
|
|
1671
1671
|
//@ts-ignore
|
|
1672
|
-
bind:
|
|
1672
|
+
bind: o.update.getBind(s)
|
|
1673
1673
|
} : { options: {}, bind: {} };
|
|
1674
1674
|
} catch {
|
|
1675
1675
|
return { options: {}, bind: {} };
|
|
@@ -1678,27 +1678,27 @@ const xt = (e, n) => ({
|
|
|
1678
1678
|
edit: {
|
|
1679
1679
|
data: {},
|
|
1680
1680
|
getApiData: (i) => {
|
|
1681
|
-
const
|
|
1681
|
+
const o = e();
|
|
1682
1682
|
if (n.option.form?.editAll) return i;
|
|
1683
1683
|
const t = {
|
|
1684
|
-
[n.option.table?.rowKey]:
|
|
1684
|
+
[n.option.table?.rowKey]: o.update.edit.data[n.option.table?.rowKey]
|
|
1685
1685
|
};
|
|
1686
|
-
return Object.keys(
|
|
1687
|
-
i[s] !==
|
|
1686
|
+
return Object.keys(o.update.edit.data).forEach((s) => {
|
|
1687
|
+
i[s] !== o.update.edit.data[s] && (t[s] = i[s]);
|
|
1688
1688
|
}), t;
|
|
1689
1689
|
}
|
|
1690
1690
|
},
|
|
1691
1691
|
view: {},
|
|
1692
|
-
open: (i,
|
|
1692
|
+
open: (i, o) => {
|
|
1693
1693
|
const t = e();
|
|
1694
1694
|
t.update.showContent || FunUtil.throttle(async () => {
|
|
1695
1695
|
S.loading(!0);
|
|
1696
1696
|
try {
|
|
1697
1697
|
t.update.type = i;
|
|
1698
1698
|
const s = i === le.Add;
|
|
1699
|
-
t.update.edit.data = s ? void 0 : JSONUtil.cp(
|
|
1700
|
-
const
|
|
1701
|
-
J.setValue(t.update.form,
|
|
1699
|
+
t.update.edit.data = s ? void 0 : JSONUtil.cp(o), t.update.title = b.tCurd(s ? "add" : i === le.View ? "view" : "edit");
|
|
1700
|
+
const f = s ? ObjectUtil.deepMerge(JSONUtil.cp(t.update.formDefault), o ? JSONUtil.cp(o) : {}) : JSONUtil.cp(o);
|
|
1701
|
+
J.setValue(t.update.form, f, !0), await t.initApiData("update"), await n.option.form?.openBefore?.(t.update.form, t.update), (!n.option.table?.inlineEdit || s) && (t.update.show = !0, t.update.showContent = !0), n.option.form?.openAfter?.(t.update.form, t.update);
|
|
1702
1702
|
} catch (s) {
|
|
1703
1703
|
console.error(s);
|
|
1704
1704
|
} finally {
|
|
@@ -1706,42 +1706,45 @@ const xt = (e, n) => ({
|
|
|
1706
1706
|
}
|
|
1707
1707
|
});
|
|
1708
1708
|
},
|
|
1709
|
+
validate: async () => {
|
|
1710
|
+
const i = e();
|
|
1711
|
+
try {
|
|
1712
|
+
return await Promise.all([
|
|
1713
|
+
l.ruleFormRef.value?.validate(async (o) => new Promise((t, s) => {
|
|
1714
|
+
o || s(!1), t(void 0);
|
|
1715
|
+
})),
|
|
1716
|
+
i.formRef.validate()
|
|
1717
|
+
]), !0;
|
|
1718
|
+
} catch {
|
|
1719
|
+
S.fail(b.tCurd("checkFormData"));
|
|
1720
|
+
}
|
|
1721
|
+
},
|
|
1709
1722
|
submit: () => {
|
|
1710
1723
|
FunUtil.throttle(async () => {
|
|
1711
1724
|
const i = e();
|
|
1712
|
-
|
|
1713
|
-
await Promise.all([
|
|
1714
|
-
l.ruleFormRef.value?.validate(async (c) => new Promise((d, f) => {
|
|
1715
|
-
c || f(!1), d(void 0);
|
|
1716
|
-
})),
|
|
1717
|
-
i.formRef.validate()
|
|
1718
|
-
]);
|
|
1719
|
-
} catch {
|
|
1720
|
-
S.fail(b.tCurd("checkFormData"));
|
|
1721
|
-
return;
|
|
1722
|
-
}
|
|
1725
|
+
if (!await i.update.validate()) return;
|
|
1723
1726
|
i.update.loading = !0;
|
|
1724
|
-
const
|
|
1727
|
+
const t = i.update.type === le.Add ? n.option.api.create : n.option.api.update;
|
|
1725
1728
|
try {
|
|
1726
1729
|
await n.option.form?.submitBefore?.(i.update.form, i.update);
|
|
1727
1730
|
} catch {
|
|
1728
1731
|
i.update.loading = !1;
|
|
1729
1732
|
return;
|
|
1730
1733
|
}
|
|
1731
|
-
let
|
|
1732
|
-
delete
|
|
1733
|
-
const
|
|
1734
|
-
Object.keys(
|
|
1735
|
-
if (
|
|
1736
|
-
const
|
|
1737
|
-
isNaN(
|
|
1734
|
+
let s = ObjectUtil.deepMerge(i.update.form, {});
|
|
1735
|
+
delete s.children;
|
|
1736
|
+
const f = new Set(n.option.column.filter((d) => d.type === "datetime").map((d) => d.key));
|
|
1737
|
+
Object.keys(s).forEach((d) => {
|
|
1738
|
+
if (f.has(d) && s[d] != null) {
|
|
1739
|
+
const c = new Date(s[d]).getTime();
|
|
1740
|
+
isNaN(c) || (s[d] = c);
|
|
1738
1741
|
}
|
|
1739
1742
|
});
|
|
1740
1743
|
try {
|
|
1741
|
-
if (!
|
|
1742
|
-
await
|
|
1743
|
-
} catch (
|
|
1744
|
-
console.error(
|
|
1744
|
+
if (!t) return;
|
|
1745
|
+
await t({ ...s }), i.update.close(), await i.table.getList(), n.option.form?.submitAfter?.(s, i.update);
|
|
1746
|
+
} catch (d) {
|
|
1747
|
+
console.error(d);
|
|
1745
1748
|
} finally {
|
|
1746
1749
|
i.update.loading = !1;
|
|
1747
1750
|
}
|
|
@@ -1750,7 +1753,7 @@ const xt = (e, n) => ({
|
|
|
1750
1753
|
close: () => {
|
|
1751
1754
|
const i = e();
|
|
1752
1755
|
i.update.show = !1, i.update.edit.data = void 0, setTimeout(() => {
|
|
1753
|
-
i.update.showContent = !1, l.ruleFormRef.value?.resetFields?.(),
|
|
1756
|
+
i.update.showContent = !1, l.ruleFormRef.value?.resetFields?.(), a.clear();
|
|
1754
1757
|
}, 350);
|
|
1755
1758
|
}
|
|
1756
1759
|
}
|
|
@@ -1769,17 +1772,17 @@ const xt = (e, n) => ({
|
|
|
1769
1772
|
S.fail(b.tCurd("selectDataToDelete"));
|
|
1770
1773
|
return;
|
|
1771
1774
|
}
|
|
1772
|
-
const
|
|
1773
|
-
|
|
1775
|
+
const a = e();
|
|
1776
|
+
a.remove.items = l, a.remove.show = !0;
|
|
1774
1777
|
},
|
|
1775
1778
|
submit: () => {
|
|
1776
1779
|
FunUtil.throttle(async () => {
|
|
1777
1780
|
const l = e();
|
|
1778
1781
|
l.remove.loading = !0;
|
|
1779
|
-
const
|
|
1782
|
+
const a = n.option.api.delete;
|
|
1780
1783
|
try {
|
|
1781
|
-
if (!
|
|
1782
|
-
await
|
|
1784
|
+
if (!a) return;
|
|
1785
|
+
await a({
|
|
1783
1786
|
[n.option.table?.rowKey]: l.remove.items.map((i) => i[n.option.table?.rowKey]),
|
|
1784
1787
|
items: l.remove.items
|
|
1785
1788
|
}), S.success(b.tCurd("operationSuccess")), l.table.data.length <= 1 && l.page.num > 1 && (l.page.num -= 1), l.remove.close(), await l.table.getList();
|
|
@@ -1793,50 +1796,50 @@ const xt = (e, n) => ({
|
|
|
1793
1796
|
}
|
|
1794
1797
|
}), zt = (e, n, l) => ({
|
|
1795
1798
|
apiDataMap: {},
|
|
1796
|
-
getColumnSpan: (
|
|
1797
|
-
const
|
|
1798
|
-
return Me(
|
|
1799
|
-
maxSpan:
|
|
1799
|
+
getColumnSpan: (a, i) => {
|
|
1800
|
+
const o = e(), t = o.update.formGrid?.length ? o.update.formGrid : i || [];
|
|
1801
|
+
return Me(a, t, o.update.form, o.update.type, {
|
|
1802
|
+
maxSpan: o.update.formMaxSpan || n.option.form?.maxSpan,
|
|
1800
1803
|
defaultSpan: n.option.form?.defaultSpan || M.config.form.defaultSpan
|
|
1801
1804
|
});
|
|
1802
1805
|
},
|
|
1803
1806
|
init: () => {
|
|
1804
|
-
const
|
|
1805
|
-
|
|
1807
|
+
const a = e();
|
|
1808
|
+
a.initCurdConfig(), a.initColumnOptions(), a.initColumnForm();
|
|
1806
1809
|
},
|
|
1807
|
-
initApiData: async (
|
|
1808
|
-
const i = e(),
|
|
1810
|
+
initApiData: async (a) => {
|
|
1811
|
+
const i = e(), o = [], t = (s) => {
|
|
1809
1812
|
if (s.children?.length) {
|
|
1810
|
-
s.children.forEach((
|
|
1813
|
+
s.children.forEach((f) => t(f));
|
|
1811
1814
|
return;
|
|
1812
1815
|
}
|
|
1813
|
-
if (s.options?.[s.type]?.dataApi && s.options?.[s.type]?.dataApiConfig?.[
|
|
1816
|
+
if (s.options?.[s.type]?.dataApi && s.options?.[s.type]?.dataApiConfig?.[a]) {
|
|
1814
1817
|
if (i.apiDataMap[s.key] && s.options?.[s.type]?.dataApiConfig?.once) return;
|
|
1815
|
-
const
|
|
1818
|
+
const f = (async () => {
|
|
1816
1819
|
try {
|
|
1817
1820
|
let d = await s.options?.[s.type]?.dataApi?.(i.update.form, i.update.type);
|
|
1818
1821
|
if (d) {
|
|
1819
|
-
const
|
|
1820
|
-
!Array.isArray(d) &&
|
|
1822
|
+
const c = s.options?.[s.type]?.dataPath;
|
|
1823
|
+
!Array.isArray(d) && c && (d = ObjectUtil.getPathValue(d, c)), s.options[s.type].data = d, s.options.search[s.type].data = d, s.options.search[s.options.search.type ?? s.type] || (s.options.search[s.options.search.type ?? s.type] = {}), s.options.search[s.options.search.type ?? s.type].data = d, s.options.formAdd[s.type].data = d, s.options.formUpdate[s.type].data = d, i.apiDataMap[s.key] = d;
|
|
1821
1824
|
}
|
|
1822
1825
|
} catch {
|
|
1823
1826
|
}
|
|
1824
1827
|
})();
|
|
1825
|
-
|
|
1828
|
+
o.push(f);
|
|
1826
1829
|
}
|
|
1827
1830
|
};
|
|
1828
|
-
return n.option.column.forEach((s) => t(s)), await Promise.all(
|
|
1831
|
+
return n.option.column.forEach((s) => t(s)), await Promise.all(o), !0;
|
|
1829
1832
|
},
|
|
1830
1833
|
initCurdConfig: () => {
|
|
1831
|
-
const
|
|
1832
|
-
|
|
1833
|
-
const i = ObjectUtil.deepMerge(
|
|
1834
|
-
Object.keys(i).forEach((
|
|
1835
|
-
n.option[
|
|
1834
|
+
const a = ObjectUtil.deepMerge(M.config, {});
|
|
1835
|
+
a.table.emptyText = b.tCurd("noData"), n.option.size = n.option.size || {}, a.table.size = n.option.size.table || a.size.table, a.form.size = n.option.size.form || a.size.form, a.size.search = n.option.size.search || a.size.search;
|
|
1836
|
+
const i = ObjectUtil.deepMerge(a, n.option || {});
|
|
1837
|
+
Object.keys(i).forEach((o) => {
|
|
1838
|
+
n.option[o] = i[o];
|
|
1836
1839
|
});
|
|
1837
1840
|
},
|
|
1838
1841
|
initColumnOptions: () => {
|
|
1839
|
-
const
|
|
1842
|
+
const a = e();
|
|
1840
1843
|
let i = JSONUtil.cp(M.config.columnConfig);
|
|
1841
1844
|
i.options = ObjectUtil.deepMerge(
|
|
1842
1845
|
{
|
|
@@ -1847,11 +1850,11 @@ const xt = (e, n) => ({
|
|
|
1847
1850
|
},
|
|
1848
1851
|
i.options
|
|
1849
1852
|
);
|
|
1850
|
-
const
|
|
1853
|
+
const o = (t) => {
|
|
1851
1854
|
for (const s in i) {
|
|
1852
1855
|
if (s === "table") {
|
|
1853
1856
|
if (t.table = ObjectUtil.deepMerge(i.table, t.table || {}), t.children) {
|
|
1854
|
-
t.children.forEach((d) =>
|
|
1857
|
+
t.children.forEach((d) => o(d));
|
|
1855
1858
|
return;
|
|
1856
1859
|
}
|
|
1857
1860
|
} else s === "type" ? t.type = t.type || i.type : t[s] = ObjectUtil.deepMerge(i[s], t[s] || {});
|
|
@@ -1859,7 +1862,7 @@ const xt = (e, n) => ({
|
|
|
1859
1862
|
t.options[d] = t.options[d] || ObjectUtil.deepMerge(t.options, {}), t.options[d][t.type] = t.options[d][t.type] || {}, t.options[d][t.type].size = d === "search" ? n.option.size.search : n.option.size.form;
|
|
1860
1863
|
}), t.table = ObjectUtil.deepMerge(t.table, t.options[t.type].table || {});
|
|
1861
1864
|
}
|
|
1862
|
-
t.type === "switch" && (t.options.switch.tableBeforeChange = async (s,
|
|
1865
|
+
t.type === "switch" && (t.options.switch.tableBeforeChange = async (s, f) => {
|
|
1863
1866
|
const d = t.options?.switch;
|
|
1864
1867
|
try {
|
|
1865
1868
|
d.tableConfig?.confirm && await l.switchConfirmRef.value?.open({
|
|
@@ -1868,106 +1871,105 @@ const xt = (e, n) => ({
|
|
|
1868
1871
|
});
|
|
1869
1872
|
try {
|
|
1870
1873
|
if (!n.option.api.update && !d.tableConfig?.api) return;
|
|
1871
|
-
const
|
|
1872
|
-
d.loadingMap || (d.loadingMap = {}), d.loadingMap[
|
|
1873
|
-
const v =
|
|
1874
|
+
const c = f[n.option.table?.rowKey];
|
|
1875
|
+
d.loadingMap || (d.loadingMap = {}), d.loadingMap[c] || (d.loadingMap[c] = { loading: !1 }), d.loadingMap[c].loading = !0;
|
|
1876
|
+
const v = f[s] === d.activeValue ? d.inactiveValue : d.activeValue, m = d.tableConfig?.api ? d.tableConfig.api : n.option.api.update;
|
|
1874
1877
|
if (!m) return;
|
|
1875
1878
|
try {
|
|
1876
|
-
await m({ ...
|
|
1879
|
+
await m({ ...f, [s]: v }, "switch");
|
|
1877
1880
|
} catch {
|
|
1878
1881
|
return !1;
|
|
1879
1882
|
} finally {
|
|
1880
|
-
d.loadingMap[
|
|
1883
|
+
d.loadingMap[c].loading = !1;
|
|
1881
1884
|
}
|
|
1882
|
-
return S.success(b.tCurd("operationSuccess")), d.tableConfig?.loadList && (
|
|
1883
|
-
} catch (
|
|
1884
|
-
return console.error(
|
|
1885
|
+
return S.success(b.tCurd("operationSuccess")), d.tableConfig?.loadList && (a.table.loading = !0, a.table.getList(), a.table.loading = !1), !0;
|
|
1886
|
+
} catch (c) {
|
|
1887
|
+
return console.error(c), !1;
|
|
1885
1888
|
} finally {
|
|
1886
|
-
|
|
1889
|
+
a.table.loading = !1;
|
|
1887
1890
|
}
|
|
1888
1891
|
} catch {
|
|
1889
1892
|
return !1;
|
|
1890
1893
|
}
|
|
1891
1894
|
}), t.type === "treeSelect" && (t.options.treeSelect.rowKey = n.option.table?.rowKey, t.options.treeSelect.nodeKey = n.option.table?.rowKey);
|
|
1892
1895
|
};
|
|
1893
|
-
n.option.column.forEach(
|
|
1896
|
+
n.option.column.forEach(o), n.option.table?.column?.forEach(o);
|
|
1894
1897
|
},
|
|
1895
1898
|
initColumnForm: () => {
|
|
1896
|
-
const
|
|
1897
|
-
|
|
1898
|
-
const
|
|
1899
|
+
const a = e(), i = n.option;
|
|
1900
|
+
a.update.formColumn = [], a.update.formGrid = [], a.update.formMaxSpan = 12, a.table.column.show = { list: [], listSource: [] };
|
|
1901
|
+
const o = n.option.form?.maxSpan || 12, t = n.option.form?.defaultSpan || o / 2, s = Re((m) => {
|
|
1899
1902
|
const g = {
|
|
1900
1903
|
input: b.tCurd("placeholderInput"),
|
|
1901
1904
|
select: b.tCurd("placeholderSelect")
|
|
1902
1905
|
};
|
|
1903
1906
|
return (g[m.type || "input"] || g.input) + m.label;
|
|
1904
|
-
}),
|
|
1907
|
+
}), f = (m) => {
|
|
1905
1908
|
if (m.children) {
|
|
1906
|
-
|
|
1909
|
+
a.table.column.show.list.push(m.key), m.children.forEach((g) => f(g));
|
|
1907
1910
|
return;
|
|
1908
1911
|
}
|
|
1909
|
-
|
|
1912
|
+
a.update.formDefault[m.key] = m.value, m.table?.table && (m.show?.table && a.table.column.show.list.push(m.key), a.table.column.show.listSource.push(m.key));
|
|
1910
1913
|
};
|
|
1911
1914
|
i.column.forEach((m) => {
|
|
1912
|
-
|
|
1915
|
+
ue(m, !0), f(m);
|
|
1913
1916
|
}), n.option.table?.column?.forEach((m) => {
|
|
1914
|
-
|
|
1915
|
-
}),
|
|
1917
|
+
ue(m, !1), f(m);
|
|
1918
|
+
}), a.search.column.list = i.column.concat(i.table?.column || []), a.table.column.list = a.search.column.list.filter((m) => m.table?.table), a.search.column.list.sort((m, g) => m.sort?.search - g.sort?.search), a.table.column.list.sort((m, g) => m.sort?.table - g.sort?.table), a.update.rules = {}, Be(i.column, a.update.formDefault, a.update.rules, (m) => s(m, a.update.form));
|
|
1916
1919
|
const d = Ae(i.column, {
|
|
1917
|
-
maxSpan:
|
|
1920
|
+
maxSpan: o,
|
|
1918
1921
|
defaultSpan: t,
|
|
1919
1922
|
layout: n.option.form?.layout
|
|
1920
1923
|
});
|
|
1921
|
-
|
|
1922
|
-
const
|
|
1923
|
-
|
|
1924
|
-
|
|
1924
|
+
a.update.formGrid = d.cells, a.update.formMaxSpan = d.maxSpan, a.update.formColumn = Fe(d.cells);
|
|
1925
|
+
const c = n.option.search?.formDefault;
|
|
1926
|
+
c && Object.keys(c).forEach((m) => {
|
|
1927
|
+
a.search.formDefault[m] = c[m];
|
|
1925
1928
|
}), i.column.forEach((m) => {
|
|
1926
|
-
m.show?.search || (
|
|
1929
|
+
m.show?.search || (a.search.formDefault[m.key] = void 0);
|
|
1927
1930
|
});
|
|
1928
|
-
const v = ObjectUtil.deepMerge(
|
|
1929
|
-
J.setValue(
|
|
1931
|
+
const v = ObjectUtil.deepMerge(a.search.formDefault, {});
|
|
1932
|
+
J.setValue(a.search.form, v, !0);
|
|
1930
1933
|
}
|
|
1931
1934
|
}), $t = (e) => {
|
|
1932
|
-
const n = Q(), l = Q(),
|
|
1933
|
-
let
|
|
1934
|
-
const t = () => a;
|
|
1935
|
-
return a = me({
|
|
1935
|
+
const n = Q(), l = Q(), a = Q(), i = { switchConfirmRef: n, ruleFormRef: l, tableRef: a }, o = () => t;
|
|
1936
|
+
let t = me({
|
|
1936
1937
|
...pt(),
|
|
1937
1938
|
option: e.option,
|
|
1938
|
-
...wt(
|
|
1939
|
-
...vt(
|
|
1940
|
-
...kt(
|
|
1941
|
-
...xt(
|
|
1942
|
-
...St(
|
|
1943
|
-
...Vt(
|
|
1944
|
-
...zt(
|
|
1945
|
-
})
|
|
1946
|
-
|
|
1947
|
-
|
|
1939
|
+
...wt(o, e),
|
|
1940
|
+
...vt(o, e),
|
|
1941
|
+
...kt(o, e, i),
|
|
1942
|
+
...xt(o, e),
|
|
1943
|
+
...St(o, e, i),
|
|
1944
|
+
...Vt(o, e),
|
|
1945
|
+
...zt(o, e, i)
|
|
1946
|
+
});
|
|
1947
|
+
return t.init(), Ve(() => {
|
|
1948
|
+
e.option.init !== !1 && t.table.getList();
|
|
1949
|
+
}), ze.setConf(t), { conf: t, switchConfirmRef: n, ruleFormRef: l, tableRef: a };
|
|
1948
1950
|
}, Et = { class: "dialog-footer" }, Dt = /* @__PURE__ */ G({
|
|
1949
1951
|
__name: "switchConfirm",
|
|
1950
1952
|
props: {
|
|
1951
1953
|
size: {}
|
|
1952
1954
|
},
|
|
1953
1955
|
setup(e, { expose: n }) {
|
|
1954
|
-
const l = Q(!1),
|
|
1955
|
-
let
|
|
1956
|
-
const s = (
|
|
1957
|
-
|
|
1958
|
-
})),
|
|
1959
|
-
l.value = !1,
|
|
1956
|
+
const l = Q(!1), a = Q("确认修改"), i = Q("确认要修改状态吗?");
|
|
1957
|
+
let o = null, t = null;
|
|
1958
|
+
const s = (c) => (c?.title && (a.value = c.title), c?.content && (i.value = c.content), l.value = !0, new Promise((v, m) => {
|
|
1959
|
+
o = v, t = m;
|
|
1960
|
+
})), f = () => {
|
|
1961
|
+
l.value = !1, o?.(!0), o = null, t = null;
|
|
1960
1962
|
}, d = () => {
|
|
1961
|
-
l.value = !1, t?.(new Error("用户取消操作")),
|
|
1963
|
+
l.value = !1, t?.(new Error("用户取消操作")), o = null, t = null;
|
|
1962
1964
|
};
|
|
1963
1965
|
return n({
|
|
1964
1966
|
open: s
|
|
1965
|
-
}), (
|
|
1967
|
+
}), (c, v) => {
|
|
1966
1968
|
const m = ae("el-form");
|
|
1967
1969
|
return u(), h(r(ye), {
|
|
1968
1970
|
modelValue: l.value,
|
|
1969
1971
|
"onUpdate:modelValue": v[0] || (v[0] = (g) => l.value = g),
|
|
1970
|
-
title:
|
|
1972
|
+
title: a.value,
|
|
1971
1973
|
"close-on-click-modal": !1,
|
|
1972
1974
|
width: "400px"
|
|
1973
1975
|
}, {
|
|
@@ -1983,7 +1985,7 @@ const xt = (e, n) => ({
|
|
|
1983
1985
|
}),
|
|
1984
1986
|
$(r(T), {
|
|
1985
1987
|
type: "primary",
|
|
1986
|
-
onClick:
|
|
1988
|
+
onClick: f
|
|
1987
1989
|
}, {
|
|
1988
1990
|
default: y(() => [...v[2] || (v[2] = [
|
|
1989
1991
|
V("确认", -1)
|
|
@@ -2002,24 +2004,7 @@ const xt = (e, n) => ({
|
|
|
2002
2004
|
}, 8, ["modelValue", "title"]);
|
|
2003
2005
|
};
|
|
2004
2006
|
}
|
|
2005
|
-
}),
|
|
2006
|
-
const l = e.__vccOpts || e;
|
|
2007
|
-
for (const [o, i] of n)
|
|
2008
|
-
l[o] = i;
|
|
2009
|
-
return l;
|
|
2010
|
-
}, Ot = {}, Mt = {
|
|
2011
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2012
|
-
viewBox: "0 0 1024 1024"
|
|
2013
|
-
};
|
|
2014
|
-
function Ft(e, n) {
|
|
2015
|
-
return u(), p("svg", Mt, [...n[0] || (n[0] = [
|
|
2016
|
-
O("path", {
|
|
2017
|
-
fill: "currentColor",
|
|
2018
|
-
d: "M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"
|
|
2019
|
-
}, null, -1)
|
|
2020
|
-
])]);
|
|
2021
|
-
}
|
|
2022
|
-
const Ut = /* @__PURE__ */ Z(Ot, [["render", Ft]]), At = ["innerHTML"], Rt = /* @__PURE__ */ G({
|
|
2007
|
+
}), Ot = ["innerHTML"], Mt = /* @__PURE__ */ G({
|
|
2023
2008
|
__name: "text",
|
|
2024
2009
|
props: {
|
|
2025
2010
|
content: {},
|
|
@@ -2027,26 +2012,130 @@ const Ut = /* @__PURE__ */ Z(Ot, [["render", Ft]]), At = ["innerHTML"], Rt = /*
|
|
|
2027
2012
|
},
|
|
2028
2013
|
setup(e) {
|
|
2029
2014
|
const n = e, l = te(() => typeof n.content == "function" ? n.content(n.value) : n.content);
|
|
2030
|
-
return (
|
|
2015
|
+
return (a, i) => typeof l.value == "object" ? (u(), h(Y(l.value), { key: 0 })) : (u(), p("div", {
|
|
2031
2016
|
key: 1,
|
|
2032
2017
|
innerHTML: l.value
|
|
2033
|
-
}, null, 8,
|
|
2018
|
+
}, null, 8, Ot));
|
|
2034
2019
|
}
|
|
2035
|
-
}),
|
|
2036
|
-
|
|
2020
|
+
}), ke = /* @__PURE__ */ G({
|
|
2021
|
+
__name: "searchField",
|
|
2022
|
+
props: {
|
|
2023
|
+
item: {},
|
|
2024
|
+
conf: {},
|
|
2025
|
+
type: {}
|
|
2026
|
+
},
|
|
2027
|
+
setup(e) {
|
|
2028
|
+
const n = e, l = te({
|
|
2029
|
+
get: () => n.conf.search.form?.[n.item?.key],
|
|
2030
|
+
set: (a) => {
|
|
2031
|
+
n.item?.key !== void 0 && (n.conf.search.form[n.item.key] = a);
|
|
2032
|
+
}
|
|
2033
|
+
});
|
|
2034
|
+
return (a, i) => r(P).customComponent[e.type ?? ""]?.search ? (u(), h(Y(r(P).customComponent[e.type ?? ""]?.search), C({
|
|
2035
|
+
key: 0,
|
|
2036
|
+
modelValue: l.value,
|
|
2037
|
+
"onUpdate:modelValue": i[0] || (i[0] = (o) => l.value = o)
|
|
2038
|
+
}, e.item.options?.search?.[e.type ?? ""], E(e.item.options?.search?.[e.type ?? ""]?.on || {})), null, 16, ["modelValue"])) : e.type === "input" ? (u(), h(r(se), C({
|
|
2039
|
+
key: 1,
|
|
2040
|
+
modelValue: l.value,
|
|
2041
|
+
"onUpdate:modelValue": i[1] || (i[1] = (o) => l.value = o),
|
|
2042
|
+
placeholder: e.conf.search.getPlaceholder(e.item),
|
|
2043
|
+
clearable: "",
|
|
2044
|
+
disabled: e.item.disabled?.search
|
|
2045
|
+
}, e.item.options?.search?.input || e.item.options?.input, E(e.item.options?.search?.input?.on || e.item.options?.input?.on || {})), null, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "switch" ? (u(), h(r(oe), C({
|
|
2046
|
+
key: 2,
|
|
2047
|
+
modelValue: l.value,
|
|
2048
|
+
"onUpdate:modelValue": i[2] || (i[2] = (o) => l.value = o),
|
|
2049
|
+
placeholder: e.conf.search.getPlaceholder(e.item, r(b).tCurd("placeholderSelect")),
|
|
2050
|
+
clearable: "",
|
|
2051
|
+
disabled: e.item.disabled?.search
|
|
2052
|
+
}, e.item.options?.search?.switch || e.item.options?.switch, E(e.item.options?.search?.switch?.on || e.item.options?.switch?.on || {})), {
|
|
2053
|
+
default: y(() => [
|
|
2054
|
+
(u(), h(r(X), {
|
|
2055
|
+
key: e.item.options?.switch?.activeValue,
|
|
2056
|
+
label: e.item.options?.switch?.activeText,
|
|
2057
|
+
value: e.item.options?.switch?.activeValue
|
|
2058
|
+
}, null, 8, ["label", "value"])),
|
|
2059
|
+
(u(), h(r(X), {
|
|
2060
|
+
key: e.item.options?.switch?.inactiveValue,
|
|
2061
|
+
label: e.item.options?.switch?.inactiveText,
|
|
2062
|
+
value: e.item.options?.switch?.inactiveValue
|
|
2063
|
+
}, null, 8, ["label", "value"]))
|
|
2064
|
+
]),
|
|
2065
|
+
_: 1
|
|
2066
|
+
}, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "select" ? (u(), h(r(oe), C({
|
|
2067
|
+
key: 3,
|
|
2068
|
+
modelValue: l.value,
|
|
2069
|
+
"onUpdate:modelValue": i[3] || (i[3] = (o) => l.value = o),
|
|
2070
|
+
placeholder: e.conf.search.getPlaceholder(e.item, r(b).tCurd("placeholderSelect")),
|
|
2071
|
+
clearable: "",
|
|
2072
|
+
disabled: e.item.disabled?.search
|
|
2073
|
+
}, e.item.options?.search?.select || e.item.options?.select, E(e.item.options?.search?.select?.on || e.item.options?.select?.on || {})), {
|
|
2074
|
+
default: y(() => [
|
|
2075
|
+
(u(!0), p(F, null, j(e.item.options?.search?.select?.data || e.item.options?.select?.data || [], (o) => (u(), h(r(X), {
|
|
2076
|
+
key: o.value,
|
|
2077
|
+
label: o.label,
|
|
2078
|
+
value: o.value
|
|
2079
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
2080
|
+
]),
|
|
2081
|
+
_: 1
|
|
2082
|
+
}, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "radio" ? (u(), h(r(Ce), C({
|
|
2083
|
+
key: 4,
|
|
2084
|
+
modelValue: l.value,
|
|
2085
|
+
"onUpdate:modelValue": i[4] || (i[4] = (o) => l.value = o),
|
|
2086
|
+
disabled: e.item.disabled?.search
|
|
2087
|
+
}, e.item.options?.search?.radio || e.item.options?.radio, E(e.item.options?.search?.radio?.on || e.item.options?.radio?.on || {})), {
|
|
2088
|
+
default: y(() => [
|
|
2089
|
+
(u(!0), p(F, null, j(e.item.options?.radio?.data, (o) => (u(), h(r(xe), {
|
|
2090
|
+
key: o.value,
|
|
2091
|
+
label: o.label,
|
|
2092
|
+
value: o.value
|
|
2093
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
2094
|
+
]),
|
|
2095
|
+
_: 1
|
|
2096
|
+
}, 16, ["modelValue", "disabled"])) : e.type === "datetime" ? (u(), h(r(Se), C({
|
|
2097
|
+
key: 5,
|
|
2098
|
+
modelValue: l.value,
|
|
2099
|
+
"onUpdate:modelValue": i[5] || (i[5] = (o) => l.value = o),
|
|
2100
|
+
disabled: e.item.disabled?.search
|
|
2101
|
+
}, e.item.options?.search?.datetime || e.item.options?.datetime, E(e.item.options?.search?.datetime?.on || e.item.options?.datetime?.on || {})), null, 16, ["modelValue", "disabled"])) : e.type && r(P).customComponent[e.type] ? (u(), h(Y(r(P).customComponent[e.type]), C({
|
|
2102
|
+
key: 6,
|
|
2103
|
+
modelValue: l.value,
|
|
2104
|
+
"onUpdate:modelValue": i[6] || (i[6] = (o) => l.value = o)
|
|
2105
|
+
}, 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 || {}), {
|
|
2106
|
+
disabled: e.item.disabled?.search
|
|
2107
|
+
}), null, 16, ["modelValue", "disabled"])) : w("", !0);
|
|
2108
|
+
}
|
|
2109
|
+
}), Z = (e, n) => {
|
|
2110
|
+
const l = e.__vccOpts || e;
|
|
2111
|
+
for (const [a, i] of n)
|
|
2112
|
+
l[a] = i;
|
|
2113
|
+
return l;
|
|
2114
|
+
}, Ft = {}, Ut = {
|
|
2037
2115
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2038
|
-
viewBox: "
|
|
2116
|
+
viewBox: "64 64 896 896"
|
|
2117
|
+
};
|
|
2118
|
+
function At(e, n) {
|
|
2119
|
+
return u(), p("svg", Ut, [...n[0] || (n[0] = [
|
|
2120
|
+
O("path", {
|
|
2121
|
+
fill: "currentColor",
|
|
2122
|
+
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"
|
|
2123
|
+
}, null, -1)
|
|
2124
|
+
])]);
|
|
2125
|
+
}
|
|
2126
|
+
const Rt = /* @__PURE__ */ Z(Ft, [["render", At]]), Bt = {}, Tt = {
|
|
2127
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2128
|
+
viewBox: "64 64 896 896"
|
|
2039
2129
|
};
|
|
2040
2130
|
function Lt(e, n) {
|
|
2041
2131
|
return u(), p("svg", Tt, [...n[0] || (n[0] = [
|
|
2042
2132
|
O("path", {
|
|
2043
2133
|
fill: "currentColor",
|
|
2044
|
-
d: "
|
|
2134
|
+
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"
|
|
2045
2135
|
}, null, -1)
|
|
2046
2136
|
])]);
|
|
2047
2137
|
}
|
|
2048
2138
|
const jt = /* @__PURE__ */ Z(Bt, [["render", Lt]]), Pt = {}, It = {
|
|
2049
|
-
"data-v-58697b5c": "",
|
|
2050
2139
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2051
2140
|
viewBox: "0 0 1024 1024"
|
|
2052
2141
|
};
|
|
@@ -2054,7 +2143,7 @@ function Kt(e, n) {
|
|
|
2054
2143
|
return u(), p("svg", It, [...n[0] || (n[0] = [
|
|
2055
2144
|
O("path", {
|
|
2056
2145
|
fill: "currentColor",
|
|
2057
|
-
d: "
|
|
2146
|
+
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"
|
|
2058
2147
|
}, null, -1)
|
|
2059
2148
|
])]);
|
|
2060
2149
|
}
|
|
@@ -2065,13 +2154,39 @@ const Ht = /* @__PURE__ */ Z(Pt, [["render", Kt]]), Gt = {}, Nt = {
|
|
|
2065
2154
|
};
|
|
2066
2155
|
function Wt(e, n) {
|
|
2067
2156
|
return u(), p("svg", Nt, [...n[0] || (n[0] = [
|
|
2157
|
+
O("path", {
|
|
2158
|
+
fill: "currentColor",
|
|
2159
|
+
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"
|
|
2160
|
+
}, null, -1)
|
|
2161
|
+
])]);
|
|
2162
|
+
}
|
|
2163
|
+
const Jt = /* @__PURE__ */ Z(Gt, [["render", Wt]]), Qt = {}, qt = {
|
|
2164
|
+
"data-v-58697b5c": "",
|
|
2165
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2166
|
+
viewBox: "0 0 1024 1024"
|
|
2167
|
+
};
|
|
2168
|
+
function Xt(e, n) {
|
|
2169
|
+
return u(), p("svg", qt, [...n[0] || (n[0] = [
|
|
2170
|
+
O("path", {
|
|
2171
|
+
fill: "currentColor",
|
|
2172
|
+
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"
|
|
2173
|
+
}, null, -1)
|
|
2174
|
+
])]);
|
|
2175
|
+
}
|
|
2176
|
+
const Yt = /* @__PURE__ */ Z(Qt, [["render", Xt]]), Zt = {}, _t = {
|
|
2177
|
+
"data-v-58697b5c": "",
|
|
2178
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2179
|
+
viewBox: "0 0 1024 1024"
|
|
2180
|
+
};
|
|
2181
|
+
function eo(e, n) {
|
|
2182
|
+
return u(), p("svg", _t, [...n[0] || (n[0] = [
|
|
2068
2183
|
O("path", {
|
|
2069
2184
|
fill: "currentColor",
|
|
2070
2185
|
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"
|
|
2071
2186
|
}, null, -1)
|
|
2072
2187
|
])]);
|
|
2073
2188
|
}
|
|
2074
|
-
const
|
|
2189
|
+
const to = /* @__PURE__ */ Z(Zt, [["render", eo]]), oo = { class: "row flex-center table-header-label inline" }, ao = { class: "table-header-tooltip" }, no = ["innerHTML"], lo = ["onClick"], io = { key: 1 }, ro = ["onClick", "innerHTML"], so = /* @__PURE__ */ G({
|
|
2075
2190
|
__name: "tableColumn",
|
|
2076
2191
|
props: {
|
|
2077
2192
|
conf: {},
|
|
@@ -2080,8 +2195,8 @@ const Jt = /* @__PURE__ */ Z(Gt, [["render", Wt]]), Qt = { class: "row flex-cent
|
|
|
2080
2195
|
},
|
|
2081
2196
|
setup(e) {
|
|
2082
2197
|
const n = S.isFun, l = Qe().type;
|
|
2083
|
-
return (
|
|
2084
|
-
const
|
|
2198
|
+
return (a, i) => {
|
|
2199
|
+
const o = ae("el-tooltip");
|
|
2085
2200
|
return u(!0), p(F, null, j(e.columnList, (t) => (u(), p(F, {
|
|
2086
2201
|
key: t.key
|
|
2087
2202
|
}, [
|
|
@@ -2092,9 +2207,9 @@ const Jt = /* @__PURE__ */ Z(Gt, [["render", Wt]]), Qt = { class: "row flex-cent
|
|
|
2092
2207
|
label: t.label
|
|
2093
2208
|
}, { ref_for: !0 }, t.table), {
|
|
2094
2209
|
header: y(() => [
|
|
2095
|
-
k(
|
|
2096
|
-
O("div",
|
|
2097
|
-
t.table?.header?.tooltip ? (u(), h(
|
|
2210
|
+
k(a.$slots, "table-header-" + t.key, { item: t }, () => [
|
|
2211
|
+
O("div", oo, [
|
|
2212
|
+
t.table?.header?.tooltip ? (u(), h(o, {
|
|
2098
2213
|
key: 0,
|
|
2099
2214
|
effect: "dark",
|
|
2100
2215
|
placement: "top"
|
|
@@ -2102,11 +2217,11 @@ const Jt = /* @__PURE__ */ Z(Gt, [["render", Wt]]), Qt = { class: "row flex-cent
|
|
|
2102
2217
|
content: y(() => [
|
|
2103
2218
|
O("div", {
|
|
2104
2219
|
innerHTML: t.table?.header?.tooltip
|
|
2105
|
-
}, null, 8,
|
|
2220
|
+
}, null, 8, no)
|
|
2106
2221
|
]),
|
|
2107
2222
|
default: y(() => [
|
|
2108
|
-
O("span",
|
|
2109
|
-
$(
|
|
2223
|
+
O("span", ao, [
|
|
2224
|
+
$(Jt)
|
|
2110
2225
|
])
|
|
2111
2226
|
]),
|
|
2112
2227
|
_: 2
|
|
@@ -2124,8 +2239,8 @@ const Jt = /* @__PURE__ */ Z(Gt, [["render", Wt]]), Qt = { class: "row flex-cent
|
|
|
2124
2239
|
["stop"]
|
|
2125
2240
|
)
|
|
2126
2241
|
}, [
|
|
2127
|
-
t.table.header.group ? (u(), h(
|
|
2128
|
-
], 8,
|
|
2242
|
+
t.table.header.group ? (u(), h(Yt, { key: 0 })) : (u(), h(to, { key: 1 }))
|
|
2243
|
+
], 8, lo)) : w("", !0)
|
|
2129
2244
|
])
|
|
2130
2245
|
])
|
|
2131
2246
|
]),
|
|
@@ -2137,10 +2252,10 @@ const Jt = /* @__PURE__ */ Z(Gt, [["render", Wt]]), Qt = { class: "row flex-cent
|
|
|
2137
2252
|
columnList: t.children,
|
|
2138
2253
|
option: e.option
|
|
2139
2254
|
}, W({ _: 2 }, [
|
|
2140
|
-
j(
|
|
2255
|
+
j(a.$slots, (f, d) => ({
|
|
2141
2256
|
name: d,
|
|
2142
|
-
fn: y((
|
|
2143
|
-
k(
|
|
2257
|
+
fn: y((c) => [
|
|
2258
|
+
k(a.$slots, d, C({ ref_for: !0 }, c || {}))
|
|
2144
2259
|
])
|
|
2145
2260
|
}))
|
|
2146
2261
|
]), 1032, ["conf", "columnList", "option"]))
|
|
@@ -2150,14 +2265,14 @@ const Jt = /* @__PURE__ */ Z(Gt, [["render", Wt]]), Qt = { class: "row flex-cent
|
|
|
2150
2265
|
class: I(["row", ["table-edit-" + t.key]]),
|
|
2151
2266
|
style: { width: "100%" }
|
|
2152
2267
|
}, [
|
|
2153
|
-
k(
|
|
2268
|
+
k(a.$slots, "table-edit-left-" + t.key, {
|
|
2154
2269
|
row: s,
|
|
2155
2270
|
item: t
|
|
2156
2271
|
}),
|
|
2157
2272
|
t.type === "input" ? (u(), h(r(se), C({
|
|
2158
2273
|
key: 0,
|
|
2159
2274
|
modelValue: s[t.key],
|
|
2160
|
-
"onUpdate:modelValue": (
|
|
2275
|
+
"onUpdate:modelValue": (f) => s[t.key] = f,
|
|
2161
2276
|
disabled: e.conf.update.getDisabled(t, !0),
|
|
2162
2277
|
class: "col"
|
|
2163
2278
|
}, { ref_for: !0 }, e.conf.update.getBind(t), E(e.conf.update.getOn(t, s))), W({ _: 2 }, [
|
|
@@ -2171,26 +2286,26 @@ const Jt = /* @__PURE__ */ Z(Gt, [["render", Wt]]), Qt = { class: "row flex-cent
|
|
|
2171
2286
|
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : t.type === "select" ? (u(), h(r(oe), C({
|
|
2172
2287
|
key: 1,
|
|
2173
2288
|
modelValue: s[t.key],
|
|
2174
|
-
"onUpdate:modelValue": (
|
|
2289
|
+
"onUpdate:modelValue": (f) => s[t.key] = f,
|
|
2175
2290
|
disabled: e.conf.update.getDisabled(t, !0),
|
|
2176
2291
|
class: "col"
|
|
2177
2292
|
}, { ref_for: !0 }, e.conf.update.getBind(t), E(e.conf.update.getOn(t, s))), {
|
|
2178
2293
|
default: y(() => [
|
|
2179
|
-
(u(!0), p(F, null, j(t.options?.search?.select?.data || t.options?.select?.data, (
|
|
2180
|
-
key:
|
|
2181
|
-
label:
|
|
2182
|
-
value:
|
|
2294
|
+
(u(!0), p(F, null, j(t.options?.search?.select?.data || t.options?.select?.data, (f) => (u(), h(r(X), {
|
|
2295
|
+
key: f.value,
|
|
2296
|
+
label: f.label,
|
|
2297
|
+
value: f.value
|
|
2183
2298
|
}, null, 8, ["label", "value"]))), 128))
|
|
2184
2299
|
]),
|
|
2185
2300
|
_: 2
|
|
2186
2301
|
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : t.type === "switch" ? (u(), h(r(ie), C({
|
|
2187
2302
|
key: 2,
|
|
2188
2303
|
modelValue: s[t.key],
|
|
2189
|
-
"onUpdate:modelValue": (
|
|
2304
|
+
"onUpdate:modelValue": (f) => s[t.key] = f,
|
|
2190
2305
|
disabled: e.conf.update.getDisabled(t, !0),
|
|
2191
2306
|
class: "col"
|
|
2192
2307
|
}, { ref_for: !0 }, e.conf.update.getBind(t), E(e.conf.update.getOn(t, s))), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : w("", !0),
|
|
2193
|
-
k(
|
|
2308
|
+
k(a.$slots, "table-edit-right-" + t.key, {
|
|
2194
2309
|
row: s,
|
|
2195
2310
|
item: t
|
|
2196
2311
|
})
|
|
@@ -2199,7 +2314,7 @@ const Jt = /* @__PURE__ */ Z(Gt, [["render", Wt]]), Qt = { class: "row flex-cent
|
|
|
2199
2314
|
t.type === "input" ? (u(), h(r(se), C({
|
|
2200
2315
|
key: 0,
|
|
2201
2316
|
modelValue: e.conf.update.form[t.key],
|
|
2202
|
-
"onUpdate:modelValue": (
|
|
2317
|
+
"onUpdate:modelValue": (f) => e.conf.update.form[t.key] = f,
|
|
2203
2318
|
disabled: e.conf.update.getDisabled(t, !0)
|
|
2204
2319
|
}, { ref_for: !0 }, e.conf.update.getBind(t), E(e.conf.update.getOn(t, s)), { style: { width: "100%" } }), W({ _: 2 }, [
|
|
2205
2320
|
t.options?.input?.prepend ? {
|
|
@@ -2212,25 +2327,25 @@ const Jt = /* @__PURE__ */ Z(Gt, [["render", Wt]]), Qt = { class: "row flex-cent
|
|
|
2212
2327
|
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : t.type === "select" ? (u(), h(r(oe), C({
|
|
2213
2328
|
key: 1,
|
|
2214
2329
|
modelValue: e.conf.update.form[t.key],
|
|
2215
|
-
"onUpdate:modelValue": (
|
|
2330
|
+
"onUpdate:modelValue": (f) => e.conf.update.form[t.key] = f,
|
|
2216
2331
|
disabled: e.conf.update.getDisabled(t, !0)
|
|
2217
2332
|
}, { ref_for: !0 }, e.conf.update.getBind(t), E(e.conf.update.getOn(t, s)), { style: { width: "100%" } }), {
|
|
2218
2333
|
default: y(() => [
|
|
2219
|
-
(u(!0), p(F, null, j(t.options?.search?.select?.data || t.options?.select?.data, (
|
|
2220
|
-
key:
|
|
2221
|
-
label:
|
|
2222
|
-
value:
|
|
2334
|
+
(u(!0), p(F, null, j(t.options?.search?.select?.data || t.options?.select?.data, (f) => (u(), h(r(X), {
|
|
2335
|
+
key: f.value,
|
|
2336
|
+
label: f.label,
|
|
2337
|
+
value: f.value
|
|
2223
2338
|
}, null, 8, ["label", "value"]))), 128))
|
|
2224
2339
|
]),
|
|
2225
2340
|
_: 2
|
|
2226
2341
|
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : t.type === "switch" ? (u(), h(r(ie), C({
|
|
2227
2342
|
key: 2,
|
|
2228
2343
|
modelValue: e.conf.update.form[t.key],
|
|
2229
|
-
"onUpdate:modelValue": (
|
|
2344
|
+
"onUpdate:modelValue": (f) => e.conf.update.form[t.key] = f
|
|
2230
2345
|
}, { ref_for: !0 }, e.conf.update.getBind(t), E(e.conf.update.getOn(t, s)), {
|
|
2231
2346
|
disabled: e.conf.update.getDisabled(t, !0)
|
|
2232
2347
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : w("", !0)
|
|
2233
|
-
], 64)) : k(
|
|
2348
|
+
], 64)) : k(a.$slots, "table-" + t.key, {
|
|
2234
2349
|
key: 1,
|
|
2235
2350
|
row: s,
|
|
2236
2351
|
item: t
|
|
@@ -2238,24 +2353,24 @@ const Jt = /* @__PURE__ */ Z(Gt, [["render", Wt]]), Qt = { class: "row flex-cent
|
|
|
2238
2353
|
r(P).customComponent[t.type ?? ""]?.table ? (u(), h(Y(r(P).customComponent[t.type ?? ""]?.table), C({
|
|
2239
2354
|
key: 0,
|
|
2240
2355
|
modelValue: s[t.key],
|
|
2241
|
-
"onUpdate:modelValue": (
|
|
2356
|
+
"onUpdate:modelValue": (f) => s[t.key] = f
|
|
2242
2357
|
}, { ref_for: !0 }, t.options?.[t.type ?? ""], E(t.options?.[t.type ?? ""]?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue"])) : t.type === "switch" ? (u(), p(F, { key: 1 }, [
|
|
2243
2358
|
t.options?.switch?.tableConfig?.change ? (u(), h(r(ie), C({
|
|
2244
2359
|
key: 0,
|
|
2245
2360
|
modelValue: s[t.key],
|
|
2246
|
-
"onUpdate:modelValue": (
|
|
2361
|
+
"onUpdate:modelValue": (f) => s[t.key] = f,
|
|
2247
2362
|
loading: t.options?.switch?.loadingMap?.[s[e.option.table?.rowKey]]?.loading,
|
|
2248
2363
|
"before-change": () => t.options?.switch?.tableBeforeChange?.(t.key, s)
|
|
2249
|
-
}, { ref_for: !0 }, t.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "loading", "before-change"])) : (u(), p("span",
|
|
2364
|
+
}, { ref_for: !0 }, t.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "loading", "before-change"])) : (u(), p("span", io, D(s[t.key] === t.options?.switch?.activeValue ? t.options?.switch?.activeText : t.options?.switch?.inactiveText), 1))
|
|
2250
2365
|
], 64)) : (u(), p("span", {
|
|
2251
2366
|
key: 2,
|
|
2252
2367
|
style: de({
|
|
2253
2368
|
"--table-text-click-color": t.table?.click?.color
|
|
2254
2369
|
}),
|
|
2255
2370
|
class: I({ "table-text-click": t.table?.click?.callback }),
|
|
2256
|
-
onClick: (
|
|
2371
|
+
onClick: (f) => t.table?.click?.callback?.(s),
|
|
2257
2372
|
innerHTML: t.table?.format ? t.table?.format(s) : s[t.key]
|
|
2258
|
-
}, null, 14,
|
|
2373
|
+
}, null, 14, ro))
|
|
2259
2374
|
])
|
|
2260
2375
|
], 64))
|
|
2261
2376
|
], 64))
|
|
@@ -2266,123 +2381,10 @@ const Jt = /* @__PURE__ */ Z(Gt, [["render", Wt]]), Qt = { class: "row flex-cent
|
|
|
2266
2381
|
], 64))), 128);
|
|
2267
2382
|
};
|
|
2268
2383
|
}
|
|
2269
|
-
}),
|
|
2270
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2271
|
-
viewBox: "64 64 896 896"
|
|
2272
|
-
};
|
|
2273
|
-
function ao(e, n) {
|
|
2274
|
-
return u(), p("svg", oo, [...n[0] || (n[0] = [
|
|
2275
|
-
O("path", {
|
|
2276
|
-
fill: "currentColor",
|
|
2277
|
-
d: "M482.2 508.4L331.3 389c-3-2.4-7.3-.2-7.3 3.6V478H184V184h204v128c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V144c0-15.5-12.5-28-28-28H144c-15.5 0-28 12.5-28 28v736c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v128H184V546h140v85.4c0 3.8 4.4 6 7.3 3.6l150.9-119.4a4.5 4.5 0 000-7.2zM880 116H596c-15.5 0-28 12.5-28 28v168c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V184h204v294H700v-85.4c0-3.8-4.3-6-7.3-3.6l-151 119.4a4.52 4.52 0 000 7.1l151 119.5c2.9 2.3 7.3.2 7.3-3.6V546h140v294H636V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v168c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V144c0-15.5-12.5-28-28-28z"
|
|
2278
|
-
}, null, -1)
|
|
2279
|
-
])]);
|
|
2280
|
-
}
|
|
2281
|
-
const no = /* @__PURE__ */ Z(to, [["render", ao]]), lo = {}, io = {
|
|
2282
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2283
|
-
viewBox: "64 64 896 896"
|
|
2284
|
-
};
|
|
2285
|
-
function ro(e, n) {
|
|
2286
|
-
return u(), p("svg", io, [...n[0] || (n[0] = [
|
|
2287
|
-
O("path", {
|
|
2288
|
-
fill: "currentColor",
|
|
2289
|
-
d: "M180 176h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zm724 0h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zM785.3 504.3L657.7 403.6a7.23 7.23 0 00-11.7 5.7V476H378v-62.8c0-6-7-9.4-11.7-5.7L238.7 508.3a7.14 7.14 0 000 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h268v62.8c0 6 7 9.4 11.7 5.7l127.5-100.8c3.8-2.9 3.8-8.5.2-11.4z"
|
|
2290
|
-
}, null, -1)
|
|
2291
|
-
])]);
|
|
2292
|
-
}
|
|
2293
|
-
const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
2294
|
-
__name: "searchField",
|
|
2295
|
-
props: {
|
|
2296
|
-
item: {},
|
|
2297
|
-
conf: {},
|
|
2298
|
-
type: {}
|
|
2299
|
-
},
|
|
2300
|
-
setup(e) {
|
|
2301
|
-
const n = e, l = te({
|
|
2302
|
-
get: () => n.conf.search.form?.[n.item?.key],
|
|
2303
|
-
set: (o) => {
|
|
2304
|
-
n.item?.key !== void 0 && (n.conf.search.form[n.item.key] = o);
|
|
2305
|
-
}
|
|
2306
|
-
});
|
|
2307
|
-
return (o, i) => r(P).customComponent[e.type ?? ""]?.search ? (u(), h(Y(r(P).customComponent[e.type ?? ""]?.search), C({
|
|
2308
|
-
key: 0,
|
|
2309
|
-
modelValue: l.value,
|
|
2310
|
-
"onUpdate:modelValue": i[0] || (i[0] = (a) => l.value = a)
|
|
2311
|
-
}, e.item.options?.search?.[e.type ?? ""], E(e.item.options?.search?.[e.type ?? ""]?.on || {})), null, 16, ["modelValue"])) : e.type === "input" ? (u(), h(r(se), C({
|
|
2312
|
-
key: 1,
|
|
2313
|
-
modelValue: l.value,
|
|
2314
|
-
"onUpdate:modelValue": i[1] || (i[1] = (a) => l.value = a),
|
|
2315
|
-
placeholder: e.conf.search.getPlaceholder(e.item),
|
|
2316
|
-
clearable: "",
|
|
2317
|
-
disabled: e.item.disabled?.search
|
|
2318
|
-
}, e.item.options?.search?.input || e.item.options?.input, E(e.item.options?.search?.input?.on || e.item.options?.input?.on || {})), null, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "switch" ? (u(), h(r(oe), C({
|
|
2319
|
-
key: 2,
|
|
2320
|
-
modelValue: l.value,
|
|
2321
|
-
"onUpdate:modelValue": i[2] || (i[2] = (a) => l.value = a),
|
|
2322
|
-
placeholder: e.conf.search.getPlaceholder(e.item, r(b).tCurd("placeholderSelect")),
|
|
2323
|
-
clearable: "",
|
|
2324
|
-
disabled: e.item.disabled?.search
|
|
2325
|
-
}, e.item.options?.search?.switch || e.item.options?.switch, E(e.item.options?.search?.switch?.on || e.item.options?.switch?.on || {})), {
|
|
2326
|
-
default: y(() => [
|
|
2327
|
-
(u(), h(r(X), {
|
|
2328
|
-
key: e.item.options?.switch?.activeValue,
|
|
2329
|
-
label: e.item.options?.switch?.activeText,
|
|
2330
|
-
value: e.item.options?.switch?.activeValue
|
|
2331
|
-
}, null, 8, ["label", "value"])),
|
|
2332
|
-
(u(), h(r(X), {
|
|
2333
|
-
key: e.item.options?.switch?.inactiveValue,
|
|
2334
|
-
label: e.item.options?.switch?.inactiveText,
|
|
2335
|
-
value: e.item.options?.switch?.inactiveValue
|
|
2336
|
-
}, null, 8, ["label", "value"]))
|
|
2337
|
-
]),
|
|
2338
|
-
_: 1
|
|
2339
|
-
}, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "select" ? (u(), h(r(oe), C({
|
|
2340
|
-
key: 3,
|
|
2341
|
-
modelValue: l.value,
|
|
2342
|
-
"onUpdate:modelValue": i[3] || (i[3] = (a) => l.value = a),
|
|
2343
|
-
placeholder: e.conf.search.getPlaceholder(e.item, r(b).tCurd("placeholderSelect")),
|
|
2344
|
-
clearable: "",
|
|
2345
|
-
disabled: e.item.disabled?.search
|
|
2346
|
-
}, e.item.options?.search?.select || e.item.options?.select, E(e.item.options?.search?.select?.on || e.item.options?.select?.on || {})), {
|
|
2347
|
-
default: y(() => [
|
|
2348
|
-
(u(!0), p(F, null, j(e.item.options?.search?.select?.data || e.item.options?.select?.data || [], (a) => (u(), h(r(X), {
|
|
2349
|
-
key: a.value,
|
|
2350
|
-
label: a.label,
|
|
2351
|
-
value: a.value
|
|
2352
|
-
}, null, 8, ["label", "value"]))), 128))
|
|
2353
|
-
]),
|
|
2354
|
-
_: 1
|
|
2355
|
-
}, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "radio" ? (u(), h(r(Ce), C({
|
|
2356
|
-
key: 4,
|
|
2357
|
-
modelValue: l.value,
|
|
2358
|
-
"onUpdate:modelValue": i[4] || (i[4] = (a) => l.value = a),
|
|
2359
|
-
disabled: e.item.disabled?.search
|
|
2360
|
-
}, e.item.options?.search?.radio || e.item.options?.radio, E(e.item.options?.search?.radio?.on || e.item.options?.radio?.on || {})), {
|
|
2361
|
-
default: y(() => [
|
|
2362
|
-
(u(!0), p(F, null, j(e.item.options?.radio?.data, (a) => (u(), h(r(xe), {
|
|
2363
|
-
key: a.value,
|
|
2364
|
-
label: a.label,
|
|
2365
|
-
value: a.value
|
|
2366
|
-
}, null, 8, ["label", "value"]))), 128))
|
|
2367
|
-
]),
|
|
2368
|
-
_: 1
|
|
2369
|
-
}, 16, ["modelValue", "disabled"])) : e.type === "datetime" ? (u(), h(r(Se), C({
|
|
2370
|
-
key: 5,
|
|
2371
|
-
modelValue: l.value,
|
|
2372
|
-
"onUpdate:modelValue": i[5] || (i[5] = (a) => l.value = a),
|
|
2373
|
-
disabled: e.item.disabled?.search
|
|
2374
|
-
}, e.item.options?.search?.datetime || e.item.options?.datetime, E(e.item.options?.search?.datetime?.on || e.item.options?.datetime?.on || {})), null, 16, ["modelValue", "disabled"])) : e.type && r(P).customComponent[e.type] ? (u(), h(Y(r(P).customComponent[e.type]), C({
|
|
2375
|
-
key: 6,
|
|
2376
|
-
modelValue: l.value,
|
|
2377
|
-
"onUpdate:modelValue": i[6] || (i[6] = (a) => l.value = a)
|
|
2378
|
-
}, e.item.options?.search?.[e.type] || e.item.options?.[e.type], E(e.item.options?.search?.[e.type]?.on || e.item.options?.[e.type]?.on || {}), {
|
|
2379
|
-
disabled: e.item.disabled?.search
|
|
2380
|
-
}), null, 16, ["modelValue", "disabled"])) : w("", !0);
|
|
2381
|
-
}
|
|
2382
|
-
}), co = {
|
|
2384
|
+
}), uo = {
|
|
2383
2385
|
key: 0,
|
|
2384
2386
|
class: "relative curd-search fit-width"
|
|
2385
|
-
},
|
|
2387
|
+
}, co = { class: "mb-10 flex justify-between items-center fit-width" }, fo = {
|
|
2386
2388
|
class: "flex items-center",
|
|
2387
2389
|
style: { gap: "10px" }
|
|
2388
2390
|
}, mo = { key: 0 }, go = { key: 1 }, ho = { key: 2 }, yo = { class: "export-btn" }, bo = {
|
|
@@ -2414,10 +2416,10 @@ const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
|
2414
2416
|
}
|
|
2415
2417
|
},
|
|
2416
2418
|
setup(e, { expose: n }) {
|
|
2417
|
-
const l = S.EDialog,
|
|
2419
|
+
const l = S.EDialog, a = e, i = S.isFun, { conf: o, switchConfirmRef: t, ruleFormRef: s, tableRef: f } = $t(a);
|
|
2418
2420
|
return n({
|
|
2419
|
-
conf:
|
|
2420
|
-
}), (d,
|
|
2421
|
+
conf: o
|
|
2422
|
+
}), (d, c) => {
|
|
2421
2423
|
const v = ae("el-tooltip"), m = Xe("loading");
|
|
2422
2424
|
return u(), p("div", {
|
|
2423
2425
|
class: I(["relative cc1-form-box", [e.option.table?.fitHeight ? "col" : "no-min-height"]])
|
|
@@ -2430,64 +2432,64 @@ const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
|
2430
2432
|
O("div", {
|
|
2431
2433
|
class: I(["column fit-width no-wrap", [e.option.table?.fitHeight ? "col" : ""]])
|
|
2432
2434
|
}, [
|
|
2433
|
-
e.option.search?.show !== !1 ? (u(), p("div",
|
|
2435
|
+
e.option.search?.show !== !1 ? (u(), p("div", uo, [
|
|
2434
2436
|
$(r(q), {
|
|
2435
|
-
model: r(
|
|
2437
|
+
model: r(o).search.form,
|
|
2436
2438
|
inline: "",
|
|
2437
2439
|
size: e.option.size?.search
|
|
2438
2440
|
}, {
|
|
2439
2441
|
default: y(() => [
|
|
2440
2442
|
k(d.$slots, "search-start", {
|
|
2441
|
-
row: r(
|
|
2443
|
+
row: r(o).search.form
|
|
2442
2444
|
}),
|
|
2443
|
-
(u(!0), p(F, null, j(r(
|
|
2445
|
+
(u(!0), p(F, null, j(r(o).search.column.list, (g) => (u(), p(F, {
|
|
2444
2446
|
key: g.key
|
|
2445
2447
|
}, [
|
|
2446
2448
|
k(d.$slots, "search-" + g.key + "-start", {
|
|
2447
|
-
row: r(
|
|
2449
|
+
row: r(o).search.form
|
|
2448
2450
|
}),
|
|
2449
|
-
(typeof g.show?.search == "function" ? g.show?.search(r(
|
|
2451
|
+
(typeof g.show?.search == "function" ? g.show?.search(r(o).search.form) : g.show?.search) ? (u(), h(r(he), {
|
|
2450
2452
|
key: 0,
|
|
2451
2453
|
label: g.text?.search?.label ?? g.label
|
|
2452
2454
|
}, {
|
|
2453
2455
|
default: y(() => [
|
|
2454
2456
|
k(d.$slots, "search-" + g.key + "-left", {
|
|
2455
|
-
row: r(
|
|
2457
|
+
row: r(o).search.form
|
|
2456
2458
|
}),
|
|
2457
2459
|
k(d.$slots, "search-" + g.key, {
|
|
2458
|
-
row: r(
|
|
2460
|
+
row: r(o).search.form
|
|
2459
2461
|
}, () => [
|
|
2460
2462
|
g.options?.search?.type ? (u(), h(ke, {
|
|
2461
2463
|
key: 0,
|
|
2462
2464
|
item: g,
|
|
2463
|
-
conf: r(
|
|
2465
|
+
conf: r(o),
|
|
2464
2466
|
type: g.options.search.type
|
|
2465
2467
|
}, null, 8, ["item", "conf", "type"])) : (u(), h(ke, {
|
|
2466
2468
|
key: 1,
|
|
2467
2469
|
item: g,
|
|
2468
|
-
conf: r(
|
|
2470
|
+
conf: r(o),
|
|
2469
2471
|
type: g.type
|
|
2470
2472
|
}, null, 8, ["item", "conf", "type"]))
|
|
2471
2473
|
]),
|
|
2472
2474
|
k(d.$slots, "search-" + g.key + "-right", {
|
|
2473
|
-
row: r(
|
|
2475
|
+
row: r(o).search.form
|
|
2474
2476
|
})
|
|
2475
2477
|
]),
|
|
2476
2478
|
_: 2
|
|
2477
2479
|
}, 1032, ["label"])) : w("", !0),
|
|
2478
2480
|
k(d.$slots, "search-" + g.key + "-end", {
|
|
2479
|
-
row: r(
|
|
2481
|
+
row: r(o).search.form
|
|
2480
2482
|
})
|
|
2481
2483
|
], 64))), 128)),
|
|
2482
2484
|
k(d.$slots, "search-center", {
|
|
2483
|
-
row: r(
|
|
2485
|
+
row: r(o).search.form
|
|
2484
2486
|
}),
|
|
2485
2487
|
e.option.tools?.search || e.option.tools?.reset ? (u(), h(r(he), { key: 0 }, {
|
|
2486
2488
|
default: y(() => [
|
|
2487
2489
|
e.option.tools?.search ? (u(), h(r(T), {
|
|
2488
2490
|
key: 0,
|
|
2489
2491
|
type: "primary",
|
|
2490
|
-
onClick: r(
|
|
2492
|
+
onClick: r(o).search.submit
|
|
2491
2493
|
}, {
|
|
2492
2494
|
default: y(() => [
|
|
2493
2495
|
V(D(r(b).tCurd("search")), 1)
|
|
@@ -2496,7 +2498,7 @@ const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
|
2496
2498
|
}, 8, ["onClick"])) : w("", !0),
|
|
2497
2499
|
e.option.tools?.reset ? (u(), h(r(T), {
|
|
2498
2500
|
key: 1,
|
|
2499
|
-
onClick: r(
|
|
2501
|
+
onClick: r(o).search.reset
|
|
2500
2502
|
}, {
|
|
2501
2503
|
default: y(() => [
|
|
2502
2504
|
V(D(r(b).tCurd("reset")), 1)
|
|
@@ -2507,18 +2509,18 @@ const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
|
2507
2509
|
_: 1
|
|
2508
2510
|
})) : w("", !0),
|
|
2509
2511
|
k(d.$slots, "search-end", {
|
|
2510
|
-
row: r(
|
|
2512
|
+
row: r(o).search.form
|
|
2511
2513
|
})
|
|
2512
2514
|
]),
|
|
2513
2515
|
_: 3
|
|
2514
2516
|
}, 8, ["model", "size"])
|
|
2515
2517
|
])) : w("", !0),
|
|
2516
|
-
O("div",
|
|
2518
|
+
O("div", co, [
|
|
2517
2519
|
O("div", fo, [
|
|
2518
2520
|
r(i)(e.option.tools?.add) ? (u(), p("div", mo, [
|
|
2519
2521
|
$(r(T), {
|
|
2520
2522
|
type: "primary",
|
|
2521
|
-
onClick:
|
|
2523
|
+
onClick: c[0] || (c[0] = (g) => r(o).update.open(r(l).Add)),
|
|
2522
2524
|
size: e.option.size?.search
|
|
2523
2525
|
}, {
|
|
2524
2526
|
default: y(() => [
|
|
@@ -2530,7 +2532,7 @@ const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
|
2530
2532
|
e.option.table?.selectable && r(i)(e.option.tools?.delete) ? (u(), p("div", go, [
|
|
2531
2533
|
$(r(T), {
|
|
2532
2534
|
type: "danger",
|
|
2533
|
-
onClick:
|
|
2535
|
+
onClick: c[1] || (c[1] = (g) => r(o).remove.open(r(o).table.selection.list)),
|
|
2534
2536
|
size: e.option.size?.search
|
|
2535
2537
|
}, {
|
|
2536
2538
|
default: y(() => [
|
|
@@ -2542,7 +2544,7 @@ const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
|
2542
2544
|
e.option.tools?.expand ? (u(), p("div", ho, [
|
|
2543
2545
|
$(r(T), {
|
|
2544
2546
|
type: "warning",
|
|
2545
|
-
onClick:
|
|
2547
|
+
onClick: c[2] || (c[2] = (g) => r(o).table.expand.all()),
|
|
2546
2548
|
size: e.option.size?.search
|
|
2547
2549
|
}, {
|
|
2548
2550
|
default: y(() => [
|
|
@@ -2554,7 +2556,7 @@ const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
|
2554
2556
|
e.option.tools?.export?.show ? (u(), p(F, { key: 3 }, [
|
|
2555
2557
|
e.option.tools?.export?.dropdown?.show ? (u(), h(r(Ge), {
|
|
2556
2558
|
key: 0,
|
|
2557
|
-
onCommand: r(
|
|
2559
|
+
onCommand: r(o).export.click
|
|
2558
2560
|
}, {
|
|
2559
2561
|
dropdown: y(() => [
|
|
2560
2562
|
$(r(Ne), {
|
|
@@ -2596,7 +2598,7 @@ const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
|
2596
2598
|
O("div", yo, [
|
|
2597
2599
|
$(r(T), {
|
|
2598
2600
|
type: "warning",
|
|
2599
|
-
loading: r(
|
|
2601
|
+
loading: r(o).export.loading,
|
|
2600
2602
|
size: e.option.size?.search
|
|
2601
2603
|
}, {
|
|
2602
2604
|
default: y(() => [
|
|
@@ -2610,9 +2612,9 @@ const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
|
2610
2612
|
}, 8, ["onCommand"])) : (u(), p("div", bo, [
|
|
2611
2613
|
$(r(T), {
|
|
2612
2614
|
type: "warning",
|
|
2613
|
-
loading: r(
|
|
2615
|
+
loading: r(o).export.loading,
|
|
2614
2616
|
size: e.option.size?.search,
|
|
2615
|
-
onClick:
|
|
2617
|
+
onClick: c[3] || (c[3] = (g) => r(o).export.run.start("all"))
|
|
2616
2618
|
}, {
|
|
2617
2619
|
default: y(() => [
|
|
2618
2620
|
V(D(r(b).tCurd("export")), 1)
|
|
@@ -2625,34 +2627,34 @@ const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
|
2625
2627
|
]),
|
|
2626
2628
|
O("div", po, [
|
|
2627
2629
|
k(d.$slots, "tools-right"),
|
|
2628
|
-
r(
|
|
2630
|
+
r(o).page.showTools ? (u(), h(r(we), C({
|
|
2629
2631
|
key: 0,
|
|
2630
|
-
"current-page": r(
|
|
2631
|
-
"onUpdate:currentPage":
|
|
2632
|
-
"page-size": r(
|
|
2633
|
-
"onUpdate:pageSize":
|
|
2632
|
+
"current-page": r(o).page.num,
|
|
2633
|
+
"onUpdate:currentPage": c[4] || (c[4] = (g) => r(o).page.num = g),
|
|
2634
|
+
"page-size": r(o).page.size,
|
|
2635
|
+
"onUpdate:pageSize": c[5] || (c[5] = (g) => r(o).page.size = g),
|
|
2634
2636
|
background: "",
|
|
2635
|
-
"page-sizes": r(
|
|
2636
|
-
"pager-count": r(
|
|
2637
|
-
layout: r(
|
|
2638
|
-
total: r(
|
|
2637
|
+
"page-sizes": r(o).page.sizeList,
|
|
2638
|
+
"pager-count": r(o).page.pagerCount,
|
|
2639
|
+
layout: r(o).page.layout,
|
|
2640
|
+
total: r(o).page.total,
|
|
2639
2641
|
size: e.option.size?.table,
|
|
2640
|
-
onSizeChange: r(
|
|
2641
|
-
onCurrentChange: r(
|
|
2642
|
+
onSizeChange: r(o).table.getList,
|
|
2643
|
+
onCurrentChange: r(o).table.getList
|
|
2642
2644
|
}, e.option.page?.pagination || {}, E(e.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : w("", !0),
|
|
2643
2645
|
e.option.tools?.expandColumn === void 0 || e.option.tools?.expandColumn ? (u(), h(v, {
|
|
2644
2646
|
key: 1,
|
|
2645
2647
|
effect: "dark",
|
|
2646
|
-
content: r(
|
|
2648
|
+
content: r(o).table.header.group.expand ? r(b).tCurd("mergeColumn") : r(b).tCurd("expandColumn"),
|
|
2647
2649
|
placement: "top"
|
|
2648
2650
|
}, {
|
|
2649
2651
|
default: y(() => [
|
|
2650
2652
|
O("div", {
|
|
2651
2653
|
class: I(["refresh-btn", [e.option.size?.search]]),
|
|
2652
|
-
onClick:
|
|
2653
|
-
(...g) => r(
|
|
2654
|
+
onClick: c[6] || (c[6] = //@ts-ignore
|
|
2655
|
+
(...g) => r(o).table.header.group.toggleExpandAll && r(o).table.header.group.toggleExpandAll(...g))
|
|
2654
2656
|
}, [
|
|
2655
|
-
r(
|
|
2657
|
+
r(o).table.header.group.expand ? (u(), h(Rt, { key: 0 })) : (u(), h(jt, { key: 1 }))
|
|
2656
2658
|
], 2)
|
|
2657
2659
|
]),
|
|
2658
2660
|
_: 1
|
|
@@ -2660,10 +2662,10 @@ const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
|
2660
2662
|
e.option.tools?.refresh === void 0 || e.option.tools?.refresh ? (u(), p("div", {
|
|
2661
2663
|
key: 2,
|
|
2662
2664
|
class: I(["refresh-btn", [e.option.size?.search]]),
|
|
2663
|
-
onClick:
|
|
2664
|
-
(...g) => r(
|
|
2665
|
+
onClick: c[7] || (c[7] = //@ts-ignore
|
|
2666
|
+
(...g) => r(o).table.getList && r(o).table.getList(...g))
|
|
2665
2667
|
}, [
|
|
2666
|
-
$(
|
|
2668
|
+
$(Ht)
|
|
2667
2669
|
], 2)) : w("", !0)
|
|
2668
2670
|
])
|
|
2669
2671
|
]),
|
|
@@ -2675,13 +2677,13 @@ const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
|
2675
2677
|
}, [
|
|
2676
2678
|
Ye((u(), h(r(We), C({
|
|
2677
2679
|
ref_key: "tableRef",
|
|
2678
|
-
ref:
|
|
2679
|
-
data: r(
|
|
2680
|
+
ref: f,
|
|
2681
|
+
data: r(o).table.data,
|
|
2680
2682
|
border: e.option.table?.border === void 0 ? !0 : e.option.table?.border,
|
|
2681
|
-
onSelectionChange: r(
|
|
2682
|
-
onSortChange: r(
|
|
2683
|
-
"expand-row-keys": r(
|
|
2684
|
-
onExpandChange: r(
|
|
2683
|
+
onSelectionChange: r(o).table.selection.change,
|
|
2684
|
+
onSortChange: r(o).table.sort.change,
|
|
2685
|
+
"expand-row-keys": r(o).table.expand.rowKeys,
|
|
2686
|
+
onExpandChange: r(o).table.expand.change
|
|
2685
2687
|
}, e.option.table, E(e.option.table?.on || {})), {
|
|
2686
2688
|
default: y(() => [
|
|
2687
2689
|
(typeof e.option.table?.selectable == "object" ? e.option.table?.selectable?.show : e.option.table?.selectable) || r(i)(e.option.tools?.delete) || e.option.tools?.export?.show && e.option.tools?.export?.select ? (u(), h(r(re), C({
|
|
@@ -2703,9 +2705,9 @@ const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
|
2703
2705
|
"show-overflow-tooltip": !1,
|
|
2704
2706
|
className: "cc1-form-index-column"
|
|
2705
2707
|
}, typeof e.option.table?.index == "object" ? e.option.table?.index : {}, E(typeof e.option.table?.index == "object" ? e.option.table?.index?.on || {} : {})), null, 16)) : w("", !0),
|
|
2706
|
-
$(
|
|
2707
|
-
conf: r(
|
|
2708
|
-
columnList: r(
|
|
2708
|
+
$(so, {
|
|
2709
|
+
conf: r(o),
|
|
2710
|
+
columnList: r(o).table.column.list,
|
|
2709
2711
|
option: e.option
|
|
2710
2712
|
}, W({ _: 2 }, [
|
|
2711
2713
|
j(d.$slots, (g, B) => ({
|
|
@@ -2717,11 +2719,12 @@ const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
|
2717
2719
|
]), 1032, ["conf", "columnList", "option"]),
|
|
2718
2720
|
r(i)(e.option.table?.add) || r(i)(e.option.table?.update) || r(i)(e.option.table?.delete) || r(i)(e.option.table?.view) || d.$slots["table-op-left"] || d.$slots["table-op-right"] ? (u(), h(r(re), C({
|
|
2719
2721
|
key: 2,
|
|
2720
|
-
width: "auto",
|
|
2721
|
-
"max-width": "200",
|
|
2722
2722
|
align: "center",
|
|
2723
2723
|
fixed: "right"
|
|
2724
|
-
}, e.option.table?.operate, {
|
|
2724
|
+
}, e.option.table?.operate, {
|
|
2725
|
+
width: e.option.table?.operate?.width || 120,
|
|
2726
|
+
"show-overflow-tooltip": !1
|
|
2727
|
+
}), {
|
|
2725
2728
|
header: y(() => [
|
|
2726
2729
|
k(d.$slots, "table-header-op", {}, () => [
|
|
2727
2730
|
V(D(r(b).tCurd("operation")), 1)
|
|
@@ -2733,11 +2736,11 @@ const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
|
2733
2736
|
}, {
|
|
2734
2737
|
default: y(() => [
|
|
2735
2738
|
k(d.$slots, "table-op-left", { row: g }),
|
|
2736
|
-
r(
|
|
2739
|
+
r(o).update.type === r(l).Update && e.option.table?.inlineEdit && r(o).update.form[a.option.table?.rowKey] === g[a.option.table?.rowKey] ? (u(), p(F, { key: 0 }, [
|
|
2737
2740
|
$(r(T), {
|
|
2738
2741
|
link: "",
|
|
2739
2742
|
type: "info",
|
|
2740
|
-
onClick: r(
|
|
2743
|
+
onClick: r(o).update.close
|
|
2741
2744
|
}, {
|
|
2742
2745
|
default: y(() => [
|
|
2743
2746
|
V(D(r(b).tCurd("cancel")), 1)
|
|
@@ -2747,8 +2750,8 @@ const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
|
2747
2750
|
$(r(T), {
|
|
2748
2751
|
link: "",
|
|
2749
2752
|
type: "primary",
|
|
2750
|
-
onClick: r(
|
|
2751
|
-
loading: r(
|
|
2753
|
+
onClick: r(o).update.submit,
|
|
2754
|
+
loading: r(o).update.loading
|
|
2752
2755
|
}, {
|
|
2753
2756
|
default: y(() => [
|
|
2754
2757
|
V(D(r(b).tCurd("confirm")), 1)
|
|
@@ -2761,7 +2764,7 @@ const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
|
2761
2764
|
key: 0,
|
|
2762
2765
|
link: "",
|
|
2763
2766
|
type: "primary",
|
|
2764
|
-
onClick: (B) => r(
|
|
2767
|
+
onClick: (B) => r(o).update.open(r(l).Add, g)
|
|
2765
2768
|
}, {
|
|
2766
2769
|
default: y(() => [
|
|
2767
2770
|
V(D(r(b).tCurd("add")), 1)
|
|
@@ -2772,7 +2775,7 @@ const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
|
2772
2775
|
key: 1,
|
|
2773
2776
|
link: "",
|
|
2774
2777
|
type: "primary",
|
|
2775
|
-
onClick: (B) => r(
|
|
2778
|
+
onClick: (B) => r(o).update.open(r(l).View, g)
|
|
2776
2779
|
}, {
|
|
2777
2780
|
default: y(() => [
|
|
2778
2781
|
V(D(r(b).tCurd("view")), 1)
|
|
@@ -2783,7 +2786,7 @@ const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
|
2783
2786
|
key: 2,
|
|
2784
2787
|
link: "",
|
|
2785
2788
|
type: "warning",
|
|
2786
|
-
onClick: (B) => r(
|
|
2789
|
+
onClick: (B) => r(o).update.open(r(l).Update, g)
|
|
2787
2790
|
}, {
|
|
2788
2791
|
default: y(() => [
|
|
2789
2792
|
V(D(r(b).tCurd("edit")), 1)
|
|
@@ -2794,7 +2797,7 @@ const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
|
2794
2797
|
key: 3,
|
|
2795
2798
|
link: "",
|
|
2796
2799
|
type: "danger",
|
|
2797
|
-
onClick: (B) => r(
|
|
2800
|
+
onClick: (B) => r(o).remove.open([g])
|
|
2798
2801
|
}, {
|
|
2799
2802
|
default: y(() => [
|
|
2800
2803
|
V(D(r(b).tCurd("delete")), 1)
|
|
@@ -2808,39 +2811,39 @@ const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
|
2808
2811
|
}, 1032, ["size"])
|
|
2809
2812
|
]),
|
|
2810
2813
|
_: 3
|
|
2811
|
-
}, 16)) : w("", !0)
|
|
2814
|
+
}, 16, ["width"])) : w("", !0)
|
|
2812
2815
|
]),
|
|
2813
2816
|
_: 3
|
|
2814
2817
|
}, 16, ["data", "border", "onSelectionChange", "onSortChange", "expand-row-keys", "onExpandChange"])), [
|
|
2815
|
-
[m, r(
|
|
2818
|
+
[m, r(o).table.loading]
|
|
2816
2819
|
])
|
|
2817
2820
|
], 2)
|
|
2818
2821
|
], 2),
|
|
2819
2822
|
O("div", wo, [
|
|
2820
|
-
(e.option.page?.show === void 0 || e.option.page?.show) && !r(
|
|
2823
|
+
(e.option.page?.show === void 0 || e.option.page?.show) && !r(o).page.showTools ? (u(), h(r(we), C({
|
|
2821
2824
|
key: 0,
|
|
2822
|
-
"current-page": r(
|
|
2823
|
-
"onUpdate:currentPage":
|
|
2824
|
-
"page-size": r(
|
|
2825
|
-
"onUpdate:pageSize":
|
|
2825
|
+
"current-page": r(o).page.num,
|
|
2826
|
+
"onUpdate:currentPage": c[8] || (c[8] = (g) => r(o).page.num = g),
|
|
2827
|
+
"page-size": r(o).page.size,
|
|
2828
|
+
"onUpdate:pageSize": c[9] || (c[9] = (g) => r(o).page.size = g),
|
|
2826
2829
|
background: "",
|
|
2827
|
-
"page-sizes": r(
|
|
2828
|
-
"pager-count": r(
|
|
2829
|
-
layout: r(
|
|
2830
|
-
total: r(
|
|
2830
|
+
"page-sizes": r(o).page.sizeList,
|
|
2831
|
+
"pager-count": r(o).page.pagerCount,
|
|
2832
|
+
layout: r(o).page.layout,
|
|
2833
|
+
total: r(o).page.total,
|
|
2831
2834
|
size: e.option.size?.table,
|
|
2832
|
-
onSizeChange: r(
|
|
2833
|
-
onCurrentChange: r(
|
|
2835
|
+
onSizeChange: r(o).table.getList,
|
|
2836
|
+
onCurrentChange: r(o).table.getList
|
|
2834
2837
|
}, e.option.page?.pagination || {}, E(e.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : w("", !0)
|
|
2835
2838
|
])
|
|
2836
2839
|
], 2),
|
|
2837
2840
|
k(d.$slots, "box-right")
|
|
2838
2841
|
], 2),
|
|
2839
2842
|
$(r(ye), C({
|
|
2840
|
-
modelValue: r(
|
|
2841
|
-
"onUpdate:modelValue":
|
|
2842
|
-
title: r(
|
|
2843
|
-
"before-close": r(
|
|
2843
|
+
modelValue: r(o).update.show,
|
|
2844
|
+
"onUpdate:modelValue": c[10] || (c[10] = (g) => r(o).update.show = g),
|
|
2845
|
+
title: r(o).update.title,
|
|
2846
|
+
"before-close": r(o).update.close
|
|
2844
2847
|
}, e.option.dialog), {
|
|
2845
2848
|
footer: y(() => [
|
|
2846
2849
|
O("span", vo, [
|
|
@@ -2848,52 +2851,59 @@ const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
|
2848
2851
|
size: e.option.size?.form
|
|
2849
2852
|
}, {
|
|
2850
2853
|
default: y(() => [
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
},
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2854
|
+
k(d.$slots, "dialog-footer", {
|
|
2855
|
+
row: r(o).update
|
|
2856
|
+
}, () => [
|
|
2857
|
+
$(r(T), {
|
|
2858
|
+
onClick: r(o).update.close
|
|
2859
|
+
}, {
|
|
2860
|
+
default: y(() => [
|
|
2861
|
+
V(D(r(b).tCurd("close")), 1)
|
|
2862
|
+
]),
|
|
2863
|
+
_: 1
|
|
2864
|
+
}, 8, ["onClick"]),
|
|
2865
|
+
r(o).update.type !== r(l).View ? (u(), h(r(T), {
|
|
2866
|
+
key: 0,
|
|
2867
|
+
type: "primary",
|
|
2868
|
+
onClick: r(o).update.submit,
|
|
2869
|
+
loading: r(o).update.loading
|
|
2870
|
+
}, {
|
|
2871
|
+
default: y(() => [
|
|
2872
|
+
V(D(r(b).tCurd("submit")), 1)
|
|
2873
|
+
]),
|
|
2874
|
+
_: 1
|
|
2875
|
+
}, 8, ["onClick", "loading"])) : w("", !0)
|
|
2876
|
+
])
|
|
2870
2877
|
]),
|
|
2871
|
-
_:
|
|
2878
|
+
_: 3
|
|
2872
2879
|
}, 8, ["size"])
|
|
2873
2880
|
])
|
|
2874
2881
|
]),
|
|
2875
2882
|
default: y(() => [
|
|
2883
|
+
k(d.$slots, "dialog-start", {
|
|
2884
|
+
row: r(o).update
|
|
2885
|
+
}),
|
|
2876
2886
|
$(r(q), {
|
|
2877
2887
|
ref_key: "ruleFormRef",
|
|
2878
2888
|
ref: s,
|
|
2879
|
-
model: r(
|
|
2880
|
-
rules: r(
|
|
2889
|
+
model: r(o).update.form,
|
|
2890
|
+
rules: r(o).update.rules,
|
|
2881
2891
|
size: e.option.size?.form,
|
|
2882
2892
|
class: "update-dialog-form"
|
|
2883
2893
|
}, {
|
|
2884
2894
|
default: y(() => [
|
|
2885
|
-
r(
|
|
2895
|
+
r(o).update.showContent ? (u(), h(Te, {
|
|
2886
2896
|
key: 0,
|
|
2887
|
-
"form-grid": r(
|
|
2888
|
-
"max-span": r(
|
|
2889
|
-
form: r(
|
|
2890
|
-
type: r(
|
|
2897
|
+
"form-grid": r(o).update.formGrid,
|
|
2898
|
+
"max-span": r(o).update.formMaxSpan,
|
|
2899
|
+
form: r(o).update.form,
|
|
2900
|
+
type: r(o).update.type,
|
|
2891
2901
|
stripe: e.option.form?.stripe,
|
|
2892
2902
|
"label-width": e.option.form?.labelWidth,
|
|
2893
2903
|
"form-option": e.option.form,
|
|
2894
|
-
"get-bind": r(
|
|
2895
|
-
"get-on": r(
|
|
2896
|
-
"get-disabled": r(
|
|
2904
|
+
"get-bind": r(o).update.getBind,
|
|
2905
|
+
"get-on": r(o).update.getOn,
|
|
2906
|
+
"get-disabled": r(o).update.getDisabled
|
|
2897
2907
|
}, W({ _: 2 }, [
|
|
2898
2908
|
j(d.$slots, (g, B) => ({
|
|
2899
2909
|
name: B,
|
|
@@ -2904,14 +2914,17 @@ const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
|
2904
2914
|
]), 1032, ["form-grid", "max-span", "form", "type", "stripe", "label-width", "form-option", "get-bind", "get-on", "get-disabled"])) : w("", !0)
|
|
2905
2915
|
]),
|
|
2906
2916
|
_: 3
|
|
2907
|
-
}, 8, ["model", "rules", "size"])
|
|
2917
|
+
}, 8, ["model", "rules", "size"]),
|
|
2918
|
+
k(d.$slots, "dialog-end", {
|
|
2919
|
+
row: r(o).update
|
|
2920
|
+
})
|
|
2908
2921
|
]),
|
|
2909
2922
|
_: 3
|
|
2910
2923
|
}, 16, ["modelValue", "title", "before-close"]),
|
|
2911
2924
|
$(r(ye), {
|
|
2912
|
-
modelValue: r(
|
|
2913
|
-
"onUpdate:modelValue":
|
|
2914
|
-
title: r(
|
|
2925
|
+
modelValue: r(o).remove.show,
|
|
2926
|
+
"onUpdate:modelValue": c[11] || (c[11] = (g) => r(o).remove.show = g),
|
|
2927
|
+
title: r(o).remove.title,
|
|
2915
2928
|
"close-on-click-modal": !1
|
|
2916
2929
|
}, {
|
|
2917
2930
|
footer: y(() => [
|
|
@@ -2921,7 +2934,7 @@ const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
|
2921
2934
|
}, {
|
|
2922
2935
|
default: y(() => [
|
|
2923
2936
|
$(r(T), {
|
|
2924
|
-
onClick: r(
|
|
2937
|
+
onClick: r(o).remove.close
|
|
2925
2938
|
}, {
|
|
2926
2939
|
default: y(() => [
|
|
2927
2940
|
V(D(r(b).tCurd("close")), 1)
|
|
@@ -2930,8 +2943,8 @@ const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
|
2930
2943
|
}, 8, ["onClick"]),
|
|
2931
2944
|
$(r(T), {
|
|
2932
2945
|
type: "danger",
|
|
2933
|
-
onClick: r(
|
|
2934
|
-
loading: r(
|
|
2946
|
+
onClick: r(o).remove.submit,
|
|
2947
|
+
loading: r(o).remove.loading
|
|
2935
2948
|
}, {
|
|
2936
2949
|
default: y(() => [
|
|
2937
2950
|
V(D(r(b).tCurd("confirmDelete")), 1)
|
|
@@ -2945,11 +2958,11 @@ const so = /* @__PURE__ */ Z(lo, [["render", ro]]), ke = /* @__PURE__ */ G({
|
|
|
2945
2958
|
]),
|
|
2946
2959
|
default: y(() => [
|
|
2947
2960
|
e.option.dialog?.delete?.content ? (u(), p("div", ko, [
|
|
2948
|
-
$(
|
|
2961
|
+
$(Mt, {
|
|
2949
2962
|
content: e.option.dialog?.delete?.content,
|
|
2950
|
-
value: r(
|
|
2963
|
+
value: r(o).remove.items
|
|
2951
2964
|
}, null, 8, ["content", "value"])
|
|
2952
|
-
])) : (u(), p("div", Co, D(r(b).tCurd("confirmDeleteMessage", r(
|
|
2965
|
+
])) : (u(), p("div", Co, D(r(b).tCurd("confirmDeleteMessage", r(o).remove.items.length)), 1))
|
|
2953
2966
|
]),
|
|
2954
2967
|
_: 1
|
|
2955
2968
|
}, 8, ["modelValue", "title"]),
|
|
@@ -2970,8 +2983,8 @@ class Oo {
|
|
|
2970
2983
|
* @param name - 下载后的文件名,默认 `'download.png'`
|
|
2971
2984
|
*/
|
|
2972
2985
|
static async download(n, l = "download.png") {
|
|
2973
|
-
const
|
|
2974
|
-
|
|
2986
|
+
const a = document.createElement("a");
|
|
2987
|
+
a.style.display = "none", a.href = n, a.setAttribute("download", l), typeof a.download > "u" && a.setAttribute("target", "_blank"), document.body.appendChild(a), a.click(), document.body.removeChild(a), window.URL.revokeObjectURL(n);
|
|
2975
2988
|
}
|
|
2976
2989
|
/**
|
|
2977
2990
|
* 将json对象或者json数组导出为json文件保存
|
|
@@ -2979,31 +2992,31 @@ class Oo {
|
|
|
2979
2992
|
* @param name
|
|
2980
2993
|
*/
|
|
2981
2994
|
static exportJSONFile = (n, l) => {
|
|
2982
|
-
const
|
|
2983
|
-
|
|
2995
|
+
const a = new Blob([JSON.stringify(n)], { type: "application/json" }), i = URL.createObjectURL(a), o = document.createElement("a");
|
|
2996
|
+
o.href = i, o.download = `${l || "config"}.json`, o.click();
|
|
2984
2997
|
};
|
|
2985
2998
|
/**
|
|
2986
2999
|
* 导入文件内容,默认为json
|
|
2987
3000
|
* @param param
|
|
2988
3001
|
* @returns
|
|
2989
3002
|
*/
|
|
2990
|
-
static importFile = async (n) => new Promise((l,
|
|
3003
|
+
static importFile = async (n) => new Promise((l, a) => {
|
|
2991
3004
|
const i = document.createElement("input");
|
|
2992
3005
|
i.type = "file";
|
|
2993
|
-
const
|
|
2994
|
-
i.accept =
|
|
3006
|
+
const o = n?.accept || ".json";
|
|
3007
|
+
i.accept = o, i.style.display = "none", i.onchange = (t) => {
|
|
2995
3008
|
const s = t.target.files[0];
|
|
2996
3009
|
if (!s) {
|
|
2997
|
-
S.fail("未选择文件"),
|
|
3010
|
+
S.fail("未选择文件"), a("未选择文件");
|
|
2998
3011
|
return;
|
|
2999
3012
|
}
|
|
3000
|
-
const
|
|
3001
|
-
|
|
3002
|
-
const
|
|
3003
|
-
l(
|
|
3004
|
-
},
|
|
3005
|
-
S.fail("文件读取失败"),
|
|
3006
|
-
},
|
|
3013
|
+
const f = new FileReader();
|
|
3014
|
+
f.onload = async (d) => {
|
|
3015
|
+
const c = o == ".json" ? JSON.parse(d.target.result) : d.target.result;
|
|
3016
|
+
l(c);
|
|
3017
|
+
}, f.onerror = () => {
|
|
3018
|
+
S.fail("文件读取失败"), a("文件读取失败");
|
|
3019
|
+
}, f.readAsText(s), document.body.removeChild(i);
|
|
3007
3020
|
}, document.body.appendChild(i), i.click();
|
|
3008
3021
|
});
|
|
3009
3022
|
}
|