cc1-form 1.2.20 → 1.2.21
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 +436 -424
- package/dist/cc1-form.umd.cjs +1 -1
- package/dist/components/TCurd/com/form/column.vue.d.ts +37 -37
- package/dist/components/TCurd/formColumn.vue.d.ts +25 -25
- package/dist/components/TCurd/index.d.ts +26 -26
- package/dist/components/TCurd/index.vue.d.ts +57 -57
- package/dist/components/TCurd/indexType.d.ts +5 -5
- package/package.json +1 -1
package/dist/cc1-form.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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 re, ElRadio as se, ElTreeSelect as he, ElDatePicker as de, ElDialog as ie, ElButton as T, ElTableColumn as oe, ElDropdown as $e, ElDropdownMenu as De, ElDropdownItem as ne, ElPagination as pe, ElTable as Ee } from "element-plus";
|
|
2
2
|
import "vue-router";
|
|
3
|
-
import { defineComponent as N, reactive as ue, onMounted as ye, resolveComponent as ee, createElementBlock as b, createCommentVNode as v, openBlock as d, renderSlot as V, createVNode as
|
|
4
|
-
class
|
|
3
|
+
import { defineComponent as N, reactive as ue, onMounted as ye, resolveComponent as ee, createElementBlock as b, createCommentVNode as v, openBlock as d, renderSlot as V, createVNode as U, withCtx as g, createTextVNode as E, Fragment as D, renderList as A, createBlock as y, normalizeClass as I, normalizeStyle as ge, ref as J, unref as l, createElementVNode as S, mergeProps as C, toHandlers as z, resolveDynamicComponent as q, watch as ce, toDisplayString as M, computed as be, getCurrentInstance as Oe, createSlots as G, withModifiers as Ue, resolveDirective as Se, withDirectives as Me, normalizeProps as Fe, guardReactiveProps as Ae } from "vue";
|
|
4
|
+
class O {
|
|
5
5
|
/**
|
|
6
6
|
* Vue Router 实例,需在应用初始化时赋值
|
|
7
7
|
*/
|
|
@@ -43,9 +43,9 @@ class M {
|
|
|
43
43
|
* @param module
|
|
44
44
|
*/
|
|
45
45
|
static loadModule = async (o) => {
|
|
46
|
-
if (!
|
|
46
|
+
if (!O.moduleObj[o])
|
|
47
47
|
throw new Error(`模块${o}未加载,请赋值如:TSys.moduleObj = { ${o}: ()=>import('${o}') }`);
|
|
48
|
-
const f = await
|
|
48
|
+
const f = await O.moduleObj[o]();
|
|
49
49
|
return f.default ?? f;
|
|
50
50
|
};
|
|
51
51
|
/**
|
|
@@ -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
|
|
136
|
-
const t = await
|
|
135
|
+
let a = document.getElementById(o.id);
|
|
136
|
+
const t = await O.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 L {
|
|
|
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 L {
|
|
|
559
559
|
)
|
|
560
560
|
*/
|
|
561
561
|
static setOptionsData = (o, f, n) => {
|
|
562
|
-
const
|
|
563
|
-
|
|
562
|
+
const a = L.findOptions(o, f);
|
|
563
|
+
a && (a.data = n);
|
|
564
564
|
};
|
|
565
565
|
static form = {
|
|
566
566
|
openBefore: {
|
|
@@ -571,9 +571,9 @@ class L {
|
|
|
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 ===
|
|
576
|
+
o ? f.type === O.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), L.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,25 +748,25 @@ const je = {
|
|
|
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
|
ye(() => {
|
|
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", je, [
|
|
767
767
|
V(t.$slots, "list-start", { row: i.row }),
|
|
768
768
|
i.addBottom ? v("", !0) : (d(), b("div", Le, [
|
|
769
|
-
|
|
769
|
+
U(r, {
|
|
770
770
|
link: "",
|
|
771
771
|
type: "primary",
|
|
772
772
|
onClick: e[0] || (e[0] = (m) => n.add(i.field, i.row, i.itemFields))
|
|
@@ -788,13 +788,13 @@ const je = {
|
|
|
788
788
|
style: ge({ width: i.inputWidth }),
|
|
789
789
|
class: I(i.inputClass),
|
|
790
790
|
placeholder: p[i.label] || p[i.value],
|
|
791
|
-
onChange: e[1] || (e[1] = (u) =>
|
|
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
|
+
U(r, {
|
|
798
798
|
link: "",
|
|
799
799
|
type: "danger",
|
|
800
800
|
onClick: (p) => n.remove(i.field, i.row, m)
|
|
@@ -806,7 +806,7 @@ const je = {
|
|
|
806
806
|
}, 1032, ["onClick"])
|
|
807
807
|
]))), 256)),
|
|
808
808
|
i.addBottom ? (d(), b("div", Re, [
|
|
809
|
-
|
|
809
|
+
U(r, {
|
|
810
810
|
link: "",
|
|
811
811
|
type: "primary",
|
|
812
812
|
onClick: e[2] || (e[2] = (m) => n.add(i.field, i.row, i.itemFields))
|
|
@@ -841,19 +841,24 @@ const je = {
|
|
|
841
841
|
}
|
|
842
842
|
},
|
|
843
843
|
setup(i, { expose: o }) {
|
|
844
|
-
const f =
|
|
844
|
+
const f = O.isFun, n = O.EDialog, a = J(), t = i, e = ue({
|
|
845
845
|
rules: {},
|
|
846
846
|
show: !0,
|
|
847
847
|
form: {},
|
|
848
848
|
formDefault: {},
|
|
849
849
|
type: t.type || n.Add,
|
|
850
850
|
formColumn: [],
|
|
851
|
-
getDisabled: (r) =>
|
|
851
|
+
getDisabled: (r) => {
|
|
852
|
+
if (e.type === n.View)
|
|
853
|
+
return r.disabled?.view === void 0 ? !0 : O.isFun(r.disabled?.view, e.form);
|
|
854
|
+
const s = r.disabled?.[e.type === n.Add ? "create" : "update"];
|
|
855
|
+
return O.isFun(s, e.form);
|
|
856
|
+
},
|
|
852
857
|
getBind: (r) => r.options?.[e.type === n.Add ? "formAdd" : "formUpdate"]?.[r.type] || r.options?.[r.type] || {},
|
|
853
858
|
getOn: (r) => r.options?.[e.type === n.Add ? "formAdd" : "formUpdate"]?.[r.type]?.on || r.options?.[r.type]?.on || {},
|
|
854
859
|
getColumnSpan: (r, s) => {
|
|
855
860
|
if (r.item.form?.spanCol) {
|
|
856
|
-
const m = t.option.form?.maxSpan || 12, p = t.option.form?.defaultSpan || m / 2, k = s.filter((h) => !
|
|
861
|
+
const m = t.option.form?.maxSpan || 12, p = t.option.form?.defaultSpan || m / 2, k = s.filter((h) => !O.isFun(h.item.show?.form, e.form, e.type)).reduce((h, c) => h + (c.item.form?.span || p), 0);
|
|
857
862
|
return (r.item.form?.span || p) + k;
|
|
858
863
|
}
|
|
859
864
|
return r.item.form?.span;
|
|
@@ -896,17 +901,17 @@ const je = {
|
|
|
896
901
|
}
|
|
897
902
|
});
|
|
898
903
|
return e.initColumnForm(), o({
|
|
899
|
-
ref:
|
|
904
|
+
ref: a,
|
|
900
905
|
conf: e
|
|
901
|
-
}), (r, s) => (d(), y(
|
|
906
|
+
}), (r, s) => (d(), y(l(Q), {
|
|
902
907
|
ref_key: "ruleFormRef",
|
|
903
|
-
ref:
|
|
908
|
+
ref: a,
|
|
904
909
|
model: e.form,
|
|
905
910
|
rules: e.rules
|
|
906
911
|
}, {
|
|
907
912
|
default: g(() => [
|
|
908
913
|
e.show ? (d(!0), b(D, { key: 0 }, A(e.formColumn, (m, p) => (d(), b(D, { key: p }, [
|
|
909
|
-
|
|
914
|
+
l(f)(
|
|
910
915
|
m.map((u) => u.item?.show?.form),
|
|
911
916
|
e.form,
|
|
912
917
|
e.type
|
|
@@ -922,42 +927,42 @@ const je = {
|
|
|
922
927
|
(d(!0), b(D, null, A(m, (u) => (d(), b(D, {
|
|
923
928
|
key: u.item.key
|
|
924
929
|
}, [
|
|
925
|
-
|
|
930
|
+
l(f)(u.item.show?.form, e.form, e.type) ? (d(), b("div", {
|
|
926
931
|
key: 0,
|
|
927
932
|
class: I([u.item.form.span > 0 ? `col-${e.getColumnSpan(u, m)}` : "col", `form-item-col-${u.item.key}`])
|
|
928
933
|
}, [
|
|
929
|
-
|
|
934
|
+
U(l(ae), {
|
|
930
935
|
label: u.item.text?.form?.label ?? u.item.label,
|
|
931
936
|
prop: u.item.key,
|
|
932
937
|
"label-width": u.item.text?.form?.label == "" ? 0 : u.item.form?.labelWidth || i.option.form?.labelWidth || "100px"
|
|
933
938
|
}, {
|
|
934
939
|
default: g(() => [
|
|
935
|
-
|
|
940
|
+
S("div", Ie, [
|
|
936
941
|
V(r.$slots, "form-" + u.item.key + "-start", {
|
|
937
942
|
row: e.form,
|
|
938
943
|
item: u.item
|
|
939
944
|
}),
|
|
940
|
-
|
|
941
|
-
|
|
945
|
+
S("div", He, [
|
|
946
|
+
S("div", Ke, [
|
|
942
947
|
V(r.$slots, "form-" + u.item.key, {
|
|
943
948
|
row: e.form,
|
|
944
949
|
item: u.item
|
|
945
950
|
}, () => [
|
|
946
|
-
u.item.type === "input" ? (d(), y(
|
|
951
|
+
u.item.type === "input" ? (d(), y(l(_), C({
|
|
947
952
|
key: 0,
|
|
948
953
|
modelValue: e.form[u.item.key],
|
|
949
954
|
"onUpdate:modelValue": (k) => e.form[u.item.key] = k,
|
|
950
955
|
ref_for: !0
|
|
951
956
|
}, e.getBind(u.item), z(e.getOn(u.item)), {
|
|
952
957
|
disabled: e.getDisabled(u.item)
|
|
953
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "switch" ? (d(), y(
|
|
958
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "switch" ? (d(), y(l(Z), C({
|
|
954
959
|
key: 1,
|
|
955
960
|
modelValue: e.form[u.item.key],
|
|
956
961
|
"onUpdate:modelValue": (k) => e.form[u.item.key] = k,
|
|
957
962
|
ref_for: !0
|
|
958
963
|
}, e.getBind(u.item), z(e.getOn(u.item)), {
|
|
959
964
|
disabled: e.getDisabled(u.item)
|
|
960
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "select" ? (d(), y(
|
|
965
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "select" ? (d(), y(l(X), C({
|
|
961
966
|
key: 2,
|
|
962
967
|
modelValue: e.form[u.item.key],
|
|
963
968
|
"onUpdate:modelValue": (k) => e.form[u.item.key] = k,
|
|
@@ -967,14 +972,14 @@ const je = {
|
|
|
967
972
|
style: { width: "100%" }
|
|
968
973
|
}), {
|
|
969
974
|
default: g(() => [
|
|
970
|
-
(d(!0), b(D, null, A(u.item.options?.select?.data, (k) => (d(), y(
|
|
975
|
+
(d(!0), b(D, null, A(u.item.options?.select?.data, (k) => (d(), y(l(W), {
|
|
971
976
|
key: k.value,
|
|
972
977
|
label: k.label,
|
|
973
978
|
value: k.value
|
|
974
979
|
}, null, 8, ["label", "value"]))), 128))
|
|
975
980
|
]),
|
|
976
981
|
_: 2
|
|
977
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "radio" ? (d(), y(
|
|
982
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "radio" ? (d(), y(l(re), C({
|
|
978
983
|
key: 3,
|
|
979
984
|
modelValue: e.form[u.item.key],
|
|
980
985
|
"onUpdate:modelValue": (k) => e.form[u.item.key] = k,
|
|
@@ -984,7 +989,7 @@ const je = {
|
|
|
984
989
|
style: { width: "100%" }
|
|
985
990
|
}), {
|
|
986
991
|
default: g(() => [
|
|
987
|
-
(d(!0), b(D, null, A(u.item.options?.radio?.data, (k) => (d(), y(
|
|
992
|
+
(d(!0), b(D, null, A(u.item.options?.radio?.data, (k) => (d(), y(l(se), {
|
|
988
993
|
key: k.value,
|
|
989
994
|
label: k.label,
|
|
990
995
|
value: k.value
|
|
@@ -999,7 +1004,7 @@ const je = {
|
|
|
999
1004
|
}, e.getBind(u.item), z(e.getOn(u.item)), {
|
|
1000
1005
|
disabled: e.getDisabled(u.item),
|
|
1001
1006
|
style: { width: "100%" }
|
|
1002
|
-
}), null, 16, ["row", "field", "disabled"])) : u.item.type === "treeSelect" ? (d(), y(
|
|
1007
|
+
}), null, 16, ["row", "field", "disabled"])) : u.item.type === "treeSelect" ? (d(), y(l(he), C({
|
|
1003
1008
|
key: 5,
|
|
1004
1009
|
modelValue: e.form[u.item.key],
|
|
1005
1010
|
"onUpdate:modelValue": (k) => e.form[u.item.key] = k,
|
|
@@ -1007,14 +1012,14 @@ const je = {
|
|
|
1007
1012
|
}, e.getBind(u.item), z(e.getOn(u.item)), {
|
|
1008
1013
|
disabled: e.getDisabled(u.item),
|
|
1009
1014
|
style: { width: "100%" }
|
|
1010
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "datetime" ? (d(), y(
|
|
1015
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "datetime" ? (d(), y(l(de), C({
|
|
1011
1016
|
key: 6,
|
|
1012
1017
|
modelValue: e.form[u.item.key],
|
|
1013
1018
|
"onUpdate:modelValue": (k) => e.form[u.item.key] = k,
|
|
1014
1019
|
ref_for: !0
|
|
1015
1020
|
}, e.getBind(u.item), z(e.getOn(u.item)), {
|
|
1016
1021
|
disabled: e.getDisabled(u.item)
|
|
1017
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type && (
|
|
1022
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type && (l(L).customComponent[u.item.type] || l(L).customComponent[u.item.type]?.form) ? (d(), y(q(l(L).customComponent[u.item.type]?.form || l(L).customComponent[u.item.type]), C({
|
|
1018
1023
|
key: 7,
|
|
1019
1024
|
modelValue: e.form[u.item.key],
|
|
1020
1025
|
"onUpdate:modelValue": (k) => e.form[u.item.key] = k,
|
|
@@ -1069,13 +1074,13 @@ class We {
|
|
|
1069
1074
|
*/
|
|
1070
1075
|
static exportToExcel = async (o, f, n) => {
|
|
1071
1076
|
if (!o || o.length === 0) return;
|
|
1072
|
-
const
|
|
1077
|
+
const a = await O.loadModule("xlsx"), t = o.map((s) => {
|
|
1073
1078
|
const m = {};
|
|
1074
1079
|
return f.forEach((p) => {
|
|
1075
1080
|
m[p.label] = s[p.key];
|
|
1076
1081
|
}), m;
|
|
1077
|
-
}), e =
|
|
1078
|
-
|
|
1082
|
+
}), e = a.utils.json_to_sheet(t), r = a.utils.book_new();
|
|
1083
|
+
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
1084
|
};
|
|
1080
1085
|
}
|
|
1081
1086
|
class x {
|
|
@@ -1097,13 +1102,13 @@ class x {
|
|
|
1097
1102
|
* @returns
|
|
1098
1103
|
*/
|
|
1099
1104
|
static setValue = (o, f, n = !1) => {
|
|
1100
|
-
n && x.delAllKey(o), Object.keys(f).forEach((
|
|
1101
|
-
o[
|
|
1105
|
+
n && x.delAllKey(o), Object.keys(f).forEach((a) => {
|
|
1106
|
+
o[a] !== f[a] && (o[a] = f[a]);
|
|
1102
1107
|
});
|
|
1103
1108
|
};
|
|
1104
1109
|
}
|
|
1105
|
-
const K =
|
|
1106
|
-
const o = J(), f = J(), n = J(),
|
|
1110
|
+
const K = O.EDialog, Je = (i) => {
|
|
1111
|
+
const o = J(), f = J(), n = J(), a = ue({
|
|
1107
1112
|
option: i.option,
|
|
1108
1113
|
/** 查询区域相关配置对象 */
|
|
1109
1114
|
search: {
|
|
@@ -1122,23 +1127,23 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1122
1127
|
getFormData: () => {
|
|
1123
1128
|
let t = {};
|
|
1124
1129
|
i.option.column.forEach((r) => {
|
|
1125
|
-
(typeof r.show?.search == "function" ? r.show?.search(
|
|
1130
|
+
(typeof r.show?.search == "function" ? r.show?.search(a.search.form) : r.show?.search) && (t[r.key] = a.search.form[r.key]);
|
|
1126
1131
|
});
|
|
1127
1132
|
const e = i.option.search?.before?.(t);
|
|
1128
1133
|
return e && (t = e), t;
|
|
1129
1134
|
},
|
|
1130
1135
|
/** 重置搜索表单 */
|
|
1131
1136
|
reset: () => {
|
|
1132
|
-
const t =
|
|
1137
|
+
const t = a.search.formDefault;
|
|
1133
1138
|
Object.keys(t).forEach((r) => {
|
|
1134
|
-
i.option.search?.resetMode === "none" ? t[r] = void 0 : t[r] =
|
|
1139
|
+
i.option.search?.resetMode === "none" ? t[r] = void 0 : t[r] = a.search.formDefault[r];
|
|
1135
1140
|
});
|
|
1136
1141
|
const e = ObjectUtil.deepMerge(t, {});
|
|
1137
|
-
x.setValue(
|
|
1142
|
+
x.setValue(a.search.form, e, !0), a.page.num = 1, i.option.init !== !1 && a.table.getList();
|
|
1138
1143
|
},
|
|
1139
1144
|
/** 提交搜索表单 */
|
|
1140
1145
|
submit: () => {
|
|
1141
|
-
|
|
1146
|
+
a.page.num = 1, a.table.getList();
|
|
1142
1147
|
}
|
|
1143
1148
|
},
|
|
1144
1149
|
/** 分页区域相关配置对象 */
|
|
@@ -1159,9 +1164,9 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1159
1164
|
pagerCount: i.option.page?.pagerCount || F.config.pagination.pagerCount,
|
|
1160
1165
|
/** 获取分页查询参数 */
|
|
1161
1166
|
getQuery: (t = {}) => ({
|
|
1162
|
-
[F.config.field.page.size]: t.size ||
|
|
1163
|
-
[F.config.field.page.num]: t.num ||
|
|
1164
|
-
...
|
|
1167
|
+
[F.config.field.page.size]: t.size || a.page.size,
|
|
1168
|
+
[F.config.field.page.num]: t.num || a.page.num,
|
|
1169
|
+
...a.search.getFormData()
|
|
1165
1170
|
})
|
|
1166
1171
|
},
|
|
1167
1172
|
/** 表格区域相关配置对象 */
|
|
@@ -1186,8 +1191,8 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1186
1191
|
},
|
|
1187
1192
|
/** 全部展开/收起 */
|
|
1188
1193
|
all: () => {
|
|
1189
|
-
if (
|
|
1190
|
-
|
|
1194
|
+
if (a.table.expand.isExpand)
|
|
1195
|
+
a.table.expand.rowKeys = [];
|
|
1191
1196
|
else {
|
|
1192
1197
|
const t = (e) => {
|
|
1193
1198
|
let r = [];
|
|
@@ -1195,9 +1200,9 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1195
1200
|
r.push(s[i.option.table.rowKey]), s.children && s.children.length > 0 && (r = r.concat(t(s.children)));
|
|
1196
1201
|
}), r;
|
|
1197
1202
|
};
|
|
1198
|
-
|
|
1203
|
+
a.table.expand.rowKeys = t(a.table.data);
|
|
1199
1204
|
}
|
|
1200
|
-
|
|
1205
|
+
a.table.expand.isExpand = !a.table.expand.isExpand;
|
|
1201
1206
|
}
|
|
1202
1207
|
},
|
|
1203
1208
|
/** 表格列相关配置 */
|
|
@@ -1219,47 +1224,47 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1219
1224
|
expand: !1,
|
|
1220
1225
|
/** 全部展开/收起主分组 */
|
|
1221
1226
|
toggleExpandAll: () => {
|
|
1222
|
-
const t = !
|
|
1223
|
-
|
|
1227
|
+
const t = !a.table.header.group.expand;
|
|
1228
|
+
a.table.header.group.expand = t;
|
|
1224
1229
|
const e = (r) => {
|
|
1225
1230
|
r.forEach((s) => {
|
|
1226
1231
|
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
1232
|
});
|
|
1228
1233
|
};
|
|
1229
|
-
e(
|
|
1234
|
+
e(a.table.column.list);
|
|
1230
1235
|
}
|
|
1231
1236
|
}
|
|
1232
1237
|
},
|
|
1233
1238
|
/** 获取数据列表接口实现 */
|
|
1234
1239
|
getList: async () => {
|
|
1235
|
-
|
|
1236
|
-
const t = i.option.api.list, e = JSONUtil.cp(
|
|
1240
|
+
a.table.loading = !0;
|
|
1241
|
+
const t = i.option.api.list, e = JSONUtil.cp(a.table.selection.list);
|
|
1237
1242
|
try {
|
|
1238
|
-
await
|
|
1243
|
+
await a.initApiData("init");
|
|
1239
1244
|
let r = {};
|
|
1240
|
-
if (
|
|
1245
|
+
if (a.table.sort.prop) {
|
|
1241
1246
|
const { props: $, order: B } = F.config.table.sort;
|
|
1242
1247
|
r = {
|
|
1243
|
-
[$.field]:
|
|
1244
|
-
[B.field]:
|
|
1248
|
+
[$.field]: a.table.sort.prop,
|
|
1249
|
+
[B.field]: a.table.sort.order
|
|
1245
1250
|
};
|
|
1246
1251
|
}
|
|
1247
1252
|
const s = await t({
|
|
1248
|
-
...
|
|
1253
|
+
...a.page.getQuery(),
|
|
1249
1254
|
...r
|
|
1250
1255
|
}), m = F.config.field.result, p = s.data || { [m.list]: s };
|
|
1251
1256
|
let u = (Array.isArray(p[m.list]), p[m.list]);
|
|
1252
|
-
const k =
|
|
1257
|
+
const k = a.update.formColumn.flat(), c = ObjectUtil.deepMerge({ data: u }, {}).data.map(($) => (Object.keys($).forEach((R) => {
|
|
1253
1258
|
const j = k.find((H) => H.item.key === R);
|
|
1254
1259
|
j && ["select", "radio"].includes(j.item.type) && (j.item.table.format || (j.item.table.format = (H) => j.item.options[j.item.type].data?.find((le) => le.value == H[R])?.label || H[R]));
|
|
1255
1260
|
}), $));
|
|
1256
|
-
|
|
1257
|
-
|
|
1261
|
+
a.table.data = i.option.data ? await i.option.data(c, u) : c, a.page.total = p[m.total] || 0, setTimeout(() => {
|
|
1262
|
+
a.table.selection.setList(e);
|
|
1258
1263
|
}, 20);
|
|
1259
1264
|
} catch (r) {
|
|
1260
1265
|
console.error(r);
|
|
1261
1266
|
} finally {
|
|
1262
|
-
|
|
1267
|
+
a.table.loading = !1;
|
|
1263
1268
|
}
|
|
1264
1269
|
},
|
|
1265
1270
|
/** 表格多选相关配置 */
|
|
@@ -1268,11 +1273,11 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1268
1273
|
list: [],
|
|
1269
1274
|
/** 选中状态回调 */
|
|
1270
1275
|
change: (t) => {
|
|
1271
|
-
|
|
1276
|
+
a.table.selection.list = t;
|
|
1272
1277
|
},
|
|
1273
1278
|
/** 设置表格多选数据 */
|
|
1274
1279
|
setList: (t, e) => {
|
|
1275
|
-
|
|
1280
|
+
a.table.selection.list = [];
|
|
1276
1281
|
const r = n.value;
|
|
1277
1282
|
if (r?.clearSelection(), !r || !t?.length) return;
|
|
1278
1283
|
const s = i.option.table?.rowKey, m = (p) => {
|
|
@@ -1288,7 +1293,7 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1288
1293
|
}
|
|
1289
1294
|
}
|
|
1290
1295
|
};
|
|
1291
|
-
return u(
|
|
1296
|
+
return u(a.table.data);
|
|
1292
1297
|
};
|
|
1293
1298
|
t.forEach((p) => {
|
|
1294
1299
|
const u = m(p);
|
|
@@ -1311,13 +1316,13 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1311
1316
|
order: "",
|
|
1312
1317
|
/** 排序变更回调 */
|
|
1313
1318
|
change: (t) => {
|
|
1314
|
-
F.config.table.sort.resetPage && (
|
|
1319
|
+
F.config.table.sort.resetPage && (a.page.num = 1);
|
|
1315
1320
|
const e = F.config.table.sort;
|
|
1316
1321
|
if (e.change) {
|
|
1317
|
-
e.change(t,
|
|
1322
|
+
e.change(t, a);
|
|
1318
1323
|
return;
|
|
1319
1324
|
}
|
|
1320
|
-
|
|
1325
|
+
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();
|
|
1321
1326
|
}
|
|
1322
1327
|
}
|
|
1323
1328
|
},
|
|
@@ -1327,7 +1332,7 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1327
1332
|
run: {
|
|
1328
1333
|
/** 执行指定方式的导出(如select、page、all) */
|
|
1329
1334
|
start: async (t) => {
|
|
1330
|
-
let e = await
|
|
1335
|
+
let e = await a.export.run[t](), r = i.option.column;
|
|
1331
1336
|
const s = ObjectUtil.deepMerge(
|
|
1332
1337
|
{
|
|
1333
1338
|
data: e,
|
|
@@ -1339,55 +1344,55 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1339
1344
|
},
|
|
1340
1345
|
/** 获取当前选中项进行导出 */
|
|
1341
1346
|
select: async () => {
|
|
1342
|
-
|
|
1347
|
+
a.export.loading = !0;
|
|
1343
1348
|
try {
|
|
1344
1349
|
if (i.option.tools?.export?.select) {
|
|
1345
1350
|
await i.option.tools?.export?.select({
|
|
1346
|
-
...
|
|
1347
|
-
items:
|
|
1351
|
+
...a.page.getQuery(),
|
|
1352
|
+
items: a.table.selection.list
|
|
1348
1353
|
});
|
|
1349
1354
|
return;
|
|
1350
1355
|
}
|
|
1351
|
-
if (
|
|
1352
|
-
throw
|
|
1353
|
-
return
|
|
1356
|
+
if (a.table.selection.list.length === 0)
|
|
1357
|
+
throw O.fail(w.tCurd("selectDataToExport")), new Error(w.tCurd("selectDataToExport"));
|
|
1358
|
+
return a.table.selection.list;
|
|
1354
1359
|
} catch (t) {
|
|
1355
1360
|
console.error(t);
|
|
1356
1361
|
} finally {
|
|
1357
|
-
|
|
1362
|
+
a.export.loading = !1;
|
|
1358
1363
|
}
|
|
1359
1364
|
},
|
|
1360
1365
|
/** 导出当前页的数据 */
|
|
1361
1366
|
page: async () => {
|
|
1362
|
-
|
|
1367
|
+
a.export.loading = !0;
|
|
1363
1368
|
try {
|
|
1364
1369
|
if (i.option.tools?.export?.page) {
|
|
1365
1370
|
await i.option.tools?.export?.page({
|
|
1366
|
-
...
|
|
1371
|
+
...a.page.getQuery()
|
|
1367
1372
|
});
|
|
1368
1373
|
return;
|
|
1369
1374
|
}
|
|
1370
|
-
if (
|
|
1371
|
-
throw
|
|
1372
|
-
return
|
|
1375
|
+
if (a.table.data.length === 0)
|
|
1376
|
+
throw O.fail(w.tCurd("noData")), new Error(w.tCurd("noData"));
|
|
1377
|
+
return a.table.data;
|
|
1373
1378
|
} catch (t) {
|
|
1374
1379
|
console.error(t);
|
|
1375
1380
|
} finally {
|
|
1376
|
-
|
|
1381
|
+
a.export.loading = !1;
|
|
1377
1382
|
}
|
|
1378
1383
|
},
|
|
1379
1384
|
/** 导出所有数据 */
|
|
1380
1385
|
all: async () => {
|
|
1381
|
-
|
|
1386
|
+
a.export.loading = !0;
|
|
1382
1387
|
try {
|
|
1383
1388
|
if (i.option.tools?.export?.all) {
|
|
1384
1389
|
await i.option.tools?.export?.all({
|
|
1385
|
-
...
|
|
1390
|
+
...a.page.getQuery()
|
|
1386
1391
|
});
|
|
1387
1392
|
return;
|
|
1388
1393
|
}
|
|
1389
1394
|
const t = i.option.api.list, e = await t({
|
|
1390
|
-
...
|
|
1395
|
+
...a.page.getQuery({
|
|
1391
1396
|
size: 999999,
|
|
1392
1397
|
num: 1
|
|
1393
1398
|
})
|
|
@@ -1396,7 +1401,7 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1396
1401
|
} catch (t) {
|
|
1397
1402
|
console.error(t);
|
|
1398
1403
|
} finally {
|
|
1399
|
-
|
|
1404
|
+
a.export.loading = !1;
|
|
1400
1405
|
}
|
|
1401
1406
|
}
|
|
1402
1407
|
},
|
|
@@ -1404,7 +1409,7 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1404
1409
|
loading: !1,
|
|
1405
1410
|
/** 执行导出操作的触发函数 */
|
|
1406
1411
|
click: (t) => {
|
|
1407
|
-
|
|
1412
|
+
a.export.loading || a.export.run.start(t);
|
|
1408
1413
|
}
|
|
1409
1414
|
},
|
|
1410
1415
|
/** 表单增删改弹窗相关对象 */
|
|
@@ -1428,27 +1433,34 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1428
1433
|
/** 表单所有列,二维数组结构按行分组 */
|
|
1429
1434
|
formColumn: [],
|
|
1430
1435
|
/** 判断是否禁用当前字段 */
|
|
1431
|
-
getDisabled: (t, e = !1) =>
|
|
1436
|
+
getDisabled: (t, e = !1) => {
|
|
1437
|
+
if (i.option.table?.editMode && e)
|
|
1438
|
+
return t.disabled?.table === void 0 ? !1 : O.isFun(t.disabled?.table, a.update.form);
|
|
1439
|
+
if (a.update.type === K.View)
|
|
1440
|
+
return t.disabled?.view === void 0 ? !0 : O.isFun(t.disabled?.view, a.update.form);
|
|
1441
|
+
const r = t.disabled?.[a.update.type === K.Add ? "create" : "update"];
|
|
1442
|
+
return O.isFun(r, a.update.form);
|
|
1443
|
+
},
|
|
1432
1444
|
/** 获取表单组件绑定属性 */
|
|
1433
|
-
getBind: (t) => t.options?.[
|
|
1445
|
+
getBind: (t) => t.options?.[a.update.type === K.Add ? "formAdd" : "formUpdate"]?.[t.type] || t.options?.[t.type] || {},
|
|
1434
1446
|
/** 获取表单组件事件属性 */
|
|
1435
1447
|
getOn: (t, e) => {
|
|
1436
|
-
const s = t.options?.[
|
|
1448
|
+
const s = t.options?.[a.update.type === K.Add ? "formAdd" : "formUpdate"]?.[t.type]?.on || t.options?.[t.type]?.on || {}, m = {};
|
|
1437
1449
|
return Object.keys(s).forEach((p) => {
|
|
1438
1450
|
const u = s[p];
|
|
1439
1451
|
typeof u == "function" ? m[p] = function(...k) {
|
|
1440
|
-
return u.apply(this, [...k, e ||
|
|
1452
|
+
return u.apply(this, [...k, e || a.update.form, t]);
|
|
1441
1453
|
} : m[p] = u;
|
|
1442
1454
|
}), m;
|
|
1443
1455
|
},
|
|
1444
1456
|
/** 获取表单组件绑定属性和事件 */
|
|
1445
1457
|
getOptions: (t) => {
|
|
1446
1458
|
try {
|
|
1447
|
-
const r =
|
|
1459
|
+
const r = a.update.formColumn.flat().find((s) => s.item.key === t)?.item;
|
|
1448
1460
|
return r ? {
|
|
1449
1461
|
options: r.options,
|
|
1450
1462
|
// @ts-ignore
|
|
1451
|
-
bind:
|
|
1463
|
+
bind: a.update.getBind(r)
|
|
1452
1464
|
} : { options: {}, bind: {} };
|
|
1453
1465
|
} catch {
|
|
1454
1466
|
return { options: {}, bind: {} };
|
|
@@ -1463,28 +1475,28 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1463
1475
|
if (i.option.form?.editAll)
|
|
1464
1476
|
return t;
|
|
1465
1477
|
let e = {
|
|
1466
|
-
[i.option.table?.rowKey]:
|
|
1478
|
+
[i.option.table?.rowKey]: a.update.edit.data[i.option.table?.rowKey]
|
|
1467
1479
|
};
|
|
1468
|
-
return Object.keys(
|
|
1469
|
-
t[r] !==
|
|
1480
|
+
return Object.keys(a.update.edit.data).forEach((r) => {
|
|
1481
|
+
t[r] !== a.update.edit.data[r] && (e[r] = t[r]);
|
|
1470
1482
|
}), e;
|
|
1471
1483
|
}
|
|
1472
1484
|
},
|
|
1473
1485
|
view: {},
|
|
1474
1486
|
/** 打开增改弹窗 */
|
|
1475
1487
|
open: (t, e) => {
|
|
1476
|
-
|
|
1477
|
-
|
|
1488
|
+
a.update.showContent || FunUtil.throttle(async () => {
|
|
1489
|
+
O.loading(!0);
|
|
1478
1490
|
try {
|
|
1479
|
-
|
|
1491
|
+
a.update.type = t;
|
|
1480
1492
|
const r = t === K.Add;
|
|
1481
|
-
|
|
1482
|
-
const s = ObjectUtil.deepMerge(r ?
|
|
1483
|
-
x.setValue(
|
|
1493
|
+
a.update.edit.data = e, a.update.title = w.tCurd(r ? "add" : t === K.View ? "view" : "edit");
|
|
1494
|
+
const s = ObjectUtil.deepMerge(r ? a.update.formDefault : e, {});
|
|
1495
|
+
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);
|
|
1484
1496
|
} catch (r) {
|
|
1485
1497
|
console.error(r);
|
|
1486
1498
|
} finally {
|
|
1487
|
-
|
|
1499
|
+
O.loading(!1);
|
|
1488
1500
|
}
|
|
1489
1501
|
});
|
|
1490
1502
|
},
|
|
@@ -1492,16 +1504,16 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1492
1504
|
submit: () => {
|
|
1493
1505
|
FunUtil.throttle(async () => {
|
|
1494
1506
|
await f.value?.validate(async (s, m) => new Promise((p, u) => {
|
|
1495
|
-
s || (
|
|
1496
|
-
})),
|
|
1497
|
-
const t =
|
|
1507
|
+
s || (O.fail(w.tCurd("checkFormData")), u(!1)), p();
|
|
1508
|
+
})), a.update.loading = !0;
|
|
1509
|
+
const t = a.update.type === K.Add ? i.option.api.create : i.option.api.update;
|
|
1498
1510
|
try {
|
|
1499
|
-
await i.option.form?.submitBefore?.(
|
|
1511
|
+
await i.option.form?.submitBefore?.(a.update.form, a.update);
|
|
1500
1512
|
} catch {
|
|
1501
|
-
|
|
1513
|
+
a.update.loading = !1;
|
|
1502
1514
|
return;
|
|
1503
1515
|
}
|
|
1504
|
-
let e = ObjectUtil.deepMerge(
|
|
1516
|
+
let e = ObjectUtil.deepMerge(a.update.form, {});
|
|
1505
1517
|
delete e.children;
|
|
1506
1518
|
const r = new Set(i.option.column.filter((s) => s.type === "datetime").map((s) => s.key));
|
|
1507
1519
|
Object.keys(e).forEach((s) => {
|
|
@@ -1514,18 +1526,18 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1514
1526
|
if (!t) return;
|
|
1515
1527
|
await t({
|
|
1516
1528
|
...e
|
|
1517
|
-
}),
|
|
1529
|
+
}), a.update.close(), await a.table.getList(), i.option.form?.submitAfter?.(e, a.update);
|
|
1518
1530
|
} catch (s) {
|
|
1519
1531
|
console.error(s);
|
|
1520
1532
|
} finally {
|
|
1521
|
-
|
|
1533
|
+
a.update.loading = !1;
|
|
1522
1534
|
}
|
|
1523
1535
|
});
|
|
1524
1536
|
},
|
|
1525
1537
|
/** 关闭弹窗和内容 */
|
|
1526
1538
|
close: () => {
|
|
1527
|
-
|
|
1528
|
-
|
|
1539
|
+
a.update.show = !1, i.option.table?.inlineEdit && (a.update.form = {}), setTimeout(() => {
|
|
1540
|
+
a.update.showContent = !1;
|
|
1529
1541
|
}, 350);
|
|
1530
1542
|
}
|
|
1531
1543
|
},
|
|
@@ -1541,38 +1553,38 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1541
1553
|
loading: !1,
|
|
1542
1554
|
/** 关闭删除弹窗 */
|
|
1543
1555
|
close: () => {
|
|
1544
|
-
|
|
1556
|
+
a.remove.show = !1;
|
|
1545
1557
|
},
|
|
1546
1558
|
/** 打开删除弹窗并设置待删除项 */
|
|
1547
1559
|
open: (t) => {
|
|
1548
1560
|
if (t.length === 0) {
|
|
1549
|
-
|
|
1561
|
+
O.fail(w.tCurd("selectDataToDelete"));
|
|
1550
1562
|
return;
|
|
1551
1563
|
}
|
|
1552
|
-
|
|
1564
|
+
a.remove.items = t, a.remove.show = !0;
|
|
1553
1565
|
},
|
|
1554
1566
|
/** 执行删除实际操作 */
|
|
1555
1567
|
submit: () => {
|
|
1556
1568
|
FunUtil.throttle(async () => {
|
|
1557
|
-
|
|
1569
|
+
a.remove.loading = !0;
|
|
1558
1570
|
const t = i.option.api.delete;
|
|
1559
1571
|
try {
|
|
1560
1572
|
if (!t) return;
|
|
1561
1573
|
await t({
|
|
1562
|
-
[i.option.table?.rowKey]:
|
|
1563
|
-
items:
|
|
1564
|
-
}),
|
|
1574
|
+
[i.option.table?.rowKey]: a.remove.items.map((e) => e[i.option.table?.rowKey]),
|
|
1575
|
+
items: a.remove.items
|
|
1576
|
+
}), O.success(w.tCurd("operationSuccess")), a.table.data.length <= 1 && a.page.num > 1 && (a.page.num -= 1), a.remove.close(), await a.table.getList();
|
|
1565
1577
|
} catch (e) {
|
|
1566
1578
|
console.error(e);
|
|
1567
1579
|
} finally {
|
|
1568
|
-
|
|
1580
|
+
a.remove.loading = !1;
|
|
1569
1581
|
}
|
|
1570
1582
|
});
|
|
1571
1583
|
}
|
|
1572
1584
|
},
|
|
1573
1585
|
/** 初始化curd关联所有默认与依赖配置及表单列 */
|
|
1574
1586
|
init: () => {
|
|
1575
|
-
|
|
1587
|
+
a.initCurdConfig(), a.initColumnOptions(), a.initColumnForm();
|
|
1576
1588
|
},
|
|
1577
1589
|
/** 下拉请求等数据缓存 */
|
|
1578
1590
|
apiDataMap: {},
|
|
@@ -1584,13 +1596,13 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1584
1596
|
return;
|
|
1585
1597
|
}
|
|
1586
1598
|
if (s.options?.[s.type]?.dataApi && s.options?.[s.type]?.dataApiConfig?.[t]) {
|
|
1587
|
-
if (
|
|
1599
|
+
if (a.apiDataMap[s.key] && s.options?.[s.type]?.dataApiConfig?.once) return;
|
|
1588
1600
|
const m = (async () => {
|
|
1589
1601
|
try {
|
|
1590
|
-
let p = await s.options?.[s.type]?.dataApi?.(
|
|
1602
|
+
let p = await s.options?.[s.type]?.dataApi?.(a.update.form, a.update.type);
|
|
1591
1603
|
if (p) {
|
|
1592
1604
|
const u = s.options?.[s.type]?.dataPath;
|
|
1593
|
-
!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,
|
|
1605
|
+
!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;
|
|
1594
1606
|
}
|
|
1595
1607
|
} catch {
|
|
1596
1608
|
}
|
|
@@ -1631,7 +1643,7 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1631
1643
|
for (const s in t) {
|
|
1632
1644
|
if (s === "table") {
|
|
1633
1645
|
if (r.table = ObjectUtil.deepMerge(t.table, r.table || {}), r.children) {
|
|
1634
|
-
|
|
1646
|
+
r.children.forEach((p) => {
|
|
1635
1647
|
e(p);
|
|
1636
1648
|
});
|
|
1637
1649
|
return;
|
|
@@ -1667,11 +1679,11 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1667
1679
|
} finally {
|
|
1668
1680
|
p.loadingMap[u].loading = !1;
|
|
1669
1681
|
}
|
|
1670
|
-
return
|
|
1682
|
+
return O.success(w.tCurd("operationSuccess")), p.tableConfig?.loadList && (a.table.loading = !0, a.table.getList(), a.table.loading = !1), !0;
|
|
1671
1683
|
} catch (u) {
|
|
1672
1684
|
return console.error(u), !1;
|
|
1673
1685
|
} finally {
|
|
1674
|
-
|
|
1686
|
+
a.table.loading = !1;
|
|
1675
1687
|
}
|
|
1676
1688
|
} catch {
|
|
1677
1689
|
return !1;
|
|
@@ -1682,7 +1694,7 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1682
1694
|
},
|
|
1683
1695
|
getColumnSpan: (t, e) => {
|
|
1684
1696
|
if (t.item.form?.spanCol) {
|
|
1685
|
-
const r = F.config.form.defaultSpan, m = e.filter((p) => !
|
|
1697
|
+
const r = F.config.form.defaultSpan, m = e.filter((p) => !O.isFun(p.item.show?.form, a.update.form, a.update.type)).reduce((p, u) => p + (u.item.form?.span || r), 0);
|
|
1686
1698
|
return (t.item?.form.span || r) + m;
|
|
1687
1699
|
}
|
|
1688
1700
|
return t.item.form.span;
|
|
@@ -1690,7 +1702,7 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1690
1702
|
/** 初始化配置并生成表单列及默认值及规则 */
|
|
1691
1703
|
initColumnForm: () => {
|
|
1692
1704
|
const t = i.option;
|
|
1693
|
-
|
|
1705
|
+
a.update.formColumn = [], a.table.column.show = {
|
|
1694
1706
|
list: [],
|
|
1695
1707
|
listSource: []
|
|
1696
1708
|
};
|
|
@@ -1698,12 +1710,12 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1698
1710
|
let m = [];
|
|
1699
1711
|
const p = (c) => {
|
|
1700
1712
|
if (c.children) {
|
|
1701
|
-
|
|
1713
|
+
a.table.column.show.list.push(c.key), c.children.forEach(($) => {
|
|
1702
1714
|
p($);
|
|
1703
1715
|
});
|
|
1704
1716
|
return;
|
|
1705
1717
|
}
|
|
1706
|
-
if (
|
|
1718
|
+
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) {
|
|
1707
1719
|
c.form = c.form || { span: s }, c.form.span = c.form.span ?? s;
|
|
1708
1720
|
let $ = c.form.span, B = m.reduce((j, H) => j + H.span, $);
|
|
1709
1721
|
const R = m.length;
|
|
@@ -1718,12 +1730,12 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1718
1730
|
trigger: "blur"
|
|
1719
1731
|
}
|
|
1720
1732
|
] : c.rules;
|
|
1721
|
-
|
|
1733
|
+
a.update.rules[c.key] = le.map((te) => {
|
|
1722
1734
|
if (te.validator) {
|
|
1723
1735
|
const we = te.validator;
|
|
1724
1736
|
return {
|
|
1725
1737
|
...te,
|
|
1726
|
-
validator: (ke, ve, Ce) => we(ke, ve, Ce,
|
|
1738
|
+
validator: (ke, ve, Ce) => we(ke, ve, Ce, a.update.form)
|
|
1727
1739
|
};
|
|
1728
1740
|
}
|
|
1729
1741
|
return te;
|
|
@@ -1737,24 +1749,24 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1737
1749
|
c.isForm = !0, u(c, !0), p(c);
|
|
1738
1750
|
}), i.option.table?.column?.forEach((c) => {
|
|
1739
1751
|
u(c, !1), p(c);
|
|
1740
|
-
}),
|
|
1752
|
+
}), 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;
|
|
1741
1753
|
const k = i.option.search?.formDefault;
|
|
1742
1754
|
k && Object.keys(k).forEach((c) => {
|
|
1743
|
-
|
|
1755
|
+
a.search.formDefault[c] = k[c];
|
|
1744
1756
|
}), t.column.forEach((c) => {
|
|
1745
|
-
c.show?.search || (
|
|
1757
|
+
c.show?.search || (a.search.formDefault[c.key] = void 0);
|
|
1746
1758
|
});
|
|
1747
|
-
const h = ObjectUtil.deepMerge(
|
|
1748
|
-
x.setValue(
|
|
1759
|
+
const h = ObjectUtil.deepMerge(a.search.formDefault, {});
|
|
1760
|
+
x.setValue(a.search.form, h, !0);
|
|
1749
1761
|
}
|
|
1750
1762
|
});
|
|
1751
|
-
return
|
|
1752
|
-
i.option.init !== !1 &&
|
|
1763
|
+
return a.init(), ye(() => {
|
|
1764
|
+
i.option.init !== !1 && a.table.getList();
|
|
1753
1765
|
}), i.form && ce(
|
|
1754
|
-
() =>
|
|
1766
|
+
() => a.update.form,
|
|
1755
1767
|
(t) => {
|
|
1756
|
-
Object.keys(
|
|
1757
|
-
i.form[e] =
|
|
1768
|
+
Object.keys(a.update.form).forEach((e) => {
|
|
1769
|
+
i.form[e] = a.update.form[e];
|
|
1758
1770
|
});
|
|
1759
1771
|
},
|
|
1760
1772
|
{
|
|
@@ -1762,26 +1774,26 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1762
1774
|
immediate: !0
|
|
1763
1775
|
}
|
|
1764
1776
|
), i.searchForm && ce(
|
|
1765
|
-
() =>
|
|
1777
|
+
() => a.search.form,
|
|
1766
1778
|
(t) => {
|
|
1767
|
-
Object.keys(
|
|
1768
|
-
i.searchForm[e] =
|
|
1779
|
+
Object.keys(a.search.form).forEach((e) => {
|
|
1780
|
+
i.searchForm[e] = a.search.form[e];
|
|
1769
1781
|
});
|
|
1770
1782
|
},
|
|
1771
1783
|
{
|
|
1772
1784
|
deep: !0,
|
|
1773
1785
|
immediate: !0
|
|
1774
1786
|
}
|
|
1775
|
-
), { conf:
|
|
1787
|
+
), { conf: a, switchConfirmRef: o, ruleFormRef: f, tableRef: n };
|
|
1776
1788
|
}, qe = { class: "dialog-footer" }, Qe = /* @__PURE__ */ N({
|
|
1777
1789
|
__name: "switchConfirm",
|
|
1778
1790
|
props: {
|
|
1779
1791
|
size: {}
|
|
1780
1792
|
},
|
|
1781
1793
|
setup(i, { expose: o }) {
|
|
1782
|
-
const f = J(!1), n = J("确认修改"),
|
|
1794
|
+
const f = J(!1), n = J("确认修改"), a = J("确认要修改状态吗?");
|
|
1783
1795
|
let t = null, e = null;
|
|
1784
|
-
const r = (p) => (p?.title && (n.value = p.title), p?.content && (
|
|
1796
|
+
const r = (p) => (p?.title && (n.value = p.title), p?.content && (a.value = p.content), f.value = !0, new Promise((u, k) => {
|
|
1785
1797
|
t = u, e = k;
|
|
1786
1798
|
})), s = () => {
|
|
1787
1799
|
f.value = !1, t?.(!0), t = null, e = null;
|
|
@@ -1792,7 +1804,7 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1792
1804
|
open: r
|
|
1793
1805
|
}), (p, u) => {
|
|
1794
1806
|
const k = ee("el-form");
|
|
1795
|
-
return d(), y(
|
|
1807
|
+
return d(), y(l(ie), {
|
|
1796
1808
|
modelValue: f.value,
|
|
1797
1809
|
"onUpdate:modelValue": u[0] || (u[0] = (h) => f.value = h),
|
|
1798
1810
|
title: n.value,
|
|
@@ -1800,16 +1812,16 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1800
1812
|
width: "400px"
|
|
1801
1813
|
}, {
|
|
1802
1814
|
footer: g(() => [
|
|
1803
|
-
|
|
1815
|
+
U(k, { size: p.size }, {
|
|
1804
1816
|
default: g(() => [
|
|
1805
|
-
|
|
1806
|
-
|
|
1817
|
+
S("span", qe, [
|
|
1818
|
+
U(l(T), { onClick: m }, {
|
|
1807
1819
|
default: g(() => u[1] || (u[1] = [
|
|
1808
1820
|
E("取消")
|
|
1809
1821
|
])),
|
|
1810
1822
|
_: 1
|
|
1811
1823
|
}),
|
|
1812
|
-
|
|
1824
|
+
U(l(T), {
|
|
1813
1825
|
type: "primary",
|
|
1814
1826
|
onClick: s
|
|
1815
1827
|
}, {
|
|
@@ -1824,7 +1836,7 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1824
1836
|
}, 8, ["size"])
|
|
1825
1837
|
]),
|
|
1826
1838
|
default: g(() => [
|
|
1827
|
-
|
|
1839
|
+
S("div", null, M(a.value), 1)
|
|
1828
1840
|
]),
|
|
1829
1841
|
_: 1
|
|
1830
1842
|
}, 8, ["modelValue", "title"]);
|
|
@@ -1832,8 +1844,8 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1832
1844
|
}
|
|
1833
1845
|
}), Y = (i, o) => {
|
|
1834
1846
|
const f = i.__vccOpts || i;
|
|
1835
|
-
for (const [n,
|
|
1836
|
-
f[n] =
|
|
1847
|
+
for (const [n, a] of o)
|
|
1848
|
+
f[n] = a;
|
|
1837
1849
|
return f;
|
|
1838
1850
|
}, Ge = {}, Xe = {
|
|
1839
1851
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1841,7 +1853,7 @@ const K = M.EDialog, Je = (i) => {
|
|
|
1841
1853
|
};
|
|
1842
1854
|
function Ye(i, o) {
|
|
1843
1855
|
return d(), b("svg", Xe, o[0] || (o[0] = [
|
|
1844
|
-
|
|
1856
|
+
S("path", {
|
|
1845
1857
|
fill: "currentColor",
|
|
1846
1858
|
d: "M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"
|
|
1847
1859
|
}, null, -1)
|
|
@@ -1855,7 +1867,7 @@ const Ze = /* @__PURE__ */ Y(Ge, [["render", Ye]]), xe = ["innerHTML"], _e = /*
|
|
|
1855
1867
|
},
|
|
1856
1868
|
setup(i) {
|
|
1857
1869
|
const o = i, f = be(() => typeof o.content == "function" ? o.content(o.value) : o.content);
|
|
1858
|
-
return (n,
|
|
1870
|
+
return (n, a) => typeof f.value == "object" ? (d(), y(q(f.value), { key: 0 })) : (d(), b("div", {
|
|
1859
1871
|
key: 1,
|
|
1860
1872
|
innerHTML: f.value
|
|
1861
1873
|
}, null, 8, xe));
|
|
@@ -1867,7 +1879,7 @@ const Ze = /* @__PURE__ */ Y(Ge, [["render", Ye]]), xe = ["innerHTML"], _e = /*
|
|
|
1867
1879
|
};
|
|
1868
1880
|
function ot(i, o) {
|
|
1869
1881
|
return d(), b("svg", tt, o[0] || (o[0] = [
|
|
1870
|
-
|
|
1882
|
+
S("path", {
|
|
1871
1883
|
fill: "currentColor",
|
|
1872
1884
|
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m23.744 191.488c-52.096 0-92.928 14.784-123.2 44.352-30.976 29.568-45.76 70.4-45.76 122.496h80.256c0-29.568 5.632-52.8 17.6-68.992 13.376-19.712 35.2-28.864 66.176-28.864 23.936 0 42.944 6.336 56.32 19.712 12.672 13.376 19.712 31.68 19.712 54.912 0 17.6-6.336 34.496-19.008 49.984l-8.448 9.856c-45.76 40.832-73.216 70.4-82.368 89.408-9.856 19.008-14.08 42.24-14.08 68.992v9.856h80.96v-9.856c0-16.896 3.52-31.68 10.56-45.76 6.336-12.672 15.488-24.64 28.16-35.2 33.792-29.568 54.208-48.576 60.544-55.616 16.896-22.528 26.048-51.392 26.048-86.592q0-64.416-42.24-101.376c-28.16-25.344-65.472-37.312-111.232-37.312m-12.672 406.208a54.27 54.27 0 0 0-38.72 14.784 49.4 49.4 0 0 0-15.488 38.016c0 15.488 4.928 28.16 15.488 38.016A54.85 54.85 0 0 0 523.072 768c15.488 0 28.16-4.928 38.72-14.784a51.52 51.52 0 0 0 16.192-38.72 51.97 51.97 0 0 0-15.488-38.016 55.94 55.94 0 0 0-39.424-14.784"
|
|
1873
1885
|
}, null, -1)
|
|
@@ -1880,7 +1892,7 @@ const at = /* @__PURE__ */ Y(et, [["render", ot]]), lt = {}, nt = {
|
|
|
1880
1892
|
};
|
|
1881
1893
|
function it(i, o) {
|
|
1882
1894
|
return d(), b("svg", nt, o[0] || (o[0] = [
|
|
1883
|
-
|
|
1895
|
+
S("path", {
|
|
1884
1896
|
fill: "currentColor",
|
|
1885
1897
|
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-38.4 409.6H326.4a38.4 38.4 0 1 0 0 76.8h147.2v147.2a38.4 38.4 0 0 0 76.8 0V550.4h147.2a38.4 38.4 0 0 0 0-76.8H550.4V326.4a38.4 38.4 0 1 0-76.8 0z"
|
|
1886
1898
|
}, null, -1)
|
|
@@ -1893,7 +1905,7 @@ const rt = /* @__PURE__ */ Y(lt, [["render", it]]), st = {}, dt = {
|
|
|
1893
1905
|
};
|
|
1894
1906
|
function ut(i, o) {
|
|
1895
1907
|
return d(), b("svg", dt, o[0] || (o[0] = [
|
|
1896
|
-
|
|
1908
|
+
S("path", {
|
|
1897
1909
|
fill: "currentColor",
|
|
1898
1910
|
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896M288 512a38.4 38.4 0 0 0 38.4 38.4h371.2a38.4 38.4 0 0 0 0-76.8H326.4A38.4 38.4 0 0 0 288 512"
|
|
1899
1911
|
}, null, -1)
|
|
@@ -1907,14 +1919,14 @@ const ft = /* @__PURE__ */ Y(st, [["render", ut]]), pt = { class: "row flex-cent
|
|
|
1907
1919
|
option: {}
|
|
1908
1920
|
},
|
|
1909
1921
|
setup(i) {
|
|
1910
|
-
const o =
|
|
1911
|
-
return (n,
|
|
1922
|
+
const o = O.isFun, f = Oe().type;
|
|
1923
|
+
return (n, a) => {
|
|
1912
1924
|
const t = ee("el-tooltip");
|
|
1913
1925
|
return d(!0), b(D, null, A(n.columnList, (e) => (d(), b(D, {
|
|
1914
1926
|
key: e.key
|
|
1915
1927
|
}, [
|
|
1916
|
-
n.conf.table.column.show.list.includes(e.key) && (e.show?.table === void 0 ||
|
|
1917
|
-
e.table?.header?.groupKey === void 0 || e.table.header.show ? (d(), y(
|
|
1928
|
+
n.conf.table.column.show.list.includes(e.key) && (e.show?.table === void 0 || l(o)(e.show?.table, n.conf.table.data)) ? (d(), b(D, { key: 0 }, [
|
|
1929
|
+
e.table?.header?.groupKey === void 0 || e.table.header.show ? (d(), y(l(oe), C({
|
|
1918
1930
|
key: 0,
|
|
1919
1931
|
prop: e.key,
|
|
1920
1932
|
label: e.label,
|
|
@@ -1922,25 +1934,25 @@ const ft = /* @__PURE__ */ Y(st, [["render", ut]]), pt = { class: "row flex-cent
|
|
|
1922
1934
|
}, e.table), {
|
|
1923
1935
|
header: g(() => [
|
|
1924
1936
|
V(n.$slots, "table-header-" + e.key, { item: e }, () => [
|
|
1925
|
-
|
|
1937
|
+
S("div", pt, [
|
|
1926
1938
|
e.table?.header?.tooltip ? (d(), y(t, {
|
|
1927
1939
|
key: 0,
|
|
1928
1940
|
effect: "dark",
|
|
1929
1941
|
placement: "top"
|
|
1930
1942
|
}, {
|
|
1931
1943
|
content: g(() => [
|
|
1932
|
-
|
|
1944
|
+
S("div", {
|
|
1933
1945
|
innerHTML: e.table?.header?.tooltip
|
|
1934
1946
|
}, null, 8, mt)
|
|
1935
1947
|
]),
|
|
1936
1948
|
default: g(() => [
|
|
1937
|
-
|
|
1938
|
-
|
|
1949
|
+
S("span", ct, [
|
|
1950
|
+
U(at)
|
|
1939
1951
|
])
|
|
1940
1952
|
]),
|
|
1941
1953
|
_: 2
|
|
1942
1954
|
}, 1024)) : v("", !0),
|
|
1943
|
-
E(" " +
|
|
1955
|
+
E(" " + M(e.label) + " ", 1),
|
|
1944
1956
|
e.table?.header?.group !== void 0 ? (d(), b("span", {
|
|
1945
1957
|
key: 1,
|
|
1946
1958
|
class: "table-header-plus",
|
|
@@ -1960,8 +1972,8 @@ const ft = /* @__PURE__ */ Y(st, [["render", ut]]), pt = { class: "row flex-cent
|
|
|
1960
1972
|
]),
|
|
1961
1973
|
default: g(({ row: r }) => [
|
|
1962
1974
|
e.children ? (d(), b(D, { key: 0 }, [
|
|
1963
|
-
|
|
1964
|
-
(d(), y(q(
|
|
1975
|
+
a[0] || (a[0] = E(" ")),
|
|
1976
|
+
(d(), y(q(l(f)), {
|
|
1965
1977
|
conf: n.conf,
|
|
1966
1978
|
columnList: e.children,
|
|
1967
1979
|
option: n.option
|
|
@@ -1983,7 +1995,7 @@ const ft = /* @__PURE__ */ Y(st, [["render", ut]]), pt = { class: "row flex-cent
|
|
|
1983
1995
|
row: r,
|
|
1984
1996
|
item: e
|
|
1985
1997
|
}),
|
|
1986
|
-
e.type === "input" ? (d(), y(
|
|
1998
|
+
e.type === "input" ? (d(), y(l(_), C({
|
|
1987
1999
|
key: 0,
|
|
1988
2000
|
modelValue: r[e.key],
|
|
1989
2001
|
"onUpdate:modelValue": (s) => r[e.key] = s,
|
|
@@ -1994,11 +2006,11 @@ const ft = /* @__PURE__ */ Y(st, [["render", ut]]), pt = { class: "row flex-cent
|
|
|
1994
2006
|
e.options?.input?.prepend ? {
|
|
1995
2007
|
name: "prepend",
|
|
1996
2008
|
fn: g(() => [
|
|
1997
|
-
E(
|
|
2009
|
+
E(M(typeof e.options?.input?.prepend == "function" ? e.options?.input?.prepend(r) : e.options?.input?.prepend), 1)
|
|
1998
2010
|
]),
|
|
1999
2011
|
key: "0"
|
|
2000
2012
|
} : void 0
|
|
2001
|
-
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "select" ? (d(), y(
|
|
2013
|
+
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "select" ? (d(), y(l(X), C({
|
|
2002
2014
|
key: 1,
|
|
2003
2015
|
modelValue: r[e.key],
|
|
2004
2016
|
"onUpdate:modelValue": (s) => r[e.key] = s,
|
|
@@ -2007,14 +2019,14 @@ const ft = /* @__PURE__ */ Y(st, [["render", ut]]), pt = { class: "row flex-cent
|
|
|
2007
2019
|
ref_for: !0
|
|
2008
2020
|
}, n.conf.update.getBind(e), z(n.conf.update.getOn(e, r))), {
|
|
2009
2021
|
default: g(() => [
|
|
2010
|
-
(d(!0), b(D, null, A(e.options?.search?.select?.data || e.options?.select?.data, (s) => (d(), y(
|
|
2022
|
+
(d(!0), b(D, null, A(e.options?.search?.select?.data || e.options?.select?.data, (s) => (d(), y(l(W), {
|
|
2011
2023
|
key: s.value,
|
|
2012
2024
|
label: s.label,
|
|
2013
2025
|
value: s.value
|
|
2014
2026
|
}, null, 8, ["label", "value"]))), 128))
|
|
2015
2027
|
]),
|
|
2016
2028
|
_: 2
|
|
2017
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "switch" ? (d(), y(
|
|
2029
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "switch" ? (d(), y(l(Z), C({
|
|
2018
2030
|
key: 2,
|
|
2019
2031
|
modelValue: r[e.key],
|
|
2020
2032
|
"onUpdate:modelValue": (s) => r[e.key] = s,
|
|
@@ -2027,8 +2039,8 @@ const ft = /* @__PURE__ */ Y(st, [["render", ut]]), pt = { class: "row flex-cent
|
|
|
2027
2039
|
item: e
|
|
2028
2040
|
})
|
|
2029
2041
|
], 2)) : (d(), b(D, { key: 1 }, [
|
|
2030
|
-
n.conf.update.type ===
|
|
2031
|
-
e.type === "input" ? (d(), y(
|
|
2042
|
+
n.conf.update.type === l(O).EDialog.Update && l(o)(e.show?.form, n.conf.update.form, l(O).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 }, [
|
|
2043
|
+
e.type === "input" ? (d(), y(l(_), C({
|
|
2032
2044
|
key: 0,
|
|
2033
2045
|
modelValue: n.conf.update.form[e.key],
|
|
2034
2046
|
"onUpdate:modelValue": (s) => n.conf.update.form[e.key] = s,
|
|
@@ -2038,11 +2050,11 @@ const ft = /* @__PURE__ */ Y(st, [["render", ut]]), pt = { class: "row flex-cent
|
|
|
2038
2050
|
e.options?.input?.prepend ? {
|
|
2039
2051
|
name: "prepend",
|
|
2040
2052
|
fn: g(() => [
|
|
2041
|
-
E(
|
|
2053
|
+
E(M(typeof e.options?.input?.prepend == "function" ? e.options?.input?.prepend(r) : e.options?.input?.prepend), 1)
|
|
2042
2054
|
]),
|
|
2043
2055
|
key: "0"
|
|
2044
2056
|
} : void 0
|
|
2045
|
-
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "select" ? (d(), y(
|
|
2057
|
+
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "select" ? (d(), y(l(X), C({
|
|
2046
2058
|
key: 1,
|
|
2047
2059
|
modelValue: n.conf.update.form[e.key],
|
|
2048
2060
|
"onUpdate:modelValue": (s) => n.conf.update.form[e.key] = s,
|
|
@@ -2050,14 +2062,14 @@ const ft = /* @__PURE__ */ Y(st, [["render", ut]]), pt = { class: "row flex-cent
|
|
|
2050
2062
|
ref_for: !0
|
|
2051
2063
|
}, n.conf.update.getBind(e), z(n.conf.update.getOn(e, r)), { style: { width: "100%" } }), {
|
|
2052
2064
|
default: g(() => [
|
|
2053
|
-
(d(!0), b(D, null, A(e.options?.search?.select?.data || e.options?.select?.data, (s) => (d(), y(
|
|
2065
|
+
(d(!0), b(D, null, A(e.options?.search?.select?.data || e.options?.select?.data, (s) => (d(), y(l(W), {
|
|
2054
2066
|
key: s.value,
|
|
2055
2067
|
label: s.label,
|
|
2056
2068
|
value: s.value
|
|
2057
2069
|
}, null, 8, ["label", "value"]))), 128))
|
|
2058
2070
|
]),
|
|
2059
2071
|
_: 2
|
|
2060
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "switch" ? (d(), y(
|
|
2072
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "switch" ? (d(), y(l(Z), C({
|
|
2061
2073
|
key: 2,
|
|
2062
2074
|
modelValue: n.conf.update.form[e.key],
|
|
2063
2075
|
"onUpdate:modelValue": (s) => n.conf.update.form[e.key] = s,
|
|
@@ -2070,20 +2082,20 @@ const ft = /* @__PURE__ */ Y(st, [["render", ut]]), pt = { class: "row flex-cent
|
|
|
2070
2082
|
row: r,
|
|
2071
2083
|
item: e
|
|
2072
2084
|
}, () => [
|
|
2073
|
-
|
|
2085
|
+
l(L).customComponent[e.type ?? ""]?.table ? (d(), y(q(l(L).customComponent[e.type ?? ""]?.table), C({
|
|
2074
2086
|
key: 0,
|
|
2075
2087
|
modelValue: r[e.key],
|
|
2076
2088
|
"onUpdate:modelValue": (s) => r[e.key] = s,
|
|
2077
2089
|
ref_for: !0
|
|
2078
2090
|
}, e.options?.[e.type ?? ""], z(e.options?.[e.type ?? ""]?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue"])) : e.type === "switch" ? (d(), b(D, { key: 1 }, [
|
|
2079
|
-
e.options?.switch?.tableConfig?.change ? (d(), y(
|
|
2091
|
+
e.options?.switch?.tableConfig?.change ? (d(), y(l(Z), C({
|
|
2080
2092
|
key: 0,
|
|
2081
2093
|
modelValue: r[e.key],
|
|
2082
2094
|
"onUpdate:modelValue": (s) => r[e.key] = s,
|
|
2083
2095
|
loading: e.options?.switch?.loadingMap?.[r[n.option.table?.rowKey]]?.loading,
|
|
2084
2096
|
"before-change": () => e.options?.switch?.tableBeforeChange?.(e.key, r),
|
|
2085
2097
|
ref_for: !0
|
|
2086
|
-
}, e.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "loading", "before-change"])) : (d(), b("span", yt,
|
|
2098
|
+
}, e.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "loading", "before-change"])) : (d(), b("span", yt, M(r[e.key] === e.options?.switch?.activeValue ? e.options?.switch?.activeText : e.options?.switch?.inactiveText), 1))
|
|
2087
2099
|
], 64)) : (d(), b("span", {
|
|
2088
2100
|
key: 2,
|
|
2089
2101
|
style: ge({
|
|
@@ -2113,24 +2125,24 @@ const ft = /* @__PURE__ */ Y(st, [["render", ut]]), pt = { class: "row flex-cent
|
|
|
2113
2125
|
item: {}
|
|
2114
2126
|
},
|
|
2115
2127
|
setup(i) {
|
|
2116
|
-
return (o, f) => (d(), y(
|
|
2128
|
+
return (o, f) => (d(), y(l(ae), {
|
|
2117
2129
|
label: o.item.item.text?.form?.label ?? o.item.item.label,
|
|
2118
2130
|
prop: o.item.item.key,
|
|
2119
2131
|
"label-width": o.item.item.text?.form?.label == "" ? 0 : o.item.item.form?.labelWidth || o.conf.option.form?.labelWidth
|
|
2120
2132
|
}, {
|
|
2121
2133
|
default: g(() => [
|
|
2122
|
-
|
|
2134
|
+
S("div", wt, [
|
|
2123
2135
|
V(o.$slots, "form-" + o.item.item.key + "-start", {
|
|
2124
2136
|
row: o.conf.update.form,
|
|
2125
2137
|
item: o.item.item
|
|
2126
2138
|
}),
|
|
2127
|
-
|
|
2128
|
-
|
|
2139
|
+
S("div", kt, [
|
|
2140
|
+
S("div", vt, [
|
|
2129
2141
|
V(o.$slots, "form-" + o.item.item.key, {
|
|
2130
2142
|
row: o.conf.update.form,
|
|
2131
2143
|
item: o.item.item
|
|
2132
2144
|
}, () => [
|
|
2133
|
-
o.item.item.type === "input" ? (d(), y(
|
|
2145
|
+
o.item.item.type === "input" ? (d(), y(l(_), C({
|
|
2134
2146
|
key: 0,
|
|
2135
2147
|
modelValue: o.conf.update.form[o.item.item.key],
|
|
2136
2148
|
"onUpdate:modelValue": f[0] || (f[0] = (n) => o.conf.update.form[o.item.item.key] = n)
|
|
@@ -2140,17 +2152,17 @@ const ft = /* @__PURE__ */ Y(st, [["render", ut]]), pt = { class: "row flex-cent
|
|
|
2140
2152
|
o.item.item.options?.input?.prepend ? {
|
|
2141
2153
|
name: "prepend",
|
|
2142
2154
|
fn: g(() => [
|
|
2143
|
-
E(
|
|
2155
|
+
E(M(typeof o.item.item.options?.input?.prepend == "function" ? o.item.item.options?.input?.prepend(o.conf.update.form) : o.item.item.options?.input?.prepend), 1)
|
|
2144
2156
|
]),
|
|
2145
2157
|
key: "0"
|
|
2146
2158
|
} : void 0
|
|
2147
|
-
]), 1040, ["modelValue", "disabled"])) : o.item.item.type === "switch" ? (d(), y(
|
|
2159
|
+
]), 1040, ["modelValue", "disabled"])) : o.item.item.type === "switch" ? (d(), y(l(Z), C({
|
|
2148
2160
|
key: 1,
|
|
2149
2161
|
modelValue: o.conf.update.form[o.item.item.key],
|
|
2150
2162
|
"onUpdate:modelValue": f[1] || (f[1] = (n) => o.conf.update.form[o.item.item.key] = n)
|
|
2151
2163
|
}, o.conf.update.getBind(o.item.item), z(o.conf.update.getOn(o.item.item)), {
|
|
2152
2164
|
disabled: o.conf.update.getDisabled(o.item.item)
|
|
2153
|
-
}), null, 16, ["modelValue", "disabled"])) : o.item.item.type === "select" ? (d(), y(
|
|
2165
|
+
}), null, 16, ["modelValue", "disabled"])) : o.item.item.type === "select" ? (d(), y(l(X), C({
|
|
2154
2166
|
key: 2,
|
|
2155
2167
|
modelValue: o.conf.update.form[o.item.item.key],
|
|
2156
2168
|
"onUpdate:modelValue": f[2] || (f[2] = (n) => o.conf.update.form[o.item.item.key] = n)
|
|
@@ -2159,13 +2171,13 @@ const ft = /* @__PURE__ */ Y(st, [["render", ut]]), pt = { class: "row flex-cent
|
|
|
2159
2171
|
style: { width: "100%" }
|
|
2160
2172
|
}), {
|
|
2161
2173
|
default: g(() => [
|
|
2162
|
-
(d(!0), b(D, null, A(o.conf.update.getBind(o.item.item).data, (n) => (d(), y(
|
|
2174
|
+
(d(!0), b(D, null, A(o.conf.update.getBind(o.item.item).data, (n) => (d(), y(l(W), C({
|
|
2163
2175
|
key: n.value,
|
|
2164
2176
|
ref_for: !0
|
|
2165
2177
|
}, n, z(n.on || {})), null, 16))), 128))
|
|
2166
2178
|
]),
|
|
2167
2179
|
_: 1
|
|
2168
|
-
}, 16, ["modelValue", "disabled"])) : o.item.item.type === "radio" ? (d(), y(
|
|
2180
|
+
}, 16, ["modelValue", "disabled"])) : o.item.item.type === "radio" ? (d(), y(l(re), C({
|
|
2169
2181
|
key: 3,
|
|
2170
2182
|
modelValue: o.conf.update.form[o.item.item.key],
|
|
2171
2183
|
"onUpdate:modelValue": f[3] || (f[3] = (n) => o.conf.update.form[o.item.item.key] = n)
|
|
@@ -2174,7 +2186,7 @@ const ft = /* @__PURE__ */ Y(st, [["render", ut]]), pt = { class: "row flex-cent
|
|
|
2174
2186
|
style: { width: "100%" }
|
|
2175
2187
|
}), {
|
|
2176
2188
|
default: g(() => [
|
|
2177
|
-
(d(!0), b(D, null, A(o.conf.update.getBind(o.item.item).data, (n) => (d(), y(
|
|
2189
|
+
(d(!0), b(D, null, A(o.conf.update.getBind(o.item.item).data, (n) => (d(), y(l(se), C({
|
|
2178
2190
|
key: n.value,
|
|
2179
2191
|
ref_for: !0
|
|
2180
2192
|
}, n, z(n.on || {})), null, 16))), 128))
|
|
@@ -2187,20 +2199,20 @@ const ft = /* @__PURE__ */ Y(st, [["render", ut]]), pt = { class: "row flex-cent
|
|
|
2187
2199
|
}, o.conf.update.getBind(o.item.item), z(o.conf.update.getOn(o.item.item)), {
|
|
2188
2200
|
disabled: o.conf.update.getDisabled(o.item.item),
|
|
2189
2201
|
style: { width: "100%" }
|
|
2190
|
-
}), null, 16, ["row", "field", "disabled"])) : o.item.item.type === "treeSelect" ? (d(), y(
|
|
2202
|
+
}), null, 16, ["row", "field", "disabled"])) : o.item.item.type === "treeSelect" ? (d(), y(l(he), C({
|
|
2191
2203
|
key: 5,
|
|
2192
2204
|
modelValue: o.conf.update.form[o.item.item.key],
|
|
2193
2205
|
"onUpdate:modelValue": f[4] || (f[4] = (n) => o.conf.update.form[o.item.item.key] = n)
|
|
2194
2206
|
}, o.conf.update.getBind(o.item.item), z(o.conf.update.getOn(o.item.item)), {
|
|
2195
2207
|
disabled: o.conf.update.getDisabled(o.item.item),
|
|
2196
2208
|
style: { width: "100%" }
|
|
2197
|
-
}), null, 16, ["modelValue", "disabled"])) : o.item.item.type === "datetime" ? (d(), y(
|
|
2209
|
+
}), null, 16, ["modelValue", "disabled"])) : o.item.item.type === "datetime" ? (d(), y(l(de), C({
|
|
2198
2210
|
key: 6,
|
|
2199
2211
|
modelValue: o.conf.update.form[o.item.item.key],
|
|
2200
2212
|
"onUpdate:modelValue": f[5] || (f[5] = (n) => o.conf.update.form[o.item.item.key] = n)
|
|
2201
2213
|
}, o.conf.update.getBind(o.item.item), z(o.conf.update.getOn(o.item.item)), {
|
|
2202
2214
|
disabled: o.conf.update.getDisabled(o.item.item)
|
|
2203
|
-
}), null, 16, ["modelValue", "disabled"])) : o.item.item.type && (
|
|
2215
|
+
}), null, 16, ["modelValue", "disabled"])) : o.item.item.type && (l(L).customComponent[o.item.item.type] || l(L).customComponent[o.item.item.type]?.form) ? (d(), y(q(l(L).customComponent[o.item.item.type]?.form || l(L).customComponent[o.item.item.type]), C({
|
|
2204
2216
|
key: 7,
|
|
2205
2217
|
modelValue: o.conf.update.form[o.item.item.key],
|
|
2206
2218
|
"onUpdate:modelValue": f[6] || (f[6] = (n) => o.conf.update.form[o.item.item.key] = n)
|
|
@@ -2239,7 +2251,7 @@ const ft = /* @__PURE__ */ Y(st, [["render", ut]]), pt = { class: "row flex-cent
|
|
|
2239
2251
|
};
|
|
2240
2252
|
function Dt(i, o) {
|
|
2241
2253
|
return d(), b("svg", $t, o[0] || (o[0] = [
|
|
2242
|
-
|
|
2254
|
+
S("path", {
|
|
2243
2255
|
fill: "currentColor",
|
|
2244
2256
|
d: "M482.2 508.4L331.3 389c-3-2.4-7.3-.2-7.3 3.6V478H184V184h204v128c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V144c0-15.5-12.5-28-28-28H144c-15.5 0-28 12.5-28 28v736c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v128H184V546h140v85.4c0 3.8 4.4 6 7.3 3.6l150.9-119.4a4.5 4.5 0 000-7.2zM880 116H596c-15.5 0-28 12.5-28 28v168c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V184h204v294H700v-85.4c0-3.8-4.3-6-7.3-3.6l-151 119.4a4.52 4.52 0 000 7.1l151 119.5c2.9 2.3 7.3.2 7.3-3.6V546h140v294H636V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v168c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V144c0-15.5-12.5-28-28-28z"
|
|
2245
2257
|
}, null, -1)
|
|
@@ -2251,7 +2263,7 @@ const Et = /* @__PURE__ */ Y(zt, [["render", Dt]]), Ot = {}, Ut = {
|
|
|
2251
2263
|
};
|
|
2252
2264
|
function St(i, o) {
|
|
2253
2265
|
return d(), b("svg", Ut, o[0] || (o[0] = [
|
|
2254
|
-
|
|
2266
|
+
S("path", {
|
|
2255
2267
|
fill: "currentColor",
|
|
2256
2268
|
d: "M180 176h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zm724 0h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zM785.3 504.3L657.7 403.6a7.23 7.23 0 00-11.7 5.7V476H378v-62.8c0-6-7-9.4-11.7-5.7L238.7 508.3a7.14 7.14 0 000 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h268v62.8c0 6 7 9.4 11.7 5.7l127.5-100.8c3.8-2.9 3.8-8.5.2-11.4z"
|
|
2257
2269
|
}, null, -1)
|
|
@@ -2271,77 +2283,77 @@ const Mt = /* @__PURE__ */ Y(Ot, [["render", St]]), me = /* @__PURE__ */ N({
|
|
|
2271
2283
|
o.item?.key !== void 0 && (o.conf.search.form[o.item.key] = n);
|
|
2272
2284
|
}
|
|
2273
2285
|
});
|
|
2274
|
-
return (n,
|
|
2286
|
+
return (n, a) => l(L).customComponent[n.type ?? ""]?.search ? (d(), y(q(l(L).customComponent[n.type ?? ""]?.search), C({
|
|
2275
2287
|
key: 0,
|
|
2276
2288
|
modelValue: f.value,
|
|
2277
|
-
"onUpdate:modelValue":
|
|
2278
|
-
}, n.item.options?.search?.[n.type ?? ""], z(n.item.options?.search?.[n.type ?? ""]?.on || {})), null, 16, ["modelValue"])) : n.type === "input" ? (d(), y(
|
|
2289
|
+
"onUpdate:modelValue": a[0] || (a[0] = (t) => f.value = t)
|
|
2290
|
+
}, n.item.options?.search?.[n.type ?? ""], z(n.item.options?.search?.[n.type ?? ""]?.on || {})), null, 16, ["modelValue"])) : n.type === "input" ? (d(), y(l(_), C({
|
|
2279
2291
|
key: 1,
|
|
2280
2292
|
modelValue: f.value,
|
|
2281
|
-
"onUpdate:modelValue":
|
|
2293
|
+
"onUpdate:modelValue": a[1] || (a[1] = (t) => f.value = t),
|
|
2282
2294
|
placeholder: n.conf.search.getPlaceholder(n.item),
|
|
2283
2295
|
clearable: "",
|
|
2284
2296
|
disabled: n.item.disabled?.search
|
|
2285
|
-
}, 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(
|
|
2297
|
+
}, 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({
|
|
2286
2298
|
key: 2,
|
|
2287
2299
|
modelValue: f.value,
|
|
2288
|
-
"onUpdate:modelValue":
|
|
2289
|
-
placeholder: n.conf.search.getPlaceholder(n.item,
|
|
2300
|
+
"onUpdate:modelValue": a[2] || (a[2] = (t) => f.value = t),
|
|
2301
|
+
placeholder: n.conf.search.getPlaceholder(n.item, l(w).tCurd("placeholderSelect")),
|
|
2290
2302
|
clearable: "",
|
|
2291
2303
|
disabled: n.item.disabled?.search
|
|
2292
2304
|
}, n.item.options?.search?.switch || n.item.options?.switch, z(n.item.options?.search?.switch?.on || n.item.options?.switch?.on || {})), {
|
|
2293
2305
|
default: g(() => [
|
|
2294
|
-
(d(), y(
|
|
2306
|
+
(d(), y(l(W), {
|
|
2295
2307
|
key: n.item.options?.switch?.activeValue,
|
|
2296
2308
|
label: n.item.options?.switch?.activeText,
|
|
2297
2309
|
value: n.item.options?.switch?.activeValue
|
|
2298
2310
|
}, null, 8, ["label", "value"])),
|
|
2299
|
-
(d(), y(
|
|
2311
|
+
(d(), y(l(W), {
|
|
2300
2312
|
key: n.item.options?.switch?.inactiveValue,
|
|
2301
2313
|
label: n.item.options?.switch?.inactiveText,
|
|
2302
2314
|
value: n.item.options?.switch?.inactiveValue
|
|
2303
2315
|
}, null, 8, ["label", "value"]))
|
|
2304
2316
|
]),
|
|
2305
2317
|
_: 1
|
|
2306
|
-
}, 16, ["modelValue", "placeholder", "disabled"])) : n.type === "select" ? (d(), y(
|
|
2318
|
+
}, 16, ["modelValue", "placeholder", "disabled"])) : n.type === "select" ? (d(), y(l(X), C({
|
|
2307
2319
|
key: 3,
|
|
2308
2320
|
modelValue: f.value,
|
|
2309
|
-
"onUpdate:modelValue":
|
|
2310
|
-
placeholder: n.conf.search.getPlaceholder(n.item,
|
|
2321
|
+
"onUpdate:modelValue": a[3] || (a[3] = (t) => f.value = t),
|
|
2322
|
+
placeholder: n.conf.search.getPlaceholder(n.item, l(w).tCurd("placeholderSelect")),
|
|
2311
2323
|
clearable: "",
|
|
2312
2324
|
disabled: n.item.disabled?.search
|
|
2313
2325
|
}, n.item.options?.search?.select || n.item.options?.select, z(n.item.options?.search?.select?.on || n.item.options?.select?.on || {})), {
|
|
2314
2326
|
default: g(() => [
|
|
2315
|
-
(d(!0), b(D, null, A(n.item.options?.search?.select?.data || n.item.options?.select?.data || [], (t) => (d(), y(
|
|
2327
|
+
(d(!0), b(D, null, A(n.item.options?.search?.select?.data || n.item.options?.select?.data || [], (t) => (d(), y(l(W), {
|
|
2316
2328
|
key: t.value,
|
|
2317
2329
|
label: t.label,
|
|
2318
2330
|
value: t.value
|
|
2319
2331
|
}, null, 8, ["label", "value"]))), 128))
|
|
2320
2332
|
]),
|
|
2321
2333
|
_: 1
|
|
2322
|
-
}, 16, ["modelValue", "placeholder", "disabled"])) : n.type === "radio" ? (d(), y(
|
|
2334
|
+
}, 16, ["modelValue", "placeholder", "disabled"])) : n.type === "radio" ? (d(), y(l(re), C({
|
|
2323
2335
|
key: 4,
|
|
2324
2336
|
modelValue: f.value,
|
|
2325
|
-
"onUpdate:modelValue":
|
|
2337
|
+
"onUpdate:modelValue": a[4] || (a[4] = (t) => f.value = t),
|
|
2326
2338
|
disabled: n.item.disabled?.search
|
|
2327
2339
|
}, n.item.options?.search?.radio || n.item.options?.radio, z(n.item.options?.search?.radio?.on || n.item.options?.radio?.on || {})), {
|
|
2328
2340
|
default: g(() => [
|
|
2329
|
-
(d(!0), b(D, null, A(n.item.options?.radio?.data, (t) => (d(), y(
|
|
2341
|
+
(d(!0), b(D, null, A(n.item.options?.radio?.data, (t) => (d(), y(l(se), {
|
|
2330
2342
|
key: t.value,
|
|
2331
2343
|
label: t.label,
|
|
2332
2344
|
value: t.value
|
|
2333
2345
|
}, null, 8, ["label", "value"]))), 128))
|
|
2334
2346
|
]),
|
|
2335
2347
|
_: 1
|
|
2336
|
-
}, 16, ["modelValue", "disabled"])) : n.type === "datetime" ? (d(), y(
|
|
2348
|
+
}, 16, ["modelValue", "disabled"])) : n.type === "datetime" ? (d(), y(l(de), C({
|
|
2337
2349
|
key: 5,
|
|
2338
2350
|
modelValue: f.value,
|
|
2339
|
-
"onUpdate:modelValue":
|
|
2351
|
+
"onUpdate:modelValue": a[5] || (a[5] = (t) => f.value = t),
|
|
2340
2352
|
disabled: n.item.disabled?.search
|
|
2341
|
-
}, 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 &&
|
|
2353
|
+
}, 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(L).customComponent[n.type] ? (d(), y(q(l(L).customComponent[n.type]), C({
|
|
2342
2354
|
key: 6,
|
|
2343
2355
|
modelValue: f.value,
|
|
2344
|
-
"onUpdate:modelValue":
|
|
2356
|
+
"onUpdate:modelValue": a[6] || (a[6] = (t) => f.value = t)
|
|
2345
2357
|
}, 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 || {}), {
|
|
2346
2358
|
disabled: n.item.disabled?.search
|
|
2347
2359
|
}), null, 16, ["modelValue", "disabled"])) : v("", !0);
|
|
@@ -2381,7 +2393,7 @@ const Mt = /* @__PURE__ */ Y(Ot, [["render", St]]), me = /* @__PURE__ */ N({
|
|
|
2381
2393
|
}
|
|
2382
2394
|
},
|
|
2383
2395
|
setup(i, { expose: o }) {
|
|
2384
|
-
const f =
|
|
2396
|
+
const f = O.EDialog, n = i, a = O.isFun, { conf: t, switchConfirmRef: e, ruleFormRef: r, tableRef: s } = Je(n);
|
|
2385
2397
|
return o({
|
|
2386
2398
|
conf: t
|
|
2387
2399
|
}), (m, p) => {
|
|
@@ -2389,84 +2401,84 @@ const Mt = /* @__PURE__ */ Y(Ot, [["render", St]]), me = /* @__PURE__ */ N({
|
|
|
2389
2401
|
return d(), b("div", {
|
|
2390
2402
|
class: I(["relative cc1-form-box", [i.option.table?.fitHeight ? "col" : "no-min-height"]])
|
|
2391
2403
|
}, [
|
|
2392
|
-
|
|
2404
|
+
S("div", {
|
|
2393
2405
|
class: I(["row", [i.option.table?.fitHeight ? "absolute fit" : ""]]),
|
|
2394
2406
|
style: { overflow: "hidden" }
|
|
2395
2407
|
}, [
|
|
2396
2408
|
V(m.$slots, "box-left"),
|
|
2397
|
-
|
|
2409
|
+
S("div", {
|
|
2398
2410
|
class: I(["column fit-width no-wrap", [i.option.table?.fitHeight ? "col" : ""]])
|
|
2399
2411
|
}, [
|
|
2400
2412
|
i.option.search?.show !== !1 ? (d(), b("div", Ft, [
|
|
2401
|
-
|
|
2402
|
-
model:
|
|
2413
|
+
U(l(Q), {
|
|
2414
|
+
model: l(t).search.form,
|
|
2403
2415
|
inline: "",
|
|
2404
2416
|
size: i.option.size?.search
|
|
2405
2417
|
}, {
|
|
2406
2418
|
default: g(() => [
|
|
2407
2419
|
V(m.$slots, "search-start", {
|
|
2408
|
-
row:
|
|
2420
|
+
row: l(t).search.form
|
|
2409
2421
|
}),
|
|
2410
|
-
(d(!0), b(D, null, A(
|
|
2422
|
+
(d(!0), b(D, null, A(l(t).search.column.list, (h) => (d(), b(D, {
|
|
2411
2423
|
key: h.key
|
|
2412
2424
|
}, [
|
|
2413
2425
|
V(m.$slots, "search-" + h.key + "-start", {
|
|
2414
|
-
row:
|
|
2426
|
+
row: l(t).search.form
|
|
2415
2427
|
}),
|
|
2416
|
-
(typeof h.show?.search == "function" ? h.show?.search(
|
|
2428
|
+
(typeof h.show?.search == "function" ? h.show?.search(l(t).search.form) : h.show?.search) ? (d(), y(l(ae), {
|
|
2417
2429
|
key: 0,
|
|
2418
2430
|
label: h.text?.search?.label ?? h.label
|
|
2419
2431
|
}, {
|
|
2420
2432
|
default: g(() => [
|
|
2421
2433
|
V(m.$slots, "search-" + h.key + "-left", {
|
|
2422
|
-
row:
|
|
2434
|
+
row: l(t).search.form
|
|
2423
2435
|
}),
|
|
2424
2436
|
V(m.$slots, "search-" + h.key, {
|
|
2425
|
-
row:
|
|
2437
|
+
row: l(t).search.form
|
|
2426
2438
|
}, () => [
|
|
2427
2439
|
h.options?.search?.type ? (d(), y(me, {
|
|
2428
2440
|
key: 0,
|
|
2429
2441
|
item: h,
|
|
2430
|
-
conf:
|
|
2442
|
+
conf: l(t),
|
|
2431
2443
|
type: h.options.search.type
|
|
2432
2444
|
}, null, 8, ["item", "conf", "type"])) : (d(), y(me, {
|
|
2433
2445
|
key: 1,
|
|
2434
2446
|
item: h,
|
|
2435
|
-
conf:
|
|
2447
|
+
conf: l(t),
|
|
2436
2448
|
type: h.type
|
|
2437
2449
|
}, null, 8, ["item", "conf", "type"]))
|
|
2438
2450
|
]),
|
|
2439
2451
|
V(m.$slots, "search-" + h.key + "-right", {
|
|
2440
|
-
row:
|
|
2452
|
+
row: l(t).search.form
|
|
2441
2453
|
})
|
|
2442
2454
|
]),
|
|
2443
2455
|
_: 2
|
|
2444
2456
|
}, 1032, ["label"])) : v("", !0),
|
|
2445
2457
|
V(m.$slots, "search-" + h.key + "-end", {
|
|
2446
|
-
row:
|
|
2458
|
+
row: l(t).search.form
|
|
2447
2459
|
})
|
|
2448
2460
|
], 64))), 128)),
|
|
2449
2461
|
V(m.$slots, "search-center", {
|
|
2450
|
-
row:
|
|
2462
|
+
row: l(t).search.form
|
|
2451
2463
|
}),
|
|
2452
|
-
i.option.tools?.search || i.option.tools?.reset ? (d(), y(
|
|
2464
|
+
i.option.tools?.search || i.option.tools?.reset ? (d(), y(l(ae), { key: 0 }, {
|
|
2453
2465
|
default: g(() => [
|
|
2454
|
-
i.option.tools?.search ? (d(), y(
|
|
2466
|
+
i.option.tools?.search ? (d(), y(l(T), {
|
|
2455
2467
|
key: 0,
|
|
2456
2468
|
type: "primary",
|
|
2457
|
-
onClick:
|
|
2469
|
+
onClick: l(t).search.submit
|
|
2458
2470
|
}, {
|
|
2459
2471
|
default: g(() => [
|
|
2460
|
-
E(
|
|
2472
|
+
E(M(l(w).tCurd("search")), 1)
|
|
2461
2473
|
]),
|
|
2462
2474
|
_: 1
|
|
2463
2475
|
}, 8, ["onClick"])) : v("", !0),
|
|
2464
|
-
i.option.tools?.reset ? (d(), y(
|
|
2476
|
+
i.option.tools?.reset ? (d(), y(l(T), {
|
|
2465
2477
|
key: 1,
|
|
2466
|
-
onClick:
|
|
2478
|
+
onClick: l(t).search.reset
|
|
2467
2479
|
}, {
|
|
2468
2480
|
default: g(() => [
|
|
2469
|
-
E(
|
|
2481
|
+
E(M(l(w).tCurd("reset")), 1)
|
|
2470
2482
|
]),
|
|
2471
2483
|
_: 1
|
|
2472
2484
|
}, 8, ["onClick"])) : v("", !0)
|
|
@@ -2474,84 +2486,84 @@ const Mt = /* @__PURE__ */ Y(Ot, [["render", St]]), me = /* @__PURE__ */ N({
|
|
|
2474
2486
|
_: 1
|
|
2475
2487
|
})) : v("", !0),
|
|
2476
2488
|
V(m.$slots, "search-end", {
|
|
2477
|
-
row:
|
|
2489
|
+
row: l(t).search.form
|
|
2478
2490
|
})
|
|
2479
2491
|
]),
|
|
2480
2492
|
_: 3
|
|
2481
2493
|
}, 8, ["model", "size"])
|
|
2482
2494
|
])) : v("", !0),
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
a
|
|
2486
|
-
|
|
2495
|
+
S("div", At, [
|
|
2496
|
+
S("div", Tt, [
|
|
2497
|
+
l(a)(i.option.tools?.add) ? (d(), b("div", jt, [
|
|
2498
|
+
U(l(T), {
|
|
2487
2499
|
type: "primary",
|
|
2488
|
-
onClick: p[0] || (p[0] = (h) =>
|
|
2500
|
+
onClick: p[0] || (p[0] = (h) => l(t).update.open(l(f).Add)),
|
|
2489
2501
|
size: i.option.size?.search
|
|
2490
2502
|
}, {
|
|
2491
2503
|
default: g(() => [
|
|
2492
|
-
E(
|
|
2504
|
+
E(M(l(w).tCurd("add")), 1)
|
|
2493
2505
|
]),
|
|
2494
2506
|
_: 1
|
|
2495
2507
|
}, 8, ["size"])
|
|
2496
2508
|
])) : v("", !0),
|
|
2497
|
-
i.option.table?.selectable && a
|
|
2498
|
-
|
|
2509
|
+
i.option.table?.selectable && l(a)(i.option.tools?.delete) ? (d(), b("div", Lt, [
|
|
2510
|
+
U(l(T), {
|
|
2499
2511
|
type: "danger",
|
|
2500
|
-
onClick: p[1] || (p[1] = (h) =>
|
|
2512
|
+
onClick: p[1] || (p[1] = (h) => l(t).remove.open(l(t).table.selection.list)),
|
|
2501
2513
|
size: i.option.size?.search
|
|
2502
2514
|
}, {
|
|
2503
2515
|
default: g(() => [
|
|
2504
|
-
E(
|
|
2516
|
+
E(M(l(w).tCurd("delete")), 1)
|
|
2505
2517
|
]),
|
|
2506
2518
|
_: 1
|
|
2507
2519
|
}, 8, ["size"])
|
|
2508
2520
|
])) : v("", !0),
|
|
2509
2521
|
i.option.tools?.expand ? (d(), b("div", Bt, [
|
|
2510
|
-
|
|
2522
|
+
U(l(T), {
|
|
2511
2523
|
type: "warning",
|
|
2512
|
-
onClick: p[2] || (p[2] = (h) =>
|
|
2524
|
+
onClick: p[2] || (p[2] = (h) => l(t).table.expand.all()),
|
|
2513
2525
|
size: i.option.size?.search
|
|
2514
2526
|
}, {
|
|
2515
2527
|
default: g(() => [
|
|
2516
|
-
E(
|
|
2528
|
+
E(M(l(w).tCurd("expandCollapse")), 1)
|
|
2517
2529
|
]),
|
|
2518
2530
|
_: 1
|
|
2519
2531
|
}, 8, ["size"])
|
|
2520
2532
|
])) : v("", !0),
|
|
2521
2533
|
i.option.tools?.export?.show ? (d(), b(D, { key: 3 }, [
|
|
2522
|
-
i.option.tools?.export?.dropdown?.show ? (d(), y(
|
|
2534
|
+
i.option.tools?.export?.dropdown?.show ? (d(), y(l($e), {
|
|
2523
2535
|
key: 0,
|
|
2524
|
-
onCommand:
|
|
2536
|
+
onCommand: l(t).export.click
|
|
2525
2537
|
}, {
|
|
2526
2538
|
dropdown: g(() => [
|
|
2527
|
-
|
|
2539
|
+
U(l(De), {
|
|
2528
2540
|
size: i.option.size?.search
|
|
2529
2541
|
}, {
|
|
2530
2542
|
default: g(() => [
|
|
2531
|
-
i.option.tools?.export?.dropdown?.select && (i.option.table?.selectable || a
|
|
2543
|
+
i.option.tools?.export?.dropdown?.select && (i.option.table?.selectable || l(a)(i.option.tools?.delete)) ? (d(), y(l(ne), {
|
|
2532
2544
|
key: 0,
|
|
2533
2545
|
command: "select"
|
|
2534
2546
|
}, {
|
|
2535
2547
|
default: g(() => [
|
|
2536
|
-
E(
|
|
2548
|
+
E(M(l(w).tCurd("exportSelect")), 1)
|
|
2537
2549
|
]),
|
|
2538
2550
|
_: 1
|
|
2539
2551
|
})) : v("", !0),
|
|
2540
|
-
i.option.tools?.export?.dropdown?.page ? (d(), y(
|
|
2552
|
+
i.option.tools?.export?.dropdown?.page ? (d(), y(l(ne), {
|
|
2541
2553
|
key: 1,
|
|
2542
2554
|
command: "page"
|
|
2543
2555
|
}, {
|
|
2544
2556
|
default: g(() => [
|
|
2545
|
-
E(
|
|
2557
|
+
E(M(l(w).tCurd("exportPage")), 1)
|
|
2546
2558
|
]),
|
|
2547
2559
|
_: 1
|
|
2548
2560
|
})) : v("", !0),
|
|
2549
|
-
i.option.tools?.export?.dropdown?.all ? (d(), y(
|
|
2561
|
+
i.option.tools?.export?.dropdown?.all ? (d(), y(l(ne), {
|
|
2550
2562
|
key: 2,
|
|
2551
2563
|
command: "all"
|
|
2552
2564
|
}, {
|
|
2553
2565
|
default: g(() => [
|
|
2554
|
-
E(
|
|
2566
|
+
E(M(l(w).tCurd("exportAll")), 1)
|
|
2555
2567
|
]),
|
|
2556
2568
|
_: 1
|
|
2557
2569
|
})) : v("", !0)
|
|
@@ -2560,14 +2572,14 @@ const Mt = /* @__PURE__ */ Y(Ot, [["render", St]]), me = /* @__PURE__ */ N({
|
|
|
2560
2572
|
}, 8, ["size"])
|
|
2561
2573
|
]),
|
|
2562
2574
|
default: g(() => [
|
|
2563
|
-
|
|
2564
|
-
|
|
2575
|
+
S("div", Rt, [
|
|
2576
|
+
U(l(T), {
|
|
2565
2577
|
type: "warning",
|
|
2566
|
-
loading:
|
|
2578
|
+
loading: l(t).export.loading,
|
|
2567
2579
|
size: i.option.size?.search
|
|
2568
2580
|
}, {
|
|
2569
2581
|
default: g(() => [
|
|
2570
|
-
E(
|
|
2582
|
+
E(M(l(w).tCurd("export")), 1)
|
|
2571
2583
|
]),
|
|
2572
2584
|
_: 1
|
|
2573
2585
|
}, 8, ["loading", "size"])
|
|
@@ -2575,14 +2587,14 @@ const Mt = /* @__PURE__ */ Y(Ot, [["render", St]]), me = /* @__PURE__ */ N({
|
|
|
2575
2587
|
]),
|
|
2576
2588
|
_: 1
|
|
2577
2589
|
}, 8, ["onCommand"])) : (d(), b("div", It, [
|
|
2578
|
-
|
|
2590
|
+
U(l(T), {
|
|
2579
2591
|
type: "warning",
|
|
2580
|
-
loading:
|
|
2592
|
+
loading: l(t).export.loading,
|
|
2581
2593
|
size: i.option.size?.search,
|
|
2582
|
-
onClick: p[3] || (p[3] = (h) =>
|
|
2594
|
+
onClick: p[3] || (p[3] = (h) => l(t).export.run.start("all"))
|
|
2583
2595
|
}, {
|
|
2584
2596
|
default: g(() => [
|
|
2585
|
-
E(
|
|
2597
|
+
E(M(l(w).tCurd("export")), 1)
|
|
2586
2598
|
]),
|
|
2587
2599
|
_: 1
|
|
2588
2600
|
}, 8, ["loading", "size"])
|
|
@@ -2590,36 +2602,36 @@ const Mt = /* @__PURE__ */ Y(Ot, [["render", St]]), me = /* @__PURE__ */ N({
|
|
|
2590
2602
|
], 64)) : v("", !0),
|
|
2591
2603
|
V(m.$slots, "tools-left")
|
|
2592
2604
|
]),
|
|
2593
|
-
|
|
2605
|
+
S("div", Ht, [
|
|
2594
2606
|
V(m.$slots, "tools-right"),
|
|
2595
|
-
|
|
2607
|
+
l(t).page.showTools ? (d(), y(l(pe), C({
|
|
2596
2608
|
key: 0,
|
|
2597
|
-
"current-page":
|
|
2598
|
-
"onUpdate:currentPage": p[4] || (p[4] = (h) =>
|
|
2599
|
-
"page-size":
|
|
2600
|
-
"onUpdate:pageSize": p[5] || (p[5] = (h) =>
|
|
2609
|
+
"current-page": l(t).page.num,
|
|
2610
|
+
"onUpdate:currentPage": p[4] || (p[4] = (h) => l(t).page.num = h),
|
|
2611
|
+
"page-size": l(t).page.size,
|
|
2612
|
+
"onUpdate:pageSize": p[5] || (p[5] = (h) => l(t).page.size = h),
|
|
2601
2613
|
background: "",
|
|
2602
|
-
"page-sizes":
|
|
2603
|
-
"pager-count":
|
|
2604
|
-
layout:
|
|
2605
|
-
total:
|
|
2614
|
+
"page-sizes": l(t).page.sizeList,
|
|
2615
|
+
"pager-count": l(t).page.pagerCount,
|
|
2616
|
+
layout: l(t).page.layout,
|
|
2617
|
+
total: l(t).page.total,
|
|
2606
2618
|
size: i.option.size?.table,
|
|
2607
|
-
onSizeChange:
|
|
2608
|
-
onCurrentChange:
|
|
2619
|
+
onSizeChange: l(t).table.getList,
|
|
2620
|
+
onCurrentChange: l(t).table.getList
|
|
2609
2621
|
}, 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),
|
|
2610
2622
|
i.option.tools?.expandColumn === void 0 || i.option.tools?.expandColumn ? (d(), y(u, {
|
|
2611
2623
|
key: 1,
|
|
2612
2624
|
effect: "dark",
|
|
2613
|
-
content:
|
|
2625
|
+
content: l(t).table.header.group.expand ? l(w).tCurd("mergeColumn") : l(w).tCurd("expandColumn"),
|
|
2614
2626
|
placement: "top"
|
|
2615
2627
|
}, {
|
|
2616
2628
|
default: g(() => [
|
|
2617
|
-
|
|
2629
|
+
S("div", {
|
|
2618
2630
|
class: I(["refresh-btn", [i.option.size?.search]]),
|
|
2619
2631
|
onClick: p[6] || (p[6] = //@ts-ignore
|
|
2620
|
-
(...h) =>
|
|
2632
|
+
(...h) => l(t).table.header.group.toggleExpandAll && l(t).table.header.group.toggleExpandAll(...h))
|
|
2621
2633
|
}, [
|
|
2622
|
-
|
|
2634
|
+
l(t).table.header.group.expand ? (d(), y(Et, { key: 0 })) : (d(), y(Mt, { key: 1 }))
|
|
2623
2635
|
], 2)
|
|
2624
2636
|
]),
|
|
2625
2637
|
_: 1
|
|
@@ -2628,30 +2640,30 @@ const Mt = /* @__PURE__ */ Y(Ot, [["render", St]]), me = /* @__PURE__ */ N({
|
|
|
2628
2640
|
key: 2,
|
|
2629
2641
|
class: I(["refresh-btn", [i.option.size?.search]]),
|
|
2630
2642
|
onClick: p[7] || (p[7] = //@ts-ignore
|
|
2631
|
-
(...h) =>
|
|
2643
|
+
(...h) => l(t).table.getList && l(t).table.getList(...h))
|
|
2632
2644
|
}, [
|
|
2633
|
-
|
|
2645
|
+
U(Ze)
|
|
2634
2646
|
], 2)) : v("", !0)
|
|
2635
2647
|
])
|
|
2636
2648
|
]),
|
|
2637
|
-
|
|
2649
|
+
S("div", {
|
|
2638
2650
|
class: I(["fit-width relative form-box", [i.option.table?.fitHeight ? "col " : "", i.option.table?.editMode ? "edit-mode" : ""]])
|
|
2639
2651
|
}, [
|
|
2640
|
-
|
|
2652
|
+
S("div", {
|
|
2641
2653
|
class: I(["column form-box-content", [i.option.table?.fitHeight ? "absolute fit" : ""]])
|
|
2642
2654
|
}, [
|
|
2643
|
-
Me((d(), y(
|
|
2655
|
+
Me((d(), y(l(Ee), C({
|
|
2644
2656
|
ref_key: "tableRef",
|
|
2645
2657
|
ref: s,
|
|
2646
|
-
data:
|
|
2658
|
+
data: l(t).table.data,
|
|
2647
2659
|
border: i.option.table?.border === void 0 ? !0 : i.option.table?.border,
|
|
2648
|
-
onSelectionChange:
|
|
2649
|
-
onSortChange:
|
|
2650
|
-
"expand-row-keys":
|
|
2651
|
-
onExpandChange:
|
|
2660
|
+
onSelectionChange: l(t).table.selection.change,
|
|
2661
|
+
onSortChange: l(t).table.sort.change,
|
|
2662
|
+
"expand-row-keys": l(t).table.expand.rowKeys,
|
|
2663
|
+
onExpandChange: l(t).table.expand.change
|
|
2652
2664
|
}, i.option.table, z(i.option.table?.on || {})), {
|
|
2653
2665
|
default: g(() => [
|
|
2654
|
-
(typeof i.option.table?.selectable == "object" ? i.option.table?.selectable?.show : i.option.table?.selectable) || a
|
|
2666
|
+
(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({
|
|
2655
2667
|
key: 0,
|
|
2656
2668
|
type: "selection",
|
|
2657
2669
|
width: "40",
|
|
@@ -2660,7 +2672,7 @@ const Mt = /* @__PURE__ */ Y(Ot, [["render", St]]), me = /* @__PURE__ */ N({
|
|
|
2660
2672
|
"show-overflow-tooltip": !1,
|
|
2661
2673
|
className: "cc1-form-selectable-column"
|
|
2662
2674
|
}, 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),
|
|
2663
|
-
(typeof i.option.table?.index == "object" ? i.option.table?.index?.show : i.option.table?.index) ? (d(), y(
|
|
2675
|
+
(typeof i.option.table?.index == "object" ? i.option.table?.index?.show : i.option.table?.index) ? (d(), y(l(oe), C({
|
|
2664
2676
|
key: 1,
|
|
2665
2677
|
type: "index",
|
|
2666
2678
|
fixed: "left",
|
|
@@ -2670,9 +2682,9 @@ const Mt = /* @__PURE__ */ Y(Ot, [["render", St]]), me = /* @__PURE__ */ N({
|
|
|
2670
2682
|
"show-overflow-tooltip": !1,
|
|
2671
2683
|
className: "cc1-form-index-column"
|
|
2672
2684
|
}, 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),
|
|
2673
|
-
|
|
2674
|
-
conf:
|
|
2675
|
-
columnList:
|
|
2685
|
+
U(bt, {
|
|
2686
|
+
conf: l(t),
|
|
2687
|
+
columnList: l(t).table.column.list,
|
|
2676
2688
|
option: i.option
|
|
2677
2689
|
}, G({ _: 2 }, [
|
|
2678
2690
|
A(m.$slots, (h, c) => ({
|
|
@@ -2682,7 +2694,7 @@ const Mt = /* @__PURE__ */ Y(Ot, [["render", St]]), me = /* @__PURE__ */ N({
|
|
|
2682
2694
|
])
|
|
2683
2695
|
}))
|
|
2684
2696
|
]), 1032, ["conf", "columnList", "option"]),
|
|
2685
|
-
a
|
|
2697
|
+
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({
|
|
2686
2698
|
key: 2,
|
|
2687
2699
|
width: "auto",
|
|
2688
2700
|
"max-width": "200",
|
|
@@ -2691,80 +2703,80 @@ const Mt = /* @__PURE__ */ Y(Ot, [["render", St]]), me = /* @__PURE__ */ N({
|
|
|
2691
2703
|
}, i.option.table?.operate, { "show-overflow-tooltip": !1 }), {
|
|
2692
2704
|
header: g(() => [
|
|
2693
2705
|
V(m.$slots, "table-header-op", {}, () => [
|
|
2694
|
-
E(
|
|
2706
|
+
E(M(l(w).tCurd("operation")), 1)
|
|
2695
2707
|
])
|
|
2696
2708
|
]),
|
|
2697
2709
|
default: g(({ row: h }) => [
|
|
2698
|
-
|
|
2710
|
+
U(l(Q), {
|
|
2699
2711
|
size: i.option.size?.table
|
|
2700
2712
|
}, {
|
|
2701
2713
|
default: g(() => [
|
|
2702
2714
|
V(m.$slots, "table-op-left", { row: h }),
|
|
2703
|
-
|
|
2704
|
-
|
|
2715
|
+
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 }, [
|
|
2716
|
+
U(l(T), {
|
|
2705
2717
|
link: "",
|
|
2706
2718
|
type: "info",
|
|
2707
|
-
onClick:
|
|
2719
|
+
onClick: l(t).update.close
|
|
2708
2720
|
}, {
|
|
2709
2721
|
default: g(() => [
|
|
2710
|
-
E(
|
|
2722
|
+
E(M(l(w).tCurd("cancel")), 1)
|
|
2711
2723
|
]),
|
|
2712
2724
|
_: 1
|
|
2713
2725
|
}, 8, ["onClick"]),
|
|
2714
|
-
|
|
2726
|
+
U(l(T), {
|
|
2715
2727
|
link: "",
|
|
2716
2728
|
type: "primary",
|
|
2717
|
-
onClick:
|
|
2718
|
-
loading:
|
|
2729
|
+
onClick: l(t).update.submit,
|
|
2730
|
+
loading: l(t).update.loading
|
|
2719
2731
|
}, {
|
|
2720
2732
|
default: g(() => [
|
|
2721
|
-
E(
|
|
2733
|
+
E(M(l(w).tCurd("confirm")), 1)
|
|
2722
2734
|
]),
|
|
2723
2735
|
_: 1
|
|
2724
2736
|
}, 8, ["onClick", "loading"]),
|
|
2725
2737
|
V(m.$slots, "table-op-edit-right", { row: h })
|
|
2726
2738
|
], 64)) : (d(), b(D, { key: 1 }, [
|
|
2727
|
-
a
|
|
2739
|
+
l(a)(i.option.table?.add, h) ? (d(), y(l(T), {
|
|
2728
2740
|
key: 0,
|
|
2729
2741
|
link: "",
|
|
2730
2742
|
type: "primary",
|
|
2731
|
-
onClick: (c) =>
|
|
2743
|
+
onClick: (c) => l(t).update.open(l(f).Add, h)
|
|
2732
2744
|
}, {
|
|
2733
2745
|
default: g(() => [
|
|
2734
|
-
E(
|
|
2746
|
+
E(M(l(w).tCurd("add")), 1)
|
|
2735
2747
|
]),
|
|
2736
2748
|
_: 2
|
|
2737
2749
|
}, 1032, ["onClick"])) : v("", !0),
|
|
2738
|
-
a
|
|
2750
|
+
l(a)(i.option.table?.view, h) ? (d(), y(l(T), {
|
|
2739
2751
|
key: 1,
|
|
2740
2752
|
link: "",
|
|
2741
2753
|
type: "primary",
|
|
2742
|
-
onClick: (c) =>
|
|
2754
|
+
onClick: (c) => l(t).update.open(l(f).View, h)
|
|
2743
2755
|
}, {
|
|
2744
2756
|
default: g(() => [
|
|
2745
|
-
E(
|
|
2757
|
+
E(M(l(w).tCurd("view")), 1)
|
|
2746
2758
|
]),
|
|
2747
2759
|
_: 2
|
|
2748
2760
|
}, 1032, ["onClick"])) : v("", !0),
|
|
2749
|
-
a
|
|
2761
|
+
l(a)(i.option.table?.update, h) ? (d(), y(l(T), {
|
|
2750
2762
|
key: 2,
|
|
2751
2763
|
link: "",
|
|
2752
2764
|
type: "warning",
|
|
2753
|
-
onClick: (c) =>
|
|
2765
|
+
onClick: (c) => l(t).update.open(l(f).Update, h)
|
|
2754
2766
|
}, {
|
|
2755
2767
|
default: g(() => [
|
|
2756
|
-
E(
|
|
2768
|
+
E(M(l(w).tCurd("edit")), 1)
|
|
2757
2769
|
]),
|
|
2758
2770
|
_: 2
|
|
2759
2771
|
}, 1032, ["onClick"])) : v("", !0),
|
|
2760
|
-
a
|
|
2772
|
+
l(a)(i.option.table?.delete, h) ? (d(), y(l(T), {
|
|
2761
2773
|
key: 3,
|
|
2762
2774
|
link: "",
|
|
2763
2775
|
type: "danger",
|
|
2764
|
-
onClick: (c) =>
|
|
2776
|
+
onClick: (c) => l(t).remove.open([h])
|
|
2765
2777
|
}, {
|
|
2766
2778
|
default: g(() => [
|
|
2767
|
-
E(
|
|
2779
|
+
E(M(l(w).tCurd("delete")), 1)
|
|
2768
2780
|
]),
|
|
2769
2781
|
_: 2
|
|
2770
2782
|
}, 1032, ["onClick"])) : v("", !0),
|
|
@@ -2779,58 +2791,58 @@ const Mt = /* @__PURE__ */ Y(Ot, [["render", St]]), me = /* @__PURE__ */ N({
|
|
|
2779
2791
|
]),
|
|
2780
2792
|
_: 3
|
|
2781
2793
|
}, 16, ["data", "border", "onSelectionChange", "onSortChange", "expand-row-keys", "onExpandChange"])), [
|
|
2782
|
-
[k,
|
|
2794
|
+
[k, l(t).table.loading]
|
|
2783
2795
|
])
|
|
2784
2796
|
], 2)
|
|
2785
2797
|
], 2),
|
|
2786
|
-
|
|
2787
|
-
(i.option.page?.show === void 0 || i.option.page?.show) && !
|
|
2798
|
+
S("div", Kt, [
|
|
2799
|
+
(i.option.page?.show === void 0 || i.option.page?.show) && !l(t).page.showTools ? (d(), y(l(pe), C({
|
|
2788
2800
|
key: 0,
|
|
2789
|
-
"current-page":
|
|
2790
|
-
"onUpdate:currentPage": p[8] || (p[8] = (h) =>
|
|
2791
|
-
"page-size":
|
|
2792
|
-
"onUpdate:pageSize": p[9] || (p[9] = (h) =>
|
|
2801
|
+
"current-page": l(t).page.num,
|
|
2802
|
+
"onUpdate:currentPage": p[8] || (p[8] = (h) => l(t).page.num = h),
|
|
2803
|
+
"page-size": l(t).page.size,
|
|
2804
|
+
"onUpdate:pageSize": p[9] || (p[9] = (h) => l(t).page.size = h),
|
|
2793
2805
|
background: "",
|
|
2794
|
-
"page-sizes":
|
|
2795
|
-
"pager-count":
|
|
2796
|
-
layout:
|
|
2797
|
-
total:
|
|
2806
|
+
"page-sizes": l(t).page.sizeList,
|
|
2807
|
+
"pager-count": l(t).page.pagerCount,
|
|
2808
|
+
layout: l(t).page.layout,
|
|
2809
|
+
total: l(t).page.total,
|
|
2798
2810
|
size: i.option.size?.table,
|
|
2799
|
-
onSizeChange:
|
|
2800
|
-
onCurrentChange:
|
|
2811
|
+
onSizeChange: l(t).table.getList,
|
|
2812
|
+
onCurrentChange: l(t).table.getList
|
|
2801
2813
|
}, 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)
|
|
2802
2814
|
])
|
|
2803
2815
|
], 2),
|
|
2804
2816
|
V(m.$slots, "box-right")
|
|
2805
2817
|
], 2),
|
|
2806
|
-
|
|
2807
|
-
modelValue:
|
|
2808
|
-
"onUpdate:modelValue": p[10] || (p[10] = (h) =>
|
|
2809
|
-
title:
|
|
2810
|
-
"before-close":
|
|
2818
|
+
U(l(ie), C({
|
|
2819
|
+
modelValue: l(t).update.show,
|
|
2820
|
+
"onUpdate:modelValue": p[10] || (p[10] = (h) => l(t).update.show = h),
|
|
2821
|
+
title: l(t).update.title,
|
|
2822
|
+
"before-close": l(t).update.close
|
|
2811
2823
|
}, i.option.dialog), {
|
|
2812
2824
|
footer: g(() => [
|
|
2813
|
-
|
|
2814
|
-
|
|
2825
|
+
S("span", Pt, [
|
|
2826
|
+
U(l(Q), {
|
|
2815
2827
|
size: i.option.size?.form
|
|
2816
2828
|
}, {
|
|
2817
2829
|
default: g(() => [
|
|
2818
|
-
|
|
2819
|
-
onClick:
|
|
2830
|
+
U(l(T), {
|
|
2831
|
+
onClick: l(t).update.close
|
|
2820
2832
|
}, {
|
|
2821
2833
|
default: g(() => [
|
|
2822
|
-
E(
|
|
2834
|
+
E(M(l(w).tCurd("close")), 1)
|
|
2823
2835
|
]),
|
|
2824
2836
|
_: 1
|
|
2825
2837
|
}, 8, ["onClick"]),
|
|
2826
|
-
|
|
2838
|
+
l(t).update.type !== l(f).View ? (d(), y(l(T), {
|
|
2827
2839
|
key: 0,
|
|
2828
2840
|
type: "primary",
|
|
2829
|
-
onClick:
|
|
2830
|
-
loading:
|
|
2841
|
+
onClick: l(t).update.submit,
|
|
2842
|
+
loading: l(t).update.loading
|
|
2831
2843
|
}, {
|
|
2832
2844
|
default: g(() => [
|
|
2833
|
-
E(
|
|
2845
|
+
E(M(l(w).tCurd("submit")), 1)
|
|
2834
2846
|
]),
|
|
2835
2847
|
_: 1
|
|
2836
2848
|
}, 8, ["onClick", "loading"])) : v("", !0)
|
|
@@ -2840,25 +2852,25 @@ const Mt = /* @__PURE__ */ Y(Ot, [["render", St]]), me = /* @__PURE__ */ N({
|
|
|
2840
2852
|
])
|
|
2841
2853
|
]),
|
|
2842
2854
|
default: g(() => [
|
|
2843
|
-
|
|
2855
|
+
U(l(Q), {
|
|
2844
2856
|
ref_key: "ruleFormRef",
|
|
2845
2857
|
ref: r,
|
|
2846
|
-
model:
|
|
2847
|
-
rules:
|
|
2858
|
+
model: l(t).update.form,
|
|
2859
|
+
rules: l(t).update.rules,
|
|
2848
2860
|
size: i.option.size?.form,
|
|
2849
2861
|
class: "update-dialog-form"
|
|
2850
2862
|
}, {
|
|
2851
2863
|
default: g(() => [
|
|
2852
|
-
|
|
2853
|
-
a
|
|
2864
|
+
l(t).update.showContent ? (d(!0), b(D, { key: 0 }, A(l(t).update.formColumn, (h) => (d(), b(D, null, [
|
|
2865
|
+
l(a)(
|
|
2854
2866
|
(() => {
|
|
2855
2867
|
const c = [], $ = (B) => {
|
|
2856
2868
|
B?.item?.children ? $(B.item.children) : c.push(...B.map((R) => R.item?.show?.form));
|
|
2857
2869
|
};
|
|
2858
2870
|
return $(h), c;
|
|
2859
2871
|
})(),
|
|
2860
|
-
|
|
2861
|
-
|
|
2872
|
+
l(t).update.form,
|
|
2873
|
+
l(t).update.type
|
|
2862
2874
|
) ? (d(), b("div", {
|
|
2863
2875
|
key: 0,
|
|
2864
2876
|
class: I(["row curd-row", {
|
|
@@ -2866,16 +2878,16 @@ const Mt = /* @__PURE__ */ Y(Ot, [["render", St]]), me = /* @__PURE__ */ N({
|
|
|
2866
2878
|
}])
|
|
2867
2879
|
}, [
|
|
2868
2880
|
V(m.$slots, "form-start", {
|
|
2869
|
-
row:
|
|
2881
|
+
row: l(t).update.form
|
|
2870
2882
|
}),
|
|
2871
2883
|
(d(!0), b(D, null, A(h, (c) => (d(), b(D, null, [
|
|
2872
|
-
a
|
|
2884
|
+
l(a)(c.item.show?.form, l(t).update.form, l(t).update.type) ? (d(), b("div", {
|
|
2873
2885
|
key: 0,
|
|
2874
|
-
class: I([c.item.form.span > 0 ? `col-${
|
|
2886
|
+
class: I([c.item.form.span > 0 ? `col-${l(t).getColumnSpan(c, h)}` : "col", `form-item-col-${c.item.key}`])
|
|
2875
2887
|
}, [
|
|
2876
2888
|
(d(!0), b(D, null, A(c.item.children ? c.children : [c], ($) => (d(), y(Vt, {
|
|
2877
2889
|
key: $.item.key,
|
|
2878
|
-
conf:
|
|
2890
|
+
conf: l(t),
|
|
2879
2891
|
item: $
|
|
2880
2892
|
}, G({ _: 2 }, [
|
|
2881
2893
|
A(m.$slots, (B, R) => ({
|
|
@@ -2888,7 +2900,7 @@ const Mt = /* @__PURE__ */ Y(Ot, [["render", St]]), me = /* @__PURE__ */ N({
|
|
|
2888
2900
|
], 2)) : v("", !0)
|
|
2889
2901
|
], 64))), 256)),
|
|
2890
2902
|
V(m.$slots, "form-end", {
|
|
2891
|
-
row:
|
|
2903
|
+
row: l(t).update.form
|
|
2892
2904
|
})
|
|
2893
2905
|
], 2)) : v("", !0)
|
|
2894
2906
|
], 64))), 256)) : v("", !0)
|
|
@@ -2898,33 +2910,33 @@ const Mt = /* @__PURE__ */ Y(Ot, [["render", St]]), me = /* @__PURE__ */ N({
|
|
|
2898
2910
|
]),
|
|
2899
2911
|
_: 3
|
|
2900
2912
|
}, 16, ["modelValue", "title", "before-close"]),
|
|
2901
|
-
|
|
2902
|
-
modelValue:
|
|
2903
|
-
"onUpdate:modelValue": p[11] || (p[11] = (h) =>
|
|
2904
|
-
title:
|
|
2913
|
+
U(l(ie), {
|
|
2914
|
+
modelValue: l(t).remove.show,
|
|
2915
|
+
"onUpdate:modelValue": p[11] || (p[11] = (h) => l(t).remove.show = h),
|
|
2916
|
+
title: l(t).remove.title,
|
|
2905
2917
|
"close-on-click-modal": !1
|
|
2906
2918
|
}, {
|
|
2907
2919
|
footer: g(() => [
|
|
2908
|
-
|
|
2909
|
-
|
|
2920
|
+
S("span", Jt, [
|
|
2921
|
+
U(l(Q), {
|
|
2910
2922
|
size: i.option.size?.form
|
|
2911
2923
|
}, {
|
|
2912
2924
|
default: g(() => [
|
|
2913
|
-
|
|
2914
|
-
onClick:
|
|
2925
|
+
U(l(T), {
|
|
2926
|
+
onClick: l(t).remove.close
|
|
2915
2927
|
}, {
|
|
2916
2928
|
default: g(() => [
|
|
2917
|
-
E(
|
|
2929
|
+
E(M(l(w).tCurd("close")), 1)
|
|
2918
2930
|
]),
|
|
2919
2931
|
_: 1
|
|
2920
2932
|
}, 8, ["onClick"]),
|
|
2921
|
-
|
|
2933
|
+
U(l(T), {
|
|
2922
2934
|
type: "danger",
|
|
2923
|
-
onClick:
|
|
2924
|
-
loading:
|
|
2935
|
+
onClick: l(t).remove.submit,
|
|
2936
|
+
loading: l(t).remove.loading
|
|
2925
2937
|
}, {
|
|
2926
2938
|
default: g(() => [
|
|
2927
|
-
E(
|
|
2939
|
+
E(M(l(w).tCurd("confirmDelete")), 1)
|
|
2928
2940
|
]),
|
|
2929
2941
|
_: 1
|
|
2930
2942
|
}, 8, ["onClick", "loading"])
|
|
@@ -2935,15 +2947,15 @@ const Mt = /* @__PURE__ */ Y(Ot, [["render", St]]), me = /* @__PURE__ */ N({
|
|
|
2935
2947
|
]),
|
|
2936
2948
|
default: g(() => [
|
|
2937
2949
|
i.option.dialog?.delete?.content ? (d(), b("div", Nt, [
|
|
2938
|
-
|
|
2950
|
+
U(_e, {
|
|
2939
2951
|
content: i.option.dialog?.delete?.content,
|
|
2940
|
-
value:
|
|
2952
|
+
value: l(t).remove.items
|
|
2941
2953
|
}, null, 8, ["content", "value"])
|
|
2942
|
-
])) : (d(), b("div", Wt,
|
|
2954
|
+
])) : (d(), b("div", Wt, M(l(w).tCurd("confirmDeleteMessage", l(t).remove.items.length)), 1))
|
|
2943
2955
|
]),
|
|
2944
2956
|
_: 1
|
|
2945
2957
|
}, 8, ["modelValue", "title"]),
|
|
2946
|
-
|
|
2958
|
+
U(Qe, {
|
|
2947
2959
|
ref_key: "switchConfirmRef",
|
|
2948
2960
|
ref: e,
|
|
2949
2961
|
size: i.option.size?.form
|
|
@@ -2969,8 +2981,8 @@ class Zt {
|
|
|
2969
2981
|
* @param name
|
|
2970
2982
|
*/
|
|
2971
2983
|
static exportJSONFile = (o, f) => {
|
|
2972
|
-
const n = new Blob([JSON.stringify(o)], { type: "application/json" }),
|
|
2973
|
-
t.href =
|
|
2984
|
+
const n = new Blob([JSON.stringify(o)], { type: "application/json" }), a = URL.createObjectURL(n), t = document.createElement("a");
|
|
2985
|
+
t.href = a, t.download = `${f || "config"}.json`, t.click();
|
|
2974
2986
|
};
|
|
2975
2987
|
/**
|
|
2976
2988
|
* 导入文件内容,默认为json
|
|
@@ -2978,13 +2990,13 @@ class Zt {
|
|
|
2978
2990
|
* @returns
|
|
2979
2991
|
*/
|
|
2980
2992
|
static importFile = async (o) => new Promise((f, n) => {
|
|
2981
|
-
const
|
|
2982
|
-
|
|
2993
|
+
const a = document.createElement("input");
|
|
2994
|
+
a.type = "file";
|
|
2983
2995
|
const t = o?.accept || ".json";
|
|
2984
|
-
|
|
2996
|
+
a.accept = t, a.style.display = "none", a.onchange = (e) => {
|
|
2985
2997
|
const r = e.target.files[0];
|
|
2986
2998
|
if (!r) {
|
|
2987
|
-
|
|
2999
|
+
O.fail("未选择文件"), n("未选择文件");
|
|
2988
3000
|
return;
|
|
2989
3001
|
}
|
|
2990
3002
|
const s = new FileReader();
|
|
@@ -2992,9 +3004,9 @@ class Zt {
|
|
|
2992
3004
|
const p = t == ".json" ? JSON.parse(m.target.result) : m.target.result;
|
|
2993
3005
|
f(p);
|
|
2994
3006
|
}, s.onerror = () => {
|
|
2995
|
-
|
|
2996
|
-
}, s.readAsText(r), document.body.removeChild(
|
|
2997
|
-
}, document.body.appendChild(
|
|
3007
|
+
O.fail("文件读取失败"), n("文件读取失败");
|
|
3008
|
+
}, s.readAsText(r), document.body.removeChild(a);
|
|
3009
|
+
}, document.body.appendChild(a), a.click();
|
|
2998
3010
|
});
|
|
2999
3011
|
}
|
|
3000
3012
|
const Qt = (i, o) => {
|
|
@@ -3016,7 +3028,7 @@ export {
|
|
|
3016
3028
|
F as TFormConfig,
|
|
3017
3029
|
w as TFormI18n,
|
|
3018
3030
|
fe as TFormList,
|
|
3019
|
-
|
|
3031
|
+
O as TSys,
|
|
3020
3032
|
xt as default,
|
|
3021
3033
|
Qt as install
|
|
3022
3034
|
};
|