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