cc1-form 1.1.43 → 1.2.1
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.css +1 -1
- package/dist/cc1-form.js +404 -399
- package/dist/cc1-form.umd.cjs +1 -1
- package/dist/components/TCurd/index.d.ts +7 -5
- package/dist/components/TCurd/index.vue.d.ts +10 -2
- package/dist/components/TCurd/indexType.d.ts +7 -1
- package/dist/components/TCurd/tableColumn.vue.d.ts +2 -2
- package/package.json +1 -1
package/dist/cc1-form.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ElMessage as ce, ElLoading as me, ElForm as N, ElFormItem as G, ElInput as
|
|
1
|
+
import { ElMessage as ce, ElLoading as me, ElForm as N, ElFormItem as G, ElInput as Z, ElSwitch as X, ElSelect as W, ElOption as K, ElRadioGroup as re, ElRadio as se, ElTreeSelect as de, ElDatePicker as ae, ElDialog as ee, ElButton as T, ElTableColumn as te, ElDropdown as he, ElDropdownMenu as ye, ElDropdownItem as _, ElPagination as ie, ElTable as be } from "element-plus";
|
|
2
2
|
import "vue-router";
|
|
3
|
-
import { defineComponent as J, reactive as le, onMounted as ue, resolveComponent as
|
|
4
|
-
class
|
|
3
|
+
import { defineComponent as J, reactive as le, onMounted as ue, resolveComponent as Y, createElementBlock as b, createCommentVNode as k, openBlock as f, renderSlot as C, createVNode as z, withCtx as m, createTextVNode as $, Fragment as S, renderList as L, createBlock as h, normalizeClass as j, normalizeStyle as fe, ref as H, unref as a, createElementVNode as F, mergeProps as v, toHandlers as D, resolveDynamicComponent as q, toDisplayString as E, getCurrentInstance as ge, createSlots as oe, resolveDirective as we, withDirectives as ke, normalizeProps as Ce, guardReactiveProps as ve } from "vue";
|
|
4
|
+
class U {
|
|
5
5
|
/**
|
|
6
6
|
* Vue Router 实例,需在应用初始化时赋值
|
|
7
7
|
*/
|
|
@@ -43,9 +43,9 @@ class E {
|
|
|
43
43
|
* @param module
|
|
44
44
|
*/
|
|
45
45
|
static loadModule = async (o) => {
|
|
46
|
-
if (!
|
|
46
|
+
if (!U.moduleObj[o])
|
|
47
47
|
throw new Error(`模块${o}未加载,请赋值如:TSys.moduleObj = { ${o}: ()=>import('${o}') }`);
|
|
48
|
-
const u = await
|
|
48
|
+
const u = await U.moduleObj[o]();
|
|
49
49
|
return u.default ?? u;
|
|
50
50
|
};
|
|
51
51
|
/**
|
|
@@ -63,9 +63,9 @@ class E {
|
|
|
63
63
|
* @param options 其他选项
|
|
64
64
|
*/
|
|
65
65
|
static showMessage(o, u, t = {}) {
|
|
66
|
-
const
|
|
67
|
-
if (!this.tipMessages[o] ||
|
|
68
|
-
this.tipMessages[o] =
|
|
66
|
+
const r = Date.now();
|
|
67
|
+
if (!this.tipMessages[o] || r - this.tipMessages[o] > this.tipMessagesGap) {
|
|
68
|
+
this.tipMessages[o] = r;
|
|
69
69
|
const l = Object.assign(
|
|
70
70
|
{
|
|
71
71
|
message: o,
|
|
@@ -117,11 +117,11 @@ class E {
|
|
|
117
117
|
*/
|
|
118
118
|
static openUrl = (o, u = !0) => {
|
|
119
119
|
if (u) {
|
|
120
|
-
let t = screen.width / 2 - 500,
|
|
120
|
+
let t = screen.width / 2 - 500, r = screen.height / 2 - 800 / 2 - 30;
|
|
121
121
|
window.open(
|
|
122
122
|
o,
|
|
123
123
|
"_blank",
|
|
124
|
-
"toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" +
|
|
124
|
+
"toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + r + ", left=" + t
|
|
125
125
|
);
|
|
126
126
|
} else
|
|
127
127
|
window.open(o, "DescriptiveWindowName" + StrUtil.getId(), "resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0");
|
|
@@ -132,10 +132,10 @@ class E {
|
|
|
132
132
|
* @returns
|
|
133
133
|
*/
|
|
134
134
|
static getImgPic = (o) => new Promise(async (u, t) => {
|
|
135
|
-
let
|
|
136
|
-
const l = await
|
|
135
|
+
let r = document.getElementById(o.id);
|
|
136
|
+
const l = await U.loadModule("html2canvas");
|
|
137
137
|
try {
|
|
138
|
-
l(
|
|
138
|
+
l(r, {
|
|
139
139
|
logging: !1,
|
|
140
140
|
allowTaint: !0,
|
|
141
141
|
scale: window.devicePixelRatio,
|
|
@@ -525,9 +525,9 @@ class M {
|
|
|
525
525
|
* @returns 该字段对应类型的 options 配置,如 select 类型返回 `options.select`
|
|
526
526
|
*/
|
|
527
527
|
static findOptions = (o, u) => {
|
|
528
|
-
const t = o.column.find((l) => l.key === u),
|
|
528
|
+
const t = o.column.find((l) => l.key === u), r = (l) => l.replace(/-([a-z])/g, (e, s) => s.toUpperCase());
|
|
529
529
|
if (t)
|
|
530
|
-
return t.options[
|
|
530
|
+
return t.options[r(t.type)];
|
|
531
531
|
};
|
|
532
532
|
/**
|
|
533
533
|
* 更新组件数据
|
|
@@ -546,8 +546,8 @@ class M {
|
|
|
546
546
|
)
|
|
547
547
|
*/
|
|
548
548
|
static setOptionsData = (o, u, t) => {
|
|
549
|
-
const
|
|
550
|
-
|
|
549
|
+
const r = M.findOptions(o, u);
|
|
550
|
+
r && (r.data = t);
|
|
551
551
|
};
|
|
552
552
|
static form = {
|
|
553
553
|
openBefore: {
|
|
@@ -558,9 +558,9 @@ class M {
|
|
|
558
558
|
* @param treeData 树形数据
|
|
559
559
|
* @param option 组件配置
|
|
560
560
|
*/
|
|
561
|
-
parentId: (o, u, t,
|
|
561
|
+
parentId: (o, u, t, r) => {
|
|
562
562
|
const l = O.config.table.rowKey;
|
|
563
|
-
o ? u.type ===
|
|
563
|
+
o ? u.type === U.EDialog.Add ? (u.form.parentId = o[l], u.form.sort = o.children.length + 1) : u.form.parentId = o.parentId.substring(o.parentId.lastIndexOf(",") + 1) : (u.form.parentId = "0", u.form.sort = t.length + 1), M.setOptionsData(r, "parentId", [{ [l]: "0", title: "根", children: t }]);
|
|
564
564
|
}
|
|
565
565
|
}
|
|
566
566
|
};
|
|
@@ -605,7 +605,7 @@ class y {
|
|
|
605
605
|
return o(...u);
|
|
606
606
|
o = String(o);
|
|
607
607
|
let t = 0;
|
|
608
|
-
return o.replace(/{([^}]+)}/g, (
|
|
608
|
+
return o.replace(/{([^}]+)}/g, (r, l) => t < u.length ? String(u[t++]) : `{${l}}`);
|
|
609
609
|
}
|
|
610
610
|
static setI18n = (o) => {
|
|
611
611
|
y.curd = ObjectUtil.deepMerge(y.curd, o);
|
|
@@ -629,12 +629,12 @@ class P {
|
|
|
629
629
|
*/
|
|
630
630
|
static setId = (o, u, t) => {
|
|
631
631
|
u[o] || (u[o] = []);
|
|
632
|
-
const
|
|
632
|
+
const r = O.config.table.rowKey;
|
|
633
633
|
u[o].forEach((l) => {
|
|
634
634
|
t.forEach((e) => {
|
|
635
635
|
let s = e.default ?? "";
|
|
636
636
|
e.type === "number" && (s = e.default ?? 0), e.type === "boolean" && (s = e.default ?? !1), e.type === "time" && (s = e.default ?? /* @__PURE__ */ new Date()), l[e.value] === void 0 && (l[e.value] = s);
|
|
637
|
-
}), l[
|
|
637
|
+
}), l[r] || (l[r] = P.getIdFun());
|
|
638
638
|
});
|
|
639
639
|
};
|
|
640
640
|
/**
|
|
@@ -644,7 +644,7 @@ class P {
|
|
|
644
644
|
* @param itemFields 元素字段-如:[{label:'',value:''}]
|
|
645
645
|
* @param callback 回调函数
|
|
646
646
|
*/
|
|
647
|
-
static add = (o, u, t,
|
|
647
|
+
static add = (o, u, t, r) => {
|
|
648
648
|
const l = JSONUtil.cp(t);
|
|
649
649
|
P.setId(o, u, t);
|
|
650
650
|
const e = O.config.table.rowKey;
|
|
@@ -656,7 +656,7 @@ class P {
|
|
|
656
656
|
},
|
|
657
657
|
{ [e]: P.getIdFun() }
|
|
658
658
|
)
|
|
659
|
-
),
|
|
659
|
+
), r?.(u);
|
|
660
660
|
};
|
|
661
661
|
/**
|
|
662
662
|
* 删除数组元素
|
|
@@ -665,9 +665,9 @@ class P {
|
|
|
665
665
|
* @param item 元素-如:{_id:''}
|
|
666
666
|
* @param callback 回调函数
|
|
667
667
|
*/
|
|
668
|
-
static remove = (o, u, t,
|
|
668
|
+
static remove = (o, u, t, r) => {
|
|
669
669
|
const l = O.config.table.rowKey;
|
|
670
|
-
u[o] = u[o].filter((e) => e[l] !== t[l]),
|
|
670
|
+
u[o] = u[o].filter((e) => e[l] !== t[l]), r?.(u);
|
|
671
671
|
};
|
|
672
672
|
/**
|
|
673
673
|
* 获取没有id的数据
|
|
@@ -676,9 +676,9 @@ class P {
|
|
|
676
676
|
* @returns 没有id的数据
|
|
677
677
|
*/
|
|
678
678
|
static getNoIdData = (o, u) => {
|
|
679
|
-
const t = JSONUtil.cp(o),
|
|
679
|
+
const t = JSONUtil.cp(o), r = O.config.table.rowKey;
|
|
680
680
|
return t.forEach((l) => {
|
|
681
|
-
l[
|
|
681
|
+
l[r] && delete l[r], u && l[u] && P.getNoIdData(l[u], u);
|
|
682
682
|
}), t;
|
|
683
683
|
};
|
|
684
684
|
}
|
|
@@ -686,7 +686,7 @@ const ze = {
|
|
|
686
686
|
key: 0,
|
|
687
687
|
class: "column curd-form-com-list",
|
|
688
688
|
style: { width: "100%", gap: "10px" }
|
|
689
|
-
},
|
|
689
|
+
}, De = { key: 0 }, $e = {
|
|
690
690
|
class: "row items-center",
|
|
691
691
|
style: { gap: "10px", width: "100%" }
|
|
692
692
|
}, Se = { key: 1 }, ne = /* @__PURE__ */ J({
|
|
@@ -727,33 +727,33 @@ const ze = {
|
|
|
727
727
|
}
|
|
728
728
|
},
|
|
729
729
|
emits: ["change"],
|
|
730
|
-
setup(
|
|
731
|
-
const u =
|
|
730
|
+
setup(i, { emit: o }) {
|
|
731
|
+
const u = i, t = le({
|
|
732
732
|
show: !1,
|
|
733
733
|
add: (l, e, s) => {
|
|
734
734
|
P.add(l, e, s, () => {
|
|
735
|
-
|
|
735
|
+
r("change");
|
|
736
736
|
});
|
|
737
737
|
},
|
|
738
738
|
remove: (l, e, s) => {
|
|
739
739
|
P.remove(l, e, s, () => {
|
|
740
|
-
|
|
740
|
+
r("change");
|
|
741
741
|
});
|
|
742
742
|
}
|
|
743
743
|
});
|
|
744
744
|
ue(() => {
|
|
745
745
|
P.setId(u.field, u.row, u.itemFields), t.show = !0;
|
|
746
746
|
});
|
|
747
|
-
const
|
|
747
|
+
const r = o;
|
|
748
748
|
return (l, e) => {
|
|
749
|
-
const s =
|
|
750
|
-
return t.show ? (f(),
|
|
751
|
-
C(l.$slots, "list-start", { row:
|
|
752
|
-
|
|
749
|
+
const s = Y("el-button"), p = Y("el-input");
|
|
750
|
+
return t.show ? (f(), b("div", ze, [
|
|
751
|
+
C(l.$slots, "list-start", { row: i.row }),
|
|
752
|
+
i.addBottom ? k("", !0) : (f(), b("div", De, [
|
|
753
753
|
z(s, {
|
|
754
754
|
link: "",
|
|
755
755
|
type: "primary",
|
|
756
|
-
onClick: e[0] || (e[0] = (c) => t.add(
|
|
756
|
+
onClick: e[0] || (e[0] = (c) => t.add(i.field, i.row, i.itemFields))
|
|
757
757
|
}, {
|
|
758
758
|
default: m(() => e[3] || (e[3] = [
|
|
759
759
|
$("添加")
|
|
@@ -761,27 +761,27 @@ const ze = {
|
|
|
761
761
|
_: 1
|
|
762
762
|
})
|
|
763
763
|
])),
|
|
764
|
-
(f(!0),
|
|
764
|
+
(f(!0), b(S, null, L(i.row[i.field], (c) => (f(), b("div", $e, [
|
|
765
765
|
C(l.$slots, "item-start", {
|
|
766
766
|
item: c,
|
|
767
|
-
row:
|
|
767
|
+
row: i.row
|
|
768
768
|
}),
|
|
769
|
-
(f(!0),
|
|
770
|
-
modelValue: c[
|
|
771
|
-
"onUpdate:modelValue": (n) => c[
|
|
772
|
-
style: fe({ width:
|
|
773
|
-
class: j(
|
|
774
|
-
placeholder:
|
|
775
|
-
onChange: e[1] || (e[1] = (n) =>
|
|
769
|
+
(f(!0), b(S, null, L(i.itemFields, (g) => (f(), h(p, {
|
|
770
|
+
modelValue: c[g.value],
|
|
771
|
+
"onUpdate:modelValue": (n) => c[g.value] = n,
|
|
772
|
+
style: fe({ width: i.inputWidth }),
|
|
773
|
+
class: j(i.inputClass),
|
|
774
|
+
placeholder: g[i.label] || g[i.value],
|
|
775
|
+
onChange: e[1] || (e[1] = (n) => r("change"))
|
|
776
776
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "style", "class", "placeholder"]))), 256)),
|
|
777
777
|
C(l.$slots, "item-end", {
|
|
778
778
|
item: c,
|
|
779
|
-
row:
|
|
779
|
+
row: i.row
|
|
780
780
|
}),
|
|
781
781
|
z(s, {
|
|
782
782
|
link: "",
|
|
783
783
|
type: "danger",
|
|
784
|
-
onClick: (
|
|
784
|
+
onClick: (g) => t.remove(i.field, i.row, c)
|
|
785
785
|
}, {
|
|
786
786
|
default: m(() => e[4] || (e[4] = [
|
|
787
787
|
$("删除")
|
|
@@ -789,11 +789,11 @@ const ze = {
|
|
|
789
789
|
_: 2
|
|
790
790
|
}, 1032, ["onClick"])
|
|
791
791
|
]))), 256)),
|
|
792
|
-
|
|
792
|
+
i.addBottom ? (f(), b("div", Se, [
|
|
793
793
|
z(s, {
|
|
794
794
|
link: "",
|
|
795
795
|
type: "primary",
|
|
796
|
-
onClick: e[2] || (e[2] = (c) => t.add(
|
|
796
|
+
onClick: e[2] || (e[2] = (c) => t.add(i.field, i.row, i.itemFields))
|
|
797
797
|
}, {
|
|
798
798
|
default: m(() => e[5] || (e[5] = [
|
|
799
799
|
$("添加")
|
|
@@ -801,14 +801,14 @@ const ze = {
|
|
|
801
801
|
_: 1
|
|
802
802
|
})
|
|
803
803
|
])) : k("", !0),
|
|
804
|
-
C(l.$slots, "list-end", { row:
|
|
804
|
+
C(l.$slots, "list-end", { row: i.row })
|
|
805
805
|
])) : k("", !0);
|
|
806
806
|
};
|
|
807
807
|
}
|
|
808
|
-
}),
|
|
808
|
+
}), Ue = {
|
|
809
809
|
class: "row form-item-content",
|
|
810
810
|
style: { width: "100%" }
|
|
811
|
-
},
|
|
811
|
+
}, Ee = { class: "col" }, Oe = { class: "col" }, Fe = ["innerHTML"], Ae = /* @__PURE__ */ J({
|
|
812
812
|
__name: "column",
|
|
813
813
|
props: {
|
|
814
814
|
/**
|
|
@@ -824,8 +824,8 @@ const ze = {
|
|
|
824
824
|
default: ""
|
|
825
825
|
}
|
|
826
826
|
},
|
|
827
|
-
setup(
|
|
828
|
-
const u =
|
|
827
|
+
setup(i, { expose: o }) {
|
|
828
|
+
const u = U.isFun, t = U.EDialog, r = H(), l = i, e = le({
|
|
829
829
|
rules: {},
|
|
830
830
|
show: !0,
|
|
831
831
|
form: {},
|
|
@@ -837,15 +837,15 @@ const ze = {
|
|
|
837
837
|
getOn: (s) => s.options?.[e.type === t.Add ? "formAdd" : "formUpdate"]?.[s.type]?.on || s.options?.[s.type]?.on || {},
|
|
838
838
|
getColumnSpan: (s, p) => {
|
|
839
839
|
if (s.item.form?.spanCol) {
|
|
840
|
-
const c = l.option.form?.maxSpan || 12,
|
|
841
|
-
return (s.item.form?.span ||
|
|
840
|
+
const c = l.option.form?.maxSpan || 12, g = l.option.form?.defaultSpan || c / 2, d = p.filter((V) => !U.isFun(V.item.show?.form, e.form, e.type)).reduce((V, w) => V + (w.item.form?.span || g), 0);
|
|
841
|
+
return (s.item.form?.span || g) + d;
|
|
842
842
|
}
|
|
843
843
|
return s.item.form?.span;
|
|
844
844
|
},
|
|
845
845
|
initColumnForm: () => {
|
|
846
846
|
const s = l.option;
|
|
847
847
|
e.formColumn = [], e.rules = {}, e.formDefault = {};
|
|
848
|
-
const p = [], c = l.option.form?.maxSpan || 12,
|
|
848
|
+
const p = [], c = l.option.form?.maxSpan || 12, g = l.option.form?.defaultSpan || c / 2;
|
|
849
849
|
let n = [];
|
|
850
850
|
const d = (w) => {
|
|
851
851
|
if (w.children) {
|
|
@@ -855,17 +855,17 @@ const ze = {
|
|
|
855
855
|
return;
|
|
856
856
|
}
|
|
857
857
|
if (e.formDefault[w.key] = w.value, w.isForm && (typeof w.show?.form != "boolean" || w.show?.form)) {
|
|
858
|
-
w.form = w.form || { span:
|
|
859
|
-
const A = w.form.span, B = n.reduce((Q,
|
|
858
|
+
w.form = w.form || { span: g }, w.form.span = w.form.span ?? g;
|
|
859
|
+
const A = w.form.span, B = n.reduce((Q, x) => Q + x.span, A), R = n.length;
|
|
860
860
|
if (n.push({ item: w, span: A }), (R === 1 && n[0].span === 0 || B >= c || A === 0 && R > 1) && (p.push(n), n = []), w.rules) {
|
|
861
861
|
const Q = {
|
|
862
862
|
input: y.tCurd("placeholderInput"),
|
|
863
863
|
select: y.tCurd("placeholderSelect")
|
|
864
|
-
},
|
|
864
|
+
}, x = (Q[w.type] || Q.input) + w.label;
|
|
865
865
|
e.rules[w.key] = typeof w.rules == "boolean" ? [
|
|
866
866
|
{
|
|
867
867
|
required: !0,
|
|
868
|
-
message:
|
|
868
|
+
message: x,
|
|
869
869
|
trigger: "blur"
|
|
870
870
|
}
|
|
871
871
|
] : w.rules;
|
|
@@ -880,33 +880,33 @@ const ze = {
|
|
|
880
880
|
}
|
|
881
881
|
});
|
|
882
882
|
return e.initColumnForm(), o({
|
|
883
|
-
ref:
|
|
883
|
+
ref: r,
|
|
884
884
|
conf: e
|
|
885
885
|
}), (s, p) => (f(), h(a(N), {
|
|
886
886
|
ref_key: "ruleFormRef",
|
|
887
|
-
ref:
|
|
887
|
+
ref: r,
|
|
888
888
|
model: e.form,
|
|
889
889
|
rules: e.rules
|
|
890
890
|
}, {
|
|
891
891
|
default: m(() => [
|
|
892
|
-
e.show ? (f(!0),
|
|
892
|
+
e.show ? (f(!0), b(S, { key: 0 }, L(e.formColumn, (c, g) => (f(), b(S, { key: g }, [
|
|
893
893
|
a(u)(
|
|
894
894
|
c.map((n) => n.item?.show?.form),
|
|
895
895
|
e.form,
|
|
896
896
|
e.type
|
|
897
|
-
) ? (f(),
|
|
897
|
+
) ? (f(), b("div", {
|
|
898
898
|
key: 0,
|
|
899
899
|
class: j(["row curd-row", {
|
|
900
|
-
stripe:
|
|
900
|
+
stripe: i.option.form?.stripe === void 0 ? !0 : i.option.form?.stripe
|
|
901
901
|
}])
|
|
902
902
|
}, [
|
|
903
903
|
C(s.$slots, "form-start", {
|
|
904
904
|
row: e.form
|
|
905
905
|
}),
|
|
906
|
-
(f(!0),
|
|
906
|
+
(f(!0), b(S, null, L(c, (n) => (f(), b(S, {
|
|
907
907
|
key: n.item.key
|
|
908
908
|
}, [
|
|
909
|
-
a(u)(n.item.show?.form, e.form, e.type) ? (f(),
|
|
909
|
+
a(u)(n.item.show?.form, e.form, e.type) ? (f(), b("div", {
|
|
910
910
|
key: 0,
|
|
911
911
|
class: j([n.item.form.span > 0 ? `col-${e.getColumnSpan(n, c)}` : "col", `form-item-col-${n.item.key}`])
|
|
912
912
|
}, [
|
|
@@ -916,45 +916,45 @@ const ze = {
|
|
|
916
916
|
}),
|
|
917
917
|
label: typeof n.item.text?.form?.label == "string" ? n.item.text?.form?.label : n.item.label,
|
|
918
918
|
prop: n.item.key,
|
|
919
|
-
"label-width": n.item.form?.labelWidth ||
|
|
919
|
+
"label-width": n.item.form?.labelWidth || i.option.form?.labelWidth || "100px"
|
|
920
920
|
}, {
|
|
921
921
|
default: m(() => [
|
|
922
|
-
F("div",
|
|
922
|
+
F("div", Ue, [
|
|
923
923
|
C(s.$slots, "form-" + n.item.key + "-start", {
|
|
924
924
|
row: e.form,
|
|
925
925
|
item: n.item
|
|
926
926
|
}),
|
|
927
|
-
F("div",
|
|
927
|
+
F("div", Ee, [
|
|
928
928
|
F("div", Oe, [
|
|
929
929
|
C(s.$slots, "form-" + n.item.key, {
|
|
930
930
|
row: e.form,
|
|
931
931
|
item: n.item
|
|
932
932
|
}, () => [
|
|
933
|
-
n.item.type === "input" ? (f(), h(a(
|
|
933
|
+
n.item.type === "input" ? (f(), h(a(Z), v({
|
|
934
934
|
key: 0,
|
|
935
935
|
modelValue: e.form[n.item.key],
|
|
936
936
|
"onUpdate:modelValue": (d) => e.form[n.item.key] = d,
|
|
937
937
|
ref_for: !0
|
|
938
|
-
}, e.getBind(n.item),
|
|
938
|
+
}, e.getBind(n.item), D(e.getOn(n.item)), {
|
|
939
939
|
disabled: e.getDisabled(n.item)
|
|
940
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type === "switch" ? (f(), h(a(
|
|
940
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type === "switch" ? (f(), h(a(X), v({
|
|
941
941
|
key: 1,
|
|
942
942
|
modelValue: e.form[n.item.key],
|
|
943
943
|
"onUpdate:modelValue": (d) => e.form[n.item.key] = d,
|
|
944
944
|
ref_for: !0
|
|
945
|
-
}, e.getBind(n.item),
|
|
945
|
+
}, e.getBind(n.item), D(e.getOn(n.item)), {
|
|
946
946
|
disabled: e.getDisabled(n.item)
|
|
947
947
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type === "select" ? (f(), h(a(W), v({
|
|
948
948
|
key: 2,
|
|
949
949
|
modelValue: e.form[n.item.key],
|
|
950
950
|
"onUpdate:modelValue": (d) => e.form[n.item.key] = d,
|
|
951
951
|
ref_for: !0
|
|
952
|
-
}, e.getBind(n.item),
|
|
952
|
+
}, e.getBind(n.item), D(e.getOn(n.item)), {
|
|
953
953
|
disabled: e.getDisabled(n.item),
|
|
954
954
|
style: { width: "100%" }
|
|
955
955
|
}), {
|
|
956
956
|
default: m(() => [
|
|
957
|
-
(f(!0),
|
|
957
|
+
(f(!0), b(S, null, L(n.item.options?.select?.data, (d) => (f(), h(a(K), {
|
|
958
958
|
key: d.value,
|
|
959
959
|
label: d.label,
|
|
960
960
|
value: d.value
|
|
@@ -966,12 +966,12 @@ const ze = {
|
|
|
966
966
|
modelValue: e.form[n.item.key],
|
|
967
967
|
"onUpdate:modelValue": (d) => e.form[n.item.key] = d,
|
|
968
968
|
ref_for: !0
|
|
969
|
-
}, e.getBind(n.item),
|
|
969
|
+
}, e.getBind(n.item), D(e.getOn(n.item)), {
|
|
970
970
|
disabled: e.getDisabled(n.item),
|
|
971
971
|
style: { width: "100%" }
|
|
972
972
|
}), {
|
|
973
973
|
default: m(() => [
|
|
974
|
-
(f(!0),
|
|
974
|
+
(f(!0), b(S, null, L(n.item.options?.radio?.data, (d) => (f(), h(a(se), {
|
|
975
975
|
key: d.value,
|
|
976
976
|
label: d.label,
|
|
977
977
|
value: d.value
|
|
@@ -983,7 +983,7 @@ const ze = {
|
|
|
983
983
|
row: e.form,
|
|
984
984
|
field: n.item.key,
|
|
985
985
|
ref_for: !0
|
|
986
|
-
}, e.getBind(n.item),
|
|
986
|
+
}, e.getBind(n.item), D(e.getOn(n.item)), {
|
|
987
987
|
disabled: e.getDisabled(n.item),
|
|
988
988
|
style: { width: "100%" }
|
|
989
989
|
}), null, 16, ["row", "field", "disabled"])) : n.item.type === "treeSelect" ? (f(), h(a(de), v({
|
|
@@ -991,7 +991,7 @@ const ze = {
|
|
|
991
991
|
modelValue: e.form[n.item.key],
|
|
992
992
|
"onUpdate:modelValue": (d) => e.form[n.item.key] = d,
|
|
993
993
|
ref_for: !0
|
|
994
|
-
}, e.getBind(n.item),
|
|
994
|
+
}, e.getBind(n.item), D(e.getOn(n.item)), {
|
|
995
995
|
disabled: e.getDisabled(n.item),
|
|
996
996
|
style: { width: "100%" }
|
|
997
997
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type === "datetime" ? (f(), h(a(ae), v({
|
|
@@ -999,14 +999,14 @@ const ze = {
|
|
|
999
999
|
modelValue: e.form[n.item.key],
|
|
1000
1000
|
"onUpdate:modelValue": (d) => e.form[n.item.key] = d,
|
|
1001
1001
|
ref_for: !0
|
|
1002
|
-
}, e.getBind(n.item),
|
|
1002
|
+
}, e.getBind(n.item), D(e.getOn(n.item)), {
|
|
1003
1003
|
disabled: e.getDisabled(n.item)
|
|
1004
1004
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type && (a(M).customComponent[n.item.type] || a(M).customComponent[n.item.type]?.form) ? (f(), h(q(a(M).customComponent[n.item.type]?.form || a(M).customComponent[n.item.type]), v({
|
|
1005
1005
|
key: 7,
|
|
1006
1006
|
modelValue: e.form[n.item.key],
|
|
1007
1007
|
"onUpdate:modelValue": (d) => e.form[n.item.key] = d,
|
|
1008
1008
|
ref_for: !0
|
|
1009
|
-
}, e.getBind(n.item),
|
|
1009
|
+
}, e.getBind(n.item), D(e.getOn(n.item)), {
|
|
1010
1010
|
disabled: e.getDisabled(n.item)
|
|
1011
1011
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : k("", !0)
|
|
1012
1012
|
]),
|
|
@@ -1019,7 +1019,7 @@ const ze = {
|
|
|
1019
1019
|
row: e.form,
|
|
1020
1020
|
item: n.item
|
|
1021
1021
|
}, () => [
|
|
1022
|
-
n.item.form?.tipText ? (f(),
|
|
1022
|
+
n.item.form?.tipText ? (f(), b("div", {
|
|
1023
1023
|
key: 0,
|
|
1024
1024
|
class: "form-tip-text",
|
|
1025
1025
|
innerHTML: typeof n.item.form?.tipText == "function" ? n.item.form?.tipText(e.form, e.type) : n.item.form?.tipText
|
|
@@ -1056,18 +1056,18 @@ class Te {
|
|
|
1056
1056
|
*/
|
|
1057
1057
|
static exportToExcel = async (o, u, t) => {
|
|
1058
1058
|
if (!o || o.length === 0) return;
|
|
1059
|
-
const
|
|
1059
|
+
const r = await U.loadModule("xlsx"), l = o.map((p) => {
|
|
1060
1060
|
const c = {};
|
|
1061
|
-
return u.forEach((
|
|
1062
|
-
c[
|
|
1061
|
+
return u.forEach((g) => {
|
|
1062
|
+
c[g.label] = p[g.key];
|
|
1063
1063
|
}), c;
|
|
1064
|
-
}), e =
|
|
1065
|
-
|
|
1064
|
+
}), e = r.utils.json_to_sheet(l), s = r.utils.book_new();
|
|
1065
|
+
r.utils.book_append_sheet(s, e, "Sheet1"), t ? typeof t == "function" && (t = t()) : t = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, r.writeFile(s, `${t}.xlsx`);
|
|
1066
1066
|
};
|
|
1067
1067
|
}
|
|
1068
|
-
const I =
|
|
1068
|
+
const I = U.EDialog, Le = (i) => {
|
|
1069
1069
|
const o = H(), u = H(), t = le({
|
|
1070
|
-
option:
|
|
1070
|
+
option: i.option,
|
|
1071
1071
|
/** 查询区域相关配置对象 */
|
|
1072
1072
|
search: {
|
|
1073
1073
|
/** 查询表单列集合 */
|
|
@@ -1080,22 +1080,22 @@ const I = E.EDialog, Le = (r) => {
|
|
|
1080
1080
|
/** 搜索表单默认值 */
|
|
1081
1081
|
formDefault: {},
|
|
1082
1082
|
/** 获取占位符 */
|
|
1083
|
-
getPlaceholder: (
|
|
1083
|
+
getPlaceholder: (r, l = y.tCurd("placeholderInput")) => r.text?.search?.placeholder === void 0 ? `${l}${r.label}` : r.text?.search?.placeholder,
|
|
1084
1084
|
/** 组装实际要搜索的数据对象 */
|
|
1085
1085
|
getFormData: () => {
|
|
1086
|
-
let
|
|
1087
|
-
|
|
1088
|
-
(typeof e.show?.search == "function" ? e.show?.search(t.search.form) : e.show?.search) && (
|
|
1086
|
+
let r = {};
|
|
1087
|
+
i.option.column.forEach((e) => {
|
|
1088
|
+
(typeof e.show?.search == "function" ? e.show?.search(t.search.form) : e.show?.search) && (r[e.key] = t.search.form[e.key]);
|
|
1089
1089
|
});
|
|
1090
|
-
const l =
|
|
1091
|
-
return l && (
|
|
1090
|
+
const l = i.option.search?.before?.(r);
|
|
1091
|
+
return l && (r = l), r;
|
|
1092
1092
|
},
|
|
1093
1093
|
/** 重置搜索表单 */
|
|
1094
1094
|
reset: () => {
|
|
1095
|
-
const
|
|
1096
|
-
Object.keys(
|
|
1097
|
-
|
|
1098
|
-
}), t.search.form = JSONUtil.cp(
|
|
1095
|
+
const r = t.search.formDefault;
|
|
1096
|
+
Object.keys(r).forEach((l) => {
|
|
1097
|
+
i.option.search?.resetMode === "none" ? r[l] = void 0 : r[l] = t.search.formDefault[l];
|
|
1098
|
+
}), t.search.form = JSONUtil.cp(r), t.page.num = 1, i.option.init !== !1 && t.table.getList();
|
|
1099
1099
|
},
|
|
1100
1100
|
/** 提交搜索表单 */
|
|
1101
1101
|
submit: () => {
|
|
@@ -1109,19 +1109,19 @@ const I = E.EDialog, Le = (r) => {
|
|
|
1109
1109
|
/** 总条数 */
|
|
1110
1110
|
total: 0,
|
|
1111
1111
|
/** 分页控件的布局方式 */
|
|
1112
|
-
layout:
|
|
1112
|
+
layout: i.option.page?.layout || O.config.pagination.layout,
|
|
1113
1113
|
/** 是否显示到工具栏 默认不显示 配置后show属性无效 */
|
|
1114
|
-
showTools:
|
|
1114
|
+
showTools: i.option.page?.showTools || O.config.pagination.showTools,
|
|
1115
1115
|
/** 当前每页条数 */
|
|
1116
|
-
size:
|
|
1116
|
+
size: i.option.page?.size || O.config.pagination.size,
|
|
1117
1117
|
/** 支持切换的每页条数选项 */
|
|
1118
|
-
sizeList:
|
|
1118
|
+
sizeList: i.option.page?.sizeList || O.config.pagination.pageSizes,
|
|
1119
1119
|
/** 分页器计数 */
|
|
1120
|
-
pagerCount:
|
|
1120
|
+
pagerCount: i.option.page?.pagerCount || O.config.pagination.pagerCount,
|
|
1121
1121
|
/** 获取分页查询参数 */
|
|
1122
|
-
getQuery: (
|
|
1123
|
-
[O.config.field.page.size]:
|
|
1124
|
-
[O.config.field.page.num]:
|
|
1122
|
+
getQuery: (r = {}) => ({
|
|
1123
|
+
[O.config.field.page.size]: r.size || t.page.size,
|
|
1124
|
+
[O.config.field.page.num]: r.num || t.page.num,
|
|
1125
1125
|
...t.search.getFormData()
|
|
1126
1126
|
})
|
|
1127
1127
|
},
|
|
@@ -1130,7 +1130,7 @@ const I = E.EDialog, Le = (r) => {
|
|
|
1130
1130
|
/** 操作列相关配置 */
|
|
1131
1131
|
op: {
|
|
1132
1132
|
/** 动态计算操作列宽度 */
|
|
1133
|
-
width: (...
|
|
1133
|
+
width: (...r) => r.filter((e) => e).length * 30 + 60
|
|
1134
1134
|
},
|
|
1135
1135
|
/** 表格加载中状态 */
|
|
1136
1136
|
loading: !1,
|
|
@@ -1143,20 +1143,20 @@ const I = E.EDialog, Le = (r) => {
|
|
|
1143
1143
|
/** 已经展开的行key集合 */
|
|
1144
1144
|
rowKeys: [],
|
|
1145
1145
|
/** 行展开触发变更函数 */
|
|
1146
|
-
change: (
|
|
1146
|
+
change: (r, l) => {
|
|
1147
1147
|
},
|
|
1148
1148
|
/** 全部展开/收起 */
|
|
1149
1149
|
all: () => {
|
|
1150
1150
|
if (t.table.expand.isExpand)
|
|
1151
1151
|
t.table.expand.rowKeys = [];
|
|
1152
1152
|
else {
|
|
1153
|
-
const
|
|
1153
|
+
const r = (l) => {
|
|
1154
1154
|
let e = [];
|
|
1155
1155
|
return l.forEach((s) => {
|
|
1156
|
-
e.push(s[
|
|
1156
|
+
e.push(s[i.option.table.rowKey]), s.children && s.children.length > 0 && (e = e.concat(r(s.children)));
|
|
1157
1157
|
}), e;
|
|
1158
1158
|
};
|
|
1159
|
-
t.table.expand.rowKeys =
|
|
1159
|
+
t.table.expand.rowKeys = r(t.table.data);
|
|
1160
1160
|
}
|
|
1161
1161
|
t.table.expand.isExpand = !t.table.expand.isExpand;
|
|
1162
1162
|
}
|
|
@@ -1176,7 +1176,7 @@ const I = E.EDialog, Le = (r) => {
|
|
|
1176
1176
|
/** 获取数据列表接口实现 */
|
|
1177
1177
|
getList: async () => {
|
|
1178
1178
|
t.table.loading = !0;
|
|
1179
|
-
const
|
|
1179
|
+
const r = i.option.api.list;
|
|
1180
1180
|
try {
|
|
1181
1181
|
await t.initApiData("init");
|
|
1182
1182
|
let l = {};
|
|
@@ -1187,16 +1187,16 @@ const I = E.EDialog, Le = (r) => {
|
|
|
1187
1187
|
[V.field]: t.table.sort.order
|
|
1188
1188
|
};
|
|
1189
1189
|
}
|
|
1190
|
-
const e = await
|
|
1190
|
+
const e = await r({
|
|
1191
1191
|
...t.page.getQuery(),
|
|
1192
1192
|
...l
|
|
1193
1193
|
}), s = O.config.field.result, p = e.data || { [s.list]: e };
|
|
1194
1194
|
let c = (Array.isArray(p[s.list]), p[s.list]);
|
|
1195
|
-
const
|
|
1196
|
-
const A =
|
|
1195
|
+
const g = t.update.formColumn.flat(), n = JSONUtil.cp(c).map((d) => (Object.keys(d).forEach((w) => {
|
|
1196
|
+
const A = g.find((B) => B.item.key === w);
|
|
1197
1197
|
A && ["select", "radio"].includes(A.item.type) && (A.item.table.format || (A.item.table.format = (B) => A.item.options[A.item.type].data?.find((R) => R.value == B[w])?.label || B[w]));
|
|
1198
1198
|
}), d));
|
|
1199
|
-
t.table.data =
|
|
1199
|
+
t.table.data = i.option.data ? await i.option.data(n, c) : n, t.page.total = p[s.total] || 0;
|
|
1200
1200
|
} catch (l) {
|
|
1201
1201
|
console.error(l);
|
|
1202
1202
|
} finally {
|
|
@@ -1208,8 +1208,8 @@ const I = E.EDialog, Le = (r) => {
|
|
|
1208
1208
|
/** 已选数据项 */
|
|
1209
1209
|
list: [],
|
|
1210
1210
|
/** 选中状态回调 */
|
|
1211
|
-
change: (
|
|
1212
|
-
t.table.selection.list =
|
|
1211
|
+
change: (r) => {
|
|
1212
|
+
t.table.selection.list = r;
|
|
1213
1213
|
}
|
|
1214
1214
|
},
|
|
1215
1215
|
/** 表格排序相关配置 */
|
|
@@ -1219,14 +1219,14 @@ const I = E.EDialog, Le = (r) => {
|
|
|
1219
1219
|
/** 当前排序顺序值 */
|
|
1220
1220
|
order: "",
|
|
1221
1221
|
/** 排序变更回调 */
|
|
1222
|
-
change: (
|
|
1222
|
+
change: (r) => {
|
|
1223
1223
|
O.config.table.sort.resetPage && (t.page.num = 1);
|
|
1224
1224
|
const l = O.config.table.sort;
|
|
1225
1225
|
if (l.change) {
|
|
1226
|
-
l.change(
|
|
1226
|
+
l.change(r, t);
|
|
1227
1227
|
return;
|
|
1228
1228
|
}
|
|
1229
|
-
t.table.sort.prop =
|
|
1229
|
+
t.table.sort.prop = r.prop, r.order === null ? t.table.sort.order = "" : t.table.sort.order = r.order === "ascending" ? l.order.asc : l.order.desc, t.table.getList();
|
|
1230
1230
|
}
|
|
1231
1231
|
}
|
|
1232
1232
|
},
|
|
@@ -1235,30 +1235,30 @@ const I = E.EDialog, Le = (r) => {
|
|
|
1235
1235
|
/** 导出逻辑方法集合 */
|
|
1236
1236
|
run: {
|
|
1237
1237
|
/** 执行指定方式的导出(如select、page、all) */
|
|
1238
|
-
start: async (
|
|
1239
|
-
let l = await t.export.run[
|
|
1238
|
+
start: async (r) => {
|
|
1239
|
+
let l = await t.export.run[r](), e = i.option.column;
|
|
1240
1240
|
const s = JSONUtil.cp({
|
|
1241
1241
|
data: l,
|
|
1242
1242
|
columns: e
|
|
1243
|
-
}), p =
|
|
1243
|
+
}), p = i.option.tools?.export || {};
|
|
1244
1244
|
p.before && p.before(s), Te.exportToExcel(s.data, s.columns, p.fileName);
|
|
1245
1245
|
},
|
|
1246
1246
|
/** 获取当前选中项进行导出 */
|
|
1247
1247
|
select: async () => {
|
|
1248
1248
|
t.export.loading = !0;
|
|
1249
1249
|
try {
|
|
1250
|
-
if (
|
|
1251
|
-
await
|
|
1250
|
+
if (i.option.tools?.export?.select) {
|
|
1251
|
+
await i.option.tools?.export?.select({
|
|
1252
1252
|
...t.page.getQuery(),
|
|
1253
1253
|
items: t.table.selection.list
|
|
1254
1254
|
});
|
|
1255
1255
|
return;
|
|
1256
1256
|
}
|
|
1257
1257
|
if (t.table.selection.list.length === 0)
|
|
1258
|
-
throw
|
|
1258
|
+
throw U.fail(y.tCurd("selectDataToExport")), new Error(y.tCurd("selectDataToExport"));
|
|
1259
1259
|
return t.table.selection.list;
|
|
1260
|
-
} catch (
|
|
1261
|
-
console.error(
|
|
1260
|
+
} catch (r) {
|
|
1261
|
+
console.error(r);
|
|
1262
1262
|
} finally {
|
|
1263
1263
|
t.export.loading = !1;
|
|
1264
1264
|
}
|
|
@@ -1267,17 +1267,17 @@ const I = E.EDialog, Le = (r) => {
|
|
|
1267
1267
|
page: async () => {
|
|
1268
1268
|
t.export.loading = !0;
|
|
1269
1269
|
try {
|
|
1270
|
-
if (
|
|
1271
|
-
await
|
|
1270
|
+
if (i.option.tools?.export?.page) {
|
|
1271
|
+
await i.option.tools?.export?.page({
|
|
1272
1272
|
...t.page.getQuery()
|
|
1273
1273
|
});
|
|
1274
1274
|
return;
|
|
1275
1275
|
}
|
|
1276
1276
|
if (t.table.data.length === 0)
|
|
1277
|
-
throw
|
|
1277
|
+
throw U.fail(y.tCurd("noData")), new Error(y.tCurd("noData"));
|
|
1278
1278
|
return t.table.data;
|
|
1279
|
-
} catch (
|
|
1280
|
-
console.error(
|
|
1279
|
+
} catch (r) {
|
|
1280
|
+
console.error(r);
|
|
1281
1281
|
} finally {
|
|
1282
1282
|
t.export.loading = !1;
|
|
1283
1283
|
}
|
|
@@ -1286,21 +1286,21 @@ const I = E.EDialog, Le = (r) => {
|
|
|
1286
1286
|
all: async () => {
|
|
1287
1287
|
t.export.loading = !0;
|
|
1288
1288
|
try {
|
|
1289
|
-
if (
|
|
1290
|
-
await
|
|
1289
|
+
if (i.option.tools?.export?.all) {
|
|
1290
|
+
await i.option.tools?.export?.all({
|
|
1291
1291
|
...t.page.getQuery()
|
|
1292
1292
|
});
|
|
1293
1293
|
return;
|
|
1294
1294
|
}
|
|
1295
|
-
const
|
|
1295
|
+
const r = i.option.api.list, l = await r({
|
|
1296
1296
|
...t.page.getQuery({
|
|
1297
1297
|
size: 999999,
|
|
1298
1298
|
num: 1
|
|
1299
1299
|
})
|
|
1300
1300
|
});
|
|
1301
1301
|
return (l.data || { [O.config.field.result.list]: l })[O.config.field.result.list];
|
|
1302
|
-
} catch (
|
|
1303
|
-
console.error(
|
|
1302
|
+
} catch (r) {
|
|
1303
|
+
console.error(r);
|
|
1304
1304
|
} finally {
|
|
1305
1305
|
t.export.loading = !1;
|
|
1306
1306
|
}
|
|
@@ -1309,8 +1309,8 @@ const I = E.EDialog, Le = (r) => {
|
|
|
1309
1309
|
/** 导出时loading状态 */
|
|
1310
1310
|
loading: !1,
|
|
1311
1311
|
/** 执行导出操作的触发函数 */
|
|
1312
|
-
click: (
|
|
1313
|
-
t.export.loading || t.export.run.start(
|
|
1312
|
+
click: (r) => {
|
|
1313
|
+
t.export.loading || t.export.run.start(r);
|
|
1314
1314
|
}
|
|
1315
1315
|
},
|
|
1316
1316
|
/** 表单增删改弹窗相关对象 */
|
|
@@ -1334,15 +1334,15 @@ const I = E.EDialog, Le = (r) => {
|
|
|
1334
1334
|
/** 表单所有列,二维数组结构按行分组 */
|
|
1335
1335
|
formColumn: [],
|
|
1336
1336
|
/** 判断是否禁用当前字段 */
|
|
1337
|
-
getDisabled: (
|
|
1337
|
+
getDisabled: (r) => t.update.type === I.View ? r.disabled?.view === void 0 ? !0 : r.disabled?.view : r.disabled?.[t.update.type === I.Add ? "create" : "update"],
|
|
1338
1338
|
/** 获取表单组件绑定属性 */
|
|
1339
|
-
getBind: (
|
|
1339
|
+
getBind: (r) => r.options?.[t.update.type === I.Add ? "formAdd" : "formUpdate"]?.[r.type] || r.options?.[r.type] || {},
|
|
1340
1340
|
/** 获取表单组件事件属性 */
|
|
1341
|
-
getOn: (
|
|
1341
|
+
getOn: (r) => r.options?.[t.update.type === I.Add ? "formAdd" : "formUpdate"]?.[r.type]?.on || r.options?.[r.type]?.on || {},
|
|
1342
1342
|
/** 获取表单组件绑定属性和事件 */
|
|
1343
|
-
getOptions: (
|
|
1343
|
+
getOptions: (r) => {
|
|
1344
1344
|
try {
|
|
1345
|
-
const e = t.update.formColumn.flat().find((s) => s.item.key ===
|
|
1345
|
+
const e = t.update.formColumn.flat().find((s) => s.item.key === r)?.item;
|
|
1346
1346
|
return e ? {
|
|
1347
1347
|
options: e.options,
|
|
1348
1348
|
// @ts-ignore
|
|
@@ -1357,53 +1357,49 @@ const I = E.EDialog, Le = (r) => {
|
|
|
1357
1357
|
/** 当前编辑的数据原始项对象 */
|
|
1358
1358
|
data: {},
|
|
1359
1359
|
/** 返回编辑时与原值的变更数据,用于局部更新API */
|
|
1360
|
-
getApiData: (
|
|
1361
|
-
if (
|
|
1362
|
-
return
|
|
1360
|
+
getApiData: (r) => {
|
|
1361
|
+
if (i.option.form?.editAll)
|
|
1362
|
+
return r;
|
|
1363
1363
|
let l = {
|
|
1364
|
-
[
|
|
1364
|
+
[i.option.table?.rowKey]: t.update.edit.data[i.option.table?.rowKey]
|
|
1365
1365
|
};
|
|
1366
1366
|
return Object.keys(t.update.edit.data).forEach((e) => {
|
|
1367
|
-
|
|
1367
|
+
r[e] !== t.update.edit.data[e] && (l[e] = r[e]);
|
|
1368
1368
|
}), l;
|
|
1369
1369
|
}
|
|
1370
1370
|
},
|
|
1371
1371
|
view: {},
|
|
1372
1372
|
/** 打开增改弹窗 */
|
|
1373
|
-
open: (
|
|
1373
|
+
open: (r, l) => {
|
|
1374
1374
|
t.update.showContent || FunUtil.throttle(async () => {
|
|
1375
|
-
|
|
1375
|
+
U.loading(!0);
|
|
1376
1376
|
try {
|
|
1377
|
-
t.update.type =
|
|
1378
|
-
const e =
|
|
1379
|
-
|
|
1380
|
-
t.inlineEdit.open(l);
|
|
1381
|
-
return;
|
|
1382
|
-
}
|
|
1383
|
-
t.update.edit.data = l, t.update.title = y.tCurd(e ? "add" : i === I.View ? "view" : "edit"), t.update.form = JSONUtil.cp(e ? t.update.formDefault : l), await r.option.form?.openBefore?.(t.update.form, t.update), t.inlineEdit.data || (t.update.show = !0), t.update.showContent = !0, r.option.form?.openAfter?.(t.update.form, t.update);
|
|
1377
|
+
t.update.type = r, await t.initApiData("update");
|
|
1378
|
+
const e = r === I.Add;
|
|
1379
|
+
t.update.edit.data = l, t.update.title = y.tCurd(e ? "add" : r === I.View ? "view" : "edit"), t.update.form = JSONUtil.cp(e ? t.update.formDefault : l), await i.option.form?.openBefore?.(t.update.form, t.update), !e && i.option.table?.inlineEdit ? t.inlineEdit.open(l) : (t.update.show = !0, t.update.showContent = !0), i.option.form?.openAfter?.(t.update.form, t.update);
|
|
1384
1380
|
} catch (e) {
|
|
1385
1381
|
console.error(e);
|
|
1386
1382
|
} finally {
|
|
1387
|
-
|
|
1383
|
+
U.loading(!1);
|
|
1388
1384
|
}
|
|
1389
1385
|
});
|
|
1390
1386
|
},
|
|
1391
1387
|
/** 提交增改表单操作 */
|
|
1392
1388
|
submit: () => {
|
|
1393
1389
|
FunUtil.throttle(async () => {
|
|
1394
|
-
await u.value?.validate(async (s, p) => new Promise((c,
|
|
1395
|
-
s || (
|
|
1390
|
+
await u.value?.validate(async (s, p) => new Promise((c, g) => {
|
|
1391
|
+
s || (U.fail(y.tCurd("checkFormData")), g(!1)), c();
|
|
1396
1392
|
})), t.update.loading = !0;
|
|
1397
|
-
const
|
|
1393
|
+
const r = t.update.type === I.Add ? i.option.api.create : i.option.api.update;
|
|
1398
1394
|
try {
|
|
1399
|
-
await
|
|
1395
|
+
await i.option.form?.submitBefore?.(t.update.form, t.update);
|
|
1400
1396
|
} catch {
|
|
1401
1397
|
t.update.loading = !1;
|
|
1402
1398
|
return;
|
|
1403
1399
|
}
|
|
1404
1400
|
let l = JSONUtil.cp(t.update.form);
|
|
1405
1401
|
delete l.children;
|
|
1406
|
-
const e = new Set(
|
|
1402
|
+
const e = new Set(i.option.column.filter((s) => s.type === "datetime").map((s) => s.key));
|
|
1407
1403
|
Object.keys(l).forEach((s) => {
|
|
1408
1404
|
if (e.has(s) && l[s] != null) {
|
|
1409
1405
|
const p = new Date(l[s]).getTime();
|
|
@@ -1411,10 +1407,10 @@ const I = E.EDialog, Le = (r) => {
|
|
|
1411
1407
|
}
|
|
1412
1408
|
});
|
|
1413
1409
|
try {
|
|
1414
|
-
if (!
|
|
1415
|
-
await
|
|
1410
|
+
if (!r) return;
|
|
1411
|
+
await r({
|
|
1416
1412
|
...l
|
|
1417
|
-
}), t.update.close(), await t.table.getList(),
|
|
1413
|
+
}), t.update.close(), await t.table.getList(), i.option.form?.submitAfter?.(l, t.update);
|
|
1418
1414
|
} catch (s) {
|
|
1419
1415
|
console.error(s);
|
|
1420
1416
|
} finally {
|
|
@@ -1434,8 +1430,8 @@ const I = E.EDialog, Le = (r) => {
|
|
|
1434
1430
|
/** 行内编辑当前行对象 */
|
|
1435
1431
|
data: null,
|
|
1436
1432
|
/** 打开行内编辑 */
|
|
1437
|
-
open: (
|
|
1438
|
-
t.inlineEdit.data =
|
|
1433
|
+
open: (r) => {
|
|
1434
|
+
t.inlineEdit.data = r, t.update.open(I.Update, r);
|
|
1439
1435
|
},
|
|
1440
1436
|
/** 关闭行内编辑 */
|
|
1441
1437
|
close: () => {
|
|
@@ -1457,24 +1453,24 @@ const I = E.EDialog, Le = (r) => {
|
|
|
1457
1453
|
t.remove.show = !1;
|
|
1458
1454
|
},
|
|
1459
1455
|
/** 打开删除弹窗并设置待删除项 */
|
|
1460
|
-
open: (
|
|
1461
|
-
if (
|
|
1462
|
-
|
|
1456
|
+
open: (r) => {
|
|
1457
|
+
if (r.length === 0) {
|
|
1458
|
+
U.fail(y.tCurd("selectDataToDelete"));
|
|
1463
1459
|
return;
|
|
1464
1460
|
}
|
|
1465
|
-
t.remove.items =
|
|
1461
|
+
t.remove.items = r, t.remove.show = !0;
|
|
1466
1462
|
},
|
|
1467
1463
|
/** 执行删除实际操作 */
|
|
1468
1464
|
submit: () => {
|
|
1469
1465
|
FunUtil.throttle(async () => {
|
|
1470
1466
|
t.remove.loading = !0;
|
|
1471
|
-
const
|
|
1467
|
+
const r = i.option.api.delete;
|
|
1472
1468
|
try {
|
|
1473
|
-
if (!
|
|
1474
|
-
await
|
|
1475
|
-
[
|
|
1469
|
+
if (!r) return;
|
|
1470
|
+
await r({
|
|
1471
|
+
[i.option.table?.rowKey]: t.remove.items.map((l) => l[i.option.table?.rowKey]),
|
|
1476
1472
|
items: t.remove.items
|
|
1477
|
-
}),
|
|
1473
|
+
}), U.success(y.tCurd("operationSuccess")), t.table.data.length <= 1 && t.page.num > 1 && (t.page.num -= 1), t.remove.close(), await t.table.getList();
|
|
1478
1474
|
} catch (l) {
|
|
1479
1475
|
console.error(l);
|
|
1480
1476
|
} finally {
|
|
@@ -1490,20 +1486,20 @@ const I = E.EDialog, Le = (r) => {
|
|
|
1490
1486
|
/** 下拉请求等数据缓存 */
|
|
1491
1487
|
apiDataMap: {},
|
|
1492
1488
|
/** 获取并绑定curd中所有下拉数据等远程依赖 */
|
|
1493
|
-
initApiData: async (
|
|
1489
|
+
initApiData: async (r) => {
|
|
1494
1490
|
const l = [], e = (s) => {
|
|
1495
1491
|
if (s.children && s.children.length) {
|
|
1496
1492
|
s.children.forEach((p) => e(p));
|
|
1497
1493
|
return;
|
|
1498
1494
|
}
|
|
1499
|
-
if (s.options?.[s.type]?.dataApi && s.options?.[s.type]?.dataApiConfig?.[
|
|
1495
|
+
if (s.options?.[s.type]?.dataApi && s.options?.[s.type]?.dataApiConfig?.[r]) {
|
|
1500
1496
|
if (t.apiDataMap[s.key] && s.options?.[s.type]?.dataApiConfig?.once) return;
|
|
1501
1497
|
const p = (async () => {
|
|
1502
1498
|
try {
|
|
1503
|
-
let c = await s.options?.[s.type]?.dataApi?.(t.update.form,
|
|
1499
|
+
let c = await s.options?.[s.type]?.dataApi?.(t.update.form, r);
|
|
1504
1500
|
if (c) {
|
|
1505
|
-
const
|
|
1506
|
-
|
|
1501
|
+
const g = s.options?.[s.type]?.dataPath;
|
|
1502
|
+
g && (c = ObjectUtil.getPathValue(c, g)), s.options[s.type].data = c, s.options.search[s.type].data = c, s.options.formAdd[s.type].data = c, s.options.formUpdate[s.type].data = c, t.apiDataMap[s.key] = c;
|
|
1507
1503
|
}
|
|
1508
1504
|
} catch {
|
|
1509
1505
|
}
|
|
@@ -1511,17 +1507,17 @@ const I = E.EDialog, Le = (r) => {
|
|
|
1511
1507
|
l.push(p);
|
|
1512
1508
|
}
|
|
1513
1509
|
};
|
|
1514
|
-
return
|
|
1510
|
+
return i.option.column.forEach((s) => {
|
|
1515
1511
|
e(s);
|
|
1516
1512
|
}), await Promise.all(l), !0;
|
|
1517
1513
|
},
|
|
1518
1514
|
/** 初始化curd配置(option默认值合并等) */
|
|
1519
1515
|
initCurdConfig: () => {
|
|
1520
|
-
const
|
|
1521
|
-
|
|
1522
|
-
const l = ObjectUtil.deepMerge(
|
|
1516
|
+
const r = JSONUtil.cp(O.config);
|
|
1517
|
+
r.table.emptyText = y.tCurd("noData"), i.option.size = i.option.size || {}, r.table.size = i.option.size.table || r.size.table, r.form.size = i.option.size.form || r.size.form, r.size.search = i.option.size.search || r.size.search;
|
|
1518
|
+
const l = ObjectUtil.deepMerge(r, i.option || {});
|
|
1523
1519
|
Object.keys(l).forEach((e) => {
|
|
1524
|
-
|
|
1520
|
+
i.option[e] = l[e];
|
|
1525
1521
|
});
|
|
1526
1522
|
},
|
|
1527
1523
|
/**
|
|
@@ -1530,25 +1526,25 @@ const I = E.EDialog, Le = (r) => {
|
|
|
1530
1526
|
* @returns
|
|
1531
1527
|
*/
|
|
1532
1528
|
initColumnOptions: () => {
|
|
1533
|
-
let
|
|
1534
|
-
|
|
1529
|
+
let r = JSONUtil.cp(O.config.columnConfig);
|
|
1530
|
+
r.options = ObjectUtil.deepMerge(r.options, {
|
|
1535
1531
|
switch: {
|
|
1536
1532
|
activeLabel: y.tCurd("switchOn"),
|
|
1537
1533
|
inactiveLabel: y.tCurd("switchOff")
|
|
1538
1534
|
}
|
|
1539
1535
|
});
|
|
1540
1536
|
const l = (e) => {
|
|
1541
|
-
for (const s in
|
|
1537
|
+
for (const s in r) {
|
|
1542
1538
|
if (s === "table") {
|
|
1543
|
-
if (e.table = ObjectUtil.deepMerge(
|
|
1539
|
+
if (e.table = ObjectUtil.deepMerge(r.table, e.table || {}), e.children) {
|
|
1544
1540
|
e.children.forEach((c) => {
|
|
1545
1541
|
l(c);
|
|
1546
1542
|
});
|
|
1547
1543
|
return;
|
|
1548
1544
|
}
|
|
1549
|
-
} else s === "type" ? e.type = e.type ||
|
|
1550
|
-
e.options = e.options || {}, e.options[e.type] = e.options[e.type] || {}, e.options[e.type].size =
|
|
1551
|
-
e.options[c] = e.options[c] || JSONUtil.cp(e.options), e.options[c][e.type] = e.options[c][e.type] || {}, e.options[c][e.type].size = c === "search" ?
|
|
1545
|
+
} else s === "type" ? e.type = e.type || r.type : e[s] = ObjectUtil.deepMerge(r[s], e[s] || {});
|
|
1546
|
+
e.options = e.options || {}, e.options[e.type] = e.options[e.type] || {}, e.options[e.type].size = i.option.size.form, ["search", "formAdd", "formUpdate"].forEach((c) => {
|
|
1547
|
+
e.options[c] = e.options[c] || JSONUtil.cp(e.options), e.options[c][e.type] = e.options[c][e.type] || {}, e.options[c][e.type].size = c === "search" ? i.option.size.search : i.option.size.form;
|
|
1552
1548
|
}), e.table = ObjectUtil.deepMerge(e.table, e.options[e.type].table || {});
|
|
1553
1549
|
}
|
|
1554
1550
|
e.type === "switch" && (e.options.switch.tableBeforeChange = async (s, p) => {
|
|
@@ -1559,40 +1555,40 @@ const I = E.EDialog, Le = (r) => {
|
|
|
1559
1555
|
content: y.tCurd("confirmSwitchMessage")
|
|
1560
1556
|
}), t.table.loading = !0;
|
|
1561
1557
|
try {
|
|
1562
|
-
return
|
|
1563
|
-
[
|
|
1558
|
+
return i.option.api.update ? (await i.option.api.update({
|
|
1559
|
+
[i.option.table?.rowKey]: p[i.option.table?.rowKey],
|
|
1564
1560
|
[s]: p[s] === c.activeValue ? c.inactiveValue : c.activeValue,
|
|
1565
|
-
final(
|
|
1561
|
+
final(g, n, d) {
|
|
1566
1562
|
t.table.loading = !1;
|
|
1567
1563
|
}
|
|
1568
|
-
}), t.table.loading = !1,
|
|
1569
|
-
} catch (
|
|
1570
|
-
return console.error(
|
|
1564
|
+
}), t.table.loading = !1, U.success(y.tCurd("operationSuccess")), t.table.getList(), !0) : void 0;
|
|
1565
|
+
} catch (g) {
|
|
1566
|
+
return console.error(g), !1;
|
|
1571
1567
|
} finally {
|
|
1572
1568
|
t.table.loading = !1;
|
|
1573
1569
|
}
|
|
1574
1570
|
} catch {
|
|
1575
1571
|
return !1;
|
|
1576
1572
|
}
|
|
1577
|
-
}), e.type === "treeSelect" && (e.options.treeSelect.rowKey =
|
|
1573
|
+
}), e.type === "treeSelect" && (e.options.treeSelect.rowKey = i.option.table?.rowKey, e.options.treeSelect.nodeKey = i.option.table?.rowKey);
|
|
1578
1574
|
};
|
|
1579
|
-
|
|
1575
|
+
i.option.column.forEach(l), i.option.table?.column?.forEach(l);
|
|
1580
1576
|
},
|
|
1581
|
-
getColumnSpan: (
|
|
1582
|
-
if (
|
|
1583
|
-
const e = O.config.form.defaultSpan, p = l.filter((c) => !
|
|
1584
|
-
return (
|
|
1577
|
+
getColumnSpan: (r, l) => {
|
|
1578
|
+
if (r.item.form?.spanCol) {
|
|
1579
|
+
const e = O.config.form.defaultSpan, p = l.filter((c) => !U.isFun(c.item.show?.form, t.update.form, t.update.type)).reduce((c, g) => c + (g.item.form?.span || e), 0);
|
|
1580
|
+
return (r.item?.form.span || e) + p;
|
|
1585
1581
|
}
|
|
1586
|
-
return
|
|
1582
|
+
return r.item.form.span;
|
|
1587
1583
|
},
|
|
1588
1584
|
/** 初始化配置并生成表单列及默认值及规则 */
|
|
1589
1585
|
initColumnForm: () => {
|
|
1590
|
-
const
|
|
1586
|
+
const r = i.option;
|
|
1591
1587
|
t.update.formColumn = [], t.table.column.show = {
|
|
1592
1588
|
list: [],
|
|
1593
1589
|
listSource: []
|
|
1594
1590
|
};
|
|
1595
|
-
const l = [], e =
|
|
1591
|
+
const l = [], e = i.option.form?.maxSpan || 12, s = i.option.form?.defaultSpan || e / 2;
|
|
1596
1592
|
let p = [];
|
|
1597
1593
|
const c = (d) => {
|
|
1598
1594
|
if (d.children) {
|
|
@@ -1619,34 +1615,34 @@ const I = E.EDialog, Le = (r) => {
|
|
|
1619
1615
|
] : d.rules;
|
|
1620
1616
|
}
|
|
1621
1617
|
}
|
|
1622
|
-
},
|
|
1623
|
-
d.isForm = V, Array.isArray(d.children) && d.children.forEach((w) =>
|
|
1618
|
+
}, g = (d, V) => {
|
|
1619
|
+
d.isForm = V, Array.isArray(d.children) && d.children.forEach((w) => g(w, V));
|
|
1624
1620
|
};
|
|
1625
|
-
|
|
1626
|
-
d.isForm = !0,
|
|
1627
|
-
}),
|
|
1628
|
-
|
|
1629
|
-
}), t.search.column.list =
|
|
1630
|
-
const n =
|
|
1621
|
+
r.column.forEach((d) => {
|
|
1622
|
+
d.isForm = !0, g(d, !0), c(d);
|
|
1623
|
+
}), i.option.table?.column?.forEach((d) => {
|
|
1624
|
+
g(d, !1), c(d);
|
|
1625
|
+
}), t.search.column.list = r.column.concat(r.table?.column || []), t.table.column.list = t.search.column.list.filter((d) => d.table?.table), t.search.column.list.sort((d, V) => d.sort?.search - V.sort?.search), t.table.column.list.sort((d, V) => d.sort?.table - V.sort?.table), p.length > 0 && l.push(p), t.update.formColumn = l;
|
|
1626
|
+
const n = i.option.search?.formDefault;
|
|
1631
1627
|
n && Object.keys(n).forEach((d) => {
|
|
1632
1628
|
t.search.formDefault[d] = n[d];
|
|
1633
|
-
}),
|
|
1629
|
+
}), r.column.forEach((d) => {
|
|
1634
1630
|
d.show?.search || (t.search.formDefault[d.key] = void 0);
|
|
1635
1631
|
}), t.search.form = JSONUtil.cp(t.search.formDefault);
|
|
1636
1632
|
}
|
|
1637
1633
|
});
|
|
1638
1634
|
return t.init(), ue(() => {
|
|
1639
|
-
|
|
1635
|
+
i.option.init !== !1 && t.table.getList();
|
|
1640
1636
|
}), { conf: t, switchConfirmRef: o, ruleFormRef: u };
|
|
1641
1637
|
}, Me = { class: "dialog-footer" }, Be = /* @__PURE__ */ J({
|
|
1642
1638
|
__name: "switchConfirm",
|
|
1643
1639
|
props: {
|
|
1644
1640
|
size: {}
|
|
1645
1641
|
},
|
|
1646
|
-
setup(
|
|
1647
|
-
const u = H(!1), t = H("确认修改"),
|
|
1642
|
+
setup(i, { expose: o }) {
|
|
1643
|
+
const u = H(!1), t = H("确认修改"), r = H("确认要修改状态吗?");
|
|
1648
1644
|
let l = null, e = null;
|
|
1649
|
-
const s = (
|
|
1645
|
+
const s = (g) => (g?.title && (t.value = g.title), g?.content && (r.value = g.content), u.value = !0, new Promise((n, d) => {
|
|
1650
1646
|
l = n, e = d;
|
|
1651
1647
|
})), p = () => {
|
|
1652
1648
|
u.value = !1, l?.(!0), l = null, e = null;
|
|
@@ -1655,9 +1651,9 @@ const I = E.EDialog, Le = (r) => {
|
|
|
1655
1651
|
};
|
|
1656
1652
|
return o({
|
|
1657
1653
|
open: s
|
|
1658
|
-
}), (
|
|
1659
|
-
const d =
|
|
1660
|
-
return f(), h(a(
|
|
1654
|
+
}), (g, n) => {
|
|
1655
|
+
const d = Y("el-form");
|
|
1656
|
+
return f(), h(a(ee), {
|
|
1661
1657
|
modelValue: u.value,
|
|
1662
1658
|
"onUpdate:modelValue": n[0] || (n[0] = (V) => u.value = V),
|
|
1663
1659
|
title: t.value,
|
|
@@ -1665,7 +1661,7 @@ const I = E.EDialog, Le = (r) => {
|
|
|
1665
1661
|
width: "400px"
|
|
1666
1662
|
}, {
|
|
1667
1663
|
footer: m(() => [
|
|
1668
|
-
z(d, { size:
|
|
1664
|
+
z(d, { size: g.size }, {
|
|
1669
1665
|
default: m(() => [
|
|
1670
1666
|
F("span", Me, [
|
|
1671
1667
|
z(a(T), { onClick: c }, {
|
|
@@ -1689,23 +1685,23 @@ const I = E.EDialog, Le = (r) => {
|
|
|
1689
1685
|
}, 8, ["size"])
|
|
1690
1686
|
]),
|
|
1691
1687
|
default: m(() => [
|
|
1692
|
-
F("div", null,
|
|
1688
|
+
F("div", null, E(r.value), 1)
|
|
1693
1689
|
]),
|
|
1694
1690
|
_: 1
|
|
1695
1691
|
}, 8, ["modelValue", "title"]);
|
|
1696
1692
|
};
|
|
1697
1693
|
}
|
|
1698
|
-
}), pe = (
|
|
1699
|
-
const u =
|
|
1700
|
-
for (const [t,
|
|
1701
|
-
u[t] =
|
|
1694
|
+
}), pe = (i, o) => {
|
|
1695
|
+
const u = i.__vccOpts || i;
|
|
1696
|
+
for (const [t, r] of o)
|
|
1697
|
+
u[t] = r;
|
|
1702
1698
|
return u;
|
|
1703
1699
|
}, je = {}, Ie = {
|
|
1704
1700
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1705
1701
|
viewBox: "0 0 1024 1024"
|
|
1706
1702
|
};
|
|
1707
|
-
function Re(
|
|
1708
|
-
return f(),
|
|
1703
|
+
function Re(i, o) {
|
|
1704
|
+
return f(), b("svg", Ie, o[0] || (o[0] = [
|
|
1709
1705
|
F("path", {
|
|
1710
1706
|
fill: "currentColor",
|
|
1711
1707
|
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"
|
|
@@ -1717,8 +1713,8 @@ const Pe = /* @__PURE__ */ pe(je, [["render", Re]]), Ne = {}, Ke = {
|
|
|
1717
1713
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1718
1714
|
viewBox: "0 0 1024 1024"
|
|
1719
1715
|
};
|
|
1720
|
-
function He(
|
|
1721
|
-
return f(),
|
|
1716
|
+
function He(i, o) {
|
|
1717
|
+
return f(), b("svg", Ke, o[0] || (o[0] = [
|
|
1722
1718
|
F("path", {
|
|
1723
1719
|
fill: "currentColor",
|
|
1724
1720
|
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"
|
|
@@ -1732,14 +1728,14 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
1732
1728
|
columnList: {},
|
|
1733
1729
|
option: {}
|
|
1734
1730
|
},
|
|
1735
|
-
setup(
|
|
1736
|
-
const o =
|
|
1737
|
-
return (t,
|
|
1738
|
-
const l =
|
|
1739
|
-
return f(!0),
|
|
1731
|
+
setup(i) {
|
|
1732
|
+
const o = U.isFun, u = ge().type;
|
|
1733
|
+
return (t, r) => {
|
|
1734
|
+
const l = Y("el-tooltip");
|
|
1735
|
+
return f(!0), b(S, null, L(t.columnList, (e) => (f(), b(S, {
|
|
1740
1736
|
key: e.key
|
|
1741
1737
|
}, [
|
|
1742
|
-
t.conf.table.column.show.list.includes(e.key) ? (f(), h(a(
|
|
1738
|
+
t.conf.table.column.show.list.includes(e.key) ? (f(), h(a(te), v({
|
|
1743
1739
|
key: 0,
|
|
1744
1740
|
prop: e.key,
|
|
1745
1741
|
label: e.label,
|
|
@@ -1761,47 +1757,56 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
1761
1757
|
]),
|
|
1762
1758
|
_: 2
|
|
1763
1759
|
}, 1032, ["content"])) : k("", !0),
|
|
1764
|
-
$(" " +
|
|
1760
|
+
$(" " + E(e.label), 1)
|
|
1765
1761
|
])
|
|
1766
1762
|
])
|
|
1767
1763
|
]),
|
|
1768
1764
|
default: m(({ row: s }) => [
|
|
1769
|
-
e.children ? (f(),
|
|
1770
|
-
|
|
1765
|
+
e.children ? (f(), b(S, { key: 0 }, [
|
|
1766
|
+
r[0] || (r[0] = $(" ")),
|
|
1771
1767
|
(f(), h(q(a(u)), {
|
|
1772
1768
|
conf: t.conf,
|
|
1773
1769
|
columnList: e.children,
|
|
1774
1770
|
option: t.option
|
|
1775
|
-
},
|
|
1771
|
+
}, oe({ _: 2 }, [
|
|
1776
1772
|
L(t.$slots, (p, c) => ({
|
|
1777
1773
|
name: c,
|
|
1778
|
-
fn: m((
|
|
1779
|
-
C(t.$slots, c, v({ ref_for: !0 },
|
|
1774
|
+
fn: m((g) => [
|
|
1775
|
+
C(t.$slots, c, v({ ref_for: !0 }, g || {}))
|
|
1780
1776
|
])
|
|
1781
1777
|
}))
|
|
1782
1778
|
]), 1032, ["conf", "columnList", "option"]))
|
|
1783
|
-
], 64)) : (f(),
|
|
1784
|
-
a(o)(e.show?.form, t.conf.update.form, a(
|
|
1785
|
-
e.type === "input" ? (f(), h(a(
|
|
1779
|
+
], 64)) : (f(), b(S, { key: 1 }, [
|
|
1780
|
+
a(o)(e.show?.form, t.conf.update.form, a(U).EDialog.Update) && t.option.table?.inlineEdit && t.conf.inlineEdit.data === s && (e.type === "input" || e.type === "select") ? (f(), b(S, { key: 0 }, [
|
|
1781
|
+
e.type === "input" ? (f(), h(a(Z), v({
|
|
1786
1782
|
key: 0,
|
|
1787
1783
|
modelValue: t.conf.update.form[e.key],
|
|
1788
1784
|
"onUpdate:modelValue": (p) => t.conf.update.form[e.key] = p,
|
|
1785
|
+
disabled: t.conf.update.getDisabled(e),
|
|
1789
1786
|
ref_for: !0
|
|
1790
|
-
}, t.conf.update.getBind(e),
|
|
1787
|
+
}, t.conf.update.getBind(e), D(t.conf.update.getOn(e)), { style: { width: "100%" } }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "select" ? (f(), h(a(W), v({
|
|
1791
1788
|
key: 1,
|
|
1792
1789
|
modelValue: t.conf.update.form[e.key],
|
|
1793
1790
|
"onUpdate:modelValue": (p) => t.conf.update.form[e.key] = p,
|
|
1791
|
+
disabled: t.conf.update.getDisabled(e),
|
|
1794
1792
|
ref_for: !0
|
|
1795
|
-
}, t.conf.update.getBind(e),
|
|
1793
|
+
}, t.conf.update.getBind(e), D(t.conf.update.getOn(e)), { style: { width: "100%" } }), {
|
|
1796
1794
|
default: m(() => [
|
|
1797
|
-
(f(!0),
|
|
1795
|
+
(f(!0), b(S, null, L(e.options?.search?.select?.data || e.options?.select?.data, (p) => (f(), h(a(K), {
|
|
1798
1796
|
key: p.value,
|
|
1799
1797
|
label: p.label,
|
|
1800
1798
|
value: p.value
|
|
1801
1799
|
}, null, 8, ["label", "value"]))), 128))
|
|
1802
1800
|
]),
|
|
1803
1801
|
_: 2
|
|
1804
|
-
}, 1040, ["modelValue", "onUpdate:modelValue"])) :
|
|
1802
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "switch" ? (f(), h(a(X), v({
|
|
1803
|
+
key: 2,
|
|
1804
|
+
modelValue: t.conf.update.form[e.key],
|
|
1805
|
+
"onUpdate:modelValue": (p) => t.conf.update.form[e.key] = p,
|
|
1806
|
+
ref_for: !0
|
|
1807
|
+
}, t.conf.update.getBind(e), D(t.conf.update.getOn(e)), {
|
|
1808
|
+
disabled: t.conf.update.getDisabled(e)
|
|
1809
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : k("", !0)
|
|
1805
1810
|
], 64)) : C(t.$slots, "table-" + e.key, {
|
|
1806
1811
|
key: 1,
|
|
1807
1812
|
row: s,
|
|
@@ -1812,13 +1817,13 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
1812
1817
|
modelValue: s[e.key],
|
|
1813
1818
|
"onUpdate:modelValue": (p) => s[e.key] = p,
|
|
1814
1819
|
ref_for: !0
|
|
1815
|
-
}, e.options?.[e.type ?? ""],
|
|
1820
|
+
}, e.options?.[e.type ?? ""], D(e.options?.[e.type ?? ""]?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue"])) : e.type === "switch" ? (f(), h(a(X), v({
|
|
1816
1821
|
key: 1,
|
|
1817
1822
|
modelValue: s[e.key],
|
|
1818
1823
|
"onUpdate:modelValue": (p) => s[e.key] = p,
|
|
1819
1824
|
"before-change": () => e.options?.switch?.tableBeforeChange?.(e.key, s),
|
|
1820
1825
|
ref_for: !0
|
|
1821
|
-
}, e.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "before-change"])) : (f(),
|
|
1826
|
+
}, e.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "before-change"])) : (f(), b("span", {
|
|
1822
1827
|
key: 2,
|
|
1823
1828
|
style: fe({
|
|
1824
1829
|
"--table-text-click-color": e.table?.click?.color
|
|
@@ -1844,7 +1849,7 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
1844
1849
|
conf: {},
|
|
1845
1850
|
item: {}
|
|
1846
1851
|
},
|
|
1847
|
-
setup(
|
|
1852
|
+
setup(i) {
|
|
1848
1853
|
return (o, u) => (f(), h(a(G), {
|
|
1849
1854
|
class: j({
|
|
1850
1855
|
"hide-label": typeof o.item.item.text?.form?.label == "boolean" ? !o.item.item.text?.form?.label : !1
|
|
@@ -1865,28 +1870,28 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
1865
1870
|
row: o.conf.update.form,
|
|
1866
1871
|
item: o.item.item
|
|
1867
1872
|
}, () => [
|
|
1868
|
-
o.item.item.type === "input" ? (f(), h(a(
|
|
1873
|
+
o.item.item.type === "input" ? (f(), h(a(Z), v({
|
|
1869
1874
|
key: 0,
|
|
1870
1875
|
modelValue: o.conf.update.form[o.item.item.key],
|
|
1871
1876
|
"onUpdate:modelValue": u[0] || (u[0] = (t) => o.conf.update.form[o.item.item.key] = t)
|
|
1872
|
-
}, o.conf.update.getBind(o.item.item),
|
|
1877
|
+
}, o.conf.update.getBind(o.item.item), D(o.conf.update.getOn(o.item.item)), {
|
|
1873
1878
|
disabled: o.conf.update.getDisabled(o.item.item)
|
|
1874
|
-
}), null, 16, ["modelValue", "disabled"])) : o.item.item.type === "switch" ? (f(), h(a(
|
|
1879
|
+
}), null, 16, ["modelValue", "disabled"])) : o.item.item.type === "switch" ? (f(), h(a(X), v({
|
|
1875
1880
|
key: 1,
|
|
1876
1881
|
modelValue: o.conf.update.form[o.item.item.key],
|
|
1877
1882
|
"onUpdate:modelValue": u[1] || (u[1] = (t) => o.conf.update.form[o.item.item.key] = t)
|
|
1878
|
-
}, o.conf.update.getBind(o.item.item),
|
|
1883
|
+
}, o.conf.update.getBind(o.item.item), D(o.conf.update.getOn(o.item.item)), {
|
|
1879
1884
|
disabled: o.conf.update.getDisabled(o.item.item)
|
|
1880
1885
|
}), null, 16, ["modelValue", "disabled"])) : o.item.item.type === "select" ? (f(), h(a(W), v({
|
|
1881
1886
|
key: 2,
|
|
1882
1887
|
modelValue: o.conf.update.form[o.item.item.key],
|
|
1883
1888
|
"onUpdate:modelValue": u[2] || (u[2] = (t) => o.conf.update.form[o.item.item.key] = t)
|
|
1884
|
-
}, o.conf.update.getBind(o.item.item),
|
|
1889
|
+
}, o.conf.update.getBind(o.item.item), D(o.conf.update.getOn(o.item.item)), {
|
|
1885
1890
|
disabled: o.conf.update.getDisabled(o.item.item),
|
|
1886
1891
|
style: { width: "100%" }
|
|
1887
1892
|
}), {
|
|
1888
1893
|
default: m(() => [
|
|
1889
|
-
(f(!0),
|
|
1894
|
+
(f(!0), b(S, null, L(o.conf.update.getBind(o.item.item).data, (t) => (f(), h(a(K), {
|
|
1890
1895
|
key: t.value,
|
|
1891
1896
|
label: t.label,
|
|
1892
1897
|
value: t.value
|
|
@@ -1897,12 +1902,12 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
1897
1902
|
key: 3,
|
|
1898
1903
|
modelValue: o.conf.update.form[o.item.item.key],
|
|
1899
1904
|
"onUpdate:modelValue": u[3] || (u[3] = (t) => o.conf.update.form[o.item.item.key] = t)
|
|
1900
|
-
}, o.conf.update.getBind(o.item.item),
|
|
1905
|
+
}, o.conf.update.getBind(o.item.item), D(o.conf.update.getOn(o.item.item)), {
|
|
1901
1906
|
disabled: o.conf.update.getDisabled(o.item.item),
|
|
1902
1907
|
style: { width: "100%" }
|
|
1903
1908
|
}), {
|
|
1904
1909
|
default: m(() => [
|
|
1905
|
-
(f(!0),
|
|
1910
|
+
(f(!0), b(S, null, L(o.conf.update.getBind(o.item.item).data, (t) => (f(), h(a(se), {
|
|
1906
1911
|
key: t.value,
|
|
1907
1912
|
label: t.label,
|
|
1908
1913
|
value: t.value
|
|
@@ -1913,27 +1918,27 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
1913
1918
|
key: 4,
|
|
1914
1919
|
row: o.conf.update.form,
|
|
1915
1920
|
field: o.item.item.key
|
|
1916
|
-
}, o.conf.update.getBind(o.item.item),
|
|
1921
|
+
}, o.conf.update.getBind(o.item.item), D(o.conf.update.getOn(o.item.item)), {
|
|
1917
1922
|
disabled: o.conf.update.getDisabled(o.item.item),
|
|
1918
1923
|
style: { width: "100%" }
|
|
1919
1924
|
}), null, 16, ["row", "field", "disabled"])) : o.item.item.type === "treeSelect" ? (f(), h(a(de), v({
|
|
1920
1925
|
key: 5,
|
|
1921
1926
|
modelValue: o.conf.update.form[o.item.item.key],
|
|
1922
1927
|
"onUpdate:modelValue": u[4] || (u[4] = (t) => o.conf.update.form[o.item.item.key] = t)
|
|
1923
|
-
}, o.conf.update.getBind(o.item.item),
|
|
1928
|
+
}, o.conf.update.getBind(o.item.item), D(o.conf.update.getOn(o.item.item)), {
|
|
1924
1929
|
disabled: o.conf.update.getDisabled(o.item.item),
|
|
1925
1930
|
style: { width: "100%" }
|
|
1926
1931
|
}), null, 16, ["modelValue", "disabled"])) : o.item.item.type === "datetime" ? (f(), h(a(ae), v({
|
|
1927
1932
|
key: 6,
|
|
1928
1933
|
modelValue: o.conf.update.form[o.item.item.key],
|
|
1929
1934
|
"onUpdate:modelValue": u[5] || (u[5] = (t) => o.conf.update.form[o.item.item.key] = t)
|
|
1930
|
-
}, o.conf.update.getBind(o.item.item),
|
|
1935
|
+
}, o.conf.update.getBind(o.item.item), D(o.conf.update.getOn(o.item.item)), {
|
|
1931
1936
|
disabled: o.conf.update.getDisabled(o.item.item)
|
|
1932
1937
|
}), null, 16, ["modelValue", "disabled"])) : o.item.item.type && (a(M).customComponent[o.item.item.type] || a(M).customComponent[o.item.item.type]?.form) ? (f(), h(q(a(M).customComponent[o.item.item.type]?.form || a(M).customComponent[o.item.item.type]), v({
|
|
1933
1938
|
key: 7,
|
|
1934
1939
|
modelValue: o.conf.update.form[o.item.item.key],
|
|
1935
1940
|
"onUpdate:modelValue": u[6] || (u[6] = (t) => o.conf.update.form[o.item.item.key] = t)
|
|
1936
|
-
}, o.conf.update.getBind(o.item.item),
|
|
1941
|
+
}, o.conf.update.getBind(o.item.item), D(o.conf.update.getOn(o.item.item)), {
|
|
1937
1942
|
disabled: o.conf.update.getDisabled(o.item.item)
|
|
1938
1943
|
}), null, 16, ["modelValue", "disabled"])) : k("", !0)
|
|
1939
1944
|
]),
|
|
@@ -1946,7 +1951,7 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
1946
1951
|
row: o.conf.update.form,
|
|
1947
1952
|
item: o.item.item
|
|
1948
1953
|
}, () => [
|
|
1949
|
-
o.item.item.form?.tipText ? (f(),
|
|
1954
|
+
o.item.item.form?.tipText ? (f(), b("div", {
|
|
1950
1955
|
key: 0,
|
|
1951
1956
|
class: "form-tip-text",
|
|
1952
1957
|
innerHTML: typeof o.item.item.form?.tipText == "function" ? o.item.item.form?.tipText(o.conf.update.form, o.conf.update.type) : o.item.item.form?.tipText
|
|
@@ -1984,34 +1989,34 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
1984
1989
|
default: {}
|
|
1985
1990
|
}
|
|
1986
1991
|
},
|
|
1987
|
-
setup(
|
|
1988
|
-
const u =
|
|
1992
|
+
setup(i, { expose: o }) {
|
|
1993
|
+
const u = U.EDialog, t = i, r = U.isFun, { conf: l, switchConfirmRef: e, ruleFormRef: s } = Le(t);
|
|
1989
1994
|
return o({
|
|
1990
1995
|
conf: l
|
|
1991
1996
|
}), (p, c) => {
|
|
1992
|
-
const
|
|
1993
|
-
return f(),
|
|
1994
|
-
class: j(["relative cc1-form-box", [
|
|
1997
|
+
const g = we("loading");
|
|
1998
|
+
return f(), b("div", {
|
|
1999
|
+
class: j(["relative cc1-form-box", [i.option.table?.fitHeight ? "col" : "no-min-height"]])
|
|
1995
2000
|
}, [
|
|
1996
2001
|
F("div", {
|
|
1997
|
-
class: j(["row", [
|
|
2002
|
+
class: j(["row", [i.option.table?.fitHeight ? "absolute fit" : ""]]),
|
|
1998
2003
|
style: { overflow: "hidden" }
|
|
1999
2004
|
}, [
|
|
2000
2005
|
C(p.$slots, "box-left"),
|
|
2001
2006
|
F("div", {
|
|
2002
|
-
class: j(["column fit-width no-wrap", [
|
|
2007
|
+
class: j(["column fit-width no-wrap", [i.option.table?.fitHeight ? "col" : ""]])
|
|
2003
2008
|
}, [
|
|
2004
|
-
|
|
2009
|
+
i.option.search?.show !== !1 ? (f(), b("div", et, [
|
|
2005
2010
|
z(a(N), {
|
|
2006
2011
|
model: a(l).search.form,
|
|
2007
2012
|
inline: "",
|
|
2008
|
-
size:
|
|
2013
|
+
size: i.option.size?.search
|
|
2009
2014
|
}, {
|
|
2010
2015
|
default: m(() => [
|
|
2011
2016
|
C(p.$slots, "search-start", {
|
|
2012
2017
|
row: a(l).search.form
|
|
2013
2018
|
}),
|
|
2014
|
-
(f(!0),
|
|
2019
|
+
(f(!0), b(S, null, L(a(l).search.column.list, (n) => (f(), b(S, {
|
|
2015
2020
|
key: n.key
|
|
2016
2021
|
}, [
|
|
2017
2022
|
(typeof n.show?.search == "function" ? n.show?.search(a(l).search.form) : n.show?.search) ? (f(), h(a(G), {
|
|
@@ -2025,7 +2030,7 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
2025
2030
|
C(p.$slots, "search-" + n.key, {
|
|
2026
2031
|
row: a(l).search.form
|
|
2027
2032
|
}, () => [
|
|
2028
|
-
n.type === "input" ? (f(), h(a(
|
|
2033
|
+
n.type === "input" ? (f(), h(a(Z), v({
|
|
2029
2034
|
key: 0,
|
|
2030
2035
|
modelValue: a(l).search.form[n.key],
|
|
2031
2036
|
"onUpdate:modelValue": (d) => a(l).search.form[n.key] = d,
|
|
@@ -2033,7 +2038,7 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
2033
2038
|
clearable: "",
|
|
2034
2039
|
disabled: n.disabled?.search,
|
|
2035
2040
|
ref_for: !0
|
|
2036
|
-
}, n.options?.search?.input || n.options?.input,
|
|
2041
|
+
}, n.options?.search?.input || n.options?.input, D(n.options?.search?.input?.on || n.options?.input?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : n.type === "switch" ? (f(), h(a(W), v({
|
|
2037
2042
|
key: 1,
|
|
2038
2043
|
modelValue: a(l).search.form[n.key],
|
|
2039
2044
|
"onUpdate:modelValue": (d) => a(l).search.form[n.key] = d,
|
|
@@ -2041,7 +2046,7 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
2041
2046
|
clearable: "",
|
|
2042
2047
|
disabled: n.disabled?.search,
|
|
2043
2048
|
ref_for: !0
|
|
2044
|
-
}, n.options?.search?.switch || n.options?.switch,
|
|
2049
|
+
}, n.options?.search?.switch || n.options?.switch, D(n.options?.search?.switch?.on || n.options?.switch?.on || {})), {
|
|
2045
2050
|
default: m(() => [
|
|
2046
2051
|
(f(), h(a(K), {
|
|
2047
2052
|
key: n.options?.switch?.activeValue,
|
|
@@ -2063,9 +2068,9 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
2063
2068
|
clearable: "",
|
|
2064
2069
|
disabled: n.disabled?.search,
|
|
2065
2070
|
ref_for: !0
|
|
2066
|
-
}, n.options?.search?.select || n.options?.select,
|
|
2071
|
+
}, n.options?.search?.select || n.options?.select, D(n.options?.search?.select?.on || n.options?.select?.on || {})), {
|
|
2067
2072
|
default: m(() => [
|
|
2068
|
-
(f(!0),
|
|
2073
|
+
(f(!0), b(S, null, L(n.options?.select?.data, (d) => (f(), h(a(K), {
|
|
2069
2074
|
key: d.value,
|
|
2070
2075
|
label: d.label,
|
|
2071
2076
|
value: d.value
|
|
@@ -2078,12 +2083,12 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
2078
2083
|
"onUpdate:modelValue": (d) => a(l).search.form[n.key] = d,
|
|
2079
2084
|
disabled: n.disabled?.search,
|
|
2080
2085
|
ref_for: !0
|
|
2081
|
-
}, n.options?.search?.datetime || n.options?.datetime,
|
|
2086
|
+
}, n.options?.search?.datetime || n.options?.datetime, D(n.options?.search?.datetime?.on || n.options?.datetime?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.type && a(M).customComponent[n.type] ? (f(), h(q(a(M).customComponent[n.type]), v({
|
|
2082
2087
|
key: 4,
|
|
2083
2088
|
modelValue: a(l).search.form[n.key],
|
|
2084
2089
|
"onUpdate:modelValue": (d) => a(l).search.form[n.key] = d,
|
|
2085
2090
|
ref_for: !0
|
|
2086
|
-
}, n.options?.search?.[n.type] || n.options?.[n.type],
|
|
2091
|
+
}, n.options?.search?.[n.type] || n.options?.[n.type], D(n.options?.search?.[n.type]?.on || n.options?.[n.type]?.on || {}), {
|
|
2087
2092
|
disabled: n.disabled?.search
|
|
2088
2093
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : k("", !0)
|
|
2089
2094
|
]),
|
|
@@ -2097,24 +2102,24 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
2097
2102
|
C(p.$slots, "search-center", {
|
|
2098
2103
|
row: a(l).search.form
|
|
2099
2104
|
}),
|
|
2100
|
-
|
|
2105
|
+
i.option.tools?.search || i.option.tools?.reset ? (f(), h(a(G), { key: 0 }, {
|
|
2101
2106
|
default: m(() => [
|
|
2102
|
-
|
|
2107
|
+
i.option.tools?.search ? (f(), h(a(T), {
|
|
2103
2108
|
key: 0,
|
|
2104
2109
|
type: "primary",
|
|
2105
2110
|
onClick: a(l).search.submit
|
|
2106
2111
|
}, {
|
|
2107
2112
|
default: m(() => [
|
|
2108
|
-
$(
|
|
2113
|
+
$(E(a(y).tCurd("search")), 1)
|
|
2109
2114
|
]),
|
|
2110
2115
|
_: 1
|
|
2111
2116
|
}, 8, ["onClick"])) : k("", !0),
|
|
2112
|
-
|
|
2117
|
+
i.option.tools?.reset ? (f(), h(a(T), {
|
|
2113
2118
|
key: 1,
|
|
2114
2119
|
onClick: a(l).search.reset
|
|
2115
2120
|
}, {
|
|
2116
2121
|
default: m(() => [
|
|
2117
|
-
$(
|
|
2122
|
+
$(E(a(y).tCurd("reset")), 1)
|
|
2118
2123
|
]),
|
|
2119
2124
|
_: 1
|
|
2120
2125
|
}, 8, ["onClick"])) : k("", !0)
|
|
@@ -2130,76 +2135,76 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
2130
2135
|
])) : k("", !0),
|
|
2131
2136
|
F("div", tt, [
|
|
2132
2137
|
F("div", ot, [
|
|
2133
|
-
a(
|
|
2138
|
+
a(r)(i.option.tools?.add) ? (f(), b("div", at, [
|
|
2134
2139
|
z(a(T), {
|
|
2135
2140
|
type: "primary",
|
|
2136
2141
|
onClick: c[0] || (c[0] = (n) => a(l).update.open(a(u).Add)),
|
|
2137
|
-
size:
|
|
2142
|
+
size: i.option.size?.search
|
|
2138
2143
|
}, {
|
|
2139
2144
|
default: m(() => [
|
|
2140
|
-
$(
|
|
2145
|
+
$(E(a(y).tCurd("add")), 1)
|
|
2141
2146
|
]),
|
|
2142
2147
|
_: 1
|
|
2143
2148
|
}, 8, ["size"])
|
|
2144
2149
|
])) : k("", !0),
|
|
2145
|
-
|
|
2150
|
+
i.option.table?.selectable && a(r)(i.option.tools?.delete) ? (f(), b("div", lt, [
|
|
2146
2151
|
z(a(T), {
|
|
2147
2152
|
type: "danger",
|
|
2148
2153
|
onClick: c[1] || (c[1] = (n) => a(l).remove.open(a(l).table.selection.list)),
|
|
2149
|
-
size:
|
|
2154
|
+
size: i.option.size?.search
|
|
2150
2155
|
}, {
|
|
2151
2156
|
default: m(() => [
|
|
2152
|
-
$(
|
|
2157
|
+
$(E(a(y).tCurd("delete")), 1)
|
|
2153
2158
|
]),
|
|
2154
2159
|
_: 1
|
|
2155
2160
|
}, 8, ["size"])
|
|
2156
2161
|
])) : k("", !0),
|
|
2157
|
-
|
|
2162
|
+
i.option.tools?.expand ? (f(), b("div", nt, [
|
|
2158
2163
|
z(a(T), {
|
|
2159
2164
|
type: "warning",
|
|
2160
2165
|
onClick: c[2] || (c[2] = (n) => a(l).table.expand.all()),
|
|
2161
|
-
size:
|
|
2166
|
+
size: i.option.size?.search
|
|
2162
2167
|
}, {
|
|
2163
2168
|
default: m(() => [
|
|
2164
|
-
$(
|
|
2169
|
+
$(E(a(y).tCurd("expandCollapse")), 1)
|
|
2165
2170
|
]),
|
|
2166
2171
|
_: 1
|
|
2167
2172
|
}, 8, ["size"])
|
|
2168
2173
|
])) : k("", !0),
|
|
2169
|
-
|
|
2170
|
-
|
|
2174
|
+
i.option.tools?.export?.show ? (f(), b(S, { key: 3 }, [
|
|
2175
|
+
i.option.tools?.export?.dropdown?.show ? (f(), h(a(he), {
|
|
2171
2176
|
key: 0,
|
|
2172
2177
|
onCommand: a(l).export.click
|
|
2173
2178
|
}, {
|
|
2174
2179
|
dropdown: m(() => [
|
|
2175
2180
|
z(a(ye), {
|
|
2176
|
-
size:
|
|
2181
|
+
size: i.option.size?.search
|
|
2177
2182
|
}, {
|
|
2178
2183
|
default: m(() => [
|
|
2179
|
-
|
|
2184
|
+
i.option.tools?.export?.dropdown?.select && (i.option.table?.selectable || a(r)(i.option.tools?.delete)) ? (f(), h(a(_), {
|
|
2180
2185
|
key: 0,
|
|
2181
2186
|
command: "select"
|
|
2182
2187
|
}, {
|
|
2183
2188
|
default: m(() => [
|
|
2184
|
-
$(
|
|
2189
|
+
$(E(a(y).tCurd("exportSelect")), 1)
|
|
2185
2190
|
]),
|
|
2186
2191
|
_: 1
|
|
2187
2192
|
})) : k("", !0),
|
|
2188
|
-
|
|
2193
|
+
i.option.tools?.export?.dropdown?.page ? (f(), h(a(_), {
|
|
2189
2194
|
key: 1,
|
|
2190
2195
|
command: "page"
|
|
2191
2196
|
}, {
|
|
2192
2197
|
default: m(() => [
|
|
2193
|
-
$(
|
|
2198
|
+
$(E(a(y).tCurd("exportPage")), 1)
|
|
2194
2199
|
]),
|
|
2195
2200
|
_: 1
|
|
2196
2201
|
})) : k("", !0),
|
|
2197
|
-
|
|
2202
|
+
i.option.tools?.export?.dropdown?.all ? (f(), h(a(_), {
|
|
2198
2203
|
key: 2,
|
|
2199
2204
|
command: "all"
|
|
2200
2205
|
}, {
|
|
2201
2206
|
default: m(() => [
|
|
2202
|
-
$(
|
|
2207
|
+
$(E(a(y).tCurd("exportAll")), 1)
|
|
2203
2208
|
]),
|
|
2204
2209
|
_: 1
|
|
2205
2210
|
})) : k("", !0)
|
|
@@ -2212,25 +2217,25 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
2212
2217
|
z(a(T), {
|
|
2213
2218
|
type: "warning",
|
|
2214
2219
|
loading: a(l).export.loading,
|
|
2215
|
-
size:
|
|
2220
|
+
size: i.option.size?.search
|
|
2216
2221
|
}, {
|
|
2217
2222
|
default: m(() => [
|
|
2218
|
-
$(
|
|
2223
|
+
$(E(a(y).tCurd("export")), 1)
|
|
2219
2224
|
]),
|
|
2220
2225
|
_: 1
|
|
2221
2226
|
}, 8, ["loading", "size"])
|
|
2222
2227
|
])
|
|
2223
2228
|
]),
|
|
2224
2229
|
_: 1
|
|
2225
|
-
}, 8, ["onCommand"])) : (f(),
|
|
2230
|
+
}, 8, ["onCommand"])) : (f(), b("div", rt, [
|
|
2226
2231
|
z(a(T), {
|
|
2227
2232
|
type: "warning",
|
|
2228
2233
|
loading: a(l).export.loading,
|
|
2229
|
-
size:
|
|
2234
|
+
size: i.option.size?.search,
|
|
2230
2235
|
onClick: c[3] || (c[3] = (n) => a(l).export.run.start("all"))
|
|
2231
2236
|
}, {
|
|
2232
2237
|
default: m(() => [
|
|
2233
|
-
$(
|
|
2238
|
+
$(E(a(y).tCurd("export")), 1)
|
|
2234
2239
|
]),
|
|
2235
2240
|
_: 1
|
|
2236
2241
|
}, 8, ["loading", "size"])
|
|
@@ -2251,13 +2256,13 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
2251
2256
|
"pager-count": a(l).page.pagerCount,
|
|
2252
2257
|
layout: a(l).page.layout,
|
|
2253
2258
|
total: a(l).page.total,
|
|
2254
|
-
size:
|
|
2259
|
+
size: i.option.size?.table,
|
|
2255
2260
|
onSizeChange: a(l).table.getList,
|
|
2256
2261
|
onCurrentChange: a(l).table.getList
|
|
2257
|
-
},
|
|
2258
|
-
|
|
2262
|
+
}, i.option.page?.pagination || {}, D(i.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : k("", !0),
|
|
2263
|
+
i.option.tools?.refresh === void 0 || i.option.tools?.refresh ? (f(), b("div", {
|
|
2259
2264
|
key: 1,
|
|
2260
|
-
class: j(["refresh-btn", [
|
|
2265
|
+
class: j(["refresh-btn", [i.option.size?.search]]),
|
|
2261
2266
|
onClick: c[6] || (c[6] = //@ts-ignore
|
|
2262
2267
|
(...n) => a(l).table.getList && a(l).table.getList(...n))
|
|
2263
2268
|
}, [
|
|
@@ -2266,34 +2271,34 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
2266
2271
|
])
|
|
2267
2272
|
]),
|
|
2268
2273
|
F("div", {
|
|
2269
|
-
class: j(["fit-width relative form-box", [
|
|
2274
|
+
class: j(["fit-width relative form-box", [i.option.table?.fitHeight ? "col " : ""]])
|
|
2270
2275
|
}, [
|
|
2271
2276
|
F("div", {
|
|
2272
|
-
class: j(["column form-box-content", [
|
|
2277
|
+
class: j(["column form-box-content", [i.option.table?.fitHeight ? "absolute fit" : ""]])
|
|
2273
2278
|
}, [
|
|
2274
|
-
ke((f(), h(a(
|
|
2279
|
+
ke((f(), h(a(be), v({
|
|
2275
2280
|
data: a(l).table.data,
|
|
2276
|
-
border:
|
|
2281
|
+
border: i.option.table?.border === void 0 ? !0 : i.option.table?.border,
|
|
2277
2282
|
onSelectionChange: a(l).table.selection.change,
|
|
2278
2283
|
onSortChange: a(l).table.sort.change,
|
|
2279
2284
|
"expand-row-keys": a(l).table.expand.rowKeys,
|
|
2280
2285
|
onExpandChange: a(l).table.expand.change
|
|
2281
|
-
},
|
|
2286
|
+
}, i.option.table, D(i.option.table?.on || {})), {
|
|
2282
2287
|
default: m(() => [
|
|
2283
|
-
|
|
2288
|
+
(typeof i.option.table?.selectable == "object" ? i.option.table?.selectable?.show : i.option.table?.selectable) || a(r)(i.option.tools?.delete) || i.option.tools?.export?.show && i.option.tools?.export?.select ? (f(), h(a(te), v({
|
|
2284
2289
|
key: 0,
|
|
2285
2290
|
type: "selection",
|
|
2286
|
-
selectable: typeof r.option.table?.selectable == "function" ? r.option.table?.selectable : void 0,
|
|
2287
2291
|
width: "40",
|
|
2288
2292
|
align: "center",
|
|
2289
2293
|
fixed: "left",
|
|
2290
|
-
"show-overflow-tooltip": !1
|
|
2291
|
-
|
|
2294
|
+
"show-overflow-tooltip": !1,
|
|
2295
|
+
className: "cc1-form-selectable-column"
|
|
2296
|
+
}, typeof i.option.table?.selectable == "object" ? i.option.table?.selectable : {}, D(typeof i.option.table?.selectable == "object" ? i.option.table?.selectable?.on || {} : {})), null, 16)) : k("", !0),
|
|
2292
2297
|
z(Ge, {
|
|
2293
2298
|
conf: a(l),
|
|
2294
2299
|
columnList: a(l).table.column.list,
|
|
2295
|
-
option:
|
|
2296
|
-
},
|
|
2300
|
+
option: i.option
|
|
2301
|
+
}, oe({ _: 2 }, [
|
|
2297
2302
|
L(p.$slots, (n, d) => ({
|
|
2298
2303
|
name: d,
|
|
2299
2304
|
fn: m((V) => [
|
|
@@ -2301,31 +2306,31 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
2301
2306
|
])
|
|
2302
2307
|
}))
|
|
2303
2308
|
]), 1032, ["conf", "columnList", "option"]),
|
|
2304
|
-
a(
|
|
2309
|
+
a(r)(i.option.table?.add) || a(r)(i.option.table?.update) || a(r)(i.option.table?.delete) || a(r)(i.option.table?.view) || p.$slots["table-op-left"] || p.$slots["table-op-right"] ? (f(), h(a(te), v({
|
|
2305
2310
|
key: 1,
|
|
2306
|
-
width: a(l).table.op.width(a(
|
|
2311
|
+
width: a(l).table.op.width(a(r)(i.option.table?.add), a(r)(i.option.table?.update), a(r)(i.option.table?.delete), a(r)(i.option.table?.view), p.$slots["table-op-left"], p.$slots["table-op-right"]),
|
|
2307
2312
|
align: "center",
|
|
2308
2313
|
fixed: "right"
|
|
2309
|
-
},
|
|
2314
|
+
}, i.option.table?.operate), {
|
|
2310
2315
|
header: m(() => [
|
|
2311
2316
|
C(p.$slots, "table-header-op", {}, () => [
|
|
2312
|
-
$(
|
|
2317
|
+
$(E(a(y).tCurd("operation")), 1)
|
|
2313
2318
|
])
|
|
2314
2319
|
]),
|
|
2315
2320
|
default: m(({ row: n }) => [
|
|
2316
2321
|
z(a(N), {
|
|
2317
|
-
size:
|
|
2322
|
+
size: i.option.size?.table
|
|
2318
2323
|
}, {
|
|
2319
2324
|
default: m(() => [
|
|
2320
2325
|
C(p.$slots, "table-op-left", { row: n }),
|
|
2321
|
-
|
|
2326
|
+
i.option.table?.inlineEdit && a(l).inlineEdit.data === n ? (f(), b(S, { key: 0 }, [
|
|
2322
2327
|
z(a(T), {
|
|
2323
2328
|
link: "",
|
|
2324
2329
|
type: "info",
|
|
2325
2330
|
onClick: a(l).inlineEdit.close
|
|
2326
2331
|
}, {
|
|
2327
2332
|
default: m(() => [
|
|
2328
|
-
$(
|
|
2333
|
+
$(E(a(y).tCurd("cancel")), 1)
|
|
2329
2334
|
]),
|
|
2330
2335
|
_: 1
|
|
2331
2336
|
}, 8, ["onClick"]),
|
|
@@ -2336,53 +2341,53 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
2336
2341
|
loading: a(l).update.loading
|
|
2337
2342
|
}, {
|
|
2338
2343
|
default: m(() => [
|
|
2339
|
-
$(
|
|
2344
|
+
$(E(a(y).tCurd("confirm")), 1)
|
|
2340
2345
|
]),
|
|
2341
2346
|
_: 1
|
|
2342
2347
|
}, 8, ["onClick", "loading"]),
|
|
2343
2348
|
C(p.$slots, "table-op-edit-right", { row: n })
|
|
2344
|
-
], 64)) : (f(),
|
|
2345
|
-
a(
|
|
2349
|
+
], 64)) : (f(), b(S, { key: 1 }, [
|
|
2350
|
+
a(r)(i.option.table?.add, n) ? (f(), h(a(T), {
|
|
2346
2351
|
key: 0,
|
|
2347
2352
|
link: "",
|
|
2348
2353
|
type: "primary",
|
|
2349
2354
|
onClick: (d) => a(l).update.open(a(u).Add, n)
|
|
2350
2355
|
}, {
|
|
2351
2356
|
default: m(() => [
|
|
2352
|
-
$(
|
|
2357
|
+
$(E(a(y).tCurd("add")), 1)
|
|
2353
2358
|
]),
|
|
2354
2359
|
_: 2
|
|
2355
2360
|
}, 1032, ["onClick"])) : k("", !0),
|
|
2356
|
-
a(
|
|
2361
|
+
a(r)(i.option.table?.view, n) ? (f(), h(a(T), {
|
|
2357
2362
|
key: 1,
|
|
2358
2363
|
link: "",
|
|
2359
2364
|
type: "primary",
|
|
2360
2365
|
onClick: (d) => a(l).update.open(a(u).View, n)
|
|
2361
2366
|
}, {
|
|
2362
2367
|
default: m(() => [
|
|
2363
|
-
$(
|
|
2368
|
+
$(E(a(y).tCurd("view")), 1)
|
|
2364
2369
|
]),
|
|
2365
2370
|
_: 2
|
|
2366
2371
|
}, 1032, ["onClick"])) : k("", !0),
|
|
2367
|
-
a(
|
|
2372
|
+
a(r)(i.option.table?.update, n) ? (f(), h(a(T), {
|
|
2368
2373
|
key: 2,
|
|
2369
2374
|
link: "",
|
|
2370
2375
|
type: "warning",
|
|
2371
2376
|
onClick: (d) => a(l).update.open(a(u).Update, n)
|
|
2372
2377
|
}, {
|
|
2373
2378
|
default: m(() => [
|
|
2374
|
-
$(
|
|
2379
|
+
$(E(a(y).tCurd("edit")), 1)
|
|
2375
2380
|
]),
|
|
2376
2381
|
_: 2
|
|
2377
2382
|
}, 1032, ["onClick"])) : k("", !0),
|
|
2378
|
-
a(
|
|
2383
|
+
a(r)(i.option.table?.delete, n) ? (f(), h(a(T), {
|
|
2379
2384
|
key: 3,
|
|
2380
2385
|
link: "",
|
|
2381
2386
|
type: "danger",
|
|
2382
2387
|
onClick: (d) => a(l).remove.open([n])
|
|
2383
2388
|
}, {
|
|
2384
2389
|
default: m(() => [
|
|
2385
|
-
$(
|
|
2390
|
+
$(E(a(y).tCurd("delete")), 1)
|
|
2386
2391
|
]),
|
|
2387
2392
|
_: 2
|
|
2388
2393
|
}, 1032, ["onClick"])) : k("", !0),
|
|
@@ -2397,12 +2402,12 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
2397
2402
|
]),
|
|
2398
2403
|
_: 3
|
|
2399
2404
|
}, 16, ["data", "border", "onSelectionChange", "onSortChange", "expand-row-keys", "onExpandChange"])), [
|
|
2400
|
-
[
|
|
2405
|
+
[g, a(l).table.loading]
|
|
2401
2406
|
])
|
|
2402
2407
|
], 2)
|
|
2403
2408
|
], 2),
|
|
2404
2409
|
F("div", dt, [
|
|
2405
|
-
(
|
|
2410
|
+
(i.option.page?.show === void 0 || i.option.page?.show) && !a(l).page.showTools ? (f(), h(a(ie), v({
|
|
2406
2411
|
key: 0,
|
|
2407
2412
|
"current-page": a(l).page.num,
|
|
2408
2413
|
"onUpdate:currentPage": c[7] || (c[7] = (n) => a(l).page.num = n),
|
|
@@ -2413,31 +2418,31 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
2413
2418
|
"pager-count": a(l).page.pagerCount,
|
|
2414
2419
|
layout: a(l).page.layout,
|
|
2415
2420
|
total: a(l).page.total,
|
|
2416
|
-
size:
|
|
2421
|
+
size: i.option.size?.table,
|
|
2417
2422
|
onSizeChange: a(l).table.getList,
|
|
2418
2423
|
onCurrentChange: a(l).table.getList
|
|
2419
|
-
},
|
|
2424
|
+
}, i.option.page?.pagination || {}, D(i.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : k("", !0)
|
|
2420
2425
|
])
|
|
2421
2426
|
], 2),
|
|
2422
2427
|
C(p.$slots, "box-right")
|
|
2423
2428
|
], 2),
|
|
2424
|
-
z(a(
|
|
2429
|
+
z(a(ee), v({
|
|
2425
2430
|
modelValue: a(l).update.show,
|
|
2426
2431
|
"onUpdate:modelValue": c[9] || (c[9] = (n) => a(l).update.show = n),
|
|
2427
2432
|
title: a(l).update.title,
|
|
2428
2433
|
"before-close": a(l).update.close
|
|
2429
|
-
},
|
|
2434
|
+
}, i.option.dialog), {
|
|
2430
2435
|
footer: m(() => [
|
|
2431
2436
|
F("span", ut, [
|
|
2432
2437
|
z(a(N), {
|
|
2433
|
-
size:
|
|
2438
|
+
size: i.option.size?.form
|
|
2434
2439
|
}, {
|
|
2435
2440
|
default: m(() => [
|
|
2436
2441
|
z(a(T), {
|
|
2437
2442
|
onClick: a(l).update.close
|
|
2438
2443
|
}, {
|
|
2439
2444
|
default: m(() => [
|
|
2440
|
-
$(
|
|
2445
|
+
$(E(a(y).tCurd("close")), 1)
|
|
2441
2446
|
]),
|
|
2442
2447
|
_: 1
|
|
2443
2448
|
}, 8, ["onClick"]),
|
|
@@ -2448,7 +2453,7 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
2448
2453
|
loading: a(l).update.loading
|
|
2449
2454
|
}, {
|
|
2450
2455
|
default: m(() => [
|
|
2451
|
-
$(
|
|
2456
|
+
$(E(a(y).tCurd("submit")), 1)
|
|
2452
2457
|
]),
|
|
2453
2458
|
_: 1
|
|
2454
2459
|
}, 8, ["onClick", "loading"])) : k("", !0)
|
|
@@ -2463,11 +2468,11 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
2463
2468
|
ref: s,
|
|
2464
2469
|
model: a(l).update.form,
|
|
2465
2470
|
rules: a(l).update.rules,
|
|
2466
|
-
size:
|
|
2471
|
+
size: i.option.size?.form
|
|
2467
2472
|
}, {
|
|
2468
2473
|
default: m(() => [
|
|
2469
|
-
a(l).update.showContent ? (f(!0),
|
|
2470
|
-
a(
|
|
2474
|
+
a(l).update.showContent ? (f(!0), b(S, { key: 0 }, L(a(l).update.formColumn, (n) => (f(), b(S, null, [
|
|
2475
|
+
a(r)(
|
|
2471
2476
|
(() => {
|
|
2472
2477
|
const d = [], V = (w) => {
|
|
2473
2478
|
w?.item?.children ? V(w.item.children) : d.push(...w.map((A) => A.item?.show?.form));
|
|
@@ -2476,25 +2481,25 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
2476
2481
|
})(),
|
|
2477
2482
|
a(l).update.form,
|
|
2478
2483
|
a(l).update.type
|
|
2479
|
-
) ? (f(),
|
|
2484
|
+
) ? (f(), b("div", {
|
|
2480
2485
|
key: 0,
|
|
2481
2486
|
class: j(["row curd-row", {
|
|
2482
|
-
stripe:
|
|
2487
|
+
stripe: i.option.form?.stripe === void 0 ? !0 : i.option.form?.stripe
|
|
2483
2488
|
}])
|
|
2484
2489
|
}, [
|
|
2485
2490
|
C(p.$slots, "form-start", {
|
|
2486
2491
|
row: a(l).update.form
|
|
2487
2492
|
}),
|
|
2488
|
-
(f(!0),
|
|
2489
|
-
a(
|
|
2493
|
+
(f(!0), b(S, null, L(n, (d) => (f(), b(S, null, [
|
|
2494
|
+
a(r)(d.item.show?.form, a(l).update.form, a(l).update.type) ? (f(), b("div", {
|
|
2490
2495
|
key: 0,
|
|
2491
2496
|
class: j([d.item.form.span > 0 ? `col-${a(l).getColumnSpan(d, n)}` : "col", `form-item-col-${d.item.key}`])
|
|
2492
2497
|
}, [
|
|
2493
|
-
(f(!0),
|
|
2498
|
+
(f(!0), b(S, null, L(d.item.children ? d.children : [d], (V) => (f(), h(_e, {
|
|
2494
2499
|
key: V.item.key,
|
|
2495
2500
|
conf: a(l),
|
|
2496
2501
|
item: V
|
|
2497
|
-
},
|
|
2502
|
+
}, oe({ _: 2 }, [
|
|
2498
2503
|
L(p.$slots, (w, A) => ({
|
|
2499
2504
|
name: A,
|
|
2500
2505
|
fn: m((B) => [
|
|
@@ -2515,7 +2520,7 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
2515
2520
|
]),
|
|
2516
2521
|
_: 3
|
|
2517
2522
|
}, 16, ["modelValue", "title", "before-close"]),
|
|
2518
|
-
z(a(
|
|
2523
|
+
z(a(ee), {
|
|
2519
2524
|
modelValue: a(l).remove.show,
|
|
2520
2525
|
"onUpdate:modelValue": c[10] || (c[10] = (n) => a(l).remove.show = n),
|
|
2521
2526
|
title: a(l).remove.title,
|
|
@@ -2524,14 +2529,14 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
2524
2529
|
footer: m(() => [
|
|
2525
2530
|
F("span", ft, [
|
|
2526
2531
|
z(a(N), {
|
|
2527
|
-
size:
|
|
2532
|
+
size: i.option.size?.form
|
|
2528
2533
|
}, {
|
|
2529
2534
|
default: m(() => [
|
|
2530
2535
|
z(a(T), {
|
|
2531
2536
|
onClick: a(l).remove.close
|
|
2532
2537
|
}, {
|
|
2533
2538
|
default: m(() => [
|
|
2534
|
-
$(
|
|
2539
|
+
$(E(a(y).tCurd("close")), 1)
|
|
2535
2540
|
]),
|
|
2536
2541
|
_: 1
|
|
2537
2542
|
}, 8, ["onClick"]),
|
|
@@ -2541,7 +2546,7 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
2541
2546
|
loading: a(l).remove.loading
|
|
2542
2547
|
}, {
|
|
2543
2548
|
default: m(() => [
|
|
2544
|
-
$(
|
|
2549
|
+
$(E(a(y).tCurd("confirmDelete")), 1)
|
|
2545
2550
|
]),
|
|
2546
2551
|
_: 1
|
|
2547
2552
|
}, 8, ["onClick", "loading"])
|
|
@@ -2551,20 +2556,20 @@ const Je = /* @__PURE__ */ pe(Ne, [["render", He]]), We = { class: "row flex-cen
|
|
|
2551
2556
|
])
|
|
2552
2557
|
]),
|
|
2553
2558
|
default: m(() => [
|
|
2554
|
-
F("div", null,
|
|
2559
|
+
F("div", null, E(a(y).tCurd("confirmDeleteMessage", a(l).remove.items.length)), 1)
|
|
2555
2560
|
]),
|
|
2556
2561
|
_: 1
|
|
2557
2562
|
}, 8, ["modelValue", "title"]),
|
|
2558
2563
|
z(Be, {
|
|
2559
2564
|
ref_key: "switchConfirmRef",
|
|
2560
2565
|
ref: e,
|
|
2561
|
-
size:
|
|
2566
|
+
size: i.option.size?.form
|
|
2562
2567
|
}, null, 8, ["size"])
|
|
2563
2568
|
], 2);
|
|
2564
2569
|
};
|
|
2565
2570
|
}
|
|
2566
2571
|
});
|
|
2567
|
-
class
|
|
2572
|
+
class bt {
|
|
2568
2573
|
/**
|
|
2569
2574
|
* 通过远程 URL 下载文件,自动创建临时 `<a>` 标签触发浏览器下载
|
|
2570
2575
|
*
|
|
@@ -2581,8 +2586,8 @@ class gt {
|
|
|
2581
2586
|
* @param name
|
|
2582
2587
|
*/
|
|
2583
2588
|
static exportJSONFile = (o, u) => {
|
|
2584
|
-
const t = new Blob([JSON.stringify(o)], { type: "application/json" }),
|
|
2585
|
-
l.href =
|
|
2589
|
+
const t = new Blob([JSON.stringify(o)], { type: "application/json" }), r = URL.createObjectURL(t), l = document.createElement("a");
|
|
2590
|
+
l.href = r, l.download = `${u || "config"}.json`, l.click();
|
|
2586
2591
|
};
|
|
2587
2592
|
/**
|
|
2588
2593
|
* 导入文件内容,默认为json
|
|
@@ -2590,32 +2595,32 @@ class gt {
|
|
|
2590
2595
|
* @returns
|
|
2591
2596
|
*/
|
|
2592
2597
|
static importFile = async (o) => new Promise((u, t) => {
|
|
2593
|
-
const
|
|
2594
|
-
|
|
2598
|
+
const r = document.createElement("input");
|
|
2599
|
+
r.type = "file";
|
|
2595
2600
|
const l = o?.accept || ".json";
|
|
2596
|
-
|
|
2601
|
+
r.accept = l, r.style.display = "none", r.onchange = (e) => {
|
|
2597
2602
|
const s = e.target.files[0];
|
|
2598
2603
|
if (!s) {
|
|
2599
|
-
|
|
2604
|
+
U.fail("未选择文件"), t("未选择文件");
|
|
2600
2605
|
return;
|
|
2601
2606
|
}
|
|
2602
2607
|
const p = new FileReader();
|
|
2603
2608
|
p.onload = async (c) => {
|
|
2604
|
-
const
|
|
2605
|
-
u(
|
|
2609
|
+
const g = l == ".json" ? JSON.parse(c.target.result) : c.target.result;
|
|
2610
|
+
u(g);
|
|
2606
2611
|
}, p.onerror = () => {
|
|
2607
|
-
|
|
2608
|
-
}, p.readAsText(s), document.body.removeChild(
|
|
2609
|
-
}, document.body.appendChild(
|
|
2612
|
+
U.fail("文件读取失败"), t("文件读取失败");
|
|
2613
|
+
}, p.readAsText(s), document.body.removeChild(r);
|
|
2614
|
+
}, document.body.appendChild(r), r.click();
|
|
2610
2615
|
});
|
|
2611
2616
|
}
|
|
2612
|
-
const ct = (
|
|
2613
|
-
if (
|
|
2617
|
+
const ct = (i, o) => {
|
|
2618
|
+
if (i.component("TCurd", pt), i.component("TFormList", ne), i.component("TColumn", Ae), o?.customComponent) {
|
|
2614
2619
|
M.customComponent = o.customComponent;
|
|
2615
2620
|
for (const u in o.customComponent)
|
|
2616
|
-
|
|
2621
|
+
i.component(u, o.customComponent[u]);
|
|
2617
2622
|
}
|
|
2618
|
-
},
|
|
2623
|
+
}, gt = {
|
|
2619
2624
|
install: ct
|
|
2620
2625
|
};
|
|
2621
2626
|
export {
|
|
@@ -2623,12 +2628,12 @@ export {
|
|
|
2623
2628
|
Te as ExcelUtil,
|
|
2624
2629
|
Ae as TColumn,
|
|
2625
2630
|
pt as TCurd,
|
|
2626
|
-
|
|
2631
|
+
bt as TFile,
|
|
2627
2632
|
M as TForm,
|
|
2628
2633
|
O as TFormConfig,
|
|
2629
2634
|
y as TFormI18n,
|
|
2630
2635
|
ne as TFormList,
|
|
2631
|
-
|
|
2632
|
-
|
|
2636
|
+
U as TSys,
|
|
2637
|
+
gt as default,
|
|
2633
2638
|
ct as install
|
|
2634
2639
|
};
|