cc1-form 1.4.3 → 1.4.5
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 +877 -880
- package/dist/cc1-form.umd.cjs +1 -1
- package/dist/components/TCurd/com/form/column.vue.d.ts +24 -0
- package/dist/components/TCurd/com/form/field.vue.d.ts +14 -11
- package/dist/components/TCurd/core/table.d.ts +3 -2
- package/dist/components/TCurd/index.d.ts +40 -2
- package/dist/components/TCurd/index.vue.d.ts +134 -22
- package/dist/components/TCurd/indexType.d.ts +10 -0
- package/dist/utils/TFormConfig.d.ts +1 -0
- package/package.json +1 -1
package/dist/cc1-form.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ElMessage as
|
|
1
|
+
import { ElMessage as lt, ElLoading as rt, ElFormItem as ge, ElInput as ue, ElInputNumber as it, ElSwitch as be, ElSelect as fe, ElOption as ne, ElRadioGroup as Te, ElRadioButton as je, ElRadio as Pe, ElCheckboxGroup as st, ElCheckboxButton as dt, ElCheckbox as ut, ElColorPicker as ft, ElSlider as ct, ElTreeSelect as pt, ElDatePicker as Ke, ElTooltip as mt, ElForm as oe, ElDialog as $e, ElButton as L, ElTableColumn as de, ElDropdown as bt, ElDropdownMenu as gt, ElDropdownItem as ze, ElPagination as Ae, ElTable as ht } from "element-plus";
|
|
2
2
|
import "vue-router";
|
|
3
|
-
import { defineComponent as Q, reactive as ie, onMounted as
|
|
3
|
+
import { defineComponent as Q, reactive as ie, onMounted as He, resolveComponent as ce, openBlock as b, createElementBlock as v, renderSlot as $, createVNode as O, withCtx as y, createTextVNode as M, createCommentVNode as S, Fragment as A, renderList as I, createBlock as h, normalizeClass as J, normalizeStyle as he, createElementVNode as F, ref as Y, watch as Ne, nextTick as ve, unref as i, mergeProps as V, toHandlers as z, createSlots as Z, toDisplayString as R, resolveDynamicComponent as ee, computed as ae, onUnmounted as Ie, normalizeProps as Me, guardReactiveProps as Oe, getCurrentInstance as Ge, onBeforeUnmount as yt, withModifiers as wt, resolveDirective as kt, withDirectives as vt } from "vue";
|
|
4
4
|
import { Scope as Fe } from "cc1-vue3";
|
|
5
5
|
class E {
|
|
6
6
|
/**
|
|
@@ -83,7 +83,7 @@ class E {
|
|
|
83
83
|
},
|
|
84
84
|
r
|
|
85
85
|
);
|
|
86
|
-
|
|
86
|
+
lt(e), setTimeout(() => {
|
|
87
87
|
delete this.tipMessages[o];
|
|
88
88
|
}, this.tipMessagesGap);
|
|
89
89
|
}
|
|
@@ -113,7 +113,7 @@ class E {
|
|
|
113
113
|
*/
|
|
114
114
|
static loading = (o = !0, s = "Loading...") => {
|
|
115
115
|
Timer.un(this.loadingTimer), this.loadingTimer = Timer.once(() => {
|
|
116
|
-
o ? this.loadingObj =
|
|
116
|
+
o ? this.loadingObj = rt.service({
|
|
117
117
|
lock: !0,
|
|
118
118
|
text: s,
|
|
119
119
|
background: "rgba(0, 0, 0, 0.3)"
|
|
@@ -155,12 +155,12 @@ class E {
|
|
|
155
155
|
windowHeight: o.windowHeight,
|
|
156
156
|
useCORS: !0,
|
|
157
157
|
backgroundColor: "#ffffff00"
|
|
158
|
-
}).then(function(
|
|
159
|
-
let
|
|
160
|
-
s(
|
|
158
|
+
}).then(function(l) {
|
|
159
|
+
let n = l.toDataURL("image/png");
|
|
160
|
+
s(n);
|
|
161
161
|
});
|
|
162
|
-
} catch (
|
|
163
|
-
r(
|
|
162
|
+
} catch (l) {
|
|
163
|
+
r(l);
|
|
164
164
|
}
|
|
165
165
|
});
|
|
166
166
|
}
|
|
@@ -402,6 +402,7 @@ class B {
|
|
|
402
402
|
scroll: !1,
|
|
403
403
|
field: "sortNo",
|
|
404
404
|
rule: "index",
|
|
405
|
+
order: "asc",
|
|
405
406
|
api: {}
|
|
406
407
|
}
|
|
407
408
|
},
|
|
@@ -565,7 +566,7 @@ class q {
|
|
|
565
566
|
* @returns 该字段对应类型的 options 配置,如 select 类型返回 `options.select`
|
|
566
567
|
*/
|
|
567
568
|
static findOptions = (o, s) => {
|
|
568
|
-
const r = o.column.find((e) => e.key === s), t = (e) => e.replace(/-([a-z])/g, (
|
|
569
|
+
const r = o.column.find((e) => e.key === s), t = (e) => e.replace(/-([a-z])/g, (l, n) => n.toUpperCase());
|
|
569
570
|
if (r)
|
|
570
571
|
return r.options[t(r.type)];
|
|
571
572
|
};
|
|
@@ -619,9 +620,9 @@ class X {
|
|
|
619
620
|
s[o] || (s[o] = []);
|
|
620
621
|
const t = B.config.table.rowKey;
|
|
621
622
|
s[o].forEach((e) => {
|
|
622
|
-
r.forEach((
|
|
623
|
-
let
|
|
624
|
-
|
|
623
|
+
r.forEach((l) => {
|
|
624
|
+
let n = l.default ?? "";
|
|
625
|
+
l.type === "number" && (n = l.default ?? 0), l.type === "boolean" && (n = l.default ?? !1), l.type === "time" && (n = l.default ?? /* @__PURE__ */ new Date()), e[l.value] === void 0 && (e[l.value] = n);
|
|
625
626
|
}), e[t] || (e[t] = X.getIdFun());
|
|
626
627
|
});
|
|
627
628
|
};
|
|
@@ -635,14 +636,14 @@ class X {
|
|
|
635
636
|
static add = (o, s, r, t) => {
|
|
636
637
|
const e = JSONUtil.cp(r);
|
|
637
638
|
X.setId(o, s, r);
|
|
638
|
-
const
|
|
639
|
+
const l = B.config.table.rowKey;
|
|
639
640
|
s[o].push(
|
|
640
641
|
e.reduce(
|
|
641
|
-
(
|
|
642
|
+
(n, u) => {
|
|
642
643
|
let f = u.default ?? "";
|
|
643
|
-
return u.type === "number" && (f = u.default ?? 0), u.type === "boolean" && (f = u.default ?? !1), u.type === "time" && (f = u.default ?? /* @__PURE__ */ new Date()),
|
|
644
|
+
return u.type === "number" && (f = u.default ?? 0), u.type === "boolean" && (f = u.default ?? !1), u.type === "time" && (f = u.default ?? /* @__PURE__ */ new Date()), n[u.value] = f, n;
|
|
644
645
|
},
|
|
645
|
-
{ [
|
|
646
|
+
{ [l]: X.getIdFun() }
|
|
646
647
|
)
|
|
647
648
|
), t?.(s);
|
|
648
649
|
};
|
|
@@ -655,7 +656,7 @@ class X {
|
|
|
655
656
|
*/
|
|
656
657
|
static remove = (o, s, r, t) => {
|
|
657
658
|
const e = B.config.table.rowKey;
|
|
658
|
-
s[o] = s[o].filter((
|
|
659
|
+
s[o] = s[o].filter((l) => l[e] !== r[e]), t?.(s);
|
|
659
660
|
};
|
|
660
661
|
/**
|
|
661
662
|
* 获取没有id的数据
|
|
@@ -670,14 +671,14 @@ class X {
|
|
|
670
671
|
}), r;
|
|
671
672
|
};
|
|
672
673
|
}
|
|
673
|
-
const
|
|
674
|
+
const Ct = {
|
|
674
675
|
key: 0,
|
|
675
676
|
class: "column curd-form-com-list",
|
|
676
677
|
style: { width: "100%", gap: "10px" }
|
|
677
|
-
},
|
|
678
|
+
}, Vt = { key: 0 }, St = {
|
|
678
679
|
class: "row items-center",
|
|
679
680
|
style: { gap: "10px", width: "100%" }
|
|
680
|
-
},
|
|
681
|
+
}, Et = { key: 1 }, We = /* @__PURE__ */ Q({
|
|
681
682
|
__name: "list",
|
|
682
683
|
props: {
|
|
683
684
|
row: {
|
|
@@ -718,85 +719,103 @@ const kt = {
|
|
|
718
719
|
setup(a, { emit: o }) {
|
|
719
720
|
const s = a, r = ie({
|
|
720
721
|
show: !1,
|
|
721
|
-
add: (e,
|
|
722
|
-
X.add(e,
|
|
722
|
+
add: (e, l, n) => {
|
|
723
|
+
X.add(e, l, n, () => {
|
|
723
724
|
t("change");
|
|
724
725
|
});
|
|
725
726
|
},
|
|
726
|
-
remove: (e,
|
|
727
|
-
X.remove(e,
|
|
727
|
+
remove: (e, l, n) => {
|
|
728
|
+
X.remove(e, l, n, () => {
|
|
728
729
|
t("change");
|
|
729
730
|
});
|
|
730
731
|
}
|
|
731
732
|
});
|
|
732
|
-
|
|
733
|
+
He(() => {
|
|
733
734
|
X.setId(s.field, s.row, s.itemFields), r.show = !0;
|
|
734
735
|
});
|
|
735
736
|
const t = o;
|
|
736
|
-
return (e,
|
|
737
|
-
const
|
|
738
|
-
return r.show ? (b(),
|
|
737
|
+
return (e, l) => {
|
|
738
|
+
const n = ce("el-button"), u = ce("el-input");
|
|
739
|
+
return r.show ? (b(), v("div", Ct, [
|
|
739
740
|
$(e.$slots, "list-start", { row: a.row }),
|
|
740
|
-
a.addBottom ?
|
|
741
|
-
|
|
741
|
+
a.addBottom ? S("", !0) : (b(), v("div", Vt, [
|
|
742
|
+
O(n, {
|
|
742
743
|
link: "",
|
|
743
744
|
type: "primary",
|
|
744
|
-
onClick:
|
|
745
|
+
onClick: l[0] || (l[0] = (f) => r.add(a.field, a.row, a.itemFields))
|
|
745
746
|
}, {
|
|
746
|
-
default: y(() =>
|
|
747
|
-
|
|
747
|
+
default: y(() => l[3] || (l[3] = [
|
|
748
|
+
M("添加")
|
|
748
749
|
])),
|
|
749
750
|
_: 1
|
|
750
751
|
})
|
|
751
752
|
])),
|
|
752
|
-
(b(!0),
|
|
753
|
+
(b(!0), v(A, null, I(a.row[a.field], (f) => (b(), v("div", St, [
|
|
753
754
|
$(e.$slots, "item-start", {
|
|
754
755
|
item: f,
|
|
755
756
|
row: a.row
|
|
756
757
|
}),
|
|
757
|
-
(b(!0),
|
|
758
|
+
(b(!0), v(A, null, I(a.itemFields, (d) => (b(), h(u, {
|
|
758
759
|
modelValue: f[d.value],
|
|
759
760
|
"onUpdate:modelValue": (m) => f[d.value] = m,
|
|
760
|
-
style:
|
|
761
|
+
style: he({ width: a.inputWidth }),
|
|
761
762
|
class: J(a.inputClass),
|
|
762
763
|
placeholder: d[a.label] || d[a.value],
|
|
763
|
-
onChange:
|
|
764
|
+
onChange: l[1] || (l[1] = (m) => t("change"))
|
|
764
765
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "style", "class", "placeholder"]))), 256)),
|
|
765
766
|
$(e.$slots, "item-end", {
|
|
766
767
|
item: f,
|
|
767
768
|
row: a.row
|
|
768
769
|
}),
|
|
769
|
-
|
|
770
|
+
O(n, {
|
|
770
771
|
link: "",
|
|
771
772
|
type: "danger",
|
|
772
773
|
onClick: (d) => r.remove(a.field, a.row, f)
|
|
773
774
|
}, {
|
|
774
|
-
default: y(() =>
|
|
775
|
-
|
|
775
|
+
default: y(() => l[4] || (l[4] = [
|
|
776
|
+
M("删除")
|
|
776
777
|
])),
|
|
777
778
|
_: 2
|
|
778
779
|
}, 1032, ["onClick"])
|
|
779
780
|
]))), 256)),
|
|
780
|
-
a.addBottom ? (b(),
|
|
781
|
-
|
|
781
|
+
a.addBottom ? (b(), v("div", Et, [
|
|
782
|
+
O(n, {
|
|
782
783
|
link: "",
|
|
783
784
|
type: "primary",
|
|
784
|
-
onClick:
|
|
785
|
+
onClick: l[2] || (l[2] = (f) => r.add(a.field, a.row, a.itemFields))
|
|
785
786
|
}, {
|
|
786
|
-
default: y(() =>
|
|
787
|
-
|
|
787
|
+
default: y(() => l[5] || (l[5] = [
|
|
788
|
+
M("添加")
|
|
788
789
|
])),
|
|
789
790
|
_: 1
|
|
790
791
|
})
|
|
791
|
-
])) :
|
|
792
|
+
])) : S("", !0),
|
|
792
793
|
$(e.$slots, "list-end", { row: a.row })
|
|
793
|
-
])) :
|
|
794
|
+
])) : S("", !0);
|
|
794
795
|
};
|
|
795
796
|
}
|
|
796
|
-
}),
|
|
797
|
+
}), se = (a, o) => {
|
|
798
|
+
const s = a.__vccOpts || a;
|
|
799
|
+
for (const [r, t] of o)
|
|
800
|
+
s[r] = t;
|
|
801
|
+
return s;
|
|
802
|
+
}, zt = {}, $t = {
|
|
803
|
+
"data-v-58697b5c": "",
|
|
804
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
805
|
+
viewBox: "0 0 1024 1024"
|
|
806
|
+
};
|
|
807
|
+
function Mt(a, o) {
|
|
808
|
+
return b(), v("svg", $t, o[0] || (o[0] = [
|
|
809
|
+
F("path", {
|
|
810
|
+
fill: "currentColor",
|
|
811
|
+
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"
|
|
812
|
+
}, null, -1)
|
|
813
|
+
]));
|
|
814
|
+
}
|
|
815
|
+
const De = /* @__PURE__ */ se(zt, [["render", Mt]]), Ot = { class: "form-item-label-tooltip" }, Ft = ["innerHTML"], Rt = {
|
|
797
816
|
class: "row form-item-content",
|
|
798
817
|
style: { width: "100%" }
|
|
799
|
-
},
|
|
818
|
+
}, Dt = { class: "col column form-item-content-item" }, Ut = { class: "col" }, At = ["innerHTML"], Bt = /* @__PURE__ */ Q({
|
|
800
819
|
__name: "field",
|
|
801
820
|
props: {
|
|
802
821
|
item: {},
|
|
@@ -814,160 +833,179 @@ const kt = {
|
|
|
814
833
|
}, t = () => {
|
|
815
834
|
r() === "error" && s.value?.clearValidate?.();
|
|
816
835
|
};
|
|
817
|
-
return
|
|
836
|
+
return Ne(
|
|
818
837
|
() => o.form?.[o.item.key],
|
|
819
838
|
() => {
|
|
820
|
-
t(),
|
|
839
|
+
t(), ve(() => t());
|
|
821
840
|
},
|
|
822
841
|
{ deep: !0, flush: "post" }
|
|
823
|
-
), (e,
|
|
842
|
+
), (e, l) => (b(), h(i(ge), {
|
|
824
843
|
ref_key: "formItemRef",
|
|
825
844
|
ref: s,
|
|
826
|
-
label: e.item.text?.form?.label ?? e.item.label,
|
|
827
845
|
prop: e.item.key,
|
|
828
846
|
"label-width": e.item.text?.form?.label == "" ? 0 : e.item.form?.labelWidth || e.labelWidth
|
|
829
847
|
}, {
|
|
848
|
+
label: y(() => [
|
|
849
|
+
e.item.text?.form?.tip ?? e.item.tip ? (b(), h(i(mt), {
|
|
850
|
+
key: 0,
|
|
851
|
+
effect: "dark",
|
|
852
|
+
placement: "top"
|
|
853
|
+
}, {
|
|
854
|
+
content: y(() => [
|
|
855
|
+
F("div", {
|
|
856
|
+
innerHTML: e.item.text?.form?.tip ?? e.item.tip
|
|
857
|
+
}, null, 8, Ft)
|
|
858
|
+
]),
|
|
859
|
+
default: y(() => [
|
|
860
|
+
F("span", Ot, [
|
|
861
|
+
O(De)
|
|
862
|
+
])
|
|
863
|
+
]),
|
|
864
|
+
_: 1
|
|
865
|
+
})) : S("", !0),
|
|
866
|
+
M(" " + R(e.item.text?.form?.label ?? e.item.label), 1)
|
|
867
|
+
]),
|
|
830
868
|
default: y(() => [
|
|
831
|
-
|
|
869
|
+
F("div", Rt, [
|
|
832
870
|
$(e.$slots, "form-" + e.item.key + "-start", {
|
|
833
871
|
row: e.form,
|
|
834
872
|
item: e.item
|
|
835
873
|
}),
|
|
836
|
-
|
|
837
|
-
|
|
874
|
+
F("div", Dt, [
|
|
875
|
+
F("div", Ut, [
|
|
838
876
|
$(e.$slots, "form-" + e.item.key, {
|
|
839
877
|
row: e.form,
|
|
840
878
|
item: e.item
|
|
841
879
|
}, () => [
|
|
842
|
-
e.item.type === "input" ? (b(), h(i(
|
|
880
|
+
e.item.type === "input" ? (b(), h(i(ue), V({
|
|
843
881
|
key: 0,
|
|
844
882
|
modelValue: e.form[e.item.key],
|
|
845
|
-
"onUpdate:modelValue":
|
|
883
|
+
"onUpdate:modelValue": l[0] || (l[0] = (n) => e.form[e.item.key] = n)
|
|
846
884
|
}, e.getBind(e.item), z(e.getOn(e.item)), {
|
|
847
885
|
disabled: e.getDisabled(e.item)
|
|
848
886
|
}), Z({ _: 2 }, [
|
|
849
887
|
e.getBind(e.item).prepend ? {
|
|
850
888
|
name: "prepend",
|
|
851
889
|
fn: y(() => [
|
|
852
|
-
|
|
890
|
+
M(R(typeof e.getBind(e.item).prepend == "function" ? e.getBind(e.item).prepend(e.form) : e.getBind(e.item).prepend), 1)
|
|
853
891
|
]),
|
|
854
892
|
key: "0"
|
|
855
893
|
} : void 0
|
|
856
|
-
]), 1040, ["modelValue", "disabled"])) : e.item.type === "number" ? (b(), h(i(
|
|
894
|
+
]), 1040, ["modelValue", "disabled"])) : e.item.type === "number" ? (b(), h(i(it), V({
|
|
857
895
|
key: 1,
|
|
858
896
|
modelValue: e.form[e.item.key],
|
|
859
|
-
"onUpdate:modelValue":
|
|
897
|
+
"onUpdate:modelValue": l[1] || (l[1] = (n) => e.form[e.item.key] = n)
|
|
860
898
|
}, e.getBind(e.item), z(e.getOn(e.item)), {
|
|
861
899
|
disabled: e.getDisabled(e.item)
|
|
862
|
-
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "textarea" ? (b(), h(i(
|
|
900
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "textarea" ? (b(), h(i(ue), V({
|
|
863
901
|
key: 2,
|
|
864
902
|
type: "textarea",
|
|
865
903
|
modelValue: e.form[e.item.key],
|
|
866
|
-
"onUpdate:modelValue":
|
|
904
|
+
"onUpdate:modelValue": l[2] || (l[2] = (n) => e.form[e.item.key] = n)
|
|
867
905
|
}, e.getBind(e.item), z(e.getOn(e.item)), {
|
|
868
906
|
disabled: e.getDisabled(e.item)
|
|
869
|
-
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "switch" ? (b(), h(i(
|
|
907
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "switch" ? (b(), h(i(be), V({
|
|
870
908
|
key: 3,
|
|
871
909
|
modelValue: e.form[e.item.key],
|
|
872
|
-
"onUpdate:modelValue":
|
|
910
|
+
"onUpdate:modelValue": l[3] || (l[3] = (n) => e.form[e.item.key] = n)
|
|
873
911
|
}, e.getBind(e.item), z(e.getOn(e.item)), {
|
|
874
912
|
disabled: e.getDisabled(e.item)
|
|
875
|
-
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "select" ? (b(), h(i(
|
|
913
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "select" ? (b(), h(i(fe), V({
|
|
876
914
|
key: 4,
|
|
877
915
|
modelValue: e.form[e.item.key],
|
|
878
|
-
"onUpdate:modelValue":
|
|
916
|
+
"onUpdate:modelValue": l[4] || (l[4] = (n) => e.form[e.item.key] = n)
|
|
879
917
|
}, e.getBind(e.item), z(e.getOn(e.item)), {
|
|
880
918
|
disabled: e.getDisabled(e.item),
|
|
881
919
|
style: { width: "100%" }
|
|
882
920
|
}), {
|
|
883
921
|
default: y(() => [
|
|
884
|
-
(b(!0),
|
|
885
|
-
key:
|
|
922
|
+
(b(!0), v(A, null, I(e.getBind(e.item).data || [], (n) => (b(), h(i(ne), V({
|
|
923
|
+
key: n.value,
|
|
886
924
|
ref_for: !0
|
|
887
|
-
},
|
|
925
|
+
}, n, z(n.on || {})), null, 16))), 128))
|
|
888
926
|
]),
|
|
889
927
|
_: 1
|
|
890
|
-
}, 16, ["modelValue", "disabled"])) : e.item.type === "radio" ? (b(), h(i(
|
|
928
|
+
}, 16, ["modelValue", "disabled"])) : e.item.type === "radio" ? (b(), h(i(Te), V({
|
|
891
929
|
key: 5,
|
|
892
930
|
modelValue: e.form[e.item.key],
|
|
893
|
-
"onUpdate:modelValue":
|
|
931
|
+
"onUpdate:modelValue": l[5] || (l[5] = (n) => e.form[e.item.key] = n)
|
|
894
932
|
}, e.getBind(e.item), z(e.getOn(e.item)), {
|
|
895
933
|
disabled: e.getDisabled(e.item),
|
|
896
934
|
style: { width: "100%" }
|
|
897
935
|
}), {
|
|
898
936
|
default: y(() => [
|
|
899
|
-
e.getBind(e.item).type === "group" ? (b(!0),
|
|
900
|
-
key:
|
|
937
|
+
e.getBind(e.item).type === "group" ? (b(!0), v(A, { key: 0 }, I(e.getBind(e.item).data || [], (n) => (b(), h(i(je), V({
|
|
938
|
+
key: n.value,
|
|
901
939
|
ref_for: !0
|
|
902
|
-
},
|
|
903
|
-
key:
|
|
940
|
+
}, n, z(n.on || {})), null, 16))), 128)) : (b(!0), v(A, { key: 1 }, I(e.getBind(e.item).data || [], (n) => (b(), h(i(Pe), V({
|
|
941
|
+
key: n.value,
|
|
904
942
|
ref_for: !0
|
|
905
|
-
},
|
|
943
|
+
}, n, z(n.on || {})), null, 16))), 128))
|
|
906
944
|
]),
|
|
907
945
|
_: 1
|
|
908
|
-
}, 16, ["modelValue", "disabled"])) : e.item.type === "checkbox" ? (b(), h(i(
|
|
946
|
+
}, 16, ["modelValue", "disabled"])) : e.item.type === "checkbox" ? (b(), h(i(st), V({
|
|
909
947
|
key: 6,
|
|
910
948
|
modelValue: e.form[e.item.key],
|
|
911
|
-
"onUpdate:modelValue":
|
|
949
|
+
"onUpdate:modelValue": l[6] || (l[6] = (n) => e.form[e.item.key] = n)
|
|
912
950
|
}, e.getBind(e.item), z(e.getOn(e.item)), {
|
|
913
951
|
disabled: e.getDisabled(e.item),
|
|
914
952
|
style: { width: "100%" }
|
|
915
953
|
}), {
|
|
916
954
|
default: y(() => [
|
|
917
|
-
e.getBind(e.item).type === "group" ? (b(!0),
|
|
918
|
-
key:
|
|
955
|
+
e.getBind(e.item).type === "group" ? (b(!0), v(A, { key: 0 }, I(e.getBind(e.item).data || [], (n) => (b(), h(i(dt), V({
|
|
956
|
+
key: n.value,
|
|
919
957
|
ref_for: !0
|
|
920
|
-
},
|
|
921
|
-
key:
|
|
958
|
+
}, n, z(n.on || {})), null, 16))), 128)) : (b(!0), v(A, { key: 1 }, I(e.getBind(e.item).data || [], (n) => (b(), h(i(ut), V({
|
|
959
|
+
key: n.value,
|
|
922
960
|
ref_for: !0
|
|
923
|
-
},
|
|
961
|
+
}, n, z(n.on || {})), null, 16))), 128))
|
|
924
962
|
]),
|
|
925
963
|
_: 1
|
|
926
|
-
}, 16, ["modelValue", "disabled"])) : e.item.type === "color" ? (b(), h(i(
|
|
964
|
+
}, 16, ["modelValue", "disabled"])) : e.item.type === "color" ? (b(), h(i(ft), V({
|
|
927
965
|
key: 7,
|
|
928
966
|
modelValue: e.form[e.item.key],
|
|
929
|
-
"onUpdate:modelValue":
|
|
967
|
+
"onUpdate:modelValue": l[7] || (l[7] = (n) => e.form[e.item.key] = n)
|
|
930
968
|
}, e.getBind(e.item), z(e.getOn(e.item)), {
|
|
931
969
|
disabled: e.getDisabled(e.item)
|
|
932
|
-
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "slider" ? (b(), h(i(
|
|
970
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "slider" ? (b(), h(i(ct), V({
|
|
933
971
|
key: 8,
|
|
934
972
|
modelValue: e.form[e.item.key],
|
|
935
|
-
"onUpdate:modelValue":
|
|
973
|
+
"onUpdate:modelValue": l[8] || (l[8] = (n) => e.form[e.item.key] = n)
|
|
936
974
|
}, e.getBind(e.item), z(e.getOn(e.item)), {
|
|
937
975
|
disabled: e.getDisabled(e.item)
|
|
938
|
-
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "list" ? (b(), h(
|
|
976
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "list" ? (b(), h(We, V({
|
|
939
977
|
key: 9,
|
|
940
978
|
row: e.form,
|
|
941
979
|
field: e.item.key
|
|
942
980
|
}, e.getBind(e.item), z(e.getOn(e.item)), {
|
|
943
981
|
disabled: e.getDisabled(e.item),
|
|
944
982
|
style: { width: "100%" }
|
|
945
|
-
}), null, 16, ["row", "field", "disabled"])) : e.item.type === "treeSelect" ? (b(), h(i(
|
|
983
|
+
}), null, 16, ["row", "field", "disabled"])) : e.item.type === "treeSelect" ? (b(), h(i(pt), V({
|
|
946
984
|
key: 10,
|
|
947
985
|
modelValue: e.form[e.item.key],
|
|
948
|
-
"onUpdate:modelValue":
|
|
986
|
+
"onUpdate:modelValue": l[9] || (l[9] = (n) => e.form[e.item.key] = n)
|
|
949
987
|
}, e.getBind(e.item), z(e.getOn(e.item)), {
|
|
950
988
|
disabled: e.getDisabled(e.item),
|
|
951
989
|
style: { width: "100%" }
|
|
952
|
-
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "datetime" ? (b(), h(i(
|
|
990
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "datetime" ? (b(), h(i(Ke), V({
|
|
953
991
|
key: 11,
|
|
954
992
|
modelValue: e.form[e.item.key],
|
|
955
|
-
"onUpdate:modelValue":
|
|
993
|
+
"onUpdate:modelValue": l[10] || (l[10] = (n) => e.form[e.item.key] = n)
|
|
956
994
|
}, e.getBind(e.item), z(e.getOn(e.item)), {
|
|
957
995
|
disabled: e.getDisabled(e.item)
|
|
958
|
-
}), null, 16, ["modelValue", "disabled"])) : e.item.type && typeof e.item.type == "object" ? (b(), h(ee(e.item.type),
|
|
996
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type && typeof e.item.type == "object" ? (b(), h(ee(e.item.type), V({
|
|
959
997
|
key: 12,
|
|
960
998
|
modelValue: e.form[e.item.key],
|
|
961
|
-
"onUpdate:modelValue":
|
|
999
|
+
"onUpdate:modelValue": l[11] || (l[11] = (n) => e.form[e.item.key] = n)
|
|
962
1000
|
}, e.getBind(e.item), z(e.getOn(e.item)), {
|
|
963
1001
|
disabled: e.getDisabled(e.item)
|
|
964
|
-
}), null, 16, ["modelValue", "disabled"])) : e.item.type && (i(q).customComponent[e.item.type] || i(q).customComponent[e.item.type]?.form) ? (b(), h(ee(i(q).customComponent[e.item.type]?.form || i(q).customComponent[e.item.type]),
|
|
1002
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type && (i(q).customComponent[e.item.type] || i(q).customComponent[e.item.type]?.form) ? (b(), h(ee(i(q).customComponent[e.item.type]?.form || i(q).customComponent[e.item.type]), V({
|
|
965
1003
|
key: 13,
|
|
966
1004
|
modelValue: e.form[e.item.key],
|
|
967
|
-
"onUpdate:modelValue":
|
|
1005
|
+
"onUpdate:modelValue": l[12] || (l[12] = (n) => e.form[e.item.key] = n)
|
|
968
1006
|
}, e.getBind(e.item), z(e.getOn(e.item)), {
|
|
969
1007
|
disabled: e.getDisabled(e.item)
|
|
970
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
1008
|
+
}), null, 16, ["modelValue", "disabled"])) : S("", !0)
|
|
971
1009
|
]),
|
|
972
1010
|
$(e.$slots, "form-" + e.item.key + "-right", {
|
|
973
1011
|
row: e.form,
|
|
@@ -978,11 +1016,11 @@ const kt = {
|
|
|
978
1016
|
row: e.form,
|
|
979
1017
|
item: e.item
|
|
980
1018
|
}, () => [
|
|
981
|
-
e.item.form?.tipText ? (b(),
|
|
1019
|
+
e.item.form?.tipText ? (b(), v("div", {
|
|
982
1020
|
key: 0,
|
|
983
1021
|
class: "form-tip-text",
|
|
984
1022
|
innerHTML: typeof e.item.form?.tipText == "function" ? e.item.form?.tipText(e.form, e.type) : e.item.form?.tipText
|
|
985
|
-
}, null, 8,
|
|
1023
|
+
}, null, 8, At)) : S("", !0)
|
|
986
1024
|
])
|
|
987
1025
|
]),
|
|
988
1026
|
$(e.$slots, "form-" + e.item.key + "-end", {
|
|
@@ -992,10 +1030,10 @@ const kt = {
|
|
|
992
1030
|
])
|
|
993
1031
|
]),
|
|
994
1032
|
_: 3
|
|
995
|
-
}, 8, ["
|
|
1033
|
+
}, 8, ["prop", "label-width"]));
|
|
996
1034
|
}
|
|
997
1035
|
});
|
|
998
|
-
const
|
|
1036
|
+
const Lt = {
|
|
999
1037
|
search: "搜索",
|
|
1000
1038
|
add: "新增",
|
|
1001
1039
|
edit: "编辑",
|
|
@@ -1037,7 +1075,7 @@ const Ft = {
|
|
|
1037
1075
|
sortableExit: "退出排序",
|
|
1038
1076
|
sortableUpdateApiRequired: "未配置排序保存接口"
|
|
1039
1077
|
};
|
|
1040
|
-
class
|
|
1078
|
+
class C {
|
|
1041
1079
|
/** 解析国际化值:函数则执行并返回字符串,字符串则替换 `{key}` 占位符 */
|
|
1042
1080
|
static t(o, ...s) {
|
|
1043
1081
|
if (typeof o == "function")
|
|
@@ -1047,14 +1085,14 @@ class k {
|
|
|
1047
1085
|
return o.replace(/{([^}]+)}/g, (t, e) => r < s.length ? String(s[r++]) : `{${e}}`);
|
|
1048
1086
|
}
|
|
1049
1087
|
static setI18n = (o) => {
|
|
1050
|
-
|
|
1088
|
+
C.curd = ObjectUtil.deepMerge(C.curd, o);
|
|
1051
1089
|
};
|
|
1052
1090
|
/** 解析curd国际化值 */
|
|
1053
1091
|
static tCurd(o, ...s) {
|
|
1054
1092
|
return this.t(this.curd[o], ...s);
|
|
1055
1093
|
}
|
|
1056
1094
|
/** curd表单 */
|
|
1057
|
-
static curd =
|
|
1095
|
+
static curd = Lt;
|
|
1058
1096
|
}
|
|
1059
1097
|
class x {
|
|
1060
1098
|
/**
|
|
@@ -1080,7 +1118,7 @@ class x {
|
|
|
1080
1118
|
});
|
|
1081
1119
|
};
|
|
1082
1120
|
}
|
|
1083
|
-
const
|
|
1121
|
+
const ye = (a) => {
|
|
1084
1122
|
const o = ie({}), s = () => typeof a == "function" ? a() : a, r = () => {
|
|
1085
1123
|
const t = s();
|
|
1086
1124
|
return t ?? o;
|
|
@@ -1101,25 +1139,25 @@ const we = (a) => {
|
|
|
1101
1139
|
x.delAllKey(r());
|
|
1102
1140
|
}
|
|
1103
1141
|
};
|
|
1104
|
-
},
|
|
1142
|
+
}, pe = (a) => {
|
|
1105
1143
|
a.forEach((o) => {
|
|
1106
1144
|
console.error({
|
|
1107
1145
|
field: o.field || "",
|
|
1108
1146
|
error: o.error || ""
|
|
1109
1147
|
});
|
|
1110
1148
|
});
|
|
1111
|
-
},
|
|
1149
|
+
}, Tt = (a) => a ? typeof a == "string" ? a : a instanceof Error ? a.message : a.message || String(a) : "", we = (a) => !a || typeof a != "object" ? [] : Object.keys(a).flatMap((o) => (Array.isArray(a[o]) ? a[o] : [a[o]]).map((r) => ({
|
|
1112
1150
|
field: r?.field || o,
|
|
1113
|
-
error:
|
|
1114
|
-
}))),
|
|
1115
|
-
const r =
|
|
1116
|
-
const
|
|
1117
|
-
if (!
|
|
1118
|
-
await
|
|
1119
|
-
const u = t(
|
|
1120
|
-
if (f.length &&
|
|
1121
|
-
if (!await
|
|
1122
|
-
m ||
|
|
1151
|
+
error: Tt(r)
|
|
1152
|
+
}))), me = E.EDialog, le = (a) => typeof a.type == "object" ? "component" : a.type || "input", jt = (a, o, s) => {
|
|
1153
|
+
const r = ye(() => o.form), t = (l) => Ue(l.update.formGrid || [], l.update.form, l.update.type, l.update.formMaxSpan).map((u) => u.item.key).filter(Boolean), e = async (l) => {
|
|
1154
|
+
const n = s.ruleFormRef.value;
|
|
1155
|
+
if (!n) return !0;
|
|
1156
|
+
await ve();
|
|
1157
|
+
const u = t(l), f = Object.keys(l.update.rules || {}).filter((m) => !u.includes(m));
|
|
1158
|
+
if (f.length && n.clearValidate(f), !u.length) return !0;
|
|
1159
|
+
if (!await n.validateField(u, async (m, c) => {
|
|
1160
|
+
m || pe(we(c));
|
|
1123
1161
|
})) throw !1;
|
|
1124
1162
|
return !0;
|
|
1125
1163
|
};
|
|
@@ -1130,37 +1168,37 @@ const we = (a) => {
|
|
|
1130
1168
|
show: !1,
|
|
1131
1169
|
showContent: !1,
|
|
1132
1170
|
loading: !1,
|
|
1133
|
-
type:
|
|
1171
|
+
type: me.Update,
|
|
1134
1172
|
get form() {
|
|
1135
1173
|
return r.get();
|
|
1136
1174
|
},
|
|
1137
|
-
set form(
|
|
1138
|
-
r.set(
|
|
1175
|
+
set form(l) {
|
|
1176
|
+
r.set(l);
|
|
1139
1177
|
},
|
|
1140
1178
|
formDefault: {},
|
|
1141
1179
|
formColumn: [],
|
|
1142
1180
|
formGrid: [],
|
|
1143
1181
|
formMaxSpan: 12,
|
|
1144
|
-
getDisabled: (
|
|
1182
|
+
getDisabled: (l, n = !1) => {
|
|
1145
1183
|
const u = a();
|
|
1146
|
-
return o.option.table?.editMode &&
|
|
1184
|
+
return o.option.table?.editMode && n ? l.disabled?.table === void 0 ? !1 : E.isFun(l.disabled?.table, u.update.form) : Qe(l, u.update.type, u.update.form);
|
|
1147
1185
|
},
|
|
1148
|
-
getBind: (
|
|
1149
|
-
const
|
|
1150
|
-
return
|
|
1186
|
+
getBind: (l) => {
|
|
1187
|
+
const n = a();
|
|
1188
|
+
return Xe(l, n.update.type);
|
|
1151
1189
|
},
|
|
1152
|
-
getOn: (
|
|
1190
|
+
getOn: (l, n) => {
|
|
1153
1191
|
const u = a();
|
|
1154
|
-
return
|
|
1192
|
+
return Ye(l, u.update.type, [n || u.update.form, l]);
|
|
1155
1193
|
},
|
|
1156
|
-
getOptions: (
|
|
1157
|
-
const
|
|
1194
|
+
getOptions: (l) => {
|
|
1195
|
+
const n = a();
|
|
1158
1196
|
try {
|
|
1159
|
-
const f =
|
|
1197
|
+
const f = Nt(n.update.formGrid?.length ? n.update.formGrid : n.update.formColumn).find((d) => d.item.key === l)?.item;
|
|
1160
1198
|
return f ? {
|
|
1161
1199
|
options: f.options,
|
|
1162
1200
|
//@ts-ignore
|
|
1163
|
-
bind:
|
|
1201
|
+
bind: n.update.getBind(f)
|
|
1164
1202
|
} : { options: {}, bind: {} };
|
|
1165
1203
|
} catch {
|
|
1166
1204
|
return { options: {}, bind: {} };
|
|
@@ -1168,28 +1206,28 @@ const we = (a) => {
|
|
|
1168
1206
|
},
|
|
1169
1207
|
edit: {
|
|
1170
1208
|
data: {},
|
|
1171
|
-
getApiData: (
|
|
1172
|
-
const
|
|
1173
|
-
if (o.option.form?.editAll) return
|
|
1209
|
+
getApiData: (l) => {
|
|
1210
|
+
const n = a();
|
|
1211
|
+
if (o.option.form?.editAll) return l;
|
|
1174
1212
|
const u = {
|
|
1175
|
-
[o.option.table?.rowKey]:
|
|
1213
|
+
[o.option.table?.rowKey]: n.update.edit.data[o.option.table?.rowKey]
|
|
1176
1214
|
};
|
|
1177
|
-
return Object.keys(
|
|
1178
|
-
|
|
1215
|
+
return Object.keys(n.update.edit.data).forEach((f) => {
|
|
1216
|
+
l[f] !== n.update.edit.data[f] && (u[f] = l[f]);
|
|
1179
1217
|
}), u;
|
|
1180
1218
|
}
|
|
1181
1219
|
},
|
|
1182
1220
|
view: {},
|
|
1183
1221
|
openLoading: !1,
|
|
1184
|
-
open: async (
|
|
1222
|
+
open: async (l, n) => {
|
|
1185
1223
|
const u = a();
|
|
1186
1224
|
if (!(u.update.showContent || u.update.openLoading)) {
|
|
1187
1225
|
E.loading(!0), u.update.openLoading = !0;
|
|
1188
1226
|
try {
|
|
1189
|
-
u.update.type =
|
|
1190
|
-
const f =
|
|
1191
|
-
u.update.edit.data = f ? void 0 : JSONUtil.cp(
|
|
1192
|
-
const d = f ? ObjectUtil.deepMerge(JSONUtil.cp(u.update.formDefault),
|
|
1227
|
+
u.update.type = l;
|
|
1228
|
+
const f = l === me.Add;
|
|
1229
|
+
u.update.edit.data = f ? void 0 : JSONUtil.cp(n), u.update.title = C.tCurd(f ? "add" : l === me.View ? "view" : "edit");
|
|
1230
|
+
const d = f ? ObjectUtil.deepMerge(JSONUtil.cp(u.update.formDefault), n ? JSONUtil.cp(n) : {}) : JSONUtil.cp(n);
|
|
1193
1231
|
x.setValue(u.update.form, d, !0), await u.initApiData("update"), await o.option.form?.openBefore?.(u.update.form, u.update), (!o.option.table?.inlineEdit || f) && (u.update.show = !0, u.update.showContent = !0), o.option.form?.openAfter?.(u.update.form, u.update);
|
|
1194
1232
|
} catch (f) {
|
|
1195
1233
|
console.error(f);
|
|
@@ -1201,31 +1239,31 @@ const we = (a) => {
|
|
|
1201
1239
|
/** 临时错误信息,直接赋值会取最后一个完成校验的错误信息,使用setErrorText方法只会提示第一个设置的错误信息 */
|
|
1202
1240
|
errorText: "",
|
|
1203
1241
|
/** 设置临时错误信息,只会提示第一个设置的错误信息 */
|
|
1204
|
-
setErrorText: (
|
|
1205
|
-
const
|
|
1206
|
-
|
|
1242
|
+
setErrorText: (l) => {
|
|
1243
|
+
const n = a();
|
|
1244
|
+
n.update.errorText || (n.update.errorText = l);
|
|
1207
1245
|
},
|
|
1208
|
-
validate: async (
|
|
1209
|
-
const
|
|
1246
|
+
validate: async (l = !0) => {
|
|
1247
|
+
const n = a();
|
|
1210
1248
|
try {
|
|
1211
|
-
const u = o.option.table?.editMode ?
|
|
1212
|
-
return await Promise.all([u,
|
|
1249
|
+
const u = o.option.table?.editMode ? n.tableEditValidate.validate() : e(n);
|
|
1250
|
+
return await Promise.all([u, n.formRef.validate()]), !0;
|
|
1213
1251
|
} catch {
|
|
1214
|
-
return
|
|
1252
|
+
return l && E.fail(n.update.errorText || C.tCurd("checkFormData")), n.update.errorText = "", !1;
|
|
1215
1253
|
}
|
|
1216
1254
|
},
|
|
1217
1255
|
submit: async () => {
|
|
1218
|
-
const
|
|
1219
|
-
if (!await
|
|
1220
|
-
|
|
1221
|
-
const u =
|
|
1256
|
+
const l = a();
|
|
1257
|
+
if (!await l.update.validate() || l.update.loading) return;
|
|
1258
|
+
l.update.loading = !0;
|
|
1259
|
+
const u = l.update.type === me.Add ? o.option.api.create : o.option.api.update;
|
|
1222
1260
|
try {
|
|
1223
|
-
await o.option.form?.submitBefore?.(
|
|
1261
|
+
await o.option.form?.submitBefore?.(l.update.form, l.update);
|
|
1224
1262
|
} catch {
|
|
1225
|
-
|
|
1263
|
+
l.update.loading = !1;
|
|
1226
1264
|
return;
|
|
1227
1265
|
}
|
|
1228
|
-
let f = ObjectUtil.deepMerge(
|
|
1266
|
+
let f = ObjectUtil.deepMerge(l.update.form, {});
|
|
1229
1267
|
delete f.children;
|
|
1230
1268
|
const d = new Set(o.option.column.filter((m) => m.type === "datetime").map((m) => m.key));
|
|
1231
1269
|
Object.keys(f).forEach((m) => {
|
|
@@ -1236,52 +1274,52 @@ const we = (a) => {
|
|
|
1236
1274
|
});
|
|
1237
1275
|
try {
|
|
1238
1276
|
if (!u) return;
|
|
1239
|
-
await u({ ...f }),
|
|
1277
|
+
await u({ ...f }), l.update.close(), await l.table.getList(), o.option.form?.submitAfter?.(f, l.update);
|
|
1240
1278
|
} catch (m) {
|
|
1241
1279
|
console.error(m);
|
|
1242
1280
|
} finally {
|
|
1243
|
-
|
|
1281
|
+
l.update.loading = !1;
|
|
1244
1282
|
}
|
|
1245
1283
|
},
|
|
1246
1284
|
close: () => {
|
|
1247
|
-
const
|
|
1248
|
-
|
|
1249
|
-
|
|
1285
|
+
const l = a();
|
|
1286
|
+
l.update.show = !1, l.update.edit.data = void 0, setTimeout(() => {
|
|
1287
|
+
l.update.showContent = !1, s.ruleFormRef.value?.resetFields?.(), r.clear();
|
|
1250
1288
|
}, 350);
|
|
1251
1289
|
}
|
|
1252
1290
|
}
|
|
1253
1291
|
};
|
|
1254
1292
|
}, W = 12, ke = (a, o) => {
|
|
1255
1293
|
a.isForm = o, Array.isArray(a.children) && a.children.forEach((s) => ke(s, o));
|
|
1256
|
-
},
|
|
1294
|
+
}, Pt = (a) => a.isForm === !1 ? !1 : typeof a.show?.form == "boolean" ? a.show.form : !0, qe = (a) => a > W ? Math.floor(a / 2) : a, Kt = (a, o, s) => (a.form = a.form || { span: o }, s === "column" ? a.form.span = a.form.span ?? 12 : a.form.span = a.form.span ?? o, a.form.span = qe(a.form.span), a.form.span), Je = (a) => {
|
|
1257
1295
|
const o = a.form;
|
|
1258
|
-
return o?.row != null && o.row > 0 ?
|
|
1259
|
-
}, re = (a) => Math.floor((a.gridRow - 1) / W),
|
|
1296
|
+
return o?.row != null && o.row > 0 ? qe(o.row) : W;
|
|
1297
|
+
}, re = (a) => Math.floor((a.gridRow - 1) / W), Qe = (a, o, s) => {
|
|
1260
1298
|
if (o === E.EDialog.View)
|
|
1261
1299
|
return a.disabled?.view === void 0 ? !0 : E.isFun(a.disabled?.view, s);
|
|
1262
1300
|
const r = a.disabled?.[o === E.EDialog.Add ? "create" : "update"];
|
|
1263
1301
|
return E.isFun(r, s);
|
|
1264
|
-
},
|
|
1302
|
+
}, Xe = (a, o) => {
|
|
1265
1303
|
const s = le(a);
|
|
1266
1304
|
return a.options?.[o === E.EDialog.Add ? "formAdd" : "formUpdate"]?.[s] || a.options?.[s] || {};
|
|
1267
|
-
},
|
|
1268
|
-
const r = le(a), e = a.options?.[o === E.EDialog.Add ? "formAdd" : "formUpdate"]?.[r]?.on || a.options?.[r]?.on || {},
|
|
1269
|
-
return Object.keys(e).forEach((
|
|
1270
|
-
const u = e[
|
|
1271
|
-
typeof u == "function" ? n
|
|
1305
|
+
}, Ye = (a, o, s = []) => {
|
|
1306
|
+
const r = le(a), e = a.options?.[o === E.EDialog.Add ? "formAdd" : "formUpdate"]?.[r]?.on || a.options?.[r]?.on || {}, l = {};
|
|
1307
|
+
return Object.keys(e).forEach((n) => {
|
|
1308
|
+
const u = e[n];
|
|
1309
|
+
typeof u == "function" ? l[n] = function(...f) {
|
|
1272
1310
|
return u.apply(this, [...f, ...s]);
|
|
1273
|
-
} : n
|
|
1274
|
-
}),
|
|
1275
|
-
},
|
|
1276
|
-
const e = a,
|
|
1311
|
+
} : l[n] = u;
|
|
1312
|
+
}), l;
|
|
1313
|
+
}, Ze = (a, o, s, r, t) => {
|
|
1314
|
+
const e = a, l = e.colSpan ?? a.span;
|
|
1277
1315
|
if (!a.item.form?.spanCol)
|
|
1278
|
-
return
|
|
1279
|
-
const
|
|
1280
|
-
return
|
|
1281
|
-
},
|
|
1316
|
+
return l;
|
|
1317
|
+
const n = t?.maxSpan || 12, u = t?.defaultSpan || n / 2, f = e.gridBand, m = o.filter((c) => f != null ? c.gridBand === f && !E.isFun(c.item.show?.form, s, r) : c.gridRow === e.gridRow && !E.isFun(c.item.show?.form, s, r)).reduce((c, p) => c + (p.colSpan ?? p.span ?? u), 0);
|
|
1318
|
+
return l + m;
|
|
1319
|
+
}, Ht = (a, o) => {
|
|
1282
1320
|
const s = (r, t) => {
|
|
1283
|
-
const e = r.gridRow,
|
|
1284
|
-
return e <= u &&
|
|
1321
|
+
const e = r.gridRow, l = r.gridRow + r.rowSpan - 1, n = t.gridRow, u = t.gridRow + t.rowSpan - 1;
|
|
1322
|
+
return e <= u && n <= l;
|
|
1285
1323
|
};
|
|
1286
1324
|
return a.map((r) => a.filter((e) => s(r, e)).length !== 1 || r.colSpan >= o ? r : {
|
|
1287
1325
|
...r,
|
|
@@ -1289,106 +1327,106 @@ const we = (a) => {
|
|
|
1289
1327
|
colSpan: o,
|
|
1290
1328
|
gridColumn: 1
|
|
1291
1329
|
});
|
|
1292
|
-
},
|
|
1330
|
+
}, xe = (a, o, s = {}) => {
|
|
1293
1331
|
const r = /* @__PURE__ */ new Set(), t = [];
|
|
1294
|
-
let e = 0,
|
|
1295
|
-
const
|
|
1296
|
-
if (w +
|
|
1297
|
-
for (let
|
|
1298
|
-
for (let
|
|
1299
|
-
if (r.has(u(p +
|
|
1332
|
+
let e = 0, l = 0;
|
|
1333
|
+
const n = (p) => Math.floor(p / W) * W, u = (p, w) => `${p},${w}`, f = (p, w, U, K) => {
|
|
1334
|
+
if (w + U > o) return !1;
|
|
1335
|
+
for (let T = 0; T < K; T++)
|
|
1336
|
+
for (let j = 0; j < U; j++)
|
|
1337
|
+
if (r.has(u(p + T, w + j))) return !1;
|
|
1300
1338
|
return !0;
|
|
1301
|
-
}, d = (p, w,
|
|
1302
|
-
for (let
|
|
1303
|
-
for (let
|
|
1304
|
-
r.add(u(p +
|
|
1305
|
-
}, m = (p, w,
|
|
1306
|
-
for (let
|
|
1307
|
-
const
|
|
1308
|
-
for (let _ = Ve; _ <
|
|
1309
|
-
const
|
|
1310
|
-
for (let te =
|
|
1311
|
-
if (f(_, te,
|
|
1339
|
+
}, d = (p, w, U, K) => {
|
|
1340
|
+
for (let T = 0; T < K; T++)
|
|
1341
|
+
for (let j = 0; j < U; j++)
|
|
1342
|
+
r.add(u(p + T, w + j));
|
|
1343
|
+
}, m = (p, w, U, K) => {
|
|
1344
|
+
for (let j = n(p); j < 500 * W; j += W) {
|
|
1345
|
+
const Ce = j + W, Ve = j === n(p) ? Math.max(j, p) : j;
|
|
1346
|
+
for (let _ = Ve; _ < Ce; _++) {
|
|
1347
|
+
const Se = _ === p ? w : 0;
|
|
1348
|
+
for (let te = Se; te <= o - U; te++)
|
|
1349
|
+
if (f(_, te, U, K)) return { tr: _, tc: te };
|
|
1312
1350
|
}
|
|
1313
1351
|
}
|
|
1314
1352
|
return { tr: p, tc: w };
|
|
1315
|
-
}, c = (p, w,
|
|
1316
|
-
const
|
|
1317
|
-
if (K < W && p + K <
|
|
1318
|
-
e = p + K,
|
|
1353
|
+
}, c = (p, w, U, K) => {
|
|
1354
|
+
const T = n(p);
|
|
1355
|
+
if (K < W && p + K < T + W) {
|
|
1356
|
+
e = p + K, l = w;
|
|
1319
1357
|
return;
|
|
1320
1358
|
}
|
|
1321
|
-
const
|
|
1322
|
-
if (
|
|
1323
|
-
|
|
1359
|
+
const j = w + U;
|
|
1360
|
+
if (j < o) {
|
|
1361
|
+
l = j, e = T;
|
|
1324
1362
|
return;
|
|
1325
1363
|
}
|
|
1326
|
-
|
|
1364
|
+
l = 0, e = T + W;
|
|
1327
1365
|
};
|
|
1328
1366
|
return a.forEach((p) => {
|
|
1329
|
-
const w = p.colSpan ?? (p.span === 0 ? o : p.span),
|
|
1330
|
-
p.item.form?.rowBreak && t.length && (
|
|
1331
|
-
let { tr: K, tc:
|
|
1332
|
-
f(K,
|
|
1333
|
-
const
|
|
1367
|
+
const w = p.colSpan ?? (p.span === 0 ? o : p.span), U = p.rowSpan ?? Je(p.item);
|
|
1368
|
+
p.item.form?.rowBreak && t.length && (l = 0, e = n(e) + W);
|
|
1369
|
+
let { tr: K, tc: T } = f(e, l, w, U) ? { tr: e, tc: l } : m(e, l, w, U);
|
|
1370
|
+
f(K, T, w, U) || ({ tr: K, tc: T } = m(0, 0, w, U)), d(K, T, w, U);
|
|
1371
|
+
const j = K + 1;
|
|
1334
1372
|
t.push({
|
|
1335
1373
|
...p,
|
|
1336
1374
|
span: w,
|
|
1337
1375
|
colSpan: w,
|
|
1338
|
-
rowSpan:
|
|
1339
|
-
gridRow:
|
|
1340
|
-
gridColumn:
|
|
1341
|
-
gridBand: re({ gridRow:
|
|
1342
|
-
}), c(K,
|
|
1343
|
-
}), s.fillSingleRows ?
|
|
1344
|
-
},
|
|
1345
|
-
const t = a.filter((
|
|
1346
|
-
a.forEach((
|
|
1347
|
-
const f = `${
|
|
1348
|
-
e.has(f) || e.set(f, []), e.get(f).push(
|
|
1376
|
+
rowSpan: U,
|
|
1377
|
+
gridRow: j,
|
|
1378
|
+
gridColumn: T + 1,
|
|
1379
|
+
gridBand: re({ gridRow: j })
|
|
1380
|
+
}), c(K, T, w, U);
|
|
1381
|
+
}), s.fillSingleRows ? Ht(t, o) : t;
|
|
1382
|
+
}, Ue = (a, o, s, r = W) => {
|
|
1383
|
+
const t = a.filter((n) => E.isFun(n.item.show?.form, o, s)), e = /* @__PURE__ */ new Map();
|
|
1384
|
+
a.forEach((n) => {
|
|
1385
|
+
const f = `${n.gridBand ?? re(n)}:${n.gridColumn}:${n.colSpan}`;
|
|
1386
|
+
e.has(f) || e.set(f, []), e.get(f).push(n);
|
|
1349
1387
|
});
|
|
1350
|
-
const
|
|
1351
|
-
return e.forEach((
|
|
1352
|
-
const u =
|
|
1353
|
-
if (!(
|
|
1354
|
-
const d =
|
|
1388
|
+
const l = /* @__PURE__ */ new Map();
|
|
1389
|
+
return e.forEach((n) => {
|
|
1390
|
+
const u = n.reduce((c, p) => c + p.rowSpan, 0);
|
|
1391
|
+
if (!(n.length > 1 && u === W && n.every((c) => c.rowSpan < W))) return;
|
|
1392
|
+
const d = n.filter((c) => E.isFun(c.item.show?.form, o, s));
|
|
1355
1393
|
if (d.length !== 1) return;
|
|
1356
1394
|
const m = d[0];
|
|
1357
|
-
|
|
1395
|
+
l.set(m.item.key, {
|
|
1358
1396
|
...m,
|
|
1359
1397
|
rowSpan: W
|
|
1360
1398
|
});
|
|
1361
|
-
}),
|
|
1399
|
+
}), xe(t.map((n) => l.get(n.item.key) || n), r, {
|
|
1362
1400
|
fillSingleRows: !0
|
|
1363
1401
|
});
|
|
1364
|
-
},
|
|
1402
|
+
}, _e = (a) => {
|
|
1365
1403
|
const o = /* @__PURE__ */ new Map();
|
|
1366
1404
|
return a.forEach((s) => {
|
|
1367
1405
|
const r = s.gridBand ?? re(s);
|
|
1368
1406
|
o.has(r) || o.set(r, []), o.get(r).push(s);
|
|
1369
1407
|
}), Array.from(o.keys()).sort((s, r) => s - r).map((s) => o.get(s));
|
|
1370
|
-
},
|
|
1371
|
-
if (!
|
|
1372
|
-
const s = o.defaultSpan ?? (o.maxSpan || 12) / 2, r =
|
|
1408
|
+
}, Nt = (a) => a?.length ? Array.isArray(a[0]) ? a.flat() : a : [], It = (a, o) => {
|
|
1409
|
+
if (!Pt(a) || !a.key) return null;
|
|
1410
|
+
const s = o.defaultSpan ?? (o.maxSpan || 12) / 2, r = Kt(a, s, o.layout);
|
|
1373
1411
|
return { item: a, span: r };
|
|
1374
|
-
},
|
|
1412
|
+
}, Gt = (a, o = {}) => {
|
|
1375
1413
|
const s = [], r = (t) => {
|
|
1376
1414
|
if (t.children?.length) {
|
|
1377
|
-
t.children.forEach((
|
|
1415
|
+
t.children.forEach((l) => r(l));
|
|
1378
1416
|
return;
|
|
1379
1417
|
}
|
|
1380
|
-
const e =
|
|
1418
|
+
const e = It(t, o);
|
|
1381
1419
|
e && s.push(e);
|
|
1382
1420
|
};
|
|
1383
1421
|
return a.forEach((t) => r(t)), s;
|
|
1384
|
-
},
|
|
1385
|
-
const s = o.maxSpan ?? 12, r = o.defaultSpan ?? s / 2, t = o.layout ?? "row",
|
|
1422
|
+
}, et = (a, o = {}) => {
|
|
1423
|
+
const s = o.maxSpan ?? 12, r = o.defaultSpan ?? s / 2, t = o.layout ?? "row", l = Gt(a, { maxSpan: s, defaultSpan: r, layout: t });
|
|
1386
1424
|
if (t === "column") {
|
|
1387
|
-
const
|
|
1425
|
+
const n = [];
|
|
1388
1426
|
let u = 1;
|
|
1389
|
-
return
|
|
1390
|
-
const d =
|
|
1391
|
-
|
|
1427
|
+
return l.forEach((f) => {
|
|
1428
|
+
const d = Je(f.item), m = s;
|
|
1429
|
+
n.push({
|
|
1392
1430
|
...f,
|
|
1393
1431
|
span: m,
|
|
1394
1432
|
colSpan: m,
|
|
@@ -1397,48 +1435,48 @@ const we = (a) => {
|
|
|
1397
1435
|
gridColumn: 1,
|
|
1398
1436
|
gridBand: re({ gridRow: u })
|
|
1399
1437
|
}), u += d;
|
|
1400
|
-
}), { cells:
|
|
1438
|
+
}), { cells: n, maxSpan: s };
|
|
1401
1439
|
}
|
|
1402
|
-
return { cells:
|
|
1403
|
-
},
|
|
1440
|
+
return { cells: xe(l, s), maxSpan: s };
|
|
1441
|
+
}, Wt = (a) => a.map((o) => o.item?.show?.form), qt = (a, o, s) => {
|
|
1404
1442
|
if (!a.rules) return;
|
|
1405
1443
|
const r = {
|
|
1406
1444
|
required: !0,
|
|
1407
1445
|
message: o(a),
|
|
1408
1446
|
trigger: "blur"
|
|
1409
|
-
}, t = le(a), e = a.options?.datetime?.type,
|
|
1410
|
-
(
|
|
1447
|
+
}, t = le(a), e = a.options?.datetime?.type, l = t === "datetime" && typeof e == "string" && e.includes("range"), n = t === "select" && !!a.options?.select?.multiple;
|
|
1448
|
+
(l || t === "checkbox" || n) && (r.type = "array", r.min = l ? 2 : 1);
|
|
1411
1449
|
const u = typeof a.rules == "boolean" ? [r] : a.rules;
|
|
1412
1450
|
return s ? u.map((f) => s(f)) : u;
|
|
1413
|
-
},
|
|
1414
|
-
const t = (e,
|
|
1415
|
-
if (
|
|
1416
|
-
const
|
|
1417
|
-
return
|
|
1451
|
+
}, Be = (a) => typeof a == "function" ? a() : a, tt = (a) => (o, s) => qt(o, a, (r) => {
|
|
1452
|
+
const t = (e, l) => {
|
|
1453
|
+
if (l && Object.prototype.hasOwnProperty.call(l, o.key) && l[o.key] !== void 0) return l[o.key];
|
|
1454
|
+
const n = Be(s);
|
|
1455
|
+
return n && Object.prototype.hasOwnProperty.call(n, o.key) ? n[o.key] : e;
|
|
1418
1456
|
};
|
|
1419
1457
|
if (r.validator) {
|
|
1420
1458
|
const e = r.validator;
|
|
1421
1459
|
return {
|
|
1422
1460
|
...r,
|
|
1423
|
-
validator: (
|
|
1424
|
-
const d =
|
|
1425
|
-
return e(
|
|
1461
|
+
validator: (l, n, u, f) => {
|
|
1462
|
+
const d = Be(s);
|
|
1463
|
+
return e(l, t(n, f), u, d || f);
|
|
1426
1464
|
}
|
|
1427
1465
|
};
|
|
1428
1466
|
}
|
|
1429
1467
|
return r;
|
|
1430
|
-
}),
|
|
1468
|
+
}), ot = (a, o) => {
|
|
1431
1469
|
const s = {
|
|
1432
|
-
input:
|
|
1433
|
-
select:
|
|
1470
|
+
input: C.tCurd("placeholderInput"),
|
|
1471
|
+
select: C.tCurd("placeholderSelect")
|
|
1434
1472
|
}, r = (s[le(a) || "input"] || s.input) + a.label;
|
|
1435
1473
|
return (o || q.error.callback)?.(a.key, a) || r;
|
|
1436
|
-
},
|
|
1437
|
-
const r = {}, t = {}, e = o?.maxSpan || 12,
|
|
1438
|
-
a.forEach((d) => ke(d, !0)), Re(a, r, t, (d) =>
|
|
1439
|
-
const { cells: u, maxSpan: f } =
|
|
1474
|
+
}, at = (a) => tt((o) => ot(o, a?.error)), Jt = (a, o, s) => {
|
|
1475
|
+
const r = {}, t = {}, e = o?.maxSpan || 12, l = o?.defaultSpan || e / 2, n = at(o);
|
|
1476
|
+
a.forEach((d) => ke(d, !0)), Re(a, r, t, (d) => n(d, s));
|
|
1477
|
+
const { cells: u, maxSpan: f } = et(a, {
|
|
1440
1478
|
maxSpan: e,
|
|
1441
|
-
defaultSpan:
|
|
1479
|
+
defaultSpan: l,
|
|
1442
1480
|
layout: o?.layout
|
|
1443
1481
|
});
|
|
1444
1482
|
return {
|
|
@@ -1446,22 +1484,22 @@ const we = (a) => {
|
|
|
1446
1484
|
rules: t,
|
|
1447
1485
|
formGrid: u,
|
|
1448
1486
|
formMaxSpan: f,
|
|
1449
|
-
formColumn:
|
|
1487
|
+
formColumn: _e(u)
|
|
1450
1488
|
};
|
|
1451
1489
|
}, Re = (a, o, s, r) => {
|
|
1452
1490
|
const t = (e) => {
|
|
1453
1491
|
if (e.children?.length) {
|
|
1454
|
-
e.children.forEach((
|
|
1492
|
+
e.children.forEach((l) => t(l));
|
|
1455
1493
|
return;
|
|
1456
1494
|
}
|
|
1457
1495
|
if (e.key) {
|
|
1458
1496
|
o[e.key] = e.value;
|
|
1459
|
-
const
|
|
1460
|
-
|
|
1497
|
+
const l = r(e);
|
|
1498
|
+
l && (s[e.key] = l);
|
|
1461
1499
|
}
|
|
1462
1500
|
};
|
|
1463
1501
|
a.forEach(t);
|
|
1464
|
-
},
|
|
1502
|
+
}, Qt = { class: "curd-form-cell-inner" }, nt = /* @__PURE__ */ Q({
|
|
1465
1503
|
__name: "layout",
|
|
1466
1504
|
props: {
|
|
1467
1505
|
formGrid: {},
|
|
@@ -1476,7 +1514,7 @@ const we = (a) => {
|
|
|
1476
1514
|
getDisabled: { type: Function }
|
|
1477
1515
|
},
|
|
1478
1516
|
setup(a) {
|
|
1479
|
-
const o = E.isFun, s = a, r = ae(() =>
|
|
1517
|
+
const o = E.isFun, s = a, r = ae(() => Ue(s.formGrid, s.form, s.type, s.maxSpan)), t = ae(() => {
|
|
1480
1518
|
const c = Array.from(
|
|
1481
1519
|
new Set(
|
|
1482
1520
|
r.value.map((p) => p.gridBand ?? re(p))
|
|
@@ -1485,16 +1523,16 @@ const we = (a) => {
|
|
|
1485
1523
|
return new Map(c.map((p, w) => [p, w]));
|
|
1486
1524
|
}), e = ae(() => ({
|
|
1487
1525
|
gridTemplateColumns: `repeat(${s.maxSpan}, minmax(0, 1fr))`
|
|
1488
|
-
})),
|
|
1526
|
+
})), l = ae(() => {
|
|
1489
1527
|
let c = 0;
|
|
1490
1528
|
return r.value.forEach((p) => {
|
|
1491
1529
|
const w = p.gridRow + p.rowSpan - 1;
|
|
1492
1530
|
w > c && (c = w);
|
|
1493
1531
|
}), c;
|
|
1494
|
-
}),
|
|
1532
|
+
}), n = (c) => c.gridRow + c.rowSpan - 1 >= l.value, u = (c) => c.rowSpan >= W, f = (c) => {
|
|
1495
1533
|
const p = c.gridBand ?? re(c);
|
|
1496
1534
|
return t.value.get(p) ?? p;
|
|
1497
|
-
}, d = (c) =>
|
|
1535
|
+
}, d = (c) => Ze(c, r.value, s.form, s.type, {
|
|
1498
1536
|
maxSpan: s.maxSpan,
|
|
1499
1537
|
defaultSpan: s.formOption?.defaultSpan
|
|
1500
1538
|
}), m = (c) => {
|
|
@@ -1504,25 +1542,25 @@ const we = (a) => {
|
|
|
1504
1542
|
gridColumn: `${c.gridColumn} / span ${p}`
|
|
1505
1543
|
};
|
|
1506
1544
|
};
|
|
1507
|
-
return (c, p) => i(o)(i(
|
|
1545
|
+
return (c, p) => i(o)(i(Wt)(c.formGrid), c.form, c.type) ? (b(), v(A, { key: 0 }, [
|
|
1508
1546
|
$(c.$slots, "form-start", { row: c.form }),
|
|
1509
|
-
|
|
1547
|
+
F("div", {
|
|
1510
1548
|
class: J(["curd-form-grid", { stripe: c.stripe !== !1 }]),
|
|
1511
|
-
style:
|
|
1549
|
+
style: he(e.value)
|
|
1512
1550
|
}, [
|
|
1513
|
-
(b(!0),
|
|
1551
|
+
(b(!0), v(A, null, I(r.value, (w) => (b(), v("div", {
|
|
1514
1552
|
key: w.item.key,
|
|
1515
1553
|
class: J(["curd-form-grid-cell", [
|
|
1516
1554
|
c.stripe !== !1 && f(w) % 2 === 0 ? "stripe-band-odd" : "",
|
|
1517
1555
|
w.gridColumn > 1 ? "has-col-border" : "",
|
|
1518
|
-
c.stripe !== !1 &&
|
|
1556
|
+
c.stripe !== !1 && n(w) ? "is-last-row" : "",
|
|
1519
1557
|
u(w) ? "is-row-span" : "",
|
|
1520
1558
|
`form-item-col-${w.item.key}`
|
|
1521
1559
|
]]),
|
|
1522
|
-
style:
|
|
1560
|
+
style: he(m(w))
|
|
1523
1561
|
}, [
|
|
1524
|
-
|
|
1525
|
-
i(o)(w.item.show?.form, c.form, c.type) ? (b(), h(
|
|
1562
|
+
F("div", Qt, [
|
|
1563
|
+
i(o)(w.item.show?.form, c.form, c.type) ? (b(), h(Bt, {
|
|
1526
1564
|
key: 0,
|
|
1527
1565
|
class: J({ "is-row-span-field": u(w) }),
|
|
1528
1566
|
item: w.item,
|
|
@@ -1533,20 +1571,20 @@ const we = (a) => {
|
|
|
1533
1571
|
"get-on": c.getOn,
|
|
1534
1572
|
"get-disabled": c.getDisabled
|
|
1535
1573
|
}, Z({ _: 2 }, [
|
|
1536
|
-
I(c.$slots, (
|
|
1574
|
+
I(c.$slots, (U, K) => ({
|
|
1537
1575
|
name: K,
|
|
1538
|
-
fn: y((
|
|
1539
|
-
$(c.$slots, K,
|
|
1576
|
+
fn: y((T) => [
|
|
1577
|
+
$(c.$slots, K, V({ ref_for: !0 }, T || {}))
|
|
1540
1578
|
])
|
|
1541
1579
|
}))
|
|
1542
|
-
]), 1032, ["class", "item", "form", "type", "label-width", "get-bind", "get-on", "get-disabled"])) :
|
|
1580
|
+
]), 1032, ["class", "item", "form", "type", "label-width", "get-bind", "get-on", "get-disabled"])) : S("", !0)
|
|
1543
1581
|
])
|
|
1544
1582
|
], 6))), 128))
|
|
1545
1583
|
], 6),
|
|
1546
1584
|
$(c.$slots, "form-end", { row: c.form })
|
|
1547
|
-
], 64)) :
|
|
1585
|
+
], 64)) : S("", !0);
|
|
1548
1586
|
}
|
|
1549
|
-
}),
|
|
1587
|
+
}), Xt = /* @__PURE__ */ Q({
|
|
1550
1588
|
__name: "column",
|
|
1551
1589
|
props: {
|
|
1552
1590
|
option: {
|
|
@@ -1564,16 +1602,16 @@ const we = (a) => {
|
|
|
1564
1602
|
},
|
|
1565
1603
|
setup(a, { expose: o }) {
|
|
1566
1604
|
const s = E.EDialog, r = Y(), t = a;
|
|
1567
|
-
let e =
|
|
1568
|
-
const
|
|
1569
|
-
|
|
1570
|
-
|
|
1605
|
+
let e = ye(t.form);
|
|
1606
|
+
const l = Fe.getConf("curdConf"), n = "formRef-" + StrUtil.getId();
|
|
1607
|
+
Ie(() => {
|
|
1608
|
+
l?.formRef?.remove(n);
|
|
1571
1609
|
});
|
|
1572
1610
|
const u = ie({
|
|
1573
1611
|
rules: {},
|
|
1574
1612
|
show: !0,
|
|
1575
1613
|
formDefault: {},
|
|
1576
|
-
type: t.type ||
|
|
1614
|
+
type: t.type || l?.update?.type || s.Add,
|
|
1577
1615
|
formColumn: [],
|
|
1578
1616
|
formGrid: [],
|
|
1579
1617
|
formMaxSpan: 12,
|
|
@@ -1583,33 +1621,33 @@ const we = (a) => {
|
|
|
1583
1621
|
set form(f) {
|
|
1584
1622
|
e.set(f);
|
|
1585
1623
|
},
|
|
1586
|
-
getDisabled: (f) =>
|
|
1587
|
-
getBind: (f) =>
|
|
1588
|
-
getOn: (f) =>
|
|
1624
|
+
getDisabled: (f) => Qe(f, u.type, u.form),
|
|
1625
|
+
getBind: (f) => Xe(f, u.type),
|
|
1626
|
+
getOn: (f) => Ye(f, u.type, [u.form, f]),
|
|
1589
1627
|
initColumnForm: () => {
|
|
1590
|
-
const f = e, d =
|
|
1628
|
+
const f = e, d = Jt(t.option.column, t.option.form, () => f.get());
|
|
1591
1629
|
u.formDefault = d.formDefault, u.rules = d.rules, u.formGrid = d.formGrid, u.formMaxSpan = d.formMaxSpan, u.formColumn = d.formColumn, u.type === s.Add ? f.isExternal() ? f.merge(JSONUtil.cp(u.formDefault)) : f.set(JSONUtil.cp(u.formDefault)) : !f.isExternal() && t.form && f.set(JSONUtil.cp(t.form));
|
|
1592
1630
|
}
|
|
1593
1631
|
});
|
|
1594
|
-
return
|
|
1632
|
+
return l?.formRef?.set(n, {
|
|
1595
1633
|
validate: async (f) => {
|
|
1596
1634
|
const d = r.value;
|
|
1597
1635
|
if (!d)
|
|
1598
1636
|
return f?.(!0), !0;
|
|
1599
|
-
await
|
|
1600
|
-
const m =
|
|
1637
|
+
await ve();
|
|
1638
|
+
const m = Ue(u.formGrid || [], u.form, u.type, u.formMaxSpan).map((w) => w.item.key).filter(Boolean), c = Object.keys(u.rules || {}).filter((w) => !m.includes(w));
|
|
1601
1639
|
if (c.length && d.clearValidate(c), !m.length)
|
|
1602
1640
|
return f?.(!0), !0;
|
|
1603
|
-
const p = await d.validateField(m, async (w,
|
|
1604
|
-
w ||
|
|
1641
|
+
const p = await d.validateField(m, async (w, U) => {
|
|
1642
|
+
w || pe(we(U));
|
|
1605
1643
|
});
|
|
1606
1644
|
if (f?.(!!p), !p) throw !1;
|
|
1607
1645
|
return !0;
|
|
1608
1646
|
}
|
|
1609
|
-
}), t.option.form?.initStart?.(u), u.initColumnForm(), t.option.form?.initEnd?.(u),
|
|
1647
|
+
}), t.option.form?.initStart?.(u), u.initColumnForm(), t.option.form?.initEnd?.(u), Ne(
|
|
1610
1648
|
() => t.form,
|
|
1611
1649
|
(f) => {
|
|
1612
|
-
e =
|
|
1650
|
+
e = ye(f), u.initColumnForm();
|
|
1613
1651
|
}
|
|
1614
1652
|
), o({ ref: r, conf: u }), (f, d) => (b(), h(i(oe), {
|
|
1615
1653
|
ref_key: "ruleFormRef",
|
|
@@ -1618,7 +1656,7 @@ const we = (a) => {
|
|
|
1618
1656
|
rules: u.rules
|
|
1619
1657
|
}, {
|
|
1620
1658
|
default: y(() => [
|
|
1621
|
-
u.show ? (b(), h(
|
|
1659
|
+
u.show ? (b(), h(nt, {
|
|
1622
1660
|
key: 0,
|
|
1623
1661
|
"form-grid": u.formGrid,
|
|
1624
1662
|
"max-span": u.formMaxSpan,
|
|
@@ -1637,28 +1675,28 @@ const we = (a) => {
|
|
|
1637
1675
|
$(f.$slots, c, Me(Oe(p || {})))
|
|
1638
1676
|
])
|
|
1639
1677
|
}))
|
|
1640
|
-
]), 1032, ["form-grid", "max-span", "form", "type", "stripe", "label-width", "form-option", "get-bind", "get-on", "get-disabled"])) :
|
|
1678
|
+
]), 1032, ["form-grid", "max-span", "form", "type", "stripe", "label-width", "form-option", "get-bind", "get-on", "get-disabled"])) : S("", !0)
|
|
1641
1679
|
]),
|
|
1642
1680
|
_: 3
|
|
1643
1681
|
}, 8, ["model", "rules"]));
|
|
1644
1682
|
}
|
|
1645
|
-
}),
|
|
1646
|
-
const o =
|
|
1683
|
+
}), Yt = (a) => a?.value || a, Zt = (a) => {
|
|
1684
|
+
const o = Yt(a);
|
|
1647
1685
|
return o?.validate ? new Promise((s, r) => {
|
|
1648
1686
|
let t = !1;
|
|
1649
|
-
const e = (
|
|
1650
|
-
t || (t = !0,
|
|
1687
|
+
const e = (l, n) => {
|
|
1688
|
+
t || (t = !0, l === !1 ? (pe(we(n)), r(!1)) : s(!0));
|
|
1651
1689
|
};
|
|
1652
1690
|
try {
|
|
1653
|
-
const
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
}) : (
|
|
1657
|
-
} catch (
|
|
1658
|
-
r(
|
|
1691
|
+
const l = o.validate(e);
|
|
1692
|
+
l && typeof l.then == "function" ? l.then((n) => e(n)).catch((n) => {
|
|
1693
|
+
pe(we(n?.fields || n)), r(n);
|
|
1694
|
+
}) : (l !== void 0 || o.validate.length === 0) && e(l);
|
|
1695
|
+
} catch (l) {
|
|
1696
|
+
r(l);
|
|
1659
1697
|
}
|
|
1660
1698
|
}) : Promise.resolve(!0);
|
|
1661
|
-
},
|
|
1699
|
+
}, xt = () => {
|
|
1662
1700
|
const a = ie({
|
|
1663
1701
|
formRef: {
|
|
1664
1702
|
map: {},
|
|
@@ -1670,7 +1708,7 @@ const we = (a) => {
|
|
|
1670
1708
|
},
|
|
1671
1709
|
validate() {
|
|
1672
1710
|
const o = Object.keys(a.formRef.map).map((s) => a.formRef.map[s]);
|
|
1673
|
-
return Promise.all(o.map((s) =>
|
|
1711
|
+
return Promise.all(o.map((s) => Zt(s))).then(() => !0);
|
|
1674
1712
|
}
|
|
1675
1713
|
},
|
|
1676
1714
|
/**
|
|
@@ -1702,8 +1740,8 @@ const we = (a) => {
|
|
|
1702
1740
|
}
|
|
1703
1741
|
});
|
|
1704
1742
|
return a;
|
|
1705
|
-
},
|
|
1706
|
-
const s =
|
|
1743
|
+
}, _t = (a, o) => {
|
|
1744
|
+
const s = ye(() => o.searchForm);
|
|
1707
1745
|
return {
|
|
1708
1746
|
search: {
|
|
1709
1747
|
column: {
|
|
@@ -1716,20 +1754,20 @@ const we = (a) => {
|
|
|
1716
1754
|
s.set(r);
|
|
1717
1755
|
},
|
|
1718
1756
|
formDefault: {},
|
|
1719
|
-
getPlaceholder: (r, t =
|
|
1757
|
+
getPlaceholder: (r, t = C.tCurd("placeholderInput")) => r.text?.search?.placeholder === void 0 ? `${t}${r.label}` : r.text?.search?.placeholder,
|
|
1720
1758
|
getFormData: () => {
|
|
1721
1759
|
const r = a();
|
|
1722
1760
|
let t = {};
|
|
1723
|
-
o.option.column.forEach((
|
|
1724
|
-
(typeof
|
|
1761
|
+
o.option.column.forEach((l) => {
|
|
1762
|
+
(typeof l.show?.search == "function" ? l.show?.search(r.search.form) : l.show?.search) && (t[l.key] = r.search.form[l.key]);
|
|
1725
1763
|
});
|
|
1726
1764
|
const e = o.option.search?.before?.(t);
|
|
1727
1765
|
return e && (t = e), t;
|
|
1728
1766
|
},
|
|
1729
1767
|
reset: () => {
|
|
1730
1768
|
const r = a(), t = r.search.formDefault;
|
|
1731
|
-
Object.keys(t).forEach((
|
|
1732
|
-
o.option.search?.resetMode === "none" ? t[
|
|
1769
|
+
Object.keys(t).forEach((l) => {
|
|
1770
|
+
o.option.search?.resetMode === "none" ? t[l] = void 0 : t[l] = r.search.formDefault[l];
|
|
1733
1771
|
});
|
|
1734
1772
|
const e = ObjectUtil.deepMerge(t, {});
|
|
1735
1773
|
x.setValue(r.search.form, e, !0), r.page.num = 1, o.option.init !== !1 && r.table.getList();
|
|
@@ -1740,7 +1778,7 @@ const we = (a) => {
|
|
|
1740
1778
|
}
|
|
1741
1779
|
}
|
|
1742
1780
|
};
|
|
1743
|
-
},
|
|
1781
|
+
}, eo = (a, o) => ({
|
|
1744
1782
|
page: {
|
|
1745
1783
|
num: 1,
|
|
1746
1784
|
total: 0,
|
|
@@ -1758,12 +1796,12 @@ const we = (a) => {
|
|
|
1758
1796
|
};
|
|
1759
1797
|
}
|
|
1760
1798
|
}
|
|
1761
|
-
}),
|
|
1799
|
+
}), to = (a, o, s) => {
|
|
1762
1800
|
const r = a;
|
|
1763
1801
|
return {
|
|
1764
1802
|
table: {
|
|
1765
1803
|
op: {
|
|
1766
|
-
width: (...t) => t.filter((
|
|
1804
|
+
width: (...t) => t.filter((l) => l).length * 30 + 60
|
|
1767
1805
|
},
|
|
1768
1806
|
loading: !1,
|
|
1769
1807
|
data: [],
|
|
@@ -1777,11 +1815,11 @@ const we = (a) => {
|
|
|
1777
1815
|
if (t.table.expand.isExpand)
|
|
1778
1816
|
t.table.expand.rowKeys = [];
|
|
1779
1817
|
else {
|
|
1780
|
-
const e = (
|
|
1781
|
-
let
|
|
1782
|
-
return
|
|
1783
|
-
|
|
1784
|
-
}),
|
|
1818
|
+
const e = (l) => {
|
|
1819
|
+
let n = [];
|
|
1820
|
+
return l.forEach((u) => {
|
|
1821
|
+
n.push(u[o.option.table.rowKey]), u.children?.length && (n = n.concat(e(u.children)));
|
|
1822
|
+
}), n;
|
|
1785
1823
|
};
|
|
1786
1824
|
t.table.expand.rowKeys = e(t.table.data);
|
|
1787
1825
|
}
|
|
@@ -1833,7 +1871,7 @@ const we = (a) => {
|
|
|
1833
1871
|
};
|
|
1834
1872
|
},
|
|
1835
1873
|
getColumnBind: () => {
|
|
1836
|
-
const { show: t, button: e, page:
|
|
1874
|
+
const { show: t, button: e, page: l, scroll: n, field: u, rule: f, api: d, onEnd: m, ...c } = r().table.sortable.getOption();
|
|
1837
1875
|
return c;
|
|
1838
1876
|
},
|
|
1839
1877
|
destroy: () => {
|
|
@@ -1847,35 +1885,36 @@ const we = (a) => {
|
|
|
1847
1885
|
const e = await t.table.sortable.modulePromise;
|
|
1848
1886
|
return e.default || e;
|
|
1849
1887
|
},
|
|
1850
|
-
applyRule: (t, e, n,
|
|
1851
|
-
if (
|
|
1852
|
-
|
|
1853
|
-
|
|
1888
|
+
applyRule: (t, e, l, n, u = "asc") => {
|
|
1889
|
+
if (l === "value") {
|
|
1890
|
+
const f = u === "desc" ? n.slice().reverse() : n;
|
|
1891
|
+
t.forEach((d, m) => {
|
|
1892
|
+
d[e] = f[m];
|
|
1854
1893
|
});
|
|
1855
1894
|
return;
|
|
1856
1895
|
}
|
|
1857
|
-
t.forEach((
|
|
1858
|
-
|
|
1896
|
+
t.forEach((f, d) => {
|
|
1897
|
+
f[e] = u === "desc" ? t.length - d : d + 1;
|
|
1859
1898
|
});
|
|
1860
1899
|
},
|
|
1861
1900
|
sync: async () => {
|
|
1862
1901
|
const t = r();
|
|
1863
1902
|
if (t.table.sortable.destroy(), !t.table.sortable.isActive() || t.table.loading) return;
|
|
1864
|
-
await
|
|
1903
|
+
await ve();
|
|
1865
1904
|
const e = t.table.sortable.getBody();
|
|
1866
1905
|
if (!e) return;
|
|
1867
|
-
const
|
|
1868
|
-
t.table.sortable.instance =
|
|
1906
|
+
const l = await t.table.sortable.loadModule(), n = t.table.sortable.getOption();
|
|
1907
|
+
t.table.sortable.instance = l.create(e, {
|
|
1869
1908
|
animation: 150,
|
|
1870
1909
|
handle: ".cc1-form-drag-handle",
|
|
1871
1910
|
draggable: ".el-table__row",
|
|
1872
1911
|
onEnd: ({ oldIndex: u, newIndex: f }) => {
|
|
1873
1912
|
const d = (c, p, w) => {
|
|
1874
1913
|
if (!Number.isInteger(p) || !Number.isInteger(w) || p === w || p < 0 || w < 0 || p >= c.length || w >= c.length) return;
|
|
1875
|
-
const
|
|
1876
|
-
c.splice(w, 0,
|
|
1877
|
-
}, m = t.table.data.map((c) => c?.[
|
|
1878
|
-
d(t.table.data, u, f),
|
|
1914
|
+
const U = c.splice(p, 1)[0];
|
|
1915
|
+
c.splice(w, 0, U);
|
|
1916
|
+
}, m = t.table.data.map((c) => c?.[n.field]);
|
|
1917
|
+
d(t.table.data, u, f), n.onEnd ? n.onEnd(t.table.data) : t.table.sortable.applyRule(t.table.data, n.field, n.rule, m, n.order || "asc");
|
|
1879
1918
|
}
|
|
1880
1919
|
});
|
|
1881
1920
|
},
|
|
@@ -1891,30 +1930,22 @@ const we = (a) => {
|
|
|
1891
1930
|
},
|
|
1892
1931
|
exit: async () => {
|
|
1893
1932
|
const t = r();
|
|
1894
|
-
o.option.table.fitHeight = t.table.sortable.fitHeight, await t.table.getList(), t.table.sortable.
|
|
1933
|
+
t.table.sortable.mode = !1, o.option.table.fitHeight = t.table.sortable.fitHeight, await t.table.getList(), t.table.sortable.destroy();
|
|
1895
1934
|
},
|
|
1896
1935
|
save: async () => {
|
|
1897
|
-
const t = r(),
|
|
1898
|
-
if (!
|
|
1899
|
-
E.fail(
|
|
1936
|
+
const t = r(), l = t.table.sortable.getOption().api?.update || o.option.api.update;
|
|
1937
|
+
if (!l) {
|
|
1938
|
+
E.fail(C.tCurd("sortableUpdateApiRequired"));
|
|
1900
1939
|
return;
|
|
1901
1940
|
}
|
|
1902
1941
|
t.table.sortable.actionLoading = !0, t.table.loading = !0;
|
|
1903
1942
|
try {
|
|
1904
|
-
await
|
|
1905
|
-
} catch (
|
|
1906
|
-
console.error(
|
|
1943
|
+
await l(t.table.data, "sortable"), E.success(C.tCurd("operationSuccess")), await t.table.sortable.exit();
|
|
1944
|
+
} catch (n) {
|
|
1945
|
+
console.error(n);
|
|
1907
1946
|
} finally {
|
|
1908
1947
|
t.table.sortable.actionLoading = !1, t.table.loading = !1;
|
|
1909
1948
|
}
|
|
1910
|
-
},
|
|
1911
|
-
command: async (t) => {
|
|
1912
|
-
const e = r();
|
|
1913
|
-
if (t === "save") {
|
|
1914
|
-
await e.table.sortable.save();
|
|
1915
|
-
return;
|
|
1916
|
-
}
|
|
1917
|
-
await e.table.sortable.exit();
|
|
1918
1949
|
}
|
|
1919
1950
|
},
|
|
1920
1951
|
header: {
|
|
@@ -1923,30 +1954,30 @@ const we = (a) => {
|
|
|
1923
1954
|
toggleExpandAll: () => {
|
|
1924
1955
|
const t = r(), e = !t.table.header.group.expand;
|
|
1925
1956
|
t.table.header.group.expand = e;
|
|
1926
|
-
const
|
|
1927
|
-
|
|
1928
|
-
u.table?.header?.group !== void 0 && (u.table.header.group = !e), u.table?.header?.groupKey !== void 0 && (u.table.header.show = e), Array.isArray(u.children) && u.children.length &&
|
|
1957
|
+
const l = (n) => {
|
|
1958
|
+
n.forEach((u) => {
|
|
1959
|
+
u.table?.header?.group !== void 0 && (u.table.header.group = !e), u.table?.header?.groupKey !== void 0 && (u.table.header.show = e), Array.isArray(u.children) && u.children.length && l(u.children);
|
|
1929
1960
|
});
|
|
1930
1961
|
};
|
|
1931
|
-
|
|
1962
|
+
l(t.table.column.list);
|
|
1932
1963
|
}
|
|
1933
1964
|
}
|
|
1934
1965
|
},
|
|
1935
1966
|
parseListResult: async (t) => {
|
|
1936
|
-
const e = B.config.field.result,
|
|
1967
|
+
const e = B.config.field.result, l = t?.data || { [e.list]: t }, n = Array.isArray(l) ? l : (Array.isArray(l[e.list]), l[e.list]), f = ObjectUtil.deepMerge({ data: n }, {}).data;
|
|
1937
1968
|
return {
|
|
1938
|
-
data: o.option.data ? await o.option.data(f,
|
|
1939
|
-
total:
|
|
1969
|
+
data: o.option.data ? await o.option.data(f, n) : f,
|
|
1970
|
+
total: l[e.total] || 0
|
|
1940
1971
|
};
|
|
1941
1972
|
},
|
|
1942
1973
|
applyListResult: async (t, e) => {
|
|
1943
|
-
const
|
|
1944
|
-
return
|
|
1974
|
+
const l = r(), n = await l.table.parseListResult(t);
|
|
1975
|
+
return l.table.data = n.data, l.page.total = e ?? n.total, l.tableEditValidate?.clear?.(), n;
|
|
1945
1976
|
},
|
|
1946
1977
|
getList: async (t) => {
|
|
1947
1978
|
const e = r();
|
|
1948
1979
|
e.table.loading = !0;
|
|
1949
|
-
const
|
|
1980
|
+
const l = o.option.table?.sortable, n = t === "sortable" && l?.api?.list || o.option.api.list, u = JSONUtil.cp(e.table.selection.list);
|
|
1950
1981
|
try {
|
|
1951
1982
|
await e.initApiData("init");
|
|
1952
1983
|
let f = {};
|
|
@@ -1957,17 +1988,17 @@ const we = (a) => {
|
|
|
1957
1988
|
[p.field]: e.table.sort.order
|
|
1958
1989
|
};
|
|
1959
1990
|
}
|
|
1960
|
-
const d = t === "sortable" &&
|
|
1991
|
+
const d = t === "sortable" && l?.page === !1 ? e.page.getQuery({
|
|
1961
1992
|
num: 1,
|
|
1962
1993
|
size: e.page.total || 999999
|
|
1963
|
-
}) : e.page.getQuery(), m = await
|
|
1994
|
+
}) : e.page.getQuery(), m = await n(
|
|
1964
1995
|
{
|
|
1965
1996
|
...d,
|
|
1966
1997
|
...f
|
|
1967
1998
|
},
|
|
1968
1999
|
t
|
|
1969
2000
|
);
|
|
1970
|
-
await e.table.applyListResult(m, t === "sortable" &&
|
|
2001
|
+
await e.table.applyListResult(m, t === "sortable" && l?.page === !1 ? e.page.total : void 0), setTimeout(() => {
|
|
1971
2002
|
e.table.selection.setList(u), o.option.table?.sortable?.show && !o.option.table?.sortable?.button && e.table.sortable.sync();
|
|
1972
2003
|
}, 20);
|
|
1973
2004
|
} catch (f) {
|
|
@@ -1982,10 +2013,10 @@ const we = (a) => {
|
|
|
1982
2013
|
r().table.selection.list = t;
|
|
1983
2014
|
},
|
|
1984
2015
|
setList: (t, e) => {
|
|
1985
|
-
const
|
|
1986
|
-
|
|
1987
|
-
const
|
|
1988
|
-
if (
|
|
2016
|
+
const l = r();
|
|
2017
|
+
l.table.selection.list = [];
|
|
2018
|
+
const n = s.tableRef.value;
|
|
2019
|
+
if (n?.clearSelection(), !n || !t?.length) return;
|
|
1989
2020
|
const u = o.option.table?.rowKey, f = (d) => {
|
|
1990
2021
|
const m = (c) => {
|
|
1991
2022
|
for (const p of c) {
|
|
@@ -1999,16 +2030,16 @@ const we = (a) => {
|
|
|
1999
2030
|
}
|
|
2000
2031
|
}
|
|
2001
2032
|
};
|
|
2002
|
-
return m(
|
|
2033
|
+
return m(l.table.data);
|
|
2003
2034
|
};
|
|
2004
2035
|
t.forEach((d) => {
|
|
2005
2036
|
const m = f(d);
|
|
2006
2037
|
if (m)
|
|
2007
2038
|
if (e) {
|
|
2008
|
-
const c = () =>
|
|
2039
|
+
const c = () => n.toggleRowSelection(m, !0, !1);
|
|
2009
2040
|
e(d) !== !1 && c();
|
|
2010
2041
|
} else
|
|
2011
|
-
|
|
2042
|
+
n.toggleRowSelection(m, !0, !1);
|
|
2012
2043
|
});
|
|
2013
2044
|
}
|
|
2014
2045
|
},
|
|
@@ -2018,53 +2049,53 @@ const we = (a) => {
|
|
|
2018
2049
|
change: (t) => {
|
|
2019
2050
|
const e = r();
|
|
2020
2051
|
B.config.table.sort.resetPage && (e.page.num = 1);
|
|
2021
|
-
const
|
|
2022
|
-
if (
|
|
2023
|
-
|
|
2052
|
+
const l = B.config.table.sort;
|
|
2053
|
+
if (l.change) {
|
|
2054
|
+
l.change(t, e);
|
|
2024
2055
|
return;
|
|
2025
2056
|
}
|
|
2026
|
-
e.table.sort.prop = t.prop, t.order === null ? (e.table.sort.order = "", e.table.sort.prop = "") : e.table.sort.order = t.order === "ascending" ?
|
|
2057
|
+
e.table.sort.prop = t.prop, t.order === null ? (e.table.sort.order = "", e.table.sort.prop = "") : e.table.sort.order = t.order === "ascending" ? l.order.asc : l.order.desc, e.table.getList();
|
|
2027
2058
|
}
|
|
2028
2059
|
}
|
|
2029
2060
|
}
|
|
2030
2061
|
};
|
|
2031
|
-
},
|
|
2062
|
+
}, oo = (a, o) => {
|
|
2032
2063
|
const s = ie({}), r = /* @__PURE__ */ new WeakMap();
|
|
2033
2064
|
let t = 0;
|
|
2034
2065
|
const e = (g) => {
|
|
2035
|
-
let
|
|
2036
|
-
return
|
|
2037
|
-
},
|
|
2038
|
-
const
|
|
2066
|
+
let k = r.get(g);
|
|
2067
|
+
return k || (t += 1, k = `fallback-${t}`, r.set(g, k)), k;
|
|
2068
|
+
}, l = (g) => {
|
|
2069
|
+
const k = o.option.table?.rowKey, D = k ? g[k] : void 0;
|
|
2039
2070
|
return D != null && D !== "" ? String(D) : e(g);
|
|
2040
|
-
},
|
|
2071
|
+
}, n = (g, k) => `${l(g)}-${k.key}`, u = (g) => ot(g, o.option.form?.error), f = tt(u), d = () => {
|
|
2041
2072
|
Object.keys(s).forEach((g) => {
|
|
2042
2073
|
delete s[g];
|
|
2043
2074
|
});
|
|
2044
|
-
}, m = (g,
|
|
2045
|
-
delete s[
|
|
2046
|
-
}, c = (g,
|
|
2075
|
+
}, m = (g, k) => {
|
|
2076
|
+
delete s[n(g, k)];
|
|
2077
|
+
}, c = (g, k) => s[n(g, k)] || "", p = (g, k) => g.message || u(k), w = (g) => g == null || g === "" || Array.isArray(g) && g.length === 0, U = (g) => {
|
|
2047
2078
|
if (typeof g == "number") return g;
|
|
2048
2079
|
if (typeof g == "string" || Array.isArray(g)) return g.length;
|
|
2049
|
-
}, K = (g,
|
|
2050
|
-
if (g === "array") return Array.isArray(
|
|
2051
|
-
if (g === "integer") return typeof
|
|
2052
|
-
if (g === "float") return typeof
|
|
2053
|
-
if (g === "number") return typeof
|
|
2054
|
-
if (g === "boolean") return typeof
|
|
2055
|
-
if (g === "object") return
|
|
2056
|
-
if (g === "date") return
|
|
2057
|
-
if (g === "email") return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(
|
|
2080
|
+
}, K = (g, k) => {
|
|
2081
|
+
if (g === "array") return Array.isArray(k);
|
|
2082
|
+
if (g === "integer") return typeof k == "number" && Number.isInteger(k);
|
|
2083
|
+
if (g === "float") return typeof k == "number" && !Number.isInteger(k);
|
|
2084
|
+
if (g === "number") return typeof k == "number" && !Number.isNaN(k);
|
|
2085
|
+
if (g === "boolean") return typeof k == "boolean";
|
|
2086
|
+
if (g === "object") return k !== null && typeof k == "object" && !Array.isArray(k);
|
|
2087
|
+
if (g === "date") return k instanceof Date || !Number.isNaN(new Date(k).getTime());
|
|
2088
|
+
if (g === "email") return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(k));
|
|
2058
2089
|
if (g === "url")
|
|
2059
2090
|
try {
|
|
2060
|
-
return new URL(String(
|
|
2091
|
+
return new URL(String(k)), !0;
|
|
2061
2092
|
} catch {
|
|
2062
2093
|
return !1;
|
|
2063
2094
|
}
|
|
2064
|
-
return g === "string" ? typeof
|
|
2065
|
-
},
|
|
2095
|
+
return g === "string" ? typeof k == "string" : !0;
|
|
2096
|
+
}, T = (g, k, D) => typeof g.validator != "function" ? Promise.resolve(!0) : new Promise((H) => {
|
|
2066
2097
|
let N = !1;
|
|
2067
|
-
const
|
|
2098
|
+
const P = (G) => {
|
|
2068
2099
|
if (!N) {
|
|
2069
2100
|
if (N = !0, G == null) {
|
|
2070
2101
|
H(!0);
|
|
@@ -2075,65 +2106,65 @@ const we = (a) => {
|
|
|
2075
2106
|
return;
|
|
2076
2107
|
}
|
|
2077
2108
|
if (Array.isArray(G)) {
|
|
2078
|
-
const
|
|
2079
|
-
H(
|
|
2109
|
+
const Ee = G[0];
|
|
2110
|
+
H(Ee instanceof Error ? Ee.message : String(Ee || p(g, D)));
|
|
2080
2111
|
return;
|
|
2081
2112
|
}
|
|
2082
2113
|
H(String(G));
|
|
2083
2114
|
}
|
|
2084
2115
|
};
|
|
2085
2116
|
try {
|
|
2086
|
-
const G = g.validator(g,
|
|
2087
|
-
G && typeof G.then == "function" ? G.then(() =>
|
|
2117
|
+
const G = g.validator(g, k, P);
|
|
2118
|
+
G && typeof G.then == "function" ? G.then(() => P()).catch(P) : G === !1 ? P(p(g, D)) : typeof G == "string" || G instanceof Error ? P(G) : g.validator.length < 3 && P();
|
|
2088
2119
|
} catch (G) {
|
|
2089
|
-
|
|
2120
|
+
P(G);
|
|
2090
2121
|
}
|
|
2091
|
-
}),
|
|
2092
|
-
const H = typeof g.transform == "function" ? g.transform(
|
|
2122
|
+
}), j = async (g, k, D) => {
|
|
2123
|
+
const H = typeof g.transform == "function" ? g.transform(k) : k, N = w(H);
|
|
2093
2124
|
if (g.required && N) return p(g, D);
|
|
2094
2125
|
if (N && !g.required) return !0;
|
|
2095
2126
|
if (g.whitespace && typeof H == "string" && H.trim() === "" || g.type && !K(g.type, H) || Array.isArray(g.enum) && !g.enum.includes(H) || g.pattern && !new RegExp(g.pattern).test(String(H))) return p(g, D);
|
|
2096
|
-
const
|
|
2097
|
-
return g.len !== void 0 &&
|
|
2098
|
-
},
|
|
2099
|
-
const
|
|
2100
|
-
return !g.key || !
|
|
2101
|
-
}, Ve = (g,
|
|
2102
|
-
const g = a(),
|
|
2127
|
+
const P = U(H);
|
|
2128
|
+
return g.len !== void 0 && P !== void 0 && P !== g.len || g.min !== void 0 && P !== void 0 && P < g.min || g.max !== void 0 && P !== void 0 && P > g.max ? p(g, D) : T(g, H, D);
|
|
2129
|
+
}, Ce = (g) => {
|
|
2130
|
+
const k = a();
|
|
2131
|
+
return !g.key || !k.table.column.show.list.includes(g.key) || g.table?.header?.groupKey !== void 0 && !g.table.header.show ? !1 : g.show?.table !== void 0 ? E.isFun(g.show?.table, k.table.data) : !0;
|
|
2132
|
+
}, Ve = (g, k) => g.show?.form !== void 0 ? E.isFun(g.show.form, k, E.EDialog.Update) : !0, _ = () => {
|
|
2133
|
+
const g = a(), k = [], D = (H) => {
|
|
2103
2134
|
H.forEach((N) => {
|
|
2104
|
-
if (
|
|
2135
|
+
if (Ce(N)) {
|
|
2105
2136
|
if (N.children?.length) {
|
|
2106
2137
|
D(N.children);
|
|
2107
2138
|
return;
|
|
2108
2139
|
}
|
|
2109
|
-
|
|
2140
|
+
k.push(N);
|
|
2110
2141
|
}
|
|
2111
2142
|
});
|
|
2112
2143
|
};
|
|
2113
|
-
return D(g.table.column.list),
|
|
2114
|
-
},
|
|
2115
|
-
if (!Ve(
|
|
2116
|
-
return m(g,
|
|
2117
|
-
const D = f(
|
|
2144
|
+
return D(g.table.column.list), k;
|
|
2145
|
+
}, Se = async (g, k) => {
|
|
2146
|
+
if (!Ve(k, g))
|
|
2147
|
+
return m(g, k), !0;
|
|
2148
|
+
const D = f(k, g);
|
|
2118
2149
|
if (!D) return !0;
|
|
2119
|
-
m(g,
|
|
2150
|
+
m(g, k);
|
|
2120
2151
|
const H = Array.isArray(D) ? D : [D];
|
|
2121
2152
|
for (const N of H) {
|
|
2122
|
-
const
|
|
2123
|
-
if (
|
|
2124
|
-
return s[
|
|
2125
|
-
field:
|
|
2126
|
-
error:
|
|
2153
|
+
const P = await j(N, g[k.key], k);
|
|
2154
|
+
if (P !== !0)
|
|
2155
|
+
return s[n(g, k)] = P, {
|
|
2156
|
+
field: k.key,
|
|
2157
|
+
error: P
|
|
2127
2158
|
};
|
|
2128
2159
|
}
|
|
2129
2160
|
return !0;
|
|
2130
2161
|
}, te = (g) => {
|
|
2131
|
-
const
|
|
2162
|
+
const k = [], D = (H) => {
|
|
2132
2163
|
H.forEach((N) => {
|
|
2133
|
-
|
|
2164
|
+
k.push(N), Array.isArray(N.children) && N.children.length && D(N.children);
|
|
2134
2165
|
});
|
|
2135
2166
|
};
|
|
2136
|
-
return D(g),
|
|
2167
|
+
return D(g), k;
|
|
2137
2168
|
};
|
|
2138
2169
|
return {
|
|
2139
2170
|
tableEditValidate: {
|
|
@@ -2143,15 +2174,15 @@ const we = (a) => {
|
|
|
2143
2174
|
getFieldError: c,
|
|
2144
2175
|
validate: async () => {
|
|
2145
2176
|
if (d(), !o.option.table?.editMode) return !0;
|
|
2146
|
-
const g = a(),
|
|
2177
|
+
const g = a(), k = _(), D = te(g.table.data || []), N = (await Promise.all(D.flatMap((P) => k.map((G) => Se(P, G))))).filter((P) => P !== !0);
|
|
2147
2178
|
if (N.length)
|
|
2148
|
-
throw
|
|
2179
|
+
throw pe(N), !1;
|
|
2149
2180
|
return !0;
|
|
2150
2181
|
}
|
|
2151
2182
|
}
|
|
2152
2183
|
};
|
|
2153
2184
|
};
|
|
2154
|
-
class
|
|
2185
|
+
class ao {
|
|
2155
2186
|
/**
|
|
2156
2187
|
* 导出数据为 Excel 文件(.xlsx),自动触发浏览器下载
|
|
2157
2188
|
*
|
|
@@ -2166,17 +2197,17 @@ class Zt {
|
|
|
2166
2197
|
return s.forEach((d) => {
|
|
2167
2198
|
f[d.label] = u[d.key];
|
|
2168
2199
|
}), f;
|
|
2169
|
-
}),
|
|
2170
|
-
t.utils.book_append_sheet(
|
|
2200
|
+
}), l = t.utils.json_to_sheet(e), n = t.utils.book_new();
|
|
2201
|
+
t.utils.book_append_sheet(n, l, "Sheet1"), r ? typeof r == "function" && (r = r()) : r = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, t.writeFile(n, `${r}.xlsx`);
|
|
2171
2202
|
};
|
|
2172
2203
|
}
|
|
2173
|
-
const
|
|
2204
|
+
const no = (a, o) => ({
|
|
2174
2205
|
export: {
|
|
2175
2206
|
run: {
|
|
2176
2207
|
start: async (s) => {
|
|
2177
2208
|
let t = await a().export.run[s]();
|
|
2178
|
-
const e = o.option.column,
|
|
2179
|
-
|
|
2209
|
+
const e = o.option.column, l = ObjectUtil.deepMerge({ data: t, columns: e }, {}), n = o.option.tools?.export || {};
|
|
2210
|
+
n.before?.(l), ao.exportToExcel(l.data, l.columns, n.fileName);
|
|
2180
2211
|
},
|
|
2181
2212
|
select: async () => {
|
|
2182
2213
|
const s = a();
|
|
@@ -2190,7 +2221,7 @@ const xt = (a, o) => ({
|
|
|
2190
2221
|
return;
|
|
2191
2222
|
}
|
|
2192
2223
|
if (s.table.selection.list.length === 0)
|
|
2193
|
-
throw E.fail(
|
|
2224
|
+
throw E.fail(C.tCurd("selectDataToExport")), new Error(C.tCurd("selectDataToExport"));
|
|
2194
2225
|
return s.table.selection.list;
|
|
2195
2226
|
} catch (r) {
|
|
2196
2227
|
console.error(r);
|
|
@@ -2209,7 +2240,7 @@ const xt = (a, o) => ({
|
|
|
2209
2240
|
return;
|
|
2210
2241
|
}
|
|
2211
2242
|
if (s.table.data.length === 0)
|
|
2212
|
-
throw E.fail(
|
|
2243
|
+
throw E.fail(C.tCurd("noData")), new Error(C.tCurd("noData"));
|
|
2213
2244
|
return s.table.data;
|
|
2214
2245
|
} catch (r) {
|
|
2215
2246
|
console.error(r);
|
|
@@ -2244,9 +2275,9 @@ const xt = (a, o) => ({
|
|
|
2244
2275
|
r.export.loading || r.export.run.start(s);
|
|
2245
2276
|
}
|
|
2246
2277
|
}
|
|
2247
|
-
}),
|
|
2278
|
+
}), lo = (a, o) => ({
|
|
2248
2279
|
remove: {
|
|
2249
|
-
title:
|
|
2280
|
+
title: C.tCurd("deleteTitle"),
|
|
2250
2281
|
show: !1,
|
|
2251
2282
|
items: [],
|
|
2252
2283
|
loading: !1,
|
|
@@ -2255,7 +2286,7 @@ const xt = (a, o) => ({
|
|
|
2255
2286
|
},
|
|
2256
2287
|
open: (s) => {
|
|
2257
2288
|
if (s.length === 0) {
|
|
2258
|
-
E.fail(
|
|
2289
|
+
E.fail(C.tCurd("selectDataToDelete"));
|
|
2259
2290
|
return;
|
|
2260
2291
|
}
|
|
2261
2292
|
const r = a();
|
|
@@ -2271,7 +2302,7 @@ const xt = (a, o) => ({
|
|
|
2271
2302
|
await r({
|
|
2272
2303
|
[o.option.table?.rowKey]: s.remove.items.map((t) => t[o.option.table?.rowKey]),
|
|
2273
2304
|
items: s.remove.items
|
|
2274
|
-
}), E.success(
|
|
2305
|
+
}), E.success(C.tCurd("operationSuccess")), s.table.data.length <= 1 && s.page.num > 1 && (s.page.num -= 1), s.remove.close(), await s.table.getList();
|
|
2275
2306
|
} catch (t) {
|
|
2276
2307
|
console.error(t);
|
|
2277
2308
|
} finally {
|
|
@@ -2280,11 +2311,11 @@ const xt = (a, o) => ({
|
|
|
2280
2311
|
});
|
|
2281
2312
|
}
|
|
2282
2313
|
}
|
|
2283
|
-
}),
|
|
2314
|
+
}), ro = (a, o, s) => ({
|
|
2284
2315
|
apiDataMap: {},
|
|
2285
2316
|
getColumnSpan: (r, t) => {
|
|
2286
|
-
const e = a(),
|
|
2287
|
-
return
|
|
2317
|
+
const e = a(), l = e.update.formGrid?.length ? e.update.formGrid : t || [];
|
|
2318
|
+
return Ze(r, l, e.update.form, e.update.type, {
|
|
2288
2319
|
maxSpan: e.update.formMaxSpan || o.option.form?.maxSpan,
|
|
2289
2320
|
defaultSpan: o.option.form?.defaultSpan || B.config.form.defaultSpan
|
|
2290
2321
|
});
|
|
@@ -2294,36 +2325,36 @@ const xt = (a, o) => ({
|
|
|
2294
2325
|
r.initCurdConfig(), r.initColumnOptions(), r.initColumnForm();
|
|
2295
2326
|
},
|
|
2296
2327
|
initApiData: async (r) => {
|
|
2297
|
-
const t = a(), e = [],
|
|
2298
|
-
if (
|
|
2299
|
-
|
|
2328
|
+
const t = a(), e = [], l = (n) => {
|
|
2329
|
+
if (n.children?.length) {
|
|
2330
|
+
n.children.forEach((d) => l(d));
|
|
2300
2331
|
return;
|
|
2301
2332
|
}
|
|
2302
|
-
const u = le(
|
|
2303
|
-
|
|
2333
|
+
const u = le(n), f = () => {
|
|
2334
|
+
n.table?.format || (n.table ??= {}, n.table.format = (d) => n.options[u].data.find((c) => c.value === d[n.key])?.label ?? d[n.key]);
|
|
2304
2335
|
};
|
|
2305
|
-
if (
|
|
2306
|
-
if (t.apiDataMap[
|
|
2336
|
+
if (n.options?.[u]?.dataApi && n.options?.[u]?.dataApiConfig?.[r]) {
|
|
2337
|
+
if (t.apiDataMap[n.key] && n.options?.[u]?.dataApiConfig?.once) return;
|
|
2307
2338
|
const d = (async () => {
|
|
2308
2339
|
try {
|
|
2309
|
-
let m = await
|
|
2340
|
+
let m = await n.options?.[u]?.dataApi?.(t.update.form, t.update.type);
|
|
2310
2341
|
if (m) {
|
|
2311
|
-
const c =
|
|
2312
|
-
!Array.isArray(m) && c && (m = ObjectUtil.getPathValue(m, c)),
|
|
2313
|
-
const p =
|
|
2314
|
-
|
|
2342
|
+
const c = n.options?.[u]?.dataPath;
|
|
2343
|
+
!Array.isArray(m) && c && (m = ObjectUtil.getPathValue(m, c)), n.options[u].data = m, n.options.search[u].data = m;
|
|
2344
|
+
const p = n.options.search.type ?? u;
|
|
2345
|
+
n.options.search[p] ??= {}, n.options.search[p].data = m, n.options.formAdd[u].data = m, n.options.formUpdate[u].data = m, f(), t.apiDataMap[n.key] = m;
|
|
2315
2346
|
}
|
|
2316
2347
|
} catch {
|
|
2317
2348
|
}
|
|
2318
2349
|
})();
|
|
2319
2350
|
e.push(d);
|
|
2320
|
-
} else Array.isArray(
|
|
2351
|
+
} else Array.isArray(n.options?.[u]?.data) && f();
|
|
2321
2352
|
};
|
|
2322
|
-
return o.option.column.forEach((
|
|
2353
|
+
return o.option.column.forEach((n) => l(n)), await Promise.all(e), !0;
|
|
2323
2354
|
},
|
|
2324
2355
|
initCurdConfig: () => {
|
|
2325
2356
|
const r = ObjectUtil.deepMerge(B.config, {});
|
|
2326
|
-
r.table.emptyText =
|
|
2357
|
+
r.table.emptyText = C.tCurd("noData"), o.option.size = o.option.size || {}, r.table.size = o.option.size.table || r.size.table, r.form.size = o.option.size.form || r.size.form, r.size.search = o.option.size.search || r.size.search;
|
|
2327
2358
|
const t = ObjectUtil.deepMerge(r, o.option || {});
|
|
2328
2359
|
Object.keys(t).forEach((e) => {
|
|
2329
2360
|
o.option[e] = t[e];
|
|
@@ -2335,31 +2366,31 @@ const xt = (a, o) => ({
|
|
|
2335
2366
|
t.options = ObjectUtil.deepMerge(
|
|
2336
2367
|
{
|
|
2337
2368
|
switch: {
|
|
2338
|
-
activeText:
|
|
2339
|
-
inactiveText:
|
|
2369
|
+
activeText: C.tCurd("switchOn"),
|
|
2370
|
+
inactiveText: C.tCurd("switchOff")
|
|
2340
2371
|
}
|
|
2341
2372
|
},
|
|
2342
2373
|
t.options
|
|
2343
2374
|
);
|
|
2344
|
-
const e = (
|
|
2345
|
-
const
|
|
2375
|
+
const e = (l) => {
|
|
2376
|
+
const n = le(l);
|
|
2346
2377
|
for (const f in t) {
|
|
2347
2378
|
if (f === "table") {
|
|
2348
|
-
if (
|
|
2349
|
-
|
|
2379
|
+
if (l.table = ObjectUtil.deepMerge(t.table, l.table || {}), l.children) {
|
|
2380
|
+
l.children.forEach((d) => e(d));
|
|
2350
2381
|
return;
|
|
2351
2382
|
}
|
|
2352
|
-
} else f === "type" ?
|
|
2353
|
-
|
|
2383
|
+
} else f === "type" ? l.type = l.type || t.type : l[f] = ObjectUtil.deepMerge(t[f], l[f] || {});
|
|
2384
|
+
l.options = l.options || {}, l.options[n] = l.options[n] || {}, l.options[n].size = o.option.size.form;
|
|
2354
2385
|
}
|
|
2355
2386
|
["search", "formAdd", "formUpdate"].forEach((f) => {
|
|
2356
|
-
|
|
2357
|
-
}),
|
|
2358
|
-
const m =
|
|
2387
|
+
l.options[f] = ObjectUtil.deepMerge(l.options, l.options[f] || {}), f === "search" ? o.option.size.search && (l.options[f][n].size = o.option.size.search) : o.option.size.form && (l.options[f][n].size = o.option.size.form);
|
|
2388
|
+
}), l.table = ObjectUtil.deepMerge(l.table, l.options[n].table || {}), n === "switch" && (l.options.switch.tableBeforeChange = async (f, d) => {
|
|
2389
|
+
const m = l.options?.switch;
|
|
2359
2390
|
try {
|
|
2360
2391
|
m.tableConfig?.confirm && await s.switchConfirmRef.value?.open({
|
|
2361
|
-
title:
|
|
2362
|
-
content:
|
|
2392
|
+
title: C.tCurd("confirmModify"),
|
|
2393
|
+
content: C.tCurd("confirmSwitchMessage")
|
|
2363
2394
|
});
|
|
2364
2395
|
try {
|
|
2365
2396
|
if (!o.option.api.update && !m.tableConfig?.api) return;
|
|
@@ -2368,13 +2399,13 @@ const xt = (a, o) => ({
|
|
|
2368
2399
|
const p = d[f] === m.activeValue ? m.inactiveValue : m.activeValue, w = m.tableConfig?.api ? m.tableConfig.api : o.option.api.update;
|
|
2369
2400
|
if (!w) return;
|
|
2370
2401
|
try {
|
|
2371
|
-
await w({ ...d, [f]: p }, "switch");
|
|
2402
|
+
await w({ ...d, [f]: p }, "switch"), m.tableConfig?.needTip !== !1 && E.success(C.tCurd("operationSuccess"));
|
|
2372
2403
|
} catch {
|
|
2373
2404
|
return !1;
|
|
2374
2405
|
} finally {
|
|
2375
2406
|
m.loadingMap[c].loading = !1;
|
|
2376
2407
|
}
|
|
2377
|
-
return
|
|
2408
|
+
return m.tableConfig?.loadList && (r.table.loading = !0, r.table.getList(), r.table.loading = !1), !0;
|
|
2378
2409
|
} catch (c) {
|
|
2379
2410
|
return console.error(c), !1;
|
|
2380
2411
|
} finally {
|
|
@@ -2383,14 +2414,14 @@ const xt = (a, o) => ({
|
|
|
2383
2414
|
} catch {
|
|
2384
2415
|
return !1;
|
|
2385
2416
|
}
|
|
2386
|
-
}),
|
|
2417
|
+
}), n === "treeSelect" && (l.options.treeSelect.rowKey = o.option.table?.rowKey, l.options.treeSelect.nodeKey = o.option.table?.rowKey);
|
|
2387
2418
|
};
|
|
2388
2419
|
o.option.column.forEach(e), o.option.table?.column?.forEach(e);
|
|
2389
2420
|
},
|
|
2390
2421
|
initColumnForm: () => {
|
|
2391
2422
|
const r = a(), t = o.option;
|
|
2392
2423
|
r.update.formColumn = [], r.update.formGrid = [], r.update.formMaxSpan = 12, r.table.column.show = { list: [], listSource: [] };
|
|
2393
|
-
const e = o.option.form?.maxSpan || 12,
|
|
2424
|
+
const e = o.option.form?.maxSpan || 12, l = o.option.form?.defaultSpan || e / 2, n = at(o.option.form), u = (c) => {
|
|
2394
2425
|
if (c.children) {
|
|
2395
2426
|
r.table.column.show.list.push(c.key), c.children.forEach((p) => u(p));
|
|
2396
2427
|
return;
|
|
@@ -2401,13 +2432,13 @@ const xt = (a, o) => ({
|
|
|
2401
2432
|
ke(c, !0), u(c);
|
|
2402
2433
|
}), o.option.table?.column?.forEach((c) => {
|
|
2403
2434
|
ke(c, !1), u(c);
|
|
2404
|
-
}), r.search.column.list = t.column.concat(t.table?.column || []), r.table.column.list = r.search.column.list.filter((c) => c.table?.table), r.search.column.list.sort((c, p) => c.sort?.search - p.sort?.search), r.table.column.list.sort((c, p) => c.sort?.table - p.sort?.table), r.update.rules = {}, Re(t.column, r.update.formDefault, r.update.rules, (c) =>
|
|
2405
|
-
const f =
|
|
2435
|
+
}), r.search.column.list = t.column.concat(t.table?.column || []), r.table.column.list = r.search.column.list.filter((c) => c.table?.table), r.search.column.list.sort((c, p) => c.sort?.search - p.sort?.search), r.table.column.list.sort((c, p) => c.sort?.table - p.sort?.table), r.update.rules = {}, Re(t.column, r.update.formDefault, r.update.rules, (c) => n(c, () => r.update.form)), t.table?.editMode && Re(t.table?.column || [], r.update.formDefault, r.update.rules, (c) => n(c, () => r.update.form));
|
|
2436
|
+
const f = et(t.column, {
|
|
2406
2437
|
maxSpan: e,
|
|
2407
|
-
defaultSpan:
|
|
2438
|
+
defaultSpan: l,
|
|
2408
2439
|
layout: o.option.form?.layout
|
|
2409
2440
|
});
|
|
2410
|
-
r.update.formGrid = f.cells, r.update.formMaxSpan = f.maxSpan, r.update.formColumn =
|
|
2441
|
+
r.update.formGrid = f.cells, r.update.formMaxSpan = f.maxSpan, r.update.formColumn = _e(f.cells);
|
|
2411
2442
|
const d = o.option.search?.formDefault;
|
|
2412
2443
|
d && Object.keys(d).forEach((c) => {
|
|
2413
2444
|
r.search.formDefault[c] = d[c];
|
|
@@ -2417,8 +2448,8 @@ const xt = (a, o) => ({
|
|
|
2417
2448
|
const m = ObjectUtil.deepMerge(r.search.formDefault, {});
|
|
2418
2449
|
x.setValue(r.search.form, m, !0);
|
|
2419
2450
|
}
|
|
2420
|
-
}),
|
|
2421
|
-
const o = Y(), s = Y(), r = Y(), t = { switchConfirmRef: o, ruleFormRef: s, tableRef: r }, e =
|
|
2451
|
+
}), io = (a) => {
|
|
2452
|
+
const o = Y(), s = Y(), r = Y(), t = { switchConfirmRef: o, ruleFormRef: s, tableRef: r }, e = Ge(), l = Fe.getConf("curdConf"), n = (m) => {
|
|
2422
2453
|
m = m || f;
|
|
2423
2454
|
let c = m, p = m;
|
|
2424
2455
|
for (; c?.parentCurdConf; )
|
|
@@ -2426,31 +2457,31 @@ const xt = (a, o) => ({
|
|
|
2426
2457
|
return p;
|
|
2427
2458
|
}, u = () => f;
|
|
2428
2459
|
let f = ie({
|
|
2429
|
-
parentCurdConf:
|
|
2430
|
-
getCurdConf:
|
|
2431
|
-
getRootCurdConf:
|
|
2432
|
-
...
|
|
2460
|
+
parentCurdConf: l,
|
|
2461
|
+
getCurdConf: n,
|
|
2462
|
+
getRootCurdConf: n,
|
|
2463
|
+
...xt(),
|
|
2433
2464
|
option: a.option,
|
|
2434
|
-
...Jt(u, a),
|
|
2435
|
-
...Qt(u, a),
|
|
2436
|
-
...Xt(u, a, t),
|
|
2437
|
-
...Yt(u, a),
|
|
2438
|
-
...xt(u, a),
|
|
2439
|
-
...Dt(u, a, t),
|
|
2440
2465
|
..._t(u, a),
|
|
2441
|
-
...eo(u, a,
|
|
2466
|
+
...eo(u, a),
|
|
2467
|
+
...to(u, a, t),
|
|
2468
|
+
...oo(u, a),
|
|
2469
|
+
...no(u, a),
|
|
2470
|
+
...jt(u, a, t),
|
|
2471
|
+
...lo(u, a),
|
|
2472
|
+
...ro(u, a, t)
|
|
2442
2473
|
});
|
|
2443
2474
|
f.init();
|
|
2444
2475
|
const d = e ? `curdRef-${e.uid}` : "";
|
|
2445
|
-
return
|
|
2476
|
+
return l?.formRef && d && (l.formRef.set(d, {
|
|
2446
2477
|
validate: async (m) => {
|
|
2447
2478
|
const c = await f.update.validate(!1);
|
|
2448
2479
|
if (m?.(!!c), !c) throw !1;
|
|
2449
2480
|
return !0;
|
|
2450
2481
|
}
|
|
2451
|
-
}),
|
|
2452
|
-
|
|
2453
|
-
})),
|
|
2482
|
+
}), Ie(() => {
|
|
2483
|
+
l.formRef.remove(d);
|
|
2484
|
+
})), He(() => {
|
|
2454
2485
|
if (a.option.init !== !1) {
|
|
2455
2486
|
if (a.option.table?.sortable?.show && !a.option.table?.sortable?.button) {
|
|
2456
2487
|
(f.table?.sortable.getOption()).scroll || (a.option.table.fitHeight = !1), f.table.sortable.refreshList();
|
|
@@ -2458,28 +2489,28 @@ const xt = (a, o) => ({
|
|
|
2458
2489
|
}
|
|
2459
2490
|
f.table.getList();
|
|
2460
2491
|
}
|
|
2461
|
-
}),
|
|
2492
|
+
}), yt(() => {
|
|
2462
2493
|
f.table.sortable.destroy();
|
|
2463
2494
|
}), Fe.setConf("curdConf", f), { conf: f, switchConfirmRef: o, ruleFormRef: s, tableRef: r };
|
|
2464
|
-
},
|
|
2495
|
+
}, so = { class: "dialog-footer" }, uo = /* @__PURE__ */ Q({
|
|
2465
2496
|
__name: "switchConfirm",
|
|
2466
2497
|
props: {
|
|
2467
2498
|
size: {}
|
|
2468
2499
|
},
|
|
2469
2500
|
setup(a, { expose: o }) {
|
|
2470
2501
|
const s = Y(!1), r = Y("确认修改"), t = Y("确认要修改状态吗?");
|
|
2471
|
-
let e = null,
|
|
2472
|
-
const
|
|
2473
|
-
e = m,
|
|
2502
|
+
let e = null, l = null;
|
|
2503
|
+
const n = (d) => (d?.title && (r.value = d.title), d?.content && (t.value = d.content), s.value = !0, new Promise((m, c) => {
|
|
2504
|
+
e = m, l = c;
|
|
2474
2505
|
})), u = () => {
|
|
2475
|
-
s.value = !1, e?.(!0), e = null,
|
|
2506
|
+
s.value = !1, e?.(!0), e = null, l = null;
|
|
2476
2507
|
}, f = () => {
|
|
2477
|
-
s.value = !1,
|
|
2508
|
+
s.value = !1, l?.(new Error("用户取消操作")), e = null, l = null;
|
|
2478
2509
|
};
|
|
2479
2510
|
return o({
|
|
2480
|
-
open:
|
|
2511
|
+
open: n
|
|
2481
2512
|
}), (d, m) => {
|
|
2482
|
-
const c =
|
|
2513
|
+
const c = ce("el-form");
|
|
2483
2514
|
return b(), h(i($e), {
|
|
2484
2515
|
modelValue: s.value,
|
|
2485
2516
|
"onUpdate:modelValue": m[0] || (m[0] = (p) => s.value = p),
|
|
@@ -2488,21 +2519,21 @@ const xt = (a, o) => ({
|
|
|
2488
2519
|
width: "400px"
|
|
2489
2520
|
}, {
|
|
2490
2521
|
footer: y(() => [
|
|
2491
|
-
|
|
2522
|
+
O(c, { size: d.size }, {
|
|
2492
2523
|
default: y(() => [
|
|
2493
|
-
|
|
2494
|
-
|
|
2524
|
+
F("span", so, [
|
|
2525
|
+
O(i(L), { onClick: f }, {
|
|
2495
2526
|
default: y(() => m[1] || (m[1] = [
|
|
2496
|
-
|
|
2527
|
+
M("取消")
|
|
2497
2528
|
])),
|
|
2498
2529
|
_: 1
|
|
2499
2530
|
}),
|
|
2500
|
-
|
|
2531
|
+
O(i(L), {
|
|
2501
2532
|
type: "primary",
|
|
2502
2533
|
onClick: u
|
|
2503
2534
|
}, {
|
|
2504
2535
|
default: y(() => m[2] || (m[2] = [
|
|
2505
|
-
|
|
2536
|
+
M("确认")
|
|
2506
2537
|
])),
|
|
2507
2538
|
_: 1
|
|
2508
2539
|
})
|
|
@@ -2512,13 +2543,13 @@ const xt = (a, o) => ({
|
|
|
2512
2543
|
}, 8, ["size"])
|
|
2513
2544
|
]),
|
|
2514
2545
|
default: y(() => [
|
|
2515
|
-
|
|
2546
|
+
F("div", null, R(t.value), 1)
|
|
2516
2547
|
]),
|
|
2517
2548
|
_: 1
|
|
2518
2549
|
}, 8, ["modelValue", "title"]);
|
|
2519
2550
|
};
|
|
2520
2551
|
}
|
|
2521
|
-
}),
|
|
2552
|
+
}), fo = ["innerHTML"], co = /* @__PURE__ */ Q({
|
|
2522
2553
|
__name: "text",
|
|
2523
2554
|
props: {
|
|
2524
2555
|
content: {},
|
|
@@ -2526,12 +2557,12 @@ const xt = (a, o) => ({
|
|
|
2526
2557
|
},
|
|
2527
2558
|
setup(a) {
|
|
2528
2559
|
const o = a, s = ae(() => typeof o.content == "function" ? o.content(o.value) : o.content);
|
|
2529
|
-
return (r, t) => typeof s.value == "object" ? (b(), h(ee(s.value), { key: 0 })) : (b(),
|
|
2560
|
+
return (r, t) => typeof s.value == "object" ? (b(), h(ee(s.value), { key: 0 })) : (b(), v("div", {
|
|
2530
2561
|
key: 1,
|
|
2531
2562
|
innerHTML: s.value
|
|
2532
|
-
}, null, 8,
|
|
2563
|
+
}, null, 8, fo));
|
|
2533
2564
|
}
|
|
2534
|
-
}),
|
|
2565
|
+
}), Le = /* @__PURE__ */ Q({
|
|
2535
2566
|
__name: "searchField",
|
|
2536
2567
|
props: {
|
|
2537
2568
|
item: {},
|
|
@@ -2551,27 +2582,27 @@ const xt = (a, o) => ({
|
|
|
2551
2582
|
t.options?.radio,
|
|
2552
2583
|
t.options?.select
|
|
2553
2584
|
];
|
|
2554
|
-
for (const
|
|
2555
|
-
if (Array.isArray(
|
|
2556
|
-
return
|
|
2585
|
+
for (const l of e)
|
|
2586
|
+
if (Array.isArray(l?.data) && l.data.length > 0)
|
|
2587
|
+
return l.data;
|
|
2557
2588
|
return [];
|
|
2558
2589
|
};
|
|
2559
|
-
return (t, e) => i(q).customComponent[t.type ?? ""]?.search ? (b(), h(ee(i(q).customComponent[t.type ?? ""]?.search),
|
|
2590
|
+
return (t, e) => i(q).customComponent[t.type ?? ""]?.search ? (b(), h(ee(i(q).customComponent[t.type ?? ""]?.search), V({
|
|
2560
2591
|
key: 0,
|
|
2561
2592
|
modelValue: s.value,
|
|
2562
|
-
"onUpdate:modelValue": e[0] || (e[0] = (
|
|
2563
|
-
}, t.item.options?.search?.[t.type ?? ""], z(t.item.options?.search?.[t.type ?? ""]?.on || {})), null, 16, ["modelValue"])) : t.type === "input" ? (b(), h(i(
|
|
2593
|
+
"onUpdate:modelValue": e[0] || (e[0] = (l) => s.value = l)
|
|
2594
|
+
}, t.item.options?.search?.[t.type ?? ""], z(t.item.options?.search?.[t.type ?? ""]?.on || {})), null, 16, ["modelValue"])) : t.type === "input" ? (b(), h(i(ue), V({
|
|
2564
2595
|
key: 1,
|
|
2565
2596
|
modelValue: s.value,
|
|
2566
|
-
"onUpdate:modelValue": e[1] || (e[1] = (
|
|
2597
|
+
"onUpdate:modelValue": e[1] || (e[1] = (l) => s.value = l),
|
|
2567
2598
|
placeholder: t.conf.search.getPlaceholder(t.item),
|
|
2568
2599
|
clearable: "",
|
|
2569
2600
|
disabled: t.item.disabled?.search
|
|
2570
|
-
}, t.item.options?.search?.input || t.item.options?.input, z(t.item.options?.search?.input?.on || t.item.options?.input?.on || {})), null, 16, ["modelValue", "placeholder", "disabled"])) : t.type === "switch" ? (b(), h(i(
|
|
2601
|
+
}, t.item.options?.search?.input || t.item.options?.input, z(t.item.options?.search?.input?.on || t.item.options?.input?.on || {})), null, 16, ["modelValue", "placeholder", "disabled"])) : t.type === "switch" ? (b(), h(i(fe), V({
|
|
2571
2602
|
key: 2,
|
|
2572
2603
|
modelValue: s.value,
|
|
2573
|
-
"onUpdate:modelValue": e[2] || (e[2] = (
|
|
2574
|
-
placeholder: t.conf.search.getPlaceholder(t.item, i(
|
|
2604
|
+
"onUpdate:modelValue": e[2] || (e[2] = (l) => s.value = l),
|
|
2605
|
+
placeholder: t.conf.search.getPlaceholder(t.item, i(C).tCurd("placeholderSelect")),
|
|
2575
2606
|
clearable: "",
|
|
2576
2607
|
disabled: t.item.disabled?.search
|
|
2577
2608
|
}, t.item.options?.search?.switch || t.item.options?.switch, z(t.item.options?.search?.switch?.on || t.item.options?.switch?.on || {})), {
|
|
@@ -2588,138 +2619,120 @@ const xt = (a, o) => ({
|
|
|
2588
2619
|
}, null, 8, ["label", "value"]))
|
|
2589
2620
|
]),
|
|
2590
2621
|
_: 1
|
|
2591
|
-
}, 16, ["modelValue", "placeholder", "disabled"])) : t.type === "select" ? (b(), h(i(
|
|
2622
|
+
}, 16, ["modelValue", "placeholder", "disabled"])) : t.type === "select" ? (b(), h(i(fe), V({
|
|
2592
2623
|
key: 3,
|
|
2593
2624
|
modelValue: s.value,
|
|
2594
|
-
"onUpdate:modelValue": e[3] || (e[3] = (
|
|
2595
|
-
placeholder: t.conf.search.getPlaceholder(t.item, i(
|
|
2625
|
+
"onUpdate:modelValue": e[3] || (e[3] = (l) => s.value = l),
|
|
2626
|
+
placeholder: t.conf.search.getPlaceholder(t.item, i(C).tCurd("placeholderSelect")),
|
|
2596
2627
|
clearable: "",
|
|
2597
2628
|
disabled: t.item.disabled?.search
|
|
2598
2629
|
}, t.item.options?.search?.select || t.item.options?.select, z(t.item.options?.search?.select?.on || t.item.options?.select?.on || {})), {
|
|
2599
2630
|
default: y(() => [
|
|
2600
|
-
(b(!0),
|
|
2601
|
-
key:
|
|
2602
|
-
label:
|
|
2603
|
-
value:
|
|
2631
|
+
(b(!0), v(A, null, I(r(t.item), (l) => (b(), h(i(ne), {
|
|
2632
|
+
key: l.value,
|
|
2633
|
+
label: l.label,
|
|
2634
|
+
value: l.value
|
|
2604
2635
|
}, null, 8, ["label", "value"]))), 128))
|
|
2605
2636
|
]),
|
|
2606
2637
|
_: 1
|
|
2607
|
-
}, 16, ["modelValue", "placeholder", "disabled"])) : t.type === "radio" ? (b(), h(i(
|
|
2638
|
+
}, 16, ["modelValue", "placeholder", "disabled"])) : t.type === "radio" ? (b(), h(i(Te), V({
|
|
2608
2639
|
key: 4,
|
|
2609
2640
|
modelValue: s.value,
|
|
2610
|
-
"onUpdate:modelValue": e[4] || (e[4] = (
|
|
2641
|
+
"onUpdate:modelValue": e[4] || (e[4] = (l) => s.value = l),
|
|
2611
2642
|
disabled: t.item.disabled?.search
|
|
2612
2643
|
}, t.item.options?.search?.radio || t.item.options?.radio, z(t.item.options?.search?.radio?.on || t.item.options?.radio?.on || {})), {
|
|
2613
2644
|
default: y(() => [
|
|
2614
|
-
(t.item.options?.search?.radio?.type || t.item.options?.radio?.type) === "group" ? (b(!0),
|
|
2615
|
-
key:
|
|
2645
|
+
(t.item.options?.search?.radio?.type || t.item.options?.radio?.type) === "group" ? (b(!0), v(A, { key: 0 }, I(r(t.item), (l) => (b(), h(i(je), V({
|
|
2646
|
+
key: l.value,
|
|
2616
2647
|
ref_for: !0
|
|
2617
|
-
},
|
|
2618
|
-
key:
|
|
2648
|
+
}, l, z(l.on || {})), null, 16))), 128)) : (b(!0), v(A, { key: 1 }, I(r(t.item), (l) => (b(), h(i(Pe), V({
|
|
2649
|
+
key: l.value,
|
|
2619
2650
|
ref_for: !0
|
|
2620
|
-
},
|
|
2651
|
+
}, l, z(l.on || {})), null, 16))), 128))
|
|
2621
2652
|
]),
|
|
2622
2653
|
_: 1
|
|
2623
|
-
}, 16, ["modelValue", "disabled"])) : t.type === "datetime" ? (b(), h(i(
|
|
2654
|
+
}, 16, ["modelValue", "disabled"])) : t.type === "datetime" ? (b(), h(i(Ke), V({
|
|
2624
2655
|
key: 5,
|
|
2625
2656
|
modelValue: s.value,
|
|
2626
|
-
"onUpdate:modelValue": e[5] || (e[5] = (
|
|
2657
|
+
"onUpdate:modelValue": e[5] || (e[5] = (l) => s.value = l),
|
|
2627
2658
|
disabled: t.item.disabled?.search
|
|
2628
|
-
}, t.item.options?.search?.datetime || t.item.options?.datetime, z(t.item.options?.search?.datetime?.on || t.item.options?.datetime?.on || {})), null, 16, ["modelValue", "disabled"])) : t.type && i(q).customComponent[t.type] ? (b(), h(ee(i(q).customComponent[t.type]),
|
|
2659
|
+
}, t.item.options?.search?.datetime || t.item.options?.datetime, z(t.item.options?.search?.datetime?.on || t.item.options?.datetime?.on || {})), null, 16, ["modelValue", "disabled"])) : t.type && i(q).customComponent[t.type] ? (b(), h(ee(i(q).customComponent[t.type]), V({
|
|
2629
2660
|
key: 6,
|
|
2630
2661
|
modelValue: s.value,
|
|
2631
|
-
"onUpdate:modelValue": e[6] || (e[6] = (
|
|
2662
|
+
"onUpdate:modelValue": e[6] || (e[6] = (l) => s.value = l)
|
|
2632
2663
|
}, t.item.options?.search?.[t.type] || t.item.options?.[t.type], z(t.item.options?.search?.[t.type]?.on || t.item.options?.[t.type]?.on || {}), {
|
|
2633
2664
|
disabled: t.item.disabled?.search
|
|
2634
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
2665
|
+
}), null, 16, ["modelValue", "disabled"])) : S("", !0);
|
|
2635
2666
|
}
|
|
2636
|
-
}),
|
|
2637
|
-
const s = a.__vccOpts || a;
|
|
2638
|
-
for (const [r, t] of o)
|
|
2639
|
-
s[r] = t;
|
|
2640
|
-
return s;
|
|
2641
|
-
}, ro = {}, io = {
|
|
2667
|
+
}), po = {}, mo = {
|
|
2642
2668
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2643
2669
|
viewBox: "64 64 896 896"
|
|
2644
2670
|
};
|
|
2645
|
-
function
|
|
2646
|
-
return b(),
|
|
2647
|
-
|
|
2671
|
+
function bo(a, o) {
|
|
2672
|
+
return b(), v("svg", mo, o[0] || (o[0] = [
|
|
2673
|
+
F("path", {
|
|
2648
2674
|
fill: "currentColor",
|
|
2649
2675
|
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"
|
|
2650
2676
|
}, null, -1)
|
|
2651
2677
|
]));
|
|
2652
2678
|
}
|
|
2653
|
-
const
|
|
2679
|
+
const go = /* @__PURE__ */ se(po, [["render", bo]]), ho = {}, yo = {
|
|
2654
2680
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2655
2681
|
viewBox: "64 64 896 896"
|
|
2656
2682
|
};
|
|
2657
|
-
function
|
|
2658
|
-
return b(),
|
|
2659
|
-
|
|
2683
|
+
function wo(a, o) {
|
|
2684
|
+
return b(), v("svg", yo, o[0] || (o[0] = [
|
|
2685
|
+
F("path", {
|
|
2660
2686
|
fill: "currentColor",
|
|
2661
2687
|
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"
|
|
2662
2688
|
}, null, -1)
|
|
2663
2689
|
]));
|
|
2664
2690
|
}
|
|
2665
|
-
const
|
|
2691
|
+
const ko = /* @__PURE__ */ se(ho, [["render", wo]]), vo = {}, Co = {
|
|
2666
2692
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2667
2693
|
viewBox: "0 0 1024 1024"
|
|
2668
2694
|
};
|
|
2669
|
-
function
|
|
2670
|
-
return b(),
|
|
2671
|
-
|
|
2695
|
+
function Vo(a, o) {
|
|
2696
|
+
return b(), v("svg", Co, o[0] || (o[0] = [
|
|
2697
|
+
F("path", {
|
|
2672
2698
|
fill: "currentColor",
|
|
2673
2699
|
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"
|
|
2674
2700
|
}, null, -1)
|
|
2675
2701
|
]));
|
|
2676
2702
|
}
|
|
2677
|
-
const
|
|
2703
|
+
const So = /* @__PURE__ */ se(vo, [["render", Vo]]), Eo = {}, zo = {
|
|
2678
2704
|
"data-v-58697b5c": "",
|
|
2679
2705
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2680
2706
|
viewBox: "0 0 1024 1024"
|
|
2681
2707
|
};
|
|
2682
|
-
function
|
|
2683
|
-
return b(),
|
|
2684
|
-
|
|
2685
|
-
fill: "currentColor",
|
|
2686
|
-
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"
|
|
2687
|
-
}, null, -1)
|
|
2688
|
-
]));
|
|
2689
|
-
}
|
|
2690
|
-
const rt = /* @__PURE__ */ se(wo, [["render", ko]]), Co = {}, So = {
|
|
2691
|
-
"data-v-58697b5c": "",
|
|
2692
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2693
|
-
viewBox: "0 0 1024 1024"
|
|
2694
|
-
};
|
|
2695
|
-
function Vo(a, o) {
|
|
2696
|
-
return b(), C("svg", So, o[0] || (o[0] = [
|
|
2697
|
-
R("path", {
|
|
2708
|
+
function $o(a, o) {
|
|
2709
|
+
return b(), v("svg", zo, o[0] || (o[0] = [
|
|
2710
|
+
F("path", {
|
|
2698
2711
|
fill: "currentColor",
|
|
2699
2712
|
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"
|
|
2700
2713
|
}, null, -1)
|
|
2701
2714
|
]));
|
|
2702
2715
|
}
|
|
2703
|
-
const
|
|
2716
|
+
const Mo = /* @__PURE__ */ se(Eo, [["render", $o]]), Oo = {}, Fo = {
|
|
2704
2717
|
"data-v-58697b5c": "",
|
|
2705
2718
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2706
2719
|
viewBox: "0 0 1024 1024"
|
|
2707
2720
|
};
|
|
2708
|
-
function
|
|
2709
|
-
return b(),
|
|
2710
|
-
|
|
2721
|
+
function Ro(a, o) {
|
|
2722
|
+
return b(), v("svg", Fo, o[0] || (o[0] = [
|
|
2723
|
+
F("path", {
|
|
2711
2724
|
fill: "currentColor",
|
|
2712
2725
|
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"
|
|
2713
2726
|
}, null, -1)
|
|
2714
2727
|
]));
|
|
2715
2728
|
}
|
|
2716
|
-
const
|
|
2729
|
+
const Do = /* @__PURE__ */ se(Oo, [["render", Ro]]), Uo = { class: "row flex-center table-header-label inline" }, Ao = { class: "table-header-tooltip" }, Bo = ["innerHTML"], Lo = {
|
|
2717
2730
|
key: 1,
|
|
2718
2731
|
class: "table-header-required"
|
|
2719
|
-
},
|
|
2732
|
+
}, To = ["onClick"], jo = {
|
|
2720
2733
|
key: 0,
|
|
2721
2734
|
class: "table-edit-form"
|
|
2722
|
-
},
|
|
2735
|
+
}, Po = { key: 1 }, Ko = ["onClick", "innerHTML"], Ho = /* @__PURE__ */ Q({
|
|
2723
2736
|
__name: "tableColumn",
|
|
2724
2737
|
props: {
|
|
2725
2738
|
conf: {},
|
|
@@ -2727,135 +2740,135 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
|
|
|
2727
2740
|
option: {}
|
|
2728
2741
|
},
|
|
2729
2742
|
setup(a) {
|
|
2730
|
-
const o = E.isFun, s = a, t =
|
|
2731
|
-
return (
|
|
2732
|
-
const f =
|
|
2733
|
-
return b(!0),
|
|
2743
|
+
const o = E.isFun, s = a, t = Ge().type, e = (n) => n === !0 ? !0 : (Array.isArray(n) ? n : n ? [n] : []).some((f) => f?.required === !0), l = (n) => s.option.table?.editMode ? e(n.rules) || e(s.conf.update.rules?.[n.key]) : !1;
|
|
2744
|
+
return (n, u) => {
|
|
2745
|
+
const f = ce("el-tooltip");
|
|
2746
|
+
return b(!0), v(A, null, I(n.columnList, (d) => (b(), v(A, {
|
|
2734
2747
|
key: d.key
|
|
2735
2748
|
}, [
|
|
2736
|
-
|
|
2737
|
-
d.table?.header?.groupKey === void 0 || d.table.header.show ? (b(), h(i(
|
|
2749
|
+
n.conf.table.column.show.list.includes(d.key) && (d.show?.table === void 0 || i(o)(d.show?.table, n.conf.table.data)) ? (b(), v(A, { key: 0 }, [
|
|
2750
|
+
d.table?.header?.groupKey === void 0 || d.table.header.show ? (b(), h(i(de), V({
|
|
2738
2751
|
key: 0,
|
|
2739
2752
|
prop: d.key,
|
|
2740
2753
|
label: d.label,
|
|
2741
2754
|
ref_for: !0
|
|
2742
2755
|
}, d.table), {
|
|
2743
2756
|
header: y(() => [
|
|
2744
|
-
$(
|
|
2745
|
-
|
|
2757
|
+
$(n.$slots, "table-header-" + d.key, { item: d }, () => [
|
|
2758
|
+
F("div", Uo, [
|
|
2746
2759
|
d.table?.header?.tooltip ? (b(), h(f, {
|
|
2747
2760
|
key: 0,
|
|
2748
2761
|
effect: "dark",
|
|
2749
2762
|
placement: "top"
|
|
2750
2763
|
}, {
|
|
2751
2764
|
content: y(() => [
|
|
2752
|
-
|
|
2765
|
+
F("div", {
|
|
2753
2766
|
innerHTML: d.table?.header?.tooltip
|
|
2754
|
-
}, null, 8,
|
|
2767
|
+
}, null, 8, Bo)
|
|
2755
2768
|
]),
|
|
2756
2769
|
default: y(() => [
|
|
2757
|
-
|
|
2758
|
-
|
|
2770
|
+
F("span", Ao, [
|
|
2771
|
+
O(De)
|
|
2759
2772
|
])
|
|
2760
2773
|
]),
|
|
2761
2774
|
_: 2
|
|
2762
|
-
}, 1024)) :
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
d.table?.header?.group !== void 0 ? (b(),
|
|
2775
|
+
}, 1024)) : S("", !0),
|
|
2776
|
+
l(d) ? (b(), v("span", Lo, "*")) : S("", !0),
|
|
2777
|
+
M(" " + R(d.label) + " ", 1),
|
|
2778
|
+
d.table?.header?.group !== void 0 ? (b(), v("span", {
|
|
2766
2779
|
key: 2,
|
|
2767
2780
|
class: "table-header-plus",
|
|
2768
|
-
onClick:
|
|
2781
|
+
onClick: wt(
|
|
2769
2782
|
() => {
|
|
2770
|
-
d.table.header.group = !d.table.header.group,
|
|
2783
|
+
d.table.header.group = !d.table.header.group, n.columnList.forEach((m) => {
|
|
2771
2784
|
m.table?.header?.groupKey === d.key && (m.table.header.show = !d.table.header.group);
|
|
2772
2785
|
});
|
|
2773
2786
|
},
|
|
2774
2787
|
["stop"]
|
|
2775
2788
|
)
|
|
2776
2789
|
}, [
|
|
2777
|
-
d.table.header.group ? (b(), h(
|
|
2778
|
-
], 8,
|
|
2790
|
+
d.table.header.group ? (b(), h(Mo, { key: 0 })) : (b(), h(Do, { key: 1 }))
|
|
2791
|
+
], 8, To)) : S("", !0)
|
|
2779
2792
|
])
|
|
2780
2793
|
])
|
|
2781
2794
|
]),
|
|
2782
2795
|
default: y(({ row: m }) => [
|
|
2783
|
-
d.children ? (b(),
|
|
2784
|
-
u[0] || (u[0] =
|
|
2796
|
+
d.children ? (b(), v(A, { key: 0 }, [
|
|
2797
|
+
u[0] || (u[0] = M(" ")),
|
|
2785
2798
|
(b(), h(ee(i(t)), {
|
|
2786
|
-
conf:
|
|
2799
|
+
conf: n.conf,
|
|
2787
2800
|
columnList: d.children,
|
|
2788
|
-
option:
|
|
2801
|
+
option: n.option
|
|
2789
2802
|
}, Z({ _: 2 }, [
|
|
2790
|
-
I(
|
|
2803
|
+
I(n.$slots, (c, p) => ({
|
|
2791
2804
|
name: p,
|
|
2792
2805
|
fn: y((w) => [
|
|
2793
|
-
$(
|
|
2806
|
+
$(n.$slots, p, V({ ref_for: !0 }, w || {}))
|
|
2794
2807
|
])
|
|
2795
2808
|
}))
|
|
2796
2809
|
]), 1032, ["conf", "columnList", "option"]))
|
|
2797
|
-
], 64)) : (b(),
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
size:
|
|
2801
|
-
error:
|
|
2810
|
+
], 64)) : (b(), v(A, { key: 1 }, [
|
|
2811
|
+
n.option.table?.editMode ? (b(), v("div", jo, [
|
|
2812
|
+
O(i(ge), {
|
|
2813
|
+
size: n.option.size?.table,
|
|
2814
|
+
error: n.conf.tableEditValidate.getFieldError(m, d),
|
|
2802
2815
|
class: "table-edit-form-item"
|
|
2803
2816
|
}, {
|
|
2804
2817
|
default: y(() => [
|
|
2805
|
-
|
|
2818
|
+
F("div", {
|
|
2806
2819
|
class: J(["row", ["table-edit-" + d.key]]),
|
|
2807
2820
|
style: { width: "100%" }
|
|
2808
2821
|
}, [
|
|
2809
|
-
$(
|
|
2822
|
+
$(n.$slots, "table-edit-left-" + d.key, {
|
|
2810
2823
|
row: m,
|
|
2811
2824
|
item: d
|
|
2812
2825
|
}),
|
|
2813
|
-
d.type === "input" ? (b(), h(i(
|
|
2826
|
+
d.type === "input" ? (b(), h(i(ue), V({
|
|
2814
2827
|
key: 0,
|
|
2815
2828
|
modelValue: m[d.key],
|
|
2816
2829
|
"onUpdate:modelValue": (c) => m[d.key] = c,
|
|
2817
|
-
disabled:
|
|
2830
|
+
disabled: n.conf.update.getDisabled(d, !0),
|
|
2818
2831
|
class: "col",
|
|
2819
2832
|
ref_for: !0
|
|
2820
|
-
},
|
|
2821
|
-
"onUpdate:modelValue": (c) =>
|
|
2833
|
+
}, n.conf.update.getBind(d), z(n.conf.update.getOn(d, m)), {
|
|
2834
|
+
"onUpdate:modelValue": (c) => n.conf.tableEditValidate.clearField(m, d)
|
|
2822
2835
|
}), Z({ _: 2 }, [
|
|
2823
2836
|
d.options?.input?.prepend ? {
|
|
2824
2837
|
name: "prepend",
|
|
2825
2838
|
fn: y(() => [
|
|
2826
|
-
|
|
2839
|
+
M(R(typeof d.options?.input?.prepend == "function" ? d.options?.input?.prepend(m) : d.options?.input?.prepend), 1)
|
|
2827
2840
|
]),
|
|
2828
2841
|
key: "0"
|
|
2829
2842
|
} : void 0
|
|
2830
|
-
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : d.type === "select" ? (b(), h(i(
|
|
2843
|
+
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : d.type === "select" ? (b(), h(i(fe), V({
|
|
2831
2844
|
key: 1,
|
|
2832
2845
|
modelValue: m[d.key],
|
|
2833
2846
|
"onUpdate:modelValue": (c) => m[d.key] = c,
|
|
2834
|
-
disabled:
|
|
2847
|
+
disabled: n.conf.update.getDisabled(d, !0),
|
|
2835
2848
|
class: "col",
|
|
2836
2849
|
ref_for: !0
|
|
2837
|
-
},
|
|
2838
|
-
"onUpdate:modelValue": (c) =>
|
|
2850
|
+
}, n.conf.update.getBind(d), z(n.conf.update.getOn(d, m)), {
|
|
2851
|
+
"onUpdate:modelValue": (c) => n.conf.tableEditValidate.clearField(m, d)
|
|
2839
2852
|
}), {
|
|
2840
2853
|
default: y(() => [
|
|
2841
|
-
(b(!0),
|
|
2854
|
+
(b(!0), v(A, null, I(d.options?.search?.select?.data || d.options?.select?.data, (c) => (b(), h(i(ne), {
|
|
2842
2855
|
key: c.value,
|
|
2843
2856
|
label: c.label,
|
|
2844
2857
|
value: c.value
|
|
2845
2858
|
}, null, 8, ["label", "value"]))), 128))
|
|
2846
2859
|
]),
|
|
2847
2860
|
_: 2
|
|
2848
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : d.type === "switch" ? (b(), h(i(
|
|
2861
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : d.type === "switch" ? (b(), h(i(be), V({
|
|
2849
2862
|
key: 2,
|
|
2850
2863
|
modelValue: m[d.key],
|
|
2851
2864
|
"onUpdate:modelValue": (c) => m[d.key] = c,
|
|
2852
|
-
disabled:
|
|
2865
|
+
disabled: n.conf.update.getDisabled(d, !0),
|
|
2853
2866
|
class: "col",
|
|
2854
2867
|
ref_for: !0
|
|
2855
|
-
},
|
|
2856
|
-
"onUpdate:modelValue": (c) =>
|
|
2857
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
2858
|
-
$(
|
|
2868
|
+
}, n.conf.update.getBind(d), z(n.conf.update.getOn(d, m)), {
|
|
2869
|
+
"onUpdate:modelValue": (c) => n.conf.tableEditValidate.clearField(m, d)
|
|
2870
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : S("", !0),
|
|
2871
|
+
$(n.$slots, "table-edit-right-" + d.key, {
|
|
2859
2872
|
row: m,
|
|
2860
2873
|
item: d
|
|
2861
2874
|
})
|
|
@@ -2863,96 +2876,96 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
|
|
|
2863
2876
|
]),
|
|
2864
2877
|
_: 2
|
|
2865
2878
|
}, 1032, ["size", "error"])
|
|
2866
|
-
])) : (b(),
|
|
2867
|
-
|
|
2868
|
-
d.type === "input" ? (b(), h(i(
|
|
2879
|
+
])) : (b(), v(A, { key: 1 }, [
|
|
2880
|
+
n.conf.update.type === i(E).EDialog.Update && i(o)(d.show?.form, n.conf.update.form, i(E).EDialog.Update) && n.option.table?.inlineEdit && n.conf.update.form[n.option.table?.rowKey] === m[n.option.table?.rowKey] && (d.type === "input" || d.type === "select") ? (b(), v(A, { key: 0 }, [
|
|
2881
|
+
d.type === "input" ? (b(), h(i(ue), V({
|
|
2869
2882
|
key: 0,
|
|
2870
|
-
modelValue:
|
|
2871
|
-
"onUpdate:modelValue": (c) =>
|
|
2872
|
-
disabled:
|
|
2883
|
+
modelValue: n.conf.update.form[d.key],
|
|
2884
|
+
"onUpdate:modelValue": (c) => n.conf.update.form[d.key] = c,
|
|
2885
|
+
disabled: n.conf.update.getDisabled(d, !0),
|
|
2873
2886
|
ref_for: !0
|
|
2874
|
-
},
|
|
2887
|
+
}, n.conf.update.getBind(d), z(n.conf.update.getOn(d, m)), { style: { width: "100%" } }), Z({ _: 2 }, [
|
|
2875
2888
|
d.options?.input?.prepend ? {
|
|
2876
2889
|
name: "prepend",
|
|
2877
2890
|
fn: y(() => [
|
|
2878
|
-
|
|
2891
|
+
M(R(typeof d.options?.input?.prepend == "function" ? d.options?.input?.prepend(m) : d.options?.input?.prepend), 1)
|
|
2879
2892
|
]),
|
|
2880
2893
|
key: "0"
|
|
2881
2894
|
} : void 0
|
|
2882
|
-
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : d.type === "select" ? (b(), h(i(
|
|
2895
|
+
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : d.type === "select" ? (b(), h(i(fe), V({
|
|
2883
2896
|
key: 1,
|
|
2884
|
-
modelValue:
|
|
2885
|
-
"onUpdate:modelValue": (c) =>
|
|
2886
|
-
disabled:
|
|
2897
|
+
modelValue: n.conf.update.form[d.key],
|
|
2898
|
+
"onUpdate:modelValue": (c) => n.conf.update.form[d.key] = c,
|
|
2899
|
+
disabled: n.conf.update.getDisabled(d, !0),
|
|
2887
2900
|
ref_for: !0
|
|
2888
|
-
},
|
|
2901
|
+
}, n.conf.update.getBind(d), z(n.conf.update.getOn(d, m)), { style: { width: "100%" } }), {
|
|
2889
2902
|
default: y(() => [
|
|
2890
|
-
(b(!0),
|
|
2903
|
+
(b(!0), v(A, null, I(d.options?.search?.select?.data || d.options?.select?.data, (c) => (b(), h(i(ne), {
|
|
2891
2904
|
key: c.value,
|
|
2892
2905
|
label: c.label,
|
|
2893
2906
|
value: c.value
|
|
2894
2907
|
}, null, 8, ["label", "value"]))), 128))
|
|
2895
2908
|
]),
|
|
2896
2909
|
_: 2
|
|
2897
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : d.type === "switch" ? (b(), h(i(
|
|
2910
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : d.type === "switch" ? (b(), h(i(be), V({
|
|
2898
2911
|
key: 2,
|
|
2899
|
-
modelValue:
|
|
2900
|
-
"onUpdate:modelValue": (c) =>
|
|
2912
|
+
modelValue: n.conf.update.form[d.key],
|
|
2913
|
+
"onUpdate:modelValue": (c) => n.conf.update.form[d.key] = c,
|
|
2901
2914
|
ref_for: !0
|
|
2902
|
-
},
|
|
2903
|
-
disabled:
|
|
2904
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
2905
|
-
], 64)) : $(
|
|
2915
|
+
}, n.conf.update.getBind(d), z(n.conf.update.getOn(d, m)), {
|
|
2916
|
+
disabled: n.conf.update.getDisabled(d, !0)
|
|
2917
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : S("", !0)
|
|
2918
|
+
], 64)) : $(n.$slots, "table-" + d.key, {
|
|
2906
2919
|
key: 1,
|
|
2907
2920
|
row: m,
|
|
2908
2921
|
item: d
|
|
2909
2922
|
}, () => [
|
|
2910
|
-
i(q).customComponent[d.type ?? ""]?.table ? (b(), h(ee(i(q).customComponent[d.type ?? ""]?.table),
|
|
2923
|
+
i(q).customComponent[d.type ?? ""]?.table ? (b(), h(ee(i(q).customComponent[d.type ?? ""]?.table), V({
|
|
2911
2924
|
key: 0,
|
|
2912
2925
|
modelValue: m[d.key],
|
|
2913
2926
|
"onUpdate:modelValue": (c) => m[d.key] = c,
|
|
2914
2927
|
ref_for: !0
|
|
2915
|
-
}, d.options?.[d.type ?? ""], z(d.options?.[d.type ?? ""]?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue"])) : d.type === "switch" ? (b(),
|
|
2916
|
-
d.options?.switch?.tableConfig?.change ? (b(), h(i(
|
|
2928
|
+
}, d.options?.[d.type ?? ""], z(d.options?.[d.type ?? ""]?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue"])) : d.type === "switch" ? (b(), v(A, { key: 1 }, [
|
|
2929
|
+
d.options?.switch?.tableConfig?.change ? (b(), h(i(be), V({
|
|
2917
2930
|
key: 0,
|
|
2918
2931
|
modelValue: m[d.key],
|
|
2919
2932
|
"onUpdate:modelValue": (c) => m[d.key] = c,
|
|
2920
|
-
loading: d.options?.switch?.loadingMap?.[m[
|
|
2933
|
+
loading: d.options?.switch?.loadingMap?.[m[n.option.table?.rowKey]]?.loading,
|
|
2921
2934
|
"before-change": () => d.options?.switch?.tableBeforeChange?.(d.key, m),
|
|
2922
2935
|
ref_for: !0
|
|
2923
|
-
}, d.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "loading", "before-change"])) : (b(),
|
|
2924
|
-
], 64)) : (b(),
|
|
2936
|
+
}, d.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "loading", "before-change"])) : (b(), v("span", Po, R(m[d.key] === d.options?.switch?.activeValue ? d.options?.switch?.activeText : d.options?.switch?.inactiveText), 1))
|
|
2937
|
+
], 64)) : (b(), v("span", {
|
|
2925
2938
|
key: 2,
|
|
2926
|
-
style:
|
|
2939
|
+
style: he({
|
|
2927
2940
|
"--table-text-click-color": d.table?.click?.color
|
|
2928
2941
|
}),
|
|
2929
2942
|
class: J({ "table-text-click": d.table?.click?.callback }),
|
|
2930
2943
|
onClick: (c) => d.table?.click?.callback?.(m),
|
|
2931
2944
|
innerHTML: d.table?.format ? d.table?.format(m) : m[d.key]
|
|
2932
|
-
}, null, 14,
|
|
2945
|
+
}, null, 14, Ko))
|
|
2933
2946
|
])
|
|
2934
2947
|
], 64))
|
|
2935
2948
|
], 64))
|
|
2936
2949
|
]),
|
|
2937
2950
|
_: 2
|
|
2938
|
-
}, 1040, ["prop", "label"])) :
|
|
2939
|
-
], 64)) :
|
|
2951
|
+
}, 1040, ["prop", "label"])) : S("", !0)
|
|
2952
|
+
], 64)) : S("", !0)
|
|
2940
2953
|
], 64))), 128);
|
|
2941
2954
|
};
|
|
2942
2955
|
}
|
|
2943
|
-
}),
|
|
2956
|
+
}), No = {
|
|
2944
2957
|
key: 0,
|
|
2945
2958
|
class: "relative curd-search fit-width"
|
|
2946
|
-
},
|
|
2959
|
+
}, Io = { class: "mb-10 flex justify-between items-center fit-width" }, Go = {
|
|
2947
2960
|
class: "flex items-center",
|
|
2948
2961
|
style: { gap: "10px" }
|
|
2949
|
-
},
|
|
2962
|
+
}, Wo = { key: 0 }, qo = { key: 1 }, Jo = { key: 2 }, Qo = { class: "export-btn" }, Xo = {
|
|
2950
2963
|
key: 1,
|
|
2951
2964
|
class: "export-btn"
|
|
2952
|
-
},
|
|
2965
|
+
}, Yo = {
|
|
2953
2966
|
class: "flex items-center table-tools-right",
|
|
2954
2967
|
style: { gap: "10px" }
|
|
2955
|
-
},
|
|
2968
|
+
}, Zo = { class: "table-sortable-tooltip" }, xo = ["innerHTML"], _o = { class: "row justify-end mt-10 mb-10 table-bottom-pagination" }, ea = { class: "dialog-footer" }, ta = { key: 0 }, oa = { key: 1 }, aa = { class: "dialog-footer" }, na = /* @__PURE__ */ Q({
|
|
2956
2969
|
__name: "index",
|
|
2957
2970
|
props: {
|
|
2958
2971
|
/**
|
|
@@ -2975,24 +2988,24 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
|
|
|
2975
2988
|
}
|
|
2976
2989
|
},
|
|
2977
2990
|
setup(a, { expose: o }) {
|
|
2978
|
-
const s = E.EDialog, r = a, t = E.isFun, { conf: e, switchConfirmRef:
|
|
2991
|
+
const s = E.EDialog, r = a, t = E.isFun, { conf: e, switchConfirmRef: l, ruleFormRef: n, tableRef: u } = io(r);
|
|
2979
2992
|
return o({
|
|
2980
2993
|
conf: e
|
|
2981
2994
|
}), (f, d) => {
|
|
2982
|
-
const m =
|
|
2983
|
-
return b(),
|
|
2995
|
+
const m = ce("el-tooltip"), c = kt("loading");
|
|
2996
|
+
return b(), v("div", {
|
|
2984
2997
|
class: J(["relative cc1-form-box", [a.option.table?.fitHeight ? "col" : "no-min-height"]])
|
|
2985
2998
|
}, [
|
|
2986
|
-
|
|
2999
|
+
F("div", {
|
|
2987
3000
|
class: J(["row", [a.option.table?.fitHeight ? "absolute fit" : ""]]),
|
|
2988
3001
|
style: { overflow: "hidden" }
|
|
2989
3002
|
}, [
|
|
2990
3003
|
$(f.$slots, "box-left"),
|
|
2991
|
-
|
|
3004
|
+
F("div", {
|
|
2992
3005
|
class: J(["column fit-width no-wrap", [a.option.table?.fitHeight ? "col" : ""]])
|
|
2993
3006
|
}, [
|
|
2994
|
-
a.option.search?.show !== !1 ? (b(),
|
|
2995
|
-
|
|
3007
|
+
a.option.search?.show !== !1 ? (b(), v("div", No, [
|
|
3008
|
+
O(i(oe), {
|
|
2996
3009
|
model: i(e).search.form,
|
|
2997
3010
|
inline: "",
|
|
2998
3011
|
size: a.option.size?.search
|
|
@@ -3001,13 +3014,13 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
|
|
|
3001
3014
|
$(f.$slots, "search-start", {
|
|
3002
3015
|
row: i(e).search.form
|
|
3003
3016
|
}),
|
|
3004
|
-
(b(!0),
|
|
3017
|
+
(b(!0), v(A, null, I(i(e).search.column.list, (p) => (b(), v(A, {
|
|
3005
3018
|
key: p.key
|
|
3006
3019
|
}, [
|
|
3007
3020
|
$(f.$slots, "search-" + p.key + "-start", {
|
|
3008
3021
|
row: i(e).search.form
|
|
3009
3022
|
}),
|
|
3010
|
-
(typeof p.show?.search == "function" ? p.show?.search(i(e).search.form) : p.show?.search) ? (b(), h(i(
|
|
3023
|
+
(typeof p.show?.search == "function" ? p.show?.search(i(e).search.form) : p.show?.search) ? (b(), h(i(ge), {
|
|
3011
3024
|
key: 0,
|
|
3012
3025
|
label: p.text?.search?.label ?? p.label
|
|
3013
3026
|
}, {
|
|
@@ -3018,12 +3031,12 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
|
|
|
3018
3031
|
$(f.$slots, "search-" + p.key, {
|
|
3019
3032
|
row: i(e).search.form
|
|
3020
3033
|
}, () => [
|
|
3021
|
-
p.options?.search?.type ? (b(), h(
|
|
3034
|
+
p.options?.search?.type ? (b(), h(Le, {
|
|
3022
3035
|
key: 0,
|
|
3023
3036
|
item: p,
|
|
3024
3037
|
conf: i(e),
|
|
3025
3038
|
type: p.options.search.type
|
|
3026
|
-
}, null, 8, ["item", "conf", "type"])) : (b(), h(
|
|
3039
|
+
}, null, 8, ["item", "conf", "type"])) : (b(), h(Le, {
|
|
3027
3040
|
key: 1,
|
|
3028
3041
|
item: p,
|
|
3029
3042
|
conf: i(e),
|
|
@@ -3035,7 +3048,7 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
|
|
|
3035
3048
|
})
|
|
3036
3049
|
]),
|
|
3037
3050
|
_: 2
|
|
3038
|
-
}, 1032, ["label"])) :
|
|
3051
|
+
}, 1032, ["label"])) : S("", !0),
|
|
3039
3052
|
$(f.$slots, "search-" + p.key + "-end", {
|
|
3040
3053
|
row: i(e).search.form
|
|
3041
3054
|
})
|
|
@@ -3043,150 +3056,150 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
|
|
|
3043
3056
|
$(f.$slots, "search-center", {
|
|
3044
3057
|
row: i(e).search.form
|
|
3045
3058
|
}),
|
|
3046
|
-
a.option.tools?.search || a.option.tools?.reset ? (b(), h(i(
|
|
3059
|
+
a.option.tools?.search || a.option.tools?.reset ? (b(), h(i(ge), { key: 0 }, {
|
|
3047
3060
|
default: y(() => [
|
|
3048
|
-
a.option.tools?.search ? (b(), h(i(
|
|
3061
|
+
a.option.tools?.search ? (b(), h(i(L), {
|
|
3049
3062
|
key: 0,
|
|
3050
3063
|
type: "primary",
|
|
3051
3064
|
onClick: i(e).search.submit
|
|
3052
3065
|
}, {
|
|
3053
3066
|
default: y(() => [
|
|
3054
|
-
|
|
3067
|
+
M(R(i(C).tCurd("search")), 1)
|
|
3055
3068
|
]),
|
|
3056
3069
|
_: 1
|
|
3057
|
-
}, 8, ["onClick"])) :
|
|
3058
|
-
a.option.tools?.reset ? (b(), h(i(
|
|
3070
|
+
}, 8, ["onClick"])) : S("", !0),
|
|
3071
|
+
a.option.tools?.reset ? (b(), h(i(L), {
|
|
3059
3072
|
key: 1,
|
|
3060
3073
|
onClick: i(e).search.reset
|
|
3061
3074
|
}, {
|
|
3062
3075
|
default: y(() => [
|
|
3063
|
-
|
|
3076
|
+
M(R(i(C).tCurd("reset")), 1)
|
|
3064
3077
|
]),
|
|
3065
3078
|
_: 1
|
|
3066
|
-
}, 8, ["onClick"])) :
|
|
3079
|
+
}, 8, ["onClick"])) : S("", !0)
|
|
3067
3080
|
]),
|
|
3068
3081
|
_: 1
|
|
3069
|
-
})) :
|
|
3082
|
+
})) : S("", !0),
|
|
3070
3083
|
$(f.$slots, "search-end", {
|
|
3071
3084
|
row: i(e).search.form
|
|
3072
3085
|
})
|
|
3073
3086
|
]),
|
|
3074
3087
|
_: 3
|
|
3075
3088
|
}, 8, ["model", "size"])
|
|
3076
|
-
])) :
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
i(t)(a.option.tools?.add) ? (b(),
|
|
3080
|
-
|
|
3089
|
+
])) : S("", !0),
|
|
3090
|
+
F("div", Io, [
|
|
3091
|
+
F("div", Go, [
|
|
3092
|
+
i(t)(a.option.tools?.add) ? (b(), v("div", Wo, [
|
|
3093
|
+
O(i(L), {
|
|
3081
3094
|
type: "primary",
|
|
3082
3095
|
onClick: d[0] || (d[0] = (p) => i(e).update.open(i(s).Add)),
|
|
3083
3096
|
size: a.option.size?.search
|
|
3084
3097
|
}, {
|
|
3085
3098
|
default: y(() => [
|
|
3086
|
-
|
|
3099
|
+
M(R(i(C).tCurd("add")), 1)
|
|
3087
3100
|
]),
|
|
3088
3101
|
_: 1
|
|
3089
3102
|
}, 8, ["size"])
|
|
3090
|
-
])) :
|
|
3091
|
-
i(t)(a.option.tools?.delete) ? (b(),
|
|
3092
|
-
|
|
3103
|
+
])) : S("", !0),
|
|
3104
|
+
i(t)(a.option.tools?.delete) ? (b(), v("div", qo, [
|
|
3105
|
+
O(i(L), {
|
|
3093
3106
|
type: "danger",
|
|
3094
3107
|
onClick: d[1] || (d[1] = (p) => i(e).remove.open(i(e).table.selection.list)),
|
|
3095
3108
|
size: a.option.size?.search
|
|
3096
3109
|
}, {
|
|
3097
3110
|
default: y(() => [
|
|
3098
|
-
|
|
3111
|
+
M(R(i(C).tCurd("delete")), 1)
|
|
3099
3112
|
]),
|
|
3100
3113
|
_: 1
|
|
3101
3114
|
}, 8, ["size"])
|
|
3102
|
-
])) :
|
|
3103
|
-
a.option.tools?.expand ? (b(),
|
|
3104
|
-
|
|
3115
|
+
])) : S("", !0),
|
|
3116
|
+
a.option.tools?.expand ? (b(), v("div", Jo, [
|
|
3117
|
+
O(i(L), {
|
|
3105
3118
|
type: "warning",
|
|
3106
3119
|
onClick: d[2] || (d[2] = (p) => i(e).table.expand.all()),
|
|
3107
3120
|
size: a.option.size?.search
|
|
3108
3121
|
}, {
|
|
3109
3122
|
default: y(() => [
|
|
3110
|
-
|
|
3123
|
+
M(R(i(C).tCurd("expandCollapse")), 1)
|
|
3111
3124
|
]),
|
|
3112
3125
|
_: 1
|
|
3113
3126
|
}, 8, ["size"])
|
|
3114
|
-
])) :
|
|
3115
|
-
a.option.tools?.export?.show ? (b(),
|
|
3116
|
-
a.option.tools?.export?.dropdown?.show ? (b(), h(i(
|
|
3127
|
+
])) : S("", !0),
|
|
3128
|
+
a.option.tools?.export?.show ? (b(), v(A, { key: 3 }, [
|
|
3129
|
+
a.option.tools?.export?.dropdown?.show ? (b(), h(i(bt), {
|
|
3117
3130
|
key: 0,
|
|
3118
3131
|
onCommand: i(e).export.click
|
|
3119
3132
|
}, {
|
|
3120
3133
|
dropdown: y(() => [
|
|
3121
|
-
|
|
3134
|
+
O(i(gt), {
|
|
3122
3135
|
size: a.option.size?.search
|
|
3123
3136
|
}, {
|
|
3124
3137
|
default: y(() => [
|
|
3125
|
-
a.option.tools?.export?.dropdown?.select && (a.option.table?.selectable || i(t)(a.option.tools?.delete)) ? (b(), h(i(
|
|
3138
|
+
a.option.tools?.export?.dropdown?.select && (a.option.table?.selectable || i(t)(a.option.tools?.delete)) ? (b(), h(i(ze), {
|
|
3126
3139
|
key: 0,
|
|
3127
3140
|
command: "select"
|
|
3128
3141
|
}, {
|
|
3129
3142
|
default: y(() => [
|
|
3130
|
-
|
|
3143
|
+
M(R(i(C).tCurd("exportSelect")), 1)
|
|
3131
3144
|
]),
|
|
3132
3145
|
_: 1
|
|
3133
|
-
})) :
|
|
3134
|
-
a.option.tools?.export?.dropdown?.page ? (b(), h(i(
|
|
3146
|
+
})) : S("", !0),
|
|
3147
|
+
a.option.tools?.export?.dropdown?.page ? (b(), h(i(ze), {
|
|
3135
3148
|
key: 1,
|
|
3136
3149
|
command: "page"
|
|
3137
3150
|
}, {
|
|
3138
3151
|
default: y(() => [
|
|
3139
|
-
|
|
3152
|
+
M(R(i(C).tCurd("exportPage")), 1)
|
|
3140
3153
|
]),
|
|
3141
3154
|
_: 1
|
|
3142
|
-
})) :
|
|
3143
|
-
a.option.tools?.export?.dropdown?.all ? (b(), h(i(
|
|
3155
|
+
})) : S("", !0),
|
|
3156
|
+
a.option.tools?.export?.dropdown?.all ? (b(), h(i(ze), {
|
|
3144
3157
|
key: 2,
|
|
3145
3158
|
command: "all"
|
|
3146
3159
|
}, {
|
|
3147
3160
|
default: y(() => [
|
|
3148
|
-
|
|
3161
|
+
M(R(i(C).tCurd("exportAll")), 1)
|
|
3149
3162
|
]),
|
|
3150
3163
|
_: 1
|
|
3151
|
-
})) :
|
|
3164
|
+
})) : S("", !0)
|
|
3152
3165
|
]),
|
|
3153
3166
|
_: 1
|
|
3154
3167
|
}, 8, ["size"])
|
|
3155
3168
|
]),
|
|
3156
3169
|
default: y(() => [
|
|
3157
|
-
|
|
3158
|
-
|
|
3170
|
+
F("div", Qo, [
|
|
3171
|
+
O(i(L), {
|
|
3159
3172
|
type: "warning",
|
|
3160
3173
|
loading: i(e).export.loading,
|
|
3161
3174
|
size: a.option.size?.search
|
|
3162
3175
|
}, {
|
|
3163
3176
|
default: y(() => [
|
|
3164
|
-
|
|
3177
|
+
M(R(i(C).tCurd("export")), 1)
|
|
3165
3178
|
]),
|
|
3166
3179
|
_: 1
|
|
3167
3180
|
}, 8, ["loading", "size"])
|
|
3168
3181
|
])
|
|
3169
3182
|
]),
|
|
3170
3183
|
_: 1
|
|
3171
|
-
}, 8, ["onCommand"])) : (b(),
|
|
3172
|
-
|
|
3184
|
+
}, 8, ["onCommand"])) : (b(), v("div", Xo, [
|
|
3185
|
+
O(i(L), {
|
|
3173
3186
|
type: "warning",
|
|
3174
3187
|
loading: i(e).export.loading,
|
|
3175
3188
|
size: a.option.size?.search,
|
|
3176
3189
|
onClick: d[3] || (d[3] = (p) => i(e).export.run.start("all"))
|
|
3177
3190
|
}, {
|
|
3178
3191
|
default: y(() => [
|
|
3179
|
-
|
|
3192
|
+
M(R(i(C).tCurd("export")), 1)
|
|
3180
3193
|
]),
|
|
3181
3194
|
_: 1
|
|
3182
3195
|
}, 8, ["loading", "size"])
|
|
3183
3196
|
]))
|
|
3184
|
-
], 64)) :
|
|
3197
|
+
], 64)) : S("", !0),
|
|
3185
3198
|
$(f.$slots, "tools-left")
|
|
3186
3199
|
]),
|
|
3187
|
-
|
|
3200
|
+
F("div", Yo, [
|
|
3188
3201
|
$(f.$slots, "tools-right"),
|
|
3189
|
-
i(e).page.showTools && i(e).table.sortable.showPagination() ? (b(), h(i(
|
|
3202
|
+
i(e).page.showTools && i(e).table.sortable.showPagination() ? (b(), h(i(Ae), V({
|
|
3190
3203
|
key: 0,
|
|
3191
3204
|
"current-page": i(e).page.num,
|
|
3192
3205
|
"onUpdate:currentPage": d[4] || (d[4] = (p) => i(e).page.num = p),
|
|
@@ -3200,8 +3213,8 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
|
|
|
3200
3213
|
size: a.option.size?.table,
|
|
3201
3214
|
onSizeChange: i(e).table.sortable.refreshList,
|
|
3202
3215
|
onCurrentChange: i(e).table.sortable.refreshList
|
|
3203
|
-
}, a.option.page?.pagination || {}, z(a.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) :
|
|
3204
|
-
i(e).table.sortable.showTriggerButton() ? (b(), h(i(
|
|
3216
|
+
}, a.option.page?.pagination || {}, z(a.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : S("", !0),
|
|
3217
|
+
i(e).table.sortable.showTriggerButton() ? (b(), h(i(L), {
|
|
3205
3218
|
key: 1,
|
|
3206
3219
|
type: "warning",
|
|
3207
3220
|
onClick: i(e).table.sortable.start,
|
|
@@ -3209,50 +3222,34 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
|
|
|
3209
3222
|
loading: i(e).table.sortable.actionLoading
|
|
3210
3223
|
}, {
|
|
3211
3224
|
default: y(() => [
|
|
3212
|
-
|
|
3225
|
+
M(R(i(C).tCurd("sortableStart")), 1)
|
|
3213
3226
|
]),
|
|
3214
3227
|
_: 1
|
|
3215
|
-
}, 8, ["onClick", "size", "loading"])) :
|
|
3216
|
-
i(e).table.sortable.showActionButton() ? (b(),
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
]),
|
|
3241
|
-
default: y(() => [
|
|
3242
|
-
M(i(P), {
|
|
3243
|
-
type: "warning",
|
|
3244
|
-
size: a.option.size?.search,
|
|
3245
|
-
loading: i(e).table.sortable.actionLoading
|
|
3246
|
-
}, {
|
|
3247
|
-
default: y(() => [
|
|
3248
|
-
O(F(i(k).tCurd("sortableAction")), 1)
|
|
3249
|
-
]),
|
|
3250
|
-
_: 1
|
|
3251
|
-
}, 8, ["size", "loading"])
|
|
3252
|
-
]),
|
|
3253
|
-
_: 1
|
|
3254
|
-
}, 8, ["onCommand"])) : V("", !0),
|
|
3255
|
-
i(e).table.sortable.showSaveButton() ? (b(), h(i(P), {
|
|
3228
|
+
}, 8, ["onClick", "size", "loading"])) : S("", !0),
|
|
3229
|
+
i(e).table.sortable.showActionButton() ? (b(), v(A, { key: 2 }, [
|
|
3230
|
+
O(i(L), {
|
|
3231
|
+
type: "success",
|
|
3232
|
+
size: a.option.size?.search,
|
|
3233
|
+
loading: i(e).table.sortable.actionLoading,
|
|
3234
|
+
onClick: i(e).table.sortable.save
|
|
3235
|
+
}, {
|
|
3236
|
+
default: y(() => [
|
|
3237
|
+
M(R(i(C).tCurd("sortableSave")), 1)
|
|
3238
|
+
]),
|
|
3239
|
+
_: 1
|
|
3240
|
+
}, 8, ["size", "loading", "onClick"]),
|
|
3241
|
+
O(i(L), {
|
|
3242
|
+
type: "info",
|
|
3243
|
+
size: a.option.size?.search,
|
|
3244
|
+
onClick: i(e).table.sortable.exit
|
|
3245
|
+
}, {
|
|
3246
|
+
default: y(() => [
|
|
3247
|
+
M(R(i(C).tCurd("sortableExit")), 1)
|
|
3248
|
+
]),
|
|
3249
|
+
_: 1
|
|
3250
|
+
}, 8, ["size", "onClick"])
|
|
3251
|
+
], 64)) : S("", !0),
|
|
3252
|
+
i(e).table.sortable.showSaveButton() ? (b(), h(i(L), {
|
|
3256
3253
|
key: 3,
|
|
3257
3254
|
type: "warning",
|
|
3258
3255
|
onClick: i(e).table.sortable.save,
|
|
@@ -3260,44 +3257,44 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
|
|
|
3260
3257
|
loading: i(e).table.sortable.actionLoading
|
|
3261
3258
|
}, {
|
|
3262
3259
|
default: y(() => [
|
|
3263
|
-
|
|
3260
|
+
M(R(i(C).tCurd("sortableSave")), 1)
|
|
3264
3261
|
]),
|
|
3265
3262
|
_: 1
|
|
3266
|
-
}, 8, ["onClick", "size", "loading"])) :
|
|
3263
|
+
}, 8, ["onClick", "size", "loading"])) : S("", !0),
|
|
3267
3264
|
a.option.tools?.expandColumn === void 0 || a.option.tools?.expandColumn ? (b(), h(m, {
|
|
3268
3265
|
key: 4,
|
|
3269
3266
|
effect: "dark",
|
|
3270
|
-
content: i(e).table.header.group.expand ? i(
|
|
3267
|
+
content: i(e).table.header.group.expand ? i(C).tCurd("mergeColumn") : i(C).tCurd("expandColumn"),
|
|
3271
3268
|
placement: "top"
|
|
3272
3269
|
}, {
|
|
3273
3270
|
default: y(() => [
|
|
3274
|
-
|
|
3271
|
+
F("div", {
|
|
3275
3272
|
class: J(["refresh-btn", [a.option.size?.search]]),
|
|
3276
3273
|
onClick: d[6] || (d[6] = //@ts-ignore
|
|
3277
3274
|
(...p) => i(e).table.header.group.toggleExpandAll && i(e).table.header.group.toggleExpandAll(...p))
|
|
3278
3275
|
}, [
|
|
3279
|
-
i(e).table.header.group.expand ? (b(), h(
|
|
3276
|
+
i(e).table.header.group.expand ? (b(), h(go, { key: 0 })) : (b(), h(ko, { key: 1 }))
|
|
3280
3277
|
], 2)
|
|
3281
3278
|
]),
|
|
3282
3279
|
_: 1
|
|
3283
|
-
}, 8, ["content"])) :
|
|
3284
|
-
a.option.tools?.refresh === void 0 || a.option.tools?.refresh ? (b(),
|
|
3280
|
+
}, 8, ["content"])) : S("", !0),
|
|
3281
|
+
a.option.tools?.refresh === void 0 || a.option.tools?.refresh ? (b(), v("div", {
|
|
3285
3282
|
key: 5,
|
|
3286
3283
|
class: J(["refresh-btn", [a.option.size?.search]]),
|
|
3287
3284
|
onClick: d[7] || (d[7] = //@ts-ignore
|
|
3288
3285
|
(...p) => i(e).table.sortable.refreshList && i(e).table.sortable.refreshList(...p))
|
|
3289
3286
|
}, [
|
|
3290
|
-
|
|
3291
|
-
], 2)) :
|
|
3287
|
+
O(So)
|
|
3288
|
+
], 2)) : S("", !0)
|
|
3292
3289
|
])
|
|
3293
3290
|
]),
|
|
3294
|
-
|
|
3291
|
+
F("div", {
|
|
3295
3292
|
class: J(["fit-width relative form-box", [a.option.table?.fitHeight ? "col " : "", a.option.table?.editMode ? "edit-mode" : ""]])
|
|
3296
3293
|
}, [
|
|
3297
|
-
|
|
3294
|
+
F("div", {
|
|
3298
3295
|
class: J(["column form-box-content", [a.option.table?.fitHeight ? "absolute fit" : ""]])
|
|
3299
3296
|
}, [
|
|
3300
|
-
vt((b(), h(i(
|
|
3297
|
+
vt((b(), h(i(ht), V({
|
|
3301
3298
|
ref_key: "tableRef",
|
|
3302
3299
|
ref: u,
|
|
3303
3300
|
data: i(e).table.data,
|
|
@@ -3309,7 +3306,7 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
|
|
|
3309
3306
|
onExpandChange: i(e).table.expand.change
|
|
3310
3307
|
}, i(e).table.sortable.getTableBindOption(), z(a.option.table?.on || {})), {
|
|
3311
3308
|
default: y(() => [
|
|
3312
|
-
(typeof a.option.table?.selectable == "object" ? a.option.table?.selectable?.show : a.option.table?.selectable) || i(t)(a.option.tools?.delete) || a.option.tools?.export?.show && a.option.tools?.export?.select ? (b(), h(i(
|
|
3309
|
+
(typeof a.option.table?.selectable == "object" ? a.option.table?.selectable?.show : a.option.table?.selectable) || i(t)(a.option.tools?.delete) || a.option.tools?.export?.show && a.option.tools?.export?.select ? (b(), h(i(de), V({
|
|
3313
3310
|
key: 0,
|
|
3314
3311
|
type: "selection",
|
|
3315
3312
|
width: "40",
|
|
@@ -3317,8 +3314,8 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
|
|
|
3317
3314
|
fixed: "left",
|
|
3318
3315
|
"show-overflow-tooltip": !1,
|
|
3319
3316
|
className: "cc1-form-selectable-column"
|
|
3320
|
-
}, typeof a.option.table?.selectable == "object" ? a.option.table?.selectable : {}, z(typeof a.option.table?.selectable == "object" ? a.option.table?.selectable?.on || {} : {})), null, 16)) :
|
|
3321
|
-
(typeof a.option.table?.index == "object" ? a.option.table?.index?.show : a.option.table?.index) ? (b(), h(i(
|
|
3317
|
+
}, typeof a.option.table?.selectable == "object" ? a.option.table?.selectable : {}, z(typeof a.option.table?.selectable == "object" ? a.option.table?.selectable?.on || {} : {})), null, 16)) : S("", !0),
|
|
3318
|
+
(typeof a.option.table?.index == "object" ? a.option.table?.index?.show : a.option.table?.index) ? (b(), h(i(de), V({
|
|
3322
3319
|
key: 1,
|
|
3323
3320
|
type: "index",
|
|
3324
3321
|
fixed: "left",
|
|
@@ -3327,8 +3324,8 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
|
|
|
3327
3324
|
label: "#",
|
|
3328
3325
|
"show-overflow-tooltip": !1,
|
|
3329
3326
|
className: "cc1-form-index-column"
|
|
3330
|
-
}, typeof a.option.table?.index == "object" ? a.option.table?.index : {}, z(typeof a.option.table?.index == "object" ? a.option.table?.index?.on || {} : {})), null, 16)) :
|
|
3331
|
-
i(e).table.sortable.isActive() ? (b(), h(i(
|
|
3327
|
+
}, typeof a.option.table?.index == "object" ? a.option.table?.index : {}, z(typeof a.option.table?.index == "object" ? a.option.table?.index?.on || {} : {})), null, 16)) : S("", !0),
|
|
3328
|
+
i(e).table.sortable.isActive() ? (b(), h(i(de), V({
|
|
3332
3329
|
key: 2,
|
|
3333
3330
|
align: "center",
|
|
3334
3331
|
"show-overflow-tooltip": !1,
|
|
@@ -3336,18 +3333,18 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
|
|
|
3336
3333
|
}, i(e).table.sortable.getColumnBind(), z(i(e).table.sortable.getColumnBind().on || {})), {
|
|
3337
3334
|
header: y(() => [
|
|
3338
3335
|
$(f.$slots, "table-header-sortable", {}, () => [
|
|
3339
|
-
|
|
3336
|
+
O(m, {
|
|
3340
3337
|
effect: "dark",
|
|
3341
3338
|
placement: "top"
|
|
3342
3339
|
}, {
|
|
3343
3340
|
content: y(() => [
|
|
3344
|
-
|
|
3345
|
-
innerHTML: a.option.table?.sortable?.tipText ?? i(
|
|
3346
|
-
}, null, 8,
|
|
3341
|
+
F("div", {
|
|
3342
|
+
innerHTML: a.option.table?.sortable?.tipText ?? i(C).tCurd("sortable")
|
|
3343
|
+
}, null, 8, xo)
|
|
3347
3344
|
]),
|
|
3348
3345
|
default: y(() => [
|
|
3349
|
-
|
|
3350
|
-
|
|
3346
|
+
F("span", Zo, [
|
|
3347
|
+
O(De)
|
|
3351
3348
|
])
|
|
3352
3349
|
]),
|
|
3353
3350
|
_: 1
|
|
@@ -3355,23 +3352,23 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
|
|
|
3355
3352
|
])
|
|
3356
3353
|
]),
|
|
3357
3354
|
default: y(() => d[12] || (d[12] = [
|
|
3358
|
-
|
|
3355
|
+
F("span", { class: "cc1-form-drag-handle" }, "::", -1)
|
|
3359
3356
|
])),
|
|
3360
3357
|
_: 3
|
|
3361
|
-
}, 16)) :
|
|
3362
|
-
|
|
3358
|
+
}, 16)) : S("", !0),
|
|
3359
|
+
O(Ho, {
|
|
3363
3360
|
conf: i(e),
|
|
3364
3361
|
columnList: i(e).table.column.list,
|
|
3365
3362
|
option: a.option
|
|
3366
3363
|
}, Z({ _: 2 }, [
|
|
3367
3364
|
I(f.$slots, (p, w) => ({
|
|
3368
3365
|
name: w,
|
|
3369
|
-
fn: y((
|
|
3370
|
-
$(f.$slots, w, Me(Oe(
|
|
3366
|
+
fn: y((U) => [
|
|
3367
|
+
$(f.$slots, w, Me(Oe(U || {})))
|
|
3371
3368
|
])
|
|
3372
3369
|
}))
|
|
3373
3370
|
]), 1032, ["conf", "columnList", "option"]),
|
|
3374
|
-
i(t)(a.option.table?.add) || i(t)(a.option.table?.update) || i(t)(a.option.table?.delete) || i(t)(a.option.table?.view) || f.$slots["table-op-left"] || f.$slots["table-op-right"] ? (b(), h(i(
|
|
3371
|
+
i(t)(a.option.table?.add) || i(t)(a.option.table?.update) || i(t)(a.option.table?.delete) || i(t)(a.option.table?.view) || f.$slots["table-op-left"] || f.$slots["table-op-right"] ? (b(), h(i(de), V({
|
|
3375
3372
|
key: 3,
|
|
3376
3373
|
align: "center",
|
|
3377
3374
|
fixed: "right"
|
|
@@ -3381,83 +3378,83 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
|
|
|
3381
3378
|
}), {
|
|
3382
3379
|
header: y(() => [
|
|
3383
3380
|
$(f.$slots, "table-header-op", {}, () => [
|
|
3384
|
-
|
|
3381
|
+
M(R(i(C).tCurd("operation")), 1)
|
|
3385
3382
|
])
|
|
3386
3383
|
]),
|
|
3387
3384
|
default: y(({ row: p }) => [
|
|
3388
|
-
|
|
3385
|
+
O(i(oe), {
|
|
3389
3386
|
size: a.option.size?.table
|
|
3390
3387
|
}, {
|
|
3391
3388
|
default: y(() => [
|
|
3392
3389
|
$(f.$slots, "table-op-left", { row: p }),
|
|
3393
|
-
i(e).update.type === i(s).Update && a.option.table?.inlineEdit && i(e).update.form[r.option.table?.rowKey] === p[r.option.table?.rowKey] ? (b(),
|
|
3394
|
-
|
|
3390
|
+
i(e).update.type === i(s).Update && a.option.table?.inlineEdit && i(e).update.form[r.option.table?.rowKey] === p[r.option.table?.rowKey] ? (b(), v(A, { key: 0 }, [
|
|
3391
|
+
O(i(L), {
|
|
3395
3392
|
link: "",
|
|
3396
3393
|
type: "info",
|
|
3397
3394
|
onClick: i(e).update.close
|
|
3398
3395
|
}, {
|
|
3399
3396
|
default: y(() => [
|
|
3400
|
-
|
|
3397
|
+
M(R(i(C).tCurd("cancel")), 1)
|
|
3401
3398
|
]),
|
|
3402
3399
|
_: 1
|
|
3403
3400
|
}, 8, ["onClick"]),
|
|
3404
|
-
|
|
3401
|
+
O(i(L), {
|
|
3405
3402
|
link: "",
|
|
3406
3403
|
type: "primary",
|
|
3407
3404
|
onClick: i(e).update.submit,
|
|
3408
3405
|
loading: i(e).update.loading
|
|
3409
3406
|
}, {
|
|
3410
3407
|
default: y(() => [
|
|
3411
|
-
|
|
3408
|
+
M(R(i(C).tCurd("confirm")), 1)
|
|
3412
3409
|
]),
|
|
3413
3410
|
_: 1
|
|
3414
3411
|
}, 8, ["onClick", "loading"]),
|
|
3415
3412
|
$(f.$slots, "table-op-edit-right", { row: p })
|
|
3416
|
-
], 64)) : (b(),
|
|
3417
|
-
i(t)(a.option.table?.add, p) ? (b(), h(i(
|
|
3413
|
+
], 64)) : (b(), v(A, { key: 1 }, [
|
|
3414
|
+
i(t)(a.option.table?.add, p) ? (b(), h(i(L), {
|
|
3418
3415
|
key: 0,
|
|
3419
3416
|
link: "",
|
|
3420
3417
|
type: "primary",
|
|
3421
3418
|
onClick: (w) => i(e).update.open(i(s).Add, p)
|
|
3422
3419
|
}, {
|
|
3423
3420
|
default: y(() => [
|
|
3424
|
-
|
|
3421
|
+
M(R(i(C).tCurd("add")), 1)
|
|
3425
3422
|
]),
|
|
3426
3423
|
_: 2
|
|
3427
|
-
}, 1032, ["onClick"])) :
|
|
3428
|
-
i(t)(a.option.table?.view, p) ? (b(), h(i(
|
|
3424
|
+
}, 1032, ["onClick"])) : S("", !0),
|
|
3425
|
+
i(t)(a.option.table?.view, p) ? (b(), h(i(L), {
|
|
3429
3426
|
key: 1,
|
|
3430
3427
|
link: "",
|
|
3431
3428
|
type: "primary",
|
|
3432
3429
|
onClick: (w) => i(e).update.open(i(s).View, p)
|
|
3433
3430
|
}, {
|
|
3434
3431
|
default: y(() => [
|
|
3435
|
-
|
|
3432
|
+
M(R(i(C).tCurd("view")), 1)
|
|
3436
3433
|
]),
|
|
3437
3434
|
_: 2
|
|
3438
|
-
}, 1032, ["onClick"])) :
|
|
3439
|
-
i(t)(a.option.table?.update, p) ? (b(), h(i(
|
|
3435
|
+
}, 1032, ["onClick"])) : S("", !0),
|
|
3436
|
+
i(t)(a.option.table?.update, p) ? (b(), h(i(L), {
|
|
3440
3437
|
key: 2,
|
|
3441
3438
|
link: "",
|
|
3442
3439
|
type: "warning",
|
|
3443
3440
|
onClick: (w) => i(e).update.open(i(s).Update, p)
|
|
3444
3441
|
}, {
|
|
3445
3442
|
default: y(() => [
|
|
3446
|
-
|
|
3443
|
+
M(R(i(C).tCurd("edit")), 1)
|
|
3447
3444
|
]),
|
|
3448
3445
|
_: 2
|
|
3449
|
-
}, 1032, ["onClick"])) :
|
|
3450
|
-
i(t)(a.option.table?.delete, p) ? (b(), h(i(
|
|
3446
|
+
}, 1032, ["onClick"])) : S("", !0),
|
|
3447
|
+
i(t)(a.option.table?.delete, p) ? (b(), h(i(L), {
|
|
3451
3448
|
key: 3,
|
|
3452
3449
|
link: "",
|
|
3453
3450
|
type: "danger",
|
|
3454
3451
|
onClick: (w) => i(e).remove.open([p])
|
|
3455
3452
|
}, {
|
|
3456
3453
|
default: y(() => [
|
|
3457
|
-
|
|
3454
|
+
M(R(i(C).tCurd("delete")), 1)
|
|
3458
3455
|
]),
|
|
3459
3456
|
_: 2
|
|
3460
|
-
}, 1032, ["onClick"])) :
|
|
3457
|
+
}, 1032, ["onClick"])) : S("", !0),
|
|
3461
3458
|
$(f.$slots, "table-op-right", { row: p })
|
|
3462
3459
|
], 64))
|
|
3463
3460
|
]),
|
|
@@ -3465,7 +3462,7 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
|
|
|
3465
3462
|
}, 1032, ["size"])
|
|
3466
3463
|
]),
|
|
3467
3464
|
_: 3
|
|
3468
|
-
}, 16, ["width"])) :
|
|
3465
|
+
}, 16, ["width"])) : S("", !0)
|
|
3469
3466
|
]),
|
|
3470
3467
|
_: 3
|
|
3471
3468
|
}, 16, ["data", "border", "class", "onSelectionChange", "onSortChange", "expand-row-keys", "onExpandChange"])), [
|
|
@@ -3473,8 +3470,8 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
|
|
|
3473
3470
|
])
|
|
3474
3471
|
], 2)
|
|
3475
3472
|
], 2),
|
|
3476
|
-
|
|
3477
|
-
(a.option.page?.show === void 0 || a.option.page?.show) && !i(e).page.showTools && i(e).table.sortable.showPagination() ? (b(), h(i(
|
|
3473
|
+
F("div", _o, [
|
|
3474
|
+
(a.option.page?.show === void 0 || a.option.page?.show) && !i(e).page.showTools && i(e).table.sortable.showPagination() ? (b(), h(i(Ae), V({
|
|
3478
3475
|
key: 0,
|
|
3479
3476
|
"current-page": i(e).page.num,
|
|
3480
3477
|
"onUpdate:currentPage": d[8] || (d[8] = (p) => i(e).page.num = p),
|
|
@@ -3488,45 +3485,45 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
|
|
|
3488
3485
|
size: a.option.size?.table,
|
|
3489
3486
|
onSizeChange: i(e).table.sortable.refreshList,
|
|
3490
3487
|
onCurrentChange: i(e).table.sortable.refreshList
|
|
3491
|
-
}, a.option.page?.pagination || {}, z(a.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) :
|
|
3488
|
+
}, a.option.page?.pagination || {}, z(a.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : S("", !0)
|
|
3492
3489
|
])
|
|
3493
3490
|
], 2),
|
|
3494
3491
|
$(f.$slots, "box-right")
|
|
3495
3492
|
], 2),
|
|
3496
|
-
|
|
3493
|
+
O(i($e), V({
|
|
3497
3494
|
modelValue: i(e).update.show,
|
|
3498
3495
|
"onUpdate:modelValue": d[10] || (d[10] = (p) => i(e).update.show = p),
|
|
3499
3496
|
title: i(e).update.title,
|
|
3500
3497
|
"before-close": i(e).update.close
|
|
3501
3498
|
}, a.option.dialog), {
|
|
3502
3499
|
footer: y(() => [
|
|
3503
|
-
|
|
3504
|
-
|
|
3500
|
+
F("span", ea, [
|
|
3501
|
+
O(i(oe), {
|
|
3505
3502
|
size: a.option.size?.form
|
|
3506
3503
|
}, {
|
|
3507
3504
|
default: y(() => [
|
|
3508
3505
|
$(f.$slots, "dialog-footer", {
|
|
3509
3506
|
row: i(e).update
|
|
3510
3507
|
}, () => [
|
|
3511
|
-
|
|
3508
|
+
O(i(L), {
|
|
3512
3509
|
onClick: i(e).update.close
|
|
3513
3510
|
}, {
|
|
3514
3511
|
default: y(() => [
|
|
3515
|
-
|
|
3512
|
+
M(R(i(C).tCurd("close")), 1)
|
|
3516
3513
|
]),
|
|
3517
3514
|
_: 1
|
|
3518
3515
|
}, 8, ["onClick"]),
|
|
3519
|
-
i(e).update.type !== i(s).View ? (b(), h(i(
|
|
3516
|
+
i(e).update.type !== i(s).View ? (b(), h(i(L), {
|
|
3520
3517
|
key: 0,
|
|
3521
3518
|
type: "primary",
|
|
3522
3519
|
onClick: i(e).update.submit,
|
|
3523
3520
|
loading: i(e).update.loading
|
|
3524
3521
|
}, {
|
|
3525
3522
|
default: y(() => [
|
|
3526
|
-
|
|
3523
|
+
M(R(i(C).tCurd("submit")), 1)
|
|
3527
3524
|
]),
|
|
3528
3525
|
_: 1
|
|
3529
|
-
}, 8, ["onClick", "loading"])) :
|
|
3526
|
+
}, 8, ["onClick", "loading"])) : S("", !0)
|
|
3530
3527
|
])
|
|
3531
3528
|
]),
|
|
3532
3529
|
_: 3
|
|
@@ -3537,16 +3534,16 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
|
|
|
3537
3534
|
$(f.$slots, "dialog-start", {
|
|
3538
3535
|
row: i(e).update
|
|
3539
3536
|
}),
|
|
3540
|
-
|
|
3537
|
+
O(i(oe), {
|
|
3541
3538
|
ref_key: "ruleFormRef",
|
|
3542
|
-
ref:
|
|
3539
|
+
ref: n,
|
|
3543
3540
|
model: i(e).update.form,
|
|
3544
3541
|
rules: i(e).update.rules,
|
|
3545
3542
|
size: a.option.size?.form,
|
|
3546
3543
|
class: "update-dialog-form"
|
|
3547
3544
|
}, {
|
|
3548
3545
|
default: y(() => [
|
|
3549
|
-
i(e).update.showContent ? (b(), h(
|
|
3546
|
+
i(e).update.showContent ? (b(), h(nt, {
|
|
3550
3547
|
key: 0,
|
|
3551
3548
|
"form-grid": i(e).update.formGrid,
|
|
3552
3549
|
"max-span": i(e).update.formMaxSpan,
|
|
@@ -3561,11 +3558,11 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
|
|
|
3561
3558
|
}, Z({ _: 2 }, [
|
|
3562
3559
|
I(f.$slots, (p, w) => ({
|
|
3563
3560
|
name: w,
|
|
3564
|
-
fn: y((
|
|
3565
|
-
$(f.$slots, w, Me(Oe(
|
|
3561
|
+
fn: y((U) => [
|
|
3562
|
+
$(f.$slots, w, Me(Oe(U || {})))
|
|
3566
3563
|
])
|
|
3567
3564
|
}))
|
|
3568
|
-
]), 1032, ["form-grid", "max-span", "form", "type", "stripe", "label-width", "form-option", "get-bind", "get-on", "get-disabled"])) :
|
|
3565
|
+
]), 1032, ["form-grid", "max-span", "form", "type", "stripe", "label-width", "form-option", "get-bind", "get-on", "get-disabled"])) : S("", !0)
|
|
3569
3566
|
]),
|
|
3570
3567
|
_: 3
|
|
3571
3568
|
}, 8, ["model", "rules", "size"]),
|
|
@@ -3575,33 +3572,33 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
|
|
|
3575
3572
|
]),
|
|
3576
3573
|
_: 3
|
|
3577
3574
|
}, 16, ["modelValue", "title", "before-close"]),
|
|
3578
|
-
|
|
3575
|
+
O(i($e), {
|
|
3579
3576
|
modelValue: i(e).remove.show,
|
|
3580
3577
|
"onUpdate:modelValue": d[11] || (d[11] = (p) => i(e).remove.show = p),
|
|
3581
3578
|
title: i(e).remove.title,
|
|
3582
3579
|
"close-on-click-modal": !1
|
|
3583
3580
|
}, {
|
|
3584
3581
|
footer: y(() => [
|
|
3585
|
-
|
|
3586
|
-
|
|
3582
|
+
F("span", aa, [
|
|
3583
|
+
O(i(oe), {
|
|
3587
3584
|
size: a.option.size?.form
|
|
3588
3585
|
}, {
|
|
3589
3586
|
default: y(() => [
|
|
3590
|
-
|
|
3587
|
+
O(i(L), {
|
|
3591
3588
|
onClick: i(e).remove.close
|
|
3592
3589
|
}, {
|
|
3593
3590
|
default: y(() => [
|
|
3594
|
-
|
|
3591
|
+
M(R(i(C).tCurd("close")), 1)
|
|
3595
3592
|
]),
|
|
3596
3593
|
_: 1
|
|
3597
3594
|
}, 8, ["onClick"]),
|
|
3598
|
-
|
|
3595
|
+
O(i(L), {
|
|
3599
3596
|
type: "danger",
|
|
3600
3597
|
onClick: i(e).remove.submit,
|
|
3601
3598
|
loading: i(e).remove.loading
|
|
3602
3599
|
}, {
|
|
3603
3600
|
default: y(() => [
|
|
3604
|
-
|
|
3601
|
+
M(R(i(C).tCurd("confirmDelete")), 1)
|
|
3605
3602
|
]),
|
|
3606
3603
|
_: 1
|
|
3607
3604
|
}, 8, ["onClick", "loading"])
|
|
@@ -3611,25 +3608,25 @@ const Oo = /* @__PURE__ */ se(zo, [["render", Mo]]), Fo = { class: "row flex-cen
|
|
|
3611
3608
|
])
|
|
3612
3609
|
]),
|
|
3613
3610
|
default: y(() => [
|
|
3614
|
-
a.option.dialog?.delete?.content ? (b(),
|
|
3615
|
-
|
|
3611
|
+
a.option.dialog?.delete?.content ? (b(), v("div", ta, [
|
|
3612
|
+
O(co, {
|
|
3616
3613
|
content: a.option.dialog?.delete?.content,
|
|
3617
3614
|
value: i(e).remove.items
|
|
3618
3615
|
}, null, 8, ["content", "value"])
|
|
3619
|
-
])) : (b(),
|
|
3616
|
+
])) : (b(), v("div", oa, R(i(C).tCurd("confirmDeleteMessage", i(e).remove.items.length)), 1))
|
|
3620
3617
|
]),
|
|
3621
3618
|
_: 1
|
|
3622
3619
|
}, 8, ["modelValue", "title"]),
|
|
3623
|
-
|
|
3620
|
+
O(uo, {
|
|
3624
3621
|
ref_key: "switchConfirmRef",
|
|
3625
|
-
ref:
|
|
3622
|
+
ref: l,
|
|
3626
3623
|
size: a.option.size?.form
|
|
3627
3624
|
}, null, 8, ["size"])
|
|
3628
3625
|
], 2);
|
|
3629
3626
|
};
|
|
3630
3627
|
}
|
|
3631
3628
|
});
|
|
3632
|
-
class
|
|
3629
|
+
class ua {
|
|
3633
3630
|
/**
|
|
3634
3631
|
* 通过远程 URL 下载文件,自动创建临时 `<a>` 标签触发浏览器下载
|
|
3635
3632
|
*
|
|
@@ -3658,9 +3655,9 @@ class ia {
|
|
|
3658
3655
|
const t = document.createElement("input");
|
|
3659
3656
|
t.type = "file";
|
|
3660
3657
|
const e = o?.accept || ".json";
|
|
3661
|
-
t.accept = e, t.style.display = "none", t.onchange = (
|
|
3662
|
-
const
|
|
3663
|
-
if (!
|
|
3658
|
+
t.accept = e, t.style.display = "none", t.onchange = (l) => {
|
|
3659
|
+
const n = l.target.files[0];
|
|
3660
|
+
if (!n) {
|
|
3664
3661
|
E.fail("未选择文件"), r("未选择文件");
|
|
3665
3662
|
return;
|
|
3666
3663
|
}
|
|
@@ -3670,30 +3667,30 @@ class ia {
|
|
|
3670
3667
|
s(d);
|
|
3671
3668
|
}, u.onerror = () => {
|
|
3672
3669
|
E.fail("文件读取失败"), r("文件读取失败");
|
|
3673
|
-
}, u.readAsText(
|
|
3670
|
+
}, u.readAsText(n), document.body.removeChild(t);
|
|
3674
3671
|
}, document.body.appendChild(t), t.click();
|
|
3675
3672
|
});
|
|
3676
3673
|
}
|
|
3677
|
-
const
|
|
3678
|
-
if (a.component("TCurd",
|
|
3674
|
+
const la = (a, o) => {
|
|
3675
|
+
if (a.component("TCurd", na), a.component("TFormList", We), a.component("TColumn", Xt), o?.customComponent) {
|
|
3679
3676
|
q.customComponent = o.customComponent;
|
|
3680
3677
|
for (const s in o.customComponent)
|
|
3681
3678
|
a.component(s, o.customComponent[s]);
|
|
3682
3679
|
}
|
|
3683
|
-
},
|
|
3684
|
-
install:
|
|
3680
|
+
}, fa = {
|
|
3681
|
+
install: la
|
|
3685
3682
|
};
|
|
3686
3683
|
export {
|
|
3687
3684
|
X as ArrUtil,
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3685
|
+
ao as ExcelUtil,
|
|
3686
|
+
Xt as TColumn,
|
|
3687
|
+
na as TCurd,
|
|
3688
|
+
ua as TFile,
|
|
3692
3689
|
q as TForm,
|
|
3693
3690
|
B as TFormConfig,
|
|
3694
|
-
|
|
3695
|
-
|
|
3691
|
+
C as TFormI18n,
|
|
3692
|
+
We as TFormList,
|
|
3696
3693
|
E as TSys,
|
|
3697
|
-
|
|
3698
|
-
|
|
3694
|
+
fa as default,
|
|
3695
|
+
la as install
|
|
3699
3696
|
};
|