cc1-form 1.2.18 → 1.2.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cc1-form.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ElMessage as Ve, ElLoading as ze, ElForm as Q, ElFormItem as ae, ElInput as _, ElSwitch as Z, ElSelect as X, ElOption as W, ElRadioGroup as ie, ElRadio as re, ElTreeSelect as me, ElDatePicker as se, ElDialog as ne, ElButton as T, ElTableColumn as oe, ElDropdown as $e, ElDropdownMenu as De, ElDropdownItem as le, ElPagination as fe, ElTable as Ee } from "element-plus";
|
|
2
2
|
import "vue-router";
|
|
3
|
-
import { defineComponent as N, reactive as de, onMounted as he, resolveComponent as ee, createElementBlock as b, createCommentVNode as v, openBlock as d, renderSlot as
|
|
3
|
+
import { defineComponent as N, reactive as de, onMounted as he, resolveComponent as ee, createElementBlock as b, createCommentVNode as v, openBlock as d, renderSlot as V, createVNode as O, withCtx as g, createTextVNode as E, Fragment as D, renderList as A, createBlock as y, normalizeClass as I, normalizeStyle as ye, ref as J, unref as l, createElementVNode as U, mergeProps as C, toHandlers as z, resolveDynamicComponent as q, nextTick as Oe, watch as pe, toDisplayString as S, computed as ge, getCurrentInstance as Ue, createSlots as G, withModifiers as Se, resolveDirective as Me, withDirectives as Fe, normalizeProps as Ae, guardReactiveProps as Te } from "vue";
|
|
4
4
|
class M {
|
|
5
5
|
/**
|
|
6
6
|
* Vue Router 实例,需在应用初始化时赋值
|
|
@@ -63,9 +63,9 @@ class M {
|
|
|
63
63
|
* @param options 其他选项
|
|
64
64
|
*/
|
|
65
65
|
static showMessage(o, f, n = {}) {
|
|
66
|
-
const
|
|
67
|
-
if (!this.tipMessages[o] ||
|
|
68
|
-
this.tipMessages[o] =
|
|
66
|
+
const a = Date.now();
|
|
67
|
+
if (!this.tipMessages[o] || a - this.tipMessages[o] > this.tipMessagesGap) {
|
|
68
|
+
this.tipMessages[o] = a;
|
|
69
69
|
const t = Object.assign(
|
|
70
70
|
{
|
|
71
71
|
message: o,
|
|
@@ -117,11 +117,11 @@ class M {
|
|
|
117
117
|
*/
|
|
118
118
|
static openUrl = (o, f = !0) => {
|
|
119
119
|
if (f) {
|
|
120
|
-
let n = screen.width / 2 - 500,
|
|
120
|
+
let n = screen.width / 2 - 500, a = screen.height / 2 - 800 / 2 - 30;
|
|
121
121
|
window.open(
|
|
122
122
|
o,
|
|
123
123
|
"_blank",
|
|
124
|
-
"toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" +
|
|
124
|
+
"toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + a + ", left=" + n
|
|
125
125
|
);
|
|
126
126
|
} else
|
|
127
127
|
window.open(o, "DescriptiveWindowName" + StrUtil.getId(), "resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0");
|
|
@@ -132,10 +132,10 @@ class M {
|
|
|
132
132
|
* @returns
|
|
133
133
|
*/
|
|
134
134
|
static getImgPic = (o) => new Promise(async (f, n) => {
|
|
135
|
-
let
|
|
135
|
+
let a = document.getElementById(o.id);
|
|
136
136
|
const t = await M.loadModule("html2canvas");
|
|
137
137
|
try {
|
|
138
|
-
t(
|
|
138
|
+
t(a, {
|
|
139
139
|
logging: !1,
|
|
140
140
|
allowTaint: !0,
|
|
141
141
|
scale: window.devicePixelRatio,
|
|
@@ -538,9 +538,9 @@ class j {
|
|
|
538
538
|
* @returns 该字段对应类型的 options 配置,如 select 类型返回 `options.select`
|
|
539
539
|
*/
|
|
540
540
|
static findOptions = (o, f) => {
|
|
541
|
-
const n = o.column.find((t) => t.key === f),
|
|
541
|
+
const n = o.column.find((t) => t.key === f), a = (t) => t.replace(/-([a-z])/g, (e, r) => r.toUpperCase());
|
|
542
542
|
if (n)
|
|
543
|
-
return n.options[
|
|
543
|
+
return n.options[a(n.type)];
|
|
544
544
|
};
|
|
545
545
|
/**
|
|
546
546
|
* 更新组件数据
|
|
@@ -559,8 +559,8 @@ class j {
|
|
|
559
559
|
)
|
|
560
560
|
*/
|
|
561
561
|
static setOptionsData = (o, f, n) => {
|
|
562
|
-
const
|
|
563
|
-
|
|
562
|
+
const a = j.findOptions(o, f);
|
|
563
|
+
a && (a.data = n);
|
|
564
564
|
};
|
|
565
565
|
static form = {
|
|
566
566
|
openBefore: {
|
|
@@ -571,9 +571,9 @@ class j {
|
|
|
571
571
|
* @param treeData 树形数据
|
|
572
572
|
* @param option 组件配置
|
|
573
573
|
*/
|
|
574
|
-
parentId: (o, f, n,
|
|
574
|
+
parentId: (o, f, n, a) => {
|
|
575
575
|
const t = F.config.table.rowKey;
|
|
576
|
-
o ? f.type === M.EDialog.Add ? (f.form.parentId = o[t], f.form.sort = o.children.length + 1) : f.form.parentId = o.parentId.substring(o.parentId.lastIndexOf(",") + 1) : (f.form.parentId = "0", f.form.sort = n.length + 1), j.setOptionsData(
|
|
576
|
+
o ? f.type === M.EDialog.Add ? (f.form.parentId = o[t], f.form.sort = o.children.length + 1) : f.form.parentId = o.parentId.substring(o.parentId.lastIndexOf(",") + 1) : (f.form.parentId = "0", f.form.sort = n.length + 1), j.setOptionsData(a, "parentId", [{ [t]: "0", title: "根", children: n }]);
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
579
|
};
|
|
@@ -621,7 +621,7 @@ class w {
|
|
|
621
621
|
return o(...f);
|
|
622
622
|
o = String(o);
|
|
623
623
|
let n = 0;
|
|
624
|
-
return o.replace(/{([^}]+)}/g, (
|
|
624
|
+
return o.replace(/{([^}]+)}/g, (a, t) => n < f.length ? String(f[n++]) : `{${t}}`);
|
|
625
625
|
}
|
|
626
626
|
static setI18n = (o) => {
|
|
627
627
|
w.curd = ObjectUtil.deepMerge(w.curd, o);
|
|
@@ -645,12 +645,12 @@ class P {
|
|
|
645
645
|
*/
|
|
646
646
|
static setId = (o, f, n) => {
|
|
647
647
|
f[o] || (f[o] = []);
|
|
648
|
-
const
|
|
648
|
+
const a = F.config.table.rowKey;
|
|
649
649
|
f[o].forEach((t) => {
|
|
650
650
|
n.forEach((e) => {
|
|
651
651
|
let r = e.default ?? "";
|
|
652
652
|
e.type === "number" && (r = e.default ?? 0), e.type === "boolean" && (r = e.default ?? !1), e.type === "time" && (r = e.default ?? /* @__PURE__ */ new Date()), t[e.value] === void 0 && (t[e.value] = r);
|
|
653
|
-
}), t[
|
|
653
|
+
}), t[a] || (t[a] = P.getIdFun());
|
|
654
654
|
});
|
|
655
655
|
};
|
|
656
656
|
/**
|
|
@@ -660,7 +660,7 @@ class P {
|
|
|
660
660
|
* @param itemFields 元素字段-如:[{label:'',value:''}]
|
|
661
661
|
* @param callback 回调函数
|
|
662
662
|
*/
|
|
663
|
-
static add = (o, f, n,
|
|
663
|
+
static add = (o, f, n, a) => {
|
|
664
664
|
const t = JSONUtil.cp(n);
|
|
665
665
|
P.setId(o, f, n);
|
|
666
666
|
const e = F.config.table.rowKey;
|
|
@@ -672,7 +672,7 @@ class P {
|
|
|
672
672
|
},
|
|
673
673
|
{ [e]: P.getIdFun() }
|
|
674
674
|
)
|
|
675
|
-
),
|
|
675
|
+
), a?.(f);
|
|
676
676
|
};
|
|
677
677
|
/**
|
|
678
678
|
* 删除数组元素
|
|
@@ -681,9 +681,9 @@ class P {
|
|
|
681
681
|
* @param item 元素-如:{_id:''}
|
|
682
682
|
* @param callback 回调函数
|
|
683
683
|
*/
|
|
684
|
-
static remove = (o, f, n,
|
|
684
|
+
static remove = (o, f, n, a) => {
|
|
685
685
|
const t = F.config.table.rowKey;
|
|
686
|
-
f[o] = f[o].filter((e) => e[t] !== n[t]),
|
|
686
|
+
f[o] = f[o].filter((e) => e[t] !== n[t]), a?.(f);
|
|
687
687
|
};
|
|
688
688
|
/**
|
|
689
689
|
* 获取没有id的数据
|
|
@@ -692,9 +692,9 @@ class P {
|
|
|
692
692
|
* @returns 没有id的数据
|
|
693
693
|
*/
|
|
694
694
|
static getNoIdData = (o, f) => {
|
|
695
|
-
const n = JSONUtil.cp(o),
|
|
695
|
+
const n = JSONUtil.cp(o), a = F.config.table.rowKey;
|
|
696
696
|
return n.forEach((t) => {
|
|
697
|
-
t[
|
|
697
|
+
t[a] && delete t[a], f && t[f] && P.getNoIdData(t[f], f);
|
|
698
698
|
}), n;
|
|
699
699
|
};
|
|
700
700
|
}
|
|
@@ -748,23 +748,23 @@ const Le = {
|
|
|
748
748
|
show: !1,
|
|
749
749
|
add: (t, e, r) => {
|
|
750
750
|
P.add(t, e, r, () => {
|
|
751
|
-
|
|
751
|
+
a("change");
|
|
752
752
|
});
|
|
753
753
|
},
|
|
754
754
|
remove: (t, e, r) => {
|
|
755
755
|
P.remove(t, e, r, () => {
|
|
756
|
-
|
|
756
|
+
a("change");
|
|
757
757
|
});
|
|
758
758
|
}
|
|
759
759
|
});
|
|
760
760
|
he(() => {
|
|
761
761
|
P.setId(f.field, f.row, f.itemFields), n.show = !0;
|
|
762
762
|
});
|
|
763
|
-
const
|
|
763
|
+
const a = o;
|
|
764
764
|
return (t, e) => {
|
|
765
765
|
const r = ee("el-button"), s = ee("el-input");
|
|
766
766
|
return n.show ? (d(), b("div", Le, [
|
|
767
|
-
|
|
767
|
+
V(t.$slots, "list-start", { row: i.row }),
|
|
768
768
|
i.addBottom ? v("", !0) : (d(), b("div", Be, [
|
|
769
769
|
O(r, {
|
|
770
770
|
link: "",
|
|
@@ -778,26 +778,26 @@ const Le = {
|
|
|
778
778
|
})
|
|
779
779
|
])),
|
|
780
780
|
(d(!0), b(D, null, A(i.row[i.field], (m) => (d(), b("div", Re, [
|
|
781
|
-
|
|
781
|
+
V(t.$slots, "item-start", {
|
|
782
782
|
item: m,
|
|
783
783
|
row: i.row
|
|
784
784
|
}),
|
|
785
|
-
(d(!0), b(D, null, A(i.itemFields, (
|
|
786
|
-
modelValue: m[
|
|
787
|
-
"onUpdate:modelValue": (u) => m[
|
|
785
|
+
(d(!0), b(D, null, A(i.itemFields, (p) => (d(), y(s, {
|
|
786
|
+
modelValue: m[p.value],
|
|
787
|
+
"onUpdate:modelValue": (u) => m[p.value] = u,
|
|
788
788
|
style: ye({ width: i.inputWidth }),
|
|
789
789
|
class: I(i.inputClass),
|
|
790
|
-
placeholder:
|
|
791
|
-
onChange: e[1] || (e[1] = (u) =>
|
|
790
|
+
placeholder: p[i.label] || p[i.value],
|
|
791
|
+
onChange: e[1] || (e[1] = (u) => a("change"))
|
|
792
792
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "style", "class", "placeholder"]))), 256)),
|
|
793
|
-
|
|
793
|
+
V(t.$slots, "item-end", {
|
|
794
794
|
item: m,
|
|
795
795
|
row: i.row
|
|
796
796
|
}),
|
|
797
797
|
O(r, {
|
|
798
798
|
link: "",
|
|
799
799
|
type: "danger",
|
|
800
|
-
onClick: (
|
|
800
|
+
onClick: (p) => n.remove(i.field, i.row, m)
|
|
801
801
|
}, {
|
|
802
802
|
default: g(() => e[4] || (e[4] = [
|
|
803
803
|
E("删除")
|
|
@@ -817,7 +817,7 @@ const Le = {
|
|
|
817
817
|
_: 1
|
|
818
818
|
})
|
|
819
819
|
])) : v("", !0),
|
|
820
|
-
|
|
820
|
+
V(t.$slots, "list-end", { row: i.row })
|
|
821
821
|
])) : v("", !0);
|
|
822
822
|
};
|
|
823
823
|
}
|
|
@@ -841,7 +841,7 @@ const Le = {
|
|
|
841
841
|
}
|
|
842
842
|
},
|
|
843
843
|
setup(i, { expose: o }) {
|
|
844
|
-
const f = M.isFun, n = M.EDialog,
|
|
844
|
+
const f = M.isFun, n = M.EDialog, a = J(), t = i, e = de({
|
|
845
845
|
rules: {},
|
|
846
846
|
show: !0,
|
|
847
847
|
form: {},
|
|
@@ -853,60 +853,60 @@ const Le = {
|
|
|
853
853
|
getOn: (r) => r.options?.[e.type === n.Add ? "formAdd" : "formUpdate"]?.[r.type]?.on || r.options?.[r.type]?.on || {},
|
|
854
854
|
getColumnSpan: (r, s) => {
|
|
855
855
|
if (r.item.form?.spanCol) {
|
|
856
|
-
const m = t.option.form?.maxSpan || 12,
|
|
857
|
-
return (r.item.form?.span ||
|
|
856
|
+
const m = t.option.form?.maxSpan || 12, p = t.option.form?.defaultSpan || m / 2, k = s.filter((h) => !M.isFun(h.item.show?.form, e.form, e.type)).reduce((h, c) => h + (c.item.form?.span || p), 0);
|
|
857
|
+
return (r.item.form?.span || p) + k;
|
|
858
858
|
}
|
|
859
859
|
return r.item.form?.span;
|
|
860
860
|
},
|
|
861
861
|
initColumnForm: () => {
|
|
862
862
|
const r = t.option;
|
|
863
863
|
e.formColumn = [], e.rules = {}, e.formDefault = {};
|
|
864
|
-
const s = [], m = t.option.form?.maxSpan || 12,
|
|
864
|
+
const s = [], m = t.option.form?.maxSpan || 12, p = t.option.form?.defaultSpan || m / 2;
|
|
865
865
|
let u = [];
|
|
866
|
-
const k = (
|
|
867
|
-
if (
|
|
868
|
-
|
|
869
|
-
k(
|
|
866
|
+
const k = (c) => {
|
|
867
|
+
if (c.children) {
|
|
868
|
+
c.children.forEach(($) => {
|
|
869
|
+
k($);
|
|
870
870
|
});
|
|
871
871
|
return;
|
|
872
872
|
}
|
|
873
|
-
if (e.formDefault[
|
|
874
|
-
|
|
875
|
-
const
|
|
876
|
-
if (u.push({ item:
|
|
873
|
+
if (e.formDefault[c.key] = c.value, c.isForm && (typeof c.show?.form != "boolean" || c.show?.form)) {
|
|
874
|
+
c.form = c.form || { span: p }, c.form.span = c.form.span ?? p;
|
|
875
|
+
const $ = c.form.span, B = u.reduce((R, H) => R + H.span, $), L = u.length;
|
|
876
|
+
if (u.push({ item: c, span: $ }), (L === 1 && u[0].span === 0 || B >= m || $ === 0 && L > 1) && (s.push(u), u = []), c.rules) {
|
|
877
877
|
const R = {
|
|
878
878
|
input: w.tCurd("placeholderInput"),
|
|
879
879
|
select: w.tCurd("placeholderSelect")
|
|
880
|
-
}, H = (R[
|
|
881
|
-
e.rules[
|
|
880
|
+
}, H = (R[c.type] || R.input) + c.label;
|
|
881
|
+
e.rules[c.key] = typeof c.rules == "boolean" ? [
|
|
882
882
|
{
|
|
883
883
|
required: !0,
|
|
884
884
|
message: H,
|
|
885
885
|
trigger: "blur"
|
|
886
886
|
}
|
|
887
|
-
] :
|
|
887
|
+
] : c.rules;
|
|
888
888
|
}
|
|
889
889
|
}
|
|
890
|
-
},
|
|
891
|
-
|
|
890
|
+
}, h = (c, $) => {
|
|
891
|
+
c.isForm = $, Array.isArray(c.children) && c.children.forEach((B) => h(B, $));
|
|
892
892
|
};
|
|
893
|
-
r.column.forEach((
|
|
894
|
-
|
|
893
|
+
r.column.forEach((c) => {
|
|
894
|
+
h(c, !0), k(c);
|
|
895
895
|
}), u.length > 0 && s.push(u), e.formColumn = s, e.form = JSONUtil.cp(e.formDefault);
|
|
896
896
|
}
|
|
897
897
|
});
|
|
898
898
|
return e.initColumnForm(), o({
|
|
899
|
-
ref:
|
|
899
|
+
ref: a,
|
|
900
900
|
conf: e
|
|
901
|
-
}), (r, s) => (d(),
|
|
901
|
+
}), (r, s) => (d(), y(l(Q), {
|
|
902
902
|
ref_key: "ruleFormRef",
|
|
903
|
-
ref:
|
|
903
|
+
ref: a,
|
|
904
904
|
model: e.form,
|
|
905
905
|
rules: e.rules
|
|
906
906
|
}, {
|
|
907
907
|
default: g(() => [
|
|
908
|
-
e.show ? (d(!0), b(D, { key: 0 }, A(e.formColumn, (m,
|
|
909
|
-
|
|
908
|
+
e.show ? (d(!0), b(D, { key: 0 }, A(e.formColumn, (m, p) => (d(), b(D, { key: p }, [
|
|
909
|
+
l(f)(
|
|
910
910
|
m.map((u) => u.item?.show?.form),
|
|
911
911
|
e.form,
|
|
912
912
|
e.type
|
|
@@ -916,119 +916,119 @@ const Le = {
|
|
|
916
916
|
stripe: i.option.form?.stripe === void 0 ? !0 : i.option.form?.stripe
|
|
917
917
|
}])
|
|
918
918
|
}, [
|
|
919
|
-
|
|
919
|
+
V(r.$slots, "form-start", {
|
|
920
920
|
row: e.form
|
|
921
921
|
}),
|
|
922
922
|
(d(!0), b(D, null, A(m, (u) => (d(), b(D, {
|
|
923
923
|
key: u.item.key
|
|
924
924
|
}, [
|
|
925
|
-
|
|
925
|
+
l(f)(u.item.show?.form, e.form, e.type) ? (d(), b("div", {
|
|
926
926
|
key: 0,
|
|
927
927
|
class: I([u.item.form.span > 0 ? `col-${e.getColumnSpan(u, m)}` : "col", `form-item-col-${u.item.key}`])
|
|
928
928
|
}, [
|
|
929
|
-
O(
|
|
929
|
+
O(l(ae), {
|
|
930
930
|
label: u.item.text?.form?.label ?? u.item.label,
|
|
931
931
|
prop: u.item.key,
|
|
932
932
|
"label-width": u.item.text?.form?.label == "" ? 0 : u.item.form?.labelWidth || i.option.form?.labelWidth || "100px"
|
|
933
933
|
}, {
|
|
934
934
|
default: g(() => [
|
|
935
935
|
U("div", He, [
|
|
936
|
-
|
|
936
|
+
V(r.$slots, "form-" + u.item.key + "-start", {
|
|
937
937
|
row: e.form,
|
|
938
938
|
item: u.item
|
|
939
939
|
}),
|
|
940
940
|
U("div", Ke, [
|
|
941
941
|
U("div", Pe, [
|
|
942
|
-
|
|
942
|
+
V(r.$slots, "form-" + u.item.key, {
|
|
943
943
|
row: e.form,
|
|
944
944
|
item: u.item
|
|
945
945
|
}, () => [
|
|
946
|
-
u.item.type === "input" ? (d(),
|
|
946
|
+
u.item.type === "input" ? (d(), y(l(_), C({
|
|
947
947
|
key: 0,
|
|
948
948
|
modelValue: e.form[u.item.key],
|
|
949
949
|
"onUpdate:modelValue": (k) => e.form[u.item.key] = k,
|
|
950
950
|
ref_for: !0
|
|
951
|
-
}, e.getBind(u.item),
|
|
951
|
+
}, e.getBind(u.item), z(e.getOn(u.item)), {
|
|
952
952
|
disabled: e.getDisabled(u.item)
|
|
953
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "switch" ? (d(),
|
|
953
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "switch" ? (d(), y(l(Z), C({
|
|
954
954
|
key: 1,
|
|
955
955
|
modelValue: e.form[u.item.key],
|
|
956
956
|
"onUpdate:modelValue": (k) => e.form[u.item.key] = k,
|
|
957
957
|
ref_for: !0
|
|
958
|
-
}, e.getBind(u.item),
|
|
958
|
+
}, e.getBind(u.item), z(e.getOn(u.item)), {
|
|
959
959
|
disabled: e.getDisabled(u.item)
|
|
960
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "select" ? (d(),
|
|
960
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "select" ? (d(), y(l(X), C({
|
|
961
961
|
key: 2,
|
|
962
962
|
modelValue: e.form[u.item.key],
|
|
963
963
|
"onUpdate:modelValue": (k) => e.form[u.item.key] = k,
|
|
964
964
|
ref_for: !0
|
|
965
|
-
}, e.getBind(u.item),
|
|
965
|
+
}, e.getBind(u.item), z(e.getOn(u.item)), {
|
|
966
966
|
disabled: e.getDisabled(u.item),
|
|
967
967
|
style: { width: "100%" }
|
|
968
968
|
}), {
|
|
969
969
|
default: g(() => [
|
|
970
|
-
(d(!0), b(D, null, A(u.item.options?.select?.data, (k) => (d(),
|
|
970
|
+
(d(!0), b(D, null, A(u.item.options?.select?.data, (k) => (d(), y(l(W), {
|
|
971
971
|
key: k.value,
|
|
972
972
|
label: k.label,
|
|
973
973
|
value: k.value
|
|
974
974
|
}, null, 8, ["label", "value"]))), 128))
|
|
975
975
|
]),
|
|
976
976
|
_: 2
|
|
977
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "radio" ? (d(),
|
|
977
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "radio" ? (d(), y(l(ie), C({
|
|
978
978
|
key: 3,
|
|
979
979
|
modelValue: e.form[u.item.key],
|
|
980
980
|
"onUpdate:modelValue": (k) => e.form[u.item.key] = k,
|
|
981
981
|
ref_for: !0
|
|
982
|
-
}, e.getBind(u.item),
|
|
982
|
+
}, e.getBind(u.item), z(e.getOn(u.item)), {
|
|
983
983
|
disabled: e.getDisabled(u.item),
|
|
984
984
|
style: { width: "100%" }
|
|
985
985
|
}), {
|
|
986
986
|
default: g(() => [
|
|
987
|
-
(d(!0), b(D, null, A(u.item.options?.radio?.data, (k) => (d(),
|
|
987
|
+
(d(!0), b(D, null, A(u.item.options?.radio?.data, (k) => (d(), y(l(re), {
|
|
988
988
|
key: k.value,
|
|
989
989
|
label: k.label,
|
|
990
990
|
value: k.value
|
|
991
991
|
}, null, 8, ["label", "value"]))), 128))
|
|
992
992
|
]),
|
|
993
993
|
_: 2
|
|
994
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "list" ? (d(),
|
|
994
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "list" ? (d(), y(ue, C({
|
|
995
995
|
key: 4,
|
|
996
996
|
row: e.form,
|
|
997
997
|
field: u.item.key,
|
|
998
998
|
ref_for: !0
|
|
999
|
-
}, e.getBind(u.item),
|
|
999
|
+
}, e.getBind(u.item), z(e.getOn(u.item)), {
|
|
1000
1000
|
disabled: e.getDisabled(u.item),
|
|
1001
1001
|
style: { width: "100%" }
|
|
1002
|
-
}), null, 16, ["row", "field", "disabled"])) : u.item.type === "treeSelect" ? (d(),
|
|
1002
|
+
}), null, 16, ["row", "field", "disabled"])) : u.item.type === "treeSelect" ? (d(), y(l(me), C({
|
|
1003
1003
|
key: 5,
|
|
1004
1004
|
modelValue: e.form[u.item.key],
|
|
1005
1005
|
"onUpdate:modelValue": (k) => e.form[u.item.key] = k,
|
|
1006
1006
|
ref_for: !0
|
|
1007
|
-
}, e.getBind(u.item),
|
|
1007
|
+
}, e.getBind(u.item), z(e.getOn(u.item)), {
|
|
1008
1008
|
disabled: e.getDisabled(u.item),
|
|
1009
1009
|
style: { width: "100%" }
|
|
1010
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "datetime" ? (d(),
|
|
1010
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "datetime" ? (d(), y(l(se), C({
|
|
1011
1011
|
key: 6,
|
|
1012
1012
|
modelValue: e.form[u.item.key],
|
|
1013
1013
|
"onUpdate:modelValue": (k) => e.form[u.item.key] = k,
|
|
1014
1014
|
ref_for: !0
|
|
1015
|
-
}, e.getBind(u.item),
|
|
1015
|
+
}, e.getBind(u.item), z(e.getOn(u.item)), {
|
|
1016
1016
|
disabled: e.getDisabled(u.item)
|
|
1017
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type && (
|
|
1017
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type && (l(j).customComponent[u.item.type] || l(j).customComponent[u.item.type]?.form) ? (d(), y(q(l(j).customComponent[u.item.type]?.form || l(j).customComponent[u.item.type]), C({
|
|
1018
1018
|
key: 7,
|
|
1019
1019
|
modelValue: e.form[u.item.key],
|
|
1020
1020
|
"onUpdate:modelValue": (k) => e.form[u.item.key] = k,
|
|
1021
1021
|
ref_for: !0
|
|
1022
|
-
}, e.getBind(u.item),
|
|
1022
|
+
}, e.getBind(u.item), z(e.getOn(u.item)), {
|
|
1023
1023
|
disabled: e.getDisabled(u.item)
|
|
1024
1024
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : v("", !0)
|
|
1025
1025
|
]),
|
|
1026
|
-
|
|
1026
|
+
V(r.$slots, "form-" + u.item.key + "-right", {
|
|
1027
1027
|
row: e.form,
|
|
1028
1028
|
item: u.item
|
|
1029
1029
|
})
|
|
1030
1030
|
]),
|
|
1031
|
-
|
|
1031
|
+
V(r.$slots, "form-" + u.item.key + "-tip", {
|
|
1032
1032
|
row: e.form,
|
|
1033
1033
|
item: u.item
|
|
1034
1034
|
}, () => [
|
|
@@ -1039,7 +1039,7 @@ const Le = {
|
|
|
1039
1039
|
}, null, 8, Ne)) : v("", !0)
|
|
1040
1040
|
])
|
|
1041
1041
|
]),
|
|
1042
|
-
|
|
1042
|
+
V(r.$slots, "form-" + u.item.key + "-end", {
|
|
1043
1043
|
row: e.form,
|
|
1044
1044
|
item: u.item
|
|
1045
1045
|
})
|
|
@@ -1049,7 +1049,7 @@ const Le = {
|
|
|
1049
1049
|
}, 1032, ["label", "prop", "label-width"])
|
|
1050
1050
|
], 2)) : v("", !0)
|
|
1051
1051
|
], 64))), 128)),
|
|
1052
|
-
|
|
1052
|
+
V(r.$slots, "form-end", {
|
|
1053
1053
|
row: e.form
|
|
1054
1054
|
})
|
|
1055
1055
|
], 2)) : v("", !0)
|
|
@@ -1069,13 +1069,13 @@ class Je {
|
|
|
1069
1069
|
*/
|
|
1070
1070
|
static exportToExcel = async (o, f, n) => {
|
|
1071
1071
|
if (!o || o.length === 0) return;
|
|
1072
|
-
const
|
|
1072
|
+
const a = await M.loadModule("xlsx"), t = o.map((s) => {
|
|
1073
1073
|
const m = {};
|
|
1074
|
-
return f.forEach((
|
|
1075
|
-
m[
|
|
1074
|
+
return f.forEach((p) => {
|
|
1075
|
+
m[p.label] = s[p.key];
|
|
1076
1076
|
}), m;
|
|
1077
|
-
}), e =
|
|
1078
|
-
|
|
1077
|
+
}), e = a.utils.json_to_sheet(t), r = a.utils.book_new();
|
|
1078
|
+
a.utils.book_append_sheet(r, e, "Sheet1"), n ? typeof n == "function" && (n = n()) : n = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, a.writeFile(r, `${n}.xlsx`);
|
|
1079
1079
|
};
|
|
1080
1080
|
}
|
|
1081
1081
|
class x {
|
|
@@ -1097,13 +1097,13 @@ class x {
|
|
|
1097
1097
|
* @returns
|
|
1098
1098
|
*/
|
|
1099
1099
|
static setValue = (o, f, n = !1) => {
|
|
1100
|
-
n && x.delAllKey(o), Object.keys(f).forEach((
|
|
1101
|
-
o[
|
|
1100
|
+
n && x.delAllKey(o), Object.keys(f).forEach((a) => {
|
|
1101
|
+
o[a] !== f[a] && (o[a] = f[a]);
|
|
1102
1102
|
});
|
|
1103
1103
|
};
|
|
1104
1104
|
}
|
|
1105
1105
|
const K = M.EDialog, qe = (i) => {
|
|
1106
|
-
const o = J(), f = J(), n = J(),
|
|
1106
|
+
const o = J(), f = J(), n = J(), a = de({
|
|
1107
1107
|
option: i.option,
|
|
1108
1108
|
/** 查询区域相关配置对象 */
|
|
1109
1109
|
search: {
|
|
@@ -1122,23 +1122,23 @@ const K = M.EDialog, qe = (i) => {
|
|
|
1122
1122
|
getFormData: () => {
|
|
1123
1123
|
let t = {};
|
|
1124
1124
|
i.option.column.forEach((r) => {
|
|
1125
|
-
(typeof r.show?.search == "function" ? r.show?.search(
|
|
1125
|
+
(typeof r.show?.search == "function" ? r.show?.search(a.search.form) : r.show?.search) && (t[r.key] = a.search.form[r.key]);
|
|
1126
1126
|
});
|
|
1127
1127
|
const e = i.option.search?.before?.(t);
|
|
1128
1128
|
return e && (t = e), t;
|
|
1129
1129
|
},
|
|
1130
1130
|
/** 重置搜索表单 */
|
|
1131
1131
|
reset: () => {
|
|
1132
|
-
const t =
|
|
1132
|
+
const t = a.search.formDefault;
|
|
1133
1133
|
Object.keys(t).forEach((r) => {
|
|
1134
|
-
i.option.search?.resetMode === "none" ? t[r] = void 0 : t[r] =
|
|
1134
|
+
i.option.search?.resetMode === "none" ? t[r] = void 0 : t[r] = a.search.formDefault[r];
|
|
1135
1135
|
});
|
|
1136
1136
|
const e = ObjectUtil.deepMerge(t, {});
|
|
1137
|
-
x.setValue(
|
|
1137
|
+
x.setValue(a.search.form, e, !0), a.page.num = 1, i.option.init !== !1 && a.table.getList();
|
|
1138
1138
|
},
|
|
1139
1139
|
/** 提交搜索表单 */
|
|
1140
1140
|
submit: () => {
|
|
1141
|
-
|
|
1141
|
+
a.page.num = 1, a.table.getList();
|
|
1142
1142
|
}
|
|
1143
1143
|
},
|
|
1144
1144
|
/** 分页区域相关配置对象 */
|
|
@@ -1159,9 +1159,9 @@ const K = M.EDialog, qe = (i) => {
|
|
|
1159
1159
|
pagerCount: i.option.page?.pagerCount || F.config.pagination.pagerCount,
|
|
1160
1160
|
/** 获取分页查询参数 */
|
|
1161
1161
|
getQuery: (t = {}) => ({
|
|
1162
|
-
[F.config.field.page.size]: t.size ||
|
|
1163
|
-
[F.config.field.page.num]: t.num ||
|
|
1164
|
-
...
|
|
1162
|
+
[F.config.field.page.size]: t.size || a.page.size,
|
|
1163
|
+
[F.config.field.page.num]: t.num || a.page.num,
|
|
1164
|
+
...a.search.getFormData()
|
|
1165
1165
|
})
|
|
1166
1166
|
},
|
|
1167
1167
|
/** 表格区域相关配置对象 */
|
|
@@ -1186,8 +1186,8 @@ const K = M.EDialog, qe = (i) => {
|
|
|
1186
1186
|
},
|
|
1187
1187
|
/** 全部展开/收起 */
|
|
1188
1188
|
all: () => {
|
|
1189
|
-
if (
|
|
1190
|
-
|
|
1189
|
+
if (a.table.expand.isExpand)
|
|
1190
|
+
a.table.expand.rowKeys = [];
|
|
1191
1191
|
else {
|
|
1192
1192
|
const t = (e) => {
|
|
1193
1193
|
let r = [];
|
|
@@ -1195,9 +1195,9 @@ const K = M.EDialog, qe = (i) => {
|
|
|
1195
1195
|
r.push(s[i.option.table.rowKey]), s.children && s.children.length > 0 && (r = r.concat(t(s.children)));
|
|
1196
1196
|
}), r;
|
|
1197
1197
|
};
|
|
1198
|
-
|
|
1198
|
+
a.table.expand.rowKeys = t(a.table.data);
|
|
1199
1199
|
}
|
|
1200
|
-
|
|
1200
|
+
a.table.expand.isExpand = !a.table.expand.isExpand;
|
|
1201
1201
|
}
|
|
1202
1202
|
},
|
|
1203
1203
|
/** 表格列相关配置 */
|
|
@@ -1219,45 +1219,47 @@ const K = M.EDialog, qe = (i) => {
|
|
|
1219
1219
|
expand: !1,
|
|
1220
1220
|
/** 全部展开/收起主分组 */
|
|
1221
1221
|
toggleExpandAll: () => {
|
|
1222
|
-
const t = !
|
|
1223
|
-
|
|
1222
|
+
const t = !a.table.header.group.expand;
|
|
1223
|
+
a.table.header.group.expand = t;
|
|
1224
1224
|
const e = (r) => {
|
|
1225
1225
|
r.forEach((s) => {
|
|
1226
1226
|
s.table?.header?.group !== void 0 && (s.table.header.group = !t), s.table?.header?.groupKey !== void 0 && (s.table.header.show = t), Array.isArray(s.children) && s.children.length > 0 && e(s.children);
|
|
1227
1227
|
});
|
|
1228
1228
|
};
|
|
1229
|
-
e(
|
|
1229
|
+
e(a.table.column.list);
|
|
1230
1230
|
}
|
|
1231
1231
|
}
|
|
1232
1232
|
},
|
|
1233
1233
|
/** 获取数据列表接口实现 */
|
|
1234
1234
|
getList: async () => {
|
|
1235
|
-
|
|
1235
|
+
a.table.loading = !0;
|
|
1236
1236
|
const t = i.option.api.list;
|
|
1237
1237
|
try {
|
|
1238
|
-
await
|
|
1238
|
+
await a.initApiData("init");
|
|
1239
1239
|
let e = {};
|
|
1240
|
-
if (
|
|
1241
|
-
const { props:
|
|
1240
|
+
if (a.table.sort.prop) {
|
|
1241
|
+
const { props: c, order: $ } = F.config.table.sort;
|
|
1242
1242
|
e = {
|
|
1243
|
-
[
|
|
1244
|
-
[
|
|
1243
|
+
[c.field]: a.table.sort.prop,
|
|
1244
|
+
[$.field]: a.table.sort.order
|
|
1245
1245
|
};
|
|
1246
1246
|
}
|
|
1247
1247
|
const r = await t({
|
|
1248
|
-
...
|
|
1248
|
+
...a.page.getQuery(),
|
|
1249
1249
|
...e
|
|
1250
1250
|
}), s = F.config.field.result, m = r.data || { [s.list]: r };
|
|
1251
|
-
let
|
|
1252
|
-
const u =
|
|
1251
|
+
let p = (Array.isArray(m[s.list]), m[s.list]);
|
|
1252
|
+
const u = a.update.formColumn.flat(), h = ObjectUtil.deepMerge({ data: p }, {}).data.map((c) => (Object.keys(c).forEach((B) => {
|
|
1253
1253
|
const L = u.find((R) => R.item.key === B);
|
|
1254
1254
|
L && ["select", "radio"].includes(L.item.type) && (L.item.table.format || (L.item.table.format = (R) => L.item.options[L.item.type].data?.find((H) => H.value == R[B])?.label || R[B]));
|
|
1255
|
-
}),
|
|
1256
|
-
|
|
1255
|
+
}), c));
|
|
1256
|
+
a.table.data = i.option.data ? await i.option.data(h, p) : h, a.page.total = m[s.total] || 0, setTimeout(() => {
|
|
1257
|
+
a.table.selection.runFun();
|
|
1258
|
+
}, 20);
|
|
1257
1259
|
} catch (e) {
|
|
1258
1260
|
console.error(e);
|
|
1259
1261
|
} finally {
|
|
1260
|
-
|
|
1262
|
+
a.table.loading = !1;
|
|
1261
1263
|
}
|
|
1262
1264
|
},
|
|
1263
1265
|
/** 表格多选相关配置 */
|
|
@@ -1266,39 +1268,44 @@ const K = M.EDialog, qe = (i) => {
|
|
|
1266
1268
|
list: [],
|
|
1267
1269
|
/** 选中状态回调 */
|
|
1268
1270
|
change: (t) => {
|
|
1269
|
-
|
|
1271
|
+
a.table.selection.list = t;
|
|
1272
|
+
},
|
|
1273
|
+
/** 最后一次选中执行 */
|
|
1274
|
+
runFun: () => {
|
|
1270
1275
|
},
|
|
1271
1276
|
/** 设置表格多选数据 */
|
|
1272
1277
|
setList: (t, e) => {
|
|
1273
|
-
|
|
1278
|
+
a.table.selection.list = [];
|
|
1274
1279
|
const r = n.value;
|
|
1275
1280
|
if (r?.clearSelection(), !r || !t?.length) return;
|
|
1276
|
-
const s = i.option.table?.rowKey, m =
|
|
1277
|
-
const
|
|
1278
|
-
for (const
|
|
1281
|
+
const s = i.option.table?.rowKey, m = (p) => {
|
|
1282
|
+
const u = (k) => {
|
|
1283
|
+
for (const h of k) {
|
|
1279
1284
|
if (s != null && s !== "") {
|
|
1280
|
-
if (
|
|
1281
|
-
} else if (
|
|
1282
|
-
return
|
|
1283
|
-
if (Array.isArray(
|
|
1284
|
-
const
|
|
1285
|
-
if (
|
|
1285
|
+
if (h[s] === p[s]) return h;
|
|
1286
|
+
} else if (h === p)
|
|
1287
|
+
return h;
|
|
1288
|
+
if (Array.isArray(h.children) && h.children.length) {
|
|
1289
|
+
const c = u(h.children);
|
|
1290
|
+
if (c !== void 0) return c;
|
|
1286
1291
|
}
|
|
1287
1292
|
}
|
|
1288
1293
|
};
|
|
1289
|
-
return
|
|
1294
|
+
return u(a.table.data);
|
|
1290
1295
|
};
|
|
1291
|
-
|
|
1292
|
-
t.forEach((
|
|
1293
|
-
const
|
|
1296
|
+
a.table.selection.runFun = () => {
|
|
1297
|
+
t.forEach((p) => {
|
|
1298
|
+
const u = m(p) ?? p;
|
|
1294
1299
|
if (e) {
|
|
1295
|
-
const
|
|
1296
|
-
r.toggleRowSelection(
|
|
1300
|
+
const k = () => {
|
|
1301
|
+
r.toggleRowSelection(u, !0, !1);
|
|
1297
1302
|
};
|
|
1298
|
-
e(
|
|
1303
|
+
e(p) !== !1 && k();
|
|
1299
1304
|
} else
|
|
1300
|
-
r.toggleRowSelection(
|
|
1305
|
+
r.toggleRowSelection(u, !0, !1);
|
|
1301
1306
|
});
|
|
1307
|
+
}, Oe(() => {
|
|
1308
|
+
a.table.selection.runFun();
|
|
1302
1309
|
});
|
|
1303
1310
|
}
|
|
1304
1311
|
},
|
|
@@ -1310,13 +1317,13 @@ const K = M.EDialog, qe = (i) => {
|
|
|
1310
1317
|
order: "",
|
|
1311
1318
|
/** 排序变更回调 */
|
|
1312
1319
|
change: (t) => {
|
|
1313
|
-
F.config.table.sort.resetPage && (
|
|
1320
|
+
F.config.table.sort.resetPage && (a.page.num = 1);
|
|
1314
1321
|
const e = F.config.table.sort;
|
|
1315
1322
|
if (e.change) {
|
|
1316
|
-
e.change(t,
|
|
1323
|
+
e.change(t, a);
|
|
1317
1324
|
return;
|
|
1318
1325
|
}
|
|
1319
|
-
|
|
1326
|
+
a.table.sort.prop = t.prop, t.order === null ? (a.table.sort.order = "", a.table.sort.prop = "") : a.table.sort.order = t.order === "ascending" ? e.order.asc : e.order.desc, a.table.getList();
|
|
1320
1327
|
}
|
|
1321
1328
|
}
|
|
1322
1329
|
},
|
|
@@ -1326,7 +1333,7 @@ const K = M.EDialog, qe = (i) => {
|
|
|
1326
1333
|
run: {
|
|
1327
1334
|
/** 执行指定方式的导出(如select、page、all) */
|
|
1328
1335
|
start: async (t) => {
|
|
1329
|
-
let e = await
|
|
1336
|
+
let e = await a.export.run[t](), r = i.option.column;
|
|
1330
1337
|
const s = ObjectUtil.deepMerge(
|
|
1331
1338
|
{
|
|
1332
1339
|
data: e,
|
|
@@ -1338,55 +1345,55 @@ const K = M.EDialog, qe = (i) => {
|
|
|
1338
1345
|
},
|
|
1339
1346
|
/** 获取当前选中项进行导出 */
|
|
1340
1347
|
select: async () => {
|
|
1341
|
-
|
|
1348
|
+
a.export.loading = !0;
|
|
1342
1349
|
try {
|
|
1343
1350
|
if (i.option.tools?.export?.select) {
|
|
1344
1351
|
await i.option.tools?.export?.select({
|
|
1345
|
-
...
|
|
1346
|
-
items:
|
|
1352
|
+
...a.page.getQuery(),
|
|
1353
|
+
items: a.table.selection.list
|
|
1347
1354
|
});
|
|
1348
1355
|
return;
|
|
1349
1356
|
}
|
|
1350
|
-
if (
|
|
1357
|
+
if (a.table.selection.list.length === 0)
|
|
1351
1358
|
throw M.fail(w.tCurd("selectDataToExport")), new Error(w.tCurd("selectDataToExport"));
|
|
1352
|
-
return
|
|
1359
|
+
return a.table.selection.list;
|
|
1353
1360
|
} catch (t) {
|
|
1354
1361
|
console.error(t);
|
|
1355
1362
|
} finally {
|
|
1356
|
-
|
|
1363
|
+
a.export.loading = !1;
|
|
1357
1364
|
}
|
|
1358
1365
|
},
|
|
1359
1366
|
/** 导出当前页的数据 */
|
|
1360
1367
|
page: async () => {
|
|
1361
|
-
|
|
1368
|
+
a.export.loading = !0;
|
|
1362
1369
|
try {
|
|
1363
1370
|
if (i.option.tools?.export?.page) {
|
|
1364
1371
|
await i.option.tools?.export?.page({
|
|
1365
|
-
...
|
|
1372
|
+
...a.page.getQuery()
|
|
1366
1373
|
});
|
|
1367
1374
|
return;
|
|
1368
1375
|
}
|
|
1369
|
-
if (
|
|
1376
|
+
if (a.table.data.length === 0)
|
|
1370
1377
|
throw M.fail(w.tCurd("noData")), new Error(w.tCurd("noData"));
|
|
1371
|
-
return
|
|
1378
|
+
return a.table.data;
|
|
1372
1379
|
} catch (t) {
|
|
1373
1380
|
console.error(t);
|
|
1374
1381
|
} finally {
|
|
1375
|
-
|
|
1382
|
+
a.export.loading = !1;
|
|
1376
1383
|
}
|
|
1377
1384
|
},
|
|
1378
1385
|
/** 导出所有数据 */
|
|
1379
1386
|
all: async () => {
|
|
1380
|
-
|
|
1387
|
+
a.export.loading = !0;
|
|
1381
1388
|
try {
|
|
1382
1389
|
if (i.option.tools?.export?.all) {
|
|
1383
1390
|
await i.option.tools?.export?.all({
|
|
1384
|
-
...
|
|
1391
|
+
...a.page.getQuery()
|
|
1385
1392
|
});
|
|
1386
1393
|
return;
|
|
1387
1394
|
}
|
|
1388
1395
|
const t = i.option.api.list, e = await t({
|
|
1389
|
-
...
|
|
1396
|
+
...a.page.getQuery({
|
|
1390
1397
|
size: 999999,
|
|
1391
1398
|
num: 1
|
|
1392
1399
|
})
|
|
@@ -1395,7 +1402,7 @@ const K = M.EDialog, qe = (i) => {
|
|
|
1395
1402
|
} catch (t) {
|
|
1396
1403
|
console.error(t);
|
|
1397
1404
|
} finally {
|
|
1398
|
-
|
|
1405
|
+
a.export.loading = !1;
|
|
1399
1406
|
}
|
|
1400
1407
|
}
|
|
1401
1408
|
},
|
|
@@ -1403,7 +1410,7 @@ const K = M.EDialog, qe = (i) => {
|
|
|
1403
1410
|
loading: !1,
|
|
1404
1411
|
/** 执行导出操作的触发函数 */
|
|
1405
1412
|
click: (t) => {
|
|
1406
|
-
|
|
1413
|
+
a.export.loading || a.export.run.start(t);
|
|
1407
1414
|
}
|
|
1408
1415
|
},
|
|
1409
1416
|
/** 表单增删改弹窗相关对象 */
|
|
@@ -1427,27 +1434,27 @@ const K = M.EDialog, qe = (i) => {
|
|
|
1427
1434
|
/** 表单所有列,二维数组结构按行分组 */
|
|
1428
1435
|
formColumn: [],
|
|
1429
1436
|
/** 判断是否禁用当前字段 */
|
|
1430
|
-
getDisabled: (t, e = !1) => i.option.table?.editMode && e ? t.disabled?.table === void 0 ? !1 : t.disabled?.table :
|
|
1437
|
+
getDisabled: (t, e = !1) => i.option.table?.editMode && e ? t.disabled?.table === void 0 ? !1 : t.disabled?.table : a.update.type === K.View ? t.disabled?.view === void 0 ? !0 : t.disabled?.view : t.disabled?.[a.update.type === K.Add ? "create" : "update"],
|
|
1431
1438
|
/** 获取表单组件绑定属性 */
|
|
1432
|
-
getBind: (t) => t.options?.[
|
|
1439
|
+
getBind: (t) => t.options?.[a.update.type === K.Add ? "formAdd" : "formUpdate"]?.[t.type] || t.options?.[t.type] || {},
|
|
1433
1440
|
/** 获取表单组件事件属性 */
|
|
1434
1441
|
getOn: (t, e) => {
|
|
1435
|
-
const s = t.options?.[
|
|
1436
|
-
return Object.keys(s).forEach((
|
|
1437
|
-
const u = s[
|
|
1438
|
-
typeof u == "function" ? m[
|
|
1439
|
-
return u.apply(this, [...k, e ||
|
|
1440
|
-
} : m[
|
|
1442
|
+
const s = t.options?.[a.update.type === K.Add ? "formAdd" : "formUpdate"]?.[t.type]?.on || t.options?.[t.type]?.on || {}, m = {};
|
|
1443
|
+
return Object.keys(s).forEach((p) => {
|
|
1444
|
+
const u = s[p];
|
|
1445
|
+
typeof u == "function" ? m[p] = function(...k) {
|
|
1446
|
+
return u.apply(this, [...k, e || a.update.form, t]);
|
|
1447
|
+
} : m[p] = u;
|
|
1441
1448
|
}), m;
|
|
1442
1449
|
},
|
|
1443
1450
|
/** 获取表单组件绑定属性和事件 */
|
|
1444
1451
|
getOptions: (t) => {
|
|
1445
1452
|
try {
|
|
1446
|
-
const r =
|
|
1453
|
+
const r = a.update.formColumn.flat().find((s) => s.item.key === t)?.item;
|
|
1447
1454
|
return r ? {
|
|
1448
1455
|
options: r.options,
|
|
1449
1456
|
// @ts-ignore
|
|
1450
|
-
bind:
|
|
1457
|
+
bind: a.update.getBind(r)
|
|
1451
1458
|
} : { options: {}, bind: {} };
|
|
1452
1459
|
} catch {
|
|
1453
1460
|
return { options: {}, bind: {} };
|
|
@@ -1462,24 +1469,24 @@ const K = M.EDialog, qe = (i) => {
|
|
|
1462
1469
|
if (i.option.form?.editAll)
|
|
1463
1470
|
return t;
|
|
1464
1471
|
let e = {
|
|
1465
|
-
[i.option.table?.rowKey]:
|
|
1472
|
+
[i.option.table?.rowKey]: a.update.edit.data[i.option.table?.rowKey]
|
|
1466
1473
|
};
|
|
1467
|
-
return Object.keys(
|
|
1468
|
-
t[r] !==
|
|
1474
|
+
return Object.keys(a.update.edit.data).forEach((r) => {
|
|
1475
|
+
t[r] !== a.update.edit.data[r] && (e[r] = t[r]);
|
|
1469
1476
|
}), e;
|
|
1470
1477
|
}
|
|
1471
1478
|
},
|
|
1472
1479
|
view: {},
|
|
1473
1480
|
/** 打开增改弹窗 */
|
|
1474
1481
|
open: (t, e) => {
|
|
1475
|
-
|
|
1482
|
+
a.update.showContent || FunUtil.throttle(async () => {
|
|
1476
1483
|
M.loading(!0);
|
|
1477
1484
|
try {
|
|
1478
|
-
|
|
1485
|
+
a.update.type = t;
|
|
1479
1486
|
const r = t === K.Add;
|
|
1480
|
-
|
|
1481
|
-
const s = ObjectUtil.deepMerge(r ?
|
|
1482
|
-
x.setValue(
|
|
1487
|
+
a.update.edit.data = e, a.update.title = w.tCurd(r ? "add" : t === K.View ? "view" : "edit");
|
|
1488
|
+
const s = ObjectUtil.deepMerge(r ? a.update.formDefault : e, {});
|
|
1489
|
+
x.setValue(a.update.form, s, !0), await a.initApiData("update"), await i.option.form?.openBefore?.(a.update.form, a.update), (!i.option.table?.inlineEdit || r) && (a.update.show = !0, a.update.showContent = !0), i.option.form?.openAfter?.(a.update.form, a.update);
|
|
1483
1490
|
} catch (r) {
|
|
1484
1491
|
console.error(r);
|
|
1485
1492
|
} finally {
|
|
@@ -1490,17 +1497,17 @@ const K = M.EDialog, qe = (i) => {
|
|
|
1490
1497
|
/** 提交增改表单操作 */
|
|
1491
1498
|
submit: () => {
|
|
1492
1499
|
FunUtil.throttle(async () => {
|
|
1493
|
-
await f.value?.validate(async (s, m) => new Promise((
|
|
1494
|
-
s || (M.fail(w.tCurd("checkFormData")), u(!1)),
|
|
1495
|
-
})),
|
|
1496
|
-
const t =
|
|
1500
|
+
await f.value?.validate(async (s, m) => new Promise((p, u) => {
|
|
1501
|
+
s || (M.fail(w.tCurd("checkFormData")), u(!1)), p();
|
|
1502
|
+
})), a.update.loading = !0;
|
|
1503
|
+
const t = a.update.type === K.Add ? i.option.api.create : i.option.api.update;
|
|
1497
1504
|
try {
|
|
1498
|
-
await i.option.form?.submitBefore?.(
|
|
1505
|
+
await i.option.form?.submitBefore?.(a.update.form, a.update);
|
|
1499
1506
|
} catch {
|
|
1500
|
-
|
|
1507
|
+
a.update.loading = !1;
|
|
1501
1508
|
return;
|
|
1502
1509
|
}
|
|
1503
|
-
let e = ObjectUtil.deepMerge(
|
|
1510
|
+
let e = ObjectUtil.deepMerge(a.update.form, {});
|
|
1504
1511
|
delete e.children;
|
|
1505
1512
|
const r = new Set(i.option.column.filter((s) => s.type === "datetime").map((s) => s.key));
|
|
1506
1513
|
Object.keys(e).forEach((s) => {
|
|
@@ -1513,18 +1520,18 @@ const K = M.EDialog, qe = (i) => {
|
|
|
1513
1520
|
if (!t) return;
|
|
1514
1521
|
await t({
|
|
1515
1522
|
...e
|
|
1516
|
-
}),
|
|
1523
|
+
}), a.update.close(), await a.table.getList(), i.option.form?.submitAfter?.(e, a.update);
|
|
1517
1524
|
} catch (s) {
|
|
1518
1525
|
console.error(s);
|
|
1519
1526
|
} finally {
|
|
1520
|
-
|
|
1527
|
+
a.update.loading = !1;
|
|
1521
1528
|
}
|
|
1522
1529
|
});
|
|
1523
1530
|
},
|
|
1524
1531
|
/** 关闭弹窗和内容 */
|
|
1525
1532
|
close: () => {
|
|
1526
|
-
|
|
1527
|
-
|
|
1533
|
+
a.update.show = !1, i.option.table?.inlineEdit && (a.update.form = {}), setTimeout(() => {
|
|
1534
|
+
a.update.showContent = !1;
|
|
1528
1535
|
}, 350);
|
|
1529
1536
|
}
|
|
1530
1537
|
},
|
|
@@ -1540,7 +1547,7 @@ const K = M.EDialog, qe = (i) => {
|
|
|
1540
1547
|
loading: !1,
|
|
1541
1548
|
/** 关闭删除弹窗 */
|
|
1542
1549
|
close: () => {
|
|
1543
|
-
|
|
1550
|
+
a.remove.show = !1;
|
|
1544
1551
|
},
|
|
1545
1552
|
/** 打开删除弹窗并设置待删除项 */
|
|
1546
1553
|
open: (t) => {
|
|
@@ -1548,30 +1555,30 @@ const K = M.EDialog, qe = (i) => {
|
|
|
1548
1555
|
M.fail(w.tCurd("selectDataToDelete"));
|
|
1549
1556
|
return;
|
|
1550
1557
|
}
|
|
1551
|
-
|
|
1558
|
+
a.remove.items = t, a.remove.show = !0;
|
|
1552
1559
|
},
|
|
1553
1560
|
/** 执行删除实际操作 */
|
|
1554
1561
|
submit: () => {
|
|
1555
1562
|
FunUtil.throttle(async () => {
|
|
1556
|
-
|
|
1563
|
+
a.remove.loading = !0;
|
|
1557
1564
|
const t = i.option.api.delete;
|
|
1558
1565
|
try {
|
|
1559
1566
|
if (!t) return;
|
|
1560
1567
|
await t({
|
|
1561
|
-
[i.option.table?.rowKey]:
|
|
1562
|
-
items:
|
|
1563
|
-
}), M.success(w.tCurd("operationSuccess")),
|
|
1568
|
+
[i.option.table?.rowKey]: a.remove.items.map((e) => e[i.option.table?.rowKey]),
|
|
1569
|
+
items: a.remove.items
|
|
1570
|
+
}), M.success(w.tCurd("operationSuccess")), a.table.data.length <= 1 && a.page.num > 1 && (a.page.num -= 1), a.remove.close(), await a.table.getList();
|
|
1564
1571
|
} catch (e) {
|
|
1565
1572
|
console.error(e);
|
|
1566
1573
|
} finally {
|
|
1567
|
-
|
|
1574
|
+
a.remove.loading = !1;
|
|
1568
1575
|
}
|
|
1569
1576
|
});
|
|
1570
1577
|
}
|
|
1571
1578
|
},
|
|
1572
1579
|
/** 初始化curd关联所有默认与依赖配置及表单列 */
|
|
1573
1580
|
init: () => {
|
|
1574
|
-
|
|
1581
|
+
a.initCurdConfig(), a.initColumnOptions(), a.initColumnForm();
|
|
1575
1582
|
},
|
|
1576
1583
|
/** 下拉请求等数据缓存 */
|
|
1577
1584
|
apiDataMap: {},
|
|
@@ -1583,13 +1590,13 @@ const K = M.EDialog, qe = (i) => {
|
|
|
1583
1590
|
return;
|
|
1584
1591
|
}
|
|
1585
1592
|
if (s.options?.[s.type]?.dataApi && s.options?.[s.type]?.dataApiConfig?.[t]) {
|
|
1586
|
-
if (
|
|
1593
|
+
if (a.apiDataMap[s.key] && s.options?.[s.type]?.dataApiConfig?.once) return;
|
|
1587
1594
|
const m = (async () => {
|
|
1588
1595
|
try {
|
|
1589
|
-
let
|
|
1590
|
-
if (
|
|
1596
|
+
let p = await s.options?.[s.type]?.dataApi?.(a.update.form, a.update.type);
|
|
1597
|
+
if (p) {
|
|
1591
1598
|
const u = s.options?.[s.type]?.dataPath;
|
|
1592
|
-
!Array.isArray(
|
|
1599
|
+
!Array.isArray(p) && u && (p = ObjectUtil.getPathValue(p, u)), s.options[s.type].data = p, s.options.search[s.type].data = p, s.options.search[s.options.search.type ?? s.type] || (s.options.search[s.options.search.type ?? s.type] = {}), s.options.search[s.options.search.type ?? s.type].data = p, s.options.formAdd[s.type].data = p, s.options.formUpdate[s.type].data = p, a.apiDataMap[s.key] = p;
|
|
1593
1600
|
}
|
|
1594
1601
|
} catch {
|
|
1595
1602
|
}
|
|
@@ -1630,31 +1637,31 @@ const K = M.EDialog, qe = (i) => {
|
|
|
1630
1637
|
for (const s in t) {
|
|
1631
1638
|
if (s === "table") {
|
|
1632
1639
|
if (r.table = ObjectUtil.deepMerge(t.table, r.table || {}), r.children) {
|
|
1633
|
-
r.children.forEach((
|
|
1634
|
-
e(
|
|
1640
|
+
r.children.forEach((p) => {
|
|
1641
|
+
e(p);
|
|
1635
1642
|
});
|
|
1636
1643
|
return;
|
|
1637
1644
|
}
|
|
1638
1645
|
} else s === "type" ? r.type = r.type || t.type : r[s] = ObjectUtil.deepMerge(t[s], r[s] || {});
|
|
1639
|
-
r.options = r.options || {}, r.options[r.type] = r.options[r.type] || {}, r.options[r.type].size = i.option.size.form, ["search", "formAdd", "formUpdate"].forEach((
|
|
1640
|
-
r.options[
|
|
1646
|
+
r.options = r.options || {}, r.options[r.type] = r.options[r.type] || {}, r.options[r.type].size = i.option.size.form, ["search", "formAdd", "formUpdate"].forEach((p) => {
|
|
1647
|
+
r.options[p] = r.options[p] || ObjectUtil.deepMerge(r.options, {}), r.options[p][r.type] = r.options[p][r.type] || {}, r.options[p][r.type].size = p === "search" ? i.option.size.search : i.option.size.form;
|
|
1641
1648
|
}), r.table = ObjectUtil.deepMerge(r.table, r.options[r.type].table || {});
|
|
1642
1649
|
}
|
|
1643
1650
|
r.type === "switch" && (r.options.switch.tableBeforeChange = async (s, m) => {
|
|
1644
|
-
const
|
|
1651
|
+
const p = r.options?.switch;
|
|
1645
1652
|
try {
|
|
1646
|
-
|
|
1653
|
+
p.tableConfig?.confirm && await o.value?.open({
|
|
1647
1654
|
title: w.tCurd("confirmModify"),
|
|
1648
1655
|
content: w.tCurd("confirmSwitchMessage")
|
|
1649
1656
|
});
|
|
1650
1657
|
try {
|
|
1651
|
-
if (!i.option.api.update && !
|
|
1658
|
+
if (!i.option.api.update && !p.tableConfig?.api) return;
|
|
1652
1659
|
const u = m[i.option.table?.rowKey];
|
|
1653
|
-
|
|
1654
|
-
const k = m[s] ===
|
|
1655
|
-
if (!
|
|
1660
|
+
p.loadingMap || (p.loadingMap = {}), p.loadingMap[u] || (p.loadingMap[u] = { loading: !1 }), p.loadingMap[u].loading = !0;
|
|
1661
|
+
const k = m[s] === p.activeValue ? p.inactiveValue : p.activeValue, h = p.tableConfig?.api ? p.tableConfig.api : i.option.api.update;
|
|
1662
|
+
if (!h) return;
|
|
1656
1663
|
try {
|
|
1657
|
-
await
|
|
1664
|
+
await h(
|
|
1658
1665
|
{
|
|
1659
1666
|
...m,
|
|
1660
1667
|
[s]: k
|
|
@@ -1664,13 +1671,13 @@ const K = M.EDialog, qe = (i) => {
|
|
|
1664
1671
|
} catch {
|
|
1665
1672
|
return !1;
|
|
1666
1673
|
} finally {
|
|
1667
|
-
|
|
1674
|
+
p.loadingMap[u].loading = !1;
|
|
1668
1675
|
}
|
|
1669
|
-
return M.success(w.tCurd("operationSuccess")),
|
|
1676
|
+
return M.success(w.tCurd("operationSuccess")), p.tableConfig?.loadList && (a.table.loading = !0, a.table.getList(), a.table.loading = !1), !0;
|
|
1670
1677
|
} catch (u) {
|
|
1671
1678
|
return console.error(u), !1;
|
|
1672
1679
|
} finally {
|
|
1673
|
-
|
|
1680
|
+
a.table.loading = !1;
|
|
1674
1681
|
}
|
|
1675
1682
|
} catch {
|
|
1676
1683
|
return !1;
|
|
@@ -1681,7 +1688,7 @@ const K = M.EDialog, qe = (i) => {
|
|
|
1681
1688
|
},
|
|
1682
1689
|
getColumnSpan: (t, e) => {
|
|
1683
1690
|
if (t.item.form?.spanCol) {
|
|
1684
|
-
const r = F.config.form.defaultSpan, m = e.filter((
|
|
1691
|
+
const r = F.config.form.defaultSpan, m = e.filter((p) => !M.isFun(p.item.show?.form, a.update.form, a.update.type)).reduce((p, u) => p + (u.item.form?.span || r), 0);
|
|
1685
1692
|
return (t.item?.form.span || r) + m;
|
|
1686
1693
|
}
|
|
1687
1694
|
return t.item.form.span;
|
|
@@ -1689,71 +1696,71 @@ const K = M.EDialog, qe = (i) => {
|
|
|
1689
1696
|
/** 初始化配置并生成表单列及默认值及规则 */
|
|
1690
1697
|
initColumnForm: () => {
|
|
1691
1698
|
const t = i.option;
|
|
1692
|
-
|
|
1699
|
+
a.update.formColumn = [], a.table.column.show = {
|
|
1693
1700
|
list: [],
|
|
1694
1701
|
listSource: []
|
|
1695
1702
|
};
|
|
1696
1703
|
const e = [], r = i.option.form?.maxSpan || 12, s = i.option.form?.defaultSpan || r / 2;
|
|
1697
1704
|
let m = [];
|
|
1698
|
-
const
|
|
1699
|
-
if (
|
|
1700
|
-
|
|
1701
|
-
|
|
1705
|
+
const p = (c) => {
|
|
1706
|
+
if (c.children) {
|
|
1707
|
+
a.table.column.show.list.push(c.key), c.children.forEach(($) => {
|
|
1708
|
+
p($);
|
|
1702
1709
|
});
|
|
1703
1710
|
return;
|
|
1704
1711
|
}
|
|
1705
|
-
if (
|
|
1706
|
-
|
|
1707
|
-
let
|
|
1712
|
+
if (a.update.formDefault[c.key] = c.value, c.table.table && (c.show.table && a.table.column.show.list.push(c.key), c.table.table && a.table.column.show.listSource.push(c.key)), !(c.isForm && typeof c.show?.form == "boolean") || c.show?.form) {
|
|
1713
|
+
c.form = c.form || { span: s }, c.form.span = c.form.span ?? s;
|
|
1714
|
+
let $ = c.form.span, B = m.reduce((R, H) => R + H.span, $);
|
|
1708
1715
|
const L = m.length;
|
|
1709
|
-
if (m.push({ item:
|
|
1716
|
+
if (m.push({ item: c, span: $ }), (L === 1 && m[0].span === 0 || B >= r || $ === 0 && L > 1) && (e.push(m), m = []), c.rules) {
|
|
1710
1717
|
const R = {
|
|
1711
1718
|
input: w.tCurd("placeholderInput"),
|
|
1712
1719
|
select: w.tCurd("placeholderSelect")
|
|
1713
|
-
}, H = (R[
|
|
1720
|
+
}, H = (R[c.type] || R.input) + c.label, be = typeof c.rules == "boolean" ? [
|
|
1714
1721
|
{
|
|
1715
1722
|
required: !0,
|
|
1716
1723
|
message: H,
|
|
1717
1724
|
trigger: "blur"
|
|
1718
1725
|
}
|
|
1719
|
-
] :
|
|
1720
|
-
|
|
1726
|
+
] : c.rules;
|
|
1727
|
+
a.update.rules[c.key] = be.map((te) => {
|
|
1721
1728
|
if (te.validator) {
|
|
1722
1729
|
const we = te.validator;
|
|
1723
1730
|
return {
|
|
1724
1731
|
...te,
|
|
1725
|
-
validator: (ke, ve, Ce) => we(ke, ve, Ce,
|
|
1732
|
+
validator: (ke, ve, Ce) => we(ke, ve, Ce, a.update.form)
|
|
1726
1733
|
};
|
|
1727
1734
|
}
|
|
1728
1735
|
return te;
|
|
1729
1736
|
});
|
|
1730
1737
|
}
|
|
1731
1738
|
}
|
|
1732
|
-
}, u = (
|
|
1733
|
-
|
|
1739
|
+
}, u = (c, $) => {
|
|
1740
|
+
c.isForm = $, Array.isArray(c.children) && c.children.forEach((B) => u(B, $));
|
|
1734
1741
|
};
|
|
1735
|
-
t.column.forEach((
|
|
1736
|
-
|
|
1737
|
-
}), i.option.table?.column?.forEach((
|
|
1738
|
-
u(
|
|
1739
|
-
}),
|
|
1742
|
+
t.column.forEach((c) => {
|
|
1743
|
+
c.isForm = !0, u(c, !0), p(c);
|
|
1744
|
+
}), i.option.table?.column?.forEach((c) => {
|
|
1745
|
+
u(c, !1), p(c);
|
|
1746
|
+
}), a.search.column.list = t.column.concat(t.table?.column || []), a.table.column.list = a.search.column.list.filter((c) => c.table?.table), a.search.column.list.sort((c, $) => c.sort?.search - $.sort?.search), a.table.column.list.sort((c, $) => c.sort?.table - $.sort?.table), m.length > 0 && e.push(m), a.update.formColumn = e;
|
|
1740
1747
|
const k = i.option.search?.formDefault;
|
|
1741
|
-
k && Object.keys(k).forEach((
|
|
1742
|
-
|
|
1743
|
-
}), t.column.forEach((
|
|
1744
|
-
|
|
1748
|
+
k && Object.keys(k).forEach((c) => {
|
|
1749
|
+
a.search.formDefault[c] = k[c];
|
|
1750
|
+
}), t.column.forEach((c) => {
|
|
1751
|
+
c.show?.search || (a.search.formDefault[c.key] = void 0);
|
|
1745
1752
|
});
|
|
1746
|
-
const
|
|
1747
|
-
x.setValue(
|
|
1753
|
+
const h = ObjectUtil.deepMerge(a.search.formDefault, {});
|
|
1754
|
+
x.setValue(a.search.form, h, !0);
|
|
1748
1755
|
}
|
|
1749
1756
|
});
|
|
1750
|
-
return
|
|
1751
|
-
i.option.init !== !1 &&
|
|
1757
|
+
return a.init(), he(() => {
|
|
1758
|
+
i.option.init !== !1 && a.table.getList();
|
|
1752
1759
|
}), i.form && pe(
|
|
1753
|
-
() =>
|
|
1760
|
+
() => a.update.form,
|
|
1754
1761
|
(t) => {
|
|
1755
|
-
Object.keys(
|
|
1756
|
-
i.form[e] =
|
|
1762
|
+
Object.keys(a.update.form).forEach((e) => {
|
|
1763
|
+
i.form[e] = a.update.form[e];
|
|
1757
1764
|
});
|
|
1758
1765
|
},
|
|
1759
1766
|
{
|
|
@@ -1761,26 +1768,26 @@ const K = M.EDialog, qe = (i) => {
|
|
|
1761
1768
|
immediate: !0
|
|
1762
1769
|
}
|
|
1763
1770
|
), i.searchForm && pe(
|
|
1764
|
-
() =>
|
|
1771
|
+
() => a.search.form,
|
|
1765
1772
|
(t) => {
|
|
1766
|
-
Object.keys(
|
|
1767
|
-
i.searchForm[e] =
|
|
1773
|
+
Object.keys(a.search.form).forEach((e) => {
|
|
1774
|
+
i.searchForm[e] = a.search.form[e];
|
|
1768
1775
|
});
|
|
1769
1776
|
},
|
|
1770
1777
|
{
|
|
1771
1778
|
deep: !0,
|
|
1772
1779
|
immediate: !0
|
|
1773
1780
|
}
|
|
1774
|
-
), { conf:
|
|
1781
|
+
), { conf: a, switchConfirmRef: o, ruleFormRef: f, tableRef: n };
|
|
1775
1782
|
}, Qe = { class: "dialog-footer" }, Ge = /* @__PURE__ */ N({
|
|
1776
1783
|
__name: "switchConfirm",
|
|
1777
1784
|
props: {
|
|
1778
1785
|
size: {}
|
|
1779
1786
|
},
|
|
1780
1787
|
setup(i, { expose: o }) {
|
|
1781
|
-
const f = J(!1), n = J("确认修改"),
|
|
1788
|
+
const f = J(!1), n = J("确认修改"), a = J("确认要修改状态吗?");
|
|
1782
1789
|
let t = null, e = null;
|
|
1783
|
-
const r = (
|
|
1790
|
+
const r = (p) => (p?.title && (n.value = p.title), p?.content && (a.value = p.content), f.value = !0, new Promise((u, k) => {
|
|
1784
1791
|
t = u, e = k;
|
|
1785
1792
|
})), s = () => {
|
|
1786
1793
|
f.value = !1, t?.(!0), t = null, e = null;
|
|
@@ -1789,26 +1796,26 @@ const K = M.EDialog, qe = (i) => {
|
|
|
1789
1796
|
};
|
|
1790
1797
|
return o({
|
|
1791
1798
|
open: r
|
|
1792
|
-
}), (
|
|
1799
|
+
}), (p, u) => {
|
|
1793
1800
|
const k = ee("el-form");
|
|
1794
|
-
return d(),
|
|
1801
|
+
return d(), y(l(ne), {
|
|
1795
1802
|
modelValue: f.value,
|
|
1796
|
-
"onUpdate:modelValue": u[0] || (u[0] = (
|
|
1803
|
+
"onUpdate:modelValue": u[0] || (u[0] = (h) => f.value = h),
|
|
1797
1804
|
title: n.value,
|
|
1798
1805
|
"close-on-click-modal": !1,
|
|
1799
1806
|
width: "400px"
|
|
1800
1807
|
}, {
|
|
1801
1808
|
footer: g(() => [
|
|
1802
|
-
O(k, { size:
|
|
1809
|
+
O(k, { size: p.size }, {
|
|
1803
1810
|
default: g(() => [
|
|
1804
1811
|
U("span", Qe, [
|
|
1805
|
-
O(
|
|
1812
|
+
O(l(T), { onClick: m }, {
|
|
1806
1813
|
default: g(() => u[1] || (u[1] = [
|
|
1807
1814
|
E("取消")
|
|
1808
1815
|
])),
|
|
1809
1816
|
_: 1
|
|
1810
1817
|
}),
|
|
1811
|
-
O(
|
|
1818
|
+
O(l(T), {
|
|
1812
1819
|
type: "primary",
|
|
1813
1820
|
onClick: s
|
|
1814
1821
|
}, {
|
|
@@ -1823,7 +1830,7 @@ const K = M.EDialog, qe = (i) => {
|
|
|
1823
1830
|
}, 8, ["size"])
|
|
1824
1831
|
]),
|
|
1825
1832
|
default: g(() => [
|
|
1826
|
-
U("div", null, S(
|
|
1833
|
+
U("div", null, S(a.value), 1)
|
|
1827
1834
|
]),
|
|
1828
1835
|
_: 1
|
|
1829
1836
|
}, 8, ["modelValue", "title"]);
|
|
@@ -1831,8 +1838,8 @@ const K = M.EDialog, qe = (i) => {
|
|
|
1831
1838
|
}
|
|
1832
1839
|
}), Y = (i, o) => {
|
|
1833
1840
|
const f = i.__vccOpts || i;
|
|
1834
|
-
for (const [n,
|
|
1835
|
-
f[n] =
|
|
1841
|
+
for (const [n, a] of o)
|
|
1842
|
+
f[n] = a;
|
|
1836
1843
|
return f;
|
|
1837
1844
|
}, Xe = {}, Ye = {
|
|
1838
1845
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1854,7 +1861,7 @@ const xe = /* @__PURE__ */ Y(Xe, [["render", Ze]]), _e = ["innerHTML"], et = /*
|
|
|
1854
1861
|
},
|
|
1855
1862
|
setup(i) {
|
|
1856
1863
|
const o = i, f = ge(() => typeof o.content == "function" ? o.content(o.value) : o.content);
|
|
1857
|
-
return (n,
|
|
1864
|
+
return (n, a) => typeof f.value == "object" ? (d(), y(q(f.value), { key: 0 })) : (d(), b("div", {
|
|
1858
1865
|
key: 1,
|
|
1859
1866
|
innerHTML: f.value
|
|
1860
1867
|
}, null, 8, _e));
|
|
@@ -1907,22 +1914,22 @@ const pt = /* @__PURE__ */ Y(dt, [["render", ft]]), ct = { class: "row flex-cent
|
|
|
1907
1914
|
},
|
|
1908
1915
|
setup(i) {
|
|
1909
1916
|
const o = M.isFun, f = Ue().type;
|
|
1910
|
-
return (n,
|
|
1917
|
+
return (n, a) => {
|
|
1911
1918
|
const t = ee("el-tooltip");
|
|
1912
1919
|
return d(!0), b(D, null, A(n.columnList, (e) => (d(), b(D, {
|
|
1913
1920
|
key: e.key
|
|
1914
1921
|
}, [
|
|
1915
|
-
n.conf.table.column.show.list.includes(e.key) &&
|
|
1916
|
-
e.table?.header?.groupKey === void 0 || e.table.header.show ? (d(),
|
|
1922
|
+
n.conf.table.column.show.list.includes(e.key) && l(o)(e.show?.table, n.conf.table.data) ? (d(), b(D, { key: 0 }, [
|
|
1923
|
+
e.table?.header?.groupKey === void 0 || e.table.header.show ? (d(), y(l(oe), C({
|
|
1917
1924
|
key: 0,
|
|
1918
1925
|
prop: e.key,
|
|
1919
1926
|
label: e.label,
|
|
1920
1927
|
ref_for: !0
|
|
1921
1928
|
}, e.table), {
|
|
1922
1929
|
header: g(() => [
|
|
1923
|
-
|
|
1930
|
+
V(n.$slots, "table-header-" + e.key, { item: e }, () => [
|
|
1924
1931
|
U("div", ct, [
|
|
1925
|
-
e.table?.header?.tooltip ? (d(),
|
|
1932
|
+
e.table?.header?.tooltip ? (d(), y(t, {
|
|
1926
1933
|
key: 0,
|
|
1927
1934
|
effect: "dark",
|
|
1928
1935
|
placement: "top"
|
|
@@ -1952,23 +1959,23 @@ const pt = /* @__PURE__ */ Y(dt, [["render", ft]]), ct = { class: "row flex-cent
|
|
|
1952
1959
|
["stop"]
|
|
1953
1960
|
)
|
|
1954
1961
|
}, [
|
|
1955
|
-
e.table.header.group ? (d(),
|
|
1962
|
+
e.table.header.group ? (d(), y(st, { key: 0 })) : (d(), y(pt, { key: 1 }))
|
|
1956
1963
|
], 8, yt)) : v("", !0)
|
|
1957
1964
|
])
|
|
1958
1965
|
])
|
|
1959
1966
|
]),
|
|
1960
1967
|
default: g(({ row: r }) => [
|
|
1961
1968
|
e.children ? (d(), b(D, { key: 0 }, [
|
|
1962
|
-
|
|
1963
|
-
(d(),
|
|
1969
|
+
a[0] || (a[0] = E(" ")),
|
|
1970
|
+
(d(), y(q(l(f)), {
|
|
1964
1971
|
conf: n.conf,
|
|
1965
1972
|
columnList: e.children,
|
|
1966
1973
|
option: n.option
|
|
1967
1974
|
}, G({ _: 2 }, [
|
|
1968
1975
|
A(n.$slots, (s, m) => ({
|
|
1969
1976
|
name: m,
|
|
1970
|
-
fn: g((
|
|
1971
|
-
|
|
1977
|
+
fn: g((p) => [
|
|
1978
|
+
V(n.$slots, m, C({ ref_for: !0 }, p || {}))
|
|
1972
1979
|
])
|
|
1973
1980
|
}))
|
|
1974
1981
|
]), 1032, ["conf", "columnList", "option"]))
|
|
@@ -1978,18 +1985,18 @@ const pt = /* @__PURE__ */ Y(dt, [["render", ft]]), ct = { class: "row flex-cent
|
|
|
1978
1985
|
class: I(["row", ["table-edit-" + e.key]]),
|
|
1979
1986
|
style: { width: "100%" }
|
|
1980
1987
|
}, [
|
|
1981
|
-
|
|
1988
|
+
V(n.$slots, "table-edit-left-" + e.key, {
|
|
1982
1989
|
row: r,
|
|
1983
1990
|
item: e
|
|
1984
1991
|
}),
|
|
1985
|
-
e.type === "input" ? (d(),
|
|
1992
|
+
e.type === "input" ? (d(), y(l(_), C({
|
|
1986
1993
|
key: 0,
|
|
1987
1994
|
modelValue: r[e.key],
|
|
1988
1995
|
"onUpdate:modelValue": (s) => r[e.key] = s,
|
|
1989
1996
|
disabled: n.conf.update.getDisabled(e, !0),
|
|
1990
1997
|
class: "col",
|
|
1991
1998
|
ref_for: !0
|
|
1992
|
-
}, n.conf.update.getBind(e),
|
|
1999
|
+
}, n.conf.update.getBind(e), z(n.conf.update.getOn(e, r))), G({ _: 2 }, [
|
|
1993
2000
|
e.options?.input?.prepend ? {
|
|
1994
2001
|
name: "prepend",
|
|
1995
2002
|
fn: g(() => [
|
|
@@ -1997,43 +2004,43 @@ const pt = /* @__PURE__ */ Y(dt, [["render", ft]]), ct = { class: "row flex-cent
|
|
|
1997
2004
|
]),
|
|
1998
2005
|
key: "0"
|
|
1999
2006
|
} : void 0
|
|
2000
|
-
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "select" ? (d(),
|
|
2007
|
+
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "select" ? (d(), y(l(X), C({
|
|
2001
2008
|
key: 1,
|
|
2002
2009
|
modelValue: r[e.key],
|
|
2003
2010
|
"onUpdate:modelValue": (s) => r[e.key] = s,
|
|
2004
2011
|
disabled: n.conf.update.getDisabled(e, !0),
|
|
2005
2012
|
class: "col",
|
|
2006
2013
|
ref_for: !0
|
|
2007
|
-
}, n.conf.update.getBind(e),
|
|
2014
|
+
}, n.conf.update.getBind(e), z(n.conf.update.getOn(e, r))), {
|
|
2008
2015
|
default: g(() => [
|
|
2009
|
-
(d(!0), b(D, null, A(e.options?.search?.select?.data || e.options?.select?.data, (s) => (d(),
|
|
2016
|
+
(d(!0), b(D, null, A(e.options?.search?.select?.data || e.options?.select?.data, (s) => (d(), y(l(W), {
|
|
2010
2017
|
key: s.value,
|
|
2011
2018
|
label: s.label,
|
|
2012
2019
|
value: s.value
|
|
2013
2020
|
}, null, 8, ["label", "value"]))), 128))
|
|
2014
2021
|
]),
|
|
2015
2022
|
_: 2
|
|
2016
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "switch" ? (d(),
|
|
2023
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "switch" ? (d(), y(l(Z), C({
|
|
2017
2024
|
key: 2,
|
|
2018
2025
|
modelValue: r[e.key],
|
|
2019
2026
|
"onUpdate:modelValue": (s) => r[e.key] = s,
|
|
2020
2027
|
disabled: n.conf.update.getDisabled(e, !0),
|
|
2021
2028
|
class: "col",
|
|
2022
2029
|
ref_for: !0
|
|
2023
|
-
}, n.conf.update.getBind(e),
|
|
2024
|
-
|
|
2030
|
+
}, n.conf.update.getBind(e), z(n.conf.update.getOn(e, r))), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : v("", !0),
|
|
2031
|
+
V(n.$slots, "table-edit-right-" + e.key, {
|
|
2025
2032
|
row: r,
|
|
2026
2033
|
item: e
|
|
2027
2034
|
})
|
|
2028
2035
|
], 2)) : (d(), b(D, { key: 1 }, [
|
|
2029
|
-
n.conf.update.type ===
|
|
2030
|
-
e.type === "input" ? (d(),
|
|
2036
|
+
n.conf.update.type === l(M).EDialog.Update && l(o)(e.show?.form, n.conf.update.form, l(M).EDialog.Update) && n.option.table?.inlineEdit && n.conf.update.form[n.option.table?.rowKey] === r[n.option.table?.rowKey] && (e.type === "input" || e.type === "select") ? (d(), b(D, { key: 0 }, [
|
|
2037
|
+
e.type === "input" ? (d(), y(l(_), C({
|
|
2031
2038
|
key: 0,
|
|
2032
2039
|
modelValue: n.conf.update.form[e.key],
|
|
2033
2040
|
"onUpdate:modelValue": (s) => n.conf.update.form[e.key] = s,
|
|
2034
2041
|
disabled: n.conf.update.getDisabled(e, !0),
|
|
2035
2042
|
ref_for: !0
|
|
2036
|
-
}, n.conf.update.getBind(e),
|
|
2043
|
+
}, n.conf.update.getBind(e), z(n.conf.update.getOn(e, r)), { style: { width: "100%" } }), G({ _: 2 }, [
|
|
2037
2044
|
e.options?.input?.prepend ? {
|
|
2038
2045
|
name: "prepend",
|
|
2039
2046
|
fn: g(() => [
|
|
@@ -2041,41 +2048,41 @@ const pt = /* @__PURE__ */ Y(dt, [["render", ft]]), ct = { class: "row flex-cent
|
|
|
2041
2048
|
]),
|
|
2042
2049
|
key: "0"
|
|
2043
2050
|
} : void 0
|
|
2044
|
-
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "select" ? (d(),
|
|
2051
|
+
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "select" ? (d(), y(l(X), C({
|
|
2045
2052
|
key: 1,
|
|
2046
2053
|
modelValue: n.conf.update.form[e.key],
|
|
2047
2054
|
"onUpdate:modelValue": (s) => n.conf.update.form[e.key] = s,
|
|
2048
2055
|
disabled: n.conf.update.getDisabled(e, !0),
|
|
2049
2056
|
ref_for: !0
|
|
2050
|
-
}, n.conf.update.getBind(e),
|
|
2057
|
+
}, n.conf.update.getBind(e), z(n.conf.update.getOn(e, r)), { style: { width: "100%" } }), {
|
|
2051
2058
|
default: g(() => [
|
|
2052
|
-
(d(!0), b(D, null, A(e.options?.search?.select?.data || e.options?.select?.data, (s) => (d(),
|
|
2059
|
+
(d(!0), b(D, null, A(e.options?.search?.select?.data || e.options?.select?.data, (s) => (d(), y(l(W), {
|
|
2053
2060
|
key: s.value,
|
|
2054
2061
|
label: s.label,
|
|
2055
2062
|
value: s.value
|
|
2056
2063
|
}, null, 8, ["label", "value"]))), 128))
|
|
2057
2064
|
]),
|
|
2058
2065
|
_: 2
|
|
2059
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "switch" ? (d(),
|
|
2066
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "switch" ? (d(), y(l(Z), C({
|
|
2060
2067
|
key: 2,
|
|
2061
2068
|
modelValue: n.conf.update.form[e.key],
|
|
2062
2069
|
"onUpdate:modelValue": (s) => n.conf.update.form[e.key] = s,
|
|
2063
2070
|
ref_for: !0
|
|
2064
|
-
}, n.conf.update.getBind(e),
|
|
2071
|
+
}, n.conf.update.getBind(e), z(n.conf.update.getOn(e, r)), {
|
|
2065
2072
|
disabled: n.conf.update.getDisabled(e, !0)
|
|
2066
2073
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : v("", !0)
|
|
2067
|
-
], 64)) :
|
|
2074
|
+
], 64)) : V(n.$slots, "table-" + e.key, {
|
|
2068
2075
|
key: 1,
|
|
2069
2076
|
row: r,
|
|
2070
2077
|
item: e
|
|
2071
2078
|
}, () => [
|
|
2072
|
-
|
|
2079
|
+
l(j).customComponent[e.type ?? ""]?.table ? (d(), y(q(l(j).customComponent[e.type ?? ""]?.table), C({
|
|
2073
2080
|
key: 0,
|
|
2074
2081
|
modelValue: r[e.key],
|
|
2075
2082
|
"onUpdate:modelValue": (s) => r[e.key] = s,
|
|
2076
2083
|
ref_for: !0
|
|
2077
|
-
}, e.options?.[e.type ?? ""],
|
|
2078
|
-
e.options?.switch?.tableConfig?.change ? (d(),
|
|
2084
|
+
}, e.options?.[e.type ?? ""], z(e.options?.[e.type ?? ""]?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue"])) : e.type === "switch" ? (d(), b(D, { key: 1 }, [
|
|
2085
|
+
e.options?.switch?.tableConfig?.change ? (d(), y(l(Z), C({
|
|
2079
2086
|
key: 0,
|
|
2080
2087
|
modelValue: r[e.key],
|
|
2081
2088
|
"onUpdate:modelValue": (s) => r[e.key] = s,
|
|
@@ -2112,28 +2119,28 @@ const pt = /* @__PURE__ */ Y(dt, [["render", ft]]), ct = { class: "row flex-cent
|
|
|
2112
2119
|
item: {}
|
|
2113
2120
|
},
|
|
2114
2121
|
setup(i) {
|
|
2115
|
-
return (o, f) => (d(),
|
|
2122
|
+
return (o, f) => (d(), y(l(ae), {
|
|
2116
2123
|
label: o.item.item.text?.form?.label ?? o.item.item.label,
|
|
2117
2124
|
prop: o.item.item.key,
|
|
2118
2125
|
"label-width": o.item.item.text?.form?.label == "" ? 0 : o.item.item.form?.labelWidth || o.conf.option.form?.labelWidth
|
|
2119
2126
|
}, {
|
|
2120
2127
|
default: g(() => [
|
|
2121
2128
|
U("div", kt, [
|
|
2122
|
-
|
|
2129
|
+
V(o.$slots, "form-" + o.item.item.key + "-start", {
|
|
2123
2130
|
row: o.conf.update.form,
|
|
2124
2131
|
item: o.item.item
|
|
2125
2132
|
}),
|
|
2126
2133
|
U("div", vt, [
|
|
2127
2134
|
U("div", Ct, [
|
|
2128
|
-
|
|
2135
|
+
V(o.$slots, "form-" + o.item.item.key, {
|
|
2129
2136
|
row: o.conf.update.form,
|
|
2130
2137
|
item: o.item.item
|
|
2131
2138
|
}, () => [
|
|
2132
|
-
o.item.item.type === "input" ? (d(),
|
|
2139
|
+
o.item.item.type === "input" ? (d(), y(l(_), C({
|
|
2133
2140
|
key: 0,
|
|
2134
2141
|
modelValue: o.conf.update.form[o.item.item.key],
|
|
2135
2142
|
"onUpdate:modelValue": f[0] || (f[0] = (n) => o.conf.update.form[o.item.item.key] = n)
|
|
2136
|
-
}, o.conf.update.getBind(o.item.item),
|
|
2143
|
+
}, o.conf.update.getBind(o.item.item), z(o.conf.update.getOn(o.item.item)), {
|
|
2137
2144
|
disabled: o.conf.update.getDisabled(o.item.item)
|
|
2138
2145
|
}), G({ _: 2 }, [
|
|
2139
2146
|
o.item.item.options?.input?.prepend ? {
|
|
@@ -2143,78 +2150,76 @@ const pt = /* @__PURE__ */ Y(dt, [["render", ft]]), ct = { class: "row flex-cent
|
|
|
2143
2150
|
]),
|
|
2144
2151
|
key: "0"
|
|
2145
2152
|
} : void 0
|
|
2146
|
-
]), 1040, ["modelValue", "disabled"])) : o.item.item.type === "switch" ? (d(),
|
|
2153
|
+
]), 1040, ["modelValue", "disabled"])) : o.item.item.type === "switch" ? (d(), y(l(Z), C({
|
|
2147
2154
|
key: 1,
|
|
2148
2155
|
modelValue: o.conf.update.form[o.item.item.key],
|
|
2149
2156
|
"onUpdate:modelValue": f[1] || (f[1] = (n) => o.conf.update.form[o.item.item.key] = n)
|
|
2150
|
-
}, o.conf.update.getBind(o.item.item),
|
|
2157
|
+
}, o.conf.update.getBind(o.item.item), z(o.conf.update.getOn(o.item.item)), {
|
|
2151
2158
|
disabled: o.conf.update.getDisabled(o.item.item)
|
|
2152
|
-
}), null, 16, ["modelValue", "disabled"])) : o.item.item.type === "select" ? (d(),
|
|
2159
|
+
}), null, 16, ["modelValue", "disabled"])) : o.item.item.type === "select" ? (d(), y(l(X), C({
|
|
2153
2160
|
key: 2,
|
|
2154
2161
|
modelValue: o.conf.update.form[o.item.item.key],
|
|
2155
2162
|
"onUpdate:modelValue": f[2] || (f[2] = (n) => o.conf.update.form[o.item.item.key] = n)
|
|
2156
|
-
}, o.conf.update.getBind(o.item.item),
|
|
2163
|
+
}, o.conf.update.getBind(o.item.item), z(o.conf.update.getOn(o.item.item)), {
|
|
2157
2164
|
disabled: o.conf.update.getDisabled(o.item.item),
|
|
2158
2165
|
style: { width: "100%" }
|
|
2159
2166
|
}), {
|
|
2160
2167
|
default: g(() => [
|
|
2161
|
-
(d(!0), b(D, null, A(o.conf.update.getBind(o.item.item).data, (n) => (d(),
|
|
2168
|
+
(d(!0), b(D, null, A(o.conf.update.getBind(o.item.item).data, (n) => (d(), y(l(W), C({
|
|
2162
2169
|
key: n.value,
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
}, null, 8, ["label", "value"]))), 128))
|
|
2170
|
+
ref_for: !0
|
|
2171
|
+
}, n, z(n.on || {})), null, 16))), 128))
|
|
2166
2172
|
]),
|
|
2167
2173
|
_: 1
|
|
2168
|
-
}, 16, ["modelValue", "disabled"])) : o.item.item.type === "radio" ? (d(),
|
|
2174
|
+
}, 16, ["modelValue", "disabled"])) : o.item.item.type === "radio" ? (d(), y(l(ie), C({
|
|
2169
2175
|
key: 3,
|
|
2170
2176
|
modelValue: o.conf.update.form[o.item.item.key],
|
|
2171
2177
|
"onUpdate:modelValue": f[3] || (f[3] = (n) => o.conf.update.form[o.item.item.key] = n)
|
|
2172
|
-
}, o.conf.update.getBind(o.item.item),
|
|
2178
|
+
}, o.conf.update.getBind(o.item.item), z(o.conf.update.getOn(o.item.item)), {
|
|
2173
2179
|
disabled: o.conf.update.getDisabled(o.item.item),
|
|
2174
2180
|
style: { width: "100%" }
|
|
2175
2181
|
}), {
|
|
2176
2182
|
default: g(() => [
|
|
2177
|
-
(d(!0), b(D, null, A(o.conf.update.getBind(o.item.item).data, (n) => (d(),
|
|
2183
|
+
(d(!0), b(D, null, A(o.conf.update.getBind(o.item.item).data, (n) => (d(), y(l(re), C({
|
|
2178
2184
|
key: n.value,
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
}, null, 8, ["label", "value"]))), 128))
|
|
2185
|
+
ref_for: !0
|
|
2186
|
+
}, n, z(n.on || {})), null, 16))), 128))
|
|
2182
2187
|
]),
|
|
2183
2188
|
_: 1
|
|
2184
|
-
}, 16, ["modelValue", "disabled"])) : o.item.item.type === "list" ? (d(),
|
|
2189
|
+
}, 16, ["modelValue", "disabled"])) : o.item.item.type === "list" ? (d(), y(ue, C({
|
|
2185
2190
|
key: 4,
|
|
2186
2191
|
row: o.conf.update.form,
|
|
2187
2192
|
field: o.item.item.key
|
|
2188
|
-
}, o.conf.update.getBind(o.item.item),
|
|
2193
|
+
}, o.conf.update.getBind(o.item.item), z(o.conf.update.getOn(o.item.item)), {
|
|
2189
2194
|
disabled: o.conf.update.getDisabled(o.item.item),
|
|
2190
2195
|
style: { width: "100%" }
|
|
2191
|
-
}), null, 16, ["row", "field", "disabled"])) : o.item.item.type === "treeSelect" ? (d(),
|
|
2196
|
+
}), null, 16, ["row", "field", "disabled"])) : o.item.item.type === "treeSelect" ? (d(), y(l(me), C({
|
|
2192
2197
|
key: 5,
|
|
2193
2198
|
modelValue: o.conf.update.form[o.item.item.key],
|
|
2194
2199
|
"onUpdate:modelValue": f[4] || (f[4] = (n) => o.conf.update.form[o.item.item.key] = n)
|
|
2195
|
-
}, o.conf.update.getBind(o.item.item),
|
|
2200
|
+
}, o.conf.update.getBind(o.item.item), z(o.conf.update.getOn(o.item.item)), {
|
|
2196
2201
|
disabled: o.conf.update.getDisabled(o.item.item),
|
|
2197
2202
|
style: { width: "100%" }
|
|
2198
|
-
}), null, 16, ["modelValue", "disabled"])) : o.item.item.type === "datetime" ? (d(),
|
|
2203
|
+
}), null, 16, ["modelValue", "disabled"])) : o.item.item.type === "datetime" ? (d(), y(l(se), C({
|
|
2199
2204
|
key: 6,
|
|
2200
2205
|
modelValue: o.conf.update.form[o.item.item.key],
|
|
2201
2206
|
"onUpdate:modelValue": f[5] || (f[5] = (n) => o.conf.update.form[o.item.item.key] = n)
|
|
2202
|
-
}, o.conf.update.getBind(o.item.item),
|
|
2207
|
+
}, o.conf.update.getBind(o.item.item), z(o.conf.update.getOn(o.item.item)), {
|
|
2203
2208
|
disabled: o.conf.update.getDisabled(o.item.item)
|
|
2204
|
-
}), null, 16, ["modelValue", "disabled"])) : o.item.item.type && (
|
|
2209
|
+
}), null, 16, ["modelValue", "disabled"])) : o.item.item.type && (l(j).customComponent[o.item.item.type] || l(j).customComponent[o.item.item.type]?.form) ? (d(), y(q(l(j).customComponent[o.item.item.type]?.form || l(j).customComponent[o.item.item.type]), C({
|
|
2205
2210
|
key: 7,
|
|
2206
2211
|
modelValue: o.conf.update.form[o.item.item.key],
|
|
2207
2212
|
"onUpdate:modelValue": f[6] || (f[6] = (n) => o.conf.update.form[o.item.item.key] = n)
|
|
2208
|
-
}, o.conf.update.getBind(o.item.item),
|
|
2213
|
+
}, o.conf.update.getBind(o.item.item), z(o.conf.update.getOn(o.item.item)), {
|
|
2209
2214
|
disabled: o.conf.update.getDisabled(o.item.item)
|
|
2210
2215
|
}), null, 16, ["modelValue", "disabled"])) : v("", !0)
|
|
2211
2216
|
]),
|
|
2212
|
-
|
|
2217
|
+
V(o.$slots, "form-" + o.item.item.key + "-right", {
|
|
2213
2218
|
row: o.conf.update.form,
|
|
2214
2219
|
item: o.item.item
|
|
2215
2220
|
})
|
|
2216
2221
|
]),
|
|
2217
|
-
|
|
2222
|
+
V(o.$slots, "form-" + o.item.item.key + "-tip", {
|
|
2218
2223
|
row: o.conf.update.form,
|
|
2219
2224
|
item: o.item.item
|
|
2220
2225
|
}, () => [
|
|
@@ -2225,7 +2230,7 @@ const pt = /* @__PURE__ */ Y(dt, [["render", ft]]), ct = { class: "row flex-cent
|
|
|
2225
2230
|
}, null, 8, Vt)) : v("", !0)
|
|
2226
2231
|
])
|
|
2227
2232
|
]),
|
|
2228
|
-
|
|
2233
|
+
V(o.$slots, "form-" + o.item.item.key + "-end", {
|
|
2229
2234
|
row: o.conf.update.form,
|
|
2230
2235
|
item: o.item.item
|
|
2231
2236
|
})
|
|
@@ -2272,78 +2277,78 @@ const Ft = /* @__PURE__ */ Y(Ut, [["render", Mt]]), ce = /* @__PURE__ */ N({
|
|
|
2272
2277
|
o.item?.key !== void 0 && (o.conf.search.form[o.item.key] = n);
|
|
2273
2278
|
}
|
|
2274
2279
|
});
|
|
2275
|
-
return (n,
|
|
2280
|
+
return (n, a) => l(j).customComponent[n.type ?? ""]?.search ? (d(), y(q(l(j).customComponent[n.type ?? ""]?.search), C({
|
|
2276
2281
|
key: 0,
|
|
2277
2282
|
modelValue: f.value,
|
|
2278
|
-
"onUpdate:modelValue":
|
|
2279
|
-
}, n.item.options?.search?.[n.type ?? ""],
|
|
2283
|
+
"onUpdate:modelValue": a[0] || (a[0] = (t) => f.value = t)
|
|
2284
|
+
}, n.item.options?.search?.[n.type ?? ""], z(n.item.options?.search?.[n.type ?? ""]?.on || {})), null, 16, ["modelValue"])) : n.type === "input" ? (d(), y(l(_), C({
|
|
2280
2285
|
key: 1,
|
|
2281
2286
|
modelValue: f.value,
|
|
2282
|
-
"onUpdate:modelValue":
|
|
2287
|
+
"onUpdate:modelValue": a[1] || (a[1] = (t) => f.value = t),
|
|
2283
2288
|
placeholder: n.conf.search.getPlaceholder(n.item),
|
|
2284
2289
|
clearable: "",
|
|
2285
2290
|
disabled: n.item.disabled?.search
|
|
2286
|
-
}, n.item.options?.search?.input || n.item.options?.input,
|
|
2291
|
+
}, n.item.options?.search?.input || n.item.options?.input, z(n.item.options?.search?.input?.on || n.item.options?.input?.on || {})), null, 16, ["modelValue", "placeholder", "disabled"])) : n.type === "switch" ? (d(), y(l(X), C({
|
|
2287
2292
|
key: 2,
|
|
2288
2293
|
modelValue: f.value,
|
|
2289
|
-
"onUpdate:modelValue":
|
|
2290
|
-
placeholder: n.conf.search.getPlaceholder(n.item,
|
|
2294
|
+
"onUpdate:modelValue": a[2] || (a[2] = (t) => f.value = t),
|
|
2295
|
+
placeholder: n.conf.search.getPlaceholder(n.item, l(w).tCurd("placeholderSelect")),
|
|
2291
2296
|
clearable: "",
|
|
2292
2297
|
disabled: n.item.disabled?.search
|
|
2293
|
-
}, n.item.options?.search?.switch || n.item.options?.switch,
|
|
2298
|
+
}, n.item.options?.search?.switch || n.item.options?.switch, z(n.item.options?.search?.switch?.on || n.item.options?.switch?.on || {})), {
|
|
2294
2299
|
default: g(() => [
|
|
2295
|
-
(d(),
|
|
2300
|
+
(d(), y(l(W), {
|
|
2296
2301
|
key: n.item.options?.switch?.activeValue,
|
|
2297
2302
|
label: n.item.options?.switch?.activeText,
|
|
2298
2303
|
value: n.item.options?.switch?.activeValue
|
|
2299
2304
|
}, null, 8, ["label", "value"])),
|
|
2300
|
-
(d(),
|
|
2305
|
+
(d(), y(l(W), {
|
|
2301
2306
|
key: n.item.options?.switch?.inactiveValue,
|
|
2302
2307
|
label: n.item.options?.switch?.inactiveText,
|
|
2303
2308
|
value: n.item.options?.switch?.inactiveValue
|
|
2304
2309
|
}, null, 8, ["label", "value"]))
|
|
2305
2310
|
]),
|
|
2306
2311
|
_: 1
|
|
2307
|
-
}, 16, ["modelValue", "placeholder", "disabled"])) : n.type === "select" ? (d(),
|
|
2312
|
+
}, 16, ["modelValue", "placeholder", "disabled"])) : n.type === "select" ? (d(), y(l(X), C({
|
|
2308
2313
|
key: 3,
|
|
2309
2314
|
modelValue: f.value,
|
|
2310
|
-
"onUpdate:modelValue":
|
|
2311
|
-
placeholder: n.conf.search.getPlaceholder(n.item,
|
|
2315
|
+
"onUpdate:modelValue": a[3] || (a[3] = (t) => f.value = t),
|
|
2316
|
+
placeholder: n.conf.search.getPlaceholder(n.item, l(w).tCurd("placeholderSelect")),
|
|
2312
2317
|
clearable: "",
|
|
2313
2318
|
disabled: n.item.disabled?.search
|
|
2314
|
-
}, n.item.options?.search?.select || n.item.options?.select,
|
|
2319
|
+
}, n.item.options?.search?.select || n.item.options?.select, z(n.item.options?.search?.select?.on || n.item.options?.select?.on || {})), {
|
|
2315
2320
|
default: g(() => [
|
|
2316
|
-
(d(!0), b(D, null, A(n.item.options?.search?.select?.data || n.item.options?.select?.data || [], (t) => (d(),
|
|
2321
|
+
(d(!0), b(D, null, A(n.item.options?.search?.select?.data || n.item.options?.select?.data || [], (t) => (d(), y(l(W), {
|
|
2317
2322
|
key: t.value,
|
|
2318
2323
|
label: t.label,
|
|
2319
2324
|
value: t.value
|
|
2320
2325
|
}, null, 8, ["label", "value"]))), 128))
|
|
2321
2326
|
]),
|
|
2322
2327
|
_: 1
|
|
2323
|
-
}, 16, ["modelValue", "placeholder", "disabled"])) : n.type === "radio" ? (d(),
|
|
2328
|
+
}, 16, ["modelValue", "placeholder", "disabled"])) : n.type === "radio" ? (d(), y(l(ie), C({
|
|
2324
2329
|
key: 4,
|
|
2325
2330
|
modelValue: f.value,
|
|
2326
|
-
"onUpdate:modelValue":
|
|
2331
|
+
"onUpdate:modelValue": a[4] || (a[4] = (t) => f.value = t),
|
|
2327
2332
|
disabled: n.item.disabled?.search
|
|
2328
|
-
}, n.item.options?.search?.radio || n.item.options?.radio,
|
|
2333
|
+
}, n.item.options?.search?.radio || n.item.options?.radio, z(n.item.options?.search?.radio?.on || n.item.options?.radio?.on || {})), {
|
|
2329
2334
|
default: g(() => [
|
|
2330
|
-
(d(!0), b(D, null, A(n.item.options?.radio?.data, (t) => (d(),
|
|
2335
|
+
(d(!0), b(D, null, A(n.item.options?.radio?.data, (t) => (d(), y(l(re), {
|
|
2331
2336
|
key: t.value,
|
|
2332
2337
|
label: t.label,
|
|
2333
2338
|
value: t.value
|
|
2334
2339
|
}, null, 8, ["label", "value"]))), 128))
|
|
2335
2340
|
]),
|
|
2336
2341
|
_: 1
|
|
2337
|
-
}, 16, ["modelValue", "disabled"])) : n.type === "datetime" ? (d(),
|
|
2342
|
+
}, 16, ["modelValue", "disabled"])) : n.type === "datetime" ? (d(), y(l(se), C({
|
|
2338
2343
|
key: 5,
|
|
2339
2344
|
modelValue: f.value,
|
|
2340
|
-
"onUpdate:modelValue":
|
|
2345
|
+
"onUpdate:modelValue": a[5] || (a[5] = (t) => f.value = t),
|
|
2341
2346
|
disabled: n.item.disabled?.search
|
|
2342
|
-
}, n.item.options?.search?.datetime || n.item.options?.datetime,
|
|
2347
|
+
}, n.item.options?.search?.datetime || n.item.options?.datetime, z(n.item.options?.search?.datetime?.on || n.item.options?.datetime?.on || {})), null, 16, ["modelValue", "disabled"])) : n.type && l(j).customComponent[n.type] ? (d(), y(q(l(j).customComponent[n.type]), C({
|
|
2343
2348
|
key: 6,
|
|
2344
2349
|
modelValue: f.value,
|
|
2345
|
-
"onUpdate:modelValue":
|
|
2346
|
-
}, n.item.options?.search?.[n.type] || n.item.options?.[n.type],
|
|
2350
|
+
"onUpdate:modelValue": a[6] || (a[6] = (t) => f.value = t)
|
|
2351
|
+
}, n.item.options?.search?.[n.type] || n.item.options?.[n.type], z(n.item.options?.search?.[n.type]?.on || n.item.options?.[n.type]?.on || {}), {
|
|
2347
2352
|
disabled: n.item.disabled?.search
|
|
2348
2353
|
}), null, 16, ["modelValue", "disabled"])) : v("", !0);
|
|
2349
2354
|
}
|
|
@@ -2382,10 +2387,10 @@ const Ft = /* @__PURE__ */ Y(Ut, [["render", Mt]]), ce = /* @__PURE__ */ N({
|
|
|
2382
2387
|
}
|
|
2383
2388
|
},
|
|
2384
2389
|
setup(i, { expose: o }) {
|
|
2385
|
-
const f = M.EDialog, n = i,
|
|
2390
|
+
const f = M.EDialog, n = i, a = M.isFun, { conf: t, switchConfirmRef: e, ruleFormRef: r, tableRef: s } = qe(n);
|
|
2386
2391
|
return o({
|
|
2387
2392
|
conf: t
|
|
2388
|
-
}), (m,
|
|
2393
|
+
}), (m, p) => {
|
|
2389
2394
|
const u = ee("el-tooltip"), k = Me("loading");
|
|
2390
2395
|
return d(), b("div", {
|
|
2391
2396
|
class: I(["relative cc1-form-box", [i.option.table?.fitHeight ? "col" : "no-min-height"]])
|
|
@@ -2394,88 +2399,88 @@ const Ft = /* @__PURE__ */ Y(Ut, [["render", Mt]]), ce = /* @__PURE__ */ N({
|
|
|
2394
2399
|
class: I(["row", [i.option.table?.fitHeight ? "absolute fit" : ""]]),
|
|
2395
2400
|
style: { overflow: "hidden" }
|
|
2396
2401
|
}, [
|
|
2397
|
-
|
|
2402
|
+
V(m.$slots, "box-left"),
|
|
2398
2403
|
U("div", {
|
|
2399
2404
|
class: I(["column fit-width no-wrap", [i.option.table?.fitHeight ? "col" : ""]])
|
|
2400
2405
|
}, [
|
|
2401
2406
|
i.option.search?.show !== !1 ? (d(), b("div", At, [
|
|
2402
|
-
O(
|
|
2403
|
-
model:
|
|
2407
|
+
O(l(Q), {
|
|
2408
|
+
model: l(t).search.form,
|
|
2404
2409
|
inline: "",
|
|
2405
2410
|
size: i.option.size?.search
|
|
2406
2411
|
}, {
|
|
2407
2412
|
default: g(() => [
|
|
2408
|
-
|
|
2409
|
-
row:
|
|
2413
|
+
V(m.$slots, "search-start", {
|
|
2414
|
+
row: l(t).search.form
|
|
2410
2415
|
}),
|
|
2411
|
-
(d(!0), b(D, null, A(
|
|
2412
|
-
key:
|
|
2416
|
+
(d(!0), b(D, null, A(l(t).search.column.list, (h) => (d(), b(D, {
|
|
2417
|
+
key: h.key
|
|
2413
2418
|
}, [
|
|
2414
|
-
|
|
2415
|
-
row:
|
|
2419
|
+
V(m.$slots, "search-" + h.key + "-start", {
|
|
2420
|
+
row: l(t).search.form
|
|
2416
2421
|
}),
|
|
2417
|
-
(typeof
|
|
2422
|
+
(typeof h.show?.search == "function" ? h.show?.search(l(t).search.form) : h.show?.search) ? (d(), y(l(ae), {
|
|
2418
2423
|
key: 0,
|
|
2419
|
-
label:
|
|
2424
|
+
label: h.text?.search?.label ?? h.label
|
|
2420
2425
|
}, {
|
|
2421
2426
|
default: g(() => [
|
|
2422
|
-
|
|
2423
|
-
row:
|
|
2427
|
+
V(m.$slots, "search-" + h.key + "-left", {
|
|
2428
|
+
row: l(t).search.form
|
|
2424
2429
|
}),
|
|
2425
|
-
|
|
2426
|
-
row:
|
|
2430
|
+
V(m.$slots, "search-" + h.key, {
|
|
2431
|
+
row: l(t).search.form
|
|
2427
2432
|
}, () => [
|
|
2428
|
-
|
|
2433
|
+
h.options?.search?.type ? (d(), y(ce, {
|
|
2429
2434
|
key: 0,
|
|
2430
|
-
item:
|
|
2431
|
-
conf:
|
|
2432
|
-
type:
|
|
2433
|
-
}, null, 8, ["item", "conf", "type"])) : (d(),
|
|
2435
|
+
item: h,
|
|
2436
|
+
conf: l(t),
|
|
2437
|
+
type: h.options.search.type
|
|
2438
|
+
}, null, 8, ["item", "conf", "type"])) : (d(), y(ce, {
|
|
2434
2439
|
key: 1,
|
|
2435
|
-
item:
|
|
2436
|
-
conf:
|
|
2437
|
-
type:
|
|
2440
|
+
item: h,
|
|
2441
|
+
conf: l(t),
|
|
2442
|
+
type: h.type
|
|
2438
2443
|
}, null, 8, ["item", "conf", "type"]))
|
|
2439
2444
|
]),
|
|
2440
|
-
|
|
2441
|
-
row:
|
|
2445
|
+
V(m.$slots, "search-" + h.key + "-right", {
|
|
2446
|
+
row: l(t).search.form
|
|
2442
2447
|
})
|
|
2443
2448
|
]),
|
|
2444
2449
|
_: 2
|
|
2445
2450
|
}, 1032, ["label"])) : v("", !0),
|
|
2446
|
-
|
|
2447
|
-
row:
|
|
2451
|
+
V(m.$slots, "search-" + h.key + "-end", {
|
|
2452
|
+
row: l(t).search.form
|
|
2448
2453
|
})
|
|
2449
2454
|
], 64))), 128)),
|
|
2450
|
-
|
|
2451
|
-
row:
|
|
2455
|
+
V(m.$slots, "search-center", {
|
|
2456
|
+
row: l(t).search.form
|
|
2452
2457
|
}),
|
|
2453
|
-
i.option.tools?.search || i.option.tools?.reset ? (d(),
|
|
2458
|
+
i.option.tools?.search || i.option.tools?.reset ? (d(), y(l(ae), { key: 0 }, {
|
|
2454
2459
|
default: g(() => [
|
|
2455
|
-
i.option.tools?.search ? (d(),
|
|
2460
|
+
i.option.tools?.search ? (d(), y(l(T), {
|
|
2456
2461
|
key: 0,
|
|
2457
2462
|
type: "primary",
|
|
2458
|
-
onClick:
|
|
2463
|
+
onClick: l(t).search.submit
|
|
2459
2464
|
}, {
|
|
2460
2465
|
default: g(() => [
|
|
2461
|
-
E(S(
|
|
2466
|
+
E(S(l(w).tCurd("search")), 1)
|
|
2462
2467
|
]),
|
|
2463
2468
|
_: 1
|
|
2464
2469
|
}, 8, ["onClick"])) : v("", !0),
|
|
2465
|
-
i.option.tools?.reset ? (d(),
|
|
2470
|
+
i.option.tools?.reset ? (d(), y(l(T), {
|
|
2466
2471
|
key: 1,
|
|
2467
|
-
onClick:
|
|
2472
|
+
onClick: l(t).search.reset
|
|
2468
2473
|
}, {
|
|
2469
2474
|
default: g(() => [
|
|
2470
|
-
E(S(
|
|
2475
|
+
E(S(l(w).tCurd("reset")), 1)
|
|
2471
2476
|
]),
|
|
2472
2477
|
_: 1
|
|
2473
2478
|
}, 8, ["onClick"])) : v("", !0)
|
|
2474
2479
|
]),
|
|
2475
2480
|
_: 1
|
|
2476
2481
|
})) : v("", !0),
|
|
2477
|
-
|
|
2478
|
-
row:
|
|
2482
|
+
V(m.$slots, "search-end", {
|
|
2483
|
+
row: l(t).search.form
|
|
2479
2484
|
})
|
|
2480
2485
|
]),
|
|
2481
2486
|
_: 3
|
|
@@ -2483,76 +2488,76 @@ const Ft = /* @__PURE__ */ Y(Ut, [["render", Mt]]), ce = /* @__PURE__ */ N({
|
|
|
2483
2488
|
])) : v("", !0),
|
|
2484
2489
|
U("div", Tt, [
|
|
2485
2490
|
U("div", jt, [
|
|
2486
|
-
a
|
|
2487
|
-
O(
|
|
2491
|
+
l(a)(i.option.tools?.add) ? (d(), b("div", Lt, [
|
|
2492
|
+
O(l(T), {
|
|
2488
2493
|
type: "primary",
|
|
2489
|
-
onClick:
|
|
2494
|
+
onClick: p[0] || (p[0] = (h) => l(t).update.open(l(f).Add)),
|
|
2490
2495
|
size: i.option.size?.search
|
|
2491
2496
|
}, {
|
|
2492
2497
|
default: g(() => [
|
|
2493
|
-
E(S(
|
|
2498
|
+
E(S(l(w).tCurd("add")), 1)
|
|
2494
2499
|
]),
|
|
2495
2500
|
_: 1
|
|
2496
2501
|
}, 8, ["size"])
|
|
2497
2502
|
])) : v("", !0),
|
|
2498
|
-
i.option.table?.selectable && a
|
|
2499
|
-
O(
|
|
2503
|
+
i.option.table?.selectable && l(a)(i.option.tools?.delete) ? (d(), b("div", Bt, [
|
|
2504
|
+
O(l(T), {
|
|
2500
2505
|
type: "danger",
|
|
2501
|
-
onClick:
|
|
2506
|
+
onClick: p[1] || (p[1] = (h) => l(t).remove.open(l(t).table.selection.list)),
|
|
2502
2507
|
size: i.option.size?.search
|
|
2503
2508
|
}, {
|
|
2504
2509
|
default: g(() => [
|
|
2505
|
-
E(S(
|
|
2510
|
+
E(S(l(w).tCurd("delete")), 1)
|
|
2506
2511
|
]),
|
|
2507
2512
|
_: 1
|
|
2508
2513
|
}, 8, ["size"])
|
|
2509
2514
|
])) : v("", !0),
|
|
2510
2515
|
i.option.tools?.expand ? (d(), b("div", Rt, [
|
|
2511
|
-
O(
|
|
2516
|
+
O(l(T), {
|
|
2512
2517
|
type: "warning",
|
|
2513
|
-
onClick:
|
|
2518
|
+
onClick: p[2] || (p[2] = (h) => l(t).table.expand.all()),
|
|
2514
2519
|
size: i.option.size?.search
|
|
2515
2520
|
}, {
|
|
2516
2521
|
default: g(() => [
|
|
2517
|
-
E(S(
|
|
2522
|
+
E(S(l(w).tCurd("expandCollapse")), 1)
|
|
2518
2523
|
]),
|
|
2519
2524
|
_: 1
|
|
2520
2525
|
}, 8, ["size"])
|
|
2521
2526
|
])) : v("", !0),
|
|
2522
2527
|
i.option.tools?.export?.show ? (d(), b(D, { key: 3 }, [
|
|
2523
|
-
i.option.tools?.export?.dropdown?.show ? (d(),
|
|
2528
|
+
i.option.tools?.export?.dropdown?.show ? (d(), y(l($e), {
|
|
2524
2529
|
key: 0,
|
|
2525
|
-
onCommand:
|
|
2530
|
+
onCommand: l(t).export.click
|
|
2526
2531
|
}, {
|
|
2527
2532
|
dropdown: g(() => [
|
|
2528
|
-
O(
|
|
2533
|
+
O(l(De), {
|
|
2529
2534
|
size: i.option.size?.search
|
|
2530
2535
|
}, {
|
|
2531
2536
|
default: g(() => [
|
|
2532
|
-
i.option.tools?.export?.dropdown?.select && (i.option.table?.selectable || a
|
|
2537
|
+
i.option.tools?.export?.dropdown?.select && (i.option.table?.selectable || l(a)(i.option.tools?.delete)) ? (d(), y(l(le), {
|
|
2533
2538
|
key: 0,
|
|
2534
2539
|
command: "select"
|
|
2535
2540
|
}, {
|
|
2536
2541
|
default: g(() => [
|
|
2537
|
-
E(S(
|
|
2542
|
+
E(S(l(w).tCurd("exportSelect")), 1)
|
|
2538
2543
|
]),
|
|
2539
2544
|
_: 1
|
|
2540
2545
|
})) : v("", !0),
|
|
2541
|
-
i.option.tools?.export?.dropdown?.page ? (d(),
|
|
2546
|
+
i.option.tools?.export?.dropdown?.page ? (d(), y(l(le), {
|
|
2542
2547
|
key: 1,
|
|
2543
2548
|
command: "page"
|
|
2544
2549
|
}, {
|
|
2545
2550
|
default: g(() => [
|
|
2546
|
-
E(S(
|
|
2551
|
+
E(S(l(w).tCurd("exportPage")), 1)
|
|
2547
2552
|
]),
|
|
2548
2553
|
_: 1
|
|
2549
2554
|
})) : v("", !0),
|
|
2550
|
-
i.option.tools?.export?.dropdown?.all ? (d(),
|
|
2555
|
+
i.option.tools?.export?.dropdown?.all ? (d(), y(l(le), {
|
|
2551
2556
|
key: 2,
|
|
2552
2557
|
command: "all"
|
|
2553
2558
|
}, {
|
|
2554
2559
|
default: g(() => [
|
|
2555
|
-
E(S(
|
|
2560
|
+
E(S(l(w).tCurd("exportAll")), 1)
|
|
2556
2561
|
]),
|
|
2557
2562
|
_: 1
|
|
2558
2563
|
})) : v("", !0)
|
|
@@ -2562,13 +2567,13 @@ const Ft = /* @__PURE__ */ Y(Ut, [["render", Mt]]), ce = /* @__PURE__ */ N({
|
|
|
2562
2567
|
]),
|
|
2563
2568
|
default: g(() => [
|
|
2564
2569
|
U("div", It, [
|
|
2565
|
-
O(
|
|
2570
|
+
O(l(T), {
|
|
2566
2571
|
type: "warning",
|
|
2567
|
-
loading:
|
|
2572
|
+
loading: l(t).export.loading,
|
|
2568
2573
|
size: i.option.size?.search
|
|
2569
2574
|
}, {
|
|
2570
2575
|
default: g(() => [
|
|
2571
|
-
E(S(
|
|
2576
|
+
E(S(l(w).tCurd("export")), 1)
|
|
2572
2577
|
]),
|
|
2573
2578
|
_: 1
|
|
2574
2579
|
}, 8, ["loading", "size"])
|
|
@@ -2576,51 +2581,51 @@ const Ft = /* @__PURE__ */ Y(Ut, [["render", Mt]]), ce = /* @__PURE__ */ N({
|
|
|
2576
2581
|
]),
|
|
2577
2582
|
_: 1
|
|
2578
2583
|
}, 8, ["onCommand"])) : (d(), b("div", Ht, [
|
|
2579
|
-
O(
|
|
2584
|
+
O(l(T), {
|
|
2580
2585
|
type: "warning",
|
|
2581
|
-
loading:
|
|
2586
|
+
loading: l(t).export.loading,
|
|
2582
2587
|
size: i.option.size?.search,
|
|
2583
|
-
onClick:
|
|
2588
|
+
onClick: p[3] || (p[3] = (h) => l(t).export.run.start("all"))
|
|
2584
2589
|
}, {
|
|
2585
2590
|
default: g(() => [
|
|
2586
|
-
E(S(
|
|
2591
|
+
E(S(l(w).tCurd("export")), 1)
|
|
2587
2592
|
]),
|
|
2588
2593
|
_: 1
|
|
2589
2594
|
}, 8, ["loading", "size"])
|
|
2590
2595
|
]))
|
|
2591
2596
|
], 64)) : v("", !0),
|
|
2592
|
-
|
|
2597
|
+
V(m.$slots, "tools-left")
|
|
2593
2598
|
]),
|
|
2594
2599
|
U("div", Kt, [
|
|
2595
|
-
|
|
2596
|
-
|
|
2600
|
+
V(m.$slots, "tools-right"),
|
|
2601
|
+
l(t).page.showTools ? (d(), y(l(fe), C({
|
|
2597
2602
|
key: 0,
|
|
2598
|
-
"current-page":
|
|
2599
|
-
"onUpdate:currentPage":
|
|
2600
|
-
"page-size":
|
|
2601
|
-
"onUpdate:pageSize":
|
|
2603
|
+
"current-page": l(t).page.num,
|
|
2604
|
+
"onUpdate:currentPage": p[4] || (p[4] = (h) => l(t).page.num = h),
|
|
2605
|
+
"page-size": l(t).page.size,
|
|
2606
|
+
"onUpdate:pageSize": p[5] || (p[5] = (h) => l(t).page.size = h),
|
|
2602
2607
|
background: "",
|
|
2603
|
-
"page-sizes":
|
|
2604
|
-
"pager-count":
|
|
2605
|
-
layout:
|
|
2606
|
-
total:
|
|
2608
|
+
"page-sizes": l(t).page.sizeList,
|
|
2609
|
+
"pager-count": l(t).page.pagerCount,
|
|
2610
|
+
layout: l(t).page.layout,
|
|
2611
|
+
total: l(t).page.total,
|
|
2607
2612
|
size: i.option.size?.table,
|
|
2608
|
-
onSizeChange:
|
|
2609
|
-
onCurrentChange:
|
|
2610
|
-
}, i.option.page?.pagination || {},
|
|
2611
|
-
i.option.tools?.expandColumn === void 0 || i.option.tools?.expandColumn ? (d(),
|
|
2613
|
+
onSizeChange: l(t).table.getList,
|
|
2614
|
+
onCurrentChange: l(t).table.getList
|
|
2615
|
+
}, i.option.page?.pagination || {}, z(i.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : v("", !0),
|
|
2616
|
+
i.option.tools?.expandColumn === void 0 || i.option.tools?.expandColumn ? (d(), y(u, {
|
|
2612
2617
|
key: 1,
|
|
2613
2618
|
effect: "dark",
|
|
2614
|
-
content:
|
|
2619
|
+
content: l(t).table.header.group.expand ? l(w).tCurd("mergeColumn") : l(w).tCurd("expandColumn"),
|
|
2615
2620
|
placement: "top"
|
|
2616
2621
|
}, {
|
|
2617
2622
|
default: g(() => [
|
|
2618
2623
|
U("div", {
|
|
2619
2624
|
class: I(["refresh-btn", [i.option.size?.search]]),
|
|
2620
|
-
onClick:
|
|
2621
|
-
(...
|
|
2625
|
+
onClick: p[6] || (p[6] = //@ts-ignore
|
|
2626
|
+
(...h) => l(t).table.header.group.toggleExpandAll && l(t).table.header.group.toggleExpandAll(...h))
|
|
2622
2627
|
}, [
|
|
2623
|
-
|
|
2628
|
+
l(t).table.header.group.expand ? (d(), y(Ot, { key: 0 })) : (d(), y(Ft, { key: 1 }))
|
|
2624
2629
|
], 2)
|
|
2625
2630
|
]),
|
|
2626
2631
|
_: 1
|
|
@@ -2628,8 +2633,8 @@ const Ft = /* @__PURE__ */ Y(Ut, [["render", Mt]]), ce = /* @__PURE__ */ N({
|
|
|
2628
2633
|
i.option.tools?.refresh === void 0 || i.option.tools?.refresh ? (d(), b("div", {
|
|
2629
2634
|
key: 2,
|
|
2630
2635
|
class: I(["refresh-btn", [i.option.size?.search]]),
|
|
2631
|
-
onClick:
|
|
2632
|
-
(...
|
|
2636
|
+
onClick: p[7] || (p[7] = //@ts-ignore
|
|
2637
|
+
(...h) => l(t).table.getList && l(t).table.getList(...h))
|
|
2633
2638
|
}, [
|
|
2634
2639
|
O(xe)
|
|
2635
2640
|
], 2)) : v("", !0)
|
|
@@ -2641,18 +2646,18 @@ const Ft = /* @__PURE__ */ Y(Ut, [["render", Mt]]), ce = /* @__PURE__ */ N({
|
|
|
2641
2646
|
U("div", {
|
|
2642
2647
|
class: I(["column form-box-content", [i.option.table?.fitHeight ? "absolute fit" : ""]])
|
|
2643
2648
|
}, [
|
|
2644
|
-
Fe((d(),
|
|
2649
|
+
Fe((d(), y(l(Ee), C({
|
|
2645
2650
|
ref_key: "tableRef",
|
|
2646
2651
|
ref: s,
|
|
2647
|
-
data:
|
|
2652
|
+
data: l(t).table.data,
|
|
2648
2653
|
border: i.option.table?.border === void 0 ? !0 : i.option.table?.border,
|
|
2649
|
-
onSelectionChange:
|
|
2650
|
-
onSortChange:
|
|
2651
|
-
"expand-row-keys":
|
|
2652
|
-
onExpandChange:
|
|
2653
|
-
}, i.option.table,
|
|
2654
|
+
onSelectionChange: l(t).table.selection.change,
|
|
2655
|
+
onSortChange: l(t).table.sort.change,
|
|
2656
|
+
"expand-row-keys": l(t).table.expand.rowKeys,
|
|
2657
|
+
onExpandChange: l(t).table.expand.change
|
|
2658
|
+
}, i.option.table, z(i.option.table?.on || {})), {
|
|
2654
2659
|
default: g(() => [
|
|
2655
|
-
(typeof i.option.table?.selectable == "object" ? i.option.table?.selectable?.show : i.option.table?.selectable) || a
|
|
2660
|
+
(typeof i.option.table?.selectable == "object" ? i.option.table?.selectable?.show : i.option.table?.selectable) || l(a)(i.option.tools?.delete) || i.option.tools?.export?.show && i.option.tools?.export?.select ? (d(), y(l(oe), C({
|
|
2656
2661
|
key: 0,
|
|
2657
2662
|
type: "selection",
|
|
2658
2663
|
width: "40",
|
|
@@ -2660,8 +2665,8 @@ const Ft = /* @__PURE__ */ Y(Ut, [["render", Mt]]), ce = /* @__PURE__ */ N({
|
|
|
2660
2665
|
fixed: "left",
|
|
2661
2666
|
"show-overflow-tooltip": !1,
|
|
2662
2667
|
className: "cc1-form-selectable-column"
|
|
2663
|
-
}, typeof i.option.table?.selectable == "object" ? i.option.table?.selectable : {},
|
|
2664
|
-
(typeof i.option.table?.index == "object" ? i.option.table?.index?.show : i.option.table?.index) ? (d(),
|
|
2668
|
+
}, typeof i.option.table?.selectable == "object" ? i.option.table?.selectable : {}, z(typeof i.option.table?.selectable == "object" ? i.option.table?.selectable?.on || {} : {})), null, 16)) : v("", !0),
|
|
2669
|
+
(typeof i.option.table?.index == "object" ? i.option.table?.index?.show : i.option.table?.index) ? (d(), y(l(oe), C({
|
|
2665
2670
|
key: 1,
|
|
2666
2671
|
type: "index",
|
|
2667
2672
|
fixed: "left",
|
|
@@ -2670,20 +2675,20 @@ const Ft = /* @__PURE__ */ Y(Ut, [["render", Mt]]), ce = /* @__PURE__ */ N({
|
|
|
2670
2675
|
label: "#",
|
|
2671
2676
|
"show-overflow-tooltip": !1,
|
|
2672
2677
|
className: "cc1-form-index-column"
|
|
2673
|
-
}, typeof i.option.table?.index == "object" ? i.option.table?.index : {},
|
|
2678
|
+
}, typeof i.option.table?.index == "object" ? i.option.table?.index : {}, z(typeof i.option.table?.index == "object" ? i.option.table?.index?.on || {} : {})), null, 16)) : v("", !0),
|
|
2674
2679
|
O(wt, {
|
|
2675
|
-
conf:
|
|
2676
|
-
columnList:
|
|
2680
|
+
conf: l(t),
|
|
2681
|
+
columnList: l(t).table.column.list,
|
|
2677
2682
|
option: i.option
|
|
2678
2683
|
}, G({ _: 2 }, [
|
|
2679
|
-
A(m.$slots, (
|
|
2680
|
-
name:
|
|
2681
|
-
fn: g((
|
|
2682
|
-
|
|
2684
|
+
A(m.$slots, (h, c) => ({
|
|
2685
|
+
name: c,
|
|
2686
|
+
fn: g(($) => [
|
|
2687
|
+
V(m.$slots, c, Ae(Te($ || {})))
|
|
2683
2688
|
])
|
|
2684
2689
|
}))
|
|
2685
2690
|
]), 1032, ["conf", "columnList", "option"]),
|
|
2686
|
-
a
|
|
2691
|
+
l(a)(i.option.table?.add) || l(a)(i.option.table?.update) || l(a)(i.option.table?.delete) || l(a)(i.option.table?.view) || m.$slots["table-op-left"] || m.$slots["table-op-right"] ? (d(), y(l(oe), C({
|
|
2687
2692
|
key: 2,
|
|
2688
2693
|
width: "auto",
|
|
2689
2694
|
"max-width": "200",
|
|
@@ -2691,85 +2696,85 @@ const Ft = /* @__PURE__ */ Y(Ut, [["render", Mt]]), ce = /* @__PURE__ */ N({
|
|
|
2691
2696
|
fixed: "right"
|
|
2692
2697
|
}, i.option.table?.operate, { "show-overflow-tooltip": !1 }), {
|
|
2693
2698
|
header: g(() => [
|
|
2694
|
-
|
|
2695
|
-
E(S(
|
|
2699
|
+
V(m.$slots, "table-header-op", {}, () => [
|
|
2700
|
+
E(S(l(w).tCurd("operation")), 1)
|
|
2696
2701
|
])
|
|
2697
2702
|
]),
|
|
2698
|
-
default: g(({ row:
|
|
2699
|
-
O(
|
|
2703
|
+
default: g(({ row: h }) => [
|
|
2704
|
+
O(l(Q), {
|
|
2700
2705
|
size: i.option.size?.table
|
|
2701
2706
|
}, {
|
|
2702
2707
|
default: g(() => [
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
O(
|
|
2708
|
+
V(m.$slots, "table-op-left", { row: h }),
|
|
2709
|
+
l(t).update.type === l(f).Update && i.option.table?.inlineEdit && l(t).update.form[n.option.table?.rowKey] === h[n.option.table?.rowKey] ? (d(), b(D, { key: 0 }, [
|
|
2710
|
+
O(l(T), {
|
|
2706
2711
|
link: "",
|
|
2707
2712
|
type: "info",
|
|
2708
|
-
onClick:
|
|
2713
|
+
onClick: l(t).update.close
|
|
2709
2714
|
}, {
|
|
2710
2715
|
default: g(() => [
|
|
2711
|
-
E(S(
|
|
2716
|
+
E(S(l(w).tCurd("cancel")), 1)
|
|
2712
2717
|
]),
|
|
2713
2718
|
_: 1
|
|
2714
2719
|
}, 8, ["onClick"]),
|
|
2715
|
-
O(
|
|
2720
|
+
O(l(T), {
|
|
2716
2721
|
link: "",
|
|
2717
2722
|
type: "primary",
|
|
2718
|
-
onClick:
|
|
2719
|
-
loading:
|
|
2723
|
+
onClick: l(t).update.submit,
|
|
2724
|
+
loading: l(t).update.loading
|
|
2720
2725
|
}, {
|
|
2721
2726
|
default: g(() => [
|
|
2722
|
-
E(S(
|
|
2727
|
+
E(S(l(w).tCurd("confirm")), 1)
|
|
2723
2728
|
]),
|
|
2724
2729
|
_: 1
|
|
2725
2730
|
}, 8, ["onClick", "loading"]),
|
|
2726
|
-
|
|
2731
|
+
V(m.$slots, "table-op-edit-right", { row: h })
|
|
2727
2732
|
], 64)) : (d(), b(D, { key: 1 }, [
|
|
2728
|
-
a
|
|
2733
|
+
l(a)(i.option.table?.add, h) ? (d(), y(l(T), {
|
|
2729
2734
|
key: 0,
|
|
2730
2735
|
link: "",
|
|
2731
2736
|
type: "primary",
|
|
2732
|
-
onClick: (
|
|
2737
|
+
onClick: (c) => l(t).update.open(l(f).Add, h)
|
|
2733
2738
|
}, {
|
|
2734
2739
|
default: g(() => [
|
|
2735
|
-
E(S(
|
|
2740
|
+
E(S(l(w).tCurd("add")), 1)
|
|
2736
2741
|
]),
|
|
2737
2742
|
_: 2
|
|
2738
2743
|
}, 1032, ["onClick"])) : v("", !0),
|
|
2739
|
-
a
|
|
2744
|
+
l(a)(i.option.table?.view, h) ? (d(), y(l(T), {
|
|
2740
2745
|
key: 1,
|
|
2741
2746
|
link: "",
|
|
2742
2747
|
type: "primary",
|
|
2743
|
-
onClick: (
|
|
2748
|
+
onClick: (c) => l(t).update.open(l(f).View, h)
|
|
2744
2749
|
}, {
|
|
2745
2750
|
default: g(() => [
|
|
2746
|
-
E(S(
|
|
2751
|
+
E(S(l(w).tCurd("view")), 1)
|
|
2747
2752
|
]),
|
|
2748
2753
|
_: 2
|
|
2749
2754
|
}, 1032, ["onClick"])) : v("", !0),
|
|
2750
|
-
a
|
|
2755
|
+
l(a)(i.option.table?.update, h) ? (d(), y(l(T), {
|
|
2751
2756
|
key: 2,
|
|
2752
2757
|
link: "",
|
|
2753
2758
|
type: "warning",
|
|
2754
|
-
onClick: (
|
|
2759
|
+
onClick: (c) => l(t).update.open(l(f).Update, h)
|
|
2755
2760
|
}, {
|
|
2756
2761
|
default: g(() => [
|
|
2757
|
-
E(S(
|
|
2762
|
+
E(S(l(w).tCurd("edit")), 1)
|
|
2758
2763
|
]),
|
|
2759
2764
|
_: 2
|
|
2760
2765
|
}, 1032, ["onClick"])) : v("", !0),
|
|
2761
|
-
a
|
|
2766
|
+
l(a)(i.option.table?.delete, h) ? (d(), y(l(T), {
|
|
2762
2767
|
key: 3,
|
|
2763
2768
|
link: "",
|
|
2764
2769
|
type: "danger",
|
|
2765
|
-
onClick: (
|
|
2770
|
+
onClick: (c) => l(t).remove.open([h])
|
|
2766
2771
|
}, {
|
|
2767
2772
|
default: g(() => [
|
|
2768
|
-
E(S(
|
|
2773
|
+
E(S(l(w).tCurd("delete")), 1)
|
|
2769
2774
|
]),
|
|
2770
2775
|
_: 2
|
|
2771
2776
|
}, 1032, ["onClick"])) : v("", !0),
|
|
2772
|
-
|
|
2777
|
+
V(m.$slots, "table-op-right", { row: h })
|
|
2773
2778
|
], 64))
|
|
2774
2779
|
]),
|
|
2775
2780
|
_: 2
|
|
@@ -2780,58 +2785,58 @@ const Ft = /* @__PURE__ */ Y(Ut, [["render", Mt]]), ce = /* @__PURE__ */ N({
|
|
|
2780
2785
|
]),
|
|
2781
2786
|
_: 3
|
|
2782
2787
|
}, 16, ["data", "border", "onSelectionChange", "onSortChange", "expand-row-keys", "onExpandChange"])), [
|
|
2783
|
-
[k,
|
|
2788
|
+
[k, l(t).table.loading]
|
|
2784
2789
|
])
|
|
2785
2790
|
], 2)
|
|
2786
2791
|
], 2),
|
|
2787
2792
|
U("div", Pt, [
|
|
2788
|
-
(i.option.page?.show === void 0 || i.option.page?.show) && !
|
|
2793
|
+
(i.option.page?.show === void 0 || i.option.page?.show) && !l(t).page.showTools ? (d(), y(l(fe), C({
|
|
2789
2794
|
key: 0,
|
|
2790
|
-
"current-page":
|
|
2791
|
-
"onUpdate:currentPage":
|
|
2792
|
-
"page-size":
|
|
2793
|
-
"onUpdate:pageSize":
|
|
2795
|
+
"current-page": l(t).page.num,
|
|
2796
|
+
"onUpdate:currentPage": p[8] || (p[8] = (h) => l(t).page.num = h),
|
|
2797
|
+
"page-size": l(t).page.size,
|
|
2798
|
+
"onUpdate:pageSize": p[9] || (p[9] = (h) => l(t).page.size = h),
|
|
2794
2799
|
background: "",
|
|
2795
|
-
"page-sizes":
|
|
2796
|
-
"pager-count":
|
|
2797
|
-
layout:
|
|
2798
|
-
total:
|
|
2800
|
+
"page-sizes": l(t).page.sizeList,
|
|
2801
|
+
"pager-count": l(t).page.pagerCount,
|
|
2802
|
+
layout: l(t).page.layout,
|
|
2803
|
+
total: l(t).page.total,
|
|
2799
2804
|
size: i.option.size?.table,
|
|
2800
|
-
onSizeChange:
|
|
2801
|
-
onCurrentChange:
|
|
2802
|
-
}, i.option.page?.pagination || {},
|
|
2805
|
+
onSizeChange: l(t).table.getList,
|
|
2806
|
+
onCurrentChange: l(t).table.getList
|
|
2807
|
+
}, i.option.page?.pagination || {}, z(i.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : v("", !0)
|
|
2803
2808
|
])
|
|
2804
2809
|
], 2),
|
|
2805
|
-
|
|
2810
|
+
V(m.$slots, "box-right")
|
|
2806
2811
|
], 2),
|
|
2807
|
-
O(
|
|
2808
|
-
modelValue:
|
|
2809
|
-
"onUpdate:modelValue":
|
|
2810
|
-
title:
|
|
2811
|
-
"before-close":
|
|
2812
|
+
O(l(ne), C({
|
|
2813
|
+
modelValue: l(t).update.show,
|
|
2814
|
+
"onUpdate:modelValue": p[10] || (p[10] = (h) => l(t).update.show = h),
|
|
2815
|
+
title: l(t).update.title,
|
|
2816
|
+
"before-close": l(t).update.close
|
|
2812
2817
|
}, i.option.dialog), {
|
|
2813
2818
|
footer: g(() => [
|
|
2814
2819
|
U("span", Nt, [
|
|
2815
|
-
O(
|
|
2820
|
+
O(l(Q), {
|
|
2816
2821
|
size: i.option.size?.form
|
|
2817
2822
|
}, {
|
|
2818
2823
|
default: g(() => [
|
|
2819
|
-
O(
|
|
2820
|
-
onClick:
|
|
2824
|
+
O(l(T), {
|
|
2825
|
+
onClick: l(t).update.close
|
|
2821
2826
|
}, {
|
|
2822
2827
|
default: g(() => [
|
|
2823
|
-
E(S(
|
|
2828
|
+
E(S(l(w).tCurd("close")), 1)
|
|
2824
2829
|
]),
|
|
2825
2830
|
_: 1
|
|
2826
2831
|
}, 8, ["onClick"]),
|
|
2827
|
-
|
|
2832
|
+
l(t).update.type !== l(f).View ? (d(), y(l(T), {
|
|
2828
2833
|
key: 0,
|
|
2829
2834
|
type: "primary",
|
|
2830
|
-
onClick:
|
|
2831
|
-
loading:
|
|
2835
|
+
onClick: l(t).update.submit,
|
|
2836
|
+
loading: l(t).update.loading
|
|
2832
2837
|
}, {
|
|
2833
2838
|
default: g(() => [
|
|
2834
|
-
E(S(
|
|
2839
|
+
E(S(l(w).tCurd("submit")), 1)
|
|
2835
2840
|
]),
|
|
2836
2841
|
_: 1
|
|
2837
2842
|
}, 8, ["onClick", "loading"])) : v("", !0)
|
|
@@ -2841,55 +2846,55 @@ const Ft = /* @__PURE__ */ Y(Ut, [["render", Mt]]), ce = /* @__PURE__ */ N({
|
|
|
2841
2846
|
])
|
|
2842
2847
|
]),
|
|
2843
2848
|
default: g(() => [
|
|
2844
|
-
O(
|
|
2849
|
+
O(l(Q), {
|
|
2845
2850
|
ref_key: "ruleFormRef",
|
|
2846
2851
|
ref: r,
|
|
2847
|
-
model:
|
|
2848
|
-
rules:
|
|
2852
|
+
model: l(t).update.form,
|
|
2853
|
+
rules: l(t).update.rules,
|
|
2849
2854
|
size: i.option.size?.form,
|
|
2850
2855
|
class: "update-dialog-form"
|
|
2851
2856
|
}, {
|
|
2852
2857
|
default: g(() => [
|
|
2853
|
-
|
|
2854
|
-
a
|
|
2858
|
+
l(t).update.showContent ? (d(!0), b(D, { key: 0 }, A(l(t).update.formColumn, (h) => (d(), b(D, null, [
|
|
2859
|
+
l(a)(
|
|
2855
2860
|
(() => {
|
|
2856
|
-
const
|
|
2857
|
-
B?.item?.children ?
|
|
2861
|
+
const c = [], $ = (B) => {
|
|
2862
|
+
B?.item?.children ? $(B.item.children) : c.push(...B.map((L) => L.item?.show?.form));
|
|
2858
2863
|
};
|
|
2859
|
-
return
|
|
2864
|
+
return $(h), c;
|
|
2860
2865
|
})(),
|
|
2861
|
-
|
|
2862
|
-
|
|
2866
|
+
l(t).update.form,
|
|
2867
|
+
l(t).update.type
|
|
2863
2868
|
) ? (d(), b("div", {
|
|
2864
2869
|
key: 0,
|
|
2865
2870
|
class: I(["row curd-row", {
|
|
2866
2871
|
stripe: i.option.form?.stripe === void 0 ? !0 : i.option.form?.stripe
|
|
2867
2872
|
}])
|
|
2868
2873
|
}, [
|
|
2869
|
-
|
|
2870
|
-
row:
|
|
2874
|
+
V(m.$slots, "form-start", {
|
|
2875
|
+
row: l(t).update.form
|
|
2871
2876
|
}),
|
|
2872
|
-
(d(!0), b(D, null, A(
|
|
2873
|
-
a
|
|
2877
|
+
(d(!0), b(D, null, A(h, (c) => (d(), b(D, null, [
|
|
2878
|
+
l(a)(c.item.show?.form, l(t).update.form, l(t).update.type) ? (d(), b("div", {
|
|
2874
2879
|
key: 0,
|
|
2875
|
-
class: I([
|
|
2880
|
+
class: I([c.item.form.span > 0 ? `col-${l(t).getColumnSpan(c, h)}` : "col", `form-item-col-${c.item.key}`])
|
|
2876
2881
|
}, [
|
|
2877
|
-
(d(!0), b(D, null, A(
|
|
2878
|
-
key:
|
|
2879
|
-
conf:
|
|
2880
|
-
item:
|
|
2882
|
+
(d(!0), b(D, null, A(c.item.children ? c.children : [c], ($) => (d(), y(zt, {
|
|
2883
|
+
key: $.item.key,
|
|
2884
|
+
conf: l(t),
|
|
2885
|
+
item: $
|
|
2881
2886
|
}, G({ _: 2 }, [
|
|
2882
2887
|
A(m.$slots, (B, L) => ({
|
|
2883
2888
|
name: L,
|
|
2884
2889
|
fn: g((R) => [
|
|
2885
|
-
|
|
2890
|
+
V(m.$slots, L, C({ ref_for: !0 }, R || {}))
|
|
2886
2891
|
])
|
|
2887
2892
|
}))
|
|
2888
2893
|
]), 1032, ["conf", "item"]))), 128))
|
|
2889
2894
|
], 2)) : v("", !0)
|
|
2890
2895
|
], 64))), 256)),
|
|
2891
|
-
|
|
2892
|
-
row:
|
|
2896
|
+
V(m.$slots, "form-end", {
|
|
2897
|
+
row: l(t).update.form
|
|
2893
2898
|
})
|
|
2894
2899
|
], 2)) : v("", !0)
|
|
2895
2900
|
], 64))), 256)) : v("", !0)
|
|
@@ -2899,33 +2904,33 @@ const Ft = /* @__PURE__ */ Y(Ut, [["render", Mt]]), ce = /* @__PURE__ */ N({
|
|
|
2899
2904
|
]),
|
|
2900
2905
|
_: 3
|
|
2901
2906
|
}, 16, ["modelValue", "title", "before-close"]),
|
|
2902
|
-
O(
|
|
2903
|
-
modelValue:
|
|
2904
|
-
"onUpdate:modelValue":
|
|
2905
|
-
title:
|
|
2907
|
+
O(l(ne), {
|
|
2908
|
+
modelValue: l(t).remove.show,
|
|
2909
|
+
"onUpdate:modelValue": p[11] || (p[11] = (h) => l(t).remove.show = h),
|
|
2910
|
+
title: l(t).remove.title,
|
|
2906
2911
|
"close-on-click-modal": !1
|
|
2907
2912
|
}, {
|
|
2908
2913
|
footer: g(() => [
|
|
2909
2914
|
U("span", qt, [
|
|
2910
|
-
O(
|
|
2915
|
+
O(l(Q), {
|
|
2911
2916
|
size: i.option.size?.form
|
|
2912
2917
|
}, {
|
|
2913
2918
|
default: g(() => [
|
|
2914
|
-
O(
|
|
2915
|
-
onClick:
|
|
2919
|
+
O(l(T), {
|
|
2920
|
+
onClick: l(t).remove.close
|
|
2916
2921
|
}, {
|
|
2917
2922
|
default: g(() => [
|
|
2918
|
-
E(S(
|
|
2923
|
+
E(S(l(w).tCurd("close")), 1)
|
|
2919
2924
|
]),
|
|
2920
2925
|
_: 1
|
|
2921
2926
|
}, 8, ["onClick"]),
|
|
2922
|
-
O(
|
|
2927
|
+
O(l(T), {
|
|
2923
2928
|
type: "danger",
|
|
2924
|
-
onClick:
|
|
2925
|
-
loading:
|
|
2929
|
+
onClick: l(t).remove.submit,
|
|
2930
|
+
loading: l(t).remove.loading
|
|
2926
2931
|
}, {
|
|
2927
2932
|
default: g(() => [
|
|
2928
|
-
E(S(
|
|
2933
|
+
E(S(l(w).tCurd("confirmDelete")), 1)
|
|
2929
2934
|
]),
|
|
2930
2935
|
_: 1
|
|
2931
2936
|
}, 8, ["onClick", "loading"])
|
|
@@ -2938,9 +2943,9 @@ const Ft = /* @__PURE__ */ Y(Ut, [["render", Mt]]), ce = /* @__PURE__ */ N({
|
|
|
2938
2943
|
i.option.dialog?.delete?.content ? (d(), b("div", Wt, [
|
|
2939
2944
|
O(et, {
|
|
2940
2945
|
content: i.option.dialog?.delete?.content,
|
|
2941
|
-
value:
|
|
2946
|
+
value: l(t).remove.items
|
|
2942
2947
|
}, null, 8, ["content", "value"])
|
|
2943
|
-
])) : (d(), b("div", Jt, S(
|
|
2948
|
+
])) : (d(), b("div", Jt, S(l(w).tCurd("confirmDeleteMessage", l(t).remove.items.length)), 1))
|
|
2944
2949
|
]),
|
|
2945
2950
|
_: 1
|
|
2946
2951
|
}, 8, ["modelValue", "title"]),
|
|
@@ -2970,8 +2975,8 @@ class xt {
|
|
|
2970
2975
|
* @param name
|
|
2971
2976
|
*/
|
|
2972
2977
|
static exportJSONFile = (o, f) => {
|
|
2973
|
-
const n = new Blob([JSON.stringify(o)], { type: "application/json" }),
|
|
2974
|
-
t.href =
|
|
2978
|
+
const n = new Blob([JSON.stringify(o)], { type: "application/json" }), a = URL.createObjectURL(n), t = document.createElement("a");
|
|
2979
|
+
t.href = a, t.download = `${f || "config"}.json`, t.click();
|
|
2975
2980
|
};
|
|
2976
2981
|
/**
|
|
2977
2982
|
* 导入文件内容,默认为json
|
|
@@ -2979,10 +2984,10 @@ class xt {
|
|
|
2979
2984
|
* @returns
|
|
2980
2985
|
*/
|
|
2981
2986
|
static importFile = async (o) => new Promise((f, n) => {
|
|
2982
|
-
const
|
|
2983
|
-
|
|
2987
|
+
const a = document.createElement("input");
|
|
2988
|
+
a.type = "file";
|
|
2984
2989
|
const t = o?.accept || ".json";
|
|
2985
|
-
|
|
2990
|
+
a.accept = t, a.style.display = "none", a.onchange = (e) => {
|
|
2986
2991
|
const r = e.target.files[0];
|
|
2987
2992
|
if (!r) {
|
|
2988
2993
|
M.fail("未选择文件"), n("未选择文件");
|
|
@@ -2990,12 +2995,12 @@ class xt {
|
|
|
2990
2995
|
}
|
|
2991
2996
|
const s = new FileReader();
|
|
2992
2997
|
s.onload = async (m) => {
|
|
2993
|
-
const
|
|
2994
|
-
f(
|
|
2998
|
+
const p = t == ".json" ? JSON.parse(m.target.result) : m.target.result;
|
|
2999
|
+
f(p);
|
|
2995
3000
|
}, s.onerror = () => {
|
|
2996
3001
|
M.fail("文件读取失败"), n("文件读取失败");
|
|
2997
|
-
}, s.readAsText(r), document.body.removeChild(
|
|
2998
|
-
}, document.body.appendChild(
|
|
3002
|
+
}, s.readAsText(r), document.body.removeChild(a);
|
|
3003
|
+
}, document.body.appendChild(a), a.click();
|
|
2999
3004
|
});
|
|
3000
3005
|
}
|
|
3001
3006
|
const Gt = (i, o) => {
|