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