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