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