cc1-form 1.2.28 → 1.3.0
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 +1440 -1373
- package/dist/cc1-form.umd.cjs +1 -1
- package/dist/components/TCurd/com/form/column.vue.d.ts +24 -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 +8 -7
- package/dist/components/TCurd/index.d.ts +14 -13
- package/dist/components/TCurd/index.vue.d.ts +55 -53
- package/dist/components/TCurd/indexType.d.ts +8 -2
- package/dist/index.d.ts +1 -2
- 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 x, 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 k, toHandlers as V, 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, c) => {
|
|
620
|
+
let u = c.default ?? "";
|
|
621
|
+
return c.type === "number" && (u = c.default ?? 0), c.type === "boolean" && (u = c.default ?? !1), c.type === "time" && (u = c.default ?? /* @__PURE__ */ new Date()), d[c.value] = u, d;
|
|
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"), c = le("el-input");
|
|
716
|
+
return t.show ? (s(), y("div", lt, [
|
|
717
|
+
x(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] = (u) => 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], (u) => (s(), y("div", rt, [
|
|
731
|
+
x(n.$slots, "item-start", {
|
|
732
|
+
item: u,
|
|
729
733
|
row: e.row
|
|
730
734
|
}),
|
|
731
|
-
(
|
|
732
|
-
modelValue:
|
|
733
|
-
"onUpdate:modelValue": (
|
|
734
|
-
style:
|
|
735
|
+
(s(!0), y(F, null, L(e.itemFields, (m) => (s(), h(c, {
|
|
736
|
+
modelValue: u[m.value],
|
|
737
|
+
"onUpdate:modelValue": (p) => u[m.value] = p,
|
|
738
|
+
style: ce({ width: e.inputWidth }),
|
|
735
739
|
class: I(e.inputClass),
|
|
736
|
-
placeholder:
|
|
737
|
-
onChange:
|
|
740
|
+
placeholder: m[e.label] || m[e.value],
|
|
741
|
+
onChange: o[1] || (o[1] = (p) => i("change"))
|
|
738
742
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "style", "class", "placeholder"]))), 256)),
|
|
739
|
-
|
|
740
|
-
item:
|
|
743
|
+
x(n.$slots, "item-end", {
|
|
744
|
+
item: u,
|
|
741
745
|
row: e.row
|
|
742
746
|
}),
|
|
743
|
-
|
|
747
|
+
D(d, {
|
|
744
748
|
link: "",
|
|
745
749
|
type: "danger",
|
|
746
|
-
onClick: (
|
|
750
|
+
onClick: (m) => t.remove(e.field, e.row, u)
|
|
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] = (u) => 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
|
+
x(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
|
+
x(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
|
+
x(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(_), k({
|
|
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), V(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(_), k({
|
|
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), V(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(_), k({
|
|
823
828
|
key: 2,
|
|
829
|
+
type: "textarea",
|
|
824
830
|
modelValue: e.form[e.item.key],
|
|
825
|
-
"onUpdate:modelValue": l[2] || (l[2] = (
|
|
826
|
-
}, e.getBind(e.item),
|
|
831
|
+
"onUpdate:modelValue": l[2] || (l[2] = (t) => e.form[e.item.key] = t)
|
|
832
|
+
}, e.getBind(e.item), V(e.getOn(e.item)), {
|
|
833
|
+
disabled: e.getDisabled(e.item)
|
|
834
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "switch" ? (s(), h(r(se), k({
|
|
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), V(e.getOn(e.item)), {
|
|
839
|
+
disabled: e.getDisabled(e.item)
|
|
840
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "select" ? (s(), h(r(ne), k({
|
|
841
|
+
key: 4,
|
|
842
|
+
modelValue: e.form[e.item.key],
|
|
843
|
+
"onUpdate:modelValue": l[4] || (l[4] = (t) => e.form[e.item.key] = t)
|
|
844
|
+
}, e.getBind(e.item), V(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), k({
|
|
850
|
+
key: t.value
|
|
851
|
+
}, { ref_for: !0 }, t, V(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), k({
|
|
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), V(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), k({
|
|
864
|
+
key: t.value
|
|
865
|
+
}, { ref_for: !0 }, t, V(t.on || {})), null, 16))), 128)) : (s(!0), y(F, { key: 1 }, L(e.getBind(e.item).data || [], (t) => (s(), h(r(Ve), k({
|
|
866
|
+
key: t.value
|
|
867
|
+
}, { ref_for: !0 }, t, V(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), k({
|
|
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), V(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), k({
|
|
880
|
+
key: t.value
|
|
881
|
+
}, { ref_for: !0 }, t, V(t.on || {})), null, 16))), 128)) : (s(!0), y(F, { key: 1 }, L(e.getBind(e.item).data || [], (t) => (s(), h(r(Je), k({
|
|
882
|
+
key: t.value
|
|
883
|
+
}, { ref_for: !0 }, t, V(t.on || {})), null, 16))), 128))
|
|
884
|
+
]),
|
|
885
|
+
_: 1
|
|
886
|
+
}, 16, ["modelValue", "disabled"])) : e.item.type === "color" ? (s(), h(r(Qe), k({
|
|
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), V(e.getOn(e.item)), {
|
|
891
|
+
disabled: e.getDisabled(e.item)
|
|
892
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "slider" ? (s(), h(r(qe), k({
|
|
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), V(e.getOn(e.item)), {
|
|
897
|
+
disabled: e.getDisabled(e.item)
|
|
898
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "list" ? (s(), h(Ee, k({
|
|
899
|
+
key: 9,
|
|
852
900
|
row: e.form,
|
|
853
901
|
field: e.item.key
|
|
854
|
-
}, e.getBind(e.item),
|
|
902
|
+
}, e.getBind(e.item), V(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), k({
|
|
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), V(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), k({
|
|
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), V(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), k({
|
|
919
|
+
key: 12,
|
|
920
|
+
modelValue: e.form[e.item.key],
|
|
921
|
+
"onUpdate:modelValue": l[11] || (l[11] = (t) => e.form[e.item.key] = t)
|
|
922
|
+
}, e.getBind(e.item), V(e.getOn(e.item)), {
|
|
923
|
+
disabled: e.getDisabled(e.item)
|
|
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]), k({
|
|
925
|
+
key: 13,
|
|
872
926
|
modelValue: e.form[e.item.key],
|
|
873
|
-
"onUpdate:modelValue": l[
|
|
874
|
-
}, e.getBind(e.item),
|
|
927
|
+
"onUpdate:modelValue": l[12] || (l[12] = (t) => e.form[e.item.key] = t)
|
|
928
|
+
}, e.getBind(e.item), V(e.getOn(e.item)), {
|
|
875
929
|
disabled: e.getDisabled(e.item)
|
|
876
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
930
|
+
}), null, 16, ["modelValue", "disabled"])) : v("", !0)
|
|
877
931
|
]),
|
|
878
|
-
|
|
932
|
+
x(a.$slots, "form-" + e.item.key + "-right", {
|
|
879
933
|
row: e.form,
|
|
880
934
|
item: e.item
|
|
881
935
|
})
|
|
882
936
|
]),
|
|
883
|
-
|
|
937
|
+
x(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
|
+
x(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 w {
|
|
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
|
+
w.curd = ObjectUtil.deepMerge(w.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((c) => c.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 = w.tCurd(d ? "add" : i === de.View ? "view" : "edit");
|
|
1126
|
+
const c = d ? ObjectUtil.deepMerge(JSONUtil.cp(o.update.formDefault), n ? JSONUtil.cp(n) : {}) : JSONUtil.cp(n);
|
|
1127
|
+
Q.setValue(o.update.form, c, !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(w.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 c = new Set(a.option.column.filter((u) => u.type === "datetime").map((u) => u.key));
|
|
1162
|
+
Object.keys(d).forEach((u) => {
|
|
1163
|
+
if (c.has(u) && d[u] != null) {
|
|
1164
|
+
const m = new Date(d[u]).getTime();
|
|
1165
|
+
isNaN(m) || (d[u] = m);
|
|
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 (u) {
|
|
1172
|
+
console.error(u);
|
|
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 c = n[d];
|
|
1202
|
+
typeof c == "function" ? o[d] = function(...u) {
|
|
1203
|
+
return c.apply(this, [...u, ...l]);
|
|
1204
|
+
} : o[d] = c;
|
|
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, c = i?.defaultSpan || d / 2, u = n.gridBand, p = a.filter((f) => u != null ? f.gridBand === u && !z.isFun(f.item.show?.form, l, t) : f.gridRow === n.gridRow && !z.isFun(f.item.show?.form, l, t)).reduce((f, g) => f + (g.colSpan ?? g.span ?? c), 0);
|
|
1211
|
+
return o + p;
|
|
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(), c = [];
|
|
1251
|
+
let u = 0, m = 0;
|
|
1252
|
+
const p = (S) => Math.floor(S / K) * K, f = (S, E) => `${S},${E}`, g = (S, E, B, j) => {
|
|
1253
|
+
if (E + B > l) return !1;
|
|
1254
|
+
for (let A = 0; A < j; A++)
|
|
1255
|
+
for (let R = 0; R < B; R++)
|
|
1256
|
+
if (d.has(f(S + A, E + R))) return !1;
|
|
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 (g(
|
|
1040
|
-
return { tr:
|
|
1258
|
+
}, C = (S, E, B, j) => {
|
|
1259
|
+
for (let A = 0; A < j; A++)
|
|
1260
|
+
for (let R = 0; R < B; R++)
|
|
1261
|
+
d.add(f(S + A, E + R));
|
|
1262
|
+
}, H = (S, E, B, j) => {
|
|
1263
|
+
for (let R = p(S); R < 500 * K; R += K) {
|
|
1264
|
+
const je = R + K, Pe = R === p(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 (g(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 = p(S);
|
|
1275
|
+
if (j < K && S + j < A + K) {
|
|
1276
|
+
u = S + j, m = E;
|
|
1048
1277
|
return;
|
|
1049
1278
|
}
|
|
1050
|
-
const R =
|
|
1279
|
+
const R = E + B;
|
|
1051
1280
|
if (R < l) {
|
|
1052
|
-
|
|
1281
|
+
m = R, u = A;
|
|
1053
1282
|
return;
|
|
1054
1283
|
}
|
|
1055
|
-
|
|
1284
|
+
m = 0, u = A + K;
|
|
1056
1285
|
};
|
|
1057
|
-
for (const
|
|
1058
|
-
const
|
|
1059
|
-
|
|
1060
|
-
let { tr:
|
|
1061
|
-
g(
|
|
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 && c.length && (m = 0, u = p(u) + K);
|
|
1289
|
+
let { tr: j, tc: A } = g(u, m, E, B) ? { tr: u, tc: m } : H(u, m, E, B);
|
|
1290
|
+
g(j, A, E, B) || ({ tr: j, tc: A } = H(0, 0, E, B)), C(j, A, E, B);
|
|
1291
|
+
const R = j + 1;
|
|
1292
|
+
c.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: c, 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((
|
|
1102
|
-
const { cells:
|
|
1103
|
-
maxSpan:
|
|
1104
|
-
defaultSpan:
|
|
1105
|
-
layout:
|
|
1321
|
+
return t;
|
|
1322
|
+
}), Ct = (e) => Re((a) => {
|
|
1323
|
+
const l = {
|
|
1324
|
+
input: w.tCurd("placeholderInput"),
|
|
1325
|
+
select: w.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((m) => me(m, !0)), Te(e, t, i, (m) => d(m, l));
|
|
1331
|
+
const { cells: c, maxSpan: u } = 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: c,
|
|
1340
|
+
formMaxSpan: u,
|
|
1341
|
+
formColumn: Ue(c)
|
|
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((f) => a(f.item.show?.form, l.form, l.type))
|
|
1373
|
+
), i = Z(() => {
|
|
1374
|
+
const f = Array.from(
|
|
1375
|
+
new Set(
|
|
1376
|
+
t.value.map((g) => g.gridBand ?? ie(g))
|
|
1377
|
+
)
|
|
1378
|
+
).sort((g, C) => g - C);
|
|
1379
|
+
return new Map(f.map((g, C) => [g, C]));
|
|
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 f = 0;
|
|
1384
|
+
return t.value.forEach((g) => {
|
|
1385
|
+
const C = g.gridRow + g.rowSpan - 1;
|
|
1386
|
+
C > f && (f = C);
|
|
1387
|
+
}), f;
|
|
1388
|
+
}), d = (f) => f.gridRow + f.rowSpan - 1 >= o.value, c = (f) => f.rowSpan >= K, u = (f) => {
|
|
1389
|
+
const g = f.gridBand ?? ie(f);
|
|
1390
|
+
return i.value.get(g) ?? g;
|
|
1391
|
+
}, m = (f) => Fe(f, l.formGrid, l.form, l.type, {
|
|
1153
1392
|
maxSpan: l.maxSpan,
|
|
1154
1393
|
defaultSpan: l.formOption?.defaultSpan
|
|
1155
|
-
}),
|
|
1156
|
-
const
|
|
1394
|
+
}), p = (f) => {
|
|
1395
|
+
const g = m(f) || f.colSpan;
|
|
1157
1396
|
return {
|
|
1158
|
-
gridRow: `${
|
|
1159
|
-
gridColumn: `${
|
|
1397
|
+
gridRow: `${f.gridRow} / span ${f.rowSpan}`,
|
|
1398
|
+
gridColumn: `${f.gridColumn} / span ${g}`
|
|
1160
1399
|
};
|
|
1161
1400
|
};
|
|
1162
|
-
return (
|
|
1163
|
-
|
|
1164
|
-
|
|
1401
|
+
return (f, g) => r(a)(r(kt)(e.formGrid), e.form, e.type) ? (s(), y(F, { key: 0 }, [
|
|
1402
|
+
x(f.$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, (C) => (s(), y("div", {
|
|
1408
|
+
key: C.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 && u(C) % 2 === 0 ? "stripe-band-odd" : "",
|
|
1411
|
+
C.gridColumn > 1 ? "has-col-border" : "",
|
|
1412
|
+
e.stripe !== !1 && d(C) ? "is-last-row" : "",
|
|
1413
|
+
c(C) ? "is-row-span" : "",
|
|
1414
|
+
`form-item-col-${C.item.key}`
|
|
1176
1415
|
]]),
|
|
1177
|
-
style:
|
|
1416
|
+
style: ce(p(C))
|
|
1178
1417
|
}, [
|
|
1179
|
-
|
|
1180
|
-
r(
|
|
1418
|
+
M("div", Vt, [
|
|
1419
|
+
r(a)(C.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": c(C) }),
|
|
1422
|
+
item: C.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(f.$slots, (H, N) => ({
|
|
1431
|
+
name: N,
|
|
1432
|
+
fn: b((S) => [
|
|
1433
|
+
x(f.$slots, N, k({ 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
|
+
x(f.$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(c) {
|
|
1476
|
+
n.set(c);
|
|
1284
1477
|
},
|
|
1285
|
-
getDisabled: (
|
|
1286
|
-
getBind: (
|
|
1287
|
-
getOn: (
|
|
1478
|
+
getDisabled: (c) => De(c, d.type, d.form),
|
|
1479
|
+
getBind: (c) => Oe(c, d.type),
|
|
1480
|
+
getOn: (c) => Me(c, d.type, [d.form, c]),
|
|
1288
1481
|
initColumnForm: () => {
|
|
1289
|
-
const
|
|
1290
|
-
|
|
1482
|
+
const c = n, u = xt(i.option.column, i.option.form, c.get());
|
|
1483
|
+
d.formDefault = u.formDefault, d.rules = u.rules, d.formGrid = u.formGrid, d.formMaxSpan = u.formMaxSpan, d.formColumn = u.formColumn, d.type === l.Add ? c.isExternal() ? c.merge(JSONUtil.cp(d.formDefault)) : c.set(JSONUtil.cp(d.formDefault)) : !c.isExternal() && i.form && c.set(JSONUtil.cp(i.form));
|
|
1291
1484
|
}
|
|
1292
1485
|
});
|
|
1293
|
-
return i.option.form?.initStart?.(
|
|
1486
|
+
return i.option.form?.initStart?.(d), d.initColumnForm(), i.option.form?.initEnd?.(d), et(
|
|
1294
1487
|
() => i.form,
|
|
1295
|
-
(
|
|
1296
|
-
|
|
1488
|
+
(c) => {
|
|
1489
|
+
n = fe(c), d.initColumnForm();
|
|
1297
1490
|
}
|
|
1298
|
-
),
|
|
1491
|
+
), a({ ref: t, conf: d }), (c, u) => (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(c.$slots, (m, p) => ({
|
|
1512
|
+
name: p,
|
|
1513
|
+
fn: b((f) => [
|
|
1514
|
+
x(c.$slots, p, pe(we(f || {})))
|
|
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 = w.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: C, order: H } = U.config.table.sort;
|
|
1660
|
+
o = {
|
|
1661
|
+
[C.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
|
+
}), c = U.config.field.result, u = d.data || { [c.list]: d }, m = (Array.isArray(u[c.list]), u[c.list]), p = Be(t.update.formGrid?.length ? t.update.formGrid : t.update.formColumn), g = ObjectUtil.deepMerge({ data: m }, {}).data.map((C) => (Object.keys(C).forEach((N) => {
|
|
1669
|
+
const S = p.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
|
+
}), C));
|
|
1672
|
+
t.table.data = a.option.data ? await a.option.data(g, m) : g, t.page.total = u[c.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
|
|
1500
|
-
for (const
|
|
1501
|
-
if (
|
|
1502
|
-
if (
|
|
1503
|
-
} else if (
|
|
1504
|
-
return
|
|
1505
|
-
if (Array.isArray(
|
|
1506
|
-
const g =
|
|
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, c = (u) => {
|
|
1692
|
+
const m = (p) => {
|
|
1693
|
+
for (const f of p) {
|
|
1694
|
+
if (d != null && d !== "") {
|
|
1695
|
+
if (f[d] === u[d]) return f;
|
|
1696
|
+
} else if (f === u)
|
|
1697
|
+
return f;
|
|
1698
|
+
if (Array.isArray(f.children) && f.children.length) {
|
|
1699
|
+
const g = m(f.children);
|
|
1507
1700
|
if (g !== void 0) return g;
|
|
1508
1701
|
}
|
|
1509
1702
|
}
|
|
1510
1703
|
};
|
|
1511
|
-
return
|
|
1704
|
+
return m(n.table.data);
|
|
1512
1705
|
};
|
|
1513
|
-
|
|
1514
|
-
const
|
|
1515
|
-
if (
|
|
1706
|
+
t.forEach((u) => {
|
|
1707
|
+
const m = c(u);
|
|
1708
|
+
if (m)
|
|
1516
1709
|
if (i) {
|
|
1517
|
-
const
|
|
1518
|
-
i(
|
|
1710
|
+
const p = () => o.toggleRowSelection(m, !0, !1);
|
|
1711
|
+
i(u) !== !1 && p();
|
|
1519
1712
|
} else
|
|
1520
|
-
|
|
1713
|
+
o.toggleRowSelection(m, !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
|
|
1552
|
-
return l.forEach((
|
|
1553
|
-
|
|
1554
|
-
}),
|
|
1555
|
-
}),
|
|
1556
|
-
i.utils.book_append_sheet(
|
|
1741
|
+
static exportToExcel = async (a, l, t) => {
|
|
1742
|
+
if (!a || a.length === 0) return;
|
|
1743
|
+
const i = await z.loadModule("xlsx"), n = a.map((c) => {
|
|
1744
|
+
const u = {};
|
|
1745
|
+
return l.forEach((m) => {
|
|
1746
|
+
u[m.label] = c[m.key];
|
|
1747
|
+
}), u;
|
|
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(w.tCurd("selectDataToExport")), new Error(w.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(w.tCurd("noData")), new Error(w.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,140 +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
|
-
openLoading: !1,
|
|
1693
|
-
open: async (i, o) => {
|
|
1694
|
-
const t = e();
|
|
1695
|
-
if (!(t.update.showContent || t.update.openLoading)) {
|
|
1696
|
-
S.loading(!0), t.update.openLoading = !0;
|
|
1697
|
-
try {
|
|
1698
|
-
t.update.type = i;
|
|
1699
|
-
const s = i === le.Add;
|
|
1700
|
-
t.update.edit.data = s ? void 0 : JSONUtil.cp(o), t.update.title = b.tCurd(s ? "add" : i === le.View ? "view" : "edit");
|
|
1701
|
-
const f = s ? ObjectUtil.deepMerge(JSONUtil.cp(t.update.formDefault), o ? JSONUtil.cp(o) : {}) : JSONUtil.cp(o);
|
|
1702
|
-
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);
|
|
1703
|
-
} catch (s) {
|
|
1704
|
-
console.error(s);
|
|
1705
|
-
} finally {
|
|
1706
|
-
S.loading(!1), t.update.openLoading = !1;
|
|
1707
|
-
}
|
|
1708
|
-
}
|
|
1709
|
-
},
|
|
1710
|
-
validate: async () => {
|
|
1711
|
-
const i = e();
|
|
1712
|
-
try {
|
|
1713
|
-
return await Promise.all([
|
|
1714
|
-
l.ruleFormRef.value?.validate(async (o) => new Promise((t, s) => {
|
|
1715
|
-
o || s(!1), t(void 0);
|
|
1716
|
-
})),
|
|
1717
|
-
i.formRef.validate()
|
|
1718
|
-
]), !0;
|
|
1719
|
-
} catch {
|
|
1720
|
-
S.fail(b.tCurd("checkFormData"));
|
|
1721
|
-
}
|
|
1722
|
-
},
|
|
1723
|
-
submit: async () => {
|
|
1724
|
-
const i = e();
|
|
1725
|
-
if (!await i.update.validate() || i.update.loading) 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
|
-
close: () => {
|
|
1753
|
-
const i = e();
|
|
1754
|
-
i.update.show = !1, i.update.edit.data = void 0, setTimeout(() => {
|
|
1755
|
-
i.update.showContent = !1, l.ruleFormRef.value?.resetFields?.(), a.clear();
|
|
1756
|
-
}, 350);
|
|
1757
|
-
}
|
|
1758
|
-
}
|
|
1759
|
-
};
|
|
1760
|
-
}, Vt = (e, n) => ({
|
|
1826
|
+
}), Ft = (e, a) => ({
|
|
1761
1827
|
remove: {
|
|
1762
|
-
title:
|
|
1828
|
+
title: w.tCurd("deleteTitle"),
|
|
1763
1829
|
show: !1,
|
|
1764
1830
|
items: [],
|
|
1765
1831
|
loading: !1,
|
|
@@ -1768,23 +1834,23 @@ const xt = (e, n) => ({
|
|
|
1768
1834
|
},
|
|
1769
1835
|
open: (l) => {
|
|
1770
1836
|
if (l.length === 0) {
|
|
1771
|
-
|
|
1837
|
+
z.fail(w.tCurd("selectDataToDelete"));
|
|
1772
1838
|
return;
|
|
1773
1839
|
}
|
|
1774
|
-
const
|
|
1775
|
-
|
|
1840
|
+
const t = e();
|
|
1841
|
+
t.remove.items = l, t.remove.show = !0;
|
|
1776
1842
|
},
|
|
1777
1843
|
submit: () => {
|
|
1778
1844
|
FunUtil.throttle(async () => {
|
|
1779
1845
|
const l = e();
|
|
1780
1846
|
l.remove.loading = !0;
|
|
1781
|
-
const
|
|
1847
|
+
const t = a.option.api.delete;
|
|
1782
1848
|
try {
|
|
1783
|
-
if (!
|
|
1784
|
-
await
|
|
1785
|
-
[
|
|
1849
|
+
if (!t) return;
|
|
1850
|
+
await t({
|
|
1851
|
+
[a.option.table?.rowKey]: l.remove.items.map((i) => i[a.option.table?.rowKey]),
|
|
1786
1852
|
items: l.remove.items
|
|
1787
|
-
}),
|
|
1853
|
+
}), z.success(w.tCurd("operationSuccess")), l.table.data.length <= 1 && l.page.num > 1 && (l.page.num -= 1), l.remove.close(), await l.table.getList();
|
|
1788
1854
|
} catch (i) {
|
|
1789
1855
|
console.error(i);
|
|
1790
1856
|
} finally {
|
|
@@ -1793,201 +1859,203 @@ const xt = (e, n) => ({
|
|
|
1793
1859
|
});
|
|
1794
1860
|
}
|
|
1795
1861
|
}
|
|
1796
|
-
}),
|
|
1862
|
+
}), Ut = (e, a, l) => ({
|
|
1797
1863
|
apiDataMap: {},
|
|
1798
|
-
getColumnSpan: (
|
|
1799
|
-
const
|
|
1800
|
-
return
|
|
1801
|
-
maxSpan:
|
|
1802
|
-
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
|
|
1803
1869
|
});
|
|
1804
1870
|
},
|
|
1805
1871
|
init: () => {
|
|
1806
|
-
const
|
|
1807
|
-
|
|
1872
|
+
const t = e();
|
|
1873
|
+
t.initCurdConfig(), t.initColumnOptions(), t.initColumnForm();
|
|
1808
1874
|
},
|
|
1809
|
-
initApiData: async (
|
|
1810
|
-
const i = e(),
|
|
1811
|
-
if (
|
|
1812
|
-
|
|
1875
|
+
initApiData: async (t) => {
|
|
1876
|
+
const i = e(), n = [], o = (d) => {
|
|
1877
|
+
if (d.children?.length) {
|
|
1878
|
+
d.children.forEach((u) => o(u));
|
|
1813
1879
|
return;
|
|
1814
1880
|
}
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1881
|
+
const c = te(d);
|
|
1882
|
+
if (d.options?.[c]?.dataApi && d.options?.[c]?.dataApiConfig?.[t]) {
|
|
1883
|
+
if (i.apiDataMap[d.key] && d.options?.[c]?.dataApiConfig?.once) return;
|
|
1884
|
+
const u = (async () => {
|
|
1818
1885
|
try {
|
|
1819
|
-
let
|
|
1820
|
-
if (
|
|
1821
|
-
const
|
|
1822
|
-
!Array.isArray(
|
|
1886
|
+
let m = await d.options?.[c]?.dataApi?.(i.update.form, i.update.type);
|
|
1887
|
+
if (m) {
|
|
1888
|
+
const p = d.options?.[c]?.dataPath;
|
|
1889
|
+
!Array.isArray(m) && p && (m = ObjectUtil.getPathValue(m, p)), d.options[c].data = m, d.options.search[c].data = m, d.options.search[d.options.search.type ?? c] || (d.options.search[d.options.search.type ?? c] = {}), d.options.search[d.options.search.type ?? c].data = m, d.options.formAdd[c].data = m, d.options.formUpdate[c].data = m, i.apiDataMap[d.key] = m;
|
|
1823
1890
|
}
|
|
1824
1891
|
} catch {
|
|
1825
1892
|
}
|
|
1826
1893
|
})();
|
|
1827
|
-
|
|
1894
|
+
n.push(u);
|
|
1828
1895
|
}
|
|
1829
1896
|
};
|
|
1830
|
-
return
|
|
1897
|
+
return a.option.column.forEach((d) => o(d)), await Promise.all(n), !0;
|
|
1831
1898
|
},
|
|
1832
1899
|
initCurdConfig: () => {
|
|
1833
|
-
const
|
|
1834
|
-
|
|
1835
|
-
const i = ObjectUtil.deepMerge(
|
|
1836
|
-
Object.keys(i).forEach((
|
|
1837
|
-
|
|
1900
|
+
const t = ObjectUtil.deepMerge(U.config, {});
|
|
1901
|
+
t.table.emptyText = w.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];
|
|
1838
1905
|
});
|
|
1839
1906
|
},
|
|
1840
1907
|
initColumnOptions: () => {
|
|
1841
|
-
const
|
|
1842
|
-
let i = JSONUtil.cp(
|
|
1908
|
+
const t = e();
|
|
1909
|
+
let i = JSONUtil.cp(U.config.columnConfig);
|
|
1843
1910
|
i.options = ObjectUtil.deepMerge(
|
|
1844
1911
|
{
|
|
1845
1912
|
switch: {
|
|
1846
|
-
activeText:
|
|
1847
|
-
inactiveText:
|
|
1913
|
+
activeText: w.tCurd("switchOn"),
|
|
1914
|
+
inactiveText: w.tCurd("switchOff")
|
|
1848
1915
|
}
|
|
1849
1916
|
},
|
|
1850
1917
|
i.options
|
|
1851
1918
|
);
|
|
1852
|
-
const
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
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((m) => n(m));
|
|
1857
1925
|
return;
|
|
1858
1926
|
}
|
|
1859
|
-
} else
|
|
1860
|
-
|
|
1861
|
-
t.options[d] = t.options[d] || ObjectUtil.deepMerge(t.options, {}), t.options[d][t.type] = t.options[d][t.type] || {}, t.options[d][t.type].size = d === "search" ? n.option.size.search : n.option.size.form;
|
|
1862
|
-
}), t.table = ObjectUtil.deepMerge(t.table, t.options[t.type].table || {});
|
|
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;
|
|
1863
1929
|
}
|
|
1864
|
-
|
|
1865
|
-
|
|
1930
|
+
["search", "formAdd", "formUpdate"].forEach((u) => {
|
|
1931
|
+
o.options[u] = ObjectUtil.deepMerge(o.options, o.options[u] || {}), u === "search" ? a.option.size.search && (o.options[u][d].size = a.option.size.search) : a.option.size.form && (o.options[u][d].size = a.option.size.form);
|
|
1932
|
+
}), o.table = ObjectUtil.deepMerge(o.table, o.options[d].table || {}), d === "switch" && (o.options.switch.tableBeforeChange = async (u, m) => {
|
|
1933
|
+
const p = o.options?.switch;
|
|
1866
1934
|
try {
|
|
1867
|
-
|
|
1868
|
-
title:
|
|
1869
|
-
content:
|
|
1935
|
+
p.tableConfig?.confirm && await l.switchConfirmRef.value?.open({
|
|
1936
|
+
title: w.tCurd("confirmModify"),
|
|
1937
|
+
content: w.tCurd("confirmSwitchMessage")
|
|
1870
1938
|
});
|
|
1871
1939
|
try {
|
|
1872
|
-
if (!
|
|
1873
|
-
const
|
|
1874
|
-
|
|
1875
|
-
const
|
|
1876
|
-
if (!
|
|
1940
|
+
if (!a.option.api.update && !p.tableConfig?.api) return;
|
|
1941
|
+
const f = m[a.option.table?.rowKey];
|
|
1942
|
+
p.loadingMap || (p.loadingMap = {}), p.loadingMap[f] || (p.loadingMap[f] = { loading: !1 }), p.loadingMap[f].loading = !0;
|
|
1943
|
+
const g = m[u] === p.activeValue ? p.inactiveValue : p.activeValue, C = p.tableConfig?.api ? p.tableConfig.api : a.option.api.update;
|
|
1944
|
+
if (!C) return;
|
|
1877
1945
|
try {
|
|
1878
|
-
await
|
|
1946
|
+
await C({ ...m, [u]: g }, "switch");
|
|
1879
1947
|
} catch {
|
|
1880
1948
|
return !1;
|
|
1881
1949
|
} finally {
|
|
1882
|
-
|
|
1950
|
+
p.loadingMap[f].loading = !1;
|
|
1883
1951
|
}
|
|
1884
|
-
return
|
|
1885
|
-
} catch (
|
|
1886
|
-
return console.error(
|
|
1952
|
+
return z.success(w.tCurd("operationSuccess")), p.tableConfig?.loadList && (t.table.loading = !0, t.table.getList(), t.table.loading = !1), !0;
|
|
1953
|
+
} catch (f) {
|
|
1954
|
+
return console.error(f), !1;
|
|
1887
1955
|
} finally {
|
|
1888
|
-
|
|
1956
|
+
t.table.loading = !1;
|
|
1889
1957
|
}
|
|
1890
1958
|
} catch {
|
|
1891
1959
|
return !1;
|
|
1892
1960
|
}
|
|
1893
|
-
}),
|
|
1961
|
+
}), d === "treeSelect" && (o.options.treeSelect.rowKey = a.option.table?.rowKey, o.options.treeSelect.nodeKey = a.option.table?.rowKey);
|
|
1894
1962
|
};
|
|
1895
|
-
|
|
1963
|
+
a.option.column.forEach(n), a.option.table?.column?.forEach(n);
|
|
1896
1964
|
},
|
|
1897
1965
|
initColumnForm: () => {
|
|
1898
|
-
const
|
|
1899
|
-
|
|
1900
|
-
const
|
|
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((f) => {
|
|
1901
1969
|
const g = {
|
|
1902
|
-
input:
|
|
1903
|
-
select:
|
|
1904
|
-
};
|
|
1905
|
-
return (
|
|
1906
|
-
}),
|
|
1907
|
-
if (
|
|
1908
|
-
|
|
1970
|
+
input: w.tCurd("placeholderInput"),
|
|
1971
|
+
select: w.tCurd("placeholderSelect")
|
|
1972
|
+
}, C = (g[te(f) || "input"] || g.input) + f.label;
|
|
1973
|
+
return (a.option.form?.error || P.error.callback)?.(f.key, f) || C;
|
|
1974
|
+
}), c = (f) => {
|
|
1975
|
+
if (f.children) {
|
|
1976
|
+
t.table.column.show.list.push(f.key), f.children.forEach((g) => c(g));
|
|
1909
1977
|
return;
|
|
1910
1978
|
}
|
|
1911
|
-
|
|
1979
|
+
t.update.formDefault[f.key] = f.value, f.table?.table && (f.show?.table && t.table.column.show.list.push(f.key), t.table.column.show.listSource.push(f.key));
|
|
1912
1980
|
};
|
|
1913
|
-
i.column.forEach((
|
|
1914
|
-
|
|
1915
|
-
}),
|
|
1916
|
-
|
|
1917
|
-
}),
|
|
1918
|
-
const
|
|
1919
|
-
maxSpan:
|
|
1920
|
-
defaultSpan:
|
|
1921
|
-
layout:
|
|
1981
|
+
i.column.forEach((f) => {
|
|
1982
|
+
me(f, !0), c(f);
|
|
1983
|
+
}), a.option.table?.column?.forEach((f) => {
|
|
1984
|
+
me(f, !1), c(f);
|
|
1985
|
+
}), t.search.column.list = i.column.concat(i.table?.column || []), t.table.column.list = t.search.column.list.filter((f) => f.table?.table), t.search.column.list.sort((f, g) => f.sort?.search - g.sort?.search), t.table.column.list.sort((f, g) => f.sort?.table - g.sort?.table), t.update.rules = {}, Te(i.column, t.update.formDefault, t.update.rules, (f) => d(f, t.update.form));
|
|
1986
|
+
const u = Ae(i.column, {
|
|
1987
|
+
maxSpan: n,
|
|
1988
|
+
defaultSpan: o,
|
|
1989
|
+
layout: a.option.form?.layout
|
|
1922
1990
|
});
|
|
1923
|
-
|
|
1924
|
-
const
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
}), i.column.forEach((
|
|
1928
|
-
|
|
1991
|
+
t.update.formGrid = u.cells, t.update.formMaxSpan = u.maxSpan, t.update.formColumn = Ue(u.cells);
|
|
1992
|
+
const m = a.option.search?.formDefault;
|
|
1993
|
+
m && Object.keys(m).forEach((f) => {
|
|
1994
|
+
t.search.formDefault[f] = m[f];
|
|
1995
|
+
}), i.column.forEach((f) => {
|
|
1996
|
+
f.show?.search || (t.search.formDefault[f.key] = void 0);
|
|
1929
1997
|
});
|
|
1930
|
-
const
|
|
1931
|
-
|
|
1998
|
+
const p = ObjectUtil.deepMerge(t.search.formDefault, {});
|
|
1999
|
+
Q.setValue(t.search.form, p, !0);
|
|
1932
2000
|
}
|
|
1933
|
-
}),
|
|
1934
|
-
const
|
|
1935
|
-
let
|
|
1936
|
-
...
|
|
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(),
|
|
1937
2005
|
option: e.option,
|
|
1938
|
-
|
|
1939
|
-
...
|
|
1940
|
-
...
|
|
1941
|
-
...
|
|
1942
|
-
...
|
|
1943
|
-
...
|
|
1944
|
-
...
|
|
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)
|
|
1945
2013
|
});
|
|
1946
|
-
return
|
|
1947
|
-
e.option.init !== !1 &&
|
|
1948
|
-
}),
|
|
1949
|
-
},
|
|
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({
|
|
1950
2018
|
__name: "switchConfirm",
|
|
1951
2019
|
props: {
|
|
1952
2020
|
size: {}
|
|
1953
2021
|
},
|
|
1954
|
-
setup(e, { expose:
|
|
1955
|
-
const l =
|
|
1956
|
-
let
|
|
1957
|
-
const
|
|
1958
|
-
|
|
1959
|
-
})),
|
|
1960
|
-
l.value = !1,
|
|
1961
|
-
},
|
|
1962
|
-
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 = (m) => (m?.title && (t.value = m.title), m?.content && (i.value = m.content), l.value = !0, new Promise((p, f) => {
|
|
2026
|
+
n = p, o = f;
|
|
2027
|
+
})), c = () => {
|
|
2028
|
+
l.value = !1, n?.(!0), n = null, o = null;
|
|
2029
|
+
}, u = () => {
|
|
2030
|
+
l.value = !1, o?.(new Error("用户取消操作")), n = null, o = null;
|
|
1963
2031
|
};
|
|
1964
|
-
return
|
|
1965
|
-
open:
|
|
1966
|
-
}), (
|
|
1967
|
-
const
|
|
1968
|
-
return
|
|
2032
|
+
return a({
|
|
2033
|
+
open: d
|
|
2034
|
+
}), (m, p) => {
|
|
2035
|
+
const f = le("el-form");
|
|
2036
|
+
return s(), h(r(ye), {
|
|
1969
2037
|
modelValue: l.value,
|
|
1970
|
-
"onUpdate:modelValue":
|
|
1971
|
-
title:
|
|
2038
|
+
"onUpdate:modelValue": p[0] || (p[0] = (g) => l.value = g),
|
|
2039
|
+
title: t.value,
|
|
1972
2040
|
"close-on-click-modal": !1,
|
|
1973
2041
|
width: "400px"
|
|
1974
2042
|
}, {
|
|
1975
|
-
footer:
|
|
1976
|
-
|
|
1977
|
-
default:
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
default:
|
|
1981
|
-
|
|
2043
|
+
footer: b(() => [
|
|
2044
|
+
D(f, { size: e.size }, {
|
|
2045
|
+
default: b(() => [
|
|
2046
|
+
M("span", At, [
|
|
2047
|
+
D(r(T), { onClick: u }, {
|
|
2048
|
+
default: b(() => [...p[1] || (p[1] = [
|
|
2049
|
+
$("取消", -1)
|
|
1982
2050
|
])]),
|
|
1983
2051
|
_: 1
|
|
1984
2052
|
}),
|
|
1985
|
-
|
|
2053
|
+
D(r(T), {
|
|
1986
2054
|
type: "primary",
|
|
1987
|
-
onClick:
|
|
2055
|
+
onClick: c
|
|
1988
2056
|
}, {
|
|
1989
|
-
default:
|
|
1990
|
-
|
|
2057
|
+
default: b(() => [...p[2] || (p[2] = [
|
|
2058
|
+
$("确认", -1)
|
|
1991
2059
|
])]),
|
|
1992
2060
|
_: 1
|
|
1993
2061
|
})
|
|
@@ -1996,27 +2064,27 @@ const xt = (e, n) => ({
|
|
|
1996
2064
|
_: 1
|
|
1997
2065
|
}, 8, ["size"])
|
|
1998
2066
|
]),
|
|
1999
|
-
default:
|
|
2000
|
-
|
|
2067
|
+
default: b(() => [
|
|
2068
|
+
M("div", null, O(i.value), 1)
|
|
2001
2069
|
]),
|
|
2002
2070
|
_: 1
|
|
2003
2071
|
}, 8, ["modelValue", "title"]);
|
|
2004
2072
|
};
|
|
2005
2073
|
}
|
|
2006
|
-
}),
|
|
2074
|
+
}), Tt = ["innerHTML"], Lt = /* @__PURE__ */ G({
|
|
2007
2075
|
__name: "text",
|
|
2008
2076
|
props: {
|
|
2009
2077
|
content: {},
|
|
2010
2078
|
value: {}
|
|
2011
2079
|
},
|
|
2012
2080
|
setup(e) {
|
|
2013
|
-
const
|
|
2014
|
-
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", {
|
|
2015
2083
|
key: 1,
|
|
2016
2084
|
innerHTML: l.value
|
|
2017
|
-
}, null, 8,
|
|
2085
|
+
}, null, 8, Tt));
|
|
2018
2086
|
}
|
|
2019
|
-
}),
|
|
2087
|
+
}), Ce = /* @__PURE__ */ G({
|
|
2020
2088
|
__name: "searchField",
|
|
2021
2089
|
props: {
|
|
2022
2090
|
item: {},
|
|
@@ -2024,168 +2092,168 @@ const xt = (e, n) => ({
|
|
|
2024
2092
|
type: {}
|
|
2025
2093
|
},
|
|
2026
2094
|
setup(e) {
|
|
2027
|
-
const
|
|
2028
|
-
get: () =>
|
|
2029
|
-
set: (
|
|
2030
|
-
|
|
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);
|
|
2031
2099
|
}
|
|
2032
2100
|
});
|
|
2033
|
-
return (
|
|
2101
|
+
return (t, i) => r(P).customComponent[e.type ?? ""]?.search ? (s(), h(X(r(P).customComponent[e.type ?? ""]?.search), k({
|
|
2034
2102
|
key: 0,
|
|
2035
2103
|
modelValue: l.value,
|
|
2036
|
-
"onUpdate:modelValue": i[0] || (i[0] = (
|
|
2037
|
-
}, e.item.options?.search?.[e.type ?? ""],
|
|
2104
|
+
"onUpdate:modelValue": i[0] || (i[0] = (n) => l.value = n)
|
|
2105
|
+
}, e.item.options?.search?.[e.type ?? ""], V(e.item.options?.search?.[e.type ?? ""]?.on || {})), null, 16, ["modelValue"])) : e.type === "input" ? (s(), h(r(_), k({
|
|
2038
2106
|
key: 1,
|
|
2039
2107
|
modelValue: l.value,
|
|
2040
|
-
"onUpdate:modelValue": i[1] || (i[1] = (
|
|
2108
|
+
"onUpdate:modelValue": i[1] || (i[1] = (n) => l.value = n),
|
|
2041
2109
|
placeholder: e.conf.search.getPlaceholder(e.item),
|
|
2042
2110
|
clearable: "",
|
|
2043
2111
|
disabled: e.item.disabled?.search
|
|
2044
|
-
}, e.item.options?.search?.input || e.item.options?.input,
|
|
2112
|
+
}, e.item.options?.search?.input || e.item.options?.input, V(e.item.options?.search?.input?.on || e.item.options?.input?.on || {})), null, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "switch" ? (s(), h(r(ne), k({
|
|
2045
2113
|
key: 2,
|
|
2046
2114
|
modelValue: l.value,
|
|
2047
|
-
"onUpdate:modelValue": i[2] || (i[2] = (
|
|
2048
|
-
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(w).tCurd("placeholderSelect")),
|
|
2049
2117
|
clearable: "",
|
|
2050
2118
|
disabled: e.item.disabled?.search
|
|
2051
|
-
}, e.item.options?.search?.switch || e.item.options?.switch,
|
|
2052
|
-
default:
|
|
2053
|
-
(
|
|
2119
|
+
}, e.item.options?.search?.switch || e.item.options?.switch, V(e.item.options?.search?.switch?.on || e.item.options?.switch?.on || {})), {
|
|
2120
|
+
default: b(() => [
|
|
2121
|
+
(s(), h(r(ee), {
|
|
2054
2122
|
key: e.item.options?.switch?.activeValue,
|
|
2055
2123
|
label: e.item.options?.switch?.activeText,
|
|
2056
2124
|
value: e.item.options?.switch?.activeValue
|
|
2057
2125
|
}, null, 8, ["label", "value"])),
|
|
2058
|
-
(
|
|
2126
|
+
(s(), h(r(ee), {
|
|
2059
2127
|
key: e.item.options?.switch?.inactiveValue,
|
|
2060
2128
|
label: e.item.options?.switch?.inactiveText,
|
|
2061
2129
|
value: e.item.options?.switch?.inactiveValue
|
|
2062
2130
|
}, null, 8, ["label", "value"]))
|
|
2063
2131
|
]),
|
|
2064
2132
|
_: 1
|
|
2065
|
-
}, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "select" ? (
|
|
2133
|
+
}, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "select" ? (s(), h(r(ne), k({
|
|
2066
2134
|
key: 3,
|
|
2067
2135
|
modelValue: l.value,
|
|
2068
|
-
"onUpdate:modelValue": i[3] || (i[3] = (
|
|
2069
|
-
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(w).tCurd("placeholderSelect")),
|
|
2070
2138
|
clearable: "",
|
|
2071
2139
|
disabled: e.item.disabled?.search
|
|
2072
|
-
}, e.item.options?.search?.select || e.item.options?.select,
|
|
2073
|
-
default:
|
|
2074
|
-
(
|
|
2075
|
-
key:
|
|
2076
|
-
label:
|
|
2077
|
-
value:
|
|
2140
|
+
}, e.item.options?.search?.select || e.item.options?.select, V(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
|
|
2078
2146
|
}, null, 8, ["label", "value"]))), 128))
|
|
2079
2147
|
]),
|
|
2080
2148
|
_: 1
|
|
2081
|
-
}, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "radio" ? (
|
|
2149
|
+
}, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "radio" ? (s(), h(r(xe), k({
|
|
2082
2150
|
key: 4,
|
|
2083
2151
|
modelValue: l.value,
|
|
2084
|
-
"onUpdate:modelValue": i[4] || (i[4] = (
|
|
2152
|
+
"onUpdate:modelValue": i[4] || (i[4] = (n) => l.value = n),
|
|
2085
2153
|
disabled: e.item.disabled?.search
|
|
2086
|
-
}, e.item.options?.search?.radio || e.item.options?.radio,
|
|
2087
|
-
default:
|
|
2088
|
-
(
|
|
2089
|
-
key:
|
|
2090
|
-
label:
|
|
2091
|
-
value:
|
|
2154
|
+
}, e.item.options?.search?.radio || e.item.options?.radio, V(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
|
|
2092
2160
|
}, null, 8, ["label", "value"]))), 128))
|
|
2093
2161
|
]),
|
|
2094
2162
|
_: 1
|
|
2095
|
-
}, 16, ["modelValue", "disabled"])) : e.type === "datetime" ? (
|
|
2163
|
+
}, 16, ["modelValue", "disabled"])) : e.type === "datetime" ? (s(), h(r(Se), k({
|
|
2096
2164
|
key: 5,
|
|
2097
2165
|
modelValue: l.value,
|
|
2098
|
-
"onUpdate:modelValue": i[5] || (i[5] = (
|
|
2166
|
+
"onUpdate:modelValue": i[5] || (i[5] = (n) => l.value = n),
|
|
2099
2167
|
disabled: e.item.disabled?.search
|
|
2100
|
-
}, e.item.options?.search?.datetime || e.item.options?.datetime,
|
|
2168
|
+
}, e.item.options?.search?.datetime || e.item.options?.datetime, V(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]), k({
|
|
2101
2169
|
key: 6,
|
|
2102
2170
|
modelValue: l.value,
|
|
2103
|
-
"onUpdate:modelValue": i[6] || (i[6] = (
|
|
2104
|
-
}, 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], V(e.item.options?.search?.[e.type]?.on || e.item.options?.[e.type]?.on || {}), {
|
|
2105
2173
|
disabled: e.item.disabled?.search
|
|
2106
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
2174
|
+
}), null, 16, ["modelValue", "disabled"])) : v("", !0);
|
|
2107
2175
|
}
|
|
2108
|
-
}),
|
|
2176
|
+
}), oe = (e, a) => {
|
|
2109
2177
|
const l = e.__vccOpts || e;
|
|
2110
|
-
for (const [
|
|
2111
|
-
l[
|
|
2178
|
+
for (const [t, i] of a)
|
|
2179
|
+
l[t] = i;
|
|
2112
2180
|
return l;
|
|
2113
|
-
},
|
|
2181
|
+
}, jt = {}, Pt = {
|
|
2114
2182
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2115
2183
|
viewBox: "64 64 896 896"
|
|
2116
2184
|
};
|
|
2117
|
-
function
|
|
2118
|
-
return
|
|
2119
|
-
|
|
2185
|
+
function It(e, a) {
|
|
2186
|
+
return s(), y("svg", Pt, [...a[0] || (a[0] = [
|
|
2187
|
+
M("path", {
|
|
2120
2188
|
fill: "currentColor",
|
|
2121
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"
|
|
2122
2190
|
}, null, -1)
|
|
2123
2191
|
])]);
|
|
2124
2192
|
}
|
|
2125
|
-
const
|
|
2193
|
+
const Kt = /* @__PURE__ */ oe(jt, [["render", It]]), Ht = {}, Gt = {
|
|
2126
2194
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2127
2195
|
viewBox: "64 64 896 896"
|
|
2128
2196
|
};
|
|
2129
|
-
function
|
|
2130
|
-
return
|
|
2131
|
-
|
|
2197
|
+
function Nt(e, a) {
|
|
2198
|
+
return s(), y("svg", Gt, [...a[0] || (a[0] = [
|
|
2199
|
+
M("path", {
|
|
2132
2200
|
fill: "currentColor",
|
|
2133
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"
|
|
2134
2202
|
}, null, -1)
|
|
2135
2203
|
])]);
|
|
2136
2204
|
}
|
|
2137
|
-
const
|
|
2205
|
+
const Wt = /* @__PURE__ */ oe(Ht, [["render", Nt]]), Jt = {}, Qt = {
|
|
2138
2206
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2139
2207
|
viewBox: "0 0 1024 1024"
|
|
2140
2208
|
};
|
|
2141
|
-
function
|
|
2142
|
-
return
|
|
2143
|
-
|
|
2209
|
+
function qt(e, a) {
|
|
2210
|
+
return s(), y("svg", Qt, [...a[0] || (a[0] = [
|
|
2211
|
+
M("path", {
|
|
2144
2212
|
fill: "currentColor",
|
|
2145
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"
|
|
2146
2214
|
}, null, -1)
|
|
2147
2215
|
])]);
|
|
2148
2216
|
}
|
|
2149
|
-
const
|
|
2217
|
+
const Xt = /* @__PURE__ */ oe(Jt, [["render", qt]]), Yt = {}, Zt = {
|
|
2150
2218
|
"data-v-58697b5c": "",
|
|
2151
2219
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2152
2220
|
viewBox: "0 0 1024 1024"
|
|
2153
2221
|
};
|
|
2154
|
-
function
|
|
2155
|
-
return
|
|
2156
|
-
|
|
2222
|
+
function _t(e, a) {
|
|
2223
|
+
return s(), y("svg", Zt, [...a[0] || (a[0] = [
|
|
2224
|
+
M("path", {
|
|
2157
2225
|
fill: "currentColor",
|
|
2158
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"
|
|
2159
2227
|
}, null, -1)
|
|
2160
2228
|
])]);
|
|
2161
2229
|
}
|
|
2162
|
-
const
|
|
2230
|
+
const eo = /* @__PURE__ */ oe(Yt, [["render", _t]]), to = {}, oo = {
|
|
2163
2231
|
"data-v-58697b5c": "",
|
|
2164
2232
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2165
2233
|
viewBox: "0 0 1024 1024"
|
|
2166
2234
|
};
|
|
2167
|
-
function
|
|
2168
|
-
return
|
|
2169
|
-
|
|
2235
|
+
function ao(e, a) {
|
|
2236
|
+
return s(), y("svg", oo, [...a[0] || (a[0] = [
|
|
2237
|
+
M("path", {
|
|
2170
2238
|
fill: "currentColor",
|
|
2171
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"
|
|
2172
2240
|
}, null, -1)
|
|
2173
2241
|
])]);
|
|
2174
2242
|
}
|
|
2175
|
-
const
|
|
2243
|
+
const no = /* @__PURE__ */ oe(to, [["render", ao]]), lo = {}, io = {
|
|
2176
2244
|
"data-v-58697b5c": "",
|
|
2177
2245
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2178
2246
|
viewBox: "0 0 1024 1024"
|
|
2179
2247
|
};
|
|
2180
|
-
function
|
|
2181
|
-
return
|
|
2182
|
-
|
|
2248
|
+
function ro(e, a) {
|
|
2249
|
+
return s(), y("svg", io, [...a[0] || (a[0] = [
|
|
2250
|
+
M("path", {
|
|
2183
2251
|
fill: "currentColor",
|
|
2184
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"
|
|
2185
2253
|
}, null, -1)
|
|
2186
2254
|
])]);
|
|
2187
2255
|
}
|
|
2188
|
-
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({
|
|
2189
2257
|
__name: "tableColumn",
|
|
2190
2258
|
props: {
|
|
2191
2259
|
conf: {},
|
|
@@ -2193,206 +2261,206 @@ const to = /* @__PURE__ */ Z(Zt, [["render", eo]]), oo = { class: "row flex-cent
|
|
|
2193
2261
|
option: {}
|
|
2194
2262
|
},
|
|
2195
2263
|
setup(e) {
|
|
2196
|
-
const
|
|
2197
|
-
return (
|
|
2198
|
-
const
|
|
2199
|
-
return
|
|
2200
|
-
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
|
|
2201
2269
|
}, [
|
|
2202
|
-
e.conf.table.column.show.list.includes(
|
|
2203
|
-
|
|
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), k({
|
|
2204
2272
|
key: 0,
|
|
2205
|
-
prop:
|
|
2206
|
-
label:
|
|
2207
|
-
}, { ref_for: !0 },
|
|
2208
|
-
header:
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2273
|
+
prop: o.key,
|
|
2274
|
+
label: o.label
|
|
2275
|
+
}, { ref_for: !0 }, o.table), {
|
|
2276
|
+
header: b(() => [
|
|
2277
|
+
x(t.$slots, "table-header-" + o.key, { item: o }, () => [
|
|
2278
|
+
M("div", uo, [
|
|
2279
|
+
o.table?.header?.tooltip ? (s(), h(n, {
|
|
2212
2280
|
key: 0,
|
|
2213
2281
|
effect: "dark",
|
|
2214
2282
|
placement: "top"
|
|
2215
2283
|
}, {
|
|
2216
|
-
content:
|
|
2217
|
-
|
|
2218
|
-
innerHTML:
|
|
2219
|
-
}, null, 8,
|
|
2284
|
+
content: b(() => [
|
|
2285
|
+
M("div", {
|
|
2286
|
+
innerHTML: o.table?.header?.tooltip
|
|
2287
|
+
}, null, 8, fo)
|
|
2220
2288
|
]),
|
|
2221
|
-
default:
|
|
2222
|
-
|
|
2223
|
-
|
|
2289
|
+
default: b(() => [
|
|
2290
|
+
M("span", co, [
|
|
2291
|
+
D(eo)
|
|
2224
2292
|
])
|
|
2225
2293
|
]),
|
|
2226
2294
|
_: 2
|
|
2227
|
-
}, 1024)) :
|
|
2228
|
-
|
|
2229
|
-
|
|
2295
|
+
}, 1024)) : v("", !0),
|
|
2296
|
+
$(" " + O(o.label) + " ", 1),
|
|
2297
|
+
o.table?.header?.group !== void 0 ? (s(), y("span", {
|
|
2230
2298
|
key: 1,
|
|
2231
2299
|
class: "table-header-plus",
|
|
2232
|
-
onClick:
|
|
2300
|
+
onClick: ot(
|
|
2233
2301
|
() => {
|
|
2234
|
-
|
|
2235
|
-
|
|
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);
|
|
2236
2304
|
});
|
|
2237
2305
|
},
|
|
2238
2306
|
["stop"]
|
|
2239
2307
|
)
|
|
2240
2308
|
}, [
|
|
2241
|
-
|
|
2242
|
-
], 8,
|
|
2309
|
+
o.table.header.group ? (s(), h(no, { key: 0 })) : (s(), h(so, { key: 1 }))
|
|
2310
|
+
], 8, mo)) : v("", !0)
|
|
2243
2311
|
])
|
|
2244
2312
|
])
|
|
2245
2313
|
]),
|
|
2246
|
-
default:
|
|
2247
|
-
|
|
2248
|
-
i[0] || (i[0] =
|
|
2249
|
-
(
|
|
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)), {
|
|
2250
2318
|
conf: e.conf,
|
|
2251
|
-
columnList:
|
|
2319
|
+
columnList: o.children,
|
|
2252
2320
|
option: e.option
|
|
2253
|
-
},
|
|
2254
|
-
|
|
2255
|
-
name:
|
|
2256
|
-
fn:
|
|
2257
|
-
|
|
2321
|
+
}, J({ _: 2 }, [
|
|
2322
|
+
L(t.$slots, (c, u) => ({
|
|
2323
|
+
name: u,
|
|
2324
|
+
fn: b((m) => [
|
|
2325
|
+
x(t.$slots, u, k({ ref_for: !0 }, m || {}))
|
|
2258
2326
|
])
|
|
2259
2327
|
}))
|
|
2260
2328
|
]), 1032, ["conf", "columnList", "option"]))
|
|
2261
|
-
], 64)) : (
|
|
2262
|
-
e.option.table?.editMode ? (
|
|
2329
|
+
], 64)) : (s(), y(F, { key: 1 }, [
|
|
2330
|
+
e.option.table?.editMode ? (s(), y("div", {
|
|
2263
2331
|
key: 0,
|
|
2264
|
-
class: I(["row", ["table-edit-" +
|
|
2332
|
+
class: I(["row", ["table-edit-" + o.key]]),
|
|
2265
2333
|
style: { width: "100%" }
|
|
2266
2334
|
}, [
|
|
2267
|
-
|
|
2268
|
-
row:
|
|
2269
|
-
item:
|
|
2335
|
+
x(t.$slots, "table-edit-left-" + o.key, {
|
|
2336
|
+
row: d,
|
|
2337
|
+
item: o
|
|
2270
2338
|
}),
|
|
2271
|
-
|
|
2339
|
+
o.type === "input" ? (s(), h(r(_), k({
|
|
2272
2340
|
key: 0,
|
|
2273
|
-
modelValue:
|
|
2274
|
-
"onUpdate:modelValue": (
|
|
2275
|
-
disabled: e.conf.update.getDisabled(
|
|
2341
|
+
modelValue: d[o.key],
|
|
2342
|
+
"onUpdate:modelValue": (c) => d[o.key] = c,
|
|
2343
|
+
disabled: e.conf.update.getDisabled(o, !0),
|
|
2276
2344
|
class: "col"
|
|
2277
|
-
}, { ref_for: !0 }, e.conf.update.getBind(
|
|
2278
|
-
|
|
2345
|
+
}, { ref_for: !0 }, e.conf.update.getBind(o), V(e.conf.update.getOn(o, d))), J({ _: 2 }, [
|
|
2346
|
+
o.options?.input?.prepend ? {
|
|
2279
2347
|
name: "prepend",
|
|
2280
|
-
fn:
|
|
2281
|
-
|
|
2348
|
+
fn: b(() => [
|
|
2349
|
+
$(O(typeof o.options?.input?.prepend == "function" ? o.options?.input?.prepend(d) : o.options?.input?.prepend), 1)
|
|
2282
2350
|
]),
|
|
2283
2351
|
key: "0"
|
|
2284
2352
|
} : void 0
|
|
2285
|
-
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
2353
|
+
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.type === "select" ? (s(), h(r(ne), k({
|
|
2286
2354
|
key: 1,
|
|
2287
|
-
modelValue:
|
|
2288
|
-
"onUpdate:modelValue": (
|
|
2289
|
-
disabled: e.conf.update.getDisabled(
|
|
2355
|
+
modelValue: d[o.key],
|
|
2356
|
+
"onUpdate:modelValue": (c) => d[o.key] = c,
|
|
2357
|
+
disabled: e.conf.update.getDisabled(o, !0),
|
|
2290
2358
|
class: "col"
|
|
2291
|
-
}, { ref_for: !0 }, e.conf.update.getBind(
|
|
2292
|
-
default:
|
|
2293
|
-
(
|
|
2294
|
-
key:
|
|
2295
|
-
label:
|
|
2296
|
-
value:
|
|
2359
|
+
}, { ref_for: !0 }, e.conf.update.getBind(o), V(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, (c) => (s(), h(r(ee), {
|
|
2362
|
+
key: c.value,
|
|
2363
|
+
label: c.label,
|
|
2364
|
+
value: c.value
|
|
2297
2365
|
}, null, 8, ["label", "value"]))), 128))
|
|
2298
2366
|
]),
|
|
2299
2367
|
_: 2
|
|
2300
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
2368
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.type === "switch" ? (s(), h(r(se), k({
|
|
2301
2369
|
key: 2,
|
|
2302
|
-
modelValue:
|
|
2303
|
-
"onUpdate:modelValue": (
|
|
2304
|
-
disabled: e.conf.update.getDisabled(
|
|
2370
|
+
modelValue: d[o.key],
|
|
2371
|
+
"onUpdate:modelValue": (c) => d[o.key] = c,
|
|
2372
|
+
disabled: e.conf.update.getDisabled(o, !0),
|
|
2305
2373
|
class: "col"
|
|
2306
|
-
}, { ref_for: !0 }, e.conf.update.getBind(
|
|
2307
|
-
|
|
2308
|
-
row:
|
|
2309
|
-
item:
|
|
2374
|
+
}, { ref_for: !0 }, e.conf.update.getBind(o), V(e.conf.update.getOn(o, d))), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : v("", !0),
|
|
2375
|
+
x(t.$slots, "table-edit-right-" + o.key, {
|
|
2376
|
+
row: d,
|
|
2377
|
+
item: o
|
|
2310
2378
|
})
|
|
2311
|
-
], 2)) : (
|
|
2312
|
-
e.conf.update.type === r(
|
|
2313
|
-
|
|
2379
|
+
], 2)) : (s(), y(F, { key: 1 }, [
|
|
2380
|
+
e.conf.update.type === r(z).EDialog.Update && r(a)(o.show?.form, e.conf.update.form, r(z).EDialog.Update) && e.option.table?.inlineEdit && e.conf.update.form[e.option.table?.rowKey] === d[e.option.table?.rowKey] && (o.type === "input" || o.type === "select") ? (s(), y(F, { key: 0 }, [
|
|
2381
|
+
o.type === "input" ? (s(), h(r(_), k({
|
|
2314
2382
|
key: 0,
|
|
2315
|
-
modelValue: e.conf.update.form[
|
|
2316
|
-
"onUpdate:modelValue": (
|
|
2317
|
-
disabled: e.conf.update.getDisabled(
|
|
2318
|
-
}, { ref_for: !0 }, e.conf.update.getBind(
|
|
2319
|
-
|
|
2383
|
+
modelValue: e.conf.update.form[o.key],
|
|
2384
|
+
"onUpdate:modelValue": (c) => e.conf.update.form[o.key] = c,
|
|
2385
|
+
disabled: e.conf.update.getDisabled(o, !0)
|
|
2386
|
+
}, { ref_for: !0 }, e.conf.update.getBind(o), V(e.conf.update.getOn(o, d)), { style: { width: "100%" } }), J({ _: 2 }, [
|
|
2387
|
+
o.options?.input?.prepend ? {
|
|
2320
2388
|
name: "prepend",
|
|
2321
|
-
fn:
|
|
2322
|
-
|
|
2389
|
+
fn: b(() => [
|
|
2390
|
+
$(O(typeof o.options?.input?.prepend == "function" ? o.options?.input?.prepend(d) : o.options?.input?.prepend), 1)
|
|
2323
2391
|
]),
|
|
2324
2392
|
key: "0"
|
|
2325
2393
|
} : void 0
|
|
2326
|
-
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
2394
|
+
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.type === "select" ? (s(), h(r(ne), k({
|
|
2327
2395
|
key: 1,
|
|
2328
|
-
modelValue: e.conf.update.form[
|
|
2329
|
-
"onUpdate:modelValue": (
|
|
2330
|
-
disabled: e.conf.update.getDisabled(
|
|
2331
|
-
}, { ref_for: !0 }, e.conf.update.getBind(
|
|
2332
|
-
default:
|
|
2333
|
-
(
|
|
2334
|
-
key:
|
|
2335
|
-
label:
|
|
2336
|
-
value:
|
|
2396
|
+
modelValue: e.conf.update.form[o.key],
|
|
2397
|
+
"onUpdate:modelValue": (c) => e.conf.update.form[o.key] = c,
|
|
2398
|
+
disabled: e.conf.update.getDisabled(o, !0)
|
|
2399
|
+
}, { ref_for: !0 }, e.conf.update.getBind(o), V(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, (c) => (s(), h(r(ee), {
|
|
2402
|
+
key: c.value,
|
|
2403
|
+
label: c.label,
|
|
2404
|
+
value: c.value
|
|
2337
2405
|
}, null, 8, ["label", "value"]))), 128))
|
|
2338
2406
|
]),
|
|
2339
2407
|
_: 2
|
|
2340
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
2408
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.type === "switch" ? (s(), h(r(se), k({
|
|
2341
2409
|
key: 2,
|
|
2342
|
-
modelValue: e.conf.update.form[
|
|
2343
|
-
"onUpdate:modelValue": (
|
|
2344
|
-
}, { ref_for: !0 }, e.conf.update.getBind(
|
|
2345
|
-
disabled: e.conf.update.getDisabled(
|
|
2346
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
2347
|
-
], 64)) :
|
|
2410
|
+
modelValue: e.conf.update.form[o.key],
|
|
2411
|
+
"onUpdate:modelValue": (c) => e.conf.update.form[o.key] = c
|
|
2412
|
+
}, { ref_for: !0 }, e.conf.update.getBind(o), V(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)) : x(t.$slots, "table-" + o.key, {
|
|
2348
2416
|
key: 1,
|
|
2349
|
-
row:
|
|
2350
|
-
item:
|
|
2417
|
+
row: d,
|
|
2418
|
+
item: o
|
|
2351
2419
|
}, () => [
|
|
2352
|
-
r(P).customComponent[
|
|
2420
|
+
r(P).customComponent[o.type ?? ""]?.table ? (s(), h(X(r(P).customComponent[o.type ?? ""]?.table), k({
|
|
2353
2421
|
key: 0,
|
|
2354
|
-
modelValue:
|
|
2355
|
-
"onUpdate:modelValue": (
|
|
2356
|
-
}, { ref_for: !0 },
|
|
2357
|
-
|
|
2422
|
+
modelValue: d[o.key],
|
|
2423
|
+
"onUpdate:modelValue": (c) => d[o.key] = c
|
|
2424
|
+
}, { ref_for: !0 }, o.options?.[o.type ?? ""], V(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), k({
|
|
2358
2426
|
key: 0,
|
|
2359
|
-
modelValue:
|
|
2360
|
-
"onUpdate:modelValue": (
|
|
2361
|
-
loading:
|
|
2362
|
-
"before-change": () =>
|
|
2363
|
-
}, { ref_for: !0 },
|
|
2364
|
-
], 64)) : (
|
|
2427
|
+
modelValue: d[o.key],
|
|
2428
|
+
"onUpdate:modelValue": (c) => d[o.key] = c,
|
|
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", {
|
|
2365
2433
|
key: 2,
|
|
2366
|
-
style:
|
|
2367
|
-
"--table-text-click-color":
|
|
2434
|
+
style: ce({
|
|
2435
|
+
"--table-text-click-color": o.table?.click?.color
|
|
2368
2436
|
}),
|
|
2369
|
-
class: I({ "table-text-click":
|
|
2370
|
-
onClick: (
|
|
2371
|
-
innerHTML:
|
|
2372
|
-
}, null, 14,
|
|
2437
|
+
class: I({ "table-text-click": o.table?.click?.callback }),
|
|
2438
|
+
onClick: (c) => o.table?.click?.callback?.(d),
|
|
2439
|
+
innerHTML: o.table?.format ? o.table?.format(d) : d[o.key]
|
|
2440
|
+
}, null, 14, ho))
|
|
2373
2441
|
])
|
|
2374
2442
|
], 64))
|
|
2375
2443
|
], 64))
|
|
2376
2444
|
]),
|
|
2377
2445
|
_: 2
|
|
2378
|
-
}, 1040, ["prop", "label"])) :
|
|
2379
|
-
], 64)) :
|
|
2446
|
+
}, 1040, ["prop", "label"])) : v("", !0)
|
|
2447
|
+
], 64)) : v("", !0)
|
|
2380
2448
|
], 64))), 128);
|
|
2381
2449
|
};
|
|
2382
2450
|
}
|
|
2383
|
-
}),
|
|
2451
|
+
}), yo = {
|
|
2384
2452
|
key: 0,
|
|
2385
2453
|
class: "relative curd-search fit-width"
|
|
2386
|
-
},
|
|
2454
|
+
}, po = { class: "mb-10 flex justify-between items-center fit-width" }, wo = {
|
|
2387
2455
|
class: "flex items-center",
|
|
2388
2456
|
style: { gap: "10px" }
|
|
2389
|
-
},
|
|
2457
|
+
}, ko = { key: 0 }, vo = { key: 1 }, Co = { key: 2 }, xo = { class: "export-btn" }, Vo = {
|
|
2390
2458
|
key: 1,
|
|
2391
2459
|
class: "export-btn"
|
|
2392
|
-
},
|
|
2460
|
+
}, So = {
|
|
2393
2461
|
class: "flex items-center table-tools-right",
|
|
2394
2462
|
style: { gap: "10px" }
|
|
2395
|
-
},
|
|
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({
|
|
2396
2464
|
__name: "index",
|
|
2397
2465
|
props: {
|
|
2398
2466
|
/**
|
|
@@ -2414,278 +2482,278 @@ const to = /* @__PURE__ */ Z(Zt, [["render", eo]]), oo = { class: "row flex-cent
|
|
|
2414
2482
|
default: void 0
|
|
2415
2483
|
}
|
|
2416
2484
|
},
|
|
2417
|
-
setup(e, { expose:
|
|
2418
|
-
const l =
|
|
2419
|
-
return
|
|
2420
|
-
conf:
|
|
2421
|
-
}), (
|
|
2422
|
-
const
|
|
2423
|
-
return
|
|
2485
|
+
setup(e, { expose: a }) {
|
|
2486
|
+
const l = z.EDialog, t = e, i = z.isFun, { conf: n, switchConfirmRef: o, ruleFormRef: d, tableRef: c } = Bt(t);
|
|
2487
|
+
return a({
|
|
2488
|
+
conf: n
|
|
2489
|
+
}), (u, m) => {
|
|
2490
|
+
const p = le("el-tooltip"), f = at("loading");
|
|
2491
|
+
return s(), y("div", {
|
|
2424
2492
|
class: I(["relative cc1-form-box", [e.option.table?.fitHeight ? "col" : "no-min-height"]])
|
|
2425
2493
|
}, [
|
|
2426
|
-
|
|
2494
|
+
M("div", {
|
|
2427
2495
|
class: I(["row", [e.option.table?.fitHeight ? "absolute fit" : ""]]),
|
|
2428
2496
|
style: { overflow: "hidden" }
|
|
2429
2497
|
}, [
|
|
2430
|
-
|
|
2431
|
-
|
|
2498
|
+
x(u.$slots, "box-left"),
|
|
2499
|
+
M("div", {
|
|
2432
2500
|
class: I(["column fit-width no-wrap", [e.option.table?.fitHeight ? "col" : ""]])
|
|
2433
2501
|
}, [
|
|
2434
|
-
e.option.search?.show !== !1 ? (
|
|
2435
|
-
|
|
2436
|
-
model: r(
|
|
2502
|
+
e.option.search?.show !== !1 ? (s(), y("div", yo, [
|
|
2503
|
+
D(r(Y), {
|
|
2504
|
+
model: r(n).search.form,
|
|
2437
2505
|
inline: "",
|
|
2438
2506
|
size: e.option.size?.search
|
|
2439
2507
|
}, {
|
|
2440
|
-
default:
|
|
2441
|
-
|
|
2442
|
-
row: r(
|
|
2508
|
+
default: b(() => [
|
|
2509
|
+
x(u.$slots, "search-start", {
|
|
2510
|
+
row: r(n).search.form
|
|
2443
2511
|
}),
|
|
2444
|
-
(
|
|
2512
|
+
(s(!0), y(F, null, L(r(n).search.column.list, (g) => (s(), y(F, {
|
|
2445
2513
|
key: g.key
|
|
2446
2514
|
}, [
|
|
2447
|
-
|
|
2448
|
-
row: r(
|
|
2515
|
+
x(u.$slots, "search-" + g.key + "-start", {
|
|
2516
|
+
row: r(n).search.form
|
|
2449
2517
|
}),
|
|
2450
|
-
(typeof g.show?.search == "function" ? g.show?.search(r(
|
|
2518
|
+
(typeof g.show?.search == "function" ? g.show?.search(r(n).search.form) : g.show?.search) ? (s(), h(r(be), {
|
|
2451
2519
|
key: 0,
|
|
2452
2520
|
label: g.text?.search?.label ?? g.label
|
|
2453
2521
|
}, {
|
|
2454
|
-
default:
|
|
2455
|
-
|
|
2456
|
-
row: r(
|
|
2522
|
+
default: b(() => [
|
|
2523
|
+
x(u.$slots, "search-" + g.key + "-left", {
|
|
2524
|
+
row: r(n).search.form
|
|
2457
2525
|
}),
|
|
2458
|
-
|
|
2459
|
-
row: r(
|
|
2526
|
+
x(u.$slots, "search-" + g.key, {
|
|
2527
|
+
row: r(n).search.form
|
|
2460
2528
|
}, () => [
|
|
2461
|
-
g.options?.search?.type ? (
|
|
2529
|
+
g.options?.search?.type ? (s(), h(Ce, {
|
|
2462
2530
|
key: 0,
|
|
2463
2531
|
item: g,
|
|
2464
|
-
conf: r(
|
|
2532
|
+
conf: r(n),
|
|
2465
2533
|
type: g.options.search.type
|
|
2466
|
-
}, null, 8, ["item", "conf", "type"])) : (
|
|
2534
|
+
}, null, 8, ["item", "conf", "type"])) : (s(), h(Ce, {
|
|
2467
2535
|
key: 1,
|
|
2468
2536
|
item: g,
|
|
2469
|
-
conf: r(
|
|
2537
|
+
conf: r(n),
|
|
2470
2538
|
type: g.type
|
|
2471
2539
|
}, null, 8, ["item", "conf", "type"]))
|
|
2472
2540
|
]),
|
|
2473
|
-
|
|
2474
|
-
row: r(
|
|
2541
|
+
x(u.$slots, "search-" + g.key + "-right", {
|
|
2542
|
+
row: r(n).search.form
|
|
2475
2543
|
})
|
|
2476
2544
|
]),
|
|
2477
2545
|
_: 2
|
|
2478
|
-
}, 1032, ["label"])) :
|
|
2479
|
-
|
|
2480
|
-
row: r(
|
|
2546
|
+
}, 1032, ["label"])) : v("", !0),
|
|
2547
|
+
x(u.$slots, "search-" + g.key + "-end", {
|
|
2548
|
+
row: r(n).search.form
|
|
2481
2549
|
})
|
|
2482
2550
|
], 64))), 128)),
|
|
2483
|
-
|
|
2484
|
-
row: r(
|
|
2551
|
+
x(u.$slots, "search-center", {
|
|
2552
|
+
row: r(n).search.form
|
|
2485
2553
|
}),
|
|
2486
|
-
e.option.tools?.search || e.option.tools?.reset ? (
|
|
2487
|
-
default:
|
|
2488
|
-
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), {
|
|
2489
2557
|
key: 0,
|
|
2490
2558
|
type: "primary",
|
|
2491
|
-
onClick: r(
|
|
2559
|
+
onClick: r(n).search.submit
|
|
2492
2560
|
}, {
|
|
2493
|
-
default:
|
|
2494
|
-
|
|
2561
|
+
default: b(() => [
|
|
2562
|
+
$(O(r(w).tCurd("search")), 1)
|
|
2495
2563
|
]),
|
|
2496
2564
|
_: 1
|
|
2497
|
-
}, 8, ["onClick"])) :
|
|
2498
|
-
e.option.tools?.reset ? (
|
|
2565
|
+
}, 8, ["onClick"])) : v("", !0),
|
|
2566
|
+
e.option.tools?.reset ? (s(), h(r(T), {
|
|
2499
2567
|
key: 1,
|
|
2500
|
-
onClick: r(
|
|
2568
|
+
onClick: r(n).search.reset
|
|
2501
2569
|
}, {
|
|
2502
|
-
default:
|
|
2503
|
-
|
|
2570
|
+
default: b(() => [
|
|
2571
|
+
$(O(r(w).tCurd("reset")), 1)
|
|
2504
2572
|
]),
|
|
2505
2573
|
_: 1
|
|
2506
|
-
}, 8, ["onClick"])) :
|
|
2574
|
+
}, 8, ["onClick"])) : v("", !0)
|
|
2507
2575
|
]),
|
|
2508
2576
|
_: 1
|
|
2509
|
-
})) :
|
|
2510
|
-
|
|
2511
|
-
row: r(
|
|
2577
|
+
})) : v("", !0),
|
|
2578
|
+
x(u.$slots, "search-end", {
|
|
2579
|
+
row: r(n).search.form
|
|
2512
2580
|
})
|
|
2513
2581
|
]),
|
|
2514
2582
|
_: 3
|
|
2515
2583
|
}, 8, ["model", "size"])
|
|
2516
|
-
])) :
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
r(i)(e.option.tools?.add) ? (
|
|
2520
|
-
|
|
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), {
|
|
2521
2589
|
type: "primary",
|
|
2522
|
-
onClick:
|
|
2590
|
+
onClick: m[0] || (m[0] = (g) => r(n).update.open(r(l).Add)),
|
|
2523
2591
|
size: e.option.size?.search
|
|
2524
2592
|
}, {
|
|
2525
|
-
default:
|
|
2526
|
-
|
|
2593
|
+
default: b(() => [
|
|
2594
|
+
$(O(r(w).tCurd("add")), 1)
|
|
2527
2595
|
]),
|
|
2528
2596
|
_: 1
|
|
2529
2597
|
}, 8, ["size"])
|
|
2530
|
-
])) :
|
|
2531
|
-
e.option.table?.selectable && r(i)(e.option.tools?.delete) ? (
|
|
2532
|
-
|
|
2598
|
+
])) : v("", !0),
|
|
2599
|
+
e.option.table?.selectable && r(i)(e.option.tools?.delete) ? (s(), y("div", vo, [
|
|
2600
|
+
D(r(T), {
|
|
2533
2601
|
type: "danger",
|
|
2534
|
-
onClick:
|
|
2602
|
+
onClick: m[1] || (m[1] = (g) => r(n).remove.open(r(n).table.selection.list)),
|
|
2535
2603
|
size: e.option.size?.search
|
|
2536
2604
|
}, {
|
|
2537
|
-
default:
|
|
2538
|
-
|
|
2605
|
+
default: b(() => [
|
|
2606
|
+
$(O(r(w).tCurd("delete")), 1)
|
|
2539
2607
|
]),
|
|
2540
2608
|
_: 1
|
|
2541
2609
|
}, 8, ["size"])
|
|
2542
|
-
])) :
|
|
2543
|
-
e.option.tools?.expand ? (
|
|
2544
|
-
|
|
2610
|
+
])) : v("", !0),
|
|
2611
|
+
e.option.tools?.expand ? (s(), y("div", Co, [
|
|
2612
|
+
D(r(T), {
|
|
2545
2613
|
type: "warning",
|
|
2546
|
-
onClick:
|
|
2614
|
+
onClick: m[2] || (m[2] = (g) => r(n).table.expand.all()),
|
|
2547
2615
|
size: e.option.size?.search
|
|
2548
2616
|
}, {
|
|
2549
|
-
default:
|
|
2550
|
-
|
|
2617
|
+
default: b(() => [
|
|
2618
|
+
$(O(r(w).tCurd("expandCollapse")), 1)
|
|
2551
2619
|
]),
|
|
2552
2620
|
_: 1
|
|
2553
2621
|
}, 8, ["size"])
|
|
2554
|
-
])) :
|
|
2555
|
-
e.option.tools?.export?.show ? (
|
|
2556
|
-
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), {
|
|
2557
2625
|
key: 0,
|
|
2558
|
-
onCommand: r(
|
|
2626
|
+
onCommand: r(n).export.click
|
|
2559
2627
|
}, {
|
|
2560
|
-
dropdown:
|
|
2561
|
-
|
|
2628
|
+
dropdown: b(() => [
|
|
2629
|
+
D(r(Ze), {
|
|
2562
2630
|
size: e.option.size?.search
|
|
2563
2631
|
}, {
|
|
2564
|
-
default:
|
|
2565
|
-
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), {
|
|
2566
2634
|
key: 0,
|
|
2567
2635
|
command: "select"
|
|
2568
2636
|
}, {
|
|
2569
|
-
default:
|
|
2570
|
-
|
|
2637
|
+
default: b(() => [
|
|
2638
|
+
$(O(r(w).tCurd("exportSelect")), 1)
|
|
2571
2639
|
]),
|
|
2572
2640
|
_: 1
|
|
2573
|
-
})) :
|
|
2574
|
-
e.option.tools?.export?.dropdown?.page ? (
|
|
2641
|
+
})) : v("", !0),
|
|
2642
|
+
e.option.tools?.export?.dropdown?.page ? (s(), h(r(he), {
|
|
2575
2643
|
key: 1,
|
|
2576
2644
|
command: "page"
|
|
2577
2645
|
}, {
|
|
2578
|
-
default:
|
|
2579
|
-
|
|
2646
|
+
default: b(() => [
|
|
2647
|
+
$(O(r(w).tCurd("exportPage")), 1)
|
|
2580
2648
|
]),
|
|
2581
2649
|
_: 1
|
|
2582
|
-
})) :
|
|
2583
|
-
e.option.tools?.export?.dropdown?.all ? (
|
|
2650
|
+
})) : v("", !0),
|
|
2651
|
+
e.option.tools?.export?.dropdown?.all ? (s(), h(r(he), {
|
|
2584
2652
|
key: 2,
|
|
2585
2653
|
command: "all"
|
|
2586
2654
|
}, {
|
|
2587
|
-
default:
|
|
2588
|
-
|
|
2655
|
+
default: b(() => [
|
|
2656
|
+
$(O(r(w).tCurd("exportAll")), 1)
|
|
2589
2657
|
]),
|
|
2590
2658
|
_: 1
|
|
2591
|
-
})) :
|
|
2659
|
+
})) : v("", !0)
|
|
2592
2660
|
]),
|
|
2593
2661
|
_: 1
|
|
2594
2662
|
}, 8, ["size"])
|
|
2595
2663
|
]),
|
|
2596
|
-
default:
|
|
2597
|
-
|
|
2598
|
-
|
|
2664
|
+
default: b(() => [
|
|
2665
|
+
M("div", xo, [
|
|
2666
|
+
D(r(T), {
|
|
2599
2667
|
type: "warning",
|
|
2600
|
-
loading: r(
|
|
2668
|
+
loading: r(n).export.loading,
|
|
2601
2669
|
size: e.option.size?.search
|
|
2602
2670
|
}, {
|
|
2603
|
-
default:
|
|
2604
|
-
|
|
2671
|
+
default: b(() => [
|
|
2672
|
+
$(O(r(w).tCurd("export")), 1)
|
|
2605
2673
|
]),
|
|
2606
2674
|
_: 1
|
|
2607
2675
|
}, 8, ["loading", "size"])
|
|
2608
2676
|
])
|
|
2609
2677
|
]),
|
|
2610
2678
|
_: 1
|
|
2611
|
-
}, 8, ["onCommand"])) : (
|
|
2612
|
-
|
|
2679
|
+
}, 8, ["onCommand"])) : (s(), y("div", Vo, [
|
|
2680
|
+
D(r(T), {
|
|
2613
2681
|
type: "warning",
|
|
2614
|
-
loading: r(
|
|
2682
|
+
loading: r(n).export.loading,
|
|
2615
2683
|
size: e.option.size?.search,
|
|
2616
|
-
onClick:
|
|
2684
|
+
onClick: m[3] || (m[3] = (g) => r(n).export.run.start("all"))
|
|
2617
2685
|
}, {
|
|
2618
|
-
default:
|
|
2619
|
-
|
|
2686
|
+
default: b(() => [
|
|
2687
|
+
$(O(r(w).tCurd("export")), 1)
|
|
2620
2688
|
]),
|
|
2621
2689
|
_: 1
|
|
2622
2690
|
}, 8, ["loading", "size"])
|
|
2623
2691
|
]))
|
|
2624
|
-
], 64)) :
|
|
2625
|
-
|
|
2692
|
+
], 64)) : v("", !0),
|
|
2693
|
+
x(u.$slots, "tools-left")
|
|
2626
2694
|
]),
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
r(
|
|
2695
|
+
M("div", So, [
|
|
2696
|
+
x(u.$slots, "tools-right"),
|
|
2697
|
+
r(n).page.showTools ? (s(), h(r(ke), k({
|
|
2630
2698
|
key: 0,
|
|
2631
|
-
"current-page": r(
|
|
2632
|
-
"onUpdate:currentPage":
|
|
2633
|
-
"page-size": r(
|
|
2634
|
-
"onUpdate:pageSize":
|
|
2699
|
+
"current-page": r(n).page.num,
|
|
2700
|
+
"onUpdate:currentPage": m[4] || (m[4] = (g) => r(n).page.num = g),
|
|
2701
|
+
"page-size": r(n).page.size,
|
|
2702
|
+
"onUpdate:pageSize": m[5] || (m[5] = (g) => r(n).page.size = g),
|
|
2635
2703
|
background: "",
|
|
2636
|
-
"page-sizes": r(
|
|
2637
|
-
"pager-count": r(
|
|
2638
|
-
layout: r(
|
|
2639
|
-
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,
|
|
2640
2708
|
size: e.option.size?.table,
|
|
2641
|
-
onSizeChange: r(
|
|
2642
|
-
onCurrentChange: r(
|
|
2643
|
-
}, e.option.page?.pagination || {},
|
|
2644
|
-
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 || {}, V(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(p, {
|
|
2645
2713
|
key: 1,
|
|
2646
2714
|
effect: "dark",
|
|
2647
|
-
content: r(
|
|
2715
|
+
content: r(n).table.header.group.expand ? r(w).tCurd("mergeColumn") : r(w).tCurd("expandColumn"),
|
|
2648
2716
|
placement: "top"
|
|
2649
2717
|
}, {
|
|
2650
|
-
default:
|
|
2651
|
-
|
|
2718
|
+
default: b(() => [
|
|
2719
|
+
M("div", {
|
|
2652
2720
|
class: I(["refresh-btn", [e.option.size?.search]]),
|
|
2653
|
-
onClick:
|
|
2654
|
-
(...g) => r(
|
|
2721
|
+
onClick: m[6] || (m[6] = //@ts-ignore
|
|
2722
|
+
(...g) => r(n).table.header.group.toggleExpandAll && r(n).table.header.group.toggleExpandAll(...g))
|
|
2655
2723
|
}, [
|
|
2656
|
-
r(
|
|
2724
|
+
r(n).table.header.group.expand ? (s(), h(Kt, { key: 0 })) : (s(), h(Wt, { key: 1 }))
|
|
2657
2725
|
], 2)
|
|
2658
2726
|
]),
|
|
2659
2727
|
_: 1
|
|
2660
|
-
}, 8, ["content"])) :
|
|
2661
|
-
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", {
|
|
2662
2730
|
key: 2,
|
|
2663
2731
|
class: I(["refresh-btn", [e.option.size?.search]]),
|
|
2664
|
-
onClick:
|
|
2665
|
-
(...g) => r(
|
|
2732
|
+
onClick: m[7] || (m[7] = //@ts-ignore
|
|
2733
|
+
(...g) => r(n).table.getList && r(n).table.getList(...g))
|
|
2666
2734
|
}, [
|
|
2667
|
-
|
|
2668
|
-
], 2)) :
|
|
2735
|
+
D(Xt)
|
|
2736
|
+
], 2)) : v("", !0)
|
|
2669
2737
|
])
|
|
2670
2738
|
]),
|
|
2671
|
-
|
|
2739
|
+
M("div", {
|
|
2672
2740
|
class: I(["fit-width relative form-box", [e.option.table?.fitHeight ? "col " : "", e.option.table?.editMode ? "edit-mode" : ""]])
|
|
2673
2741
|
}, [
|
|
2674
|
-
|
|
2742
|
+
M("div", {
|
|
2675
2743
|
class: I(["column form-box-content", [e.option.table?.fitHeight ? "absolute fit" : ""]])
|
|
2676
2744
|
}, [
|
|
2677
|
-
|
|
2745
|
+
nt((s(), h(r(_e), k({
|
|
2678
2746
|
ref_key: "tableRef",
|
|
2679
|
-
ref:
|
|
2680
|
-
data: r(
|
|
2747
|
+
ref: c,
|
|
2748
|
+
data: r(n).table.data,
|
|
2681
2749
|
border: e.option.table?.border === void 0 ? !0 : e.option.table?.border,
|
|
2682
|
-
onSelectionChange: r(
|
|
2683
|
-
onSortChange: r(
|
|
2684
|
-
"expand-row-keys": r(
|
|
2685
|
-
onExpandChange: r(
|
|
2686
|
-
}, e.option.table,
|
|
2687
|
-
default:
|
|
2688
|
-
(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, V(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), k({
|
|
2689
2757
|
key: 0,
|
|
2690
2758
|
type: "selection",
|
|
2691
2759
|
width: "40",
|
|
@@ -2693,8 +2761,8 @@ const to = /* @__PURE__ */ Z(Zt, [["render", eo]]), oo = { class: "row flex-cent
|
|
|
2693
2761
|
fixed: "left",
|
|
2694
2762
|
"show-overflow-tooltip": !1,
|
|
2695
2763
|
className: "cc1-form-selectable-column"
|
|
2696
|
-
}, typeof e.option.table?.selectable == "object" ? e.option.table?.selectable : {},
|
|
2697
|
-
(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 : {}, V(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), k({
|
|
2698
2766
|
key: 1,
|
|
2699
2767
|
type: "index",
|
|
2700
2768
|
fixed: "left",
|
|
@@ -2703,20 +2771,20 @@ const to = /* @__PURE__ */ Z(Zt, [["render", eo]]), oo = { class: "row flex-cent
|
|
|
2703
2771
|
label: "#",
|
|
2704
2772
|
"show-overflow-tooltip": !1,
|
|
2705
2773
|
className: "cc1-form-index-column"
|
|
2706
|
-
}, typeof e.option.table?.index == "object" ? e.option.table?.index : {},
|
|
2707
|
-
|
|
2708
|
-
conf: r(
|
|
2709
|
-
columnList: r(
|
|
2774
|
+
}, typeof e.option.table?.index == "object" ? e.option.table?.index : {}, V(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,
|
|
2710
2778
|
option: e.option
|
|
2711
|
-
},
|
|
2712
|
-
|
|
2713
|
-
name:
|
|
2714
|
-
fn:
|
|
2715
|
-
|
|
2779
|
+
}, J({ _: 2 }, [
|
|
2780
|
+
L(u.$slots, (g, C) => ({
|
|
2781
|
+
name: C,
|
|
2782
|
+
fn: b((H) => [
|
|
2783
|
+
x(u.$slots, C, pe(we(H || {})))
|
|
2716
2784
|
])
|
|
2717
2785
|
}))
|
|
2718
2786
|
]), 1032, ["conf", "columnList", "option"]),
|
|
2719
|
-
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) || u.$slots["table-op-left"] || u.$slots["table-op-right"] ? (s(), h(r(ue), k({
|
|
2720
2788
|
key: 2,
|
|
2721
2789
|
align: "center",
|
|
2722
2790
|
fixed: "right"
|
|
@@ -2724,229 +2792,229 @@ const to = /* @__PURE__ */ Z(Zt, [["render", eo]]), oo = { class: "row flex-cent
|
|
|
2724
2792
|
width: e.option.table?.operate?.width || 120,
|
|
2725
2793
|
"show-overflow-tooltip": !1
|
|
2726
2794
|
}), {
|
|
2727
|
-
header:
|
|
2728
|
-
|
|
2729
|
-
|
|
2795
|
+
header: b(() => [
|
|
2796
|
+
x(u.$slots, "table-header-op", {}, () => [
|
|
2797
|
+
$(O(r(w).tCurd("operation")), 1)
|
|
2730
2798
|
])
|
|
2731
2799
|
]),
|
|
2732
|
-
default:
|
|
2733
|
-
|
|
2800
|
+
default: b(({ row: g }) => [
|
|
2801
|
+
D(r(Y), {
|
|
2734
2802
|
size: e.option.size?.table
|
|
2735
2803
|
}, {
|
|
2736
|
-
default:
|
|
2737
|
-
|
|
2738
|
-
r(
|
|
2739
|
-
|
|
2804
|
+
default: b(() => [
|
|
2805
|
+
x(u.$slots, "table-op-left", { row: g }),
|
|
2806
|
+
r(n).update.type === r(l).Update && e.option.table?.inlineEdit && r(n).update.form[t.option.table?.rowKey] === g[t.option.table?.rowKey] ? (s(), y(F, { key: 0 }, [
|
|
2807
|
+
D(r(T), {
|
|
2740
2808
|
link: "",
|
|
2741
2809
|
type: "info",
|
|
2742
|
-
onClick: r(
|
|
2810
|
+
onClick: r(n).update.close
|
|
2743
2811
|
}, {
|
|
2744
|
-
default:
|
|
2745
|
-
|
|
2812
|
+
default: b(() => [
|
|
2813
|
+
$(O(r(w).tCurd("cancel")), 1)
|
|
2746
2814
|
]),
|
|
2747
2815
|
_: 1
|
|
2748
2816
|
}, 8, ["onClick"]),
|
|
2749
|
-
|
|
2817
|
+
D(r(T), {
|
|
2750
2818
|
link: "",
|
|
2751
2819
|
type: "primary",
|
|
2752
|
-
onClick: r(
|
|
2753
|
-
loading: r(
|
|
2820
|
+
onClick: r(n).update.submit,
|
|
2821
|
+
loading: r(n).update.loading
|
|
2754
2822
|
}, {
|
|
2755
|
-
default:
|
|
2756
|
-
|
|
2823
|
+
default: b(() => [
|
|
2824
|
+
$(O(r(w).tCurd("confirm")), 1)
|
|
2757
2825
|
]),
|
|
2758
2826
|
_: 1
|
|
2759
2827
|
}, 8, ["onClick", "loading"]),
|
|
2760
|
-
|
|
2761
|
-
], 64)) : (
|
|
2762
|
-
r(i)(e.option.table?.add, g) ? (
|
|
2828
|
+
x(u.$slots, "table-op-edit-right", { row: g })
|
|
2829
|
+
], 64)) : (s(), y(F, { key: 1 }, [
|
|
2830
|
+
r(i)(e.option.table?.add, g) ? (s(), h(r(T), {
|
|
2763
2831
|
key: 0,
|
|
2764
2832
|
link: "",
|
|
2765
2833
|
type: "primary",
|
|
2766
|
-
onClick: (
|
|
2834
|
+
onClick: (C) => r(n).update.open(r(l).Add, g)
|
|
2767
2835
|
}, {
|
|
2768
|
-
default:
|
|
2769
|
-
|
|
2836
|
+
default: b(() => [
|
|
2837
|
+
$(O(r(w).tCurd("add")), 1)
|
|
2770
2838
|
]),
|
|
2771
2839
|
_: 1
|
|
2772
|
-
}, 8, ["onClick"])) :
|
|
2773
|
-
r(i)(e.option.table?.view, g) ? (
|
|
2840
|
+
}, 8, ["onClick"])) : v("", !0),
|
|
2841
|
+
r(i)(e.option.table?.view, g) ? (s(), h(r(T), {
|
|
2774
2842
|
key: 1,
|
|
2775
2843
|
link: "",
|
|
2776
2844
|
type: "primary",
|
|
2777
|
-
onClick: (
|
|
2845
|
+
onClick: (C) => r(n).update.open(r(l).View, g)
|
|
2778
2846
|
}, {
|
|
2779
|
-
default:
|
|
2780
|
-
|
|
2847
|
+
default: b(() => [
|
|
2848
|
+
$(O(r(w).tCurd("view")), 1)
|
|
2781
2849
|
]),
|
|
2782
2850
|
_: 1
|
|
2783
|
-
}, 8, ["onClick"])) :
|
|
2784
|
-
r(i)(e.option.table?.update, g) ? (
|
|
2851
|
+
}, 8, ["onClick"])) : v("", !0),
|
|
2852
|
+
r(i)(e.option.table?.update, g) ? (s(), h(r(T), {
|
|
2785
2853
|
key: 2,
|
|
2786
2854
|
link: "",
|
|
2787
2855
|
type: "warning",
|
|
2788
|
-
onClick: (
|
|
2856
|
+
onClick: (C) => r(n).update.open(r(l).Update, g)
|
|
2789
2857
|
}, {
|
|
2790
|
-
default:
|
|
2791
|
-
|
|
2858
|
+
default: b(() => [
|
|
2859
|
+
$(O(r(w).tCurd("edit")), 1)
|
|
2792
2860
|
]),
|
|
2793
2861
|
_: 1
|
|
2794
|
-
}, 8, ["onClick"])) :
|
|
2795
|
-
r(i)(e.option.table?.delete, g) ? (
|
|
2862
|
+
}, 8, ["onClick"])) : v("", !0),
|
|
2863
|
+
r(i)(e.option.table?.delete, g) ? (s(), h(r(T), {
|
|
2796
2864
|
key: 3,
|
|
2797
2865
|
link: "",
|
|
2798
2866
|
type: "danger",
|
|
2799
|
-
onClick: (
|
|
2867
|
+
onClick: (C) => r(n).remove.open([g])
|
|
2800
2868
|
}, {
|
|
2801
|
-
default:
|
|
2802
|
-
|
|
2869
|
+
default: b(() => [
|
|
2870
|
+
$(O(r(w).tCurd("delete")), 1)
|
|
2803
2871
|
]),
|
|
2804
2872
|
_: 1
|
|
2805
|
-
}, 8, ["onClick"])) :
|
|
2806
|
-
|
|
2873
|
+
}, 8, ["onClick"])) : v("", !0),
|
|
2874
|
+
x(u.$slots, "table-op-right", { row: g })
|
|
2807
2875
|
], 64))
|
|
2808
2876
|
]),
|
|
2809
2877
|
_: 2
|
|
2810
2878
|
}, 1032, ["size"])
|
|
2811
2879
|
]),
|
|
2812
2880
|
_: 3
|
|
2813
|
-
}, 16, ["width"])) :
|
|
2881
|
+
}, 16, ["width"])) : v("", !0)
|
|
2814
2882
|
]),
|
|
2815
2883
|
_: 3
|
|
2816
2884
|
}, 16, ["data", "border", "onSelectionChange", "onSortChange", "expand-row-keys", "onExpandChange"])), [
|
|
2817
|
-
[
|
|
2885
|
+
[f, r(n).table.loading]
|
|
2818
2886
|
])
|
|
2819
2887
|
], 2)
|
|
2820
2888
|
], 2),
|
|
2821
|
-
|
|
2822
|
-
(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), k({
|
|
2823
2891
|
key: 0,
|
|
2824
|
-
"current-page": r(
|
|
2825
|
-
"onUpdate:currentPage":
|
|
2826
|
-
"page-size": r(
|
|
2827
|
-
"onUpdate:pageSize":
|
|
2892
|
+
"current-page": r(n).page.num,
|
|
2893
|
+
"onUpdate:currentPage": m[8] || (m[8] = (g) => r(n).page.num = g),
|
|
2894
|
+
"page-size": r(n).page.size,
|
|
2895
|
+
"onUpdate:pageSize": m[9] || (m[9] = (g) => r(n).page.size = g),
|
|
2828
2896
|
background: "",
|
|
2829
|
-
"page-sizes": r(
|
|
2830
|
-
"pager-count": r(
|
|
2831
|
-
layout: r(
|
|
2832
|
-
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,
|
|
2833
2901
|
size: e.option.size?.table,
|
|
2834
|
-
onSizeChange: r(
|
|
2835
|
-
onCurrentChange: r(
|
|
2836
|
-
}, e.option.page?.pagination || {},
|
|
2902
|
+
onSizeChange: r(n).table.getList,
|
|
2903
|
+
onCurrentChange: r(n).table.getList
|
|
2904
|
+
}, e.option.page?.pagination || {}, V(e.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : v("", !0)
|
|
2837
2905
|
])
|
|
2838
2906
|
], 2),
|
|
2839
|
-
|
|
2907
|
+
x(u.$slots, "box-right")
|
|
2840
2908
|
], 2),
|
|
2841
|
-
|
|
2842
|
-
modelValue: r(
|
|
2843
|
-
"onUpdate:modelValue":
|
|
2844
|
-
title: r(
|
|
2845
|
-
"before-close": r(
|
|
2909
|
+
D(r(ye), k({
|
|
2910
|
+
modelValue: r(n).update.show,
|
|
2911
|
+
"onUpdate:modelValue": m[10] || (m[10] = (g) => r(n).update.show = g),
|
|
2912
|
+
title: r(n).update.title,
|
|
2913
|
+
"before-close": r(n).update.close
|
|
2846
2914
|
}, e.option.dialog), {
|
|
2847
|
-
footer:
|
|
2848
|
-
|
|
2849
|
-
|
|
2915
|
+
footer: b(() => [
|
|
2916
|
+
M("span", $o, [
|
|
2917
|
+
D(r(Y), {
|
|
2850
2918
|
size: e.option.size?.form
|
|
2851
2919
|
}, {
|
|
2852
|
-
default:
|
|
2853
|
-
|
|
2854
|
-
row: r(
|
|
2920
|
+
default: b(() => [
|
|
2921
|
+
x(u.$slots, "dialog-footer", {
|
|
2922
|
+
row: r(n).update
|
|
2855
2923
|
}, () => [
|
|
2856
|
-
|
|
2857
|
-
onClick: r(
|
|
2924
|
+
D(r(T), {
|
|
2925
|
+
onClick: r(n).update.close
|
|
2858
2926
|
}, {
|
|
2859
|
-
default:
|
|
2860
|
-
|
|
2927
|
+
default: b(() => [
|
|
2928
|
+
$(O(r(w).tCurd("close")), 1)
|
|
2861
2929
|
]),
|
|
2862
2930
|
_: 1
|
|
2863
2931
|
}, 8, ["onClick"]),
|
|
2864
|
-
r(
|
|
2932
|
+
r(n).update.type !== r(l).View ? (s(), h(r(T), {
|
|
2865
2933
|
key: 0,
|
|
2866
2934
|
type: "primary",
|
|
2867
|
-
onClick: r(
|
|
2868
|
-
loading: r(
|
|
2935
|
+
onClick: r(n).update.submit,
|
|
2936
|
+
loading: r(n).update.loading
|
|
2869
2937
|
}, {
|
|
2870
|
-
default:
|
|
2871
|
-
|
|
2938
|
+
default: b(() => [
|
|
2939
|
+
$(O(r(w).tCurd("submit")), 1)
|
|
2872
2940
|
]),
|
|
2873
2941
|
_: 1
|
|
2874
|
-
}, 8, ["onClick", "loading"])) :
|
|
2942
|
+
}, 8, ["onClick", "loading"])) : v("", !0)
|
|
2875
2943
|
])
|
|
2876
2944
|
]),
|
|
2877
2945
|
_: 3
|
|
2878
2946
|
}, 8, ["size"])
|
|
2879
2947
|
])
|
|
2880
2948
|
]),
|
|
2881
|
-
default:
|
|
2882
|
-
|
|
2883
|
-
row: r(
|
|
2949
|
+
default: b(() => [
|
|
2950
|
+
x(u.$slots, "dialog-start", {
|
|
2951
|
+
row: r(n).update
|
|
2884
2952
|
}),
|
|
2885
|
-
|
|
2953
|
+
D(r(Y), {
|
|
2886
2954
|
ref_key: "ruleFormRef",
|
|
2887
|
-
ref:
|
|
2888
|
-
model: r(
|
|
2889
|
-
rules: r(
|
|
2955
|
+
ref: d,
|
|
2956
|
+
model: r(n).update.form,
|
|
2957
|
+
rules: r(n).update.rules,
|
|
2890
2958
|
size: e.option.size?.form,
|
|
2891
2959
|
class: "update-dialog-form"
|
|
2892
2960
|
}, {
|
|
2893
|
-
default:
|
|
2894
|
-
r(
|
|
2961
|
+
default: b(() => [
|
|
2962
|
+
r(n).update.showContent ? (s(), h(Le, {
|
|
2895
2963
|
key: 0,
|
|
2896
|
-
"form-grid": r(
|
|
2897
|
-
"max-span": r(
|
|
2898
|
-
form: r(
|
|
2899
|
-
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,
|
|
2900
2968
|
stripe: e.option.form?.stripe,
|
|
2901
2969
|
"label-width": e.option.form?.labelWidth,
|
|
2902
2970
|
"form-option": e.option.form,
|
|
2903
|
-
"get-bind": r(
|
|
2904
|
-
"get-on": r(
|
|
2905
|
-
"get-disabled": r(
|
|
2906
|
-
},
|
|
2907
|
-
|
|
2908
|
-
name:
|
|
2909
|
-
fn:
|
|
2910
|
-
|
|
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(u.$slots, (g, C) => ({
|
|
2976
|
+
name: C,
|
|
2977
|
+
fn: b((H) => [
|
|
2978
|
+
x(u.$slots, C, pe(we(H || {})))
|
|
2911
2979
|
])
|
|
2912
2980
|
}))
|
|
2913
|
-
]), 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)
|
|
2914
2982
|
]),
|
|
2915
2983
|
_: 3
|
|
2916
2984
|
}, 8, ["model", "rules", "size"]),
|
|
2917
|
-
|
|
2918
|
-
row: r(
|
|
2985
|
+
x(u.$slots, "dialog-end", {
|
|
2986
|
+
row: r(n).update
|
|
2919
2987
|
})
|
|
2920
2988
|
]),
|
|
2921
2989
|
_: 3
|
|
2922
2990
|
}, 16, ["modelValue", "title", "before-close"]),
|
|
2923
|
-
|
|
2924
|
-
modelValue: r(
|
|
2925
|
-
"onUpdate:modelValue":
|
|
2926
|
-
title: r(
|
|
2991
|
+
D(r(ye), {
|
|
2992
|
+
modelValue: r(n).remove.show,
|
|
2993
|
+
"onUpdate:modelValue": m[11] || (m[11] = (g) => r(n).remove.show = g),
|
|
2994
|
+
title: r(n).remove.title,
|
|
2927
2995
|
"close-on-click-modal": !1
|
|
2928
2996
|
}, {
|
|
2929
|
-
footer:
|
|
2930
|
-
|
|
2931
|
-
|
|
2997
|
+
footer: b(() => [
|
|
2998
|
+
M("span", Oo, [
|
|
2999
|
+
D(r(Y), {
|
|
2932
3000
|
size: e.option.size?.form
|
|
2933
3001
|
}, {
|
|
2934
|
-
default:
|
|
2935
|
-
|
|
2936
|
-
onClick: r(
|
|
3002
|
+
default: b(() => [
|
|
3003
|
+
D(r(T), {
|
|
3004
|
+
onClick: r(n).remove.close
|
|
2937
3005
|
}, {
|
|
2938
|
-
default:
|
|
2939
|
-
|
|
3006
|
+
default: b(() => [
|
|
3007
|
+
$(O(r(w).tCurd("close")), 1)
|
|
2940
3008
|
]),
|
|
2941
3009
|
_: 1
|
|
2942
3010
|
}, 8, ["onClick"]),
|
|
2943
|
-
|
|
3011
|
+
D(r(T), {
|
|
2944
3012
|
type: "danger",
|
|
2945
|
-
onClick: r(
|
|
2946
|
-
loading: r(
|
|
3013
|
+
onClick: r(n).remove.submit,
|
|
3014
|
+
loading: r(n).remove.loading
|
|
2947
3015
|
}, {
|
|
2948
|
-
default:
|
|
2949
|
-
|
|
3016
|
+
default: b(() => [
|
|
3017
|
+
$(O(r(w).tCurd("confirmDelete")), 1)
|
|
2950
3018
|
]),
|
|
2951
3019
|
_: 1
|
|
2952
3020
|
}, 8, ["onClick", "loading"])
|
|
@@ -2955,91 +3023,90 @@ const to = /* @__PURE__ */ Z(Zt, [["render", eo]]), oo = { class: "row flex-cent
|
|
|
2955
3023
|
}, 8, ["size"])
|
|
2956
3024
|
])
|
|
2957
3025
|
]),
|
|
2958
|
-
default:
|
|
2959
|
-
e.option.dialog?.delete?.content ? (
|
|
2960
|
-
|
|
3026
|
+
default: b(() => [
|
|
3027
|
+
e.option.dialog?.delete?.content ? (s(), y("div", Eo, [
|
|
3028
|
+
D(Lt, {
|
|
2961
3029
|
content: e.option.dialog?.delete?.content,
|
|
2962
|
-
value: r(
|
|
3030
|
+
value: r(n).remove.items
|
|
2963
3031
|
}, null, 8, ["content", "value"])
|
|
2964
|
-
])) : (
|
|
3032
|
+
])) : (s(), y("div", Do, O(r(w).tCurd("confirmDeleteMessage", r(n).remove.items.length)), 1))
|
|
2965
3033
|
]),
|
|
2966
3034
|
_: 1
|
|
2967
3035
|
}, 8, ["modelValue", "title"]),
|
|
2968
|
-
|
|
3036
|
+
D(Rt, {
|
|
2969
3037
|
ref_key: "switchConfirmRef",
|
|
2970
|
-
ref:
|
|
3038
|
+
ref: o,
|
|
2971
3039
|
size: e.option.size?.form
|
|
2972
3040
|
}, null, 8, ["size"])
|
|
2973
3041
|
], 2);
|
|
2974
3042
|
};
|
|
2975
3043
|
}
|
|
2976
3044
|
});
|
|
2977
|
-
class
|
|
3045
|
+
class To {
|
|
2978
3046
|
/**
|
|
2979
3047
|
* 通过远程 URL 下载文件,自动创建临时 `<a>` 标签触发浏览器下载
|
|
2980
3048
|
*
|
|
2981
3049
|
* @param href - 文件的远程地址
|
|
2982
3050
|
* @param name - 下载后的文件名,默认 `'download.png'`
|
|
2983
3051
|
*/
|
|
2984
|
-
static async download(
|
|
2985
|
-
const
|
|
2986
|
-
|
|
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);
|
|
2987
3055
|
}
|
|
2988
3056
|
/**
|
|
2989
3057
|
* 将json对象或者json数组导出为json文件保存
|
|
2990
3058
|
* @param data
|
|
2991
3059
|
* @param name
|
|
2992
3060
|
*/
|
|
2993
|
-
static exportJSONFile = (
|
|
2994
|
-
const
|
|
2995
|
-
|
|
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();
|
|
2996
3064
|
};
|
|
2997
3065
|
/**
|
|
2998
3066
|
* 导入文件内容,默认为json
|
|
2999
3067
|
* @param param
|
|
3000
3068
|
* @returns
|
|
3001
3069
|
*/
|
|
3002
|
-
static importFile = async (
|
|
3070
|
+
static importFile = async (a) => new Promise((l, t) => {
|
|
3003
3071
|
const i = document.createElement("input");
|
|
3004
3072
|
i.type = "file";
|
|
3005
|
-
const
|
|
3006
|
-
i.accept =
|
|
3007
|
-
const
|
|
3008
|
-
if (!
|
|
3009
|
-
|
|
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("未选择文件");
|
|
3010
3078
|
return;
|
|
3011
3079
|
}
|
|
3012
|
-
const
|
|
3013
|
-
|
|
3014
|
-
const
|
|
3015
|
-
l(
|
|
3016
|
-
},
|
|
3017
|
-
|
|
3018
|
-
},
|
|
3080
|
+
const c = new FileReader();
|
|
3081
|
+
c.onload = async (u) => {
|
|
3082
|
+
const m = n == ".json" ? JSON.parse(u.target.result) : u.target.result;
|
|
3083
|
+
l(m);
|
|
3084
|
+
}, c.onerror = () => {
|
|
3085
|
+
z.fail("文件读取失败"), t("文件读取失败");
|
|
3086
|
+
}, c.readAsText(d), document.body.removeChild(i);
|
|
3019
3087
|
}, document.body.appendChild(i), i.click();
|
|
3020
3088
|
});
|
|
3021
3089
|
}
|
|
3022
|
-
const
|
|
3023
|
-
if (e.component("TCurd",
|
|
3024
|
-
P.customComponent =
|
|
3025
|
-
for (const l in
|
|
3026
|
-
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]);
|
|
3027
3095
|
}
|
|
3028
|
-
},
|
|
3029
|
-
install:
|
|
3096
|
+
}, Lo = {
|
|
3097
|
+
install: Fo
|
|
3030
3098
|
};
|
|
3031
3099
|
export {
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3100
|
+
W as ArrUtil,
|
|
3101
|
+
Ot as ExcelUtil,
|
|
3102
|
+
St as TColumn,
|
|
3103
|
+
Mo as TCurd,
|
|
3104
|
+
To as TFile,
|
|
3037
3105
|
P as TForm,
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
Vo as install
|
|
3106
|
+
U as TFormConfig,
|
|
3107
|
+
w as TFormI18n,
|
|
3108
|
+
Ee as TFormList,
|
|
3109
|
+
z as TSys,
|
|
3110
|
+
Lo as default,
|
|
3111
|
+
Fo as install
|
|
3045
3112
|
};
|