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