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