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