cc1-form 1.3.5 → 1.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cc1-form.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ElMessage as
|
|
1
|
+
import { ElMessage as nt, ElLoading as lt, ElFormItem as be, ElInput as ue, ElInputNumber as it, ElSwitch as he, ElSelect as ce, ElOption as ne, ElRadioGroup as Be, ElRadioButton as rt, ElRadio as Te, ElCheckboxGroup as st, ElCheckboxButton as dt, ElCheckbox as ut, ElColorPicker as ct, ElSlider as ft, ElTreeSelect as mt, ElDatePicker as Le, ElForm as oe, ElDialog as Ee, ElButton as G, ElTableColumn as ye, ElDropdown as gt, ElDropdownMenu as ht, ElDropdownItem as Se, ElPagination as Re, ElTable as yt } 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 N, 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 bt, resolveDirective as pt, withDirectives as wt } 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
|
+
nt(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 = lt.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
|
-
(
|
|
620
|
-
let
|
|
621
|
-
return c.type === "number" && (
|
|
618
|
+
o.reduce(
|
|
619
|
+
(i, c) => {
|
|
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()), 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 kt = {
|
|
652
652
|
key: 0,
|
|
653
653
|
class: "column curd-form-com-list",
|
|
654
654
|
style: { width: "100%", gap: "10px" }
|
|
655
|
-
},
|
|
655
|
+
}, vt = { key: 0 }, Ct = {
|
|
656
656
|
class: "row items-center",
|
|
657
657
|
style: { gap: "10px", width: "100%" }
|
|
658
|
-
},
|
|
658
|
+
}, xt = { key: 1 }, Ge = /* @__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", kt, [
|
|
717
|
+
S(o.$slots, "list-start", { row: e.row }),
|
|
718
|
+
e.addBottom ? V("", !0) : (g(), v("div", vt, [
|
|
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,
|
|
731
|
-
S(
|
|
732
|
-
item:
|
|
730
|
+
(g(!0), v(B, null, N(e.row[e.field], (u) => (g(), v("div", Ct, [
|
|
731
|
+
S(o.$slots, "item-start", {
|
|
732
|
+
item: u,
|
|
733
733
|
row: e.row
|
|
734
734
|
}),
|
|
735
|
-
(g(!0), v(B, null,
|
|
736
|
-
modelValue: d
|
|
737
|
-
"onUpdate:modelValue": (h) => d
|
|
735
|
+
(g(!0), v(B, null, N(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(
|
|
744
|
-
item:
|
|
743
|
+
S(o.$slots, "item-end", {
|
|
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", xt, [
|
|
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
|
+
}), Vt = {
|
|
775
775
|
class: "row form-item-content",
|
|
776
776
|
style: { width: "100%" }
|
|
777
|
-
},
|
|
777
|
+
}, St = { class: "col column form-item-content-item" }, Et = { class: "col" }, $t = ["innerHTML"], zt = /* @__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 = (u, c) => Array.isArray(u) ? Promise.all(u.map((d) => typeof d == "function" ? d(...c) : d)) : typeof u == "function" ? u(...c) : void 0, i = (u) => {
|
|
796
|
-
const c = t.getOn(u);
|
|
797
|
-
return {
|
|
798
|
-
...c,
|
|
799
|
-
change: (...d) => {
|
|
800
|
-
const s = o() === "error", h = a(c.change, d);
|
|
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", Vt, [
|
|
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", St, [
|
|
815
|
+
R("div", Et, [
|
|
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(it), 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,
|
|
868
|
-
key:
|
|
869
|
-
}, { ref_for: !0 },
|
|
862
|
+
(g(!0), v(B, null, N(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 },
|
|
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 }, N(e.getBind(e.item).data || [], (i) => (g(), b(r(rt), x({
|
|
877
|
+
key: i.value
|
|
878
|
+
}, { ref_for: !0 }, i, E(i.on || {})), null, 16))), 128)) : (g(!0), v(B, { key: 1 }, N(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(st), 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 },
|
|
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 }, N(e.getBind(e.item).data || [], (i) => (g(), b(r(dt), x({
|
|
893
|
+
key: i.value
|
|
894
|
+
}, { ref_for: !0 }, i, E(i.on || {})), null, 16))), 128)) : (g(!0), v(B, { key: 1 }, N(e.getBind(e.item).data || [], (i) => (g(), b(r(ut), 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(ct), 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(ft), 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(Ge, 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(mt), 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, $t)) : 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 Mt = {
|
|
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 = Mt;
|
|
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
|
+
}, Ft = (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: Ft(a)
|
|
1081
|
+
}))), ge = $.EDialog, le = (e) => typeof e.type == "object" ? "component" : e.type || "input", Dt = (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) : We(l, c.update.type, c.update.form);
|
|
1118
1114
|
},
|
|
1119
|
-
getBind: (
|
|
1120
|
-
const
|
|
1121
|
-
return
|
|
1115
|
+
getBind: (l) => {
|
|
1116
|
+
const i = e();
|
|
1117
|
+
return Je(l, i.update.type);
|
|
1122
1118
|
},
|
|
1123
|
-
getOn: (
|
|
1119
|
+
getOn: (l, i) => {
|
|
1124
1120
|
const c = e();
|
|
1125
|
-
return
|
|
1121
|
+
return qe(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
|
|
1131
|
-
return
|
|
1132
|
-
options:
|
|
1126
|
+
const u = Ze(i.update.formGrid?.length ? i.update.formGrid : i.update.formColumn).find((d) => d.item.key === l)?.item;
|
|
1127
|
+
return u ? {
|
|
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,166 +1135,166 @@ 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
|
|
1162
|
-
c.update.edit.data =
|
|
1163
|
-
const
|
|
1164
|
-
Z.setValue(c.update.form,
|
|
1165
|
-
} catch (
|
|
1166
|
-
console.error(
|
|
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);
|
|
1161
|
+
} catch (u) {
|
|
1162
|
+
console.error(u);
|
|
1167
1163
|
} finally {
|
|
1168
1164
|
$.loading(!1), c.update.openLoading = !1;
|
|
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
|
|
1196
|
-
delete
|
|
1197
|
-
const
|
|
1198
|
-
Object.keys(
|
|
1199
|
-
if (
|
|
1200
|
-
const f = new Date(
|
|
1201
|
-
isNaN(f) || (
|
|
1191
|
+
let u = ObjectUtil.deepMerge(l.update.form, {});
|
|
1192
|
+
delete u.children;
|
|
1193
|
+
const d = new Set(t.option.column.filter((h) => h.type === "datetime").map((h) => h.key));
|
|
1194
|
+
Object.keys(u).forEach((h) => {
|
|
1195
|
+
if (d.has(h) && u[h] != null) {
|
|
1196
|
+
const f = new Date(u[h]).getTime();
|
|
1197
|
+
isNaN(f) || (u[h] = f);
|
|
1202
1198
|
}
|
|
1203
1199
|
});
|
|
1204
1200
|
try {
|
|
1205
1201
|
if (!c) return;
|
|
1206
|
-
await c({ ...
|
|
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
|
+
}, Ot = (e) => e.isForm === !1 ? !1 : typeof e.show?.form == "boolean" ? e.show.form : !0, Ne = (e) => e > H ? Math.floor(e / 2) : e, Rt = (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 = Ne(e.form.span), e.form.span), He = (e) => {
|
|
1224
1220
|
const t = e.form;
|
|
1225
|
-
return t?.row != null && t.row > 0 ? t.row : H;
|
|
1226
|
-
}, ie = (e) => Math.floor((e.gridRow - 1) / H),
|
|
1221
|
+
return t?.row != null && t.row > 0 ? Ne(t.row) : H;
|
|
1222
|
+
}, ie = (e) => Math.floor((e.gridRow - 1) / H), We = (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
|
+
}, Je = (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
|
|
1239
|
-
return c.apply(this, [...
|
|
1240
|
-
} : i
|
|
1241
|
-
}),
|
|
1242
|
-
},
|
|
1243
|
-
const
|
|
1230
|
+
}, qe = (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) {
|
|
1235
|
+
return c.apply(this, [...u, ...n]);
|
|
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
|
+
}, Ut = (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
|
+
}, Xe = (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++)
|
|
1278
|
-
if (
|
|
1274
|
+
if (u(_, te, D, T)) return { tr: _, tc: te };
|
|
1279
1275
|
}
|
|
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 } =
|
|
1299
|
-
|
|
1292
|
+
const w = m.colSpan ?? (m.span === 0 ? t : m.span), D = m.rowSpan ?? He(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
|
|
1315
|
-
|
|
1306
|
+
}), n.fillSingleRows ? Ut(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
|
+
}), Xe(s.map((i) => l.get(i.item.key) || i), a, {
|
|
1329
1325
|
fillSingleRows: !0
|
|
1330
1326
|
});
|
|
1331
|
-
},
|
|
1327
|
+
}, Ye = (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
|
+
}, Ze = (e) => e?.length ? Array.isArray(e[0]) ? e.flat() : e : [], At = (e, t) => {
|
|
1334
|
+
if (!Ot(e) || !e.key) return null;
|
|
1335
|
+
const n = t.defaultSpan ?? (t.maxSpan || 12) / 2, a = Rt(e, n, t.layout);
|
|
1336
|
+
return { item: e, span: a };
|
|
1337
|
+
}, Bt = (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 = At(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
|
+
}, _e = (e, t = {}) => {
|
|
1348
|
+
const n = t.maxSpan ?? 12, a = t.defaultSpan ?? n / 2, s = t.layout ?? "row", l = Bt(e, { maxSpan: n, defaultSpan: a, layout: s });
|
|
1349
|
+
if (s === "column") {
|
|
1350
|
+
const i = [];
|
|
1355
1351
|
let c = 1;
|
|
1356
|
-
return
|
|
1357
|
-
const
|
|
1358
|
-
|
|
1359
|
-
...
|
|
1352
|
+
return l.forEach((u) => {
|
|
1353
|
+
const d = He(u.item), h = n;
|
|
1354
|
+
i.push({
|
|
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: Xe(l, n), maxSpan: n };
|
|
1366
|
+
}, Tt = (e) => e.map((t) => t.item?.show?.form), Lt = (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" ? [
|
|
1379
|
-
return n ? c.map((
|
|
1380
|
-
},
|
|
1381
|
-
const
|
|
1382
|
-
if (
|
|
1383
|
-
const
|
|
1384
|
-
return
|
|
1385
|
-
}, a = (i) => {
|
|
1386
|
-
const u = r(i);
|
|
1387
|
-
return typeof o.transform == "function" ? o.transform(u) : u;
|
|
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;
|
|
1375
|
+
return n ? c.map((u) => n(u)) : c;
|
|
1376
|
+
}, Ue = (e) => typeof e == "function" ? e() : e, et = (e) => (t, n) => Lt(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
|
+
}), tt = (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:
|
|
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
|
+
}, ot = (e) => et((t) => tt(t, e?.error)), jt = (e, t, n) => {
|
|
1400
|
+
const a = {}, s = {}, o = t?.maxSpan || 12, l = t?.defaultSpan || o / 2, i = ot(t);
|
|
1401
|
+
e.forEach((d) => ve(d, !0)), Fe(e, a, s, (d) => i(d, n));
|
|
1402
|
+
const { cells: c, maxSpan: u } = _e(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
|
-
formMaxSpan:
|
|
1420
|
-
formColumn:
|
|
1411
|
+
formMaxSpan: u,
|
|
1412
|
+
formColumn: Ye(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
|
+
}, Kt = { class: "curd-form-cell-inner" }, at = /* @__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(Tt)(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,
|
|
1476
|
+
(g(!0), v(B, null, N(a.value, (w) => (g(), v("div", {
|
|
1485
1477
|
key: w.item.key,
|
|
1486
1478
|
class: J(["curd-form-grid-cell", [
|
|
1487
|
-
e.stripe !== !1 &&
|
|
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", Kt, [
|
|
1488
|
+
r(t)(w.item.show?.form, e.form, e.type) ? (g(), b(zt, {
|
|
1497
1489
|
key: 0,
|
|
1498
1490
|
class: J({ "is-row-span-field": c(w) }),
|
|
1499
1491
|
item: w.item,
|
|
@@ -1504,7 +1496,7 @@ const we = (e) => {
|
|
|
1504
1496
|
"get-on": e.getOn,
|
|
1505
1497
|
"get-disabled": e.getDisabled
|
|
1506
1498
|
}, Y({ _: 2 }, [
|
|
1507
|
-
|
|
1499
|
+
N(f.$slots, (D, T) => ({
|
|
1508
1500
|
name: T,
|
|
1509
1501
|
fn: p((O) => [
|
|
1510
1502
|
S(f.$slots, T, x({ ref_for: !0 }, O || {}))
|
|
@@ -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
|
+
}), Pt = /* @__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
|
-
set form(
|
|
1555
|
-
|
|
1546
|
+
set form(u) {
|
|
1547
|
+
o.set(u);
|
|
1556
1548
|
},
|
|
1557
|
-
getDisabled: (
|
|
1558
|
-
getBind: (
|
|
1559
|
-
getOn: (
|
|
1549
|
+
getDisabled: (u) => We(u, c.type, c.form),
|
|
1550
|
+
getBind: (u) => Je(u, c.type),
|
|
1551
|
+
getOn: (u) => qe(u, c.type, [c.form, u]),
|
|
1560
1552
|
initColumnForm: () => {
|
|
1561
|
-
const
|
|
1562
|
-
c.formDefault =
|
|
1553
|
+
const u = o, d = jt(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
|
|
1566
|
-
validate: async (
|
|
1567
|
-
const
|
|
1568
|
-
if (!
|
|
1569
|
-
return
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1557
|
+
return l?.formRef?.set(i, {
|
|
1558
|
+
validate: async (u) => {
|
|
1559
|
+
const d = a.value;
|
|
1560
|
+
if (!d)
|
|
1561
|
+
return u?.(!0), !0;
|
|
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)
|
|
1565
|
+
return u?.(!0), !0;
|
|
1566
|
+
const m = await d.validateField(h, async (w, D) => {
|
|
1574
1567
|
w || me(ke(D));
|
|
1575
1568
|
});
|
|
1576
|
-
if (
|
|
1569
|
+
if (u?.(!!m), !m) throw !1;
|
|
1577
1570
|
return !0;
|
|
1578
1571
|
}
|
|
1579
|
-
}),
|
|
1580
|
-
() =>
|
|
1581
|
-
(
|
|
1582
|
-
|
|
1572
|
+
}), s.option.form?.initStart?.(c), c.initColumnForm(), s.option.form?.initEnd?.(c), Ke(
|
|
1573
|
+
() => s.form,
|
|
1574
|
+
(u) => {
|
|
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(at, {
|
|
1592
1585
|
key: 0,
|
|
1593
1586
|
"form-grid": c.formGrid,
|
|
1594
1587
|
"max-span": c.formMaxSpan,
|
|
@@ -1601,10 +1594,10 @@ const we = (e) => {
|
|
|
1601
1594
|
"get-on": c.getOn,
|
|
1602
1595
|
"get-disabled": c.getDisabled
|
|
1603
1596
|
}, Y({ _: 2 }, [
|
|
1604
|
-
|
|
1597
|
+
N(u.$slots, (h, f) => ({
|
|
1605
1598
|
name: f,
|
|
1606
1599
|
fn: p((m) => [
|
|
1607
|
-
S(
|
|
1600
|
+
S(u.$slots, f, $e(ze(m || {})))
|
|
1608
1601
|
])
|
|
1609
1602
|
}))
|
|
1610
1603
|
]), 1032, ["form-grid", "max-span", "form", "type", "stripe", "label-width", "form-option", "get-bind", "get-on", "get-disabled"])) : V("", !0)
|
|
@@ -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
|
+
}), It = (e) => e?.value || e, Gt = (e) => {
|
|
1609
|
+
const t = It(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) => Gt(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
|
+
}, Ht = (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
|
+
}, Wt = (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
|
+
}), Jt = (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,
|
|
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 = Ze(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[
|
|
1826
|
-
} else if (f ===
|
|
1817
|
+
if (i != null && i !== "") {
|
|
1818
|
+
if (f[i] === u[i]) return f;
|
|
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
|
+
}), qt = (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) => tt(y, t.option.form?.error), u = et(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) => {
|
|
@@ -1945,14 +1938,14 @@ const we = (e) => {
|
|
|
1945
1938
|
}, xe = async (y, k) => {
|
|
1946
1939
|
if (!Ce(k, y))
|
|
1947
1940
|
return h(y, k), !0;
|
|
1948
|
-
const z =
|
|
1941
|
+
const z = u(k, y);
|
|
1949
1942
|
if (!z) return !0;
|
|
1950
1943
|
h(y, k);
|
|
1951
1944
|
const K = Array.isArray(z) ? z : [z];
|
|
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
|
|
1996
|
-
const
|
|
1997
|
-
return n.forEach((
|
|
1998
|
-
d
|
|
1999
|
-
}),
|
|
2000
|
-
}),
|
|
2001
|
-
|
|
1988
|
+
const s = await $.loadModule("xlsx"), o = t.map((c) => {
|
|
1989
|
+
const u = {};
|
|
1990
|
+
return n.forEach((d) => {
|
|
1991
|
+
u[d.label] = c[d.key];
|
|
1992
|
+
}), u;
|
|
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 Xt = (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
|
+
}), Yt = (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
|
+
}), Zt = (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 (
|
|
2136
|
-
const
|
|
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;
|
|
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
|
|
2174
|
-
if (
|
|
2175
|
-
if (
|
|
2176
|
-
|
|
2164
|
+
const o = (l) => {
|
|
2165
|
+
const i = le(l);
|
|
2166
|
+
for (const u in s) {
|
|
2167
|
+
if (u === "table") {
|
|
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
|
|
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
|
-
["search", "formAdd", "formUpdate"].forEach((
|
|
2183
|
-
|
|
2184
|
-
}),
|
|
2185
|
-
const h =
|
|
2175
|
+
["search", "formAdd", "formUpdate"].forEach((u) => {
|
|
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,133 +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 = ot(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
|
|
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 = _e(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 = Ye(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
|
-
h = h ||
|
|
2240
|
+
}), _t = (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;
|
|
2250
2243
|
let f = h, m = h;
|
|
2251
2244
|
for (; f?.parentCurdConf; )
|
|
2252
2245
|
m = f.parentCurdConf, f = f.parentCurdConf;
|
|
2253
2246
|
return m;
|
|
2254
|
-
}, c = () =>
|
|
2255
|
-
let
|
|
2256
|
-
parentCurdConf:
|
|
2257
|
-
getCurdConf:
|
|
2258
|
-
getRootCurdConf:
|
|
2259
|
-
...
|
|
2247
|
+
}, c = () => u;
|
|
2248
|
+
let u = re({
|
|
2249
|
+
parentCurdConf: l,
|
|
2250
|
+
getCurdConf: i,
|
|
2251
|
+
getRootCurdConf: i,
|
|
2252
|
+
...Nt(),
|
|
2260
2253
|
option: e.option,
|
|
2261
|
-
...
|
|
2262
|
-
...Gt(c, e),
|
|
2263
|
-
...Ht(c, e, r),
|
|
2254
|
+
...Ht(c, e),
|
|
2264
2255
|
...Wt(c, e),
|
|
2256
|
+
...Jt(c, e, s),
|
|
2265
2257
|
...qt(c, e),
|
|
2266
|
-
...
|
|
2267
|
-
...
|
|
2268
|
-
...
|
|
2258
|
+
...Xt(c, e),
|
|
2259
|
+
...Dt(c, e, s),
|
|
2260
|
+
...Yt(c, e),
|
|
2261
|
+
...Zt(c, e, s)
|
|
2269
2262
|
});
|
|
2270
|
-
|
|
2271
|
-
const
|
|
2272
|
-
return
|
|
2263
|
+
u.init();
|
|
2264
|
+
const d = o ? `curdRef-${o.uid}` : "";
|
|
2265
|
+
return l?.formRef && d && (l.formRef.set(d, {
|
|
2273
2266
|
validate: async (h) => {
|
|
2274
|
-
const f = await
|
|
2267
|
+
const f = await u.update.validate(!1);
|
|
2275
2268
|
if (h?.(!!f), !f) throw !1;
|
|
2276
2269
|
return !0;
|
|
2277
2270
|
}
|
|
2278
|
-
}),
|
|
2279
|
-
|
|
2280
|
-
})),
|
|
2281
|
-
e.option.init !== !1 &&
|
|
2282
|
-
}), Me.setConf("curdConf",
|
|
2283
|
-
},
|
|
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
|
+
}, eo = { class: "dialog-footer" }, to = /* @__PURE__ */ q({
|
|
2284
2277
|
__name: "switchConfirm",
|
|
2285
2278
|
props: {
|
|
2286
2279
|
size: {}
|
|
2287
2280
|
},
|
|
2288
2281
|
setup(e, { expose: t }) {
|
|
2289
|
-
const n = X(!1),
|
|
2290
|
-
let
|
|
2291
|
-
const
|
|
2292
|
-
|
|
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;
|
|
2293
2286
|
})), c = () => {
|
|
2294
|
-
n.value = !1,
|
|
2295
|
-
},
|
|
2296
|
-
n.value = !1,
|
|
2287
|
+
n.value = !1, o?.(!0), o = null, l = null;
|
|
2288
|
+
}, u = () => {
|
|
2289
|
+
n.value = !1, l?.(new Error("用户取消操作")), o = null, l = null;
|
|
2297
2290
|
};
|
|
2298
2291
|
return t({
|
|
2299
|
-
open:
|
|
2300
|
-
}), (
|
|
2292
|
+
open: i
|
|
2293
|
+
}), (d, h) => {
|
|
2301
2294
|
const f = fe("el-form");
|
|
2302
|
-
return g(), b(
|
|
2295
|
+
return g(), b(r(Ee), {
|
|
2303
2296
|
modelValue: n.value,
|
|
2304
2297
|
"onUpdate:modelValue": h[0] || (h[0] = (m) => n.value = m),
|
|
2305
|
-
title:
|
|
2298
|
+
title: a.value,
|
|
2306
2299
|
"close-on-click-modal": !1,
|
|
2307
2300
|
width: "400px"
|
|
2308
2301
|
}, {
|
|
2309
2302
|
footer: p(() => [
|
|
2310
2303
|
F(f, { size: e.size }, {
|
|
2311
2304
|
default: p(() => [
|
|
2312
|
-
R("span",
|
|
2313
|
-
F(
|
|
2305
|
+
R("span", eo, [
|
|
2306
|
+
F(r(G), { onClick: u }, {
|
|
2314
2307
|
default: p(() => [...h[1] || (h[1] = [
|
|
2315
2308
|
M("取消", -1)
|
|
2316
2309
|
])]),
|
|
2317
2310
|
_: 1
|
|
2318
2311
|
}),
|
|
2319
|
-
F(
|
|
2312
|
+
F(r(G), {
|
|
2320
2313
|
type: "primary",
|
|
2321
2314
|
onClick: c
|
|
2322
2315
|
}, {
|
|
@@ -2331,13 +2324,13 @@ const qt = (e, t) => ({
|
|
|
2331
2324
|
}, 8, ["size"])
|
|
2332
2325
|
]),
|
|
2333
2326
|
default: p(() => [
|
|
2334
|
-
R("div", null, U(
|
|
2327
|
+
R("div", null, U(s.value), 1)
|
|
2335
2328
|
]),
|
|
2336
2329
|
_: 1
|
|
2337
2330
|
}, 8, ["modelValue", "title"]);
|
|
2338
2331
|
};
|
|
2339
2332
|
}
|
|
2340
|
-
}),
|
|
2333
|
+
}), oo = ["innerHTML"], ao = /* @__PURE__ */ q({
|
|
2341
2334
|
__name: "text",
|
|
2342
2335
|
props: {
|
|
2343
2336
|
content: {},
|
|
@@ -2345,12 +2338,12 @@ const qt = (e, t) => ({
|
|
|
2345
2338
|
},
|
|
2346
2339
|
setup(e) {
|
|
2347
2340
|
const t = e, n = ae(() => typeof t.content == "function" ? t.content(t.value) : t.content);
|
|
2348
|
-
return (
|
|
2341
|
+
return (a, s) => typeof n.value == "object" ? (g(), b(ee(n.value), { key: 0 })) : (g(), v("div", {
|
|
2349
2342
|
key: 1,
|
|
2350
2343
|
innerHTML: n.value
|
|
2351
|
-
}, null, 8,
|
|
2344
|
+
}, null, 8, oo));
|
|
2352
2345
|
}
|
|
2353
|
-
}),
|
|
2346
|
+
}), Ae = /* @__PURE__ */ q({
|
|
2354
2347
|
__name: "searchField",
|
|
2355
2348
|
props: {
|
|
2356
2349
|
item: {},
|
|
@@ -2360,172 +2353,172 @@ const qt = (e, t) => ({
|
|
|
2360
2353
|
setup(e) {
|
|
2361
2354
|
const t = e, n = ae({
|
|
2362
2355
|
get: () => t.conf.search.form?.[t.item?.key],
|
|
2363
|
-
set: (
|
|
2364
|
-
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);
|
|
2365
2358
|
}
|
|
2366
2359
|
});
|
|
2367
|
-
return (
|
|
2360
|
+
return (a, s) => r(W).customComponent[e.type ?? ""]?.search ? (g(), b(ee(r(W).customComponent[e.type ?? ""]?.search), x({
|
|
2368
2361
|
key: 0,
|
|
2369
2362
|
modelValue: n.value,
|
|
2370
|
-
"onUpdate:modelValue":
|
|
2371
|
-
}, 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({
|
|
2372
2365
|
key: 1,
|
|
2373
2366
|
modelValue: n.value,
|
|
2374
|
-
"onUpdate:modelValue":
|
|
2367
|
+
"onUpdate:modelValue": s[1] || (s[1] = (o) => n.value = o),
|
|
2375
2368
|
placeholder: e.conf.search.getPlaceholder(e.item),
|
|
2376
2369
|
clearable: "",
|
|
2377
2370
|
disabled: e.item.disabled?.search
|
|
2378
|
-
}, 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({
|
|
2379
2372
|
key: 2,
|
|
2380
2373
|
modelValue: n.value,
|
|
2381
|
-
"onUpdate:modelValue":
|
|
2382
|
-
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")),
|
|
2383
2376
|
clearable: "",
|
|
2384
2377
|
disabled: e.item.disabled?.search
|
|
2385
2378
|
}, e.item.options?.search?.switch || e.item.options?.switch, E(e.item.options?.search?.switch?.on || e.item.options?.switch?.on || {})), {
|
|
2386
2379
|
default: p(() => [
|
|
2387
|
-
(g(), b(
|
|
2380
|
+
(g(), b(r(ne), {
|
|
2388
2381
|
key: e.item.options?.switch?.activeValue,
|
|
2389
2382
|
label: e.item.options?.switch?.activeText,
|
|
2390
2383
|
value: e.item.options?.switch?.activeValue
|
|
2391
2384
|
}, null, 8, ["label", "value"])),
|
|
2392
|
-
(g(), b(
|
|
2385
|
+
(g(), b(r(ne), {
|
|
2393
2386
|
key: e.item.options?.switch?.inactiveValue,
|
|
2394
2387
|
label: e.item.options?.switch?.inactiveText,
|
|
2395
2388
|
value: e.item.options?.switch?.inactiveValue
|
|
2396
2389
|
}, null, 8, ["label", "value"]))
|
|
2397
2390
|
]),
|
|
2398
2391
|
_: 1
|
|
2399
|
-
}, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "select" ? (g(), b(
|
|
2392
|
+
}, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "select" ? (g(), b(r(ce), x({
|
|
2400
2393
|
key: 3,
|
|
2401
2394
|
modelValue: n.value,
|
|
2402
|
-
"onUpdate:modelValue":
|
|
2403
|
-
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")),
|
|
2404
2397
|
clearable: "",
|
|
2405
2398
|
disabled: e.item.disabled?.search
|
|
2406
2399
|
}, e.item.options?.search?.select || e.item.options?.select, E(e.item.options?.search?.select?.on || e.item.options?.select?.on || {})), {
|
|
2407
2400
|
default: p(() => [
|
|
2408
|
-
(g(!0), v(B, null,
|
|
2409
|
-
key:
|
|
2410
|
-
label:
|
|
2411
|
-
value:
|
|
2401
|
+
(g(!0), v(B, null, N(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
|
|
2412
2405
|
}, null, 8, ["label", "value"]))), 128))
|
|
2413
2406
|
]),
|
|
2414
2407
|
_: 1
|
|
2415
|
-
}, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "radio" ? (g(), b(
|
|
2408
|
+
}, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "radio" ? (g(), b(r(Be), x({
|
|
2416
2409
|
key: 4,
|
|
2417
2410
|
modelValue: n.value,
|
|
2418
|
-
"onUpdate:modelValue":
|
|
2411
|
+
"onUpdate:modelValue": s[4] || (s[4] = (o) => n.value = o),
|
|
2419
2412
|
disabled: e.item.disabled?.search
|
|
2420
2413
|
}, e.item.options?.search?.radio || e.item.options?.radio, E(e.item.options?.search?.radio?.on || e.item.options?.radio?.on || {})), {
|
|
2421
2414
|
default: p(() => [
|
|
2422
|
-
(g(!0), v(B, null,
|
|
2423
|
-
key:
|
|
2424
|
-
label:
|
|
2425
|
-
value:
|
|
2415
|
+
(g(!0), v(B, null, N(e.item.options?.radio?.data, (o) => (g(), b(r(Te), {
|
|
2416
|
+
key: o.value,
|
|
2417
|
+
label: o.label,
|
|
2418
|
+
value: o.value
|
|
2426
2419
|
}, null, 8, ["label", "value"]))), 128))
|
|
2427
2420
|
]),
|
|
2428
2421
|
_: 1
|
|
2429
|
-
}, 16, ["modelValue", "disabled"])) : e.type === "datetime" ? (g(), b(
|
|
2422
|
+
}, 16, ["modelValue", "disabled"])) : e.type === "datetime" ? (g(), b(r(Le), x({
|
|
2430
2423
|
key: 5,
|
|
2431
2424
|
modelValue: n.value,
|
|
2432
|
-
"onUpdate:modelValue":
|
|
2425
|
+
"onUpdate:modelValue": s[5] || (s[5] = (o) => n.value = o),
|
|
2433
2426
|
disabled: e.item.disabled?.search
|
|
2434
|
-
}, 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({
|
|
2435
2428
|
key: 6,
|
|
2436
2429
|
modelValue: n.value,
|
|
2437
|
-
"onUpdate:modelValue":
|
|
2430
|
+
"onUpdate:modelValue": s[6] || (s[6] = (o) => n.value = o)
|
|
2438
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 || {}), {
|
|
2439
2432
|
disabled: e.item.disabled?.search
|
|
2440
2433
|
}), null, 16, ["modelValue", "disabled"])) : V("", !0);
|
|
2441
2434
|
}
|
|
2442
2435
|
}), se = (e, t) => {
|
|
2443
2436
|
const n = e.__vccOpts || e;
|
|
2444
|
-
for (const [
|
|
2445
|
-
n[
|
|
2437
|
+
for (const [a, s] of t)
|
|
2438
|
+
n[a] = s;
|
|
2446
2439
|
return n;
|
|
2447
|
-
},
|
|
2440
|
+
}, no = {}, lo = {
|
|
2448
2441
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2449
2442
|
viewBox: "64 64 896 896"
|
|
2450
2443
|
};
|
|
2451
|
-
function
|
|
2452
|
-
return g(), v("svg",
|
|
2444
|
+
function io(e, t) {
|
|
2445
|
+
return g(), v("svg", lo, [...t[0] || (t[0] = [
|
|
2453
2446
|
R("path", {
|
|
2454
2447
|
fill: "currentColor",
|
|
2455
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"
|
|
2456
2449
|
}, null, -1)
|
|
2457
2450
|
])]);
|
|
2458
2451
|
}
|
|
2459
|
-
const
|
|
2452
|
+
const ro = /* @__PURE__ */ se(no, [["render", io]]), so = {}, uo = {
|
|
2460
2453
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2461
2454
|
viewBox: "64 64 896 896"
|
|
2462
2455
|
};
|
|
2463
|
-
function
|
|
2464
|
-
return g(), v("svg",
|
|
2456
|
+
function co(e, t) {
|
|
2457
|
+
return g(), v("svg", uo, [...t[0] || (t[0] = [
|
|
2465
2458
|
R("path", {
|
|
2466
2459
|
fill: "currentColor",
|
|
2467
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"
|
|
2468
2461
|
}, null, -1)
|
|
2469
2462
|
])]);
|
|
2470
2463
|
}
|
|
2471
|
-
const
|
|
2464
|
+
const fo = /* @__PURE__ */ se(so, [["render", co]]), mo = {}, go = {
|
|
2472
2465
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2473
2466
|
viewBox: "0 0 1024 1024"
|
|
2474
2467
|
};
|
|
2475
|
-
function
|
|
2476
|
-
return g(), v("svg",
|
|
2468
|
+
function ho(e, t) {
|
|
2469
|
+
return g(), v("svg", go, [...t[0] || (t[0] = [
|
|
2477
2470
|
R("path", {
|
|
2478
2471
|
fill: "currentColor",
|
|
2479
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"
|
|
2480
2473
|
}, null, -1)
|
|
2481
2474
|
])]);
|
|
2482
2475
|
}
|
|
2483
|
-
const
|
|
2476
|
+
const yo = /* @__PURE__ */ se(mo, [["render", ho]]), bo = {}, po = {
|
|
2484
2477
|
"data-v-58697b5c": "",
|
|
2485
2478
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2486
2479
|
viewBox: "0 0 1024 1024"
|
|
2487
2480
|
};
|
|
2488
|
-
function
|
|
2489
|
-
return g(), v("svg",
|
|
2481
|
+
function wo(e, t) {
|
|
2482
|
+
return g(), v("svg", po, [...t[0] || (t[0] = [
|
|
2490
2483
|
R("path", {
|
|
2491
2484
|
fill: "currentColor",
|
|
2492
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"
|
|
2493
2486
|
}, null, -1)
|
|
2494
2487
|
])]);
|
|
2495
2488
|
}
|
|
2496
|
-
const
|
|
2489
|
+
const ko = /* @__PURE__ */ se(bo, [["render", wo]]), vo = {}, Co = {
|
|
2497
2490
|
"data-v-58697b5c": "",
|
|
2498
2491
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2499
2492
|
viewBox: "0 0 1024 1024"
|
|
2500
2493
|
};
|
|
2501
|
-
function
|
|
2502
|
-
return g(), v("svg",
|
|
2494
|
+
function xo(e, t) {
|
|
2495
|
+
return g(), v("svg", Co, [...t[0] || (t[0] = [
|
|
2503
2496
|
R("path", {
|
|
2504
2497
|
fill: "currentColor",
|
|
2505
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"
|
|
2506
2499
|
}, null, -1)
|
|
2507
2500
|
])]);
|
|
2508
2501
|
}
|
|
2509
|
-
const
|
|
2502
|
+
const Vo = /* @__PURE__ */ se(vo, [["render", xo]]), So = {}, Eo = {
|
|
2510
2503
|
"data-v-58697b5c": "",
|
|
2511
2504
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2512
2505
|
viewBox: "0 0 1024 1024"
|
|
2513
2506
|
};
|
|
2514
|
-
function
|
|
2515
|
-
return g(), v("svg",
|
|
2507
|
+
function $o(e, t) {
|
|
2508
|
+
return g(), v("svg", Eo, [...t[0] || (t[0] = [
|
|
2516
2509
|
R("path", {
|
|
2517
2510
|
fill: "currentColor",
|
|
2518
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"
|
|
2519
2512
|
}, null, -1)
|
|
2520
2513
|
])]);
|
|
2521
2514
|
}
|
|
2522
|
-
const
|
|
2515
|
+
const zo = /* @__PURE__ */ se(So, [["render", $o]]), Mo = { class: "row flex-center table-header-label inline" }, Fo = { class: "table-header-tooltip" }, Do = ["innerHTML"], Oo = {
|
|
2523
2516
|
key: 1,
|
|
2524
2517
|
class: "table-header-required"
|
|
2525
|
-
},
|
|
2518
|
+
}, Ro = ["onClick"], Uo = {
|
|
2526
2519
|
key: 0,
|
|
2527
2520
|
class: "table-edit-form"
|
|
2528
|
-
},
|
|
2521
|
+
}, Ao = { key: 1 }, Bo = ["onClick", "innerHTML"], To = /* @__PURE__ */ q({
|
|
2529
2522
|
__name: "tableColumn",
|
|
2530
2523
|
props: {
|
|
2531
2524
|
conf: {},
|
|
@@ -2533,200 +2526,200 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
2533
2526
|
option: {}
|
|
2534
2527
|
},
|
|
2535
2528
|
setup(e) {
|
|
2536
|
-
const t = $.isFun, n = e,
|
|
2537
|
-
return (
|
|
2538
|
-
const
|
|
2539
|
-
return g(!0), v(B, null,
|
|
2540
|
-
key:
|
|
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) => {
|
|
2531
|
+
const u = fe("el-tooltip");
|
|
2532
|
+
return g(!0), v(B, null, N(e.columnList, (d) => (g(), v(B, {
|
|
2533
|
+
key: d.key
|
|
2541
2534
|
}, [
|
|
2542
|
-
e.conf.table.column.show.list.includes(
|
|
2543
|
-
|
|
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({
|
|
2544
2537
|
key: 0,
|
|
2545
|
-
prop:
|
|
2546
|
-
label:
|
|
2547
|
-
}, { ref_for: !0 },
|
|
2538
|
+
prop: d.key,
|
|
2539
|
+
label: d.label
|
|
2540
|
+
}, { ref_for: !0 }, d.table), {
|
|
2548
2541
|
header: p(() => [
|
|
2549
|
-
S(
|
|
2550
|
-
R("div",
|
|
2551
|
-
|
|
2542
|
+
S(i.$slots, "table-header-" + d.key, { item: d }, () => [
|
|
2543
|
+
R("div", Mo, [
|
|
2544
|
+
d.table?.header?.tooltip ? (g(), b(u, {
|
|
2552
2545
|
key: 0,
|
|
2553
2546
|
effect: "dark",
|
|
2554
2547
|
placement: "top"
|
|
2555
2548
|
}, {
|
|
2556
2549
|
content: p(() => [
|
|
2557
2550
|
R("div", {
|
|
2558
|
-
innerHTML:
|
|
2559
|
-
}, null, 8,
|
|
2551
|
+
innerHTML: d.table?.header?.tooltip
|
|
2552
|
+
}, null, 8, Do)
|
|
2560
2553
|
]),
|
|
2561
2554
|
default: p(() => [
|
|
2562
|
-
R("span",
|
|
2563
|
-
F(
|
|
2555
|
+
R("span", Fo, [
|
|
2556
|
+
F(ko)
|
|
2564
2557
|
])
|
|
2565
2558
|
]),
|
|
2566
2559
|
_: 2
|
|
2567
2560
|
}, 1024)) : V("", !0),
|
|
2568
|
-
|
|
2569
|
-
M(" " + U(
|
|
2570
|
-
|
|
2561
|
+
l(d) ? (g(), v("span", Oo, "*")) : V("", !0),
|
|
2562
|
+
M(" " + U(d.label) + " ", 1),
|
|
2563
|
+
d.table?.header?.group !== void 0 ? (g(), v("span", {
|
|
2571
2564
|
key: 2,
|
|
2572
2565
|
class: "table-header-plus",
|
|
2573
|
-
onClick:
|
|
2566
|
+
onClick: bt(
|
|
2574
2567
|
() => {
|
|
2575
|
-
|
|
2576
|
-
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);
|
|
2577
2570
|
});
|
|
2578
2571
|
},
|
|
2579
2572
|
["stop"]
|
|
2580
2573
|
)
|
|
2581
2574
|
}, [
|
|
2582
|
-
|
|
2583
|
-
], 8,
|
|
2575
|
+
d.table.header.group ? (g(), b(Vo, { key: 0 })) : (g(), b(zo, { key: 1 }))
|
|
2576
|
+
], 8, Ro)) : V("", !0)
|
|
2584
2577
|
])
|
|
2585
2578
|
])
|
|
2586
2579
|
]),
|
|
2587
2580
|
default: p(({ row: h }) => [
|
|
2588
|
-
|
|
2581
|
+
d.children ? (g(), v(B, { key: 0 }, [
|
|
2589
2582
|
c[0] || (c[0] = M(" ", -1)),
|
|
2590
|
-
(g(), b(ee(
|
|
2583
|
+
(g(), b(ee(r(s)), {
|
|
2591
2584
|
conf: e.conf,
|
|
2592
|
-
columnList:
|
|
2585
|
+
columnList: d.children,
|
|
2593
2586
|
option: e.option
|
|
2594
2587
|
}, Y({ _: 2 }, [
|
|
2595
|
-
|
|
2588
|
+
N(i.$slots, (f, m) => ({
|
|
2596
2589
|
name: m,
|
|
2597
2590
|
fn: p((w) => [
|
|
2598
|
-
S(
|
|
2591
|
+
S(i.$slots, m, x({ ref_for: !0 }, w || {}))
|
|
2599
2592
|
])
|
|
2600
2593
|
}))
|
|
2601
2594
|
]), 1032, ["conf", "columnList", "option"]))
|
|
2602
2595
|
], 64)) : (g(), v(B, { key: 1 }, [
|
|
2603
|
-
e.option.table?.editMode ? (g(), v("div",
|
|
2604
|
-
F(
|
|
2596
|
+
e.option.table?.editMode ? (g(), v("div", Uo, [
|
|
2597
|
+
F(r(be), {
|
|
2605
2598
|
size: e.option.size?.table,
|
|
2606
|
-
error: e.conf.tableEditValidate.getFieldError(h,
|
|
2599
|
+
error: e.conf.tableEditValidate.getFieldError(h, d),
|
|
2607
2600
|
class: "table-edit-form-item"
|
|
2608
2601
|
}, {
|
|
2609
2602
|
default: p(() => [
|
|
2610
2603
|
R("div", {
|
|
2611
|
-
class: J(["row", ["table-edit-" +
|
|
2604
|
+
class: J(["row", ["table-edit-" + d.key]]),
|
|
2612
2605
|
style: { width: "100%" }
|
|
2613
2606
|
}, [
|
|
2614
|
-
S(
|
|
2607
|
+
S(i.$slots, "table-edit-left-" + d.key, {
|
|
2615
2608
|
row: h,
|
|
2616
|
-
item:
|
|
2609
|
+
item: d
|
|
2617
2610
|
}),
|
|
2618
|
-
|
|
2611
|
+
d.type === "input" ? (g(), b(r(ue), x({
|
|
2619
2612
|
key: 0,
|
|
2620
|
-
modelValue: h[
|
|
2621
|
-
"onUpdate:modelValue": (f) => h[
|
|
2622
|
-
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),
|
|
2623
2616
|
class: "col"
|
|
2624
|
-
}, { ref_for: !0 }, e.conf.update.getBind(
|
|
2625
|
-
"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)
|
|
2626
2619
|
}), Y({ _: 2 }, [
|
|
2627
|
-
|
|
2620
|
+
d.options?.input?.prepend ? {
|
|
2628
2621
|
name: "prepend",
|
|
2629
2622
|
fn: p(() => [
|
|
2630
|
-
M(U(typeof
|
|
2623
|
+
M(U(typeof d.options?.input?.prepend == "function" ? d.options?.input?.prepend(h) : d.options?.input?.prepend), 1)
|
|
2631
2624
|
]),
|
|
2632
2625
|
key: "0"
|
|
2633
2626
|
} : void 0
|
|
2634
|
-
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
2627
|
+
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : d.type === "select" ? (g(), b(r(ce), x({
|
|
2635
2628
|
key: 1,
|
|
2636
|
-
modelValue: h[
|
|
2637
|
-
"onUpdate:modelValue": (f) => h[
|
|
2638
|
-
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),
|
|
2639
2632
|
class: "col"
|
|
2640
|
-
}, { ref_for: !0 }, e.conf.update.getBind(
|
|
2641
|
-
"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)
|
|
2642
2635
|
}), {
|
|
2643
2636
|
default: p(() => [
|
|
2644
|
-
(g(!0), v(B, null,
|
|
2637
|
+
(g(!0), v(B, null, N(d.options?.search?.select?.data || d.options?.select?.data, (f) => (g(), b(r(ne), {
|
|
2645
2638
|
key: f.value,
|
|
2646
2639
|
label: f.label,
|
|
2647
2640
|
value: f.value
|
|
2648
2641
|
}, null, 8, ["label", "value"]))), 128))
|
|
2649
2642
|
]),
|
|
2650
2643
|
_: 2
|
|
2651
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
2644
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : d.type === "switch" ? (g(), b(r(he), x({
|
|
2652
2645
|
key: 2,
|
|
2653
|
-
modelValue: h[
|
|
2654
|
-
"onUpdate:modelValue": (f) => h[
|
|
2655
|
-
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),
|
|
2656
2649
|
class: "col"
|
|
2657
|
-
}, { ref_for: !0 }, e.conf.update.getBind(
|
|
2658
|
-
"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)
|
|
2659
2652
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : V("", !0),
|
|
2660
|
-
S(
|
|
2653
|
+
S(i.$slots, "table-edit-right-" + d.key, {
|
|
2661
2654
|
row: h,
|
|
2662
|
-
item:
|
|
2655
|
+
item: d
|
|
2663
2656
|
})
|
|
2664
2657
|
], 2)
|
|
2665
2658
|
]),
|
|
2666
2659
|
_: 2
|
|
2667
2660
|
}, 1032, ["size", "error"])
|
|
2668
2661
|
])) : (g(), v(B, { key: 1 }, [
|
|
2669
|
-
e.conf.update.type ===
|
|
2670
|
-
|
|
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({
|
|
2671
2664
|
key: 0,
|
|
2672
|
-
modelValue: e.conf.update.form[
|
|
2673
|
-
"onUpdate:modelValue": (f) => e.conf.update.form[
|
|
2674
|
-
disabled: e.conf.update.getDisabled(
|
|
2675
|
-
}, { ref_for: !0 }, e.conf.update.getBind(
|
|
2676
|
-
|
|
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 ? {
|
|
2677
2670
|
name: "prepend",
|
|
2678
2671
|
fn: p(() => [
|
|
2679
|
-
M(U(typeof
|
|
2672
|
+
M(U(typeof d.options?.input?.prepend == "function" ? d.options?.input?.prepend(h) : d.options?.input?.prepend), 1)
|
|
2680
2673
|
]),
|
|
2681
2674
|
key: "0"
|
|
2682
2675
|
} : void 0
|
|
2683
|
-
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
2676
|
+
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : d.type === "select" ? (g(), b(r(ce), x({
|
|
2684
2677
|
key: 1,
|
|
2685
|
-
modelValue: e.conf.update.form[
|
|
2686
|
-
"onUpdate:modelValue": (f) => e.conf.update.form[
|
|
2687
|
-
disabled: e.conf.update.getDisabled(
|
|
2688
|
-
}, { 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%" } }), {
|
|
2689
2682
|
default: p(() => [
|
|
2690
|
-
(g(!0), v(B, null,
|
|
2683
|
+
(g(!0), v(B, null, N(d.options?.search?.select?.data || d.options?.select?.data, (f) => (g(), b(r(ne), {
|
|
2691
2684
|
key: f.value,
|
|
2692
2685
|
label: f.label,
|
|
2693
2686
|
value: f.value
|
|
2694
2687
|
}, null, 8, ["label", "value"]))), 128))
|
|
2695
2688
|
]),
|
|
2696
2689
|
_: 2
|
|
2697
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
2690
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : d.type === "switch" ? (g(), b(r(he), x({
|
|
2698
2691
|
key: 2,
|
|
2699
|
-
modelValue: e.conf.update.form[
|
|
2700
|
-
"onUpdate:modelValue": (f) => e.conf.update.form[
|
|
2701
|
-
}, { ref_for: !0 }, e.conf.update.getBind(
|
|
2702
|
-
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)
|
|
2703
2696
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : V("", !0)
|
|
2704
|
-
], 64)) : S(
|
|
2697
|
+
], 64)) : S(i.$slots, "table-" + d.key, {
|
|
2705
2698
|
key: 1,
|
|
2706
2699
|
row: h,
|
|
2707
|
-
item:
|
|
2700
|
+
item: d
|
|
2708
2701
|
}, () => [
|
|
2709
|
-
|
|
2702
|
+
r(W).customComponent[d.type ?? ""]?.table ? (g(), b(ee(r(W).customComponent[d.type ?? ""]?.table), x({
|
|
2710
2703
|
key: 0,
|
|
2711
|
-
modelValue: h[
|
|
2712
|
-
"onUpdate:modelValue": (f) => h[
|
|
2713
|
-
}, { ref_for: !0 },
|
|
2714
|
-
|
|
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({
|
|
2715
2708
|
key: 0,
|
|
2716
|
-
modelValue: h[
|
|
2717
|
-
"onUpdate:modelValue": (f) => h[
|
|
2718
|
-
loading:
|
|
2719
|
-
"before-change": () =>
|
|
2720
|
-
}, { 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", Ao, U(h[d.key] === d.options?.switch?.activeValue ? d.options?.switch?.activeText : d.options?.switch?.inactiveText), 1))
|
|
2721
2714
|
], 64)) : (g(), v("span", {
|
|
2722
2715
|
key: 2,
|
|
2723
2716
|
style: pe({
|
|
2724
|
-
"--table-text-click-color":
|
|
2717
|
+
"--table-text-click-color": d.table?.click?.color
|
|
2725
2718
|
}),
|
|
2726
|
-
class: J({ "table-text-click":
|
|
2727
|
-
onClick: (f) =>
|
|
2728
|
-
innerHTML:
|
|
2729
|
-
}, 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, Bo))
|
|
2730
2723
|
])
|
|
2731
2724
|
], 64))
|
|
2732
2725
|
], 64))
|
|
@@ -2737,19 +2730,19 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
2737
2730
|
], 64))), 128);
|
|
2738
2731
|
};
|
|
2739
2732
|
}
|
|
2740
|
-
}),
|
|
2733
|
+
}), Lo = {
|
|
2741
2734
|
key: 0,
|
|
2742
2735
|
class: "relative curd-search fit-width"
|
|
2743
|
-
},
|
|
2736
|
+
}, jo = { class: "mb-10 flex justify-between items-center fit-width" }, Ko = {
|
|
2744
2737
|
class: "flex items-center",
|
|
2745
2738
|
style: { gap: "10px" }
|
|
2746
|
-
},
|
|
2739
|
+
}, Po = { key: 0 }, Io = { key: 1 }, Go = { key: 2 }, No = { class: "export-btn" }, Ho = {
|
|
2747
2740
|
key: 1,
|
|
2748
2741
|
class: "export-btn"
|
|
2749
|
-
},
|
|
2742
|
+
}, Wo = {
|
|
2750
2743
|
class: "flex items-center table-tools-right",
|
|
2751
2744
|
style: { gap: "10px" }
|
|
2752
|
-
},
|
|
2745
|
+
}, Jo = { class: "row justify-end mt-10 mb-10 table-bottom-pagination" }, qo = { class: "dialog-footer" }, Qo = { key: 0 }, Xo = { key: 1 }, Yo = { class: "dialog-footer" }, Zo = /* @__PURE__ */ q({
|
|
2753
2746
|
__name: "index",
|
|
2754
2747
|
props: {
|
|
2755
2748
|
/**
|
|
@@ -2772,11 +2765,11 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
2772
2765
|
}
|
|
2773
2766
|
},
|
|
2774
2767
|
setup(e, { expose: t }) {
|
|
2775
|
-
const n = $.EDialog,
|
|
2768
|
+
const n = $.EDialog, a = e, s = $.isFun, { conf: o, switchConfirmRef: l, ruleFormRef: i, tableRef: c } = _t(a);
|
|
2776
2769
|
return t({
|
|
2777
|
-
conf:
|
|
2778
|
-
}), (
|
|
2779
|
-
const h = fe("el-tooltip"), f =
|
|
2770
|
+
conf: o
|
|
2771
|
+
}), (u, d) => {
|
|
2772
|
+
const h = fe("el-tooltip"), f = pt("loading");
|
|
2780
2773
|
return g(), v("div", {
|
|
2781
2774
|
class: J(["relative cc1-form-box", [e.option.table?.fitHeight ? "col" : "no-min-height"]])
|
|
2782
2775
|
}, [
|
|
@@ -2784,165 +2777,165 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
2784
2777
|
class: J(["row", [e.option.table?.fitHeight ? "absolute fit" : ""]]),
|
|
2785
2778
|
style: { overflow: "hidden" }
|
|
2786
2779
|
}, [
|
|
2787
|
-
S(
|
|
2780
|
+
S(u.$slots, "box-left"),
|
|
2788
2781
|
R("div", {
|
|
2789
2782
|
class: J(["column fit-width no-wrap", [e.option.table?.fitHeight ? "col" : ""]])
|
|
2790
2783
|
}, [
|
|
2791
|
-
e.option.search?.show !== !1 ? (g(), v("div",
|
|
2792
|
-
F(
|
|
2793
|
-
model:
|
|
2784
|
+
e.option.search?.show !== !1 ? (g(), v("div", Lo, [
|
|
2785
|
+
F(r(oe), {
|
|
2786
|
+
model: r(o).search.form,
|
|
2794
2787
|
inline: "",
|
|
2795
2788
|
size: e.option.size?.search
|
|
2796
2789
|
}, {
|
|
2797
2790
|
default: p(() => [
|
|
2798
|
-
S(
|
|
2799
|
-
row:
|
|
2791
|
+
S(u.$slots, "search-start", {
|
|
2792
|
+
row: r(o).search.form
|
|
2800
2793
|
}),
|
|
2801
|
-
(g(!0), v(B, null,
|
|
2794
|
+
(g(!0), v(B, null, N(r(o).search.column.list, (m) => (g(), v(B, {
|
|
2802
2795
|
key: m.key
|
|
2803
2796
|
}, [
|
|
2804
|
-
S(
|
|
2805
|
-
row:
|
|
2797
|
+
S(u.$slots, "search-" + m.key + "-start", {
|
|
2798
|
+
row: r(o).search.form
|
|
2806
2799
|
}),
|
|
2807
|
-
(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), {
|
|
2808
2801
|
key: 0,
|
|
2809
2802
|
label: m.text?.search?.label ?? m.label
|
|
2810
2803
|
}, {
|
|
2811
2804
|
default: p(() => [
|
|
2812
|
-
S(
|
|
2813
|
-
row:
|
|
2805
|
+
S(u.$slots, "search-" + m.key + "-left", {
|
|
2806
|
+
row: r(o).search.form
|
|
2814
2807
|
}),
|
|
2815
|
-
S(
|
|
2816
|
-
row:
|
|
2808
|
+
S(u.$slots, "search-" + m.key, {
|
|
2809
|
+
row: r(o).search.form
|
|
2817
2810
|
}, () => [
|
|
2818
|
-
m.options?.search?.type ? (g(), b(
|
|
2811
|
+
m.options?.search?.type ? (g(), b(Ae, {
|
|
2819
2812
|
key: 0,
|
|
2820
2813
|
item: m,
|
|
2821
|
-
conf:
|
|
2814
|
+
conf: r(o),
|
|
2822
2815
|
type: m.options.search.type
|
|
2823
|
-
}, null, 8, ["item", "conf", "type"])) : (g(), b(
|
|
2816
|
+
}, null, 8, ["item", "conf", "type"])) : (g(), b(Ae, {
|
|
2824
2817
|
key: 1,
|
|
2825
2818
|
item: m,
|
|
2826
|
-
conf:
|
|
2819
|
+
conf: r(o),
|
|
2827
2820
|
type: m.type
|
|
2828
2821
|
}, null, 8, ["item", "conf", "type"]))
|
|
2829
2822
|
]),
|
|
2830
|
-
S(
|
|
2831
|
-
row:
|
|
2823
|
+
S(u.$slots, "search-" + m.key + "-right", {
|
|
2824
|
+
row: r(o).search.form
|
|
2832
2825
|
})
|
|
2833
2826
|
]),
|
|
2834
2827
|
_: 2
|
|
2835
2828
|
}, 1032, ["label"])) : V("", !0),
|
|
2836
|
-
S(
|
|
2837
|
-
row:
|
|
2829
|
+
S(u.$slots, "search-" + m.key + "-end", {
|
|
2830
|
+
row: r(o).search.form
|
|
2838
2831
|
})
|
|
2839
2832
|
], 64))), 128)),
|
|
2840
|
-
S(
|
|
2841
|
-
row:
|
|
2833
|
+
S(u.$slots, "search-center", {
|
|
2834
|
+
row: r(o).search.form
|
|
2842
2835
|
}),
|
|
2843
|
-
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 }, {
|
|
2844
2837
|
default: p(() => [
|
|
2845
|
-
e.option.tools?.search ? (g(), b(
|
|
2838
|
+
e.option.tools?.search ? (g(), b(r(G), {
|
|
2846
2839
|
key: 0,
|
|
2847
2840
|
type: "primary",
|
|
2848
|
-
onClick:
|
|
2841
|
+
onClick: r(o).search.submit
|
|
2849
2842
|
}, {
|
|
2850
2843
|
default: p(() => [
|
|
2851
|
-
M(U(
|
|
2844
|
+
M(U(r(C).tCurd("search")), 1)
|
|
2852
2845
|
]),
|
|
2853
2846
|
_: 1
|
|
2854
2847
|
}, 8, ["onClick"])) : V("", !0),
|
|
2855
|
-
e.option.tools?.reset ? (g(), b(
|
|
2848
|
+
e.option.tools?.reset ? (g(), b(r(G), {
|
|
2856
2849
|
key: 1,
|
|
2857
|
-
onClick:
|
|
2850
|
+
onClick: r(o).search.reset
|
|
2858
2851
|
}, {
|
|
2859
2852
|
default: p(() => [
|
|
2860
|
-
M(U(
|
|
2853
|
+
M(U(r(C).tCurd("reset")), 1)
|
|
2861
2854
|
]),
|
|
2862
2855
|
_: 1
|
|
2863
2856
|
}, 8, ["onClick"])) : V("", !0)
|
|
2864
2857
|
]),
|
|
2865
2858
|
_: 1
|
|
2866
2859
|
})) : V("", !0),
|
|
2867
|
-
S(
|
|
2868
|
-
row:
|
|
2860
|
+
S(u.$slots, "search-end", {
|
|
2861
|
+
row: r(o).search.form
|
|
2869
2862
|
})
|
|
2870
2863
|
]),
|
|
2871
2864
|
_: 3
|
|
2872
2865
|
}, 8, ["model", "size"])
|
|
2873
2866
|
])) : V("", !0),
|
|
2874
|
-
R("div",
|
|
2875
|
-
R("div",
|
|
2876
|
-
|
|
2877
|
-
F(
|
|
2867
|
+
R("div", jo, [
|
|
2868
|
+
R("div", Ko, [
|
|
2869
|
+
r(s)(e.option.tools?.add) ? (g(), v("div", Po, [
|
|
2870
|
+
F(r(G), {
|
|
2878
2871
|
type: "primary",
|
|
2879
|
-
onClick:
|
|
2872
|
+
onClick: d[0] || (d[0] = (m) => r(o).update.open(r(n).Add)),
|
|
2880
2873
|
size: e.option.size?.search
|
|
2881
2874
|
}, {
|
|
2882
2875
|
default: p(() => [
|
|
2883
|
-
M(U(
|
|
2876
|
+
M(U(r(C).tCurd("add")), 1)
|
|
2884
2877
|
]),
|
|
2885
2878
|
_: 1
|
|
2886
2879
|
}, 8, ["size"])
|
|
2887
2880
|
])) : V("", !0),
|
|
2888
|
-
e.option.table?.selectable &&
|
|
2889
|
-
F(
|
|
2881
|
+
e.option.table?.selectable && r(s)(e.option.tools?.delete) ? (g(), v("div", Io, [
|
|
2882
|
+
F(r(G), {
|
|
2890
2883
|
type: "danger",
|
|
2891
|
-
onClick:
|
|
2884
|
+
onClick: d[1] || (d[1] = (m) => r(o).remove.open(r(o).table.selection.list)),
|
|
2892
2885
|
size: e.option.size?.search
|
|
2893
2886
|
}, {
|
|
2894
2887
|
default: p(() => [
|
|
2895
|
-
M(U(
|
|
2888
|
+
M(U(r(C).tCurd("delete")), 1)
|
|
2896
2889
|
]),
|
|
2897
2890
|
_: 1
|
|
2898
2891
|
}, 8, ["size"])
|
|
2899
2892
|
])) : V("", !0),
|
|
2900
|
-
e.option.tools?.expand ? (g(), v("div",
|
|
2901
|
-
F(
|
|
2893
|
+
e.option.tools?.expand ? (g(), v("div", Go, [
|
|
2894
|
+
F(r(G), {
|
|
2902
2895
|
type: "warning",
|
|
2903
|
-
onClick:
|
|
2896
|
+
onClick: d[2] || (d[2] = (m) => r(o).table.expand.all()),
|
|
2904
2897
|
size: e.option.size?.search
|
|
2905
2898
|
}, {
|
|
2906
2899
|
default: p(() => [
|
|
2907
|
-
M(U(
|
|
2900
|
+
M(U(r(C).tCurd("expandCollapse")), 1)
|
|
2908
2901
|
]),
|
|
2909
2902
|
_: 1
|
|
2910
2903
|
}, 8, ["size"])
|
|
2911
2904
|
])) : V("", !0),
|
|
2912
2905
|
e.option.tools?.export?.show ? (g(), v(B, { key: 3 }, [
|
|
2913
|
-
e.option.tools?.export?.dropdown?.show ? (g(), b(
|
|
2906
|
+
e.option.tools?.export?.dropdown?.show ? (g(), b(r(gt), {
|
|
2914
2907
|
key: 0,
|
|
2915
|
-
onCommand:
|
|
2908
|
+
onCommand: r(o).export.click
|
|
2916
2909
|
}, {
|
|
2917
2910
|
dropdown: p(() => [
|
|
2918
|
-
F(
|
|
2911
|
+
F(r(ht), {
|
|
2919
2912
|
size: e.option.size?.search
|
|
2920
2913
|
}, {
|
|
2921
2914
|
default: p(() => [
|
|
2922
|
-
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), {
|
|
2923
2916
|
key: 0,
|
|
2924
2917
|
command: "select"
|
|
2925
2918
|
}, {
|
|
2926
2919
|
default: p(() => [
|
|
2927
|
-
M(U(
|
|
2920
|
+
M(U(r(C).tCurd("exportSelect")), 1)
|
|
2928
2921
|
]),
|
|
2929
2922
|
_: 1
|
|
2930
2923
|
})) : V("", !0),
|
|
2931
|
-
e.option.tools?.export?.dropdown?.page ? (g(), b(
|
|
2924
|
+
e.option.tools?.export?.dropdown?.page ? (g(), b(r(Se), {
|
|
2932
2925
|
key: 1,
|
|
2933
2926
|
command: "page"
|
|
2934
2927
|
}, {
|
|
2935
2928
|
default: p(() => [
|
|
2936
|
-
M(U(
|
|
2929
|
+
M(U(r(C).tCurd("exportPage")), 1)
|
|
2937
2930
|
]),
|
|
2938
2931
|
_: 1
|
|
2939
2932
|
})) : V("", !0),
|
|
2940
|
-
e.option.tools?.export?.dropdown?.all ? (g(), b(
|
|
2933
|
+
e.option.tools?.export?.dropdown?.all ? (g(), b(r(Se), {
|
|
2941
2934
|
key: 2,
|
|
2942
2935
|
command: "all"
|
|
2943
2936
|
}, {
|
|
2944
2937
|
default: p(() => [
|
|
2945
|
-
M(U(
|
|
2938
|
+
M(U(r(C).tCurd("exportAll")), 1)
|
|
2946
2939
|
]),
|
|
2947
2940
|
_: 1
|
|
2948
2941
|
})) : V("", !0)
|
|
@@ -2951,66 +2944,66 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
2951
2944
|
}, 8, ["size"])
|
|
2952
2945
|
]),
|
|
2953
2946
|
default: p(() => [
|
|
2954
|
-
R("div",
|
|
2955
|
-
F(
|
|
2947
|
+
R("div", No, [
|
|
2948
|
+
F(r(G), {
|
|
2956
2949
|
type: "warning",
|
|
2957
|
-
loading:
|
|
2950
|
+
loading: r(o).export.loading,
|
|
2958
2951
|
size: e.option.size?.search
|
|
2959
2952
|
}, {
|
|
2960
2953
|
default: p(() => [
|
|
2961
|
-
M(U(
|
|
2954
|
+
M(U(r(C).tCurd("export")), 1)
|
|
2962
2955
|
]),
|
|
2963
2956
|
_: 1
|
|
2964
2957
|
}, 8, ["loading", "size"])
|
|
2965
2958
|
])
|
|
2966
2959
|
]),
|
|
2967
2960
|
_: 1
|
|
2968
|
-
}, 8, ["onCommand"])) : (g(), v("div",
|
|
2969
|
-
F(
|
|
2961
|
+
}, 8, ["onCommand"])) : (g(), v("div", Ho, [
|
|
2962
|
+
F(r(G), {
|
|
2970
2963
|
type: "warning",
|
|
2971
|
-
loading:
|
|
2964
|
+
loading: r(o).export.loading,
|
|
2972
2965
|
size: e.option.size?.search,
|
|
2973
|
-
onClick:
|
|
2966
|
+
onClick: d[3] || (d[3] = (m) => r(o).export.run.start("all"))
|
|
2974
2967
|
}, {
|
|
2975
2968
|
default: p(() => [
|
|
2976
|
-
M(U(
|
|
2969
|
+
M(U(r(C).tCurd("export")), 1)
|
|
2977
2970
|
]),
|
|
2978
2971
|
_: 1
|
|
2979
2972
|
}, 8, ["loading", "size"])
|
|
2980
2973
|
]))
|
|
2981
2974
|
], 64)) : V("", !0),
|
|
2982
|
-
S(
|
|
2975
|
+
S(u.$slots, "tools-left")
|
|
2983
2976
|
]),
|
|
2984
|
-
R("div",
|
|
2985
|
-
S(
|
|
2986
|
-
|
|
2977
|
+
R("div", Wo, [
|
|
2978
|
+
S(u.$slots, "tools-right"),
|
|
2979
|
+
r(o).page.showTools ? (g(), b(r(Re), x({
|
|
2987
2980
|
key: 0,
|
|
2988
|
-
"current-page":
|
|
2989
|
-
"onUpdate:currentPage":
|
|
2990
|
-
"page-size":
|
|
2991
|
-
"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),
|
|
2992
2985
|
background: "",
|
|
2993
|
-
"page-sizes":
|
|
2994
|
-
"pager-count":
|
|
2995
|
-
layout:
|
|
2996
|
-
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,
|
|
2997
2990
|
size: e.option.size?.table,
|
|
2998
|
-
onSizeChange:
|
|
2999
|
-
onCurrentChange:
|
|
2991
|
+
onSizeChange: r(o).table.getList,
|
|
2992
|
+
onCurrentChange: r(o).table.getList
|
|
3000
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),
|
|
3001
2994
|
e.option.tools?.expandColumn === void 0 || e.option.tools?.expandColumn ? (g(), b(h, {
|
|
3002
2995
|
key: 1,
|
|
3003
2996
|
effect: "dark",
|
|
3004
|
-
content:
|
|
2997
|
+
content: r(o).table.header.group.expand ? r(C).tCurd("mergeColumn") : r(C).tCurd("expandColumn"),
|
|
3005
2998
|
placement: "top"
|
|
3006
2999
|
}, {
|
|
3007
3000
|
default: p(() => [
|
|
3008
3001
|
R("div", {
|
|
3009
3002
|
class: J(["refresh-btn", [e.option.size?.search]]),
|
|
3010
|
-
onClick:
|
|
3011
|
-
(...m) =>
|
|
3003
|
+
onClick: d[6] || (d[6] = //@ts-ignore
|
|
3004
|
+
(...m) => r(o).table.header.group.toggleExpandAll && r(o).table.header.group.toggleExpandAll(...m))
|
|
3012
3005
|
}, [
|
|
3013
|
-
|
|
3006
|
+
r(o).table.header.group.expand ? (g(), b(ro, { key: 0 })) : (g(), b(fo, { key: 1 }))
|
|
3014
3007
|
], 2)
|
|
3015
3008
|
]),
|
|
3016
3009
|
_: 1
|
|
@@ -3018,10 +3011,10 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
3018
3011
|
e.option.tools?.refresh === void 0 || e.option.tools?.refresh ? (g(), v("div", {
|
|
3019
3012
|
key: 2,
|
|
3020
3013
|
class: J(["refresh-btn", [e.option.size?.search]]),
|
|
3021
|
-
onClick:
|
|
3022
|
-
(...m) =>
|
|
3014
|
+
onClick: d[7] || (d[7] = //@ts-ignore
|
|
3015
|
+
(...m) => r(o).table.getList && r(o).table.getList(...m))
|
|
3023
3016
|
}, [
|
|
3024
|
-
F(
|
|
3017
|
+
F(yo)
|
|
3025
3018
|
], 2)) : V("", !0)
|
|
3026
3019
|
])
|
|
3027
3020
|
]),
|
|
@@ -3031,18 +3024,18 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
3031
3024
|
R("div", {
|
|
3032
3025
|
class: J(["column form-box-content", [e.option.table?.fitHeight ? "absolute fit" : ""]])
|
|
3033
3026
|
}, [
|
|
3034
|
-
|
|
3027
|
+
wt((g(), b(r(yt), x({
|
|
3035
3028
|
ref_key: "tableRef",
|
|
3036
3029
|
ref: c,
|
|
3037
|
-
data:
|
|
3030
|
+
data: r(o).table.data,
|
|
3038
3031
|
border: e.option.table?.border === void 0 ? !0 : e.option.table?.border,
|
|
3039
|
-
onSelectionChange:
|
|
3040
|
-
onSortChange:
|
|
3041
|
-
"expand-row-keys":
|
|
3042
|
-
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
|
|
3043
3036
|
}, e.option.table, E(e.option.table?.on || {})), {
|
|
3044
3037
|
default: p(() => [
|
|
3045
|
-
(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({
|
|
3046
3039
|
key: 0,
|
|
3047
3040
|
type: "selection",
|
|
3048
3041
|
width: "40",
|
|
@@ -3051,7 +3044,7 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
3051
3044
|
"show-overflow-tooltip": !1,
|
|
3052
3045
|
className: "cc1-form-selectable-column"
|
|
3053
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),
|
|
3054
|
-
(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({
|
|
3055
3048
|
key: 1,
|
|
3056
3049
|
type: "index",
|
|
3057
3050
|
fixed: "left",
|
|
@@ -3061,19 +3054,19 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
3061
3054
|
"show-overflow-tooltip": !1,
|
|
3062
3055
|
className: "cc1-form-index-column"
|
|
3063
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),
|
|
3064
|
-
F(
|
|
3065
|
-
conf:
|
|
3066
|
-
columnList:
|
|
3057
|
+
F(To, {
|
|
3058
|
+
conf: r(o),
|
|
3059
|
+
columnList: r(o).table.column.list,
|
|
3067
3060
|
option: e.option
|
|
3068
3061
|
}, Y({ _: 2 }, [
|
|
3069
|
-
|
|
3062
|
+
N(u.$slots, (m, w) => ({
|
|
3070
3063
|
name: w,
|
|
3071
3064
|
fn: p((D) => [
|
|
3072
|
-
S(
|
|
3065
|
+
S(u.$slots, w, $e(ze(D || {})))
|
|
3073
3066
|
])
|
|
3074
3067
|
}))
|
|
3075
3068
|
]), 1032, ["conf", "columnList", "option"]),
|
|
3076
|
-
|
|
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({
|
|
3077
3070
|
key: 2,
|
|
3078
3071
|
align: "center",
|
|
3079
3072
|
fixed: "right"
|
|
@@ -3082,85 +3075,85 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
3082
3075
|
"show-overflow-tooltip": !1
|
|
3083
3076
|
}), {
|
|
3084
3077
|
header: p(() => [
|
|
3085
|
-
S(
|
|
3086
|
-
M(U(
|
|
3078
|
+
S(u.$slots, "table-header-op", {}, () => [
|
|
3079
|
+
M(U(r(C).tCurd("operation")), 1)
|
|
3087
3080
|
])
|
|
3088
3081
|
]),
|
|
3089
3082
|
default: p(({ row: m }) => [
|
|
3090
|
-
F(
|
|
3083
|
+
F(r(oe), {
|
|
3091
3084
|
size: e.option.size?.table
|
|
3092
3085
|
}, {
|
|
3093
3086
|
default: p(() => [
|
|
3094
|
-
S(
|
|
3095
|
-
|
|
3096
|
-
F(
|
|
3087
|
+
S(u.$slots, "table-op-left", { row: m }),
|
|
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(G), {
|
|
3097
3090
|
link: "",
|
|
3098
3091
|
type: "info",
|
|
3099
|
-
onClick:
|
|
3092
|
+
onClick: r(o).update.close
|
|
3100
3093
|
}, {
|
|
3101
3094
|
default: p(() => [
|
|
3102
|
-
M(U(
|
|
3095
|
+
M(U(r(C).tCurd("cancel")), 1)
|
|
3103
3096
|
]),
|
|
3104
3097
|
_: 1
|
|
3105
3098
|
}, 8, ["onClick"]),
|
|
3106
|
-
F(
|
|
3099
|
+
F(r(G), {
|
|
3107
3100
|
link: "",
|
|
3108
3101
|
type: "primary",
|
|
3109
|
-
onClick:
|
|
3110
|
-
loading:
|
|
3102
|
+
onClick: r(o).update.submit,
|
|
3103
|
+
loading: r(o).update.loading
|
|
3111
3104
|
}, {
|
|
3112
3105
|
default: p(() => [
|
|
3113
|
-
M(U(
|
|
3106
|
+
M(U(r(C).tCurd("confirm")), 1)
|
|
3114
3107
|
]),
|
|
3115
3108
|
_: 1
|
|
3116
3109
|
}, 8, ["onClick", "loading"]),
|
|
3117
|
-
S(
|
|
3110
|
+
S(u.$slots, "table-op-edit-right", { row: m })
|
|
3118
3111
|
], 64)) : (g(), v(B, { key: 1 }, [
|
|
3119
|
-
|
|
3112
|
+
r(s)(e.option.table?.add, m) ? (g(), b(r(G), {
|
|
3120
3113
|
key: 0,
|
|
3121
3114
|
link: "",
|
|
3122
3115
|
type: "primary",
|
|
3123
|
-
onClick: (w) =>
|
|
3116
|
+
onClick: (w) => r(o).update.open(r(n).Add, m)
|
|
3124
3117
|
}, {
|
|
3125
3118
|
default: p(() => [
|
|
3126
|
-
M(U(
|
|
3119
|
+
M(U(r(C).tCurd("add")), 1)
|
|
3127
3120
|
]),
|
|
3128
3121
|
_: 1
|
|
3129
3122
|
}, 8, ["onClick"])) : V("", !0),
|
|
3130
|
-
|
|
3123
|
+
r(s)(e.option.table?.view, m) ? (g(), b(r(G), {
|
|
3131
3124
|
key: 1,
|
|
3132
3125
|
link: "",
|
|
3133
3126
|
type: "primary",
|
|
3134
|
-
onClick: (w) =>
|
|
3127
|
+
onClick: (w) => r(o).update.open(r(n).View, m)
|
|
3135
3128
|
}, {
|
|
3136
3129
|
default: p(() => [
|
|
3137
|
-
M(U(
|
|
3130
|
+
M(U(r(C).tCurd("view")), 1)
|
|
3138
3131
|
]),
|
|
3139
3132
|
_: 1
|
|
3140
3133
|
}, 8, ["onClick"])) : V("", !0),
|
|
3141
|
-
|
|
3134
|
+
r(s)(e.option.table?.update, m) ? (g(), b(r(G), {
|
|
3142
3135
|
key: 2,
|
|
3143
3136
|
link: "",
|
|
3144
3137
|
type: "warning",
|
|
3145
|
-
onClick: (w) =>
|
|
3138
|
+
onClick: (w) => r(o).update.open(r(n).Update, m)
|
|
3146
3139
|
}, {
|
|
3147
3140
|
default: p(() => [
|
|
3148
|
-
M(U(
|
|
3141
|
+
M(U(r(C).tCurd("edit")), 1)
|
|
3149
3142
|
]),
|
|
3150
3143
|
_: 1
|
|
3151
3144
|
}, 8, ["onClick"])) : V("", !0),
|
|
3152
|
-
|
|
3145
|
+
r(s)(e.option.table?.delete, m) ? (g(), b(r(G), {
|
|
3153
3146
|
key: 3,
|
|
3154
3147
|
link: "",
|
|
3155
3148
|
type: "danger",
|
|
3156
|
-
onClick: (w) =>
|
|
3149
|
+
onClick: (w) => r(o).remove.open([m])
|
|
3157
3150
|
}, {
|
|
3158
3151
|
default: p(() => [
|
|
3159
|
-
M(U(
|
|
3152
|
+
M(U(r(C).tCurd("delete")), 1)
|
|
3160
3153
|
]),
|
|
3161
3154
|
_: 1
|
|
3162
3155
|
}, 8, ["onClick"])) : V("", !0),
|
|
3163
|
-
S(
|
|
3156
|
+
S(u.$slots, "table-op-right", { row: m })
|
|
3164
3157
|
], 64))
|
|
3165
3158
|
]),
|
|
3166
3159
|
_: 2
|
|
@@ -3171,61 +3164,61 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
3171
3164
|
]),
|
|
3172
3165
|
_: 3
|
|
3173
3166
|
}, 16, ["data", "border", "onSelectionChange", "onSortChange", "expand-row-keys", "onExpandChange"])), [
|
|
3174
|
-
[f,
|
|
3167
|
+
[f, r(o).table.loading]
|
|
3175
3168
|
])
|
|
3176
3169
|
], 2)
|
|
3177
3170
|
], 2),
|
|
3178
|
-
R("div",
|
|
3179
|
-
(e.option.page?.show === void 0 || e.option.page?.show) && !
|
|
3171
|
+
R("div", Jo, [
|
|
3172
|
+
(e.option.page?.show === void 0 || e.option.page?.show) && !r(o).page.showTools ? (g(), b(r(Re), x({
|
|
3180
3173
|
key: 0,
|
|
3181
|
-
"current-page":
|
|
3182
|
-
"onUpdate:currentPage":
|
|
3183
|
-
"page-size":
|
|
3184
|
-
"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),
|
|
3185
3178
|
background: "",
|
|
3186
|
-
"page-sizes":
|
|
3187
|
-
"pager-count":
|
|
3188
|
-
layout:
|
|
3189
|
-
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,
|
|
3190
3183
|
size: e.option.size?.table,
|
|
3191
|
-
onSizeChange:
|
|
3192
|
-
onCurrentChange:
|
|
3184
|
+
onSizeChange: r(o).table.getList,
|
|
3185
|
+
onCurrentChange: r(o).table.getList
|
|
3193
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)
|
|
3194
3187
|
])
|
|
3195
3188
|
], 2),
|
|
3196
|
-
S(
|
|
3189
|
+
S(u.$slots, "box-right")
|
|
3197
3190
|
], 2),
|
|
3198
|
-
F(
|
|
3199
|
-
modelValue:
|
|
3200
|
-
"onUpdate:modelValue":
|
|
3201
|
-
title:
|
|
3202
|
-
"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
|
|
3203
3196
|
}, e.option.dialog), {
|
|
3204
3197
|
footer: p(() => [
|
|
3205
|
-
R("span",
|
|
3206
|
-
F(
|
|
3198
|
+
R("span", qo, [
|
|
3199
|
+
F(r(oe), {
|
|
3207
3200
|
size: e.option.size?.form
|
|
3208
3201
|
}, {
|
|
3209
3202
|
default: p(() => [
|
|
3210
|
-
S(
|
|
3211
|
-
row:
|
|
3203
|
+
S(u.$slots, "dialog-footer", {
|
|
3204
|
+
row: r(o).update
|
|
3212
3205
|
}, () => [
|
|
3213
|
-
F(
|
|
3214
|
-
onClick:
|
|
3206
|
+
F(r(G), {
|
|
3207
|
+
onClick: r(o).update.close
|
|
3215
3208
|
}, {
|
|
3216
3209
|
default: p(() => [
|
|
3217
|
-
M(U(
|
|
3210
|
+
M(U(r(C).tCurd("close")), 1)
|
|
3218
3211
|
]),
|
|
3219
3212
|
_: 1
|
|
3220
3213
|
}, 8, ["onClick"]),
|
|
3221
|
-
|
|
3214
|
+
r(o).update.type !== r(n).View ? (g(), b(r(G), {
|
|
3222
3215
|
key: 0,
|
|
3223
3216
|
type: "primary",
|
|
3224
|
-
onClick:
|
|
3225
|
-
loading:
|
|
3217
|
+
onClick: r(o).update.submit,
|
|
3218
|
+
loading: r(o).update.loading
|
|
3226
3219
|
}, {
|
|
3227
3220
|
default: p(() => [
|
|
3228
|
-
M(U(
|
|
3221
|
+
M(U(r(C).tCurd("submit")), 1)
|
|
3229
3222
|
]),
|
|
3230
3223
|
_: 1
|
|
3231
3224
|
}, 8, ["onClick", "loading"])) : V("", !0)
|
|
@@ -3236,74 +3229,74 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
3236
3229
|
])
|
|
3237
3230
|
]),
|
|
3238
3231
|
default: p(() => [
|
|
3239
|
-
S(
|
|
3240
|
-
row:
|
|
3232
|
+
S(u.$slots, "dialog-start", {
|
|
3233
|
+
row: r(o).update
|
|
3241
3234
|
}),
|
|
3242
|
-
F(
|
|
3235
|
+
F(r(oe), {
|
|
3243
3236
|
ref_key: "ruleFormRef",
|
|
3244
|
-
ref:
|
|
3245
|
-
model:
|
|
3246
|
-
rules:
|
|
3237
|
+
ref: i,
|
|
3238
|
+
model: r(o).update.form,
|
|
3239
|
+
rules: r(o).update.rules,
|
|
3247
3240
|
size: e.option.size?.form,
|
|
3248
3241
|
class: "update-dialog-form"
|
|
3249
3242
|
}, {
|
|
3250
3243
|
default: p(() => [
|
|
3251
|
-
|
|
3244
|
+
r(o).update.showContent ? (g(), b(at, {
|
|
3252
3245
|
key: 0,
|
|
3253
|
-
"form-grid":
|
|
3254
|
-
"max-span":
|
|
3255
|
-
form:
|
|
3256
|
-
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,
|
|
3257
3250
|
stripe: e.option.form?.stripe,
|
|
3258
3251
|
"label-width": e.option.form?.labelWidth,
|
|
3259
3252
|
"form-option": e.option.form,
|
|
3260
|
-
"get-bind":
|
|
3261
|
-
"get-on":
|
|
3262
|
-
"get-disabled":
|
|
3253
|
+
"get-bind": r(o).update.getBind,
|
|
3254
|
+
"get-on": r(o).update.getOn,
|
|
3255
|
+
"get-disabled": r(o).update.getDisabled
|
|
3263
3256
|
}, Y({ _: 2 }, [
|
|
3264
|
-
|
|
3257
|
+
N(u.$slots, (m, w) => ({
|
|
3265
3258
|
name: w,
|
|
3266
3259
|
fn: p((D) => [
|
|
3267
|
-
S(
|
|
3260
|
+
S(u.$slots, w, $e(ze(D || {})))
|
|
3268
3261
|
])
|
|
3269
3262
|
}))
|
|
3270
3263
|
]), 1032, ["form-grid", "max-span", "form", "type", "stripe", "label-width", "form-option", "get-bind", "get-on", "get-disabled"])) : V("", !0)
|
|
3271
3264
|
]),
|
|
3272
3265
|
_: 3
|
|
3273
3266
|
}, 8, ["model", "rules", "size"]),
|
|
3274
|
-
S(
|
|
3275
|
-
row:
|
|
3267
|
+
S(u.$slots, "dialog-end", {
|
|
3268
|
+
row: r(o).update
|
|
3276
3269
|
})
|
|
3277
3270
|
]),
|
|
3278
3271
|
_: 3
|
|
3279
3272
|
}, 16, ["modelValue", "title", "before-close"]),
|
|
3280
|
-
F(
|
|
3281
|
-
modelValue:
|
|
3282
|
-
"onUpdate:modelValue":
|
|
3283
|
-
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,
|
|
3284
3277
|
"close-on-click-modal": !1
|
|
3285
3278
|
}, {
|
|
3286
3279
|
footer: p(() => [
|
|
3287
|
-
R("span",
|
|
3288
|
-
F(
|
|
3280
|
+
R("span", Yo, [
|
|
3281
|
+
F(r(oe), {
|
|
3289
3282
|
size: e.option.size?.form
|
|
3290
3283
|
}, {
|
|
3291
3284
|
default: p(() => [
|
|
3292
|
-
F(
|
|
3293
|
-
onClick:
|
|
3285
|
+
F(r(G), {
|
|
3286
|
+
onClick: r(o).remove.close
|
|
3294
3287
|
}, {
|
|
3295
3288
|
default: p(() => [
|
|
3296
|
-
M(U(
|
|
3289
|
+
M(U(r(C).tCurd("close")), 1)
|
|
3297
3290
|
]),
|
|
3298
3291
|
_: 1
|
|
3299
3292
|
}, 8, ["onClick"]),
|
|
3300
|
-
F(
|
|
3293
|
+
F(r(G), {
|
|
3301
3294
|
type: "danger",
|
|
3302
|
-
onClick:
|
|
3303
|
-
loading:
|
|
3295
|
+
onClick: r(o).remove.submit,
|
|
3296
|
+
loading: r(o).remove.loading
|
|
3304
3297
|
}, {
|
|
3305
3298
|
default: p(() => [
|
|
3306
|
-
M(U(
|
|
3299
|
+
M(U(r(C).tCurd("confirmDelete")), 1)
|
|
3307
3300
|
]),
|
|
3308
3301
|
_: 1
|
|
3309
3302
|
}, 8, ["onClick", "loading"])
|
|
@@ -3313,25 +3306,25 @@ const Eo = /* @__PURE__ */ se(xo, [["render", So]]), $o = { class: "row flex-cen
|
|
|
3313
3306
|
])
|
|
3314
3307
|
]),
|
|
3315
3308
|
default: p(() => [
|
|
3316
|
-
e.option.dialog?.delete?.content ? (g(), v("div",
|
|
3317
|
-
F(
|
|
3309
|
+
e.option.dialog?.delete?.content ? (g(), v("div", Qo, [
|
|
3310
|
+
F(ao, {
|
|
3318
3311
|
content: e.option.dialog?.delete?.content,
|
|
3319
|
-
value:
|
|
3312
|
+
value: r(o).remove.items
|
|
3320
3313
|
}, null, 8, ["content", "value"])
|
|
3321
|
-
])) : (g(), v("div",
|
|
3314
|
+
])) : (g(), v("div", Xo, U(r(C).tCurd("confirmDeleteMessage", r(o).remove.items.length)), 1))
|
|
3322
3315
|
]),
|
|
3323
3316
|
_: 1
|
|
3324
3317
|
}, 8, ["modelValue", "title"]),
|
|
3325
|
-
F(
|
|
3318
|
+
F(to, {
|
|
3326
3319
|
ref_key: "switchConfirmRef",
|
|
3327
|
-
ref:
|
|
3320
|
+
ref: l,
|
|
3328
3321
|
size: e.option.size?.form
|
|
3329
3322
|
}, null, 8, ["size"])
|
|
3330
3323
|
], 2);
|
|
3331
3324
|
};
|
|
3332
3325
|
}
|
|
3333
3326
|
});
|
|
3334
|
-
class
|
|
3327
|
+
class na {
|
|
3335
3328
|
/**
|
|
3336
3329
|
* 通过远程 URL 下载文件,自动创建临时 `<a>` 标签触发浏览器下载
|
|
3337
3330
|
*
|
|
@@ -3339,8 +3332,8 @@ class oa {
|
|
|
3339
3332
|
* @param name - 下载后的文件名,默认 `'download.png'`
|
|
3340
3333
|
*/
|
|
3341
3334
|
static async download(t, n = "download.png") {
|
|
3342
|
-
const
|
|
3343
|
-
|
|
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);
|
|
3344
3337
|
}
|
|
3345
3338
|
/**
|
|
3346
3339
|
* 将json对象或者json数组导出为json文件保存
|
|
@@ -3348,54 +3341,54 @@ class oa {
|
|
|
3348
3341
|
* @param name
|
|
3349
3342
|
*/
|
|
3350
3343
|
static exportJSONFile = (t, n) => {
|
|
3351
|
-
const
|
|
3352
|
-
|
|
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();
|
|
3353
3346
|
};
|
|
3354
3347
|
/**
|
|
3355
3348
|
* 导入文件内容,默认为json
|
|
3356
3349
|
* @param param
|
|
3357
3350
|
* @returns
|
|
3358
3351
|
*/
|
|
3359
|
-
static importFile = async (t) => new Promise((n,
|
|
3360
|
-
const
|
|
3361
|
-
|
|
3362
|
-
const
|
|
3363
|
-
|
|
3364
|
-
const
|
|
3365
|
-
if (!
|
|
3366
|
-
$.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("未选择文件");
|
|
3367
3360
|
return;
|
|
3368
3361
|
}
|
|
3369
3362
|
const c = new FileReader();
|
|
3370
|
-
c.onload = async (
|
|
3371
|
-
const
|
|
3372
|
-
n(
|
|
3363
|
+
c.onload = async (u) => {
|
|
3364
|
+
const d = o == ".json" ? JSON.parse(u.target.result) : u.target.result;
|
|
3365
|
+
n(d);
|
|
3373
3366
|
}, c.onerror = () => {
|
|
3374
|
-
$.fail("文件读取失败"),
|
|
3375
|
-
}, c.readAsText(
|
|
3376
|
-
}, document.body.appendChild(
|
|
3367
|
+
$.fail("文件读取失败"), a("文件读取失败");
|
|
3368
|
+
}, c.readAsText(i), document.body.removeChild(s);
|
|
3369
|
+
}, document.body.appendChild(s), s.click();
|
|
3377
3370
|
});
|
|
3378
3371
|
}
|
|
3379
|
-
const
|
|
3380
|
-
if (e.component("TCurd",
|
|
3372
|
+
const _o = (e, t) => {
|
|
3373
|
+
if (e.component("TCurd", Zo), e.component("TFormList", Ge), e.component("TColumn", Pt), t?.customComponent) {
|
|
3381
3374
|
W.customComponent = t.customComponent;
|
|
3382
3375
|
for (const n in t.customComponent)
|
|
3383
3376
|
e.component(n, t.customComponent[n]);
|
|
3384
3377
|
}
|
|
3385
|
-
},
|
|
3386
|
-
install:
|
|
3378
|
+
}, la = {
|
|
3379
|
+
install: _o
|
|
3387
3380
|
};
|
|
3388
3381
|
export {
|
|
3389
3382
|
Q as ArrUtil,
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3383
|
+
Qt as ExcelUtil,
|
|
3384
|
+
Pt as TColumn,
|
|
3385
|
+
Zo as TCurd,
|
|
3386
|
+
na as TFile,
|
|
3394
3387
|
W as TForm,
|
|
3395
3388
|
L as TFormConfig,
|
|
3396
3389
|
C as TFormI18n,
|
|
3397
|
-
|
|
3390
|
+
Ge as TFormList,
|
|
3398
3391
|
$ as TSys,
|
|
3399
|
-
|
|
3400
|
-
|
|
3392
|
+
la as default,
|
|
3393
|
+
_o as install
|
|
3401
3394
|
};
|