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