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