cc1-form 1.3.4 → 1.3.6
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 +1004 -1012
- package/dist/cc1-form.umd.cjs +1 -1
- package/dist/components/TCurd/com/form/field.vue.d.ts +0 -2
- package/dist/components/TCurd/com/form/shared.d.ts +4 -3
- package/dist/components/TCurd/index.d.ts +2798 -1
- package/dist/components/TCurd/index.vue.d.ts +8272 -13
- package/package.json +1 -1
package/dist/cc1-form.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ElMessage as
|
|
1
|
+
import { ElMessage as at, ElLoading as nt, ElFormItem as be, ElInput as ue, ElInputNumber as lt, ElSwitch as he, ElSelect as ce, ElOption as ne, ElRadioGroup as Be, ElRadioButton as it, ElRadio as Te, ElCheckboxGroup as rt, ElCheckboxButton as st, ElCheckbox as dt, ElColorPicker as ut, ElSlider as ct, ElTreeSelect as ft, ElDatePicker as Le, ElForm as oe, ElDialog as Ee, ElButton as N, ElTableColumn as ye, ElDropdown as mt, ElDropdownMenu as gt, ElDropdownItem as Se, ElPagination as Re, ElTable as ht } from "element-plus";
|
|
2
2
|
import "vue-router";
|
|
3
|
-
import { defineComponent as q, reactive as re, onMounted as
|
|
3
|
+
import { defineComponent as q, reactive as re, onMounted as je, resolveComponent as fe, openBlock as g, createElementBlock as v, renderSlot as S, createVNode as F, withCtx as p, createTextVNode as M, createCommentVNode as V, Fragment as B, renderList as G, createBlock as b, normalizeClass as J, normalizeStyle as pe, ref as X, watch as Ke, nextTick as De, unref as r, createElementVNode as R, mergeProps as x, toHandlers as E, createSlots as Y, toDisplayString as U, resolveDynamicComponent as ee, computed as ae, onUnmounted as Pe, normalizeProps as $e, guardReactiveProps as ze, getCurrentInstance as Ie, withModifiers as yt, resolveDirective as bt, withDirectives as pt } from "vue";
|
|
4
4
|
import { Scope as Me } from "cc1-vue3";
|
|
5
5
|
class $ {
|
|
6
6
|
/**
|
|
@@ -27,7 +27,7 @@ class $ {
|
|
|
27
27
|
* @param data 数据
|
|
28
28
|
* @returns 是否显示
|
|
29
29
|
*/
|
|
30
|
-
static isFun = (t, ...n) => Array.isArray(t) ? t.some((
|
|
30
|
+
static isFun = (t, ...n) => Array.isArray(t) ? t.some((a) => typeof a == "function" ? a(...n) : a) : typeof t == "function" ? t(...n) : t;
|
|
31
31
|
/**
|
|
32
32
|
* 获取路由参数,自动获取query、params中的参数, 哪个有就返回哪个
|
|
33
33
|
*/
|
|
@@ -63,18 +63,18 @@ class $ {
|
|
|
63
63
|
* @param type 消息类型
|
|
64
64
|
* @param options 其他选项
|
|
65
65
|
*/
|
|
66
|
-
static showMessage(t, n,
|
|
67
|
-
const
|
|
68
|
-
if (!this.tipMessages[t] ||
|
|
69
|
-
this.tipMessages[t] =
|
|
70
|
-
const
|
|
66
|
+
static showMessage(t, n, a = {}) {
|
|
67
|
+
const s = Date.now();
|
|
68
|
+
if (!this.tipMessages[t] || s - this.tipMessages[t] > this.tipMessagesGap) {
|
|
69
|
+
this.tipMessages[t] = s;
|
|
70
|
+
const o = Object.assign(
|
|
71
71
|
{
|
|
72
72
|
message: t,
|
|
73
73
|
type: n
|
|
74
74
|
},
|
|
75
|
-
|
|
75
|
+
a
|
|
76
76
|
);
|
|
77
|
-
|
|
77
|
+
at(o), setTimeout(() => {
|
|
78
78
|
delete this.tipMessages[t];
|
|
79
79
|
}, this.tipMessagesGap);
|
|
80
80
|
}
|
|
@@ -104,7 +104,7 @@ class $ {
|
|
|
104
104
|
*/
|
|
105
105
|
static loading = (t = !0, n = "Loading...") => {
|
|
106
106
|
Timer.un(this.loadingTimer), this.loadingTimer = Timer.once(() => {
|
|
107
|
-
t ? this.loadingObj =
|
|
107
|
+
t ? this.loadingObj = nt.service({
|
|
108
108
|
lock: !0,
|
|
109
109
|
text: n,
|
|
110
110
|
background: "rgba(0, 0, 0, 0.3)"
|
|
@@ -118,11 +118,11 @@ class $ {
|
|
|
118
118
|
*/
|
|
119
119
|
static openUrl = (t, n = !0) => {
|
|
120
120
|
if (n) {
|
|
121
|
-
let
|
|
121
|
+
let a = screen.width / 2 - 500, s = screen.height / 2 - 800 / 2 - 30;
|
|
122
122
|
window.open(
|
|
123
123
|
t,
|
|
124
124
|
"_blank",
|
|
125
|
-
"toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" +
|
|
125
|
+
"toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + s + ", left=" + a
|
|
126
126
|
);
|
|
127
127
|
} else
|
|
128
128
|
window.open(t, "DescriptiveWindowName" + StrUtil.getId(), "resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0");
|
|
@@ -132,11 +132,11 @@ class $ {
|
|
|
132
132
|
* @param param
|
|
133
133
|
* @returns
|
|
134
134
|
*/
|
|
135
|
-
static getImgPic = (t) => new Promise(async (n,
|
|
136
|
-
let
|
|
137
|
-
const
|
|
135
|
+
static getImgPic = (t) => new Promise(async (n, a) => {
|
|
136
|
+
let s = document.getElementById(t.id);
|
|
137
|
+
const o = await $.loadModule("html2canvas");
|
|
138
138
|
try {
|
|
139
|
-
|
|
139
|
+
o(s, {
|
|
140
140
|
logging: !1,
|
|
141
141
|
allowTaint: !0,
|
|
142
142
|
scale: window.devicePixelRatio,
|
|
@@ -146,12 +146,12 @@ class $ {
|
|
|
146
146
|
windowHeight: t.windowHeight,
|
|
147
147
|
useCORS: !0,
|
|
148
148
|
backgroundColor: "#ffffff00"
|
|
149
|
-
}).then(function(
|
|
150
|
-
let
|
|
151
|
-
n(
|
|
149
|
+
}).then(function(l) {
|
|
150
|
+
let i = l.toDataURL("image/png");
|
|
151
|
+
n(i);
|
|
152
152
|
});
|
|
153
|
-
} catch (
|
|
154
|
-
|
|
153
|
+
} catch (l) {
|
|
154
|
+
a(l);
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
157
|
}
|
|
@@ -543,9 +543,9 @@ class W {
|
|
|
543
543
|
* @returns 该字段对应类型的 options 配置,如 select 类型返回 `options.select`
|
|
544
544
|
*/
|
|
545
545
|
static findOptions = (t, n) => {
|
|
546
|
-
const
|
|
547
|
-
if (
|
|
548
|
-
return
|
|
546
|
+
const a = t.column.find((o) => o.key === n), s = (o) => o.replace(/-([a-z])/g, (l, i) => i.toUpperCase());
|
|
547
|
+
if (a)
|
|
548
|
+
return a.options[s(a.type)];
|
|
549
549
|
};
|
|
550
550
|
/**
|
|
551
551
|
* 更新组件数据
|
|
@@ -563,9 +563,9 @@ class W {
|
|
|
563
563
|
}))
|
|
564
564
|
)
|
|
565
565
|
*/
|
|
566
|
-
static setOptionsData = (t, n,
|
|
567
|
-
const
|
|
568
|
-
|
|
566
|
+
static setOptionsData = (t, n, a) => {
|
|
567
|
+
const s = W.findOptions(t, n);
|
|
568
|
+
s && (s.data = a);
|
|
569
569
|
};
|
|
570
570
|
static form = {
|
|
571
571
|
openBefore: {
|
|
@@ -576,9 +576,9 @@ class W {
|
|
|
576
576
|
* @param treeData 树形数据
|
|
577
577
|
* @param option 组件配置
|
|
578
578
|
*/
|
|
579
|
-
parentId: (t, n,
|
|
580
|
-
const
|
|
581
|
-
t ? n.type === $.EDialog.Add ? (n.form.parentId = t[
|
|
579
|
+
parentId: (t, n, a, s) => {
|
|
580
|
+
const o = L.config.table.rowKey;
|
|
581
|
+
t ? n.type === $.EDialog.Add ? (n.form.parentId = t[o], n.form.sort = t.children.length + 1) : n.form.parentId = t.parentId.substring(t.parentId.lastIndexOf(",") + 1) : (n.form.parentId = "0", n.form.sort = a.length + 1), W.setOptionsData(s, "parentId", [{ [o]: "0", title: "根", children: a }]);
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
584
|
};
|
|
@@ -593,14 +593,14 @@ class Q {
|
|
|
593
593
|
* @param field 字段名
|
|
594
594
|
* @param row 行数据
|
|
595
595
|
*/
|
|
596
|
-
static setId = (t, n,
|
|
596
|
+
static setId = (t, n, a) => {
|
|
597
597
|
n[t] || (n[t] = []);
|
|
598
|
-
const
|
|
599
|
-
n[t].forEach((
|
|
600
|
-
|
|
601
|
-
let
|
|
602
|
-
|
|
603
|
-
}),
|
|
598
|
+
const s = L.config.table.rowKey;
|
|
599
|
+
n[t].forEach((o) => {
|
|
600
|
+
a.forEach((l) => {
|
|
601
|
+
let i = l.default ?? "";
|
|
602
|
+
l.type === "number" && (i = l.default ?? 0), l.type === "boolean" && (i = l.default ?? !1), l.type === "time" && (i = l.default ?? /* @__PURE__ */ new Date()), o[l.value] === void 0 && (o[l.value] = i);
|
|
603
|
+
}), o[s] || (o[s] = Q.getIdFun());
|
|
604
604
|
});
|
|
605
605
|
};
|
|
606
606
|
/**
|
|
@@ -610,19 +610,19 @@ class Q {
|
|
|
610
610
|
* @param itemFields 元素字段-如:[{label:'',value:''}]
|
|
611
611
|
* @param callback 回调函数
|
|
612
612
|
*/
|
|
613
|
-
static add = (t, n,
|
|
614
|
-
const
|
|
615
|
-
Q.setId(t, n,
|
|
616
|
-
const
|
|
613
|
+
static add = (t, n, a, s) => {
|
|
614
|
+
const o = JSONUtil.cp(a);
|
|
615
|
+
Q.setId(t, n, a);
|
|
616
|
+
const l = L.config.table.rowKey;
|
|
617
617
|
n[t].push(
|
|
618
|
-
|
|
619
|
-
(
|
|
618
|
+
o.reduce(
|
|
619
|
+
(i, c) => {
|
|
620
620
|
let u = c.default ?? "";
|
|
621
|
-
return c.type === "number" && (u = c.default ?? 0), c.type === "boolean" && (u = c.default ?? !1), c.type === "time" && (u = c.default ?? /* @__PURE__ */ new Date()),
|
|
621
|
+
return c.type === "number" && (u = c.default ?? 0), c.type === "boolean" && (u = c.default ?? !1), c.type === "time" && (u = c.default ?? /* @__PURE__ */ new Date()), i[c.value] = u, i;
|
|
622
622
|
},
|
|
623
|
-
{ [
|
|
623
|
+
{ [l]: Q.getIdFun() }
|
|
624
624
|
)
|
|
625
|
-
),
|
|
625
|
+
), s?.(n);
|
|
626
626
|
};
|
|
627
627
|
/**
|
|
628
628
|
* 删除数组元素
|
|
@@ -631,9 +631,9 @@ class Q {
|
|
|
631
631
|
* @param item 元素-如:{_id:''}
|
|
632
632
|
* @param callback 回调函数
|
|
633
633
|
*/
|
|
634
|
-
static remove = (t, n,
|
|
635
|
-
const
|
|
636
|
-
n[t] = n[t].filter((
|
|
634
|
+
static remove = (t, n, a, s) => {
|
|
635
|
+
const o = L.config.table.rowKey;
|
|
636
|
+
n[t] = n[t].filter((l) => l[o] !== a[o]), s?.(n);
|
|
637
637
|
};
|
|
638
638
|
/**
|
|
639
639
|
* 获取没有id的数据
|
|
@@ -642,20 +642,20 @@ class Q {
|
|
|
642
642
|
* @returns 没有id的数据
|
|
643
643
|
*/
|
|
644
644
|
static getNoIdData = (t, n) => {
|
|
645
|
-
const
|
|
646
|
-
return
|
|
647
|
-
|
|
648
|
-
}),
|
|
645
|
+
const a = JSONUtil.cp(t), s = L.config.table.rowKey;
|
|
646
|
+
return a.forEach((o) => {
|
|
647
|
+
o[s] && delete o[s], n && o[n] && Q.getNoIdData(o[n], n);
|
|
648
|
+
}), a;
|
|
649
649
|
};
|
|
650
650
|
}
|
|
651
|
-
const
|
|
651
|
+
const wt = {
|
|
652
652
|
key: 0,
|
|
653
653
|
class: "column curd-form-com-list",
|
|
654
654
|
style: { width: "100%", gap: "10px" }
|
|
655
|
-
},
|
|
655
|
+
}, kt = { key: 0 }, vt = {
|
|
656
656
|
class: "row items-center",
|
|
657
657
|
style: { gap: "10px", width: "100%" }
|
|
658
|
-
},
|
|
658
|
+
}, Ct = { key: 1 }, Ne = /* @__PURE__ */ q({
|
|
659
659
|
__name: "list",
|
|
660
660
|
props: {
|
|
661
661
|
row: {
|
|
@@ -694,87 +694,87 @@ const pt = {
|
|
|
694
694
|
},
|
|
695
695
|
emits: ["change"],
|
|
696
696
|
setup(e, { emit: t }) {
|
|
697
|
-
const n = e,
|
|
697
|
+
const n = e, a = re({
|
|
698
698
|
show: !1,
|
|
699
|
-
add: (
|
|
700
|
-
Q.add(
|
|
701
|
-
|
|
699
|
+
add: (o, l, i) => {
|
|
700
|
+
Q.add(o, l, i, () => {
|
|
701
|
+
s("change");
|
|
702
702
|
});
|
|
703
703
|
},
|
|
704
|
-
remove: (
|
|
705
|
-
Q.remove(
|
|
706
|
-
|
|
704
|
+
remove: (o, l, i) => {
|
|
705
|
+
Q.remove(o, l, i, () => {
|
|
706
|
+
s("change");
|
|
707
707
|
});
|
|
708
708
|
}
|
|
709
709
|
});
|
|
710
|
-
|
|
711
|
-
Q.setId(n.field, n.row, n.itemFields),
|
|
710
|
+
je(() => {
|
|
711
|
+
Q.setId(n.field, n.row, n.itemFields), a.show = !0;
|
|
712
712
|
});
|
|
713
|
-
const
|
|
714
|
-
return (
|
|
715
|
-
const
|
|
716
|
-
return
|
|
717
|
-
S(
|
|
718
|
-
e.addBottom ? V("", !0) : (g(), v("div",
|
|
719
|
-
F(
|
|
713
|
+
const s = t;
|
|
714
|
+
return (o, l) => {
|
|
715
|
+
const i = fe("el-button"), c = fe("el-input");
|
|
716
|
+
return a.show ? (g(), v("div", wt, [
|
|
717
|
+
S(o.$slots, "list-start", { row: e.row }),
|
|
718
|
+
e.addBottom ? V("", !0) : (g(), v("div", kt, [
|
|
719
|
+
F(i, {
|
|
720
720
|
link: "",
|
|
721
721
|
type: "primary",
|
|
722
|
-
onClick:
|
|
722
|
+
onClick: l[0] || (l[0] = (u) => a.add(e.field, e.row, e.itemFields))
|
|
723
723
|
}, {
|
|
724
|
-
default: p(() => [...
|
|
724
|
+
default: p(() => [...l[3] || (l[3] = [
|
|
725
725
|
M("添加", -1)
|
|
726
726
|
])]),
|
|
727
727
|
_: 1
|
|
728
728
|
})
|
|
729
729
|
])),
|
|
730
|
-
(g(!0), v(B, null, G(e.row[e.field], (u) => (g(), v("div",
|
|
731
|
-
S(
|
|
730
|
+
(g(!0), v(B, null, G(e.row[e.field], (u) => (g(), v("div", vt, [
|
|
731
|
+
S(o.$slots, "item-start", {
|
|
732
732
|
item: u,
|
|
733
733
|
row: e.row
|
|
734
734
|
}),
|
|
735
|
-
(g(!0), v(B, null, G(e.itemFields, (
|
|
736
|
-
modelValue: u[
|
|
737
|
-
"onUpdate:modelValue": (h) => u[
|
|
735
|
+
(g(!0), v(B, null, G(e.itemFields, (d) => (g(), b(c, {
|
|
736
|
+
modelValue: u[d.value],
|
|
737
|
+
"onUpdate:modelValue": (h) => u[d.value] = h,
|
|
738
738
|
style: pe({ width: e.inputWidth }),
|
|
739
739
|
class: J(e.inputClass),
|
|
740
|
-
placeholder:
|
|
741
|
-
onChange:
|
|
740
|
+
placeholder: d[e.label] || d[e.value],
|
|
741
|
+
onChange: l[1] || (l[1] = (h) => s("change"))
|
|
742
742
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "style", "class", "placeholder"]))), 256)),
|
|
743
|
-
S(
|
|
743
|
+
S(o.$slots, "item-end", {
|
|
744
744
|
item: u,
|
|
745
745
|
row: e.row
|
|
746
746
|
}),
|
|
747
|
-
F(
|
|
747
|
+
F(i, {
|
|
748
748
|
link: "",
|
|
749
749
|
type: "danger",
|
|
750
|
-
onClick: (
|
|
750
|
+
onClick: (d) => a.remove(e.field, e.row, u)
|
|
751
751
|
}, {
|
|
752
|
-
default: p(() => [...
|
|
752
|
+
default: p(() => [...l[4] || (l[4] = [
|
|
753
753
|
M("删除", -1)
|
|
754
754
|
])]),
|
|
755
755
|
_: 1
|
|
756
756
|
}, 8, ["onClick"])
|
|
757
757
|
]))), 256)),
|
|
758
|
-
e.addBottom ? (g(), v("div",
|
|
759
|
-
F(
|
|
758
|
+
e.addBottom ? (g(), v("div", Ct, [
|
|
759
|
+
F(i, {
|
|
760
760
|
link: "",
|
|
761
761
|
type: "primary",
|
|
762
|
-
onClick:
|
|
762
|
+
onClick: l[2] || (l[2] = (u) => a.add(e.field, e.row, e.itemFields))
|
|
763
763
|
}, {
|
|
764
|
-
default: p(() => [...
|
|
764
|
+
default: p(() => [...l[5] || (l[5] = [
|
|
765
765
|
M("添加", -1)
|
|
766
766
|
])]),
|
|
767
767
|
_: 1
|
|
768
768
|
})
|
|
769
769
|
])) : V("", !0),
|
|
770
|
-
S(
|
|
770
|
+
S(o.$slots, "list-end", { row: e.row })
|
|
771
771
|
])) : V("", !0);
|
|
772
772
|
};
|
|
773
773
|
}
|
|
774
|
-
}),
|
|
774
|
+
}), xt = {
|
|
775
775
|
class: "row form-item-content",
|
|
776
776
|
style: { width: "100%" }
|
|
777
|
-
},
|
|
777
|
+
}, Vt = { class: "col column form-item-content-item" }, St = { class: "col" }, Et = ["innerHTML"], $t = /* @__PURE__ */ q({
|
|
778
778
|
__name: "field",
|
|
779
779
|
props: {
|
|
780
780
|
item: {},
|
|
@@ -786,24 +786,19 @@ const pt = {
|
|
|
786
786
|
getDisabled: { type: Function }
|
|
787
787
|
},
|
|
788
788
|
setup(e) {
|
|
789
|
-
const t = e, n = X(),
|
|
790
|
-
const
|
|
791
|
-
return
|
|
792
|
-
},
|
|
793
|
-
|
|
794
|
-
}));
|
|
795
|
-
}, a = (d, c) => Array.isArray(d) ? Promise.all(d.map((u) => typeof u == "function" ? u(...c) : u)) : typeof d == "function" ? d(...c) : void 0, i = (d) => {
|
|
796
|
-
const c = t.getOn(d);
|
|
797
|
-
return {
|
|
798
|
-
...c,
|
|
799
|
-
change: (...u) => {
|
|
800
|
-
const s = o() === "error", h = a(c.change, u);
|
|
801
|
-
return Promise.resolve(h).then(() => r(s), () => r(s)).catch(() => {
|
|
802
|
-
}), h;
|
|
803
|
-
}
|
|
804
|
-
};
|
|
789
|
+
const t = e, n = X(), a = () => {
|
|
790
|
+
const o = n.value?.validateState;
|
|
791
|
+
return o && typeof o == "object" && "value" in o ? o.value : o;
|
|
792
|
+
}, s = () => {
|
|
793
|
+
a() === "error" && n.value?.clearValidate?.();
|
|
805
794
|
};
|
|
806
|
-
return (
|
|
795
|
+
return Ke(
|
|
796
|
+
() => t.form?.[t.item.key],
|
|
797
|
+
() => {
|
|
798
|
+
s(), De(() => s());
|
|
799
|
+
},
|
|
800
|
+
{ deep: !0, flush: "post" }
|
|
801
|
+
), (o, l) => (g(), b(r(be), {
|
|
807
802
|
ref_key: "formItemRef",
|
|
808
803
|
ref: n,
|
|
809
804
|
label: e.item.text?.form?.label ?? e.item.label,
|
|
@@ -811,21 +806,21 @@ const pt = {
|
|
|
811
806
|
"label-width": e.item.text?.form?.label == "" ? 0 : e.item.form?.labelWidth || e.labelWidth
|
|
812
807
|
}, {
|
|
813
808
|
default: p(() => [
|
|
814
|
-
R("div",
|
|
815
|
-
S(
|
|
809
|
+
R("div", xt, [
|
|
810
|
+
S(o.$slots, "form-" + e.item.key + "-start", {
|
|
816
811
|
row: e.form,
|
|
817
812
|
item: e.item
|
|
818
813
|
}),
|
|
819
|
-
R("div",
|
|
820
|
-
R("div",
|
|
821
|
-
S(
|
|
814
|
+
R("div", Vt, [
|
|
815
|
+
R("div", St, [
|
|
816
|
+
S(o.$slots, "form-" + e.item.key, {
|
|
822
817
|
row: e.form,
|
|
823
818
|
item: e.item
|
|
824
819
|
}, () => [
|
|
825
|
-
e.item.type === "input" ? (g(), b(
|
|
820
|
+
e.item.type === "input" ? (g(), b(r(ue), x({
|
|
826
821
|
key: 0,
|
|
827
822
|
modelValue: e.form[e.item.key],
|
|
828
|
-
"onUpdate:modelValue":
|
|
823
|
+
"onUpdate:modelValue": l[0] || (l[0] = (i) => e.form[e.item.key] = i)
|
|
829
824
|
}, e.getBind(e.item), E(e.getOn(e.item)), {
|
|
830
825
|
disabled: e.getDisabled(e.item)
|
|
831
826
|
}), Y({ _: 2 }, [
|
|
@@ -836,123 +831,123 @@ const pt = {
|
|
|
836
831
|
]),
|
|
837
832
|
key: "0"
|
|
838
833
|
} : void 0
|
|
839
|
-
]), 1040, ["modelValue", "disabled"])) : e.item.type === "number" ? (g(), b(
|
|
834
|
+
]), 1040, ["modelValue", "disabled"])) : e.item.type === "number" ? (g(), b(r(lt), x({
|
|
840
835
|
key: 1,
|
|
841
836
|
modelValue: e.form[e.item.key],
|
|
842
|
-
"onUpdate:modelValue":
|
|
837
|
+
"onUpdate:modelValue": l[1] || (l[1] = (i) => e.form[e.item.key] = i)
|
|
843
838
|
}, e.getBind(e.item), E(e.getOn(e.item)), {
|
|
844
839
|
disabled: e.getDisabled(e.item)
|
|
845
|
-
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "textarea" ? (g(), b(
|
|
840
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "textarea" ? (g(), b(r(ue), x({
|
|
846
841
|
key: 2,
|
|
847
842
|
type: "textarea",
|
|
848
843
|
modelValue: e.form[e.item.key],
|
|
849
|
-
"onUpdate:modelValue":
|
|
844
|
+
"onUpdate:modelValue": l[2] || (l[2] = (i) => e.form[e.item.key] = i)
|
|
850
845
|
}, e.getBind(e.item), E(e.getOn(e.item)), {
|
|
851
846
|
disabled: e.getDisabled(e.item)
|
|
852
|
-
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "switch" ? (g(), b(
|
|
847
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "switch" ? (g(), b(r(he), x({
|
|
853
848
|
key: 3,
|
|
854
849
|
modelValue: e.form[e.item.key],
|
|
855
|
-
"onUpdate:modelValue":
|
|
850
|
+
"onUpdate:modelValue": l[3] || (l[3] = (i) => e.form[e.item.key] = i)
|
|
856
851
|
}, e.getBind(e.item), E(e.getOn(e.item)), {
|
|
857
852
|
disabled: e.getDisabled(e.item)
|
|
858
|
-
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "select" ? (g(), b(
|
|
853
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "select" ? (g(), b(r(ce), x({
|
|
859
854
|
key: 4,
|
|
860
855
|
modelValue: e.form[e.item.key],
|
|
861
|
-
"onUpdate:modelValue":
|
|
862
|
-
}, e.getBind(e.item), E(
|
|
856
|
+
"onUpdate:modelValue": l[4] || (l[4] = (i) => e.form[e.item.key] = i)
|
|
857
|
+
}, e.getBind(e.item), E(e.getOn(e.item)), {
|
|
863
858
|
disabled: e.getDisabled(e.item),
|
|
864
859
|
style: { width: "100%" }
|
|
865
860
|
}), {
|
|
866
861
|
default: p(() => [
|
|
867
|
-
(g(!0), v(B, null, G(e.getBind(e.item).data || [], (
|
|
868
|
-
key:
|
|
869
|
-
}, { ref_for: !0 },
|
|
862
|
+
(g(!0), v(B, null, G(e.getBind(e.item).data || [], (i) => (g(), b(r(ne), x({
|
|
863
|
+
key: i.value
|
|
864
|
+
}, { ref_for: !0 }, i, E(i.on || {})), null, 16))), 128))
|
|
870
865
|
]),
|
|
871
866
|
_: 1
|
|
872
|
-
}, 16, ["modelValue", "disabled"])) : e.item.type === "radio" ? (g(), b(
|
|
867
|
+
}, 16, ["modelValue", "disabled"])) : e.item.type === "radio" ? (g(), b(r(Be), x({
|
|
873
868
|
key: 5,
|
|
874
869
|
modelValue: e.form[e.item.key],
|
|
875
|
-
"onUpdate:modelValue":
|
|
870
|
+
"onUpdate:modelValue": l[5] || (l[5] = (i) => e.form[e.item.key] = i)
|
|
876
871
|
}, e.getBind(e.item), E(e.getOn(e.item)), {
|
|
877
872
|
disabled: e.getDisabled(e.item),
|
|
878
873
|
style: { width: "100%" }
|
|
879
874
|
}), {
|
|
880
875
|
default: p(() => [
|
|
881
|
-
e.getBind(e.item).type === "group" ? (g(!0), v(B, { key: 0 }, G(e.getBind(e.item).data || [], (
|
|
882
|
-
key:
|
|
883
|
-
}, { ref_for: !0 },
|
|
884
|
-
key:
|
|
885
|
-
}, { ref_for: !0 },
|
|
876
|
+
e.getBind(e.item).type === "group" ? (g(!0), v(B, { key: 0 }, G(e.getBind(e.item).data || [], (i) => (g(), b(r(it), x({
|
|
877
|
+
key: i.value
|
|
878
|
+
}, { ref_for: !0 }, i, E(i.on || {})), null, 16))), 128)) : (g(!0), v(B, { key: 1 }, G(e.getBind(e.item).data || [], (i) => (g(), b(r(Te), x({
|
|
879
|
+
key: i.value
|
|
880
|
+
}, { ref_for: !0 }, i, E(i.on || {})), null, 16))), 128))
|
|
886
881
|
]),
|
|
887
882
|
_: 1
|
|
888
|
-
}, 16, ["modelValue", "disabled"])) : e.item.type === "checkbox" ? (g(), b(
|
|
883
|
+
}, 16, ["modelValue", "disabled"])) : e.item.type === "checkbox" ? (g(), b(r(rt), x({
|
|
889
884
|
key: 6,
|
|
890
885
|
modelValue: e.form[e.item.key],
|
|
891
|
-
"onUpdate:modelValue":
|
|
892
|
-
}, e.getBind(e.item), E(
|
|
886
|
+
"onUpdate:modelValue": l[6] || (l[6] = (i) => e.form[e.item.key] = i)
|
|
887
|
+
}, e.getBind(e.item), E(e.getOn(e.item)), {
|
|
893
888
|
disabled: e.getDisabled(e.item),
|
|
894
889
|
style: { width: "100%" }
|
|
895
890
|
}), {
|
|
896
891
|
default: p(() => [
|
|
897
|
-
e.getBind(e.item).type === "group" ? (g(!0), v(B, { key: 0 }, G(e.getBind(e.item).data || [], (
|
|
898
|
-
key:
|
|
899
|
-
}, { ref_for: !0 },
|
|
900
|
-
key:
|
|
901
|
-
}, { ref_for: !0 },
|
|
892
|
+
e.getBind(e.item).type === "group" ? (g(!0), v(B, { key: 0 }, G(e.getBind(e.item).data || [], (i) => (g(), b(r(st), x({
|
|
893
|
+
key: i.value
|
|
894
|
+
}, { ref_for: !0 }, i, E(i.on || {})), null, 16))), 128)) : (g(!0), v(B, { key: 1 }, G(e.getBind(e.item).data || [], (i) => (g(), b(r(dt), x({
|
|
895
|
+
key: i.value
|
|
896
|
+
}, { ref_for: !0 }, i, E(i.on || {})), null, 16))), 128))
|
|
902
897
|
]),
|
|
903
898
|
_: 1
|
|
904
|
-
}, 16, ["modelValue", "disabled"])) : e.item.type === "color" ? (g(), b(
|
|
899
|
+
}, 16, ["modelValue", "disabled"])) : e.item.type === "color" ? (g(), b(r(ut), x({
|
|
905
900
|
key: 7,
|
|
906
901
|
modelValue: e.form[e.item.key],
|
|
907
|
-
"onUpdate:modelValue":
|
|
902
|
+
"onUpdate:modelValue": l[7] || (l[7] = (i) => e.form[e.item.key] = i)
|
|
908
903
|
}, e.getBind(e.item), E(e.getOn(e.item)), {
|
|
909
904
|
disabled: e.getDisabled(e.item)
|
|
910
|
-
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "slider" ? (g(), b(
|
|
905
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "slider" ? (g(), b(r(ct), x({
|
|
911
906
|
key: 8,
|
|
912
907
|
modelValue: e.form[e.item.key],
|
|
913
|
-
"onUpdate:modelValue":
|
|
908
|
+
"onUpdate:modelValue": l[8] || (l[8] = (i) => e.form[e.item.key] = i)
|
|
914
909
|
}, e.getBind(e.item), E(e.getOn(e.item)), {
|
|
915
910
|
disabled: e.getDisabled(e.item)
|
|
916
|
-
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "list" ? (g(), b(
|
|
911
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "list" ? (g(), b(Ne, x({
|
|
917
912
|
key: 9,
|
|
918
913
|
row: e.form,
|
|
919
914
|
field: e.item.key
|
|
920
915
|
}, e.getBind(e.item), E(e.getOn(e.item)), {
|
|
921
916
|
disabled: e.getDisabled(e.item),
|
|
922
917
|
style: { width: "100%" }
|
|
923
|
-
}), null, 16, ["row", "field", "disabled"])) : e.item.type === "treeSelect" ? (g(), b(
|
|
918
|
+
}), null, 16, ["row", "field", "disabled"])) : e.item.type === "treeSelect" ? (g(), b(r(ft), x({
|
|
924
919
|
key: 10,
|
|
925
920
|
modelValue: e.form[e.item.key],
|
|
926
|
-
"onUpdate:modelValue":
|
|
921
|
+
"onUpdate:modelValue": l[9] || (l[9] = (i) => e.form[e.item.key] = i)
|
|
927
922
|
}, e.getBind(e.item), E(e.getOn(e.item)), {
|
|
928
923
|
disabled: e.getDisabled(e.item),
|
|
929
924
|
style: { width: "100%" }
|
|
930
|
-
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "datetime" ? (g(), b(
|
|
925
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "datetime" ? (g(), b(r(Le), x({
|
|
931
926
|
key: 11,
|
|
932
927
|
modelValue: e.form[e.item.key],
|
|
933
|
-
"onUpdate:modelValue":
|
|
934
|
-
}, e.getBind(e.item), E(
|
|
928
|
+
"onUpdate:modelValue": l[10] || (l[10] = (i) => e.form[e.item.key] = i)
|
|
929
|
+
}, e.getBind(e.item), E(e.getOn(e.item)), {
|
|
935
930
|
disabled: e.getDisabled(e.item)
|
|
936
931
|
}), null, 16, ["modelValue", "disabled"])) : e.item.type && typeof e.item.type == "object" ? (g(), b(ee(e.item.type), x({
|
|
937
932
|
key: 12,
|
|
938
933
|
modelValue: e.form[e.item.key],
|
|
939
|
-
"onUpdate:modelValue":
|
|
934
|
+
"onUpdate:modelValue": l[11] || (l[11] = (i) => e.form[e.item.key] = i)
|
|
940
935
|
}, e.getBind(e.item), E(e.getOn(e.item)), {
|
|
941
936
|
disabled: e.getDisabled(e.item)
|
|
942
|
-
}), null, 16, ["modelValue", "disabled"])) : e.item.type && (
|
|
937
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type && (r(W).customComponent[e.item.type] || r(W).customComponent[e.item.type]?.form) ? (g(), b(ee(r(W).customComponent[e.item.type]?.form || r(W).customComponent[e.item.type]), x({
|
|
943
938
|
key: 13,
|
|
944
939
|
modelValue: e.form[e.item.key],
|
|
945
|
-
"onUpdate:modelValue":
|
|
940
|
+
"onUpdate:modelValue": l[12] || (l[12] = (i) => e.form[e.item.key] = i)
|
|
946
941
|
}, e.getBind(e.item), E(e.getOn(e.item)), {
|
|
947
942
|
disabled: e.getDisabled(e.item)
|
|
948
943
|
}), null, 16, ["modelValue", "disabled"])) : V("", !0)
|
|
949
944
|
]),
|
|
950
|
-
S(
|
|
945
|
+
S(o.$slots, "form-" + e.item.key + "-right", {
|
|
951
946
|
row: e.form,
|
|
952
947
|
item: e.item
|
|
953
948
|
})
|
|
954
949
|
]),
|
|
955
|
-
S(
|
|
950
|
+
S(o.$slots, "form-" + e.item.key + "-tip", {
|
|
956
951
|
row: e.form,
|
|
957
952
|
item: e.item
|
|
958
953
|
}, () => [
|
|
@@ -960,10 +955,10 @@ const pt = {
|
|
|
960
955
|
key: 0,
|
|
961
956
|
class: "form-tip-text",
|
|
962
957
|
innerHTML: typeof e.item.form?.tipText == "function" ? e.item.form?.tipText(e.form, e.type) : e.item.form?.tipText
|
|
963
|
-
}, null, 8,
|
|
958
|
+
}, null, 8, Et)) : V("", !0)
|
|
964
959
|
])
|
|
965
960
|
]),
|
|
966
|
-
S(
|
|
961
|
+
S(o.$slots, "form-" + e.item.key + "-end", {
|
|
967
962
|
row: e.form,
|
|
968
963
|
item: e.item
|
|
969
964
|
})
|
|
@@ -973,7 +968,7 @@ const pt = {
|
|
|
973
968
|
}, 8, ["label", "prop", "label-width"]));
|
|
974
969
|
}
|
|
975
970
|
});
|
|
976
|
-
const
|
|
971
|
+
const zt = {
|
|
977
972
|
search: "搜索",
|
|
978
973
|
add: "新增",
|
|
979
974
|
edit: "编辑",
|
|
@@ -1015,8 +1010,8 @@ class C {
|
|
|
1015
1010
|
if (typeof t == "function")
|
|
1016
1011
|
return t(...n);
|
|
1017
1012
|
t = String(t);
|
|
1018
|
-
let
|
|
1019
|
-
return t.replace(/{([^}]+)}/g, (
|
|
1013
|
+
let a = 0;
|
|
1014
|
+
return t.replace(/{([^}]+)}/g, (s, o) => a < n.length ? String(n[a++]) : `{${o}}`);
|
|
1020
1015
|
}
|
|
1021
1016
|
static setI18n = (t) => {
|
|
1022
1017
|
C.curd = ObjectUtil.deepMerge(C.curd, t);
|
|
@@ -1026,7 +1021,7 @@ class C {
|
|
|
1026
1021
|
return this.t(this.curd[t], ...n);
|
|
1027
1022
|
}
|
|
1028
1023
|
/** curd表单 */
|
|
1029
|
-
static curd =
|
|
1024
|
+
static curd = zt;
|
|
1030
1025
|
}
|
|
1031
1026
|
class Z {
|
|
1032
1027
|
/**
|
|
@@ -1046,31 +1041,31 @@ class Z {
|
|
|
1046
1041
|
* @param delAll 是否删除目标对象所有属性
|
|
1047
1042
|
* @returns
|
|
1048
1043
|
*/
|
|
1049
|
-
static setValue = (t, n,
|
|
1050
|
-
|
|
1051
|
-
t[
|
|
1044
|
+
static setValue = (t, n, a = !1) => {
|
|
1045
|
+
a && Z.delAllKey(t), Object.keys(n).forEach((s) => {
|
|
1046
|
+
t[s] !== n[s] && (t[s] = n[s]);
|
|
1052
1047
|
});
|
|
1053
1048
|
};
|
|
1054
1049
|
}
|
|
1055
1050
|
const we = (e) => {
|
|
1056
|
-
const t = re({}), n = () => typeof e == "function" ? e() : e,
|
|
1057
|
-
const
|
|
1058
|
-
return
|
|
1051
|
+
const t = re({}), n = () => typeof e == "function" ? e() : e, a = () => {
|
|
1052
|
+
const s = n();
|
|
1053
|
+
return s ?? t;
|
|
1059
1054
|
};
|
|
1060
1055
|
return {
|
|
1061
1056
|
internal: t,
|
|
1062
1057
|
isExternal: () => n() != null,
|
|
1063
1058
|
get() {
|
|
1064
|
-
return
|
|
1059
|
+
return a();
|
|
1065
1060
|
},
|
|
1066
|
-
set(
|
|
1067
|
-
Z.setValue(
|
|
1061
|
+
set(s) {
|
|
1062
|
+
Z.setValue(a(), s, !0);
|
|
1068
1063
|
},
|
|
1069
|
-
merge(
|
|
1070
|
-
Z.setValue(
|
|
1064
|
+
merge(s) {
|
|
1065
|
+
Z.setValue(a(), s, !1);
|
|
1071
1066
|
},
|
|
1072
1067
|
clear() {
|
|
1073
|
-
Z.delAllKey(
|
|
1068
|
+
Z.delAllKey(a());
|
|
1074
1069
|
}
|
|
1075
1070
|
};
|
|
1076
1071
|
}, me = (e) => {
|
|
@@ -1080,16 +1075,17 @@ const we = (e) => {
|
|
|
1080
1075
|
error: t.error || ""
|
|
1081
1076
|
});
|
|
1082
1077
|
});
|
|
1083
|
-
},
|
|
1084
|
-
field:
|
|
1085
|
-
error:
|
|
1086
|
-
}))), ge = $.EDialog, le = (e) => typeof e.type == "object" ? "component" : e.type || "input",
|
|
1087
|
-
const
|
|
1088
|
-
const
|
|
1089
|
-
if (!
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
if (
|
|
1078
|
+
}, Mt = (e) => e ? typeof e == "string" ? e : e instanceof Error ? e.message : e.message || String(e) : "", ke = (e) => !e || typeof e != "object" ? [] : Object.keys(e).flatMap((t) => (Array.isArray(e[t]) ? e[t] : [e[t]]).map((a) => ({
|
|
1079
|
+
field: a?.field || t,
|
|
1080
|
+
error: Mt(a)
|
|
1081
|
+
}))), ge = $.EDialog, le = (e) => typeof e.type == "object" ? "component" : e.type || "input", Ft = (e, t, n) => {
|
|
1082
|
+
const a = we(() => t.form), s = (l) => Oe(l.update.formGrid || [], l.update.form, l.update.type, l.update.formMaxSpan).map((c) => c.item.key).filter(Boolean), o = async (l) => {
|
|
1083
|
+
const i = n.ruleFormRef.value;
|
|
1084
|
+
if (!i) return !0;
|
|
1085
|
+
await De();
|
|
1086
|
+
const c = s(l), u = Object.keys(l.update.rules || {}).filter((h) => !c.includes(h));
|
|
1087
|
+
if (u.length && i.clearValidate(u), !c.length) return !0;
|
|
1088
|
+
if (!await i.validateField(c, async (h, f) => {
|
|
1093
1089
|
h || me(ke(f));
|
|
1094
1090
|
})) throw !1;
|
|
1095
1091
|
return !0;
|
|
@@ -1103,35 +1099,35 @@ const we = (e) => {
|
|
|
1103
1099
|
loading: !1,
|
|
1104
1100
|
type: ge.Update,
|
|
1105
1101
|
get form() {
|
|
1106
|
-
return
|
|
1102
|
+
return a.get();
|
|
1107
1103
|
},
|
|
1108
|
-
set form(
|
|
1109
|
-
|
|
1104
|
+
set form(l) {
|
|
1105
|
+
a.set(l);
|
|
1110
1106
|
},
|
|
1111
1107
|
formDefault: {},
|
|
1112
1108
|
formColumn: [],
|
|
1113
1109
|
formGrid: [],
|
|
1114
1110
|
formMaxSpan: 12,
|
|
1115
|
-
getDisabled: (
|
|
1111
|
+
getDisabled: (l, i = !1) => {
|
|
1116
1112
|
const c = e();
|
|
1117
|
-
return t.option.table?.editMode &&
|
|
1113
|
+
return t.option.table?.editMode && i ? l.disabled?.table === void 0 ? !1 : $.isFun(l.disabled?.table, c.update.form) : He(l, c.update.type, c.update.form);
|
|
1118
1114
|
},
|
|
1119
|
-
getBind: (
|
|
1120
|
-
const
|
|
1121
|
-
return
|
|
1115
|
+
getBind: (l) => {
|
|
1116
|
+
const i = e();
|
|
1117
|
+
return We(l, i.update.type);
|
|
1122
1118
|
},
|
|
1123
|
-
getOn: (
|
|
1119
|
+
getOn: (l, i) => {
|
|
1124
1120
|
const c = e();
|
|
1125
|
-
return
|
|
1121
|
+
return Je(l, c.update.type, [i || c.update.form, l]);
|
|
1126
1122
|
},
|
|
1127
|
-
getOptions: (
|
|
1128
|
-
const
|
|
1123
|
+
getOptions: (l) => {
|
|
1124
|
+
const i = e();
|
|
1129
1125
|
try {
|
|
1130
|
-
const u =
|
|
1126
|
+
const u = Ye(i.update.formGrid?.length ? i.update.formGrid : i.update.formColumn).find((d) => d.item.key === l)?.item;
|
|
1131
1127
|
return u ? {
|
|
1132
1128
|
options: u.options,
|
|
1133
1129
|
//@ts-ignore
|
|
1134
|
-
bind:
|
|
1130
|
+
bind: i.update.getBind(u)
|
|
1135
1131
|
} : { options: {}, bind: {} };
|
|
1136
1132
|
} catch {
|
|
1137
1133
|
return { options: {}, bind: {} };
|
|
@@ -1139,29 +1135,29 @@ const we = (e) => {
|
|
|
1139
1135
|
},
|
|
1140
1136
|
edit: {
|
|
1141
1137
|
data: {},
|
|
1142
|
-
getApiData: (
|
|
1143
|
-
const
|
|
1144
|
-
if (t.option.form?.editAll) return
|
|
1138
|
+
getApiData: (l) => {
|
|
1139
|
+
const i = e();
|
|
1140
|
+
if (t.option.form?.editAll) return l;
|
|
1145
1141
|
const c = {
|
|
1146
|
-
[t.option.table?.rowKey]:
|
|
1142
|
+
[t.option.table?.rowKey]: i.update.edit.data[t.option.table?.rowKey]
|
|
1147
1143
|
};
|
|
1148
|
-
return Object.keys(
|
|
1149
|
-
|
|
1144
|
+
return Object.keys(i.update.edit.data).forEach((u) => {
|
|
1145
|
+
l[u] !== i.update.edit.data[u] && (c[u] = l[u]);
|
|
1150
1146
|
}), c;
|
|
1151
1147
|
}
|
|
1152
1148
|
},
|
|
1153
1149
|
view: {},
|
|
1154
1150
|
openLoading: !1,
|
|
1155
|
-
open: async (
|
|
1151
|
+
open: async (l, i) => {
|
|
1156
1152
|
const c = e();
|
|
1157
1153
|
if (!(c.update.showContent || c.update.openLoading)) {
|
|
1158
1154
|
$.loading(!0), c.update.openLoading = !0;
|
|
1159
1155
|
try {
|
|
1160
|
-
c.update.type =
|
|
1161
|
-
const u =
|
|
1162
|
-
c.update.edit.data = u ? void 0 : JSONUtil.cp(
|
|
1163
|
-
const
|
|
1164
|
-
Z.setValue(c.update.form,
|
|
1156
|
+
c.update.type = l;
|
|
1157
|
+
const u = l === ge.Add;
|
|
1158
|
+
c.update.edit.data = u ? void 0 : JSONUtil.cp(i), c.update.title = C.tCurd(u ? "add" : l === ge.View ? "view" : "edit");
|
|
1159
|
+
const d = u ? ObjectUtil.deepMerge(JSONUtil.cp(c.update.formDefault), i ? JSONUtil.cp(i) : {}) : JSONUtil.cp(i);
|
|
1160
|
+
Z.setValue(c.update.form, d, !0), await c.initApiData("update"), await t.option.form?.openBefore?.(c.update.form, c.update), (!t.option.table?.inlineEdit || u) && (c.update.show = !0, c.update.showContent = !0), t.option.form?.openAfter?.(c.update.form, c.update);
|
|
1165
1161
|
} catch (u) {
|
|
1166
1162
|
console.error(u);
|
|
1167
1163
|
} finally {
|
|
@@ -1169,109 +1165,109 @@ const we = (e) => {
|
|
|
1169
1165
|
}
|
|
1170
1166
|
}
|
|
1171
1167
|
},
|
|
1172
|
-
validate: async (
|
|
1173
|
-
const
|
|
1168
|
+
validate: async (l = !0) => {
|
|
1169
|
+
const i = e();
|
|
1174
1170
|
try {
|
|
1175
|
-
const c = t.option.table?.editMode ?
|
|
1171
|
+
const c = t.option.table?.editMode ? i.tableEditValidate.validate() : o(i);
|
|
1176
1172
|
return await Promise.all([
|
|
1177
1173
|
c,
|
|
1178
|
-
|
|
1174
|
+
i.formRef.validate()
|
|
1179
1175
|
]), !0;
|
|
1180
1176
|
} catch {
|
|
1181
|
-
return
|
|
1177
|
+
return l && $.fail(C.tCurd("checkFormData")), !1;
|
|
1182
1178
|
}
|
|
1183
1179
|
},
|
|
1184
1180
|
submit: async () => {
|
|
1185
|
-
const
|
|
1186
|
-
if (!await
|
|
1187
|
-
|
|
1188
|
-
const c =
|
|
1181
|
+
const l = e();
|
|
1182
|
+
if (!await l.update.validate() || l.update.loading) return;
|
|
1183
|
+
l.update.loading = !0;
|
|
1184
|
+
const c = l.update.type === ge.Add ? t.option.api.create : t.option.api.update;
|
|
1189
1185
|
try {
|
|
1190
|
-
await t.option.form?.submitBefore?.(
|
|
1186
|
+
await t.option.form?.submitBefore?.(l.update.form, l.update);
|
|
1191
1187
|
} catch {
|
|
1192
|
-
|
|
1188
|
+
l.update.loading = !1;
|
|
1193
1189
|
return;
|
|
1194
1190
|
}
|
|
1195
|
-
let u = ObjectUtil.deepMerge(
|
|
1191
|
+
let u = ObjectUtil.deepMerge(l.update.form, {});
|
|
1196
1192
|
delete u.children;
|
|
1197
|
-
const
|
|
1193
|
+
const d = new Set(t.option.column.filter((h) => h.type === "datetime").map((h) => h.key));
|
|
1198
1194
|
Object.keys(u).forEach((h) => {
|
|
1199
|
-
if (
|
|
1195
|
+
if (d.has(h) && u[h] != null) {
|
|
1200
1196
|
const f = new Date(u[h]).getTime();
|
|
1201
1197
|
isNaN(f) || (u[h] = f);
|
|
1202
1198
|
}
|
|
1203
1199
|
});
|
|
1204
1200
|
try {
|
|
1205
1201
|
if (!c) return;
|
|
1206
|
-
await c({ ...u }),
|
|
1202
|
+
await c({ ...u }), l.update.close(), await l.table.getList(), t.option.form?.submitAfter?.(u, l.update);
|
|
1207
1203
|
} catch (h) {
|
|
1208
1204
|
console.error(h);
|
|
1209
1205
|
} finally {
|
|
1210
|
-
|
|
1206
|
+
l.update.loading = !1;
|
|
1211
1207
|
}
|
|
1212
1208
|
},
|
|
1213
1209
|
close: () => {
|
|
1214
|
-
const
|
|
1215
|
-
|
|
1216
|
-
|
|
1210
|
+
const l = e();
|
|
1211
|
+
l.update.show = !1, l.update.edit.data = void 0, setTimeout(() => {
|
|
1212
|
+
l.update.showContent = !1, n.ruleFormRef.value?.resetFields?.(), a.clear();
|
|
1217
1213
|
}, 350);
|
|
1218
1214
|
}
|
|
1219
1215
|
}
|
|
1220
1216
|
};
|
|
1221
1217
|
}, H = 12, ve = (e, t) => {
|
|
1222
1218
|
e.isForm = t, Array.isArray(e.children) && e.children.forEach((n) => ve(n, t));
|
|
1223
|
-
},
|
|
1219
|
+
}, Dt = (e) => e.isForm === !1 ? !1 : typeof e.show?.form == "boolean" ? e.show.form : !0, Ot = (e, t, n) => (e.form = e.form || { span: t }, n === "column" ? e.form.span = e.form.span ?? 12 : e.form.span = e.form.span ?? t, e.form.span), Ge = (e) => {
|
|
1224
1220
|
const t = e.form;
|
|
1225
1221
|
return t?.row != null && t.row > 0 ? t.row : H;
|
|
1226
|
-
}, ie = (e) => Math.floor((e.gridRow - 1) / H),
|
|
1222
|
+
}, ie = (e) => Math.floor((e.gridRow - 1) / H), He = (e, t, n) => {
|
|
1227
1223
|
if (t === $.EDialog.View)
|
|
1228
1224
|
return e.disabled?.view === void 0 ? !0 : $.isFun(e.disabled?.view, n);
|
|
1229
|
-
const
|
|
1230
|
-
return $.isFun(
|
|
1231
|
-
},
|
|
1225
|
+
const a = e.disabled?.[t === $.EDialog.Add ? "create" : "update"];
|
|
1226
|
+
return $.isFun(a, n);
|
|
1227
|
+
}, We = (e, t) => {
|
|
1232
1228
|
const n = le(e);
|
|
1233
1229
|
return e.options?.[t === $.EDialog.Add ? "formAdd" : "formUpdate"]?.[n] || e.options?.[n] || {};
|
|
1234
|
-
},
|
|
1235
|
-
const
|
|
1236
|
-
return Object.keys(
|
|
1237
|
-
const c =
|
|
1238
|
-
typeof c == "function" ? i
|
|
1230
|
+
}, Je = (e, t, n = []) => {
|
|
1231
|
+
const a = le(e), o = e.options?.[t === $.EDialog.Add ? "formAdd" : "formUpdate"]?.[a]?.on || e.options?.[a]?.on || {}, l = {};
|
|
1232
|
+
return Object.keys(o).forEach((i) => {
|
|
1233
|
+
const c = o[i];
|
|
1234
|
+
typeof c == "function" ? l[i] = function(...u) {
|
|
1239
1235
|
return c.apply(this, [...u, ...n]);
|
|
1240
|
-
} : i
|
|
1241
|
-
}),
|
|
1242
|
-
},
|
|
1243
|
-
const
|
|
1236
|
+
} : l[i] = c;
|
|
1237
|
+
}), l;
|
|
1238
|
+
}, qe = (e, t, n, a, s) => {
|
|
1239
|
+
const o = e, l = o.colSpan ?? e.span;
|
|
1244
1240
|
if (!e.item.form?.spanCol)
|
|
1245
|
-
return
|
|
1246
|
-
const
|
|
1247
|
-
return
|
|
1248
|
-
},
|
|
1249
|
-
const n = (
|
|
1250
|
-
const
|
|
1251
|
-
return
|
|
1241
|
+
return l;
|
|
1242
|
+
const i = s?.maxSpan || 12, c = s?.defaultSpan || i / 2, u = o.gridBand, h = t.filter((f) => u != null ? f.gridBand === u && !$.isFun(f.item.show?.form, n, a) : f.gridRow === o.gridRow && !$.isFun(f.item.show?.form, n, a)).reduce((f, m) => f + (m.colSpan ?? m.span ?? c), 0);
|
|
1243
|
+
return l + h;
|
|
1244
|
+
}, Rt = (e, t) => {
|
|
1245
|
+
const n = (a, s) => {
|
|
1246
|
+
const o = a.gridRow, l = a.gridRow + a.rowSpan - 1, i = s.gridRow, c = s.gridRow + s.rowSpan - 1;
|
|
1247
|
+
return o <= c && i <= l;
|
|
1252
1248
|
};
|
|
1253
|
-
return e.map((
|
|
1254
|
-
...
|
|
1249
|
+
return e.map((a) => e.filter((o) => n(a, o)).length !== 1 || a.colSpan >= t ? a : {
|
|
1250
|
+
...a,
|
|
1255
1251
|
span: t,
|
|
1256
1252
|
colSpan: t,
|
|
1257
1253
|
gridColumn: 1
|
|
1258
1254
|
});
|
|
1259
|
-
},
|
|
1260
|
-
const
|
|
1261
|
-
let
|
|
1262
|
-
const
|
|
1255
|
+
}, Qe = (e, t, n = {}) => {
|
|
1256
|
+
const a = /* @__PURE__ */ new Set(), s = [];
|
|
1257
|
+
let o = 0, l = 0;
|
|
1258
|
+
const i = (m) => Math.floor(m / H) * H, c = (m, w) => `${m},${w}`, u = (m, w, D, T) => {
|
|
1263
1259
|
if (w + D > t) return !1;
|
|
1264
1260
|
for (let O = 0; O < T; O++)
|
|
1265
1261
|
for (let A = 0; A < D; A++)
|
|
1266
|
-
if (
|
|
1262
|
+
if (a.has(c(m + O, w + A))) return !1;
|
|
1267
1263
|
return !0;
|
|
1268
|
-
},
|
|
1264
|
+
}, d = (m, w, D, T) => {
|
|
1269
1265
|
for (let O = 0; O < T; O++)
|
|
1270
1266
|
for (let A = 0; A < D; A++)
|
|
1271
|
-
|
|
1267
|
+
a.add(c(m + O, w + A));
|
|
1272
1268
|
}, h = (m, w, D, T) => {
|
|
1273
|
-
for (let A =
|
|
1274
|
-
const de = A + H, Ce = A ===
|
|
1269
|
+
for (let A = i(m); A < 500 * H; A += H) {
|
|
1270
|
+
const de = A + H, Ce = A === i(m) ? Math.max(A, m) : A;
|
|
1275
1271
|
for (let _ = Ce; _ < de; _++) {
|
|
1276
1272
|
const xe = _ === m ? w : 0;
|
|
1277
1273
|
for (let te = xe; te <= t - D; te++)
|
|
@@ -1280,25 +1276,25 @@ const we = (e) => {
|
|
|
1280
1276
|
}
|
|
1281
1277
|
return { tr: m, tc: w };
|
|
1282
1278
|
}, f = (m, w, D, T) => {
|
|
1283
|
-
const O =
|
|
1279
|
+
const O = i(m);
|
|
1284
1280
|
if (T < H && m + T < O + H) {
|
|
1285
|
-
|
|
1281
|
+
o = m + T, l = w;
|
|
1286
1282
|
return;
|
|
1287
1283
|
}
|
|
1288
1284
|
const A = w + D;
|
|
1289
1285
|
if (A < t) {
|
|
1290
|
-
|
|
1286
|
+
l = A, o = O;
|
|
1291
1287
|
return;
|
|
1292
1288
|
}
|
|
1293
|
-
|
|
1289
|
+
l = 0, o = O + H;
|
|
1294
1290
|
};
|
|
1295
1291
|
return e.forEach((m) => {
|
|
1296
|
-
const w = m.colSpan ?? (m.span === 0 ? t : m.span), D = m.rowSpan ??
|
|
1297
|
-
m.item.form?.rowBreak &&
|
|
1298
|
-
let { tr: T, tc: O } = u(
|
|
1299
|
-
u(T, O, w, D) || ({ tr: T, tc: O } = h(0, 0, w, D)),
|
|
1292
|
+
const w = m.colSpan ?? (m.span === 0 ? t : m.span), D = m.rowSpan ?? Ge(m.item);
|
|
1293
|
+
m.item.form?.rowBreak && s.length && (l = 0, o = i(o) + H);
|
|
1294
|
+
let { tr: T, tc: O } = u(o, l, w, D) ? { tr: o, tc: l } : h(o, l, w, D);
|
|
1295
|
+
u(T, O, w, D) || ({ tr: T, tc: O } = h(0, 0, w, D)), d(T, O, w, D);
|
|
1300
1296
|
const A = T + 1;
|
|
1301
|
-
|
|
1297
|
+
s.push({
|
|
1302
1298
|
...m,
|
|
1303
1299
|
span: w,
|
|
1304
1300
|
colSpan: w,
|
|
@@ -1307,132 +1303,128 @@ const we = (e) => {
|
|
|
1307
1303
|
gridColumn: O + 1,
|
|
1308
1304
|
gridBand: ie({ gridRow: A })
|
|
1309
1305
|
}), f(T, O, w, D);
|
|
1310
|
-
}), n.fillSingleRows ?
|
|
1311
|
-
},
|
|
1312
|
-
const
|
|
1313
|
-
e.forEach((
|
|
1314
|
-
const u = `${
|
|
1315
|
-
|
|
1306
|
+
}), n.fillSingleRows ? Rt(s, t) : s;
|
|
1307
|
+
}, Oe = (e, t, n, a = H) => {
|
|
1308
|
+
const s = e.filter((i) => $.isFun(i.item.show?.form, t, n)), o = /* @__PURE__ */ new Map();
|
|
1309
|
+
e.forEach((i) => {
|
|
1310
|
+
const u = `${i.gridBand ?? ie(i)}:${i.gridColumn}:${i.colSpan}`;
|
|
1311
|
+
o.has(u) || o.set(u, []), o.get(u).push(i);
|
|
1316
1312
|
});
|
|
1317
|
-
const
|
|
1318
|
-
return
|
|
1319
|
-
const c =
|
|
1320
|
-
if (!(
|
|
1321
|
-
const
|
|
1322
|
-
if (
|
|
1323
|
-
const h =
|
|
1324
|
-
|
|
1313
|
+
const l = /* @__PURE__ */ new Map();
|
|
1314
|
+
return o.forEach((i) => {
|
|
1315
|
+
const c = i.reduce((f, m) => f + m.rowSpan, 0);
|
|
1316
|
+
if (!(i.length > 1 && c === H && i.every((f) => f.rowSpan < H))) return;
|
|
1317
|
+
const d = i.filter((f) => $.isFun(f.item.show?.form, t, n));
|
|
1318
|
+
if (d.length !== 1) return;
|
|
1319
|
+
const h = d[0];
|
|
1320
|
+
l.set(h.item.key, {
|
|
1325
1321
|
...h,
|
|
1326
1322
|
rowSpan: H
|
|
1327
1323
|
});
|
|
1328
|
-
}),
|
|
1324
|
+
}), Qe(s.map((i) => l.get(i.item.key) || i), a, {
|
|
1329
1325
|
fillSingleRows: !0
|
|
1330
1326
|
});
|
|
1331
|
-
},
|
|
1327
|
+
}, Xe = (e) => {
|
|
1332
1328
|
const t = /* @__PURE__ */ new Map();
|
|
1333
1329
|
return e.forEach((n) => {
|
|
1334
|
-
const
|
|
1335
|
-
t.has(
|
|
1336
|
-
}), Array.from(t.keys()).sort((n,
|
|
1337
|
-
},
|
|
1338
|
-
if (!
|
|
1339
|
-
const n = t.defaultSpan ?? (t.maxSpan || 12) / 2,
|
|
1340
|
-
return { item: e, span:
|
|
1341
|
-
},
|
|
1342
|
-
const n = [],
|
|
1343
|
-
if (
|
|
1344
|
-
|
|
1330
|
+
const a = n.gridBand ?? ie(n);
|
|
1331
|
+
t.has(a) || t.set(a, []), t.get(a).push(n);
|
|
1332
|
+
}), Array.from(t.keys()).sort((n, a) => n - a).map((n) => t.get(n));
|
|
1333
|
+
}, Ye = (e) => e?.length ? Array.isArray(e[0]) ? e.flat() : e : [], Ut = (e, t) => {
|
|
1334
|
+
if (!Dt(e) || !e.key) return null;
|
|
1335
|
+
const n = t.defaultSpan ?? (t.maxSpan || 12) / 2, a = Ot(e, n, t.layout);
|
|
1336
|
+
return { item: e, span: a };
|
|
1337
|
+
}, At = (e, t = {}) => {
|
|
1338
|
+
const n = [], a = (s) => {
|
|
1339
|
+
if (s.children?.length) {
|
|
1340
|
+
s.children.forEach((l) => a(l));
|
|
1345
1341
|
return;
|
|
1346
1342
|
}
|
|
1347
|
-
const
|
|
1348
|
-
|
|
1343
|
+
const o = Ut(s, t);
|
|
1344
|
+
o && n.push(o);
|
|
1349
1345
|
};
|
|
1350
|
-
return e.forEach((
|
|
1351
|
-
},
|
|
1352
|
-
const n = t.maxSpan ?? 12,
|
|
1353
|
-
if (
|
|
1354
|
-
const
|
|
1346
|
+
return e.forEach((s) => a(s)), n;
|
|
1347
|
+
}, Ze = (e, t = {}) => {
|
|
1348
|
+
const n = t.maxSpan ?? 12, a = t.defaultSpan ?? n / 2, s = t.layout ?? "row", l = At(e, { maxSpan: n, defaultSpan: a, layout: s });
|
|
1349
|
+
if (s === "column") {
|
|
1350
|
+
const i = [];
|
|
1355
1351
|
let c = 1;
|
|
1356
|
-
return
|
|
1357
|
-
const
|
|
1358
|
-
|
|
1352
|
+
return l.forEach((u) => {
|
|
1353
|
+
const d = Ge(u.item), h = n;
|
|
1354
|
+
i.push({
|
|
1359
1355
|
...u,
|
|
1360
1356
|
span: h,
|
|
1361
1357
|
colSpan: h,
|
|
1362
|
-
rowSpan:
|
|
1358
|
+
rowSpan: d,
|
|
1363
1359
|
gridRow: c,
|
|
1364
1360
|
gridColumn: 1,
|
|
1365
1361
|
gridBand: ie({ gridRow: c })
|
|
1366
|
-
}), c +=
|
|
1367
|
-
}), { cells:
|
|
1362
|
+
}), c += d;
|
|
1363
|
+
}), { cells: i, maxSpan: n };
|
|
1368
1364
|
}
|
|
1369
|
-
return { cells:
|
|
1370
|
-
},
|
|
1365
|
+
return { cells: Qe(l, n), maxSpan: n };
|
|
1366
|
+
}, Bt = (e) => e.map((t) => t.item?.show?.form), Tt = (e, t, n) => {
|
|
1371
1367
|
if (!e.rules) return;
|
|
1372
|
-
const
|
|
1368
|
+
const a = {
|
|
1373
1369
|
required: !0,
|
|
1374
1370
|
message: t(e),
|
|
1375
1371
|
trigger: "blur"
|
|
1376
|
-
},
|
|
1377
|
-
(
|
|
1378
|
-
const c = typeof e.rules == "boolean" ? [
|
|
1372
|
+
}, s = le(e), o = e.options?.datetime?.type, l = s === "datetime" && typeof o == "string" && o.includes("range"), i = s === "select" && !!e.options?.select?.multiple;
|
|
1373
|
+
(l || s === "checkbox" || i) && (a.type = "array", a.min = l ? 2 : 1);
|
|
1374
|
+
const c = typeof e.rules == "boolean" ? [a] : e.rules;
|
|
1379
1375
|
return n ? c.map((u) => n(u)) : c;
|
|
1380
|
-
},
|
|
1381
|
-
const
|
|
1382
|
-
if (
|
|
1383
|
-
const
|
|
1384
|
-
return
|
|
1385
|
-
}, a = (i) => {
|
|
1386
|
-
const d = r(i);
|
|
1387
|
-
return typeof o.transform == "function" ? o.transform(d) : d;
|
|
1376
|
+
}, Ue = (e) => typeof e == "function" ? e() : e, _e = (e) => (t, n) => Tt(t, e, (a) => {
|
|
1377
|
+
const s = (o, l) => {
|
|
1378
|
+
if (l && Object.prototype.hasOwnProperty.call(l, t.key) && l[t.key] !== void 0) return l[t.key];
|
|
1379
|
+
const i = Ue(n);
|
|
1380
|
+
return i && Object.prototype.hasOwnProperty.call(i, t.key) ? i[t.key] : o;
|
|
1388
1381
|
};
|
|
1389
|
-
if (
|
|
1390
|
-
const
|
|
1382
|
+
if (a.validator) {
|
|
1383
|
+
const o = a.validator;
|
|
1391
1384
|
return {
|
|
1392
|
-
...
|
|
1393
|
-
|
|
1394
|
-
|
|
1385
|
+
...a,
|
|
1386
|
+
validator: (l, i, c, u) => {
|
|
1387
|
+
const d = Ue(n);
|
|
1388
|
+
return o(l, s(i, u), c, d || u);
|
|
1389
|
+
}
|
|
1395
1390
|
};
|
|
1396
1391
|
}
|
|
1397
|
-
return
|
|
1398
|
-
|
|
1399
|
-
transform: a
|
|
1400
|
-
};
|
|
1401
|
-
}), Ye = (e, t) => {
|
|
1392
|
+
return a;
|
|
1393
|
+
}), et = (e, t) => {
|
|
1402
1394
|
const n = {
|
|
1403
1395
|
input: C.tCurd("placeholderInput"),
|
|
1404
1396
|
select: C.tCurd("placeholderSelect")
|
|
1405
|
-
},
|
|
1406
|
-
return (t || W.error.callback)?.(e.key, e) ||
|
|
1407
|
-
},
|
|
1408
|
-
const
|
|
1409
|
-
e.forEach((
|
|
1410
|
-
const { cells: c, maxSpan: u } =
|
|
1411
|
-
maxSpan:
|
|
1412
|
-
defaultSpan:
|
|
1397
|
+
}, a = (n[le(e) || "input"] || n.input) + e.label;
|
|
1398
|
+
return (t || W.error.callback)?.(e.key, e) || a;
|
|
1399
|
+
}, tt = (e) => _e((t) => et(t, e?.error)), Lt = (e, t, n) => {
|
|
1400
|
+
const a = {}, s = {}, o = t?.maxSpan || 12, l = t?.defaultSpan || o / 2, i = tt(t);
|
|
1401
|
+
e.forEach((d) => ve(d, !0)), Fe(e, a, s, (d) => i(d, n));
|
|
1402
|
+
const { cells: c, maxSpan: u } = Ze(e, {
|
|
1403
|
+
maxSpan: o,
|
|
1404
|
+
defaultSpan: l,
|
|
1413
1405
|
layout: t?.layout
|
|
1414
1406
|
});
|
|
1415
1407
|
return {
|
|
1416
|
-
formDefault:
|
|
1417
|
-
rules:
|
|
1408
|
+
formDefault: a,
|
|
1409
|
+
rules: s,
|
|
1418
1410
|
formGrid: c,
|
|
1419
1411
|
formMaxSpan: u,
|
|
1420
|
-
formColumn:
|
|
1412
|
+
formColumn: Xe(c)
|
|
1421
1413
|
};
|
|
1422
|
-
}, Fe = (e, t, n,
|
|
1423
|
-
const
|
|
1424
|
-
if (
|
|
1425
|
-
|
|
1414
|
+
}, Fe = (e, t, n, a) => {
|
|
1415
|
+
const s = (o) => {
|
|
1416
|
+
if (o.children?.length) {
|
|
1417
|
+
o.children.forEach((l) => s(l));
|
|
1426
1418
|
return;
|
|
1427
1419
|
}
|
|
1428
|
-
if (
|
|
1429
|
-
t[
|
|
1430
|
-
const
|
|
1431
|
-
|
|
1420
|
+
if (o.key) {
|
|
1421
|
+
t[o.key] = o.value;
|
|
1422
|
+
const l = a(o);
|
|
1423
|
+
l && (n[o.key] = l);
|
|
1432
1424
|
}
|
|
1433
1425
|
};
|
|
1434
|
-
e.forEach(
|
|
1435
|
-
},
|
|
1426
|
+
e.forEach(s);
|
|
1427
|
+
}, jt = { class: "curd-form-cell-inner" }, ot = /* @__PURE__ */ q({
|
|
1436
1428
|
__name: "layout",
|
|
1437
1429
|
props: {
|
|
1438
1430
|
formGrid: {},
|
|
@@ -1447,53 +1439,53 @@ const we = (e) => {
|
|
|
1447
1439
|
getDisabled: { type: Function }
|
|
1448
1440
|
},
|
|
1449
1441
|
setup(e) {
|
|
1450
|
-
const t = $.isFun, n = e,
|
|
1442
|
+
const t = $.isFun, n = e, a = ae(() => Oe(n.formGrid, n.form, n.type, n.maxSpan)), s = ae(() => {
|
|
1451
1443
|
const f = Array.from(
|
|
1452
1444
|
new Set(
|
|
1453
|
-
|
|
1445
|
+
a.value.map((m) => m.gridBand ?? ie(m))
|
|
1454
1446
|
)
|
|
1455
1447
|
).sort((m, w) => m - w);
|
|
1456
1448
|
return new Map(f.map((m, w) => [m, w]));
|
|
1457
|
-
}),
|
|
1449
|
+
}), o = ae(() => ({
|
|
1458
1450
|
gridTemplateColumns: `repeat(${n.maxSpan}, minmax(0, 1fr))`
|
|
1459
|
-
})),
|
|
1451
|
+
})), l = ae(() => {
|
|
1460
1452
|
let f = 0;
|
|
1461
|
-
return
|
|
1453
|
+
return a.value.forEach((m) => {
|
|
1462
1454
|
const w = m.gridRow + m.rowSpan - 1;
|
|
1463
1455
|
w > f && (f = w);
|
|
1464
1456
|
}), f;
|
|
1465
|
-
}),
|
|
1457
|
+
}), i = (f) => f.gridRow + f.rowSpan - 1 >= l.value, c = (f) => f.rowSpan >= H, u = (f) => {
|
|
1466
1458
|
const m = f.gridBand ?? ie(f);
|
|
1467
|
-
return
|
|
1468
|
-
},
|
|
1459
|
+
return s.value.get(m) ?? m;
|
|
1460
|
+
}, d = (f) => qe(f, a.value, n.form, n.type, {
|
|
1469
1461
|
maxSpan: n.maxSpan,
|
|
1470
1462
|
defaultSpan: n.formOption?.defaultSpan
|
|
1471
1463
|
}), h = (f) => {
|
|
1472
|
-
const m =
|
|
1464
|
+
const m = d(f) || f.colSpan;
|
|
1473
1465
|
return {
|
|
1474
1466
|
gridRow: `${f.gridRow} / span ${f.rowSpan}`,
|
|
1475
1467
|
gridColumn: `${f.gridColumn} / span ${m}`
|
|
1476
1468
|
};
|
|
1477
1469
|
};
|
|
1478
|
-
return (f, m) =>
|
|
1470
|
+
return (f, m) => r(t)(r(Bt)(e.formGrid), e.form, e.type) ? (g(), v(B, { key: 0 }, [
|
|
1479
1471
|
S(f.$slots, "form-start", { row: e.form }),
|
|
1480
1472
|
R("div", {
|
|
1481
1473
|
class: J(["curd-form-grid", { stripe: e.stripe !== !1 }]),
|
|
1482
|
-
style: pe(
|
|
1474
|
+
style: pe(o.value)
|
|
1483
1475
|
}, [
|
|
1484
|
-
(g(!0), v(B, null, G(
|
|
1476
|
+
(g(!0), v(B, null, G(a.value, (w) => (g(), v("div", {
|
|
1485
1477
|
key: w.item.key,
|
|
1486
1478
|
class: J(["curd-form-grid-cell", [
|
|
1487
1479
|
e.stripe !== !1 && u(w) % 2 === 0 ? "stripe-band-odd" : "",
|
|
1488
1480
|
w.gridColumn > 1 ? "has-col-border" : "",
|
|
1489
|
-
e.stripe !== !1 &&
|
|
1481
|
+
e.stripe !== !1 && i(w) ? "is-last-row" : "",
|
|
1490
1482
|
c(w) ? "is-row-span" : "",
|
|
1491
1483
|
`form-item-col-${w.item.key}`
|
|
1492
1484
|
]]),
|
|
1493
1485
|
style: pe(h(w))
|
|
1494
1486
|
}, [
|
|
1495
|
-
R("div",
|
|
1496
|
-
|
|
1487
|
+
R("div", jt, [
|
|
1488
|
+
r(t)(w.item.show?.form, e.form, e.type) ? (g(), b($t, {
|
|
1497
1489
|
key: 0,
|
|
1498
1490
|
class: J({ "is-row-span-field": c(w) }),
|
|
1499
1491
|
item: w.item,
|
|
@@ -1517,7 +1509,7 @@ const we = (e) => {
|
|
|
1517
1509
|
S(f.$slots, "form-end", { row: e.form })
|
|
1518
1510
|
], 64)) : V("", !0);
|
|
1519
1511
|
}
|
|
1520
|
-
}),
|
|
1512
|
+
}), Kt = /* @__PURE__ */ q({
|
|
1521
1513
|
__name: "column",
|
|
1522
1514
|
props: {
|
|
1523
1515
|
option: {
|
|
@@ -1534,61 +1526,62 @@ const we = (e) => {
|
|
|
1534
1526
|
}
|
|
1535
1527
|
},
|
|
1536
1528
|
setup(e, { expose: t }) {
|
|
1537
|
-
const n = $.EDialog,
|
|
1538
|
-
let
|
|
1539
|
-
const
|
|
1540
|
-
|
|
1541
|
-
|
|
1529
|
+
const n = $.EDialog, a = X(), s = e;
|
|
1530
|
+
let o = we(s.form);
|
|
1531
|
+
const l = Me.getConf("curdConf"), i = "formRef-" + StrUtil.getId();
|
|
1532
|
+
Pe(() => {
|
|
1533
|
+
l?.formRef?.remove(i);
|
|
1542
1534
|
});
|
|
1543
1535
|
const c = re({
|
|
1544
1536
|
rules: {},
|
|
1545
1537
|
show: !0,
|
|
1546
1538
|
formDefault: {},
|
|
1547
|
-
type:
|
|
1539
|
+
type: s.type || l?.update?.type || n.Add,
|
|
1548
1540
|
formColumn: [],
|
|
1549
1541
|
formGrid: [],
|
|
1550
1542
|
formMaxSpan: 12,
|
|
1551
1543
|
get form() {
|
|
1552
|
-
return
|
|
1544
|
+
return o.get();
|
|
1553
1545
|
},
|
|
1554
1546
|
set form(u) {
|
|
1555
|
-
|
|
1547
|
+
o.set(u);
|
|
1556
1548
|
},
|
|
1557
|
-
getDisabled: (u) =>
|
|
1558
|
-
getBind: (u) =>
|
|
1559
|
-
getOn: (u) =>
|
|
1549
|
+
getDisabled: (u) => He(u, c.type, c.form),
|
|
1550
|
+
getBind: (u) => We(u, c.type),
|
|
1551
|
+
getOn: (u) => Je(u, c.type, [c.form, u]),
|
|
1560
1552
|
initColumnForm: () => {
|
|
1561
|
-
const u =
|
|
1562
|
-
c.formDefault =
|
|
1553
|
+
const u = o, d = Lt(s.option.column, s.option.form, () => u.get());
|
|
1554
|
+
c.formDefault = d.formDefault, c.rules = d.rules, c.formGrid = d.formGrid, c.formMaxSpan = d.formMaxSpan, c.formColumn = d.formColumn, c.type === n.Add ? u.isExternal() ? u.merge(JSONUtil.cp(c.formDefault)) : u.set(JSONUtil.cp(c.formDefault)) : !u.isExternal() && s.form && u.set(JSONUtil.cp(s.form));
|
|
1563
1555
|
}
|
|
1564
1556
|
});
|
|
1565
|
-
return
|
|
1557
|
+
return l?.formRef?.set(i, {
|
|
1566
1558
|
validate: async (u) => {
|
|
1567
|
-
const
|
|
1568
|
-
if (!
|
|
1559
|
+
const d = a.value;
|
|
1560
|
+
if (!d)
|
|
1569
1561
|
return u?.(!0), !0;
|
|
1570
|
-
|
|
1571
|
-
|
|
1562
|
+
await De();
|
|
1563
|
+
const h = Oe(c.formGrid || [], c.form, c.type, c.formMaxSpan).map((w) => w.item.key).filter(Boolean), f = Object.keys(c.rules || {}).filter((w) => !h.includes(w));
|
|
1564
|
+
if (f.length && d.clearValidate(f), !h.length)
|
|
1572
1565
|
return u?.(!0), !0;
|
|
1573
|
-
const m = await
|
|
1566
|
+
const m = await d.validateField(h, async (w, D) => {
|
|
1574
1567
|
w || me(ke(D));
|
|
1575
1568
|
});
|
|
1576
1569
|
if (u?.(!!m), !m) throw !1;
|
|
1577
1570
|
return !0;
|
|
1578
1571
|
}
|
|
1579
|
-
}),
|
|
1580
|
-
() =>
|
|
1572
|
+
}), s.option.form?.initStart?.(c), c.initColumnForm(), s.option.form?.initEnd?.(c), Ke(
|
|
1573
|
+
() => s.form,
|
|
1581
1574
|
(u) => {
|
|
1582
|
-
|
|
1575
|
+
o = we(u), c.initColumnForm();
|
|
1583
1576
|
}
|
|
1584
|
-
), t({ ref:
|
|
1577
|
+
), t({ ref: a, conf: c }), (u, d) => (g(), b(r(oe), {
|
|
1585
1578
|
ref_key: "ruleFormRef",
|
|
1586
|
-
ref:
|
|
1579
|
+
ref: a,
|
|
1587
1580
|
model: c.form,
|
|
1588
1581
|
rules: c.rules
|
|
1589
1582
|
}, {
|
|
1590
1583
|
default: p(() => [
|
|
1591
|
-
c.show ? (g(), b(
|
|
1584
|
+
c.show ? (g(), b(ot, {
|
|
1592
1585
|
key: 0,
|
|
1593
1586
|
"form-grid": c.formGrid,
|
|
1594
1587
|
"max-span": c.formMaxSpan,
|
|
@@ -1612,23 +1605,23 @@ const we = (e) => {
|
|
|
1612
1605
|
_: 3
|
|
1613
1606
|
}, 8, ["model", "rules"]));
|
|
1614
1607
|
}
|
|
1615
|
-
}),
|
|
1616
|
-
const t =
|
|
1617
|
-
return t?.validate ? new Promise((n,
|
|
1618
|
-
let
|
|
1619
|
-
const
|
|
1620
|
-
|
|
1608
|
+
}), Pt = (e) => e?.value || e, It = (e) => {
|
|
1609
|
+
const t = Pt(e);
|
|
1610
|
+
return t?.validate ? new Promise((n, a) => {
|
|
1611
|
+
let s = !1;
|
|
1612
|
+
const o = (l, i) => {
|
|
1613
|
+
s || (s = !0, l === !1 ? (me(ke(i)), a(!1)) : n(!0));
|
|
1621
1614
|
};
|
|
1622
1615
|
try {
|
|
1623
|
-
const
|
|
1624
|
-
|
|
1625
|
-
me(ke(
|
|
1626
|
-
}) : (
|
|
1627
|
-
} catch (
|
|
1628
|
-
|
|
1616
|
+
const l = t.validate(o);
|
|
1617
|
+
l && typeof l.then == "function" ? l.then((i) => o(i)).catch((i) => {
|
|
1618
|
+
me(ke(i?.fields || i)), a(i);
|
|
1619
|
+
}) : (l !== void 0 || t.validate.length === 0) && o(l);
|
|
1620
|
+
} catch (l) {
|
|
1621
|
+
a(l);
|
|
1629
1622
|
}
|
|
1630
1623
|
}) : Promise.resolve(!0);
|
|
1631
|
-
},
|
|
1624
|
+
}, Nt = () => {
|
|
1632
1625
|
const e = re({
|
|
1633
1626
|
formRef: {
|
|
1634
1627
|
map: {},
|
|
@@ -1640,7 +1633,7 @@ const we = (e) => {
|
|
|
1640
1633
|
},
|
|
1641
1634
|
validate() {
|
|
1642
1635
|
const t = Object.keys(e.formRef.map).map((n) => e.formRef.map[n]);
|
|
1643
|
-
return Promise.all(t.map((n) =>
|
|
1636
|
+
return Promise.all(t.map((n) => It(n))).then(() => !0);
|
|
1644
1637
|
}
|
|
1645
1638
|
},
|
|
1646
1639
|
/**
|
|
@@ -1659,20 +1652,20 @@ const we = (e) => {
|
|
|
1659
1652
|
* } }, 'formRef-1')
|
|
1660
1653
|
* @returns
|
|
1661
1654
|
*/
|
|
1662
|
-
regFormRef(t, n,
|
|
1663
|
-
t ?
|
|
1664
|
-
validate: async (
|
|
1655
|
+
regFormRef(t, n, a) {
|
|
1656
|
+
t ? a ? e.formRef.set(n, {
|
|
1657
|
+
validate: async (s) => {
|
|
1665
1658
|
try {
|
|
1666
|
-
|
|
1659
|
+
s(await a());
|
|
1667
1660
|
} catch {
|
|
1668
|
-
|
|
1661
|
+
s(!1);
|
|
1669
1662
|
}
|
|
1670
1663
|
}
|
|
1671
1664
|
}) : e.formRef.set(n, t) : e.formRef.remove(n);
|
|
1672
1665
|
}
|
|
1673
1666
|
});
|
|
1674
1667
|
return e;
|
|
1675
|
-
},
|
|
1668
|
+
}, Gt = (e, t) => {
|
|
1676
1669
|
const n = we(() => t.searchForm);
|
|
1677
1670
|
return {
|
|
1678
1671
|
search: {
|
|
@@ -1682,35 +1675,35 @@ const we = (e) => {
|
|
|
1682
1675
|
get form() {
|
|
1683
1676
|
return n.get();
|
|
1684
1677
|
},
|
|
1685
|
-
set form(
|
|
1686
|
-
n.set(
|
|
1678
|
+
set form(a) {
|
|
1679
|
+
n.set(a);
|
|
1687
1680
|
},
|
|
1688
1681
|
formDefault: {},
|
|
1689
|
-
getPlaceholder: (
|
|
1682
|
+
getPlaceholder: (a, s = C.tCurd("placeholderInput")) => a.text?.search?.placeholder === void 0 ? `${s}${a.label}` : a.text?.search?.placeholder,
|
|
1690
1683
|
getFormData: () => {
|
|
1691
|
-
const
|
|
1692
|
-
let
|
|
1693
|
-
t.option.column.forEach((
|
|
1694
|
-
(typeof
|
|
1684
|
+
const a = e();
|
|
1685
|
+
let s = {};
|
|
1686
|
+
t.option.column.forEach((l) => {
|
|
1687
|
+
(typeof l.show?.search == "function" ? l.show?.search(a.search.form) : l.show?.search) && (s[l.key] = a.search.form[l.key]);
|
|
1695
1688
|
});
|
|
1696
|
-
const
|
|
1697
|
-
return
|
|
1689
|
+
const o = t.option.search?.before?.(s);
|
|
1690
|
+
return o && (s = o), s;
|
|
1698
1691
|
},
|
|
1699
1692
|
reset: () => {
|
|
1700
|
-
const
|
|
1701
|
-
Object.keys(
|
|
1702
|
-
t.option.search?.resetMode === "none" ?
|
|
1693
|
+
const a = e(), s = a.search.formDefault;
|
|
1694
|
+
Object.keys(s).forEach((l) => {
|
|
1695
|
+
t.option.search?.resetMode === "none" ? s[l] = void 0 : s[l] = a.search.formDefault[l];
|
|
1703
1696
|
});
|
|
1704
|
-
const
|
|
1705
|
-
Z.setValue(
|
|
1697
|
+
const o = ObjectUtil.deepMerge(s, {});
|
|
1698
|
+
Z.setValue(a.search.form, o, !0), a.page.num = 1, t.option.init !== !1 && a.table.getList();
|
|
1706
1699
|
},
|
|
1707
1700
|
submit: () => {
|
|
1708
|
-
const
|
|
1709
|
-
|
|
1701
|
+
const a = e();
|
|
1702
|
+
a.page.num = 1, a.table.getList();
|
|
1710
1703
|
}
|
|
1711
1704
|
}
|
|
1712
1705
|
};
|
|
1713
|
-
},
|
|
1706
|
+
}, Ht = (e, t) => ({
|
|
1714
1707
|
page: {
|
|
1715
1708
|
num: 1,
|
|
1716
1709
|
total: 0,
|
|
@@ -1720,40 +1713,40 @@ const we = (e) => {
|
|
|
1720
1713
|
sizeList: t.option.page?.sizeList || L.config.pagination.pageSizes,
|
|
1721
1714
|
pagerCount: t.option.page?.pagerCount || L.config.pagination.pagerCount,
|
|
1722
1715
|
getQuery: (n = {}) => {
|
|
1723
|
-
const
|
|
1716
|
+
const a = e();
|
|
1724
1717
|
return {
|
|
1725
|
-
[L.config.field.page.size]: n.size ||
|
|
1726
|
-
[L.config.field.page.num]: n.num ||
|
|
1727
|
-
...
|
|
1718
|
+
[L.config.field.page.size]: n.size || a.page.size,
|
|
1719
|
+
[L.config.field.page.num]: n.num || a.page.num,
|
|
1720
|
+
...a.search.getFormData()
|
|
1728
1721
|
};
|
|
1729
1722
|
}
|
|
1730
1723
|
}
|
|
1731
|
-
}),
|
|
1724
|
+
}), Wt = (e, t, n) => ({
|
|
1732
1725
|
table: {
|
|
1733
1726
|
op: {
|
|
1734
|
-
width: (...
|
|
1727
|
+
width: (...a) => a.filter((o) => o).length * 30 + 60
|
|
1735
1728
|
},
|
|
1736
1729
|
loading: !1,
|
|
1737
1730
|
data: [],
|
|
1738
1731
|
expand: {
|
|
1739
1732
|
isExpand: !1,
|
|
1740
1733
|
rowKeys: [],
|
|
1741
|
-
change: (
|
|
1734
|
+
change: (a, s) => {
|
|
1742
1735
|
},
|
|
1743
1736
|
all: () => {
|
|
1744
|
-
const
|
|
1745
|
-
if (
|
|
1746
|
-
|
|
1737
|
+
const a = e();
|
|
1738
|
+
if (a.table.expand.isExpand)
|
|
1739
|
+
a.table.expand.rowKeys = [];
|
|
1747
1740
|
else {
|
|
1748
|
-
const
|
|
1749
|
-
let
|
|
1750
|
-
return
|
|
1751
|
-
|
|
1752
|
-
}),
|
|
1741
|
+
const s = (o) => {
|
|
1742
|
+
let l = [];
|
|
1743
|
+
return o.forEach((i) => {
|
|
1744
|
+
l.push(i[t.option.table.rowKey]), i.children?.length && (l = l.concat(s(i.children)));
|
|
1745
|
+
}), l;
|
|
1753
1746
|
};
|
|
1754
|
-
|
|
1747
|
+
a.table.expand.rowKeys = s(a.table.data);
|
|
1755
1748
|
}
|
|
1756
|
-
|
|
1749
|
+
a.table.expand.isExpand = !a.table.expand.isExpand;
|
|
1757
1750
|
}
|
|
1758
1751
|
},
|
|
1759
1752
|
column: {
|
|
@@ -1767,114 +1760,114 @@ const we = (e) => {
|
|
|
1767
1760
|
group: {
|
|
1768
1761
|
expand: !1,
|
|
1769
1762
|
toggleExpandAll: () => {
|
|
1770
|
-
const
|
|
1771
|
-
|
|
1772
|
-
const
|
|
1773
|
-
|
|
1774
|
-
|
|
1763
|
+
const a = e(), s = !a.table.header.group.expand;
|
|
1764
|
+
a.table.header.group.expand = s;
|
|
1765
|
+
const o = (l) => {
|
|
1766
|
+
l.forEach((i) => {
|
|
1767
|
+
i.table?.header?.group !== void 0 && (i.table.header.group = !s), i.table?.header?.groupKey !== void 0 && (i.table.header.show = s), Array.isArray(i.children) && i.children.length && o(i.children);
|
|
1775
1768
|
});
|
|
1776
1769
|
};
|
|
1777
|
-
a
|
|
1770
|
+
o(a.table.column.list);
|
|
1778
1771
|
}
|
|
1779
1772
|
}
|
|
1780
1773
|
},
|
|
1781
1774
|
getList: async () => {
|
|
1782
|
-
const
|
|
1783
|
-
|
|
1784
|
-
const
|
|
1775
|
+
const a = e();
|
|
1776
|
+
a.table.loading = !0;
|
|
1777
|
+
const s = t.option.api.list, o = JSONUtil.cp(a.table.selection.list);
|
|
1785
1778
|
try {
|
|
1786
|
-
await
|
|
1787
|
-
let
|
|
1788
|
-
if (
|
|
1779
|
+
await a.initApiData("init");
|
|
1780
|
+
let l = {};
|
|
1781
|
+
if (a.table.sort.prop) {
|
|
1789
1782
|
const { props: w, order: D } = L.config.table.sort;
|
|
1790
|
-
|
|
1791
|
-
[w.field]:
|
|
1792
|
-
[D.field]:
|
|
1783
|
+
l = {
|
|
1784
|
+
[w.field]: a.table.sort.prop,
|
|
1785
|
+
[D.field]: a.table.sort.order
|
|
1793
1786
|
};
|
|
1794
1787
|
}
|
|
1795
|
-
const
|
|
1796
|
-
...
|
|
1797
|
-
...
|
|
1798
|
-
}), c = L.config.field.result, u =
|
|
1788
|
+
const i = await s({
|
|
1789
|
+
...a.page.getQuery(),
|
|
1790
|
+
...l
|
|
1791
|
+
}), c = L.config.field.result, u = i.data || { [c.list]: i }, d = (Array.isArray(u[c.list]), u[c.list]), h = Ye(a.update.formGrid?.length ? a.update.formGrid : a.update.formColumn), m = ObjectUtil.deepMerge({ data: d }, {}).data.map((w) => (Object.keys(w).forEach((T) => {
|
|
1799
1792
|
const O = h.find((A) => A.item.key === T);
|
|
1800
1793
|
O && ["select", "radio"].includes(O.item.type) && (O.item.table.format || (O.item.table.format = (A) => O.item.options[O.item.type].data?.find((de) => de.value == A[T])?.label || A[T]));
|
|
1801
1794
|
}), w));
|
|
1802
|
-
|
|
1803
|
-
|
|
1795
|
+
a.table.data = t.option.data ? await t.option.data(m, d) : m, a.tableEditValidate?.clear?.(), a.page.total = u[c.total] || 0, setTimeout(() => {
|
|
1796
|
+
a.table.selection.setList(o);
|
|
1804
1797
|
}, 20);
|
|
1805
|
-
} catch (
|
|
1806
|
-
console.error(
|
|
1798
|
+
} catch (l) {
|
|
1799
|
+
console.error(l);
|
|
1807
1800
|
} finally {
|
|
1808
|
-
|
|
1801
|
+
a.table.loading = !1;
|
|
1809
1802
|
}
|
|
1810
1803
|
},
|
|
1811
1804
|
selection: {
|
|
1812
1805
|
list: [],
|
|
1813
|
-
change: (
|
|
1814
|
-
e().table.selection.list =
|
|
1806
|
+
change: (a) => {
|
|
1807
|
+
e().table.selection.list = a;
|
|
1815
1808
|
},
|
|
1816
|
-
setList: (
|
|
1817
|
-
const
|
|
1818
|
-
|
|
1819
|
-
const
|
|
1820
|
-
if (
|
|
1821
|
-
const
|
|
1822
|
-
const
|
|
1809
|
+
setList: (a, s) => {
|
|
1810
|
+
const o = e();
|
|
1811
|
+
o.table.selection.list = [];
|
|
1812
|
+
const l = n.tableRef.value;
|
|
1813
|
+
if (l?.clearSelection(), !l || !a?.length) return;
|
|
1814
|
+
const i = t.option.table?.rowKey, c = (u) => {
|
|
1815
|
+
const d = (h) => {
|
|
1823
1816
|
for (const f of h) {
|
|
1824
|
-
if (
|
|
1825
|
-
if (f[
|
|
1817
|
+
if (i != null && i !== "") {
|
|
1818
|
+
if (f[i] === u[i]) return f;
|
|
1826
1819
|
} else if (f === u)
|
|
1827
1820
|
return f;
|
|
1828
1821
|
if (Array.isArray(f.children) && f.children.length) {
|
|
1829
|
-
const m =
|
|
1822
|
+
const m = d(f.children);
|
|
1830
1823
|
if (m !== void 0) return m;
|
|
1831
1824
|
}
|
|
1832
1825
|
}
|
|
1833
1826
|
};
|
|
1834
|
-
return
|
|
1827
|
+
return d(o.table.data);
|
|
1835
1828
|
};
|
|
1836
|
-
|
|
1837
|
-
const
|
|
1838
|
-
if (
|
|
1839
|
-
if (
|
|
1840
|
-
const h = () =>
|
|
1841
|
-
|
|
1829
|
+
a.forEach((u) => {
|
|
1830
|
+
const d = c(u);
|
|
1831
|
+
if (d)
|
|
1832
|
+
if (s) {
|
|
1833
|
+
const h = () => l.toggleRowSelection(d, !0, !1);
|
|
1834
|
+
s(u) !== !1 && h();
|
|
1842
1835
|
} else
|
|
1843
|
-
|
|
1836
|
+
l.toggleRowSelection(d, !0, !1);
|
|
1844
1837
|
});
|
|
1845
1838
|
}
|
|
1846
1839
|
},
|
|
1847
1840
|
sort: {
|
|
1848
1841
|
prop: "",
|
|
1849
1842
|
order: "",
|
|
1850
|
-
change: (
|
|
1851
|
-
const
|
|
1852
|
-
L.config.table.sort.resetPage && (
|
|
1853
|
-
const
|
|
1854
|
-
if (
|
|
1855
|
-
|
|
1843
|
+
change: (a) => {
|
|
1844
|
+
const s = e();
|
|
1845
|
+
L.config.table.sort.resetPage && (s.page.num = 1);
|
|
1846
|
+
const o = L.config.table.sort;
|
|
1847
|
+
if (o.change) {
|
|
1848
|
+
o.change(a, s);
|
|
1856
1849
|
return;
|
|
1857
1850
|
}
|
|
1858
|
-
|
|
1851
|
+
s.table.sort.prop = a.prop, a.order === null ? (s.table.sort.order = "", s.table.sort.prop = "") : s.table.sort.order = a.order === "ascending" ? o.order.asc : o.order.desc, s.table.getList();
|
|
1859
1852
|
}
|
|
1860
1853
|
}
|
|
1861
1854
|
}
|
|
1862
|
-
}),
|
|
1863
|
-
const n = re({}),
|
|
1864
|
-
let
|
|
1865
|
-
const
|
|
1866
|
-
let k =
|
|
1867
|
-
return k || (
|
|
1868
|
-
},
|
|
1855
|
+
}), Jt = (e, t) => {
|
|
1856
|
+
const n = re({}), a = /* @__PURE__ */ new WeakMap();
|
|
1857
|
+
let s = 0;
|
|
1858
|
+
const o = (y) => {
|
|
1859
|
+
let k = a.get(y);
|
|
1860
|
+
return k || (s += 1, k = `fallback-${s}`, a.set(y, k)), k;
|
|
1861
|
+
}, l = (y) => {
|
|
1869
1862
|
const k = t.option.table?.rowKey, z = k ? y[k] : void 0;
|
|
1870
|
-
return z != null && z !== "" ? String(z) :
|
|
1871
|
-
},
|
|
1863
|
+
return z != null && z !== "" ? String(z) : o(y);
|
|
1864
|
+
}, i = (y, k) => `${l(y)}-${k.key}`, c = (y) => et(y, t.option.form?.error), u = _e(c), d = () => {
|
|
1872
1865
|
Object.keys(n).forEach((y) => {
|
|
1873
1866
|
delete n[y];
|
|
1874
1867
|
});
|
|
1875
1868
|
}, h = (y, k) => {
|
|
1876
|
-
delete n[
|
|
1877
|
-
}, f = (y, k) => n[
|
|
1869
|
+
delete n[i(y, k)];
|
|
1870
|
+
}, f = (y, k) => n[i(y, k)] || "", m = (y, k) => y.message || c(k), w = (y) => y == null || y === "" || Array.isArray(y) && y.length === 0, D = (y) => {
|
|
1878
1871
|
if (typeof y == "number") return y;
|
|
1879
1872
|
if (typeof y == "string" || Array.isArray(y)) return y.length;
|
|
1880
1873
|
}, T = (y, k) => {
|
|
@@ -1952,7 +1945,7 @@ const we = (e) => {
|
|
|
1952
1945
|
for (const P of K) {
|
|
1953
1946
|
const j = await A(P, y[k.key], k);
|
|
1954
1947
|
if (j !== !0)
|
|
1955
|
-
return n[
|
|
1948
|
+
return n[i(y, k)] = j, {
|
|
1956
1949
|
field: k.key,
|
|
1957
1950
|
error: j
|
|
1958
1951
|
};
|
|
@@ -1969,11 +1962,11 @@ const we = (e) => {
|
|
|
1969
1962
|
return {
|
|
1970
1963
|
tableEditValidate: {
|
|
1971
1964
|
errors: n,
|
|
1972
|
-
clear:
|
|
1965
|
+
clear: d,
|
|
1973
1966
|
clearField: h,
|
|
1974
1967
|
getFieldError: f,
|
|
1975
1968
|
validate: async () => {
|
|
1976
|
-
if (
|
|
1969
|
+
if (d(), !t.option.table?.editMode) return !0;
|
|
1977
1970
|
const y = e(), k = _(), z = te(y.table.data || []), P = (await Promise.all(z.flatMap((j) => k.map((I) => xe(j, I))))).filter((j) => j !== !0);
|
|
1978
1971
|
if (P.length)
|
|
1979
1972
|
throw me(P), !1;
|
|
@@ -1982,7 +1975,7 @@ const we = (e) => {
|
|
|
1982
1975
|
}
|
|
1983
1976
|
};
|
|
1984
1977
|
};
|
|
1985
|
-
class
|
|
1978
|
+
class qt {
|
|
1986
1979
|
/**
|
|
1987
1980
|
* 导出数据为 Excel 文件(.xlsx),自动触发浏览器下载
|
|
1988
1981
|
*
|
|
@@ -1990,24 +1983,24 @@ class Jt {
|
|
|
1990
1983
|
* @param columns - 列配置数组,需包含 `key`(数据字段)和 `label`(Excel 表头)
|
|
1991
1984
|
* @param fileName - 文件名(不含扩展名),支持字符串或返回字符串的函数;默认生成「导出数据_日期_时间戳」
|
|
1992
1985
|
*/
|
|
1993
|
-
static exportToExcel = async (t, n,
|
|
1986
|
+
static exportToExcel = async (t, n, a) => {
|
|
1994
1987
|
if (!t || t.length === 0) return;
|
|
1995
|
-
const
|
|
1988
|
+
const s = await $.loadModule("xlsx"), o = t.map((c) => {
|
|
1996
1989
|
const u = {};
|
|
1997
|
-
return n.forEach((
|
|
1998
|
-
u[
|
|
1990
|
+
return n.forEach((d) => {
|
|
1991
|
+
u[d.label] = c[d.key];
|
|
1999
1992
|
}), u;
|
|
2000
|
-
}),
|
|
2001
|
-
|
|
1993
|
+
}), l = s.utils.json_to_sheet(o), i = s.utils.book_new();
|
|
1994
|
+
s.utils.book_append_sheet(i, l, "Sheet1"), a ? typeof a == "function" && (a = a()) : a = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, s.writeFile(i, `${a}.xlsx`);
|
|
2002
1995
|
};
|
|
2003
1996
|
}
|
|
2004
|
-
const
|
|
1997
|
+
const Qt = (e, t) => ({
|
|
2005
1998
|
export: {
|
|
2006
1999
|
run: {
|
|
2007
2000
|
start: async (n) => {
|
|
2008
|
-
let
|
|
2009
|
-
const
|
|
2010
|
-
|
|
2001
|
+
let s = await e().export.run[n]();
|
|
2002
|
+
const o = t.option.column, l = ObjectUtil.deepMerge({ data: s, columns: o }, {}), i = t.option.tools?.export || {};
|
|
2003
|
+
i.before?.(l), qt.exportToExcel(l.data, l.columns, i.fileName);
|
|
2011
2004
|
},
|
|
2012
2005
|
select: async () => {
|
|
2013
2006
|
const n = e();
|
|
@@ -2023,8 +2016,8 @@ const qt = (e, t) => ({
|
|
|
2023
2016
|
if (n.table.selection.list.length === 0)
|
|
2024
2017
|
throw $.fail(C.tCurd("selectDataToExport")), new Error(C.tCurd("selectDataToExport"));
|
|
2025
2018
|
return n.table.selection.list;
|
|
2026
|
-
} catch (
|
|
2027
|
-
console.error(
|
|
2019
|
+
} catch (a) {
|
|
2020
|
+
console.error(a);
|
|
2028
2021
|
} finally {
|
|
2029
2022
|
n.export.loading = !1;
|
|
2030
2023
|
}
|
|
@@ -2042,8 +2035,8 @@ const qt = (e, t) => ({
|
|
|
2042
2035
|
if (n.table.data.length === 0)
|
|
2043
2036
|
throw $.fail(C.tCurd("noData")), new Error(C.tCurd("noData"));
|
|
2044
2037
|
return n.table.data;
|
|
2045
|
-
} catch (
|
|
2046
|
-
console.error(
|
|
2038
|
+
} catch (a) {
|
|
2039
|
+
console.error(a);
|
|
2047
2040
|
} finally {
|
|
2048
2041
|
n.export.loading = !1;
|
|
2049
2042
|
}
|
|
@@ -2058,12 +2051,12 @@ const qt = (e, t) => ({
|
|
|
2058
2051
|
});
|
|
2059
2052
|
return;
|
|
2060
2053
|
}
|
|
2061
|
-
const
|
|
2054
|
+
const a = t.option.api.list, s = await a({
|
|
2062
2055
|
...n.page.getQuery({ size: 999999, num: 1 })
|
|
2063
2056
|
});
|
|
2064
|
-
return (
|
|
2065
|
-
} catch (
|
|
2066
|
-
console.error(
|
|
2057
|
+
return (s.data || { [L.config.field.result.list]: s })[L.config.field.result.list];
|
|
2058
|
+
} catch (a) {
|
|
2059
|
+
console.error(a);
|
|
2067
2060
|
} finally {
|
|
2068
2061
|
n.export.loading = !1;
|
|
2069
2062
|
}
|
|
@@ -2071,11 +2064,11 @@ const qt = (e, t) => ({
|
|
|
2071
2064
|
},
|
|
2072
2065
|
loading: !1,
|
|
2073
2066
|
click: (n) => {
|
|
2074
|
-
const
|
|
2075
|
-
|
|
2067
|
+
const a = e();
|
|
2068
|
+
a.export.loading || a.export.run.start(n);
|
|
2076
2069
|
}
|
|
2077
2070
|
}
|
|
2078
|
-
}),
|
|
2071
|
+
}), Xt = (e, t) => ({
|
|
2079
2072
|
remove: {
|
|
2080
2073
|
title: C.tCurd("deleteTitle"),
|
|
2081
2074
|
show: !1,
|
|
@@ -2089,100 +2082,100 @@ const qt = (e, t) => ({
|
|
|
2089
2082
|
$.fail(C.tCurd("selectDataToDelete"));
|
|
2090
2083
|
return;
|
|
2091
2084
|
}
|
|
2092
|
-
const
|
|
2093
|
-
|
|
2085
|
+
const a = e();
|
|
2086
|
+
a.remove.items = n, a.remove.show = !0;
|
|
2094
2087
|
},
|
|
2095
2088
|
submit: () => {
|
|
2096
2089
|
FunUtil.throttle(async () => {
|
|
2097
2090
|
const n = e();
|
|
2098
2091
|
n.remove.loading = !0;
|
|
2099
|
-
const
|
|
2092
|
+
const a = t.option.api.delete;
|
|
2100
2093
|
try {
|
|
2101
|
-
if (!
|
|
2102
|
-
await
|
|
2103
|
-
[t.option.table?.rowKey]: n.remove.items.map((
|
|
2094
|
+
if (!a) return;
|
|
2095
|
+
await a({
|
|
2096
|
+
[t.option.table?.rowKey]: n.remove.items.map((s) => s[t.option.table?.rowKey]),
|
|
2104
2097
|
items: n.remove.items
|
|
2105
2098
|
}), $.success(C.tCurd("operationSuccess")), n.table.data.length <= 1 && n.page.num > 1 && (n.page.num -= 1), n.remove.close(), await n.table.getList();
|
|
2106
|
-
} catch (
|
|
2107
|
-
console.error(
|
|
2099
|
+
} catch (s) {
|
|
2100
|
+
console.error(s);
|
|
2108
2101
|
} finally {
|
|
2109
2102
|
n.remove.loading = !1;
|
|
2110
2103
|
}
|
|
2111
2104
|
});
|
|
2112
2105
|
}
|
|
2113
2106
|
}
|
|
2114
|
-
}),
|
|
2107
|
+
}), Yt = (e, t, n) => ({
|
|
2115
2108
|
apiDataMap: {},
|
|
2116
|
-
getColumnSpan: (
|
|
2117
|
-
const
|
|
2118
|
-
return
|
|
2119
|
-
maxSpan:
|
|
2109
|
+
getColumnSpan: (a, s) => {
|
|
2110
|
+
const o = e(), l = o.update.formGrid?.length ? o.update.formGrid : s || [];
|
|
2111
|
+
return qe(a, l, o.update.form, o.update.type, {
|
|
2112
|
+
maxSpan: o.update.formMaxSpan || t.option.form?.maxSpan,
|
|
2120
2113
|
defaultSpan: t.option.form?.defaultSpan || L.config.form.defaultSpan
|
|
2121
2114
|
});
|
|
2122
2115
|
},
|
|
2123
2116
|
init: () => {
|
|
2124
|
-
const
|
|
2125
|
-
|
|
2117
|
+
const a = e();
|
|
2118
|
+
a.initCurdConfig(), a.initColumnOptions(), a.initColumnForm();
|
|
2126
2119
|
},
|
|
2127
|
-
initApiData: async (
|
|
2128
|
-
const
|
|
2129
|
-
if (
|
|
2130
|
-
|
|
2120
|
+
initApiData: async (a) => {
|
|
2121
|
+
const s = e(), o = [], l = (i) => {
|
|
2122
|
+
if (i.children?.length) {
|
|
2123
|
+
i.children.forEach((u) => l(u));
|
|
2131
2124
|
return;
|
|
2132
2125
|
}
|
|
2133
|
-
const c = le(
|
|
2134
|
-
if (
|
|
2135
|
-
if (
|
|
2126
|
+
const c = le(i);
|
|
2127
|
+
if (i.options?.[c]?.dataApi && i.options?.[c]?.dataApiConfig?.[a]) {
|
|
2128
|
+
if (s.apiDataMap[i.key] && i.options?.[c]?.dataApiConfig?.once) return;
|
|
2136
2129
|
const u = (async () => {
|
|
2137
2130
|
try {
|
|
2138
|
-
let
|
|
2139
|
-
if (
|
|
2140
|
-
const h =
|
|
2141
|
-
!Array.isArray(
|
|
2131
|
+
let d = await i.options?.[c]?.dataApi?.(s.update.form, s.update.type);
|
|
2132
|
+
if (d) {
|
|
2133
|
+
const h = i.options?.[c]?.dataPath;
|
|
2134
|
+
!Array.isArray(d) && h && (d = ObjectUtil.getPathValue(d, h)), i.options[c].data = d, i.options.search[c].data = d, i.options.search[i.options.search.type ?? c] || (i.options.search[i.options.search.type ?? c] = {}), i.options.search[i.options.search.type ?? c].data = d, i.options.formAdd[c].data = d, i.options.formUpdate[c].data = d, s.apiDataMap[i.key] = d;
|
|
2142
2135
|
}
|
|
2143
2136
|
} catch {
|
|
2144
2137
|
}
|
|
2145
2138
|
})();
|
|
2146
|
-
|
|
2139
|
+
o.push(u);
|
|
2147
2140
|
}
|
|
2148
2141
|
};
|
|
2149
|
-
return t.option.column.forEach((
|
|
2142
|
+
return t.option.column.forEach((i) => l(i)), await Promise.all(o), !0;
|
|
2150
2143
|
},
|
|
2151
2144
|
initCurdConfig: () => {
|
|
2152
|
-
const
|
|
2153
|
-
|
|
2154
|
-
const
|
|
2155
|
-
Object.keys(
|
|
2156
|
-
t.option[
|
|
2145
|
+
const a = ObjectUtil.deepMerge(L.config, {});
|
|
2146
|
+
a.table.emptyText = C.tCurd("noData"), t.option.size = t.option.size || {}, a.table.size = t.option.size.table || a.size.table, a.form.size = t.option.size.form || a.size.form, a.size.search = t.option.size.search || a.size.search;
|
|
2147
|
+
const s = ObjectUtil.deepMerge(a, t.option || {});
|
|
2148
|
+
Object.keys(s).forEach((o) => {
|
|
2149
|
+
t.option[o] = s[o];
|
|
2157
2150
|
});
|
|
2158
2151
|
},
|
|
2159
2152
|
initColumnOptions: () => {
|
|
2160
|
-
const
|
|
2161
|
-
let
|
|
2162
|
-
|
|
2153
|
+
const a = e();
|
|
2154
|
+
let s = JSONUtil.cp(L.config.columnConfig);
|
|
2155
|
+
s.options = ObjectUtil.deepMerge(
|
|
2163
2156
|
{
|
|
2164
2157
|
switch: {
|
|
2165
2158
|
activeText: C.tCurd("switchOn"),
|
|
2166
2159
|
inactiveText: C.tCurd("switchOff")
|
|
2167
2160
|
}
|
|
2168
2161
|
},
|
|
2169
|
-
|
|
2162
|
+
s.options
|
|
2170
2163
|
);
|
|
2171
|
-
const
|
|
2172
|
-
const
|
|
2173
|
-
for (const u in
|
|
2164
|
+
const o = (l) => {
|
|
2165
|
+
const i = le(l);
|
|
2166
|
+
for (const u in s) {
|
|
2174
2167
|
if (u === "table") {
|
|
2175
|
-
if (
|
|
2176
|
-
|
|
2168
|
+
if (l.table = ObjectUtil.deepMerge(s.table, l.table || {}), l.children) {
|
|
2169
|
+
l.children.forEach((d) => o(d));
|
|
2177
2170
|
return;
|
|
2178
2171
|
}
|
|
2179
|
-
} else u === "type" ?
|
|
2180
|
-
|
|
2172
|
+
} else u === "type" ? l.type = l.type || s.type : l[u] = ObjectUtil.deepMerge(s[u], l[u] || {});
|
|
2173
|
+
l.options = l.options || {}, l.options[i] = l.options[i] || {}, l.options[i].size = t.option.size.form;
|
|
2181
2174
|
}
|
|
2182
2175
|
["search", "formAdd", "formUpdate"].forEach((u) => {
|
|
2183
|
-
|
|
2184
|
-
}),
|
|
2185
|
-
const h =
|
|
2176
|
+
l.options[u] = ObjectUtil.deepMerge(l.options, l.options[u] || {}), u === "search" ? t.option.size.search && (l.options[u][i].size = t.option.size.search) : t.option.size.form && (l.options[u][i].size = t.option.size.form);
|
|
2177
|
+
}), l.table = ObjectUtil.deepMerge(l.table, l.options[i].table || {}), i === "switch" && (l.options.switch.tableBeforeChange = async (u, d) => {
|
|
2178
|
+
const h = l.options?.switch;
|
|
2186
2179
|
try {
|
|
2187
2180
|
h.tableConfig?.confirm && await n.switchConfirmRef.value?.open({
|
|
2188
2181
|
title: C.tCurd("confirmModify"),
|
|
@@ -2190,134 +2183,133 @@ const qt = (e, t) => ({
|
|
|
2190
2183
|
});
|
|
2191
2184
|
try {
|
|
2192
2185
|
if (!t.option.api.update && !h.tableConfig?.api) return;
|
|
2193
|
-
const f =
|
|
2186
|
+
const f = d[t.option.table?.rowKey];
|
|
2194
2187
|
h.loadingMap || (h.loadingMap = {}), h.loadingMap[f] || (h.loadingMap[f] = { loading: !1 }), h.loadingMap[f].loading = !0;
|
|
2195
|
-
const m =
|
|
2188
|
+
const m = d[u] === h.activeValue ? h.inactiveValue : h.activeValue, w = h.tableConfig?.api ? h.tableConfig.api : t.option.api.update;
|
|
2196
2189
|
if (!w) return;
|
|
2197
2190
|
try {
|
|
2198
|
-
await w({ ...
|
|
2191
|
+
await w({ ...d, [u]: m }, "switch");
|
|
2199
2192
|
} catch {
|
|
2200
2193
|
return !1;
|
|
2201
2194
|
} finally {
|
|
2202
2195
|
h.loadingMap[f].loading = !1;
|
|
2203
2196
|
}
|
|
2204
|
-
return $.success(C.tCurd("operationSuccess")), h.tableConfig?.loadList && (
|
|
2197
|
+
return $.success(C.tCurd("operationSuccess")), h.tableConfig?.loadList && (a.table.loading = !0, a.table.getList(), a.table.loading = !1), !0;
|
|
2205
2198
|
} catch (f) {
|
|
2206
2199
|
return console.error(f), !1;
|
|
2207
2200
|
} finally {
|
|
2208
|
-
|
|
2201
|
+
a.table.loading = !1;
|
|
2209
2202
|
}
|
|
2210
2203
|
} catch {
|
|
2211
2204
|
return !1;
|
|
2212
2205
|
}
|
|
2213
|
-
}),
|
|
2206
|
+
}), i === "treeSelect" && (l.options.treeSelect.rowKey = t.option.table?.rowKey, l.options.treeSelect.nodeKey = t.option.table?.rowKey);
|
|
2214
2207
|
};
|
|
2215
|
-
t.option.column.forEach(
|
|
2208
|
+
t.option.column.forEach(o), t.option.table?.column?.forEach(o);
|
|
2216
2209
|
},
|
|
2217
2210
|
initColumnForm: () => {
|
|
2218
|
-
const
|
|
2219
|
-
|
|
2220
|
-
const
|
|
2211
|
+
const a = e(), s = t.option;
|
|
2212
|
+
a.update.formColumn = [], a.update.formGrid = [], a.update.formMaxSpan = 12, a.table.column.show = { list: [], listSource: [] };
|
|
2213
|
+
const o = t.option.form?.maxSpan || 12, l = t.option.form?.defaultSpan || o / 2, i = tt(t.option.form), c = (f) => {
|
|
2221
2214
|
if (f.children) {
|
|
2222
|
-
|
|
2215
|
+
a.table.column.show.list.push(f.key), f.children.forEach((m) => c(m));
|
|
2223
2216
|
return;
|
|
2224
2217
|
}
|
|
2225
|
-
|
|
2218
|
+
a.update.formDefault[f.key] = f.value, f.table?.table && (f.show?.table && a.table.column.show.list.push(f.key), a.table.column.show.listSource.push(f.key));
|
|
2226
2219
|
};
|
|
2227
|
-
|
|
2220
|
+
s.column.forEach((f) => {
|
|
2228
2221
|
ve(f, !0), c(f);
|
|
2229
2222
|
}), t.option.table?.column?.forEach((f) => {
|
|
2230
2223
|
ve(f, !1), c(f);
|
|
2231
|
-
}),
|
|
2232
|
-
const u =
|
|
2233
|
-
maxSpan:
|
|
2234
|
-
defaultSpan:
|
|
2224
|
+
}), a.search.column.list = s.column.concat(s.table?.column || []), a.table.column.list = a.search.column.list.filter((f) => f.table?.table), a.search.column.list.sort((f, m) => f.sort?.search - m.sort?.search), a.table.column.list.sort((f, m) => f.sort?.table - m.sort?.table), a.update.rules = {}, Fe(s.column, a.update.formDefault, a.update.rules, (f) => i(f, () => a.update.form)), s.table?.editMode && Fe(s.table?.column || [], a.update.formDefault, a.update.rules, (f) => i(f, () => a.update.form));
|
|
2225
|
+
const u = Ze(s.column, {
|
|
2226
|
+
maxSpan: o,
|
|
2227
|
+
defaultSpan: l,
|
|
2235
2228
|
layout: t.option.form?.layout
|
|
2236
2229
|
});
|
|
2237
|
-
|
|
2238
|
-
const
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
}),
|
|
2242
|
-
f.show?.search || (
|
|
2230
|
+
a.update.formGrid = u.cells, a.update.formMaxSpan = u.maxSpan, a.update.formColumn = Xe(u.cells);
|
|
2231
|
+
const d = t.option.search?.formDefault;
|
|
2232
|
+
d && Object.keys(d).forEach((f) => {
|
|
2233
|
+
a.search.formDefault[f] = d[f];
|
|
2234
|
+
}), s.column.forEach((f) => {
|
|
2235
|
+
f.show?.search || (a.search.formDefault[f.key] = void 0);
|
|
2243
2236
|
});
|
|
2244
|
-
const h = ObjectUtil.deepMerge(
|
|
2245
|
-
Z.setValue(
|
|
2237
|
+
const h = ObjectUtil.deepMerge(a.search.formDefault, {});
|
|
2238
|
+
Z.setValue(a.search.form, h, !0);
|
|
2246
2239
|
}
|
|
2247
|
-
}),
|
|
2248
|
-
const t = X(), n = X(),
|
|
2249
|
-
|
|
2250
|
-
const c = (h) => {
|
|
2251
|
-
h = h || d;
|
|
2240
|
+
}), Zt = (e) => {
|
|
2241
|
+
const t = X(), n = X(), a = X(), s = { switchConfirmRef: t, ruleFormRef: n, tableRef: a }, o = Ie(), l = Me.getConf("curdConf"), i = (h) => {
|
|
2242
|
+
h = h || u;
|
|
2252
2243
|
let f = h, m = h;
|
|
2253
2244
|
for (; f?.parentCurdConf; )
|
|
2254
2245
|
m = f.parentCurdConf, f = f.parentCurdConf;
|
|
2255
2246
|
return m;
|
|
2256
|
-
},
|
|
2257
|
-
|
|
2258
|
-
parentCurdConf:
|
|
2259
|
-
getCurdConf:
|
|
2260
|
-
getRootCurdConf:
|
|
2261
|
-
...
|
|
2247
|
+
}, c = () => u;
|
|
2248
|
+
let u = re({
|
|
2249
|
+
parentCurdConf: l,
|
|
2250
|
+
getCurdConf: i,
|
|
2251
|
+
getRootCurdConf: i,
|
|
2252
|
+
...Nt(),
|
|
2262
2253
|
option: e.option,
|
|
2263
|
-
...
|
|
2264
|
-
...
|
|
2265
|
-
...
|
|
2266
|
-
...
|
|
2267
|
-
...
|
|
2268
|
-
...
|
|
2269
|
-
...
|
|
2270
|
-
...
|
|
2271
|
-
})
|
|
2272
|
-
|
|
2273
|
-
|
|
2254
|
+
...Gt(c, e),
|
|
2255
|
+
...Ht(c, e),
|
|
2256
|
+
...Wt(c, e, s),
|
|
2257
|
+
...Jt(c, e),
|
|
2258
|
+
...Qt(c, e),
|
|
2259
|
+
...Ft(c, e, s),
|
|
2260
|
+
...Xt(c, e),
|
|
2261
|
+
...Yt(c, e, s)
|
|
2262
|
+
});
|
|
2263
|
+
u.init();
|
|
2264
|
+
const d = o ? `curdRef-${o.uid}` : "";
|
|
2265
|
+
return l?.formRef && d && (l.formRef.set(d, {
|
|
2274
2266
|
validate: async (h) => {
|
|
2275
|
-
const f = await
|
|
2267
|
+
const f = await u.update.validate(!1);
|
|
2276
2268
|
if (h?.(!!f), !f) throw !1;
|
|
2277
2269
|
return !0;
|
|
2278
2270
|
}
|
|
2279
|
-
}),
|
|
2280
|
-
|
|
2281
|
-
})),
|
|
2282
|
-
e.option.init !== !1 &&
|
|
2283
|
-
}), Me.setConf("curdConf",
|
|
2284
|
-
},
|
|
2271
|
+
}), Pe(() => {
|
|
2272
|
+
l.formRef.remove(d);
|
|
2273
|
+
})), je(() => {
|
|
2274
|
+
e.option.init !== !1 && u.table.getList();
|
|
2275
|
+
}), Me.setConf("curdConf", u), { conf: u, switchConfirmRef: t, ruleFormRef: n, tableRef: a };
|
|
2276
|
+
}, _t = { class: "dialog-footer" }, eo = /* @__PURE__ */ q({
|
|
2285
2277
|
__name: "switchConfirm",
|
|
2286
2278
|
props: {
|
|
2287
2279
|
size: {}
|
|
2288
2280
|
},
|
|
2289
2281
|
setup(e, { expose: t }) {
|
|
2290
|
-
const n = X(!1),
|
|
2291
|
-
let
|
|
2292
|
-
const
|
|
2293
|
-
|
|
2282
|
+
const n = X(!1), a = X("确认修改"), s = X("确认要修改状态吗?");
|
|
2283
|
+
let o = null, l = null;
|
|
2284
|
+
const i = (d) => (d?.title && (a.value = d.title), d?.content && (s.value = d.content), n.value = !0, new Promise((h, f) => {
|
|
2285
|
+
o = h, l = f;
|
|
2294
2286
|
})), c = () => {
|
|
2295
|
-
n.value = !1,
|
|
2287
|
+
n.value = !1, o?.(!0), o = null, l = null;
|
|
2296
2288
|
}, u = () => {
|
|
2297
|
-
n.value = !1,
|
|
2289
|
+
n.value = !1, l?.(new Error("用户取消操作")), o = null, l = null;
|
|
2298
2290
|
};
|
|
2299
2291
|
return t({
|
|
2300
|
-
open:
|
|
2301
|
-
}), (
|
|
2292
|
+
open: i
|
|
2293
|
+
}), (d, h) => {
|
|
2302
2294
|
const f = fe("el-form");
|
|
2303
|
-
return g(), b(
|
|
2295
|
+
return g(), b(r(Ee), {
|
|
2304
2296
|
modelValue: n.value,
|
|
2305
2297
|
"onUpdate:modelValue": h[0] || (h[0] = (m) => n.value = m),
|
|
2306
|
-
title:
|
|
2298
|
+
title: a.value,
|
|
2307
2299
|
"close-on-click-modal": !1,
|
|
2308
2300
|
width: "400px"
|
|
2309
2301
|
}, {
|
|
2310
2302
|
footer: p(() => [
|
|
2311
2303
|
F(f, { size: e.size }, {
|
|
2312
2304
|
default: p(() => [
|
|
2313
|
-
R("span",
|
|
2314
|
-
F(
|
|
2305
|
+
R("span", _t, [
|
|
2306
|
+
F(r(N), { onClick: u }, {
|
|
2315
2307
|
default: p(() => [...h[1] || (h[1] = [
|
|
2316
2308
|
M("取消", -1)
|
|
2317
2309
|
])]),
|
|
2318
2310
|
_: 1
|
|
2319
2311
|
}),
|
|
2320
|
-
F(
|
|
2312
|
+
F(r(N), {
|
|
2321
2313
|
type: "primary",
|
|
2322
2314
|
onClick: c
|
|
2323
2315
|
}, {
|
|
@@ -2332,13 +2324,13 @@ const qt = (e, t) => ({
|
|
|
2332
2324
|
}, 8, ["size"])
|
|
2333
2325
|
]),
|
|
2334
2326
|
default: p(() => [
|
|
2335
|
-
R("div", null, U(
|
|
2327
|
+
R("div", null, U(s.value), 1)
|
|
2336
2328
|
]),
|
|
2337
2329
|
_: 1
|
|
2338
2330
|
}, 8, ["modelValue", "title"]);
|
|
2339
2331
|
};
|
|
2340
2332
|
}
|
|
2341
|
-
}),
|
|
2333
|
+
}), to = ["innerHTML"], oo = /* @__PURE__ */ q({
|
|
2342
2334
|
__name: "text",
|
|
2343
2335
|
props: {
|
|
2344
2336
|
content: {},
|
|
@@ -2346,12 +2338,12 @@ const qt = (e, t) => ({
|
|
|
2346
2338
|
},
|
|
2347
2339
|
setup(e) {
|
|
2348
2340
|
const t = e, n = ae(() => typeof t.content == "function" ? t.content(t.value) : t.content);
|
|
2349
|
-
return (
|
|
2341
|
+
return (a, s) => typeof n.value == "object" ? (g(), b(ee(n.value), { key: 0 })) : (g(), v("div", {
|
|
2350
2342
|
key: 1,
|
|
2351
2343
|
innerHTML: n.value
|
|
2352
|
-
}, null, 8,
|
|
2344
|
+
}, null, 8, to));
|
|
2353
2345
|
}
|
|
2354
|
-
}),
|
|
2346
|
+
}), Ae = /* @__PURE__ */ q({
|
|
2355
2347
|
__name: "searchField",
|
|
2356
2348
|
props: {
|
|
2357
2349
|
item: {},
|
|
@@ -2361,172 +2353,172 @@ const qt = (e, t) => ({
|
|
|
2361
2353
|
setup(e) {
|
|
2362
2354
|
const t = e, n = ae({
|
|
2363
2355
|
get: () => t.conf.search.form?.[t.item?.key],
|
|
2364
|
-
set: (
|
|
2365
|
-
t.item?.key !== void 0 && (t.conf.search.form[t.item.key] =
|
|
2356
|
+
set: (a) => {
|
|
2357
|
+
t.item?.key !== void 0 && (t.conf.search.form[t.item.key] = a);
|
|
2366
2358
|
}
|
|
2367
2359
|
});
|
|
2368
|
-
return (
|
|
2360
|
+
return (a, s) => r(W).customComponent[e.type ?? ""]?.search ? (g(), b(ee(r(W).customComponent[e.type ?? ""]?.search), x({
|
|
2369
2361
|
key: 0,
|
|
2370
2362
|
modelValue: n.value,
|
|
2371
|
-
"onUpdate:modelValue":
|
|
2372
|
-
}, e.item.options?.search?.[e.type ?? ""], E(e.item.options?.search?.[e.type ?? ""]?.on || {})), null, 16, ["modelValue"])) : e.type === "input" ? (g(), b(
|
|
2363
|
+
"onUpdate:modelValue": s[0] || (s[0] = (o) => n.value = o)
|
|
2364
|
+
}, e.item.options?.search?.[e.type ?? ""], E(e.item.options?.search?.[e.type ?? ""]?.on || {})), null, 16, ["modelValue"])) : e.type === "input" ? (g(), b(r(ue), x({
|
|
2373
2365
|
key: 1,
|
|
2374
2366
|
modelValue: n.value,
|
|
2375
|
-
"onUpdate:modelValue":
|
|
2367
|
+
"onUpdate:modelValue": s[1] || (s[1] = (o) => n.value = o),
|
|
2376
2368
|
placeholder: e.conf.search.getPlaceholder(e.item),
|
|
2377
2369
|
clearable: "",
|
|
2378
2370
|
disabled: e.item.disabled?.search
|
|
2379
|
-
}, e.item.options?.search?.input || e.item.options?.input, E(e.item.options?.search?.input?.on || e.item.options?.input?.on || {})), null, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "switch" ? (g(), b(
|
|
2371
|
+
}, e.item.options?.search?.input || e.item.options?.input, E(e.item.options?.search?.input?.on || e.item.options?.input?.on || {})), null, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "switch" ? (g(), b(r(ce), x({
|
|
2380
2372
|
key: 2,
|
|
2381
2373
|
modelValue: n.value,
|
|
2382
|
-
"onUpdate:modelValue":
|
|
2383
|
-
placeholder: e.conf.search.getPlaceholder(e.item,
|
|
2374
|
+
"onUpdate:modelValue": s[2] || (s[2] = (o) => n.value = o),
|
|
2375
|
+
placeholder: e.conf.search.getPlaceholder(e.item, r(C).tCurd("placeholderSelect")),
|
|
2384
2376
|
clearable: "",
|
|
2385
2377
|
disabled: e.item.disabled?.search
|
|
2386
2378
|
}, e.item.options?.search?.switch || e.item.options?.switch, E(e.item.options?.search?.switch?.on || e.item.options?.switch?.on || {})), {
|
|
2387
2379
|
default: p(() => [
|
|
2388
|
-
(g(), b(
|
|
2380
|
+
(g(), b(r(ne), {
|
|
2389
2381
|
key: e.item.options?.switch?.activeValue,
|
|
2390
2382
|
label: e.item.options?.switch?.activeText,
|
|
2391
2383
|
value: e.item.options?.switch?.activeValue
|
|
2392
2384
|
}, null, 8, ["label", "value"])),
|
|
2393
|
-
(g(), b(
|
|
2385
|
+
(g(), b(r(ne), {
|
|
2394
2386
|
key: e.item.options?.switch?.inactiveValue,
|
|
2395
2387
|
label: e.item.options?.switch?.inactiveText,
|
|
2396
2388
|
value: e.item.options?.switch?.inactiveValue
|
|
2397
2389
|
}, null, 8, ["label", "value"]))
|
|
2398
2390
|
]),
|
|
2399
2391
|
_: 1
|
|
2400
|
-
}, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "select" ? (g(), b(
|
|
2392
|
+
}, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "select" ? (g(), b(r(ce), x({
|
|
2401
2393
|
key: 3,
|
|
2402
2394
|
modelValue: n.value,
|
|
2403
|
-
"onUpdate:modelValue":
|
|
2404
|
-
placeholder: e.conf.search.getPlaceholder(e.item,
|
|
2395
|
+
"onUpdate:modelValue": s[3] || (s[3] = (o) => n.value = o),
|
|
2396
|
+
placeholder: e.conf.search.getPlaceholder(e.item, r(C).tCurd("placeholderSelect")),
|
|
2405
2397
|
clearable: "",
|
|
2406
2398
|
disabled: e.item.disabled?.search
|
|
2407
2399
|
}, e.item.options?.search?.select || e.item.options?.select, E(e.item.options?.search?.select?.on || e.item.options?.select?.on || {})), {
|
|
2408
2400
|
default: p(() => [
|
|
2409
|
-
(g(!0), v(B, null, G(e.item.options?.search?.select?.data || e.item.options?.select?.data || [], (
|
|
2410
|
-
key:
|
|
2411
|
-
label:
|
|
2412
|
-
value:
|
|
2401
|
+
(g(!0), v(B, null, G(e.item.options?.search?.select?.data || e.item.options?.select?.data || [], (o) => (g(), b(r(ne), {
|
|
2402
|
+
key: o.value,
|
|
2403
|
+
label: o.label,
|
|
2404
|
+
value: o.value
|
|
2413
2405
|
}, null, 8, ["label", "value"]))), 128))
|
|
2414
2406
|
]),
|
|
2415
2407
|
_: 1
|
|
2416
|
-
}, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "radio" ? (g(), b(
|
|
2408
|
+
}, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "radio" ? (g(), b(r(Be), x({
|
|
2417
2409
|
key: 4,
|
|
2418
2410
|
modelValue: n.value,
|
|
2419
|
-
"onUpdate:modelValue":
|
|
2411
|
+
"onUpdate:modelValue": s[4] || (s[4] = (o) => n.value = o),
|
|
2420
2412
|
disabled: e.item.disabled?.search
|
|
2421
2413
|
}, e.item.options?.search?.radio || e.item.options?.radio, E(e.item.options?.search?.radio?.on || e.item.options?.radio?.on || {})), {
|
|
2422
2414
|
default: p(() => [
|
|
2423
|
-
(g(!0), v(B, null, G(e.item.options?.radio?.data, (
|
|
2424
|
-
key:
|
|
2425
|
-
label:
|
|
2426
|
-
value:
|
|
2415
|
+
(g(!0), v(B, null, G(e.item.options?.radio?.data, (o) => (g(), b(r(Te), {
|
|
2416
|
+
key: o.value,
|
|
2417
|
+
label: o.label,
|
|
2418
|
+
value: o.value
|
|
2427
2419
|
}, null, 8, ["label", "value"]))), 128))
|
|
2428
2420
|
]),
|
|
2429
2421
|
_: 1
|
|
2430
|
-
}, 16, ["modelValue", "disabled"])) : e.type === "datetime" ? (g(), b(
|
|
2422
|
+
}, 16, ["modelValue", "disabled"])) : e.type === "datetime" ? (g(), b(r(Le), x({
|
|
2431
2423
|
key: 5,
|
|
2432
2424
|
modelValue: n.value,
|
|
2433
|
-
"onUpdate:modelValue":
|
|
2425
|
+
"onUpdate:modelValue": s[5] || (s[5] = (o) => n.value = o),
|
|
2434
2426
|
disabled: e.item.disabled?.search
|
|
2435
|
-
}, e.item.options?.search?.datetime || e.item.options?.datetime, E(e.item.options?.search?.datetime?.on || e.item.options?.datetime?.on || {})), null, 16, ["modelValue", "disabled"])) : e.type &&
|
|
2427
|
+
}, e.item.options?.search?.datetime || e.item.options?.datetime, E(e.item.options?.search?.datetime?.on || e.item.options?.datetime?.on || {})), null, 16, ["modelValue", "disabled"])) : e.type && r(W).customComponent[e.type] ? (g(), b(ee(r(W).customComponent[e.type]), x({
|
|
2436
2428
|
key: 6,
|
|
2437
2429
|
modelValue: n.value,
|
|
2438
|
-
"onUpdate:modelValue":
|
|
2430
|
+
"onUpdate:modelValue": s[6] || (s[6] = (o) => n.value = o)
|
|
2439
2431
|
}, e.item.options?.search?.[e.type] || e.item.options?.[e.type], E(e.item.options?.search?.[e.type]?.on || e.item.options?.[e.type]?.on || {}), {
|
|
2440
2432
|
disabled: e.item.disabled?.search
|
|
2441
2433
|
}), null, 16, ["modelValue", "disabled"])) : V("", !0);
|
|
2442
2434
|
}
|
|
2443
2435
|
}), se = (e, t) => {
|
|
2444
2436
|
const n = e.__vccOpts || e;
|
|
2445
|
-
for (const [
|
|
2446
|
-
n[
|
|
2437
|
+
for (const [a, s] of t)
|
|
2438
|
+
n[a] = s;
|
|
2447
2439
|
return n;
|
|
2448
|
-
},
|
|
2440
|
+
}, ao = {}, no = {
|
|
2449
2441
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2450
2442
|
viewBox: "64 64 896 896"
|
|
2451
2443
|
};
|
|
2452
|
-
function
|
|
2453
|
-
return g(), v("svg",
|
|
2444
|
+
function lo(e, t) {
|
|
2445
|
+
return g(), v("svg", no, [...t[0] || (t[0] = [
|
|
2454
2446
|
R("path", {
|
|
2455
2447
|
fill: "currentColor",
|
|
2456
2448
|
d: "M482.2 508.4L331.3 389c-3-2.4-7.3-.2-7.3 3.6V478H184V184h204v128c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V144c0-15.5-12.5-28-28-28H144c-15.5 0-28 12.5-28 28v736c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v128H184V546h140v85.4c0 3.8 4.4 6 7.3 3.6l150.9-119.4a4.5 4.5 0 000-7.2zM880 116H596c-15.5 0-28 12.5-28 28v168c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V184h204v294H700v-85.4c0-3.8-4.3-6-7.3-3.6l-151 119.4a4.52 4.52 0 000 7.1l151 119.5c2.9 2.3 7.3.2 7.3-3.6V546h140v294H636V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v168c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V144c0-15.5-12.5-28-28-28z"
|
|
2457
2449
|
}, null, -1)
|
|
2458
2450
|
])]);
|
|
2459
2451
|
}
|
|
2460
|
-
const
|
|
2452
|
+
const io = /* @__PURE__ */ se(ao, [["render", lo]]), ro = {}, so = {
|
|
2461
2453
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2462
2454
|
viewBox: "64 64 896 896"
|
|
2463
2455
|
};
|
|
2464
|
-
function
|
|
2465
|
-
return g(), v("svg",
|
|
2456
|
+
function uo(e, t) {
|
|
2457
|
+
return g(), v("svg", so, [...t[0] || (t[0] = [
|
|
2466
2458
|
R("path", {
|
|
2467
2459
|
fill: "currentColor",
|
|
2468
2460
|
d: "M180 176h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zm724 0h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zM785.3 504.3L657.7 403.6a7.23 7.23 0 00-11.7 5.7V476H378v-62.8c0-6-7-9.4-11.7-5.7L238.7 508.3a7.14 7.14 0 000 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h268v62.8c0 6 7 9.4 11.7 5.7l127.5-100.8c3.8-2.9 3.8-8.5.2-11.4z"
|
|
2469
2461
|
}, null, -1)
|
|
2470
2462
|
])]);
|
|
2471
2463
|
}
|
|
2472
|
-
const
|
|
2464
|
+
const co = /* @__PURE__ */ se(ro, [["render", uo]]), fo = {}, mo = {
|
|
2473
2465
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2474
2466
|
viewBox: "0 0 1024 1024"
|
|
2475
2467
|
};
|
|
2476
|
-
function
|
|
2477
|
-
return g(), v("svg",
|
|
2468
|
+
function go(e, t) {
|
|
2469
|
+
return g(), v("svg", mo, [...t[0] || (t[0] = [
|
|
2478
2470
|
R("path", {
|
|
2479
2471
|
fill: "currentColor",
|
|
2480
2472
|
d: "M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"
|
|
2481
2473
|
}, null, -1)
|
|
2482
2474
|
])]);
|
|
2483
2475
|
}
|
|
2484
|
-
const
|
|
2476
|
+
const ho = /* @__PURE__ */ se(fo, [["render", go]]), yo = {}, bo = {
|
|
2485
2477
|
"data-v-58697b5c": "",
|
|
2486
2478
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2487
2479
|
viewBox: "0 0 1024 1024"
|
|
2488
2480
|
};
|
|
2489
|
-
function
|
|
2490
|
-
return g(), v("svg",
|
|
2481
|
+
function po(e, t) {
|
|
2482
|
+
return g(), v("svg", bo, [...t[0] || (t[0] = [
|
|
2491
2483
|
R("path", {
|
|
2492
2484
|
fill: "currentColor",
|
|
2493
2485
|
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m23.744 191.488c-52.096 0-92.928 14.784-123.2 44.352-30.976 29.568-45.76 70.4-45.76 122.496h80.256c0-29.568 5.632-52.8 17.6-68.992 13.376-19.712 35.2-28.864 66.176-28.864 23.936 0 42.944 6.336 56.32 19.712 12.672 13.376 19.712 31.68 19.712 54.912 0 17.6-6.336 34.496-19.008 49.984l-8.448 9.856c-45.76 40.832-73.216 70.4-82.368 89.408-9.856 19.008-14.08 42.24-14.08 68.992v9.856h80.96v-9.856c0-16.896 3.52-31.68 10.56-45.76 6.336-12.672 15.488-24.64 28.16-35.2 33.792-29.568 54.208-48.576 60.544-55.616 16.896-22.528 26.048-51.392 26.048-86.592q0-64.416-42.24-101.376c-28.16-25.344-65.472-37.312-111.232-37.312m-12.672 406.208a54.27 54.27 0 0 0-38.72 14.784 49.4 49.4 0 0 0-15.488 38.016c0 15.488 4.928 28.16 15.488 38.016A54.85 54.85 0 0 0 523.072 768c15.488 0 28.16-4.928 38.72-14.784a51.52 51.52 0 0 0 16.192-38.72 51.97 51.97 0 0 0-15.488-38.016 55.94 55.94 0 0 0-39.424-14.784"
|
|
2494
2486
|
}, null, -1)
|
|
2495
2487
|
])]);
|
|
2496
2488
|
}
|
|
2497
|
-
const
|
|
2489
|
+
const wo = /* @__PURE__ */ se(yo, [["render", po]]), ko = {}, vo = {
|
|
2498
2490
|
"data-v-58697b5c": "",
|
|
2499
2491
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2500
2492
|
viewBox: "0 0 1024 1024"
|
|
2501
2493
|
};
|
|
2502
|
-
function
|
|
2503
|
-
return g(), v("svg",
|
|
2494
|
+
function Co(e, t) {
|
|
2495
|
+
return g(), v("svg", vo, [...t[0] || (t[0] = [
|
|
2504
2496
|
R("path", {
|
|
2505
2497
|
fill: "currentColor",
|
|
2506
2498
|
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"
|
|
2507
2499
|
}, null, -1)
|
|
2508
2500
|
])]);
|
|
2509
2501
|
}
|
|
2510
|
-
const
|
|
2502
|
+
const xo = /* @__PURE__ */ se(ko, [["render", Co]]), Vo = {}, So = {
|
|
2511
2503
|
"data-v-58697b5c": "",
|
|
2512
2504
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2513
2505
|
viewBox: "0 0 1024 1024"
|
|
2514
2506
|
};
|
|
2515
|
-
function
|
|
2516
|
-
return g(), v("svg",
|
|
2507
|
+
function Eo(e, t) {
|
|
2508
|
+
return g(), v("svg", So, [...t[0] || (t[0] = [
|
|
2517
2509
|
R("path", {
|
|
2518
2510
|
fill: "currentColor",
|
|
2519
2511
|
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896M288 512a38.4 38.4 0 0 0 38.4 38.4h371.2a38.4 38.4 0 0 0 0-76.8H326.4A38.4 38.4 0 0 0 288 512"
|
|
2520
2512
|
}, null, -1)
|
|
2521
2513
|
])]);
|
|
2522
2514
|
}
|
|
2523
|
-
const
|
|
2515
|
+
const $o = /* @__PURE__ */ se(Vo, [["render", Eo]]), zo = { class: "row flex-center table-header-label inline" }, Mo = { class: "table-header-tooltip" }, Fo = ["innerHTML"], Do = {
|
|
2524
2516
|
key: 1,
|
|
2525
2517
|
class: "table-header-required"
|
|
2526
|
-
},
|
|
2518
|
+
}, Oo = ["onClick"], Ro = {
|
|
2527
2519
|
key: 0,
|
|
2528
2520
|
class: "table-edit-form"
|
|
2529
|
-
},
|
|
2521
|
+
}, Uo = { key: 1 }, Ao = ["onClick", "innerHTML"], Bo = /* @__PURE__ */ q({
|
|
2530
2522
|
__name: "tableColumn",
|
|
2531
2523
|
props: {
|
|
2532
2524
|
conf: {},
|
|
@@ -2534,200 +2526,200 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
2534
2526
|
option: {}
|
|
2535
2527
|
},
|
|
2536
2528
|
setup(e) {
|
|
2537
|
-
const t = $.isFun, n = e,
|
|
2538
|
-
return (
|
|
2529
|
+
const t = $.isFun, n = e, s = Ie().type, o = (i) => i === !0 ? !0 : (Array.isArray(i) ? i : i ? [i] : []).some((u) => u?.required === !0), l = (i) => n.option.table?.editMode ? o(i.rules) || o(n.conf.update.rules?.[i.key]) : !1;
|
|
2530
|
+
return (i, c) => {
|
|
2539
2531
|
const u = fe("el-tooltip");
|
|
2540
|
-
return g(!0), v(B, null, G(e.columnList, (
|
|
2541
|
-
key:
|
|
2532
|
+
return g(!0), v(B, null, G(e.columnList, (d) => (g(), v(B, {
|
|
2533
|
+
key: d.key
|
|
2542
2534
|
}, [
|
|
2543
|
-
e.conf.table.column.show.list.includes(
|
|
2544
|
-
|
|
2535
|
+
e.conf.table.column.show.list.includes(d.key) && (d.show?.table === void 0 || r(t)(d.show?.table, e.conf.table.data)) ? (g(), v(B, { key: 0 }, [
|
|
2536
|
+
d.table?.header?.groupKey === void 0 || d.table.header.show ? (g(), b(r(ye), x({
|
|
2545
2537
|
key: 0,
|
|
2546
|
-
prop:
|
|
2547
|
-
label:
|
|
2548
|
-
}, { ref_for: !0 },
|
|
2538
|
+
prop: d.key,
|
|
2539
|
+
label: d.label
|
|
2540
|
+
}, { ref_for: !0 }, d.table), {
|
|
2549
2541
|
header: p(() => [
|
|
2550
|
-
S(
|
|
2551
|
-
R("div",
|
|
2552
|
-
|
|
2542
|
+
S(i.$slots, "table-header-" + d.key, { item: d }, () => [
|
|
2543
|
+
R("div", zo, [
|
|
2544
|
+
d.table?.header?.tooltip ? (g(), b(u, {
|
|
2553
2545
|
key: 0,
|
|
2554
2546
|
effect: "dark",
|
|
2555
2547
|
placement: "top"
|
|
2556
2548
|
}, {
|
|
2557
2549
|
content: p(() => [
|
|
2558
2550
|
R("div", {
|
|
2559
|
-
innerHTML:
|
|
2560
|
-
}, null, 8,
|
|
2551
|
+
innerHTML: d.table?.header?.tooltip
|
|
2552
|
+
}, null, 8, Fo)
|
|
2561
2553
|
]),
|
|
2562
2554
|
default: p(() => [
|
|
2563
|
-
R("span",
|
|
2564
|
-
F(
|
|
2555
|
+
R("span", Mo, [
|
|
2556
|
+
F(wo)
|
|
2565
2557
|
])
|
|
2566
2558
|
]),
|
|
2567
2559
|
_: 2
|
|
2568
2560
|
}, 1024)) : V("", !0),
|
|
2569
|
-
|
|
2570
|
-
M(" " + U(
|
|
2571
|
-
|
|
2561
|
+
l(d) ? (g(), v("span", Do, "*")) : V("", !0),
|
|
2562
|
+
M(" " + U(d.label) + " ", 1),
|
|
2563
|
+
d.table?.header?.group !== void 0 ? (g(), v("span", {
|
|
2572
2564
|
key: 2,
|
|
2573
2565
|
class: "table-header-plus",
|
|
2574
|
-
onClick:
|
|
2566
|
+
onClick: yt(
|
|
2575
2567
|
() => {
|
|
2576
|
-
|
|
2577
|
-
h.table?.header?.groupKey ===
|
|
2568
|
+
d.table.header.group = !d.table.header.group, e.columnList.forEach((h) => {
|
|
2569
|
+
h.table?.header?.groupKey === d.key && (h.table.header.show = !d.table.header.group);
|
|
2578
2570
|
});
|
|
2579
2571
|
},
|
|
2580
2572
|
["stop"]
|
|
2581
2573
|
)
|
|
2582
2574
|
}, [
|
|
2583
|
-
|
|
2584
|
-
], 8,
|
|
2575
|
+
d.table.header.group ? (g(), b(xo, { key: 0 })) : (g(), b($o, { key: 1 }))
|
|
2576
|
+
], 8, Oo)) : V("", !0)
|
|
2585
2577
|
])
|
|
2586
2578
|
])
|
|
2587
2579
|
]),
|
|
2588
2580
|
default: p(({ row: h }) => [
|
|
2589
|
-
|
|
2581
|
+
d.children ? (g(), v(B, { key: 0 }, [
|
|
2590
2582
|
c[0] || (c[0] = M(" ", -1)),
|
|
2591
|
-
(g(), b(ee(
|
|
2583
|
+
(g(), b(ee(r(s)), {
|
|
2592
2584
|
conf: e.conf,
|
|
2593
|
-
columnList:
|
|
2585
|
+
columnList: d.children,
|
|
2594
2586
|
option: e.option
|
|
2595
2587
|
}, Y({ _: 2 }, [
|
|
2596
|
-
G(
|
|
2588
|
+
G(i.$slots, (f, m) => ({
|
|
2597
2589
|
name: m,
|
|
2598
2590
|
fn: p((w) => [
|
|
2599
|
-
S(
|
|
2591
|
+
S(i.$slots, m, x({ ref_for: !0 }, w || {}))
|
|
2600
2592
|
])
|
|
2601
2593
|
}))
|
|
2602
2594
|
]), 1032, ["conf", "columnList", "option"]))
|
|
2603
2595
|
], 64)) : (g(), v(B, { key: 1 }, [
|
|
2604
|
-
e.option.table?.editMode ? (g(), v("div",
|
|
2605
|
-
F(
|
|
2596
|
+
e.option.table?.editMode ? (g(), v("div", Ro, [
|
|
2597
|
+
F(r(be), {
|
|
2606
2598
|
size: e.option.size?.table,
|
|
2607
|
-
error: e.conf.tableEditValidate.getFieldError(h,
|
|
2599
|
+
error: e.conf.tableEditValidate.getFieldError(h, d),
|
|
2608
2600
|
class: "table-edit-form-item"
|
|
2609
2601
|
}, {
|
|
2610
2602
|
default: p(() => [
|
|
2611
2603
|
R("div", {
|
|
2612
|
-
class: J(["row", ["table-edit-" +
|
|
2604
|
+
class: J(["row", ["table-edit-" + d.key]]),
|
|
2613
2605
|
style: { width: "100%" }
|
|
2614
2606
|
}, [
|
|
2615
|
-
S(
|
|
2607
|
+
S(i.$slots, "table-edit-left-" + d.key, {
|
|
2616
2608
|
row: h,
|
|
2617
|
-
item:
|
|
2609
|
+
item: d
|
|
2618
2610
|
}),
|
|
2619
|
-
|
|
2611
|
+
d.type === "input" ? (g(), b(r(ue), x({
|
|
2620
2612
|
key: 0,
|
|
2621
|
-
modelValue: h[
|
|
2622
|
-
"onUpdate:modelValue": (f) => h[
|
|
2623
|
-
disabled: e.conf.update.getDisabled(
|
|
2613
|
+
modelValue: h[d.key],
|
|
2614
|
+
"onUpdate:modelValue": (f) => h[d.key] = f,
|
|
2615
|
+
disabled: e.conf.update.getDisabled(d, !0),
|
|
2624
2616
|
class: "col"
|
|
2625
|
-
}, { ref_for: !0 }, e.conf.update.getBind(
|
|
2626
|
-
"onUpdate:modelValue": (f) => e.conf.tableEditValidate.clearField(h,
|
|
2617
|
+
}, { ref_for: !0 }, e.conf.update.getBind(d), E(e.conf.update.getOn(d, h)), {
|
|
2618
|
+
"onUpdate:modelValue": (f) => e.conf.tableEditValidate.clearField(h, d)
|
|
2627
2619
|
}), Y({ _: 2 }, [
|
|
2628
|
-
|
|
2620
|
+
d.options?.input?.prepend ? {
|
|
2629
2621
|
name: "prepend",
|
|
2630
2622
|
fn: p(() => [
|
|
2631
|
-
M(U(typeof
|
|
2623
|
+
M(U(typeof d.options?.input?.prepend == "function" ? d.options?.input?.prepend(h) : d.options?.input?.prepend), 1)
|
|
2632
2624
|
]),
|
|
2633
2625
|
key: "0"
|
|
2634
2626
|
} : void 0
|
|
2635
|
-
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
2627
|
+
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : d.type === "select" ? (g(), b(r(ce), x({
|
|
2636
2628
|
key: 1,
|
|
2637
|
-
modelValue: h[
|
|
2638
|
-
"onUpdate:modelValue": (f) => h[
|
|
2639
|
-
disabled: e.conf.update.getDisabled(
|
|
2629
|
+
modelValue: h[d.key],
|
|
2630
|
+
"onUpdate:modelValue": (f) => h[d.key] = f,
|
|
2631
|
+
disabled: e.conf.update.getDisabled(d, !0),
|
|
2640
2632
|
class: "col"
|
|
2641
|
-
}, { ref_for: !0 }, e.conf.update.getBind(
|
|
2642
|
-
"onUpdate:modelValue": (f) => e.conf.tableEditValidate.clearField(h,
|
|
2633
|
+
}, { ref_for: !0 }, e.conf.update.getBind(d), E(e.conf.update.getOn(d, h)), {
|
|
2634
|
+
"onUpdate:modelValue": (f) => e.conf.tableEditValidate.clearField(h, d)
|
|
2643
2635
|
}), {
|
|
2644
2636
|
default: p(() => [
|
|
2645
|
-
(g(!0), v(B, null, G(
|
|
2637
|
+
(g(!0), v(B, null, G(d.options?.search?.select?.data || d.options?.select?.data, (f) => (g(), b(r(ne), {
|
|
2646
2638
|
key: f.value,
|
|
2647
2639
|
label: f.label,
|
|
2648
2640
|
value: f.value
|
|
2649
2641
|
}, null, 8, ["label", "value"]))), 128))
|
|
2650
2642
|
]),
|
|
2651
2643
|
_: 2
|
|
2652
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
2644
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : d.type === "switch" ? (g(), b(r(he), x({
|
|
2653
2645
|
key: 2,
|
|
2654
|
-
modelValue: h[
|
|
2655
|
-
"onUpdate:modelValue": (f) => h[
|
|
2656
|
-
disabled: e.conf.update.getDisabled(
|
|
2646
|
+
modelValue: h[d.key],
|
|
2647
|
+
"onUpdate:modelValue": (f) => h[d.key] = f,
|
|
2648
|
+
disabled: e.conf.update.getDisabled(d, !0),
|
|
2657
2649
|
class: "col"
|
|
2658
|
-
}, { ref_for: !0 }, e.conf.update.getBind(
|
|
2659
|
-
"onUpdate:modelValue": (f) => e.conf.tableEditValidate.clearField(h,
|
|
2650
|
+
}, { ref_for: !0 }, e.conf.update.getBind(d), E(e.conf.update.getOn(d, h)), {
|
|
2651
|
+
"onUpdate:modelValue": (f) => e.conf.tableEditValidate.clearField(h, d)
|
|
2660
2652
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : V("", !0),
|
|
2661
|
-
S(
|
|
2653
|
+
S(i.$slots, "table-edit-right-" + d.key, {
|
|
2662
2654
|
row: h,
|
|
2663
|
-
item:
|
|
2655
|
+
item: d
|
|
2664
2656
|
})
|
|
2665
2657
|
], 2)
|
|
2666
2658
|
]),
|
|
2667
2659
|
_: 2
|
|
2668
2660
|
}, 1032, ["size", "error"])
|
|
2669
2661
|
])) : (g(), v(B, { key: 1 }, [
|
|
2670
|
-
e.conf.update.type ===
|
|
2671
|
-
|
|
2662
|
+
e.conf.update.type === r($).EDialog.Update && r(t)(d.show?.form, e.conf.update.form, r($).EDialog.Update) && e.option.table?.inlineEdit && e.conf.update.form[e.option.table?.rowKey] === h[e.option.table?.rowKey] && (d.type === "input" || d.type === "select") ? (g(), v(B, { key: 0 }, [
|
|
2663
|
+
d.type === "input" ? (g(), b(r(ue), x({
|
|
2672
2664
|
key: 0,
|
|
2673
|
-
modelValue: e.conf.update.form[
|
|
2674
|
-
"onUpdate:modelValue": (f) => e.conf.update.form[
|
|
2675
|
-
disabled: e.conf.update.getDisabled(
|
|
2676
|
-
}, { ref_for: !0 }, e.conf.update.getBind(
|
|
2677
|
-
|
|
2665
|
+
modelValue: e.conf.update.form[d.key],
|
|
2666
|
+
"onUpdate:modelValue": (f) => e.conf.update.form[d.key] = f,
|
|
2667
|
+
disabled: e.conf.update.getDisabled(d, !0)
|
|
2668
|
+
}, { ref_for: !0 }, e.conf.update.getBind(d), E(e.conf.update.getOn(d, h)), { style: { width: "100%" } }), Y({ _: 2 }, [
|
|
2669
|
+
d.options?.input?.prepend ? {
|
|
2678
2670
|
name: "prepend",
|
|
2679
2671
|
fn: p(() => [
|
|
2680
|
-
M(U(typeof
|
|
2672
|
+
M(U(typeof d.options?.input?.prepend == "function" ? d.options?.input?.prepend(h) : d.options?.input?.prepend), 1)
|
|
2681
2673
|
]),
|
|
2682
2674
|
key: "0"
|
|
2683
2675
|
} : void 0
|
|
2684
|
-
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
2676
|
+
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : d.type === "select" ? (g(), b(r(ce), x({
|
|
2685
2677
|
key: 1,
|
|
2686
|
-
modelValue: e.conf.update.form[
|
|
2687
|
-
"onUpdate:modelValue": (f) => e.conf.update.form[
|
|
2688
|
-
disabled: e.conf.update.getDisabled(
|
|
2689
|
-
}, { ref_for: !0 }, e.conf.update.getBind(
|
|
2678
|
+
modelValue: e.conf.update.form[d.key],
|
|
2679
|
+
"onUpdate:modelValue": (f) => e.conf.update.form[d.key] = f,
|
|
2680
|
+
disabled: e.conf.update.getDisabled(d, !0)
|
|
2681
|
+
}, { ref_for: !0 }, e.conf.update.getBind(d), E(e.conf.update.getOn(d, h)), { style: { width: "100%" } }), {
|
|
2690
2682
|
default: p(() => [
|
|
2691
|
-
(g(!0), v(B, null, G(
|
|
2683
|
+
(g(!0), v(B, null, G(d.options?.search?.select?.data || d.options?.select?.data, (f) => (g(), b(r(ne), {
|
|
2692
2684
|
key: f.value,
|
|
2693
2685
|
label: f.label,
|
|
2694
2686
|
value: f.value
|
|
2695
2687
|
}, null, 8, ["label", "value"]))), 128))
|
|
2696
2688
|
]),
|
|
2697
2689
|
_: 2
|
|
2698
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
2690
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : d.type === "switch" ? (g(), b(r(he), x({
|
|
2699
2691
|
key: 2,
|
|
2700
|
-
modelValue: e.conf.update.form[
|
|
2701
|
-
"onUpdate:modelValue": (f) => e.conf.update.form[
|
|
2702
|
-
}, { ref_for: !0 }, e.conf.update.getBind(
|
|
2703
|
-
disabled: e.conf.update.getDisabled(
|
|
2692
|
+
modelValue: e.conf.update.form[d.key],
|
|
2693
|
+
"onUpdate:modelValue": (f) => e.conf.update.form[d.key] = f
|
|
2694
|
+
}, { ref_for: !0 }, e.conf.update.getBind(d), E(e.conf.update.getOn(d, h)), {
|
|
2695
|
+
disabled: e.conf.update.getDisabled(d, !0)
|
|
2704
2696
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : V("", !0)
|
|
2705
|
-
], 64)) : S(
|
|
2697
|
+
], 64)) : S(i.$slots, "table-" + d.key, {
|
|
2706
2698
|
key: 1,
|
|
2707
2699
|
row: h,
|
|
2708
|
-
item:
|
|
2700
|
+
item: d
|
|
2709
2701
|
}, () => [
|
|
2710
|
-
|
|
2702
|
+
r(W).customComponent[d.type ?? ""]?.table ? (g(), b(ee(r(W).customComponent[d.type ?? ""]?.table), x({
|
|
2711
2703
|
key: 0,
|
|
2712
|
-
modelValue: h[
|
|
2713
|
-
"onUpdate:modelValue": (f) => h[
|
|
2714
|
-
}, { ref_for: !0 },
|
|
2715
|
-
|
|
2704
|
+
modelValue: h[d.key],
|
|
2705
|
+
"onUpdate:modelValue": (f) => h[d.key] = f
|
|
2706
|
+
}, { ref_for: !0 }, d.options?.[d.type ?? ""], E(d.options?.[d.type ?? ""]?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue"])) : d.type === "switch" ? (g(), v(B, { key: 1 }, [
|
|
2707
|
+
d.options?.switch?.tableConfig?.change ? (g(), b(r(he), x({
|
|
2716
2708
|
key: 0,
|
|
2717
|
-
modelValue: h[
|
|
2718
|
-
"onUpdate:modelValue": (f) => h[
|
|
2719
|
-
loading:
|
|
2720
|
-
"before-change": () =>
|
|
2721
|
-
}, { ref_for: !0 },
|
|
2709
|
+
modelValue: h[d.key],
|
|
2710
|
+
"onUpdate:modelValue": (f) => h[d.key] = f,
|
|
2711
|
+
loading: d.options?.switch?.loadingMap?.[h[e.option.table?.rowKey]]?.loading,
|
|
2712
|
+
"before-change": () => d.options?.switch?.tableBeforeChange?.(d.key, h)
|
|
2713
|
+
}, { ref_for: !0 }, d.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "loading", "before-change"])) : (g(), v("span", Uo, U(h[d.key] === d.options?.switch?.activeValue ? d.options?.switch?.activeText : d.options?.switch?.inactiveText), 1))
|
|
2722
2714
|
], 64)) : (g(), v("span", {
|
|
2723
2715
|
key: 2,
|
|
2724
2716
|
style: pe({
|
|
2725
|
-
"--table-text-click-color":
|
|
2717
|
+
"--table-text-click-color": d.table?.click?.color
|
|
2726
2718
|
}),
|
|
2727
|
-
class: J({ "table-text-click":
|
|
2728
|
-
onClick: (f) =>
|
|
2729
|
-
innerHTML:
|
|
2730
|
-
}, null, 14,
|
|
2719
|
+
class: J({ "table-text-click": d.table?.click?.callback }),
|
|
2720
|
+
onClick: (f) => d.table?.click?.callback?.(h),
|
|
2721
|
+
innerHTML: d.table?.format ? d.table?.format(h) : h[d.key]
|
|
2722
|
+
}, null, 14, Ao))
|
|
2731
2723
|
])
|
|
2732
2724
|
], 64))
|
|
2733
2725
|
], 64))
|
|
@@ -2738,19 +2730,19 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
2738
2730
|
], 64))), 128);
|
|
2739
2731
|
};
|
|
2740
2732
|
}
|
|
2741
|
-
}),
|
|
2733
|
+
}), To = {
|
|
2742
2734
|
key: 0,
|
|
2743
2735
|
class: "relative curd-search fit-width"
|
|
2744
|
-
},
|
|
2736
|
+
}, Lo = { class: "mb-10 flex justify-between items-center fit-width" }, jo = {
|
|
2745
2737
|
class: "flex items-center",
|
|
2746
2738
|
style: { gap: "10px" }
|
|
2747
|
-
},
|
|
2739
|
+
}, Ko = { key: 0 }, Po = { key: 1 }, Io = { key: 2 }, No = { class: "export-btn" }, Go = {
|
|
2748
2740
|
key: 1,
|
|
2749
2741
|
class: "export-btn"
|
|
2750
|
-
},
|
|
2742
|
+
}, Ho = {
|
|
2751
2743
|
class: "flex items-center table-tools-right",
|
|
2752
2744
|
style: { gap: "10px" }
|
|
2753
|
-
},
|
|
2745
|
+
}, Wo = { class: "row justify-end mt-10 mb-10 table-bottom-pagination" }, Jo = { class: "dialog-footer" }, qo = { key: 0 }, Qo = { key: 1 }, Xo = { class: "dialog-footer" }, Yo = /* @__PURE__ */ q({
|
|
2754
2746
|
__name: "index",
|
|
2755
2747
|
props: {
|
|
2756
2748
|
/**
|
|
@@ -2773,11 +2765,11 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
2773
2765
|
}
|
|
2774
2766
|
},
|
|
2775
2767
|
setup(e, { expose: t }) {
|
|
2776
|
-
const n = $.EDialog,
|
|
2768
|
+
const n = $.EDialog, a = e, s = $.isFun, { conf: o, switchConfirmRef: l, ruleFormRef: i, tableRef: c } = Zt(a);
|
|
2777
2769
|
return t({
|
|
2778
|
-
conf:
|
|
2779
|
-
}), (u,
|
|
2780
|
-
const h = fe("el-tooltip"), f =
|
|
2770
|
+
conf: o
|
|
2771
|
+
}), (u, d) => {
|
|
2772
|
+
const h = fe("el-tooltip"), f = bt("loading");
|
|
2781
2773
|
return g(), v("div", {
|
|
2782
2774
|
class: J(["relative cc1-form-box", [e.option.table?.fitHeight ? "col" : "no-min-height"]])
|
|
2783
2775
|
}, [
|
|
@@ -2789,76 +2781,76 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
2789
2781
|
R("div", {
|
|
2790
2782
|
class: J(["column fit-width no-wrap", [e.option.table?.fitHeight ? "col" : ""]])
|
|
2791
2783
|
}, [
|
|
2792
|
-
e.option.search?.show !== !1 ? (g(), v("div",
|
|
2793
|
-
F(
|
|
2794
|
-
model:
|
|
2784
|
+
e.option.search?.show !== !1 ? (g(), v("div", To, [
|
|
2785
|
+
F(r(oe), {
|
|
2786
|
+
model: r(o).search.form,
|
|
2795
2787
|
inline: "",
|
|
2796
2788
|
size: e.option.size?.search
|
|
2797
2789
|
}, {
|
|
2798
2790
|
default: p(() => [
|
|
2799
2791
|
S(u.$slots, "search-start", {
|
|
2800
|
-
row:
|
|
2792
|
+
row: r(o).search.form
|
|
2801
2793
|
}),
|
|
2802
|
-
(g(!0), v(B, null, G(
|
|
2794
|
+
(g(!0), v(B, null, G(r(o).search.column.list, (m) => (g(), v(B, {
|
|
2803
2795
|
key: m.key
|
|
2804
2796
|
}, [
|
|
2805
2797
|
S(u.$slots, "search-" + m.key + "-start", {
|
|
2806
|
-
row:
|
|
2798
|
+
row: r(o).search.form
|
|
2807
2799
|
}),
|
|
2808
|
-
(typeof m.show?.search == "function" ? m.show?.search(
|
|
2800
|
+
(typeof m.show?.search == "function" ? m.show?.search(r(o).search.form) : m.show?.search) ? (g(), b(r(be), {
|
|
2809
2801
|
key: 0,
|
|
2810
2802
|
label: m.text?.search?.label ?? m.label
|
|
2811
2803
|
}, {
|
|
2812
2804
|
default: p(() => [
|
|
2813
2805
|
S(u.$slots, "search-" + m.key + "-left", {
|
|
2814
|
-
row:
|
|
2806
|
+
row: r(o).search.form
|
|
2815
2807
|
}),
|
|
2816
2808
|
S(u.$slots, "search-" + m.key, {
|
|
2817
|
-
row:
|
|
2809
|
+
row: r(o).search.form
|
|
2818
2810
|
}, () => [
|
|
2819
|
-
m.options?.search?.type ? (g(), b(
|
|
2811
|
+
m.options?.search?.type ? (g(), b(Ae, {
|
|
2820
2812
|
key: 0,
|
|
2821
2813
|
item: m,
|
|
2822
|
-
conf:
|
|
2814
|
+
conf: r(o),
|
|
2823
2815
|
type: m.options.search.type
|
|
2824
|
-
}, null, 8, ["item", "conf", "type"])) : (g(), b(
|
|
2816
|
+
}, null, 8, ["item", "conf", "type"])) : (g(), b(Ae, {
|
|
2825
2817
|
key: 1,
|
|
2826
2818
|
item: m,
|
|
2827
|
-
conf:
|
|
2819
|
+
conf: r(o),
|
|
2828
2820
|
type: m.type
|
|
2829
2821
|
}, null, 8, ["item", "conf", "type"]))
|
|
2830
2822
|
]),
|
|
2831
2823
|
S(u.$slots, "search-" + m.key + "-right", {
|
|
2832
|
-
row:
|
|
2824
|
+
row: r(o).search.form
|
|
2833
2825
|
})
|
|
2834
2826
|
]),
|
|
2835
2827
|
_: 2
|
|
2836
2828
|
}, 1032, ["label"])) : V("", !0),
|
|
2837
2829
|
S(u.$slots, "search-" + m.key + "-end", {
|
|
2838
|
-
row:
|
|
2830
|
+
row: r(o).search.form
|
|
2839
2831
|
})
|
|
2840
2832
|
], 64))), 128)),
|
|
2841
2833
|
S(u.$slots, "search-center", {
|
|
2842
|
-
row:
|
|
2834
|
+
row: r(o).search.form
|
|
2843
2835
|
}),
|
|
2844
|
-
e.option.tools?.search || e.option.tools?.reset ? (g(), b(
|
|
2836
|
+
e.option.tools?.search || e.option.tools?.reset ? (g(), b(r(be), { key: 0 }, {
|
|
2845
2837
|
default: p(() => [
|
|
2846
|
-
e.option.tools?.search ? (g(), b(
|
|
2838
|
+
e.option.tools?.search ? (g(), b(r(N), {
|
|
2847
2839
|
key: 0,
|
|
2848
2840
|
type: "primary",
|
|
2849
|
-
onClick:
|
|
2841
|
+
onClick: r(o).search.submit
|
|
2850
2842
|
}, {
|
|
2851
2843
|
default: p(() => [
|
|
2852
|
-
M(U(
|
|
2844
|
+
M(U(r(C).tCurd("search")), 1)
|
|
2853
2845
|
]),
|
|
2854
2846
|
_: 1
|
|
2855
2847
|
}, 8, ["onClick"])) : V("", !0),
|
|
2856
|
-
e.option.tools?.reset ? (g(), b(
|
|
2848
|
+
e.option.tools?.reset ? (g(), b(r(N), {
|
|
2857
2849
|
key: 1,
|
|
2858
|
-
onClick:
|
|
2850
|
+
onClick: r(o).search.reset
|
|
2859
2851
|
}, {
|
|
2860
2852
|
default: p(() => [
|
|
2861
|
-
M(U(
|
|
2853
|
+
M(U(r(C).tCurd("reset")), 1)
|
|
2862
2854
|
]),
|
|
2863
2855
|
_: 1
|
|
2864
2856
|
}, 8, ["onClick"])) : V("", !0)
|
|
@@ -2866,84 +2858,84 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
2866
2858
|
_: 1
|
|
2867
2859
|
})) : V("", !0),
|
|
2868
2860
|
S(u.$slots, "search-end", {
|
|
2869
|
-
row:
|
|
2861
|
+
row: r(o).search.form
|
|
2870
2862
|
})
|
|
2871
2863
|
]),
|
|
2872
2864
|
_: 3
|
|
2873
2865
|
}, 8, ["model", "size"])
|
|
2874
2866
|
])) : V("", !0),
|
|
2875
|
-
R("div",
|
|
2876
|
-
R("div",
|
|
2877
|
-
|
|
2878
|
-
F(
|
|
2867
|
+
R("div", Lo, [
|
|
2868
|
+
R("div", jo, [
|
|
2869
|
+
r(s)(e.option.tools?.add) ? (g(), v("div", Ko, [
|
|
2870
|
+
F(r(N), {
|
|
2879
2871
|
type: "primary",
|
|
2880
|
-
onClick:
|
|
2872
|
+
onClick: d[0] || (d[0] = (m) => r(o).update.open(r(n).Add)),
|
|
2881
2873
|
size: e.option.size?.search
|
|
2882
2874
|
}, {
|
|
2883
2875
|
default: p(() => [
|
|
2884
|
-
M(U(
|
|
2876
|
+
M(U(r(C).tCurd("add")), 1)
|
|
2885
2877
|
]),
|
|
2886
2878
|
_: 1
|
|
2887
2879
|
}, 8, ["size"])
|
|
2888
2880
|
])) : V("", !0),
|
|
2889
|
-
e.option.table?.selectable &&
|
|
2890
|
-
F(
|
|
2881
|
+
e.option.table?.selectable && r(s)(e.option.tools?.delete) ? (g(), v("div", Po, [
|
|
2882
|
+
F(r(N), {
|
|
2891
2883
|
type: "danger",
|
|
2892
|
-
onClick:
|
|
2884
|
+
onClick: d[1] || (d[1] = (m) => r(o).remove.open(r(o).table.selection.list)),
|
|
2893
2885
|
size: e.option.size?.search
|
|
2894
2886
|
}, {
|
|
2895
2887
|
default: p(() => [
|
|
2896
|
-
M(U(
|
|
2888
|
+
M(U(r(C).tCurd("delete")), 1)
|
|
2897
2889
|
]),
|
|
2898
2890
|
_: 1
|
|
2899
2891
|
}, 8, ["size"])
|
|
2900
2892
|
])) : V("", !0),
|
|
2901
|
-
e.option.tools?.expand ? (g(), v("div",
|
|
2902
|
-
F(
|
|
2893
|
+
e.option.tools?.expand ? (g(), v("div", Io, [
|
|
2894
|
+
F(r(N), {
|
|
2903
2895
|
type: "warning",
|
|
2904
|
-
onClick:
|
|
2896
|
+
onClick: d[2] || (d[2] = (m) => r(o).table.expand.all()),
|
|
2905
2897
|
size: e.option.size?.search
|
|
2906
2898
|
}, {
|
|
2907
2899
|
default: p(() => [
|
|
2908
|
-
M(U(
|
|
2900
|
+
M(U(r(C).tCurd("expandCollapse")), 1)
|
|
2909
2901
|
]),
|
|
2910
2902
|
_: 1
|
|
2911
2903
|
}, 8, ["size"])
|
|
2912
2904
|
])) : V("", !0),
|
|
2913
2905
|
e.option.tools?.export?.show ? (g(), v(B, { key: 3 }, [
|
|
2914
|
-
e.option.tools?.export?.dropdown?.show ? (g(), b(
|
|
2906
|
+
e.option.tools?.export?.dropdown?.show ? (g(), b(r(mt), {
|
|
2915
2907
|
key: 0,
|
|
2916
|
-
onCommand:
|
|
2908
|
+
onCommand: r(o).export.click
|
|
2917
2909
|
}, {
|
|
2918
2910
|
dropdown: p(() => [
|
|
2919
|
-
F(
|
|
2911
|
+
F(r(gt), {
|
|
2920
2912
|
size: e.option.size?.search
|
|
2921
2913
|
}, {
|
|
2922
2914
|
default: p(() => [
|
|
2923
|
-
e.option.tools?.export?.dropdown?.select && (e.option.table?.selectable ||
|
|
2915
|
+
e.option.tools?.export?.dropdown?.select && (e.option.table?.selectable || r(s)(e.option.tools?.delete)) ? (g(), b(r(Se), {
|
|
2924
2916
|
key: 0,
|
|
2925
2917
|
command: "select"
|
|
2926
2918
|
}, {
|
|
2927
2919
|
default: p(() => [
|
|
2928
|
-
M(U(
|
|
2920
|
+
M(U(r(C).tCurd("exportSelect")), 1)
|
|
2929
2921
|
]),
|
|
2930
2922
|
_: 1
|
|
2931
2923
|
})) : V("", !0),
|
|
2932
|
-
e.option.tools?.export?.dropdown?.page ? (g(), b(
|
|
2924
|
+
e.option.tools?.export?.dropdown?.page ? (g(), b(r(Se), {
|
|
2933
2925
|
key: 1,
|
|
2934
2926
|
command: "page"
|
|
2935
2927
|
}, {
|
|
2936
2928
|
default: p(() => [
|
|
2937
|
-
M(U(
|
|
2929
|
+
M(U(r(C).tCurd("exportPage")), 1)
|
|
2938
2930
|
]),
|
|
2939
2931
|
_: 1
|
|
2940
2932
|
})) : V("", !0),
|
|
2941
|
-
e.option.tools?.export?.dropdown?.all ? (g(), b(
|
|
2933
|
+
e.option.tools?.export?.dropdown?.all ? (g(), b(r(Se), {
|
|
2942
2934
|
key: 2,
|
|
2943
2935
|
command: "all"
|
|
2944
2936
|
}, {
|
|
2945
2937
|
default: p(() => [
|
|
2946
|
-
M(U(
|
|
2938
|
+
M(U(r(C).tCurd("exportAll")), 1)
|
|
2947
2939
|
]),
|
|
2948
2940
|
_: 1
|
|
2949
2941
|
})) : V("", !0)
|
|
@@ -2952,29 +2944,29 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
2952
2944
|
}, 8, ["size"])
|
|
2953
2945
|
]),
|
|
2954
2946
|
default: p(() => [
|
|
2955
|
-
R("div",
|
|
2956
|
-
F(
|
|
2947
|
+
R("div", No, [
|
|
2948
|
+
F(r(N), {
|
|
2957
2949
|
type: "warning",
|
|
2958
|
-
loading:
|
|
2950
|
+
loading: r(o).export.loading,
|
|
2959
2951
|
size: e.option.size?.search
|
|
2960
2952
|
}, {
|
|
2961
2953
|
default: p(() => [
|
|
2962
|
-
M(U(
|
|
2954
|
+
M(U(r(C).tCurd("export")), 1)
|
|
2963
2955
|
]),
|
|
2964
2956
|
_: 1
|
|
2965
2957
|
}, 8, ["loading", "size"])
|
|
2966
2958
|
])
|
|
2967
2959
|
]),
|
|
2968
2960
|
_: 1
|
|
2969
|
-
}, 8, ["onCommand"])) : (g(), v("div",
|
|
2970
|
-
F(
|
|
2961
|
+
}, 8, ["onCommand"])) : (g(), v("div", Go, [
|
|
2962
|
+
F(r(N), {
|
|
2971
2963
|
type: "warning",
|
|
2972
|
-
loading:
|
|
2964
|
+
loading: r(o).export.loading,
|
|
2973
2965
|
size: e.option.size?.search,
|
|
2974
|
-
onClick:
|
|
2966
|
+
onClick: d[3] || (d[3] = (m) => r(o).export.run.start("all"))
|
|
2975
2967
|
}, {
|
|
2976
2968
|
default: p(() => [
|
|
2977
|
-
M(U(
|
|
2969
|
+
M(U(r(C).tCurd("export")), 1)
|
|
2978
2970
|
]),
|
|
2979
2971
|
_: 1
|
|
2980
2972
|
}, 8, ["loading", "size"])
|
|
@@ -2982,36 +2974,36 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
2982
2974
|
], 64)) : V("", !0),
|
|
2983
2975
|
S(u.$slots, "tools-left")
|
|
2984
2976
|
]),
|
|
2985
|
-
R("div",
|
|
2977
|
+
R("div", Ho, [
|
|
2986
2978
|
S(u.$slots, "tools-right"),
|
|
2987
|
-
|
|
2979
|
+
r(o).page.showTools ? (g(), b(r(Re), x({
|
|
2988
2980
|
key: 0,
|
|
2989
|
-
"current-page":
|
|
2990
|
-
"onUpdate:currentPage":
|
|
2991
|
-
"page-size":
|
|
2992
|
-
"onUpdate:pageSize":
|
|
2981
|
+
"current-page": r(o).page.num,
|
|
2982
|
+
"onUpdate:currentPage": d[4] || (d[4] = (m) => r(o).page.num = m),
|
|
2983
|
+
"page-size": r(o).page.size,
|
|
2984
|
+
"onUpdate:pageSize": d[5] || (d[5] = (m) => r(o).page.size = m),
|
|
2993
2985
|
background: "",
|
|
2994
|
-
"page-sizes":
|
|
2995
|
-
"pager-count":
|
|
2996
|
-
layout:
|
|
2997
|
-
total:
|
|
2986
|
+
"page-sizes": r(o).page.sizeList,
|
|
2987
|
+
"pager-count": r(o).page.pagerCount,
|
|
2988
|
+
layout: r(o).page.layout,
|
|
2989
|
+
total: r(o).page.total,
|
|
2998
2990
|
size: e.option.size?.table,
|
|
2999
|
-
onSizeChange:
|
|
3000
|
-
onCurrentChange:
|
|
2991
|
+
onSizeChange: r(o).table.getList,
|
|
2992
|
+
onCurrentChange: r(o).table.getList
|
|
3001
2993
|
}, e.option.page?.pagination || {}, E(e.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : V("", !0),
|
|
3002
2994
|
e.option.tools?.expandColumn === void 0 || e.option.tools?.expandColumn ? (g(), b(h, {
|
|
3003
2995
|
key: 1,
|
|
3004
2996
|
effect: "dark",
|
|
3005
|
-
content:
|
|
2997
|
+
content: r(o).table.header.group.expand ? r(C).tCurd("mergeColumn") : r(C).tCurd("expandColumn"),
|
|
3006
2998
|
placement: "top"
|
|
3007
2999
|
}, {
|
|
3008
3000
|
default: p(() => [
|
|
3009
3001
|
R("div", {
|
|
3010
3002
|
class: J(["refresh-btn", [e.option.size?.search]]),
|
|
3011
|
-
onClick:
|
|
3012
|
-
(...m) =>
|
|
3003
|
+
onClick: d[6] || (d[6] = //@ts-ignore
|
|
3004
|
+
(...m) => r(o).table.header.group.toggleExpandAll && r(o).table.header.group.toggleExpandAll(...m))
|
|
3013
3005
|
}, [
|
|
3014
|
-
|
|
3006
|
+
r(o).table.header.group.expand ? (g(), b(io, { key: 0 })) : (g(), b(co, { key: 1 }))
|
|
3015
3007
|
], 2)
|
|
3016
3008
|
]),
|
|
3017
3009
|
_: 1
|
|
@@ -3019,10 +3011,10 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
3019
3011
|
e.option.tools?.refresh === void 0 || e.option.tools?.refresh ? (g(), v("div", {
|
|
3020
3012
|
key: 2,
|
|
3021
3013
|
class: J(["refresh-btn", [e.option.size?.search]]),
|
|
3022
|
-
onClick:
|
|
3023
|
-
(...m) =>
|
|
3014
|
+
onClick: d[7] || (d[7] = //@ts-ignore
|
|
3015
|
+
(...m) => r(o).table.getList && r(o).table.getList(...m))
|
|
3024
3016
|
}, [
|
|
3025
|
-
F(
|
|
3017
|
+
F(ho)
|
|
3026
3018
|
], 2)) : V("", !0)
|
|
3027
3019
|
])
|
|
3028
3020
|
]),
|
|
@@ -3032,18 +3024,18 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
3032
3024
|
R("div", {
|
|
3033
3025
|
class: J(["column form-box-content", [e.option.table?.fitHeight ? "absolute fit" : ""]])
|
|
3034
3026
|
}, [
|
|
3035
|
-
|
|
3027
|
+
pt((g(), b(r(ht), x({
|
|
3036
3028
|
ref_key: "tableRef",
|
|
3037
3029
|
ref: c,
|
|
3038
|
-
data:
|
|
3030
|
+
data: r(o).table.data,
|
|
3039
3031
|
border: e.option.table?.border === void 0 ? !0 : e.option.table?.border,
|
|
3040
|
-
onSelectionChange:
|
|
3041
|
-
onSortChange:
|
|
3042
|
-
"expand-row-keys":
|
|
3043
|
-
onExpandChange:
|
|
3032
|
+
onSelectionChange: r(o).table.selection.change,
|
|
3033
|
+
onSortChange: r(o).table.sort.change,
|
|
3034
|
+
"expand-row-keys": r(o).table.expand.rowKeys,
|
|
3035
|
+
onExpandChange: r(o).table.expand.change
|
|
3044
3036
|
}, e.option.table, E(e.option.table?.on || {})), {
|
|
3045
3037
|
default: p(() => [
|
|
3046
|
-
(typeof e.option.table?.selectable == "object" ? e.option.table?.selectable?.show : e.option.table?.selectable) ||
|
|
3038
|
+
(typeof e.option.table?.selectable == "object" ? e.option.table?.selectable?.show : e.option.table?.selectable) || r(s)(e.option.tools?.delete) || e.option.tools?.export?.show && e.option.tools?.export?.select ? (g(), b(r(ye), x({
|
|
3047
3039
|
key: 0,
|
|
3048
3040
|
type: "selection",
|
|
3049
3041
|
width: "40",
|
|
@@ -3052,7 +3044,7 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
3052
3044
|
"show-overflow-tooltip": !1,
|
|
3053
3045
|
className: "cc1-form-selectable-column"
|
|
3054
3046
|
}, typeof e.option.table?.selectable == "object" ? e.option.table?.selectable : {}, E(typeof e.option.table?.selectable == "object" ? e.option.table?.selectable?.on || {} : {})), null, 16)) : V("", !0),
|
|
3055
|
-
(typeof e.option.table?.index == "object" ? e.option.table?.index?.show : e.option.table?.index) ? (g(), b(
|
|
3047
|
+
(typeof e.option.table?.index == "object" ? e.option.table?.index?.show : e.option.table?.index) ? (g(), b(r(ye), x({
|
|
3056
3048
|
key: 1,
|
|
3057
3049
|
type: "index",
|
|
3058
3050
|
fixed: "left",
|
|
@@ -3062,9 +3054,9 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
3062
3054
|
"show-overflow-tooltip": !1,
|
|
3063
3055
|
className: "cc1-form-index-column"
|
|
3064
3056
|
}, typeof e.option.table?.index == "object" ? e.option.table?.index : {}, E(typeof e.option.table?.index == "object" ? e.option.table?.index?.on || {} : {})), null, 16)) : V("", !0),
|
|
3065
|
-
F(
|
|
3066
|
-
conf:
|
|
3067
|
-
columnList:
|
|
3057
|
+
F(Bo, {
|
|
3058
|
+
conf: r(o),
|
|
3059
|
+
columnList: r(o).table.column.list,
|
|
3068
3060
|
option: e.option
|
|
3069
3061
|
}, Y({ _: 2 }, [
|
|
3070
3062
|
G(u.$slots, (m, w) => ({
|
|
@@ -3074,7 +3066,7 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
3074
3066
|
])
|
|
3075
3067
|
}))
|
|
3076
3068
|
]), 1032, ["conf", "columnList", "option"]),
|
|
3077
|
-
|
|
3069
|
+
r(s)(e.option.table?.add) || r(s)(e.option.table?.update) || r(s)(e.option.table?.delete) || r(s)(e.option.table?.view) || u.$slots["table-op-left"] || u.$slots["table-op-right"] ? (g(), b(r(ye), x({
|
|
3078
3070
|
key: 2,
|
|
3079
3071
|
align: "center",
|
|
3080
3072
|
fixed: "right"
|
|
@@ -3084,80 +3076,80 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
3084
3076
|
}), {
|
|
3085
3077
|
header: p(() => [
|
|
3086
3078
|
S(u.$slots, "table-header-op", {}, () => [
|
|
3087
|
-
M(U(
|
|
3079
|
+
M(U(r(C).tCurd("operation")), 1)
|
|
3088
3080
|
])
|
|
3089
3081
|
]),
|
|
3090
3082
|
default: p(({ row: m }) => [
|
|
3091
|
-
F(
|
|
3083
|
+
F(r(oe), {
|
|
3092
3084
|
size: e.option.size?.table
|
|
3093
3085
|
}, {
|
|
3094
3086
|
default: p(() => [
|
|
3095
3087
|
S(u.$slots, "table-op-left", { row: m }),
|
|
3096
|
-
|
|
3097
|
-
F(
|
|
3088
|
+
r(o).update.type === r(n).Update && e.option.table?.inlineEdit && r(o).update.form[a.option.table?.rowKey] === m[a.option.table?.rowKey] ? (g(), v(B, { key: 0 }, [
|
|
3089
|
+
F(r(N), {
|
|
3098
3090
|
link: "",
|
|
3099
3091
|
type: "info",
|
|
3100
|
-
onClick:
|
|
3092
|
+
onClick: r(o).update.close
|
|
3101
3093
|
}, {
|
|
3102
3094
|
default: p(() => [
|
|
3103
|
-
M(U(
|
|
3095
|
+
M(U(r(C).tCurd("cancel")), 1)
|
|
3104
3096
|
]),
|
|
3105
3097
|
_: 1
|
|
3106
3098
|
}, 8, ["onClick"]),
|
|
3107
|
-
F(
|
|
3099
|
+
F(r(N), {
|
|
3108
3100
|
link: "",
|
|
3109
3101
|
type: "primary",
|
|
3110
|
-
onClick:
|
|
3111
|
-
loading:
|
|
3102
|
+
onClick: r(o).update.submit,
|
|
3103
|
+
loading: r(o).update.loading
|
|
3112
3104
|
}, {
|
|
3113
3105
|
default: p(() => [
|
|
3114
|
-
M(U(
|
|
3106
|
+
M(U(r(C).tCurd("confirm")), 1)
|
|
3115
3107
|
]),
|
|
3116
3108
|
_: 1
|
|
3117
3109
|
}, 8, ["onClick", "loading"]),
|
|
3118
3110
|
S(u.$slots, "table-op-edit-right", { row: m })
|
|
3119
3111
|
], 64)) : (g(), v(B, { key: 1 }, [
|
|
3120
|
-
|
|
3112
|
+
r(s)(e.option.table?.add, m) ? (g(), b(r(N), {
|
|
3121
3113
|
key: 0,
|
|
3122
3114
|
link: "",
|
|
3123
3115
|
type: "primary",
|
|
3124
|
-
onClick: (w) =>
|
|
3116
|
+
onClick: (w) => r(o).update.open(r(n).Add, m)
|
|
3125
3117
|
}, {
|
|
3126
3118
|
default: p(() => [
|
|
3127
|
-
M(U(
|
|
3119
|
+
M(U(r(C).tCurd("add")), 1)
|
|
3128
3120
|
]),
|
|
3129
3121
|
_: 1
|
|
3130
3122
|
}, 8, ["onClick"])) : V("", !0),
|
|
3131
|
-
|
|
3123
|
+
r(s)(e.option.table?.view, m) ? (g(), b(r(N), {
|
|
3132
3124
|
key: 1,
|
|
3133
3125
|
link: "",
|
|
3134
3126
|
type: "primary",
|
|
3135
|
-
onClick: (w) =>
|
|
3127
|
+
onClick: (w) => r(o).update.open(r(n).View, m)
|
|
3136
3128
|
}, {
|
|
3137
3129
|
default: p(() => [
|
|
3138
|
-
M(U(
|
|
3130
|
+
M(U(r(C).tCurd("view")), 1)
|
|
3139
3131
|
]),
|
|
3140
3132
|
_: 1
|
|
3141
3133
|
}, 8, ["onClick"])) : V("", !0),
|
|
3142
|
-
|
|
3134
|
+
r(s)(e.option.table?.update, m) ? (g(), b(r(N), {
|
|
3143
3135
|
key: 2,
|
|
3144
3136
|
link: "",
|
|
3145
3137
|
type: "warning",
|
|
3146
|
-
onClick: (w) =>
|
|
3138
|
+
onClick: (w) => r(o).update.open(r(n).Update, m)
|
|
3147
3139
|
}, {
|
|
3148
3140
|
default: p(() => [
|
|
3149
|
-
M(U(
|
|
3141
|
+
M(U(r(C).tCurd("edit")), 1)
|
|
3150
3142
|
]),
|
|
3151
3143
|
_: 1
|
|
3152
3144
|
}, 8, ["onClick"])) : V("", !0),
|
|
3153
|
-
|
|
3145
|
+
r(s)(e.option.table?.delete, m) ? (g(), b(r(N), {
|
|
3154
3146
|
key: 3,
|
|
3155
3147
|
link: "",
|
|
3156
3148
|
type: "danger",
|
|
3157
|
-
onClick: (w) =>
|
|
3149
|
+
onClick: (w) => r(o).remove.open([m])
|
|
3158
3150
|
}, {
|
|
3159
3151
|
default: p(() => [
|
|
3160
|
-
M(U(
|
|
3152
|
+
M(U(r(C).tCurd("delete")), 1)
|
|
3161
3153
|
]),
|
|
3162
3154
|
_: 1
|
|
3163
3155
|
}, 8, ["onClick"])) : V("", !0),
|
|
@@ -3172,61 +3164,61 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
3172
3164
|
]),
|
|
3173
3165
|
_: 3
|
|
3174
3166
|
}, 16, ["data", "border", "onSelectionChange", "onSortChange", "expand-row-keys", "onExpandChange"])), [
|
|
3175
|
-
[f,
|
|
3167
|
+
[f, r(o).table.loading]
|
|
3176
3168
|
])
|
|
3177
3169
|
], 2)
|
|
3178
3170
|
], 2),
|
|
3179
|
-
R("div",
|
|
3180
|
-
(e.option.page?.show === void 0 || e.option.page?.show) && !
|
|
3171
|
+
R("div", Wo, [
|
|
3172
|
+
(e.option.page?.show === void 0 || e.option.page?.show) && !r(o).page.showTools ? (g(), b(r(Re), x({
|
|
3181
3173
|
key: 0,
|
|
3182
|
-
"current-page":
|
|
3183
|
-
"onUpdate:currentPage":
|
|
3184
|
-
"page-size":
|
|
3185
|
-
"onUpdate:pageSize":
|
|
3174
|
+
"current-page": r(o).page.num,
|
|
3175
|
+
"onUpdate:currentPage": d[8] || (d[8] = (m) => r(o).page.num = m),
|
|
3176
|
+
"page-size": r(o).page.size,
|
|
3177
|
+
"onUpdate:pageSize": d[9] || (d[9] = (m) => r(o).page.size = m),
|
|
3186
3178
|
background: "",
|
|
3187
|
-
"page-sizes":
|
|
3188
|
-
"pager-count":
|
|
3189
|
-
layout:
|
|
3190
|
-
total:
|
|
3179
|
+
"page-sizes": r(o).page.sizeList,
|
|
3180
|
+
"pager-count": r(o).page.pagerCount,
|
|
3181
|
+
layout: r(o).page.layout,
|
|
3182
|
+
total: r(o).page.total,
|
|
3191
3183
|
size: e.option.size?.table,
|
|
3192
|
-
onSizeChange:
|
|
3193
|
-
onCurrentChange:
|
|
3184
|
+
onSizeChange: r(o).table.getList,
|
|
3185
|
+
onCurrentChange: r(o).table.getList
|
|
3194
3186
|
}, e.option.page?.pagination || {}, E(e.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : V("", !0)
|
|
3195
3187
|
])
|
|
3196
3188
|
], 2),
|
|
3197
3189
|
S(u.$slots, "box-right")
|
|
3198
3190
|
], 2),
|
|
3199
|
-
F(
|
|
3200
|
-
modelValue:
|
|
3201
|
-
"onUpdate:modelValue":
|
|
3202
|
-
title:
|
|
3203
|
-
"before-close":
|
|
3191
|
+
F(r(Ee), x({
|
|
3192
|
+
modelValue: r(o).update.show,
|
|
3193
|
+
"onUpdate:modelValue": d[10] || (d[10] = (m) => r(o).update.show = m),
|
|
3194
|
+
title: r(o).update.title,
|
|
3195
|
+
"before-close": r(o).update.close
|
|
3204
3196
|
}, e.option.dialog), {
|
|
3205
3197
|
footer: p(() => [
|
|
3206
|
-
R("span",
|
|
3207
|
-
F(
|
|
3198
|
+
R("span", Jo, [
|
|
3199
|
+
F(r(oe), {
|
|
3208
3200
|
size: e.option.size?.form
|
|
3209
3201
|
}, {
|
|
3210
3202
|
default: p(() => [
|
|
3211
3203
|
S(u.$slots, "dialog-footer", {
|
|
3212
|
-
row:
|
|
3204
|
+
row: r(o).update
|
|
3213
3205
|
}, () => [
|
|
3214
|
-
F(
|
|
3215
|
-
onClick:
|
|
3206
|
+
F(r(N), {
|
|
3207
|
+
onClick: r(o).update.close
|
|
3216
3208
|
}, {
|
|
3217
3209
|
default: p(() => [
|
|
3218
|
-
M(U(
|
|
3210
|
+
M(U(r(C).tCurd("close")), 1)
|
|
3219
3211
|
]),
|
|
3220
3212
|
_: 1
|
|
3221
3213
|
}, 8, ["onClick"]),
|
|
3222
|
-
|
|
3214
|
+
r(o).update.type !== r(n).View ? (g(), b(r(N), {
|
|
3223
3215
|
key: 0,
|
|
3224
3216
|
type: "primary",
|
|
3225
|
-
onClick:
|
|
3226
|
-
loading:
|
|
3217
|
+
onClick: r(o).update.submit,
|
|
3218
|
+
loading: r(o).update.loading
|
|
3227
3219
|
}, {
|
|
3228
3220
|
default: p(() => [
|
|
3229
|
-
M(U(
|
|
3221
|
+
M(U(r(C).tCurd("submit")), 1)
|
|
3230
3222
|
]),
|
|
3231
3223
|
_: 1
|
|
3232
3224
|
}, 8, ["onClick", "loading"])) : V("", !0)
|
|
@@ -3238,29 +3230,29 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
3238
3230
|
]),
|
|
3239
3231
|
default: p(() => [
|
|
3240
3232
|
S(u.$slots, "dialog-start", {
|
|
3241
|
-
row:
|
|
3233
|
+
row: r(o).update
|
|
3242
3234
|
}),
|
|
3243
|
-
F(
|
|
3235
|
+
F(r(oe), {
|
|
3244
3236
|
ref_key: "ruleFormRef",
|
|
3245
|
-
ref:
|
|
3246
|
-
model:
|
|
3247
|
-
rules:
|
|
3237
|
+
ref: i,
|
|
3238
|
+
model: r(o).update.form,
|
|
3239
|
+
rules: r(o).update.rules,
|
|
3248
3240
|
size: e.option.size?.form,
|
|
3249
3241
|
class: "update-dialog-form"
|
|
3250
3242
|
}, {
|
|
3251
3243
|
default: p(() => [
|
|
3252
|
-
|
|
3244
|
+
r(o).update.showContent ? (g(), b(ot, {
|
|
3253
3245
|
key: 0,
|
|
3254
|
-
"form-grid":
|
|
3255
|
-
"max-span":
|
|
3256
|
-
form:
|
|
3257
|
-
type:
|
|
3246
|
+
"form-grid": r(o).update.formGrid,
|
|
3247
|
+
"max-span": r(o).update.formMaxSpan,
|
|
3248
|
+
form: r(o).update.form,
|
|
3249
|
+
type: r(o).update.type,
|
|
3258
3250
|
stripe: e.option.form?.stripe,
|
|
3259
3251
|
"label-width": e.option.form?.labelWidth,
|
|
3260
3252
|
"form-option": e.option.form,
|
|
3261
|
-
"get-bind":
|
|
3262
|
-
"get-on":
|
|
3263
|
-
"get-disabled":
|
|
3253
|
+
"get-bind": r(o).update.getBind,
|
|
3254
|
+
"get-on": r(o).update.getOn,
|
|
3255
|
+
"get-disabled": r(o).update.getDisabled
|
|
3264
3256
|
}, Y({ _: 2 }, [
|
|
3265
3257
|
G(u.$slots, (m, w) => ({
|
|
3266
3258
|
name: w,
|
|
@@ -3273,38 +3265,38 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
3273
3265
|
_: 3
|
|
3274
3266
|
}, 8, ["model", "rules", "size"]),
|
|
3275
3267
|
S(u.$slots, "dialog-end", {
|
|
3276
|
-
row:
|
|
3268
|
+
row: r(o).update
|
|
3277
3269
|
})
|
|
3278
3270
|
]),
|
|
3279
3271
|
_: 3
|
|
3280
3272
|
}, 16, ["modelValue", "title", "before-close"]),
|
|
3281
|
-
F(
|
|
3282
|
-
modelValue:
|
|
3283
|
-
"onUpdate:modelValue":
|
|
3284
|
-
title:
|
|
3273
|
+
F(r(Ee), {
|
|
3274
|
+
modelValue: r(o).remove.show,
|
|
3275
|
+
"onUpdate:modelValue": d[11] || (d[11] = (m) => r(o).remove.show = m),
|
|
3276
|
+
title: r(o).remove.title,
|
|
3285
3277
|
"close-on-click-modal": !1
|
|
3286
3278
|
}, {
|
|
3287
3279
|
footer: p(() => [
|
|
3288
|
-
R("span",
|
|
3289
|
-
F(
|
|
3280
|
+
R("span", Xo, [
|
|
3281
|
+
F(r(oe), {
|
|
3290
3282
|
size: e.option.size?.form
|
|
3291
3283
|
}, {
|
|
3292
3284
|
default: p(() => [
|
|
3293
|
-
F(
|
|
3294
|
-
onClick:
|
|
3285
|
+
F(r(N), {
|
|
3286
|
+
onClick: r(o).remove.close
|
|
3295
3287
|
}, {
|
|
3296
3288
|
default: p(() => [
|
|
3297
|
-
M(U(
|
|
3289
|
+
M(U(r(C).tCurd("close")), 1)
|
|
3298
3290
|
]),
|
|
3299
3291
|
_: 1
|
|
3300
3292
|
}, 8, ["onClick"]),
|
|
3301
|
-
F(
|
|
3293
|
+
F(r(N), {
|
|
3302
3294
|
type: "danger",
|
|
3303
|
-
onClick:
|
|
3304
|
-
loading:
|
|
3295
|
+
onClick: r(o).remove.submit,
|
|
3296
|
+
loading: r(o).remove.loading
|
|
3305
3297
|
}, {
|
|
3306
3298
|
default: p(() => [
|
|
3307
|
-
M(U(
|
|
3299
|
+
M(U(r(C).tCurd("confirmDelete")), 1)
|
|
3308
3300
|
]),
|
|
3309
3301
|
_: 1
|
|
3310
3302
|
}, 8, ["onClick", "loading"])
|
|
@@ -3314,25 +3306,25 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
3314
3306
|
])
|
|
3315
3307
|
]),
|
|
3316
3308
|
default: p(() => [
|
|
3317
|
-
e.option.dialog?.delete?.content ? (g(), v("div",
|
|
3318
|
-
F(
|
|
3309
|
+
e.option.dialog?.delete?.content ? (g(), v("div", qo, [
|
|
3310
|
+
F(oo, {
|
|
3319
3311
|
content: e.option.dialog?.delete?.content,
|
|
3320
|
-
value:
|
|
3312
|
+
value: r(o).remove.items
|
|
3321
3313
|
}, null, 8, ["content", "value"])
|
|
3322
|
-
])) : (g(), v("div",
|
|
3314
|
+
])) : (g(), v("div", Qo, U(r(C).tCurd("confirmDeleteMessage", r(o).remove.items.length)), 1))
|
|
3323
3315
|
]),
|
|
3324
3316
|
_: 1
|
|
3325
3317
|
}, 8, ["modelValue", "title"]),
|
|
3326
|
-
F(
|
|
3318
|
+
F(eo, {
|
|
3327
3319
|
ref_key: "switchConfirmRef",
|
|
3328
|
-
ref:
|
|
3320
|
+
ref: l,
|
|
3329
3321
|
size: e.option.size?.form
|
|
3330
3322
|
}, null, 8, ["size"])
|
|
3331
3323
|
], 2);
|
|
3332
3324
|
};
|
|
3333
3325
|
}
|
|
3334
3326
|
});
|
|
3335
|
-
class
|
|
3327
|
+
class aa {
|
|
3336
3328
|
/**
|
|
3337
3329
|
* 通过远程 URL 下载文件,自动创建临时 `<a>` 标签触发浏览器下载
|
|
3338
3330
|
*
|
|
@@ -3340,8 +3332,8 @@ class oa {
|
|
|
3340
3332
|
* @param name - 下载后的文件名,默认 `'download.png'`
|
|
3341
3333
|
*/
|
|
3342
3334
|
static async download(t, n = "download.png") {
|
|
3343
|
-
const
|
|
3344
|
-
|
|
3335
|
+
const a = document.createElement("a");
|
|
3336
|
+
a.style.display = "none", a.href = t, a.setAttribute("download", n), typeof a.download > "u" && a.setAttribute("target", "_blank"), document.body.appendChild(a), a.click(), document.body.removeChild(a), window.URL.revokeObjectURL(t);
|
|
3345
3337
|
}
|
|
3346
3338
|
/**
|
|
3347
3339
|
* 将json对象或者json数组导出为json文件保存
|
|
@@ -3349,54 +3341,54 @@ class oa {
|
|
|
3349
3341
|
* @param name
|
|
3350
3342
|
*/
|
|
3351
3343
|
static exportJSONFile = (t, n) => {
|
|
3352
|
-
const
|
|
3353
|
-
|
|
3344
|
+
const a = new Blob([JSON.stringify(t)], { type: "application/json" }), s = URL.createObjectURL(a), o = document.createElement("a");
|
|
3345
|
+
o.href = s, o.download = `${n || "config"}.json`, o.click();
|
|
3354
3346
|
};
|
|
3355
3347
|
/**
|
|
3356
3348
|
* 导入文件内容,默认为json
|
|
3357
3349
|
* @param param
|
|
3358
3350
|
* @returns
|
|
3359
3351
|
*/
|
|
3360
|
-
static importFile = async (t) => new Promise((n,
|
|
3361
|
-
const
|
|
3362
|
-
|
|
3363
|
-
const
|
|
3364
|
-
|
|
3365
|
-
const
|
|
3366
|
-
if (!
|
|
3367
|
-
$.fail("未选择文件"),
|
|
3352
|
+
static importFile = async (t) => new Promise((n, a) => {
|
|
3353
|
+
const s = document.createElement("input");
|
|
3354
|
+
s.type = "file";
|
|
3355
|
+
const o = t?.accept || ".json";
|
|
3356
|
+
s.accept = o, s.style.display = "none", s.onchange = (l) => {
|
|
3357
|
+
const i = l.target.files[0];
|
|
3358
|
+
if (!i) {
|
|
3359
|
+
$.fail("未选择文件"), a("未选择文件");
|
|
3368
3360
|
return;
|
|
3369
3361
|
}
|
|
3370
3362
|
const c = new FileReader();
|
|
3371
3363
|
c.onload = async (u) => {
|
|
3372
|
-
const
|
|
3373
|
-
n(
|
|
3364
|
+
const d = o == ".json" ? JSON.parse(u.target.result) : u.target.result;
|
|
3365
|
+
n(d);
|
|
3374
3366
|
}, c.onerror = () => {
|
|
3375
|
-
$.fail("文件读取失败"),
|
|
3376
|
-
}, c.readAsText(
|
|
3377
|
-
}, document.body.appendChild(
|
|
3367
|
+
$.fail("文件读取失败"), a("文件读取失败");
|
|
3368
|
+
}, c.readAsText(i), document.body.removeChild(s);
|
|
3369
|
+
}, document.body.appendChild(s), s.click();
|
|
3378
3370
|
});
|
|
3379
3371
|
}
|
|
3380
|
-
const
|
|
3381
|
-
if (e.component("TCurd",
|
|
3372
|
+
const Zo = (e, t) => {
|
|
3373
|
+
if (e.component("TCurd", Yo), e.component("TFormList", Ne), e.component("TColumn", Kt), t?.customComponent) {
|
|
3382
3374
|
W.customComponent = t.customComponent;
|
|
3383
3375
|
for (const n in t.customComponent)
|
|
3384
3376
|
e.component(n, t.customComponent[n]);
|
|
3385
3377
|
}
|
|
3386
|
-
},
|
|
3387
|
-
install:
|
|
3378
|
+
}, na = {
|
|
3379
|
+
install: Zo
|
|
3388
3380
|
};
|
|
3389
3381
|
export {
|
|
3390
3382
|
Q as ArrUtil,
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3383
|
+
qt as ExcelUtil,
|
|
3384
|
+
Kt as TColumn,
|
|
3385
|
+
Yo as TCurd,
|
|
3386
|
+
aa as TFile,
|
|
3395
3387
|
W as TForm,
|
|
3396
3388
|
L as TFormConfig,
|
|
3397
3389
|
C as TFormI18n,
|
|
3398
|
-
|
|
3390
|
+
Ne as TFormList,
|
|
3399
3391
|
$ as TSys,
|
|
3400
|
-
|
|
3401
|
-
|
|
3392
|
+
na as default,
|
|
3393
|
+
Zo as install
|
|
3402
3394
|
};
|