cc1-form 1.1.37 → 1.1.38
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 +758 -780
- package/dist/cc1-form.umd.cjs +1 -1
- package/dist/components/TCurd/com/form/column.vue.d.ts +660 -10
- package/dist/components/TCurd/com/form/list.vue.d.ts +2 -2
- package/dist/components/TCurd/formColumn.vue.d.ts +660 -10
- package/dist/components/TCurd/index.d.ts +666 -22
- package/dist/components/TCurd/index.vue.d.ts +1748 -340
- package/dist/components/TCurd/indexType.d.ts +7 -3
- package/dist/components/TCurd/tableColumn.vue.d.ts +2 -2
- package/dist/utils/TSys.d.ts +1 -1
- package/package.json +1 -1
package/dist/cc1-form.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ElMessage as ue, ElLoading as fe, ElForm as N, ElFormItem as G, ElInput as Q, ElSwitch as ee, ElSelect as W, ElOption as
|
|
1
|
+
import { ElMessage as ue, ElLoading as fe, ElForm as N, ElFormItem as G, ElInput as Q, ElSwitch as ee, ElSelect as W, ElOption as K, ElTreeSelect as ne, ElDatePicker as te, ElDialog as Z, ElButton as F, ElTableColumn as x, ElRadioGroup as ce, ElRadio as pe, ElDropdown as me, ElDropdownMenu as he, ElDropdownItem as Y, ElPagination as le, ElTable as ge } from "element-plus";
|
|
2
2
|
import "vue-router";
|
|
3
|
-
import { defineComponent as
|
|
4
|
-
class
|
|
3
|
+
import { defineComponent as J, reactive as oe, onMounted as ie, resolveComponent as X, createElementBlock as w, createCommentVNode as C, openBlock as f, renderSlot as k, createElementVNode as O, createVNode as V, withCtx as h, createTextVNode as D, Fragment as S, renderList as L, createBlock as g, normalizeClass as I, normalizeStyle as se, ref as H, nextTick as be, unref as a, mergeProps as v, toHandlers as E, resolveDynamicComponent as q, toDisplayString as $, getCurrentInstance as ye, createSlots as _, resolveDirective as we, withDirectives as ke, normalizeProps as Ce, guardReactiveProps as ve } from "vue";
|
|
4
|
+
class U {
|
|
5
5
|
/**
|
|
6
6
|
* Vue Router 实例,需在应用初始化时赋值
|
|
7
7
|
*/
|
|
@@ -15,7 +15,7 @@ class D {
|
|
|
15
15
|
*/
|
|
16
16
|
static getRouterPath = () => this.router.currentRoute.value.path;
|
|
17
17
|
static EDialog = {
|
|
18
|
-
|
|
18
|
+
Add: "Add",
|
|
19
19
|
Update: "Update",
|
|
20
20
|
View: "View",
|
|
21
21
|
Remove: "Remove"
|
|
@@ -26,13 +26,13 @@ class D {
|
|
|
26
26
|
* @param data 数据
|
|
27
27
|
* @returns 是否显示
|
|
28
28
|
*/
|
|
29
|
-
static isFun = (
|
|
29
|
+
static isFun = (t, ...d) => Array.isArray(t) ? t.some((e) => typeof e == "function" ? e(...d) : e) : typeof t == "function" ? t(...d) : t;
|
|
30
30
|
/**
|
|
31
31
|
* 获取路由参数,自动获取query、params中的参数, 哪个有就返回哪个
|
|
32
32
|
*/
|
|
33
33
|
static getRouterParams = () => {
|
|
34
|
-
const
|
|
35
|
-
return Object.keys(
|
|
34
|
+
const t = this.router.currentRoute.value.query || {}, d = this.router.currentRoute.value.params || {};
|
|
35
|
+
return Object.keys(t).length ? t : Object.keys(d).length ? d : {};
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
38
38
|
* 模块赋值
|
|
@@ -42,10 +42,10 @@ class D {
|
|
|
42
42
|
* 加载模块
|
|
43
43
|
* @param module
|
|
44
44
|
*/
|
|
45
|
-
static loadModule = async (
|
|
46
|
-
if (!
|
|
47
|
-
throw new Error(`模块${
|
|
48
|
-
const d = await
|
|
45
|
+
static loadModule = async (t) => {
|
|
46
|
+
if (!U.moduleObj[t])
|
|
47
|
+
throw new Error(`模块${t}未加载,请赋值如:TSys.moduleObj = { ${t}: ()=>import('${t}') }`);
|
|
48
|
+
const d = await U.moduleObj[t]();
|
|
49
49
|
return d.default ?? d;
|
|
50
50
|
};
|
|
51
51
|
/**
|
|
@@ -62,19 +62,19 @@ class D {
|
|
|
62
62
|
* @param type 消息类型
|
|
63
63
|
* @param options 其他选项
|
|
64
64
|
*/
|
|
65
|
-
static showMessage(
|
|
66
|
-
const
|
|
67
|
-
if (!this.tipMessages[
|
|
68
|
-
this.tipMessages[
|
|
69
|
-
const
|
|
65
|
+
static showMessage(t, d, e = {}) {
|
|
66
|
+
const n = Date.now();
|
|
67
|
+
if (!this.tipMessages[t] || n - this.tipMessages[t] > this.tipMessagesGap) {
|
|
68
|
+
this.tipMessages[t] = n;
|
|
69
|
+
const o = Object.assign(
|
|
70
70
|
{
|
|
71
|
-
message:
|
|
71
|
+
message: t,
|
|
72
72
|
type: d
|
|
73
73
|
},
|
|
74
74
|
e
|
|
75
75
|
);
|
|
76
|
-
ue(
|
|
77
|
-
delete this.tipMessages[
|
|
76
|
+
ue(o), setTimeout(() => {
|
|
77
|
+
delete this.tipMessages[t];
|
|
78
78
|
}, this.tipMessagesGap);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -83,16 +83,16 @@ class D {
|
|
|
83
83
|
* @param content
|
|
84
84
|
* @param options
|
|
85
85
|
*/
|
|
86
|
-
static fail = (
|
|
87
|
-
this.showMessage(
|
|
86
|
+
static fail = (t, d = {}) => {
|
|
87
|
+
this.showMessage(t, "error", d);
|
|
88
88
|
};
|
|
89
89
|
/**
|
|
90
90
|
* 成功提示
|
|
91
91
|
* @param content
|
|
92
92
|
* @param options
|
|
93
93
|
*/
|
|
94
|
-
static success = (
|
|
95
|
-
this.showMessage(
|
|
94
|
+
static success = (t, d = {}) => {
|
|
95
|
+
this.showMessage(t, "success", d);
|
|
96
96
|
};
|
|
97
97
|
static loadingObj = null;
|
|
98
98
|
static loadingTimer = null;
|
|
@@ -101,9 +101,9 @@ class D {
|
|
|
101
101
|
* @param show
|
|
102
102
|
* @param text
|
|
103
103
|
*/
|
|
104
|
-
static loading = (
|
|
104
|
+
static loading = (t = !0, d = "Loading...") => {
|
|
105
105
|
Timer.un(this.loadingTimer), this.loadingTimer = Timer.once(() => {
|
|
106
|
-
|
|
106
|
+
t ? this.loadingObj = fe.service({
|
|
107
107
|
lock: !0,
|
|
108
108
|
text: d,
|
|
109
109
|
background: "rgba(0, 0, 0, 0.3)"
|
|
@@ -115,42 +115,42 @@ class D {
|
|
|
115
115
|
* @param url 地址
|
|
116
116
|
* @param isCenter 是否居中
|
|
117
117
|
*/
|
|
118
|
-
static openUrl = (
|
|
118
|
+
static openUrl = (t, d = !0) => {
|
|
119
119
|
if (d) {
|
|
120
|
-
let e = screen.width / 2 - 500,
|
|
120
|
+
let e = screen.width / 2 - 500, n = screen.height / 2 - 800 / 2 - 30;
|
|
121
121
|
window.open(
|
|
122
|
-
|
|
122
|
+
t,
|
|
123
123
|
"_blank",
|
|
124
|
-
"toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" +
|
|
124
|
+
"toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + n + ", left=" + e
|
|
125
125
|
);
|
|
126
126
|
} else
|
|
127
|
-
window.open(
|
|
127
|
+
window.open(t, "DescriptiveWindowName" + StrUtil.getId(), "resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0");
|
|
128
128
|
};
|
|
129
129
|
/**
|
|
130
130
|
* 根据dom id截图并返回图片数据
|
|
131
131
|
* @param param
|
|
132
132
|
* @returns
|
|
133
133
|
*/
|
|
134
|
-
static getImgPic = (
|
|
135
|
-
let
|
|
136
|
-
const
|
|
134
|
+
static getImgPic = (t) => new Promise(async (d, e) => {
|
|
135
|
+
let n = document.getElementById(t.id);
|
|
136
|
+
const o = await U.loadModule("html2canvas");
|
|
137
137
|
try {
|
|
138
|
-
|
|
138
|
+
o(n, {
|
|
139
139
|
logging: !1,
|
|
140
140
|
allowTaint: !0,
|
|
141
141
|
scale: window.devicePixelRatio,
|
|
142
|
-
width:
|
|
143
|
-
height:
|
|
144
|
-
windowWidth:
|
|
145
|
-
windowHeight:
|
|
142
|
+
width: t.windowWidth,
|
|
143
|
+
height: t.windowHeight,
|
|
144
|
+
windowWidth: t.windowWidth,
|
|
145
|
+
windowHeight: t.windowHeight,
|
|
146
146
|
useCORS: !0,
|
|
147
147
|
backgroundColor: "#ffffff00"
|
|
148
|
-
}).then(function(
|
|
149
|
-
let r =
|
|
148
|
+
}).then(function(l) {
|
|
149
|
+
let r = l.toDataURL("image/png");
|
|
150
150
|
d(r);
|
|
151
151
|
});
|
|
152
|
-
} catch (
|
|
153
|
-
e(
|
|
152
|
+
} catch (l) {
|
|
153
|
+
e(l);
|
|
154
154
|
}
|
|
155
155
|
});
|
|
156
156
|
}
|
|
@@ -489,8 +489,8 @@ class z {
|
|
|
489
489
|
*
|
|
490
490
|
* @param config - 需要覆盖的配置项(深度 Partial)
|
|
491
491
|
*/
|
|
492
|
-
static setConfig = (
|
|
493
|
-
z.config = ObjectUtil.deepMerge(z.config,
|
|
492
|
+
static setConfig = (t) => {
|
|
493
|
+
z.config = ObjectUtil.deepMerge(z.config, t);
|
|
494
494
|
};
|
|
495
495
|
}
|
|
496
496
|
class j {
|
|
@@ -511,10 +511,10 @@ class j {
|
|
|
511
511
|
* @param field - 字段的 key 值
|
|
512
512
|
* @returns 该字段对应类型的 options 配置,如 select 类型返回 `options.select`
|
|
513
513
|
*/
|
|
514
|
-
static findOptions = (
|
|
515
|
-
const e =
|
|
514
|
+
static findOptions = (t, d) => {
|
|
515
|
+
const e = t.column.find((o) => o.key === d), n = (o) => o.replace(/-([a-z])/g, (l, r) => r.toUpperCase());
|
|
516
516
|
if (e)
|
|
517
|
-
return e.options[
|
|
517
|
+
return e.options[n(e.type)];
|
|
518
518
|
};
|
|
519
519
|
/**
|
|
520
520
|
* 更新组件数据
|
|
@@ -532,9 +532,9 @@ class j {
|
|
|
532
532
|
}))
|
|
533
533
|
)
|
|
534
534
|
*/
|
|
535
|
-
static setOptionsData = (
|
|
536
|
-
const
|
|
537
|
-
|
|
535
|
+
static setOptionsData = (t, d, e) => {
|
|
536
|
+
const n = j.findOptions(t, d);
|
|
537
|
+
n && (n.data = e);
|
|
538
538
|
};
|
|
539
539
|
static form = {
|
|
540
540
|
openBefore: {
|
|
@@ -545,9 +545,9 @@ class j {
|
|
|
545
545
|
* @param treeData 树形数据
|
|
546
546
|
* @param option 组件配置
|
|
547
547
|
*/
|
|
548
|
-
parentId: (
|
|
549
|
-
const
|
|
550
|
-
|
|
548
|
+
parentId: (t, d, e, n) => {
|
|
549
|
+
const o = z.config.table.rowKey;
|
|
550
|
+
t ? d.type === U.EDialog.Add ? (d.form.parentId = t[o], d.form.sort = t.children.length + 1) : d.form.parentId = t.parentId.substring(t.parentId.lastIndexOf(",") + 1) : (d.form.parentId = "0", d.form.sort = e.length + 1), j.setOptionsData(n, "parentId", [{ [o]: "0", title: "根", children: e }]);
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
553
|
};
|
|
@@ -562,14 +562,14 @@ class P {
|
|
|
562
562
|
* @param field 字段名
|
|
563
563
|
* @param row 行数据
|
|
564
564
|
*/
|
|
565
|
-
static setId = (
|
|
566
|
-
d[
|
|
567
|
-
const
|
|
568
|
-
d[
|
|
569
|
-
e.forEach((
|
|
570
|
-
let r =
|
|
571
|
-
|
|
572
|
-
}),
|
|
565
|
+
static setId = (t, d, e) => {
|
|
566
|
+
d[t] || (d[t] = []);
|
|
567
|
+
const n = z.config.table.rowKey;
|
|
568
|
+
d[t].forEach((o) => {
|
|
569
|
+
e.forEach((l) => {
|
|
570
|
+
let r = l.default ?? "";
|
|
571
|
+
l.type === "number" && (r = l.default ?? 0), l.type === "boolean" && (r = l.default ?? !1), l.type === "time" && (r = l.default ?? /* @__PURE__ */ new Date()), o[l.value] === void 0 && (o[l.value] = r);
|
|
572
|
+
}), o[n] || (o[n] = P.getIdFun());
|
|
573
573
|
});
|
|
574
574
|
};
|
|
575
575
|
/**
|
|
@@ -579,19 +579,19 @@ class P {
|
|
|
579
579
|
* @param itemFields 元素字段-如:[{label:'',value:''}]
|
|
580
580
|
* @param callback 回调函数
|
|
581
581
|
*/
|
|
582
|
-
static add = (
|
|
583
|
-
const
|
|
584
|
-
P.setId(
|
|
585
|
-
const
|
|
586
|
-
d[
|
|
587
|
-
|
|
582
|
+
static add = (t, d, e, n) => {
|
|
583
|
+
const o = JSONUtil.cp(e);
|
|
584
|
+
P.setId(t, d, e);
|
|
585
|
+
const l = z.config.table.rowKey;
|
|
586
|
+
d[t].push(
|
|
587
|
+
o.reduce(
|
|
588
588
|
(r, c) => {
|
|
589
589
|
let m = c.default ?? "";
|
|
590
590
|
return c.type === "number" && (m = c.default ?? 0), c.type === "boolean" && (m = c.default ?? !1), c.type === "time" && (m = c.default ?? /* @__PURE__ */ new Date()), r[c.value] = m, r;
|
|
591
591
|
},
|
|
592
|
-
{ [
|
|
592
|
+
{ [l]: P.getIdFun() }
|
|
593
593
|
)
|
|
594
|
-
),
|
|
594
|
+
), n?.(d);
|
|
595
595
|
};
|
|
596
596
|
/**
|
|
597
597
|
* 删除数组元素
|
|
@@ -600,9 +600,9 @@ class P {
|
|
|
600
600
|
* @param item 元素-如:{_id:''}
|
|
601
601
|
* @param callback 回调函数
|
|
602
602
|
*/
|
|
603
|
-
static remove = (
|
|
604
|
-
const
|
|
605
|
-
d[
|
|
603
|
+
static remove = (t, d, e, n) => {
|
|
604
|
+
const o = z.config.table.rowKey;
|
|
605
|
+
d[t] = d[t].filter((l) => l[o] !== e[o]), n?.(d);
|
|
606
606
|
};
|
|
607
607
|
/**
|
|
608
608
|
* 获取没有id的数据
|
|
@@ -610,21 +610,21 @@ class P {
|
|
|
610
610
|
* @param childernField 子级字段-如:list、children
|
|
611
611
|
* @returns 没有id的数据
|
|
612
612
|
*/
|
|
613
|
-
static getNoIdData = (
|
|
614
|
-
const e = JSONUtil.cp(
|
|
615
|
-
return e.forEach((
|
|
616
|
-
|
|
613
|
+
static getNoIdData = (t, d) => {
|
|
614
|
+
const e = JSONUtil.cp(t), n = z.config.table.rowKey;
|
|
615
|
+
return e.forEach((o) => {
|
|
616
|
+
o[n] && delete o[n], d && o[d] && P.getNoIdData(o[d], d);
|
|
617
617
|
}), e;
|
|
618
618
|
};
|
|
619
619
|
}
|
|
620
|
-
const
|
|
620
|
+
const Ve = {
|
|
621
621
|
key: 0,
|
|
622
622
|
class: "column",
|
|
623
623
|
style: { width: "100%", gap: "10px" }
|
|
624
|
-
},
|
|
624
|
+
}, ze = {
|
|
625
625
|
class: "row items-center",
|
|
626
626
|
style: { gap: "10px", width: "100%" }
|
|
627
|
-
},
|
|
627
|
+
}, ae = /* @__PURE__ */ J({
|
|
628
628
|
__name: "list",
|
|
629
629
|
props: {
|
|
630
630
|
row: {
|
|
@@ -659,73 +659,73 @@ const ze = {
|
|
|
659
659
|
}
|
|
660
660
|
},
|
|
661
661
|
emits: ["change"],
|
|
662
|
-
setup(
|
|
663
|
-
const d =
|
|
662
|
+
setup(i, { emit: t }) {
|
|
663
|
+
const d = i, e = oe({
|
|
664
664
|
show: !1,
|
|
665
|
-
add: (
|
|
666
|
-
P.add(
|
|
667
|
-
|
|
665
|
+
add: (o, l, r) => {
|
|
666
|
+
P.add(o, l, r, () => {
|
|
667
|
+
n("change");
|
|
668
668
|
});
|
|
669
669
|
},
|
|
670
|
-
remove: (
|
|
671
|
-
P.remove(
|
|
672
|
-
|
|
670
|
+
remove: (o, l, r) => {
|
|
671
|
+
P.remove(o, l, r, () => {
|
|
672
|
+
n("change");
|
|
673
673
|
});
|
|
674
674
|
}
|
|
675
675
|
});
|
|
676
|
-
|
|
676
|
+
ie(() => {
|
|
677
677
|
P.setId(d.field, d.row, d.itemFields), e.show = !0;
|
|
678
678
|
});
|
|
679
|
-
const
|
|
680
|
-
return (
|
|
679
|
+
const n = t;
|
|
680
|
+
return (o, l) => {
|
|
681
681
|
const r = X("el-button"), c = X("el-input");
|
|
682
|
-
return e.show ? (f(), w("div",
|
|
683
|
-
k(
|
|
682
|
+
return e.show ? (f(), w("div", Ve, [
|
|
683
|
+
k(o.$slots, "list-start", { row: i.row }),
|
|
684
684
|
O("div", null, [
|
|
685
685
|
V(r, {
|
|
686
686
|
link: "",
|
|
687
687
|
type: "primary",
|
|
688
|
-
onClick:
|
|
688
|
+
onClick: l[0] || (l[0] = (m) => e.add(i.field, i.row, i.itemFields))
|
|
689
689
|
}, {
|
|
690
|
-
default: h(() =>
|
|
691
|
-
|
|
690
|
+
default: h(() => l[2] || (l[2] = [
|
|
691
|
+
D("添加")
|
|
692
692
|
])),
|
|
693
693
|
_: 1
|
|
694
694
|
})
|
|
695
695
|
]),
|
|
696
|
-
(f(!0), w(S, null, L(
|
|
697
|
-
k(
|
|
696
|
+
(f(!0), w(S, null, L(i.row[i.field], (m) => (f(), w("div", ze, [
|
|
697
|
+
k(o.$slots, "item-start", {
|
|
698
698
|
item: m,
|
|
699
|
-
row:
|
|
699
|
+
row: i.row
|
|
700
700
|
}),
|
|
701
|
-
(f(!0), w(S, null, L(
|
|
701
|
+
(f(!0), w(S, null, L(i.itemFields, (u) => (f(), g(c, {
|
|
702
702
|
modelValue: m[u.value],
|
|
703
703
|
"onUpdate:modelValue": (s) => m[u.value] = s,
|
|
704
|
-
style: se({ width:
|
|
705
|
-
class:
|
|
706
|
-
placeholder: u[
|
|
707
|
-
onChange:
|
|
704
|
+
style: se({ width: i.inputWidth }),
|
|
705
|
+
class: I(i.inputClass),
|
|
706
|
+
placeholder: u[i.label] || u[i.value],
|
|
707
|
+
onChange: l[1] || (l[1] = (s) => n("change"))
|
|
708
708
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "style", "class", "placeholder"]))), 256)),
|
|
709
|
-
k(
|
|
709
|
+
k(o.$slots, "item-end", {
|
|
710
710
|
item: m,
|
|
711
|
-
row:
|
|
711
|
+
row: i.row
|
|
712
712
|
}),
|
|
713
713
|
V(r, {
|
|
714
714
|
link: "",
|
|
715
715
|
type: "danger",
|
|
716
|
-
onClick: (u) => e.remove(
|
|
716
|
+
onClick: (u) => e.remove(i.field, i.row, m)
|
|
717
717
|
}, {
|
|
718
|
-
default: h(() =>
|
|
719
|
-
|
|
718
|
+
default: h(() => l[3] || (l[3] = [
|
|
719
|
+
D("删除")
|
|
720
720
|
])),
|
|
721
721
|
_: 2
|
|
722
722
|
}, 1032, ["onClick"])
|
|
723
723
|
]))), 256)),
|
|
724
|
-
k(
|
|
724
|
+
k(o.$slots, "list-end", { row: i.row })
|
|
725
725
|
])) : C("", !0);
|
|
726
726
|
};
|
|
727
727
|
}
|
|
728
|
-
}), De = { class: "row curd-row" },
|
|
728
|
+
}), De = { class: "row curd-row" }, Ee = /* @__PURE__ */ J({
|
|
729
729
|
__name: "column",
|
|
730
730
|
props: {
|
|
731
731
|
/**
|
|
@@ -741,133 +741,133 @@ const ze = {
|
|
|
741
741
|
default: ""
|
|
742
742
|
}
|
|
743
743
|
},
|
|
744
|
-
setup(
|
|
745
|
-
const d =
|
|
744
|
+
setup(i, { expose: t }) {
|
|
745
|
+
const d = U.isFun, e = U.EDialog, n = H(), o = i, l = oe({
|
|
746
746
|
rules: {},
|
|
747
747
|
show: !0,
|
|
748
748
|
form: {},
|
|
749
749
|
formDefault: {},
|
|
750
750
|
formColumn: [],
|
|
751
|
-
getDisabled: (r) => r.disabled?.[(
|
|
751
|
+
getDisabled: (r) => r.disabled?.[(o.type || e.Add) === e.Add ? "create" : "update"],
|
|
752
752
|
initColumnForm: async () => {
|
|
753
|
-
const r =
|
|
754
|
-
|
|
755
|
-
const c = [], m =
|
|
753
|
+
const r = o.option;
|
|
754
|
+
l.formColumn = [];
|
|
755
|
+
const c = [], m = o.option.form?.maxSpan || 12, u = o.option.form?.defaultSpan || m;
|
|
756
756
|
let s = [];
|
|
757
757
|
const p = (y) => {
|
|
758
|
-
if (
|
|
758
|
+
if (l.formDefault[y.key] = y.value, y.isForm) {
|
|
759
759
|
y.form = y.form || { span: u }, y.form.span = y.form.span ?? u;
|
|
760
|
-
let
|
|
761
|
-
const
|
|
762
|
-
s.push({ item: y, span:
|
|
760
|
+
let T = y.form.span, A = s.reduce((B, de) => B + de.span, T);
|
|
761
|
+
const M = s.length;
|
|
762
|
+
s.push({ item: y, span: T }), (M === 1 && s[0].span === 0 || A >= m || T === 0 && M > 1) && (c.push(s), s = []), y.rules && (l.rules[y.key] = y.rules);
|
|
763
763
|
}
|
|
764
764
|
};
|
|
765
765
|
r.column.forEach((y) => {
|
|
766
766
|
y.isForm = !0, p(y);
|
|
767
|
-
}), s.length > 0 && c.push(s),
|
|
767
|
+
}), s.length > 0 && c.push(s), l.formColumn = c, l.form = JSONUtil.cp(l.formDefault);
|
|
768
768
|
},
|
|
769
769
|
init: async () => {
|
|
770
|
-
|
|
770
|
+
l.show = !1, await be(), l.initColumnForm();
|
|
771
771
|
}
|
|
772
772
|
});
|
|
773
|
-
return
|
|
774
|
-
ref:
|
|
775
|
-
conf:
|
|
776
|
-
}), (r, c) => (f(),
|
|
773
|
+
return l.initColumnForm(), t({
|
|
774
|
+
ref: n,
|
|
775
|
+
conf: l
|
|
776
|
+
}), (r, c) => (f(), g(a(N), {
|
|
777
777
|
ref_key: "ruleFormRef",
|
|
778
|
-
ref:
|
|
779
|
-
model:
|
|
780
|
-
rules:
|
|
778
|
+
ref: n,
|
|
779
|
+
model: l.form,
|
|
780
|
+
rules: l.rules
|
|
781
781
|
}, {
|
|
782
782
|
default: h(() => [
|
|
783
|
-
|
|
783
|
+
l.show ? (f(!0), w(S, { key: 0 }, L(l.formColumn, (m) => (f(), w("div", De, [
|
|
784
784
|
k(r.$slots, "form-start", {
|
|
785
|
-
row:
|
|
785
|
+
row: l.form
|
|
786
786
|
}),
|
|
787
787
|
(f(!0), w(S, null, L(m, (u) => (f(), w(S, null, [
|
|
788
|
-
|
|
788
|
+
a(d)(u.item.show?.form, l.form) ?? !0 ? (f(), w("div", {
|
|
789
789
|
key: 0,
|
|
790
|
-
class:
|
|
790
|
+
class: I(u.item.form.span > 0 ? `col-${u.item.form.span}` : "col")
|
|
791
791
|
}, [
|
|
792
|
-
V(
|
|
792
|
+
V(a(G), {
|
|
793
793
|
label: u.item.label,
|
|
794
794
|
prop: u.item.key,
|
|
795
795
|
"label-width": u.item.form?.labelWidth || "100px"
|
|
796
796
|
}, {
|
|
797
797
|
default: h(() => [
|
|
798
798
|
k(r.$slots, "form-" + u.item.key + "-start", {
|
|
799
|
-
row:
|
|
799
|
+
row: l.form,
|
|
800
800
|
item: u.item
|
|
801
801
|
}),
|
|
802
802
|
k(r.$slots, "form-" + u.item.key, {
|
|
803
|
-
row:
|
|
803
|
+
row: l.form,
|
|
804
804
|
item: u.item
|
|
805
805
|
}, () => [
|
|
806
|
-
u.item.type === "input" ? (f(),
|
|
806
|
+
u.item.type === "input" ? (f(), g(a(Q), v({
|
|
807
807
|
key: 0,
|
|
808
|
-
modelValue:
|
|
809
|
-
"onUpdate:modelValue": (s) =>
|
|
808
|
+
modelValue: l.form[u.item.key],
|
|
809
|
+
"onUpdate:modelValue": (s) => l.form[u.item.key] = s,
|
|
810
810
|
ref_for: !0
|
|
811
|
-
}, u.item.options?.input,
|
|
812
|
-
disabled:
|
|
813
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "switch" ? (f(),
|
|
811
|
+
}, u.item.options?.input, E(u.item.options?.input?.on || {}), {
|
|
812
|
+
disabled: l.getDisabled(u.item)
|
|
813
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "switch" ? (f(), g(a(ee), v({
|
|
814
814
|
key: 1,
|
|
815
|
-
modelValue:
|
|
816
|
-
"onUpdate:modelValue": (s) =>
|
|
815
|
+
modelValue: l.form[u.item.key],
|
|
816
|
+
"onUpdate:modelValue": (s) => l.form[u.item.key] = s,
|
|
817
817
|
ref_for: !0
|
|
818
|
-
}, u.item.options?.switch,
|
|
819
|
-
disabled:
|
|
820
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "select" ? (f(),
|
|
818
|
+
}, u.item.options?.switch, E(u.item.options?.switch?.on || {}), {
|
|
819
|
+
disabled: l.getDisabled(u.item)
|
|
820
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "select" ? (f(), g(a(W), v({
|
|
821
821
|
key: 2,
|
|
822
|
-
modelValue:
|
|
823
|
-
"onUpdate:modelValue": (s) =>
|
|
822
|
+
modelValue: l.form[u.item.key],
|
|
823
|
+
"onUpdate:modelValue": (s) => l.form[u.item.key] = s,
|
|
824
824
|
ref_for: !0
|
|
825
|
-
}, u.item.options?.select,
|
|
826
|
-
disabled:
|
|
825
|
+
}, u.item.options?.select, E(u.item.options?.select?.on || {}), {
|
|
826
|
+
disabled: l.getDisabled(u.item),
|
|
827
827
|
style: { width: "100%" }
|
|
828
828
|
}), {
|
|
829
829
|
default: h(() => [
|
|
830
|
-
(f(!0), w(S, null, L(u.item.options?.select?.data, (s) => (f(),
|
|
830
|
+
(f(!0), w(S, null, L(u.item.options?.select?.data, (s) => (f(), g(a(K), {
|
|
831
831
|
key: s.value,
|
|
832
832
|
label: s.label,
|
|
833
833
|
value: s.value
|
|
834
834
|
}, null, 8, ["label", "value"]))), 128))
|
|
835
835
|
]),
|
|
836
836
|
_: 2
|
|
837
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "list" ? (f(),
|
|
837
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "list" ? (f(), g(ae, v({
|
|
838
838
|
key: 3,
|
|
839
|
-
row:
|
|
839
|
+
row: l.form,
|
|
840
840
|
field: u.item.key,
|
|
841
841
|
ref_for: !0
|
|
842
|
-
}, u.item.options?.list,
|
|
843
|
-
disabled:
|
|
842
|
+
}, u.item.options?.list, E(u.item.options?.list?.on || {}), {
|
|
843
|
+
disabled: l.getDisabled(u.item),
|
|
844
844
|
style: { width: "100%" }
|
|
845
|
-
}), null, 16, ["row", "field", "disabled"])) : u.item.type === "treeSelect" ? (f(),
|
|
845
|
+
}), null, 16, ["row", "field", "disabled"])) : u.item.type === "treeSelect" ? (f(), g(a(ne), v({
|
|
846
846
|
key: 4,
|
|
847
|
-
modelValue:
|
|
848
|
-
"onUpdate:modelValue": (s) =>
|
|
847
|
+
modelValue: l.form[u.item.key],
|
|
848
|
+
"onUpdate:modelValue": (s) => l.form[u.item.key] = s,
|
|
849
849
|
ref_for: !0
|
|
850
|
-
}, u.item.options?.treeSelect,
|
|
851
|
-
disabled:
|
|
850
|
+
}, u.item.options?.treeSelect, E(u.item.options?.treeSelect?.on || {}), {
|
|
851
|
+
disabled: l.getDisabled(u.item),
|
|
852
852
|
style: { width: "100%" }
|
|
853
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "datetime" ? (f(),
|
|
853
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "datetime" ? (f(), g(a(te), v({
|
|
854
854
|
key: 5,
|
|
855
|
-
modelValue:
|
|
856
|
-
"onUpdate:modelValue": (s) =>
|
|
855
|
+
modelValue: l.form[u.item.key],
|
|
856
|
+
"onUpdate:modelValue": (s) => l.form[u.item.key] = s,
|
|
857
857
|
ref_for: !0
|
|
858
|
-
}, u.item.options?.datetime,
|
|
859
|
-
disabled:
|
|
860
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type &&
|
|
858
|
+
}, u.item.options?.datetime, E(u.item.options?.datetime?.on || {}), {
|
|
859
|
+
disabled: l.getDisabled(u.item)
|
|
860
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type && a(j).customComponent[u.item.type] ? (f(), g(q(a(j).customComponent[u.item.type]), v({
|
|
861
861
|
key: 6,
|
|
862
|
-
modelValue:
|
|
863
|
-
"onUpdate:modelValue": (s) =>
|
|
862
|
+
modelValue: l.form[u.item.key],
|
|
863
|
+
"onUpdate:modelValue": (s) => l.form[u.item.key] = s,
|
|
864
864
|
ref_for: !0
|
|
865
|
-
}, u.item.options?.[u.item.type],
|
|
866
|
-
disabled:
|
|
865
|
+
}, u.item.options?.[u.item.type], E(u.item.options?.[u.item.type]?.on || {}), {
|
|
866
|
+
disabled: l.getDisabled(u.item)
|
|
867
867
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : C("", !0)
|
|
868
868
|
]),
|
|
869
869
|
k(r.$slots, "form-" + u.item.key + "-end", {
|
|
870
|
-
row:
|
|
870
|
+
row: l.form,
|
|
871
871
|
item: u.item
|
|
872
872
|
})
|
|
873
873
|
]),
|
|
@@ -876,7 +876,7 @@ const ze = {
|
|
|
876
876
|
], 2)) : C("", !0)
|
|
877
877
|
], 64))), 256)),
|
|
878
878
|
k(r.$slots, "form-end", {
|
|
879
|
-
row:
|
|
879
|
+
row: l.form
|
|
880
880
|
})
|
|
881
881
|
]))), 256)) : C("", !0)
|
|
882
882
|
]),
|
|
@@ -884,7 +884,7 @@ const ze = {
|
|
|
884
884
|
}, 8, ["model", "rules"]));
|
|
885
885
|
}
|
|
886
886
|
});
|
|
887
|
-
const
|
|
887
|
+
const Se = {
|
|
888
888
|
search: "搜索",
|
|
889
889
|
add: "新增",
|
|
890
890
|
edit: "编辑",
|
|
@@ -917,26 +917,26 @@ const Ue = {
|
|
|
917
917
|
confirmModify: "确认修改",
|
|
918
918
|
confirmSwitchMessage: "确认要修改吗?"
|
|
919
919
|
};
|
|
920
|
-
class
|
|
920
|
+
class b {
|
|
921
921
|
/** 解析国际化值:函数则执行并返回字符串,字符串则替换 `{key}` 占位符 */
|
|
922
|
-
static t(
|
|
923
|
-
if (typeof
|
|
924
|
-
return
|
|
925
|
-
|
|
922
|
+
static t(t, ...d) {
|
|
923
|
+
if (typeof t == "function")
|
|
924
|
+
return t(...d);
|
|
925
|
+
t = String(t);
|
|
926
926
|
let e = 0;
|
|
927
|
-
return
|
|
927
|
+
return t.replace(/{([^}]+)}/g, (n, o) => e < d.length ? String(d[e++]) : `{${o}}`);
|
|
928
928
|
}
|
|
929
|
-
static setI18n = (
|
|
930
|
-
|
|
929
|
+
static setI18n = (t) => {
|
|
930
|
+
b.curd = ObjectUtil.deepMerge(b.curd, t);
|
|
931
931
|
};
|
|
932
932
|
/** 解析curd国际化值 */
|
|
933
|
-
static tCurd(
|
|
934
|
-
return this.t(this.curd[
|
|
933
|
+
static tCurd(t, ...d) {
|
|
934
|
+
return this.t(this.curd[t], ...d);
|
|
935
935
|
}
|
|
936
936
|
/** curd表单 */
|
|
937
|
-
static curd =
|
|
937
|
+
static curd = Se;
|
|
938
938
|
}
|
|
939
|
-
class
|
|
939
|
+
class Ue {
|
|
940
940
|
/**
|
|
941
941
|
* 导出数据为 Excel 文件(.xlsx),自动触发浏览器下载
|
|
942
942
|
*
|
|
@@ -944,20 +944,20 @@ class $e {
|
|
|
944
944
|
* @param columns - 列配置数组,需包含 `key`(数据字段)和 `label`(Excel 表头)
|
|
945
945
|
* @param fileName - 文件名(不含扩展名),支持字符串或返回字符串的函数;默认生成「导出数据_日期_时间戳」
|
|
946
946
|
*/
|
|
947
|
-
static exportToExcel = async (
|
|
948
|
-
if (!
|
|
949
|
-
const
|
|
947
|
+
static exportToExcel = async (t, d, e) => {
|
|
948
|
+
if (!t || t.length === 0) return;
|
|
949
|
+
const n = await U.loadModule("xlsx"), o = t.map((c) => {
|
|
950
950
|
const m = {};
|
|
951
951
|
return d.forEach((u) => {
|
|
952
952
|
m[u.label] = c[u.key];
|
|
953
953
|
}), m;
|
|
954
|
-
}),
|
|
955
|
-
|
|
954
|
+
}), l = n.utils.json_to_sheet(o), r = n.utils.book_new();
|
|
955
|
+
n.utils.book_append_sheet(r, l, "Sheet1"), e ? typeof e == "function" && (e = e()) : e = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, n.writeFile(r, `${e}.xlsx`);
|
|
956
956
|
};
|
|
957
957
|
}
|
|
958
|
-
const
|
|
959
|
-
const
|
|
960
|
-
option:
|
|
958
|
+
const R = U.EDialog, $e = (i) => {
|
|
959
|
+
const t = H(), d = H(), e = oe({
|
|
960
|
+
option: i.option,
|
|
961
961
|
/** 查询区域相关配置对象 */
|
|
962
962
|
search: {
|
|
963
963
|
/** 查询表单列集合 */
|
|
@@ -970,22 +970,22 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
970
970
|
/** 搜索表单默认值 */
|
|
971
971
|
formDefault: {},
|
|
972
972
|
/** 获取占位符 */
|
|
973
|
-
getPlaceholder: (
|
|
973
|
+
getPlaceholder: (n, o = b.tCurd("placeholderInput")) => n.text?.search?.placeholder === void 0 ? `${o}${n.label}` : n.text?.search?.placeholder,
|
|
974
974
|
/** 组装实际要搜索的数据对象 */
|
|
975
975
|
getFormData: () => {
|
|
976
|
-
let
|
|
977
|
-
|
|
978
|
-
(typeof
|
|
976
|
+
let n = {};
|
|
977
|
+
i.option.column.forEach((l) => {
|
|
978
|
+
(typeof l.show?.search == "function" ? l.show?.search(e.search.form) : l.show?.search) && (n[l.key] = e.search.form[l.key]);
|
|
979
979
|
});
|
|
980
|
-
const
|
|
981
|
-
return
|
|
980
|
+
const o = i.option.search?.before?.(n);
|
|
981
|
+
return o && (n = o), n;
|
|
982
982
|
},
|
|
983
983
|
/** 重置搜索表单 */
|
|
984
984
|
reset: () => {
|
|
985
|
-
const
|
|
986
|
-
Object.keys(
|
|
987
|
-
|
|
988
|
-
}), e.search.form = JSONUtil.cp(
|
|
985
|
+
const n = e.search.formDefault;
|
|
986
|
+
Object.keys(n).forEach((o) => {
|
|
987
|
+
i.option.search?.resetMode === "none" ? n[o] = void 0 : n[o] = e.search.formDefault[o];
|
|
988
|
+
}), e.search.form = JSONUtil.cp(n), e.page.num = 1, i.option.init !== !1 && e.table.getList();
|
|
989
989
|
},
|
|
990
990
|
/** 提交搜索表单 */
|
|
991
991
|
submit: () => {
|
|
@@ -999,22 +999,22 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
999
999
|
/** 总条数 */
|
|
1000
1000
|
total: 0,
|
|
1001
1001
|
/** 分页控件的布局方式 */
|
|
1002
|
-
layout:
|
|
1002
|
+
layout: i.option.page?.layout || z.config.pagination.layout,
|
|
1003
1003
|
/** 是否显示到工具栏 默认不显示 配置后show属性无效 */
|
|
1004
|
-
showTools:
|
|
1004
|
+
showTools: i.option.page?.showTools || z.config.pagination.showTools,
|
|
1005
1005
|
/** 当前每页条数 */
|
|
1006
|
-
size:
|
|
1006
|
+
size: i.option.page?.size || z.config.pagination.size,
|
|
1007
1007
|
/** 支持切换的每页条数选项 */
|
|
1008
|
-
sizeList:
|
|
1008
|
+
sizeList: i.option.page?.sizeList || z.config.pagination.pageSizes,
|
|
1009
1009
|
/** 分页器计数 */
|
|
1010
|
-
pagerCount:
|
|
1010
|
+
pagerCount: i.option.page?.pagerCount || z.config.pagination.pagerCount
|
|
1011
1011
|
},
|
|
1012
1012
|
/** 表格区域相关配置对象 */
|
|
1013
1013
|
table: {
|
|
1014
1014
|
/** 操作列相关配置 */
|
|
1015
1015
|
op: {
|
|
1016
1016
|
/** 动态计算操作列宽度 */
|
|
1017
|
-
width: (...
|
|
1017
|
+
width: (...n) => n.filter((l) => l).length * 30 + 60
|
|
1018
1018
|
},
|
|
1019
1019
|
/** 表格加载中状态 */
|
|
1020
1020
|
loading: !1,
|
|
@@ -1027,20 +1027,20 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1027
1027
|
/** 已经展开的行key集合 */
|
|
1028
1028
|
rowKeys: [],
|
|
1029
1029
|
/** 行展开触发变更函数 */
|
|
1030
|
-
change: (
|
|
1030
|
+
change: (n, o) => {
|
|
1031
1031
|
},
|
|
1032
1032
|
/** 全部展开/收起 */
|
|
1033
1033
|
all: () => {
|
|
1034
1034
|
if (e.table.expand.isExpand)
|
|
1035
1035
|
e.table.expand.rowKeys = [];
|
|
1036
1036
|
else {
|
|
1037
|
-
const
|
|
1038
|
-
let
|
|
1039
|
-
return
|
|
1040
|
-
|
|
1041
|
-
}),
|
|
1037
|
+
const n = (o) => {
|
|
1038
|
+
let l = [];
|
|
1039
|
+
return o.forEach((r) => {
|
|
1040
|
+
l.push(r[i.option.table.rowKey]), r.children && r.children.length > 0 && (l = l.concat(n(r.children)));
|
|
1041
|
+
}), l;
|
|
1042
1042
|
};
|
|
1043
|
-
e.table.expand.rowKeys =
|
|
1043
|
+
e.table.expand.rowKeys = n(e.table.data);
|
|
1044
1044
|
}
|
|
1045
1045
|
e.table.expand.isExpand = !e.table.expand.isExpand;
|
|
1046
1046
|
}
|
|
@@ -1060,31 +1060,31 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1060
1060
|
/** 获取数据列表接口实现 */
|
|
1061
1061
|
getList: async () => {
|
|
1062
1062
|
e.table.loading = !0;
|
|
1063
|
-
const
|
|
1063
|
+
const n = i.option.api.list;
|
|
1064
1064
|
try {
|
|
1065
1065
|
await e.initApiData("init");
|
|
1066
|
-
let
|
|
1066
|
+
let o = {};
|
|
1067
1067
|
if (e.table.sort.prop) {
|
|
1068
1068
|
const { props: p, order: y } = z.config.table.sort;
|
|
1069
|
-
|
|
1069
|
+
o = {
|
|
1070
1070
|
[p.field]: e.table.sort.prop,
|
|
1071
1071
|
[y.field]: e.table.sort.order
|
|
1072
1072
|
};
|
|
1073
1073
|
}
|
|
1074
|
-
const
|
|
1074
|
+
const l = await n({
|
|
1075
1075
|
[z.config.page.size]: e.page.size,
|
|
1076
1076
|
[z.config.page.num]: e.page.num,
|
|
1077
1077
|
...e.search.getFormData(),
|
|
1078
|
-
...
|
|
1079
|
-
}), r = z.config.result, c =
|
|
1078
|
+
...o
|
|
1079
|
+
}), r = z.config.result, c = l.data || { [r.list]: l };
|
|
1080
1080
|
let m = (Array.isArray(c[r.list]), c[r.list]);
|
|
1081
|
-
const u = e.update.formColumn.flat(), s = JSONUtil.cp(m).map((p) => (Object.keys(p).forEach((
|
|
1082
|
-
const
|
|
1083
|
-
|
|
1081
|
+
const u = e.update.formColumn.flat(), s = JSONUtil.cp(m).map((p) => (Object.keys(p).forEach((T) => {
|
|
1082
|
+
const A = u.find((M) => M.item.key === T);
|
|
1083
|
+
A && ["select", "radio"].includes(A.item.type) && (A.item.table.format || (A.item.table.format = (M) => A.item.options[A.item.type].data?.find((B) => B.value == M[T])?.label || M[T]));
|
|
1084
1084
|
}), p));
|
|
1085
|
-
e.table.data =
|
|
1086
|
-
} catch (
|
|
1087
|
-
console.error(
|
|
1085
|
+
e.table.data = i.option.data ? await i.option.data(s, m) : s, e.page.total = c[r.total] || 0;
|
|
1086
|
+
} catch (o) {
|
|
1087
|
+
console.error(o);
|
|
1088
1088
|
} finally {
|
|
1089
1089
|
e.table.loading = !1;
|
|
1090
1090
|
}
|
|
@@ -1094,8 +1094,8 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1094
1094
|
/** 已选数据项 */
|
|
1095
1095
|
list: [],
|
|
1096
1096
|
/** 选中状态回调 */
|
|
1097
|
-
change: (
|
|
1098
|
-
e.table.selection.list =
|
|
1097
|
+
change: (n) => {
|
|
1098
|
+
e.table.selection.list = n;
|
|
1099
1099
|
}
|
|
1100
1100
|
},
|
|
1101
1101
|
/** 表格排序相关配置 */
|
|
@@ -1105,14 +1105,14 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1105
1105
|
/** 当前排序顺序值 */
|
|
1106
1106
|
order: "",
|
|
1107
1107
|
/** 排序变更回调 */
|
|
1108
|
-
change: (
|
|
1108
|
+
change: (n) => {
|
|
1109
1109
|
z.config.table.sort.resetPage && (e.page.num = 1);
|
|
1110
|
-
const
|
|
1111
|
-
if (
|
|
1112
|
-
|
|
1110
|
+
const o = z.config.table.sort;
|
|
1111
|
+
if (o.change) {
|
|
1112
|
+
o.change(n, e);
|
|
1113
1113
|
return;
|
|
1114
1114
|
}
|
|
1115
|
-
e.table.sort.prop =
|
|
1115
|
+
e.table.sort.prop = n.prop, n.order === null ? e.table.sort.order = "" : e.table.sort.order = n.order === "ascending" ? o.order.asc : o.order.desc, e.table.getList();
|
|
1116
1116
|
}
|
|
1117
1117
|
}
|
|
1118
1118
|
},
|
|
@@ -1121,45 +1121,45 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1121
1121
|
/** 导出逻辑方法集合 */
|
|
1122
1122
|
run: {
|
|
1123
1123
|
/** 执行指定方式的导出(如select、page、all) */
|
|
1124
|
-
start: async (
|
|
1125
|
-
let
|
|
1124
|
+
start: async (n) => {
|
|
1125
|
+
let o = await e.export.run[n](), l = i.option.column;
|
|
1126
1126
|
const r = JSONUtil.cp({
|
|
1127
|
-
data:
|
|
1128
|
-
columns:
|
|
1129
|
-
}), c =
|
|
1130
|
-
c.before && c.before(r),
|
|
1127
|
+
data: o,
|
|
1128
|
+
columns: l
|
|
1129
|
+
}), c = i.option.tools?.export || {};
|
|
1130
|
+
c.before && c.before(r), Ue.exportToExcel(r.data, r.columns, c.fileName);
|
|
1131
1131
|
},
|
|
1132
1132
|
/** 获取当前选中项进行导出 */
|
|
1133
1133
|
select: () => {
|
|
1134
1134
|
if (e.table.selection.list.length === 0)
|
|
1135
|
-
throw
|
|
1135
|
+
throw U.fail(b.tCurd("selectDataToExport")), new Error(b.tCurd("selectDataToExport"));
|
|
1136
1136
|
return e.table.selection.list;
|
|
1137
1137
|
},
|
|
1138
1138
|
/** 导出当前页的数据 */
|
|
1139
1139
|
page: () => {
|
|
1140
1140
|
if (e.table.data.length === 0)
|
|
1141
|
-
throw
|
|
1141
|
+
throw U.fail(b.tCurd("noData")), new Error(b.tCurd("noData"));
|
|
1142
1142
|
return e.table.data;
|
|
1143
1143
|
},
|
|
1144
1144
|
/** 导出所有数据 */
|
|
1145
1145
|
all: async () => {
|
|
1146
1146
|
e.export.loading = !0;
|
|
1147
1147
|
try {
|
|
1148
|
-
if (
|
|
1149
|
-
await
|
|
1148
|
+
if (i.option.tools?.export?.all) {
|
|
1149
|
+
await i.option.tools?.export?.all({
|
|
1150
1150
|
[z.config.page.size]: e.page.size,
|
|
1151
1151
|
[z.config.page.num]: e.page.num,
|
|
1152
1152
|
...e.search.getFormData()
|
|
1153
1153
|
});
|
|
1154
1154
|
return;
|
|
1155
1155
|
}
|
|
1156
|
-
const
|
|
1156
|
+
const n = i.option.api.list, o = await n({
|
|
1157
1157
|
[z.config.page.size]: 999999,
|
|
1158
1158
|
[z.config.page.num]: 1
|
|
1159
1159
|
});
|
|
1160
|
-
return (
|
|
1161
|
-
} catch (
|
|
1162
|
-
console.error(
|
|
1160
|
+
return (o.data || { [z.config.result.list]: o })[z.config.result.list];
|
|
1161
|
+
} catch (n) {
|
|
1162
|
+
console.error(n);
|
|
1163
1163
|
} finally {
|
|
1164
1164
|
e.export.loading = !1;
|
|
1165
1165
|
}
|
|
@@ -1168,8 +1168,8 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1168
1168
|
/** 导出时loading状态 */
|
|
1169
1169
|
loading: !1,
|
|
1170
1170
|
/** 执行导出操作的触发函数 */
|
|
1171
|
-
click: (
|
|
1172
|
-
e.export.loading || e.export.run.start(
|
|
1171
|
+
click: (n) => {
|
|
1172
|
+
e.export.loading || e.export.run.start(n);
|
|
1173
1173
|
}
|
|
1174
1174
|
},
|
|
1175
1175
|
/** 表单增删改弹窗相关对象 */
|
|
@@ -1185,7 +1185,7 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1185
1185
|
/** 弹窗loading */
|
|
1186
1186
|
loading: !1,
|
|
1187
1187
|
/** 当前操作类型,插入或修改 */
|
|
1188
|
-
type:
|
|
1188
|
+
type: R.Add,
|
|
1189
1189
|
/** 当前操作表单数据 */
|
|
1190
1190
|
form: {},
|
|
1191
1191
|
/** 表单默认值 */
|
|
@@ -1193,40 +1193,44 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1193
1193
|
/** 表单所有列,二维数组结构按行分组 */
|
|
1194
1194
|
formColumn: [],
|
|
1195
1195
|
/** 判断是否禁用当前字段 */
|
|
1196
|
-
getDisabled: (
|
|
1196
|
+
getDisabled: (n) => e.update.type === R.View ? n.disabled?.view === void 0 ? !0 : n.disabled?.view : n.disabled?.[e.update.type === R.Add ? "create" : "update"],
|
|
1197
|
+
/** 获取表单组件绑定属性 */
|
|
1198
|
+
getBind: (n) => n.options?.[e.update.type === R.Add ? "formAdd" : "formUpdate"]?.[n.type] || n.options?.[n.type] || {},
|
|
1199
|
+
/** 获取表单组件事件属性 */
|
|
1200
|
+
getOn: (n) => n.options?.[e.update.type === R.Add ? "formAdd" : "formUpdate"]?.[n.type]?.on || n.options?.[n.type]?.on || {},
|
|
1197
1201
|
/** 编辑相关数据与方法 */
|
|
1198
1202
|
edit: {
|
|
1199
1203
|
/** 当前编辑的数据原始项对象 */
|
|
1200
1204
|
data: {},
|
|
1201
1205
|
/** 返回编辑时与原值的变更数据,用于局部更新API */
|
|
1202
|
-
getApiData: (
|
|
1203
|
-
if (
|
|
1204
|
-
return
|
|
1205
|
-
let
|
|
1206
|
-
[
|
|
1206
|
+
getApiData: (n) => {
|
|
1207
|
+
if (i.option.form?.editAll)
|
|
1208
|
+
return n;
|
|
1209
|
+
let o = {
|
|
1210
|
+
[i.option.table?.rowKey]: e.update.edit.data[i.option.table?.rowKey]
|
|
1207
1211
|
};
|
|
1208
|
-
return Object.keys(e.update.edit.data).forEach((
|
|
1209
|
-
|
|
1210
|
-
}),
|
|
1212
|
+
return Object.keys(e.update.edit.data).forEach((l) => {
|
|
1213
|
+
n[l] !== e.update.edit.data[l] && (o[l] = n[l]);
|
|
1214
|
+
}), o;
|
|
1211
1215
|
}
|
|
1212
1216
|
},
|
|
1213
1217
|
view: {},
|
|
1214
1218
|
/** 打开增改弹窗 */
|
|
1215
|
-
open: (
|
|
1219
|
+
open: (n, o) => {
|
|
1216
1220
|
e.update.showContent || FunUtil.throttle(async () => {
|
|
1217
|
-
|
|
1221
|
+
U.loading(!0);
|
|
1218
1222
|
try {
|
|
1219
1223
|
await e.initApiData("update");
|
|
1220
|
-
const
|
|
1221
|
-
if (!
|
|
1222
|
-
e.inlineEdit.open(
|
|
1224
|
+
const l = n === R.Add;
|
|
1225
|
+
if (!l && i.option.table?.inlineEdit) {
|
|
1226
|
+
e.inlineEdit.open(o);
|
|
1223
1227
|
return;
|
|
1224
1228
|
}
|
|
1225
|
-
e.update.type =
|
|
1226
|
-
} catch (
|
|
1227
|
-
console.error(
|
|
1229
|
+
e.update.type = n, e.update.edit.data = o, e.update.title = b.tCurd(l ? "add" : n === R.View ? "view" : "edit"), e.update.form = JSONUtil.cp(l ? e.update.formDefault : o), await i.option.form?.openBefore?.(o, e.update), e.inlineEdit.data || (e.update.show = !0), e.update.showContent = !0, i.option.form?.openAfter?.(o, e.update);
|
|
1230
|
+
} catch (l) {
|
|
1231
|
+
console.error(l);
|
|
1228
1232
|
} finally {
|
|
1229
|
-
|
|
1233
|
+
U.loading(!1);
|
|
1230
1234
|
}
|
|
1231
1235
|
});
|
|
1232
1236
|
},
|
|
@@ -1234,29 +1238,29 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1234
1238
|
submit: () => {
|
|
1235
1239
|
FunUtil.throttle(async () => {
|
|
1236
1240
|
await d.value?.validate(async (r, c) => new Promise((m, u) => {
|
|
1237
|
-
r || (
|
|
1241
|
+
r || (U.fail(b.tCurd("checkFormData")), u(!1)), m();
|
|
1238
1242
|
})), e.update.loading = !0;
|
|
1239
|
-
const
|
|
1243
|
+
const n = e.update.type === R.Add ? i.option.api.create : i.option.api.update;
|
|
1240
1244
|
try {
|
|
1241
|
-
await
|
|
1245
|
+
await i.option.form?.submitBefore?.(e.update.form, e.update);
|
|
1242
1246
|
} catch {
|
|
1243
1247
|
e.update.loading = !1;
|
|
1244
1248
|
return;
|
|
1245
1249
|
}
|
|
1246
|
-
let
|
|
1247
|
-
delete
|
|
1248
|
-
const
|
|
1249
|
-
Object.keys(
|
|
1250
|
-
if (
|
|
1251
|
-
const c = new Date(
|
|
1252
|
-
isNaN(c) || (
|
|
1250
|
+
let o = JSONUtil.cp(e.update.form);
|
|
1251
|
+
delete o.children;
|
|
1252
|
+
const l = new Set(i.option.column.filter((r) => r.type === "datetime").map((r) => r.key));
|
|
1253
|
+
Object.keys(o).forEach((r) => {
|
|
1254
|
+
if (l.has(r) && o[r] != null) {
|
|
1255
|
+
const c = new Date(o[r]).getTime();
|
|
1256
|
+
isNaN(c) || (o[r] = c);
|
|
1253
1257
|
}
|
|
1254
1258
|
});
|
|
1255
1259
|
try {
|
|
1256
|
-
if (!
|
|
1257
|
-
await
|
|
1258
|
-
...
|
|
1259
|
-
}), e.update.close(), await e.table.getList(),
|
|
1260
|
+
if (!n) return;
|
|
1261
|
+
await n({
|
|
1262
|
+
...o
|
|
1263
|
+
}), e.update.close(), await e.table.getList(), i.option.form?.submitAfter?.(o, e.update);
|
|
1260
1264
|
} catch (r) {
|
|
1261
1265
|
console.error(r);
|
|
1262
1266
|
} finally {
|
|
@@ -1274,41 +1278,20 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1274
1278
|
/** 行内编辑相关对象 */
|
|
1275
1279
|
inlineEdit: {
|
|
1276
1280
|
/** 行内编辑当前行对象 */
|
|
1277
|
-
|
|
1278
|
-
/** 行内编辑表单数据副本 */
|
|
1279
|
-
form: {},
|
|
1280
|
-
/** 行内编辑loading */
|
|
1281
|
-
loading: !1,
|
|
1281
|
+
data: null,
|
|
1282
1282
|
/** 打开行内编辑 */
|
|
1283
|
-
open: (
|
|
1284
|
-
e.inlineEdit.
|
|
1283
|
+
open: (n) => {
|
|
1284
|
+
e.inlineEdit.data = n, e.update.open(R.Update, n);
|
|
1285
1285
|
},
|
|
1286
1286
|
/** 关闭行内编辑 */
|
|
1287
1287
|
close: () => {
|
|
1288
|
-
e.inlineEdit.
|
|
1289
|
-
},
|
|
1290
|
-
/** 行内保存提交 */
|
|
1291
|
-
submit: () => {
|
|
1292
|
-
FunUtil.throttle(async () => {
|
|
1293
|
-
e.inlineEdit.loading = !0;
|
|
1294
|
-
const i = n.option.api.update;
|
|
1295
|
-
let t = JSONUtil.cp(e.inlineEdit.form);
|
|
1296
|
-
delete t.children;
|
|
1297
|
-
try {
|
|
1298
|
-
if (!i) return;
|
|
1299
|
-
await i({ ...t }), e.inlineEdit.close(), await e.table.getList(), D.success(g.tCurd("operationSuccess"));
|
|
1300
|
-
} catch (a) {
|
|
1301
|
-
console.error(a);
|
|
1302
|
-
} finally {
|
|
1303
|
-
e.inlineEdit.loading = !1;
|
|
1304
|
-
}
|
|
1305
|
-
});
|
|
1288
|
+
e.inlineEdit.data = null, e.update.close();
|
|
1306
1289
|
}
|
|
1307
1290
|
},
|
|
1308
1291
|
/** 删除操作弹窗与数据对象 */
|
|
1309
1292
|
remove: {
|
|
1310
1293
|
/** 删除弹窗标题 */
|
|
1311
|
-
title:
|
|
1294
|
+
title: b.tCurd("confirmDelete"),
|
|
1312
1295
|
/** 删除弹窗显示控制 */
|
|
1313
1296
|
show: !1,
|
|
1314
1297
|
/** 待删除数据项集合 */
|
|
@@ -1320,26 +1303,26 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1320
1303
|
e.remove.show = !1;
|
|
1321
1304
|
},
|
|
1322
1305
|
/** 打开删除弹窗并设置待删除项 */
|
|
1323
|
-
open: (
|
|
1324
|
-
if (
|
|
1325
|
-
|
|
1306
|
+
open: (n) => {
|
|
1307
|
+
if (n.length === 0) {
|
|
1308
|
+
U.fail(b.tCurd("selectDataToDelete"));
|
|
1326
1309
|
return;
|
|
1327
1310
|
}
|
|
1328
|
-
e.remove.items =
|
|
1311
|
+
e.remove.items = n, e.remove.show = !0;
|
|
1329
1312
|
},
|
|
1330
1313
|
/** 执行删除实际操作 */
|
|
1331
1314
|
submit: () => {
|
|
1332
1315
|
FunUtil.throttle(async () => {
|
|
1333
1316
|
e.remove.loading = !0;
|
|
1334
|
-
const
|
|
1317
|
+
const n = i.option.api.delete;
|
|
1335
1318
|
try {
|
|
1336
|
-
if (!
|
|
1337
|
-
await
|
|
1338
|
-
[
|
|
1319
|
+
if (!n) return;
|
|
1320
|
+
await n({
|
|
1321
|
+
[i.option.table?.rowKey]: e.remove.items.map((o) => o[i.option.table?.rowKey]),
|
|
1339
1322
|
items: e.remove.items
|
|
1340
|
-
}),
|
|
1341
|
-
} catch (
|
|
1342
|
-
console.error(
|
|
1323
|
+
}), U.success(b.tCurd("operationSuccess")), e.table.data.length <= 1 && e.page.num > 1 && (e.page.num -= 1), e.remove.close(), await e.table.getList();
|
|
1324
|
+
} catch (o) {
|
|
1325
|
+
console.error(o);
|
|
1343
1326
|
} finally {
|
|
1344
1327
|
e.remove.loading = !1;
|
|
1345
1328
|
}
|
|
@@ -1353,13 +1336,13 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1353
1336
|
/** 下拉请求等数据缓存 */
|
|
1354
1337
|
apiDataMap: {},
|
|
1355
1338
|
/** 获取并绑定curd中所有下拉数据等远程依赖 */
|
|
1356
|
-
initApiData: async (
|
|
1357
|
-
const
|
|
1339
|
+
initApiData: async (n) => {
|
|
1340
|
+
const o = [], l = (r) => {
|
|
1358
1341
|
if (r.children && r.children.length) {
|
|
1359
|
-
r.children.forEach((c) =>
|
|
1342
|
+
r.children.forEach((c) => l(c));
|
|
1360
1343
|
return;
|
|
1361
1344
|
}
|
|
1362
|
-
if (r.type === "select" && r.options?.select?.dataApi && r.options?.select?.dataApiConfig?.[
|
|
1345
|
+
if (r.type === "select" && r.options?.select?.dataApi && r.options?.select?.dataApiConfig?.[n]) {
|
|
1363
1346
|
if (e.apiDataMap[r.key] && r.options?.select?.dataApiConfig?.once) return;
|
|
1364
1347
|
const c = (async () => {
|
|
1365
1348
|
try {
|
|
@@ -1371,20 +1354,20 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1371
1354
|
} catch {
|
|
1372
1355
|
}
|
|
1373
1356
|
})();
|
|
1374
|
-
|
|
1357
|
+
o.push(c);
|
|
1375
1358
|
}
|
|
1376
1359
|
};
|
|
1377
|
-
return
|
|
1378
|
-
|
|
1379
|
-
}), await Promise.all(
|
|
1360
|
+
return i.option.column.forEach((r) => {
|
|
1361
|
+
l(r);
|
|
1362
|
+
}), await Promise.all(o), !0;
|
|
1380
1363
|
},
|
|
1381
1364
|
/** 初始化curd配置(option默认值合并等) */
|
|
1382
1365
|
initCurdConfig: () => {
|
|
1383
|
-
const
|
|
1384
|
-
|
|
1385
|
-
const
|
|
1386
|
-
Object.keys(
|
|
1387
|
-
|
|
1366
|
+
const n = JSONUtil.cp(z.config);
|
|
1367
|
+
n.table.emptyText = b.tCurd("noData"), i.option.size = i.option.size || {}, n.table.size = i.option.size.table || n.size.table, n.form.size = i.option.size.form || n.size.form, n.size.search = i.option.size.search || n.size.search;
|
|
1368
|
+
const o = ObjectUtil.deepMerge(n, i.option || {});
|
|
1369
|
+
Object.keys(o).forEach((l) => {
|
|
1370
|
+
i.option[l] = o[l];
|
|
1388
1371
|
});
|
|
1389
1372
|
},
|
|
1390
1373
|
/**
|
|
@@ -1393,40 +1376,42 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1393
1376
|
* @returns
|
|
1394
1377
|
*/
|
|
1395
1378
|
initColumnOptions: () => {
|
|
1396
|
-
let
|
|
1397
|
-
|
|
1379
|
+
let n = JSONUtil.cp(z.config.columnConfig);
|
|
1380
|
+
n.options = ObjectUtil.deepMerge(n.options, {
|
|
1398
1381
|
switch: {
|
|
1399
|
-
activeLabel:
|
|
1400
|
-
inactiveLabel:
|
|
1382
|
+
activeLabel: b.tCurd("switchOn"),
|
|
1383
|
+
inactiveLabel: b.tCurd("switchOff")
|
|
1401
1384
|
}
|
|
1402
1385
|
});
|
|
1403
|
-
const
|
|
1404
|
-
for (const r in
|
|
1386
|
+
const o = (l) => {
|
|
1387
|
+
for (const r in n) {
|
|
1405
1388
|
if (r === "table") {
|
|
1406
|
-
if (
|
|
1407
|
-
|
|
1408
|
-
|
|
1389
|
+
if (l.table = ObjectUtil.deepMerge(n.table, l.table || {}), l.children) {
|
|
1390
|
+
l.children.forEach((m) => {
|
|
1391
|
+
o(m);
|
|
1409
1392
|
});
|
|
1410
1393
|
return;
|
|
1411
1394
|
}
|
|
1412
|
-
} else r === "type" ?
|
|
1413
|
-
|
|
1395
|
+
} else r === "type" ? l.type = l.type || n.type : l[r] = ObjectUtil.deepMerge(n[r], l[r] || {});
|
|
1396
|
+
l.options = l.options || {}, l.options[l.type] = l.options[l.type] || {}, l.options[l.type].size = i.option.size.form, ["search", "formAdd", "formUpdate"].forEach((m) => {
|
|
1397
|
+
l.options[m] = l.options[m] || JSONUtil.cp(l.options), l.options[m][l.type] = l.options[m][l.type] || {}, l.options[m][l.type].size = m === "search" ? i.option.size.search : i.option.size.form;
|
|
1398
|
+
}), l.table = ObjectUtil.deepMerge(l.table, l.options[l.type].table || {});
|
|
1414
1399
|
}
|
|
1415
|
-
|
|
1416
|
-
const m =
|
|
1400
|
+
l.type === "switch" && (l.options.switch.tableBeforeChange = async (r, c) => {
|
|
1401
|
+
const m = l.options?.switch;
|
|
1417
1402
|
try {
|
|
1418
|
-
await
|
|
1419
|
-
title:
|
|
1420
|
-
content:
|
|
1403
|
+
await t.value?.open({
|
|
1404
|
+
title: b.tCurd("confirmModify"),
|
|
1405
|
+
content: b.tCurd("confirmSwitchMessage")
|
|
1421
1406
|
}), e.table.loading = !0;
|
|
1422
1407
|
try {
|
|
1423
|
-
return
|
|
1424
|
-
[
|
|
1408
|
+
return i.option.api.update ? (await i.option.api.update({
|
|
1409
|
+
[i.option.table?.rowKey]: c[i.option.table?.rowKey],
|
|
1425
1410
|
[r]: c[r] === m.activeValue ? m.inactiveValue : m.activeValue,
|
|
1426
1411
|
final(u, s, p) {
|
|
1427
1412
|
e.table.loading = !1;
|
|
1428
1413
|
}
|
|
1429
|
-
}), e.table.loading = !1,
|
|
1414
|
+
}), e.table.loading = !1, U.success(b.tCurd("operationSuccess")), e.table.getList(), !0) : void 0;
|
|
1430
1415
|
} catch (u) {
|
|
1431
1416
|
return console.error(u), !1;
|
|
1432
1417
|
} finally {
|
|
@@ -1435,25 +1420,25 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1435
1420
|
} catch {
|
|
1436
1421
|
return !1;
|
|
1437
1422
|
}
|
|
1438
|
-
}),
|
|
1423
|
+
}), l.type === "treeSelect" && (l.options.treeSelect.rowKey = i.option.table?.rowKey, l.options.treeSelect.nodeKey = i.option.table?.rowKey);
|
|
1439
1424
|
};
|
|
1440
|
-
|
|
1425
|
+
i.option.column.forEach(o), i.option.table?.column?.forEach(o);
|
|
1441
1426
|
},
|
|
1442
|
-
getColumnSpan: (
|
|
1443
|
-
if (
|
|
1444
|
-
const
|
|
1445
|
-
return (
|
|
1427
|
+
getColumnSpan: (n, o) => {
|
|
1428
|
+
if (n.item.form?.spanCol) {
|
|
1429
|
+
const l = z.config.form.defaultSpan, c = o.filter((m) => !U.isFun(m.item.show?.form, e.update.form, e.update.type)).reduce((m, u) => m + (u.item.form?.span || l), 0);
|
|
1430
|
+
return (n.item?.form.span || l) + c;
|
|
1446
1431
|
}
|
|
1447
|
-
return
|
|
1432
|
+
return n.item.form.span;
|
|
1448
1433
|
},
|
|
1449
1434
|
/** 初始化配置并生成表单列及默认值及规则 */
|
|
1450
1435
|
initColumnForm: () => {
|
|
1451
|
-
const
|
|
1436
|
+
const n = i.option;
|
|
1452
1437
|
e.update.formColumn = [], e.table.column.show = {
|
|
1453
1438
|
list: [],
|
|
1454
1439
|
listSource: []
|
|
1455
1440
|
};
|
|
1456
|
-
const
|
|
1441
|
+
const o = [], l = i.option.form?.maxSpan || 12, r = i.option.form?.defaultSpan || l / 2;
|
|
1457
1442
|
let c = [];
|
|
1458
1443
|
const m = (p) => {
|
|
1459
1444
|
if (p.children) {
|
|
@@ -1464,61 +1449,61 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1464
1449
|
}
|
|
1465
1450
|
if (e.update.formDefault[p.key] = p.value, p.table.table && (p.show.table && e.table.column.show.list.push(p.key), p.table.table && e.table.column.show.listSource.push(p.key)), !(p.isForm && typeof p.show?.form == "boolean") || p.show?.form) {
|
|
1466
1451
|
p.form = p.form || { span: r }, p.form.span = p.form.span ?? r;
|
|
1467
|
-
let y = p.form.span,
|
|
1468
|
-
const
|
|
1469
|
-
if (c.push({ item: p, span: y }), (
|
|
1470
|
-
const
|
|
1471
|
-
input:
|
|
1472
|
-
select:
|
|
1473
|
-
},
|
|
1452
|
+
let y = p.form.span, T = c.reduce((M, B) => M + B.span, y);
|
|
1453
|
+
const A = c.length;
|
|
1454
|
+
if (c.push({ item: p, span: y }), (A === 1 && c[0].span === 0 || T >= l || y === 0 && A > 1) && (o.push(c), c = []), p.rules) {
|
|
1455
|
+
const M = {
|
|
1456
|
+
input: b.tCurd("placeholderInput"),
|
|
1457
|
+
select: b.tCurd("placeholderSelect")
|
|
1458
|
+
}, B = (M[p.type] || M.input) + p.label;
|
|
1474
1459
|
e.update.rules[p.key] = typeof p.rules == "boolean" ? [
|
|
1475
1460
|
{
|
|
1476
1461
|
required: !0,
|
|
1477
|
-
message:
|
|
1462
|
+
message: B,
|
|
1478
1463
|
trigger: "blur"
|
|
1479
1464
|
}
|
|
1480
1465
|
] : p.rules;
|
|
1481
1466
|
}
|
|
1482
1467
|
}
|
|
1483
1468
|
}, u = (p, y) => {
|
|
1484
|
-
p.isForm = y, Array.isArray(p.children) && p.children.forEach((
|
|
1469
|
+
p.isForm = y, Array.isArray(p.children) && p.children.forEach((T) => u(T, y));
|
|
1485
1470
|
};
|
|
1486
|
-
|
|
1471
|
+
n.column.forEach((p) => {
|
|
1487
1472
|
p.isForm = !0, u(p, !0), m(p);
|
|
1488
|
-
}),
|
|
1473
|
+
}), i.option.table?.column?.forEach((p) => {
|
|
1489
1474
|
u(p, !1), m(p);
|
|
1490
|
-
}), e.search.column.list =
|
|
1491
|
-
const s =
|
|
1475
|
+
}), e.search.column.list = n.column.concat(n.table?.column || []), e.table.column.list = e.search.column.list.filter((p) => p.table?.table), e.search.column.list.sort((p, y) => p.sort?.search - y.sort?.search), e.table.column.list.sort((p, y) => p.sort?.table - y.sort?.table), c.length > 0 && o.push(c), e.update.formColumn = o;
|
|
1476
|
+
const s = i.option.search?.formDefault;
|
|
1492
1477
|
s && Object.keys(s).forEach((p) => {
|
|
1493
1478
|
e.search.formDefault[p] = s[p];
|
|
1494
|
-
}),
|
|
1479
|
+
}), n.column.forEach((p) => {
|
|
1495
1480
|
p.show?.search || (e.search.formDefault[p.key] = void 0);
|
|
1496
1481
|
}), e.search.form = JSONUtil.cp(e.search.formDefault);
|
|
1497
1482
|
}
|
|
1498
1483
|
});
|
|
1499
|
-
return e.init(),
|
|
1500
|
-
|
|
1501
|
-
}), { conf: e, switchConfirmRef:
|
|
1502
|
-
},
|
|
1484
|
+
return e.init(), ie(() => {
|
|
1485
|
+
i.option.init !== !1 && e.table.getList();
|
|
1486
|
+
}), { conf: e, switchConfirmRef: t, ruleFormRef: d };
|
|
1487
|
+
}, Oe = { class: "dialog-footer" }, Fe = /* @__PURE__ */ J({
|
|
1503
1488
|
__name: "switchConfirm",
|
|
1504
1489
|
props: {
|
|
1505
1490
|
size: {}
|
|
1506
1491
|
},
|
|
1507
|
-
setup(
|
|
1508
|
-
const d =
|
|
1509
|
-
let
|
|
1510
|
-
const r = (u) => (u?.title && (e.value = u.title), u?.content && (
|
|
1511
|
-
|
|
1492
|
+
setup(i, { expose: t }) {
|
|
1493
|
+
const d = H(!1), e = H("确认修改"), n = H("确认要修改状态吗?");
|
|
1494
|
+
let o = null, l = null;
|
|
1495
|
+
const r = (u) => (u?.title && (e.value = u.title), u?.content && (n.value = u.content), d.value = !0, new Promise((s, p) => {
|
|
1496
|
+
o = s, l = p;
|
|
1512
1497
|
})), c = () => {
|
|
1513
|
-
d.value = !1,
|
|
1498
|
+
d.value = !1, o?.(!0), o = null, l = null;
|
|
1514
1499
|
}, m = () => {
|
|
1515
|
-
d.value = !1,
|
|
1500
|
+
d.value = !1, l?.(new Error("用户取消操作")), o = null, l = null;
|
|
1516
1501
|
};
|
|
1517
|
-
return
|
|
1502
|
+
return t({
|
|
1518
1503
|
open: r
|
|
1519
1504
|
}), (u, s) => {
|
|
1520
1505
|
const p = X("el-form");
|
|
1521
|
-
return f(),
|
|
1506
|
+
return f(), g(a(Z), {
|
|
1522
1507
|
modelValue: d.value,
|
|
1523
1508
|
"onUpdate:modelValue": s[0] || (s[0] = (y) => d.value = y),
|
|
1524
1509
|
title: e.value,
|
|
@@ -1528,19 +1513,19 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1528
1513
|
footer: h(() => [
|
|
1529
1514
|
V(p, { size: u.size }, {
|
|
1530
1515
|
default: h(() => [
|
|
1531
|
-
O("span",
|
|
1532
|
-
V(
|
|
1516
|
+
O("span", Oe, [
|
|
1517
|
+
V(a(F), { onClick: m }, {
|
|
1533
1518
|
default: h(() => s[1] || (s[1] = [
|
|
1534
|
-
|
|
1519
|
+
D("取消")
|
|
1535
1520
|
])),
|
|
1536
1521
|
_: 1
|
|
1537
1522
|
}),
|
|
1538
|
-
V(
|
|
1523
|
+
V(a(F), {
|
|
1539
1524
|
type: "primary",
|
|
1540
1525
|
onClick: c
|
|
1541
1526
|
}, {
|
|
1542
1527
|
default: h(() => s[2] || (s[2] = [
|
|
1543
|
-
|
|
1528
|
+
D("确认")
|
|
1544
1529
|
])),
|
|
1545
1530
|
_: 1
|
|
1546
1531
|
})
|
|
@@ -1550,88 +1535,88 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1550
1535
|
}, 8, ["size"])
|
|
1551
1536
|
]),
|
|
1552
1537
|
default: h(() => [
|
|
1553
|
-
O("div", null,
|
|
1538
|
+
O("div", null, $(n.value), 1)
|
|
1554
1539
|
]),
|
|
1555
1540
|
_: 1
|
|
1556
1541
|
}, 8, ["modelValue", "title"]);
|
|
1557
1542
|
};
|
|
1558
1543
|
}
|
|
1559
|
-
}), re = (
|
|
1560
|
-
const d =
|
|
1561
|
-
for (const [e,
|
|
1562
|
-
d[e] =
|
|
1544
|
+
}), re = (i, t) => {
|
|
1545
|
+
const d = i.__vccOpts || i;
|
|
1546
|
+
for (const [e, n] of t)
|
|
1547
|
+
d[e] = n;
|
|
1563
1548
|
return d;
|
|
1564
|
-
},
|
|
1549
|
+
}, Le = {}, Te = {
|
|
1565
1550
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1566
1551
|
viewBox: "0 0 1024 1024"
|
|
1567
1552
|
};
|
|
1568
|
-
function
|
|
1569
|
-
return f(), w("svg",
|
|
1553
|
+
function Ae(i, t) {
|
|
1554
|
+
return f(), w("svg", Te, t[0] || (t[0] = [
|
|
1570
1555
|
O("path", {
|
|
1571
1556
|
fill: "currentColor",
|
|
1572
1557
|
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"
|
|
1573
1558
|
}, null, -1)
|
|
1574
1559
|
]));
|
|
1575
1560
|
}
|
|
1576
|
-
const
|
|
1561
|
+
const Me = /* @__PURE__ */ re(Le, [["render", Ae]]), je = {}, Ie = {
|
|
1577
1562
|
"data-v-58697b5c": "",
|
|
1578
1563
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1579
1564
|
viewBox: "0 0 1024 1024"
|
|
1580
1565
|
};
|
|
1581
|
-
function
|
|
1582
|
-
return f(), w("svg",
|
|
1566
|
+
function Re(i, t) {
|
|
1567
|
+
return f(), w("svg", Ie, t[0] || (t[0] = [
|
|
1583
1568
|
O("path", {
|
|
1584
1569
|
fill: "currentColor",
|
|
1585
1570
|
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"
|
|
1586
1571
|
}, null, -1)
|
|
1587
1572
|
]));
|
|
1588
1573
|
}
|
|
1589
|
-
const
|
|
1574
|
+
const Pe = /* @__PURE__ */ re(je, [["render", Re]]), Be = { class: "row flex-center table-header-label inline" }, Ne = { class: "table-header-tooltip" }, Ke = ["onClick", "innerHTML"], He = /* @__PURE__ */ J({
|
|
1590
1575
|
__name: "tableColumn",
|
|
1591
1576
|
props: {
|
|
1592
1577
|
conf: {},
|
|
1593
1578
|
columnList: {},
|
|
1594
1579
|
option: {}
|
|
1595
1580
|
},
|
|
1596
|
-
setup(
|
|
1597
|
-
const
|
|
1598
|
-
return (e,
|
|
1599
|
-
const
|
|
1600
|
-
return f(!0), w(S, null, L(e.columnList, (
|
|
1601
|
-
key:
|
|
1581
|
+
setup(i) {
|
|
1582
|
+
const t = U.isFun, d = ye().type;
|
|
1583
|
+
return (e, n) => {
|
|
1584
|
+
const o = X("el-tooltip");
|
|
1585
|
+
return f(!0), w(S, null, L(e.columnList, (l) => (f(), w(S, {
|
|
1586
|
+
key: l.key
|
|
1602
1587
|
}, [
|
|
1603
|
-
e.conf.table.column.show.list.includes(
|
|
1588
|
+
e.conf.table.column.show.list.includes(l.key) ? (f(), g(a(x), v({
|
|
1604
1589
|
key: 0,
|
|
1605
|
-
prop:
|
|
1606
|
-
label:
|
|
1590
|
+
prop: l.key,
|
|
1591
|
+
label: l.label,
|
|
1607
1592
|
ref_for: !0
|
|
1608
|
-
},
|
|
1593
|
+
}, l.table), {
|
|
1609
1594
|
header: h(() => [
|
|
1610
|
-
k(e.$slots, "table-header-" +
|
|
1611
|
-
O("div",
|
|
1612
|
-
|
|
1595
|
+
k(e.$slots, "table-header-" + l.key, { item: l }, () => [
|
|
1596
|
+
O("div", Be, [
|
|
1597
|
+
l.table?.tooltip ? (f(), g(o, {
|
|
1613
1598
|
key: 0,
|
|
1614
1599
|
effect: "dark",
|
|
1615
|
-
content:
|
|
1600
|
+
content: l.table?.tooltip,
|
|
1616
1601
|
placement: "top"
|
|
1617
1602
|
}, {
|
|
1618
1603
|
default: h(() => [
|
|
1619
|
-
O("span",
|
|
1620
|
-
V(
|
|
1604
|
+
O("span", Ne, [
|
|
1605
|
+
V(Pe)
|
|
1621
1606
|
])
|
|
1622
1607
|
]),
|
|
1623
1608
|
_: 2
|
|
1624
1609
|
}, 1032, ["content"])) : C("", !0),
|
|
1625
|
-
|
|
1610
|
+
D(" " + $(l.label), 1)
|
|
1626
1611
|
])
|
|
1627
1612
|
])
|
|
1628
1613
|
]),
|
|
1629
1614
|
default: h(({ row: r }) => [
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
(f(),
|
|
1615
|
+
l.children ? (f(), w(S, { key: 0 }, [
|
|
1616
|
+
n[0] || (n[0] = D(" ")),
|
|
1617
|
+
(f(), g(q(a(d)), {
|
|
1633
1618
|
conf: e.conf,
|
|
1634
|
-
columnList:
|
|
1619
|
+
columnList: l.children,
|
|
1635
1620
|
option: e.option
|
|
1636
1621
|
}, _({ _: 2 }, [
|
|
1637
1622
|
L(e.$slots, (c, m) => ({
|
|
@@ -1642,27 +1627,20 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
1642
1627
|
}))
|
|
1643
1628
|
]), 1032, ["conf", "columnList", "option"]))
|
|
1644
1629
|
], 64)) : (f(), w(S, { key: 1 }, [
|
|
1645
|
-
|
|
1646
|
-
|
|
1630
|
+
a(t)(l.show?.form, e.conf.update.form, a(U).EDialog.Update) && e.option.table?.inlineEdit && e.conf.inlineEdit.data === r && (l.type === "input" || l.type === "select") ? (f(), w(S, { key: 0 }, [
|
|
1631
|
+
l.type === "input" ? (f(), g(a(Q), v({
|
|
1647
1632
|
key: 0,
|
|
1648
|
-
modelValue: e.conf.
|
|
1649
|
-
"onUpdate:modelValue": (c) => e.conf.
|
|
1633
|
+
modelValue: e.conf.update.form[l.key],
|
|
1634
|
+
"onUpdate:modelValue": (c) => e.conf.update.form[l.key] = c,
|
|
1650
1635
|
ref_for: !0
|
|
1651
|
-
},
|
|
1652
|
-
size: "small",
|
|
1653
|
-
style: { width: "100%" },
|
|
1654
|
-
onKeyup: we(e.conf.inlineEdit.submit, ["enter"])
|
|
1655
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "onKeyup"])) : a.type === "select" ? (f(), b(o(W), v({
|
|
1636
|
+
}, e.conf.update.getBind(l), E(e.conf.update.getOn(l)), { style: { width: "100%" } }), null, 16, ["modelValue", "onUpdate:modelValue"])) : l.type === "select" ? (f(), g(a(W), v({
|
|
1656
1637
|
key: 1,
|
|
1657
|
-
modelValue: e.conf.
|
|
1658
|
-
"onUpdate:modelValue": (c) => e.conf.
|
|
1638
|
+
modelValue: e.conf.update.form[l.key],
|
|
1639
|
+
"onUpdate:modelValue": (c) => e.conf.update.form[l.key] = c,
|
|
1659
1640
|
ref_for: !0
|
|
1660
|
-
},
|
|
1661
|
-
size: "small",
|
|
1662
|
-
style: { width: "100%" }
|
|
1663
|
-
}), {
|
|
1641
|
+
}, e.conf.update.getBind(l), E(e.conf.update.getOn(l)), { style: { width: "100%" } }), {
|
|
1664
1642
|
default: h(() => [
|
|
1665
|
-
(f(!0), w(S, null, L(
|
|
1643
|
+
(f(!0), w(S, null, L(l.options?.select?.data, (c) => (f(), g(a(K), {
|
|
1666
1644
|
key: c.value,
|
|
1667
1645
|
label: c.label,
|
|
1668
1646
|
value: c.value
|
|
@@ -1670,31 +1648,31 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
1670
1648
|
]),
|
|
1671
1649
|
_: 2
|
|
1672
1650
|
}, 1040, ["modelValue", "onUpdate:modelValue"])) : C("", !0)
|
|
1673
|
-
], 64)) : k(e.$slots, "table-" +
|
|
1651
|
+
], 64)) : k(e.$slots, "table-" + l.key, {
|
|
1674
1652
|
key: 1,
|
|
1675
1653
|
row: r,
|
|
1676
|
-
item:
|
|
1654
|
+
item: l
|
|
1677
1655
|
}, () => [
|
|
1678
|
-
|
|
1656
|
+
a(j).customComponent[l.type ?? ""]?.table ? (f(), g(q(a(j).customComponent[l.type ?? ""]?.table), v({
|
|
1679
1657
|
key: 0,
|
|
1680
|
-
modelValue: r[
|
|
1681
|
-
"onUpdate:modelValue": (c) => r[
|
|
1658
|
+
modelValue: r[l.key],
|
|
1659
|
+
"onUpdate:modelValue": (c) => r[l.key] = c,
|
|
1682
1660
|
ref_for: !0
|
|
1683
|
-
},
|
|
1661
|
+
}, l.options?.[l.type ?? ""], E(l.options?.[l.type ?? ""]?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue"])) : l.type === "switch" ? (f(), g(a(ee), v({
|
|
1684
1662
|
key: 1,
|
|
1685
|
-
modelValue: r[
|
|
1686
|
-
"onUpdate:modelValue": (c) => r[
|
|
1687
|
-
"before-change": () =>
|
|
1663
|
+
modelValue: r[l.key],
|
|
1664
|
+
"onUpdate:modelValue": (c) => r[l.key] = c,
|
|
1665
|
+
"before-change": () => l.options?.switch?.tableBeforeChange?.(l.key, r),
|
|
1688
1666
|
ref_for: !0
|
|
1689
|
-
},
|
|
1667
|
+
}, l.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "before-change"])) : (f(), w("span", {
|
|
1690
1668
|
key: 2,
|
|
1691
1669
|
style: se({
|
|
1692
|
-
"--table-text-click-color":
|
|
1670
|
+
"--table-text-click-color": l.table?.click?.color
|
|
1693
1671
|
}),
|
|
1694
|
-
class:
|
|
1695
|
-
onClick: (c) =>
|
|
1696
|
-
innerHTML:
|
|
1697
|
-
}, null, 14,
|
|
1672
|
+
class: I({ "table-text-click": l.table?.click?.callback }),
|
|
1673
|
+
onClick: (c) => l.table?.click?.callback?.(r),
|
|
1674
|
+
innerHTML: l.table?.format ? l.table?.format(r) : r[l.key]
|
|
1675
|
+
}, null, 14, Ke))
|
|
1698
1676
|
])
|
|
1699
1677
|
], 64))
|
|
1700
1678
|
]),
|
|
@@ -1703,143 +1681,143 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
1703
1681
|
], 64))), 128);
|
|
1704
1682
|
};
|
|
1705
1683
|
}
|
|
1706
|
-
}),
|
|
1684
|
+
}), Je = {
|
|
1707
1685
|
class: "row form-item-content",
|
|
1708
1686
|
style: { width: "100%" }
|
|
1709
|
-
},
|
|
1687
|
+
}, We = { class: "col" }, qe = { class: "col" }, Ge = ["innerHTML"], Xe = /* @__PURE__ */ J({
|
|
1710
1688
|
__name: "formColumn",
|
|
1711
1689
|
props: {
|
|
1712
1690
|
conf: {},
|
|
1713
1691
|
item: {}
|
|
1714
1692
|
},
|
|
1715
|
-
setup(
|
|
1716
|
-
return (
|
|
1717
|
-
class:
|
|
1718
|
-
"hide-label": typeof
|
|
1693
|
+
setup(i) {
|
|
1694
|
+
return (t, d) => (f(), g(a(G), {
|
|
1695
|
+
class: I({
|
|
1696
|
+
"hide-label": typeof t.item.item.text?.form?.label == "boolean" ? !t.item.item.text?.form?.label : !1
|
|
1719
1697
|
}),
|
|
1720
|
-
label: typeof
|
|
1721
|
-
prop:
|
|
1722
|
-
"label-width":
|
|
1698
|
+
label: typeof t.item.item.text?.form?.label == "string" ? t.item.item.text?.form?.label : t.item.item.label,
|
|
1699
|
+
prop: t.item.item.key,
|
|
1700
|
+
"label-width": t.item.item.form?.labelWidth || t.conf.option.form?.labelWidth
|
|
1723
1701
|
}, {
|
|
1724
1702
|
default: h(() => [
|
|
1725
|
-
O("div",
|
|
1726
|
-
k(
|
|
1727
|
-
row:
|
|
1728
|
-
item:
|
|
1703
|
+
O("div", Je, [
|
|
1704
|
+
k(t.$slots, "form-" + t.item.item.key + "-start", {
|
|
1705
|
+
row: t.conf.update.form,
|
|
1706
|
+
item: t.item.item
|
|
1729
1707
|
}),
|
|
1730
|
-
O("div",
|
|
1731
|
-
O("div",
|
|
1732
|
-
k(
|
|
1733
|
-
row:
|
|
1734
|
-
item:
|
|
1708
|
+
O("div", We, [
|
|
1709
|
+
O("div", qe, [
|
|
1710
|
+
k(t.$slots, "form-" + t.item.item.key, {
|
|
1711
|
+
row: t.conf.update.form,
|
|
1712
|
+
item: t.item.item
|
|
1735
1713
|
}, () => [
|
|
1736
|
-
|
|
1714
|
+
t.item.item.type === "input" ? (f(), g(a(Q), v({
|
|
1737
1715
|
key: 0,
|
|
1738
|
-
modelValue:
|
|
1739
|
-
"onUpdate:modelValue": d[0] || (d[0] = (e) =>
|
|
1740
|
-
},
|
|
1741
|
-
disabled:
|
|
1742
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
1716
|
+
modelValue: t.conf.update.form[t.item.item.key],
|
|
1717
|
+
"onUpdate:modelValue": d[0] || (d[0] = (e) => t.conf.update.form[t.item.item.key] = e)
|
|
1718
|
+
}, t.conf.update.getBind(t.item.item), E(t.conf.update.getOn(t.item.item)), {
|
|
1719
|
+
disabled: t.conf.update.getDisabled(t.item.item)
|
|
1720
|
+
}), null, 16, ["modelValue", "disabled"])) : t.item.item.type === "switch" ? (f(), g(a(ee), v({
|
|
1743
1721
|
key: 1,
|
|
1744
|
-
modelValue:
|
|
1745
|
-
"onUpdate:modelValue": d[1] || (d[1] = (e) =>
|
|
1746
|
-
},
|
|
1747
|
-
disabled:
|
|
1748
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
1722
|
+
modelValue: t.conf.update.form[t.item.item.key],
|
|
1723
|
+
"onUpdate:modelValue": d[1] || (d[1] = (e) => t.conf.update.form[t.item.item.key] = e)
|
|
1724
|
+
}, t.conf.update.getBind(t.item.item), E(t.conf.update.getOn(t.item.item)), {
|
|
1725
|
+
disabled: t.conf.update.getDisabled(t.item.item)
|
|
1726
|
+
}), null, 16, ["modelValue", "disabled"])) : t.item.item.type === "select" ? (f(), g(a(W), v({
|
|
1749
1727
|
key: 2,
|
|
1750
|
-
modelValue:
|
|
1751
|
-
"onUpdate:modelValue": d[2] || (d[2] = (e) =>
|
|
1752
|
-
},
|
|
1753
|
-
disabled:
|
|
1728
|
+
modelValue: t.conf.update.form[t.item.item.key],
|
|
1729
|
+
"onUpdate:modelValue": d[2] || (d[2] = (e) => t.conf.update.form[t.item.item.key] = e)
|
|
1730
|
+
}, t.conf.update.getBind(t.item.item), E(t.conf.update.getOn(t.item.item)), {
|
|
1731
|
+
disabled: t.conf.update.getDisabled(t.item.item),
|
|
1754
1732
|
style: { width: "100%" }
|
|
1755
1733
|
}), {
|
|
1756
1734
|
default: h(() => [
|
|
1757
|
-
(f(!0), w(S, null, L(
|
|
1735
|
+
(f(!0), w(S, null, L(t.item.item.options?.select?.data, (e) => (f(), g(a(K), {
|
|
1758
1736
|
key: e.value,
|
|
1759
1737
|
label: e.label,
|
|
1760
1738
|
value: e.value
|
|
1761
1739
|
}, null, 8, ["label", "value"]))), 128))
|
|
1762
1740
|
]),
|
|
1763
1741
|
_: 1
|
|
1764
|
-
}, 16, ["modelValue", "disabled"])) :
|
|
1742
|
+
}, 16, ["modelValue", "disabled"])) : t.item.item.type === "radio" ? (f(), g(a(ce), v({
|
|
1765
1743
|
key: 3,
|
|
1766
|
-
modelValue:
|
|
1767
|
-
"onUpdate:modelValue": d[3] || (d[3] = (e) =>
|
|
1768
|
-
},
|
|
1769
|
-
disabled:
|
|
1744
|
+
modelValue: t.conf.update.form[t.item.item.key],
|
|
1745
|
+
"onUpdate:modelValue": d[3] || (d[3] = (e) => t.conf.update.form[t.item.item.key] = e)
|
|
1746
|
+
}, t.conf.update.getBind(t.item.item), E(t.conf.update.getOn(t.item.item)), {
|
|
1747
|
+
disabled: t.conf.update.getDisabled(t.item.item),
|
|
1770
1748
|
style: { width: "100%" }
|
|
1771
1749
|
}), {
|
|
1772
1750
|
default: h(() => [
|
|
1773
|
-
(f(!0), w(S, null, L(
|
|
1751
|
+
(f(!0), w(S, null, L(t.item.item.options?.radio?.data, (e) => (f(), g(a(pe), {
|
|
1774
1752
|
key: e.value,
|
|
1775
1753
|
label: e.label,
|
|
1776
1754
|
value: e.value
|
|
1777
1755
|
}, null, 8, ["label", "value"]))), 128))
|
|
1778
1756
|
]),
|
|
1779
1757
|
_: 1
|
|
1780
|
-
}, 16, ["modelValue", "disabled"])) :
|
|
1758
|
+
}, 16, ["modelValue", "disabled"])) : t.item.item.type === "list" ? (f(), g(ae, v({
|
|
1781
1759
|
key: 4,
|
|
1782
|
-
row:
|
|
1783
|
-
field:
|
|
1784
|
-
},
|
|
1785
|
-
disabled:
|
|
1760
|
+
row: t.conf.update.form,
|
|
1761
|
+
field: t.item.item.key
|
|
1762
|
+
}, t.conf.update.getBind(t.item.item), E(t.conf.update.getOn(t.item.item)), {
|
|
1763
|
+
disabled: t.conf.update.getDisabled(t.item.item),
|
|
1786
1764
|
style: { width: "100%" }
|
|
1787
|
-
}), null, 16, ["row", "field", "disabled"])) :
|
|
1765
|
+
}), null, 16, ["row", "field", "disabled"])) : t.item.item.type === "treeSelect" ? (f(), g(a(ne), v({
|
|
1788
1766
|
key: 5,
|
|
1789
|
-
modelValue:
|
|
1790
|
-
"onUpdate:modelValue": d[4] || (d[4] = (e) =>
|
|
1791
|
-
},
|
|
1792
|
-
disabled:
|
|
1767
|
+
modelValue: t.conf.update.form[t.item.item.key],
|
|
1768
|
+
"onUpdate:modelValue": d[4] || (d[4] = (e) => t.conf.update.form[t.item.item.key] = e)
|
|
1769
|
+
}, t.conf.update.getBind(t.item.item), E(t.conf.update.getOn(t.item.item)), {
|
|
1770
|
+
disabled: t.conf.update.getDisabled(t.item.item),
|
|
1793
1771
|
style: { width: "100%" }
|
|
1794
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
1772
|
+
}), null, 16, ["modelValue", "disabled"])) : t.item.item.type === "datetime" ? (f(), g(a(te), v({
|
|
1795
1773
|
key: 6,
|
|
1796
|
-
modelValue:
|
|
1797
|
-
"onUpdate:modelValue": d[5] || (d[5] = (e) =>
|
|
1798
|
-
},
|
|
1799
|
-
disabled:
|
|
1800
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
1774
|
+
modelValue: t.conf.update.form[t.item.item.key],
|
|
1775
|
+
"onUpdate:modelValue": d[5] || (d[5] = (e) => t.conf.update.form[t.item.item.key] = e)
|
|
1776
|
+
}, t.conf.update.getBind(t.item.item), E(t.conf.update.getOn(t.item.item)), {
|
|
1777
|
+
disabled: t.conf.update.getDisabled(t.item.item)
|
|
1778
|
+
}), null, 16, ["modelValue", "disabled"])) : t.item.item.type && (a(j).customComponent[t.item.item.type] || a(j).customComponent[t.item.item.type]?.form) ? (f(), g(q(a(j).customComponent[t.item.item.type]?.form || a(j).customComponent[t.item.item.type]), v({
|
|
1801
1779
|
key: 7,
|
|
1802
|
-
modelValue:
|
|
1803
|
-
"onUpdate:modelValue": d[6] || (d[6] = (e) =>
|
|
1804
|
-
},
|
|
1805
|
-
disabled:
|
|
1780
|
+
modelValue: t.conf.update.form[t.item.item.key],
|
|
1781
|
+
"onUpdate:modelValue": d[6] || (d[6] = (e) => t.conf.update.form[t.item.item.key] = e)
|
|
1782
|
+
}, t.conf.update.getBind(t.item.item), E(t.conf.update.getOn(t.item.item)), {
|
|
1783
|
+
disabled: t.conf.update.getDisabled(t.item.item)
|
|
1806
1784
|
}), null, 16, ["modelValue", "disabled"])) : C("", !0)
|
|
1807
1785
|
]),
|
|
1808
|
-
k(
|
|
1809
|
-
row:
|
|
1810
|
-
item:
|
|
1786
|
+
k(t.$slots, "form-" + t.item.item.key + "-right", {
|
|
1787
|
+
row: t.conf.update.form,
|
|
1788
|
+
item: t.item.item
|
|
1811
1789
|
})
|
|
1812
1790
|
]),
|
|
1813
|
-
k(
|
|
1814
|
-
row:
|
|
1815
|
-
item:
|
|
1791
|
+
k(t.$slots, "form-" + t.item.item.key + "-tip", {
|
|
1792
|
+
row: t.conf.update.form,
|
|
1793
|
+
item: t.item.item
|
|
1816
1794
|
}, () => [
|
|
1817
|
-
|
|
1795
|
+
t.item.item.form?.tipText ? (f(), w("div", {
|
|
1818
1796
|
key: 0,
|
|
1819
1797
|
class: "form-tip-text",
|
|
1820
|
-
innerHTML:
|
|
1821
|
-
}, null, 8,
|
|
1798
|
+
innerHTML: typeof t.item.item.form?.tipText == "function" ? t.item.item.form?.tipText(t.conf.update.form, t.conf.update.type) : t.item.item.form?.tipText
|
|
1799
|
+
}, null, 8, Ge)) : C("", !0)
|
|
1822
1800
|
])
|
|
1823
1801
|
]),
|
|
1824
|
-
k(
|
|
1825
|
-
row:
|
|
1826
|
-
item:
|
|
1802
|
+
k(t.$slots, "form-" + t.item.item.key + "-end", {
|
|
1803
|
+
row: t.conf.update.form,
|
|
1804
|
+
item: t.item.item
|
|
1827
1805
|
})
|
|
1828
1806
|
])
|
|
1829
1807
|
]),
|
|
1830
1808
|
_: 3
|
|
1831
1809
|
}, 8, ["class", "label", "prop", "label-width"]));
|
|
1832
1810
|
}
|
|
1833
|
-
}),
|
|
1811
|
+
}), Qe = {
|
|
1834
1812
|
key: 0,
|
|
1835
1813
|
class: "relative curd-search fit-width"
|
|
1836
|
-
},
|
|
1814
|
+
}, Ye = { class: "mb-10 flex justify-between items-center fit-width" }, Ze = {
|
|
1837
1815
|
class: "flex items-center",
|
|
1838
1816
|
style: { gap: "10px" }
|
|
1839
|
-
},
|
|
1817
|
+
}, xe = { key: 0 }, _e = { key: 1 }, et = { key: 2 }, tt = { class: "export-btn" }, ot = {
|
|
1840
1818
|
class: "flex items-center table-tools-right",
|
|
1841
1819
|
style: { gap: "10px" }
|
|
1842
|
-
}, at = { class: "row justify-end mt-10 mb-10 table-bottom-pagination" },
|
|
1820
|
+
}, at = { class: "row justify-end mt-10 mb-10 table-bottom-pagination" }, lt = { class: "dialog-footer" }, nt = { class: "dialog-footer" }, it = /* @__PURE__ */ J({
|
|
1843
1821
|
__name: "index",
|
|
1844
1822
|
props: {
|
|
1845
1823
|
/**
|
|
@@ -1849,137 +1827,137 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
1849
1827
|
default: {}
|
|
1850
1828
|
}
|
|
1851
1829
|
},
|
|
1852
|
-
setup(
|
|
1853
|
-
const d =
|
|
1854
|
-
return
|
|
1855
|
-
conf:
|
|
1830
|
+
setup(i, { expose: t }) {
|
|
1831
|
+
const d = U.EDialog, e = i, n = U.isFun, { conf: o, switchConfirmRef: l, ruleFormRef: r } = $e(e);
|
|
1832
|
+
return t({
|
|
1833
|
+
conf: o
|
|
1856
1834
|
}), (c, m) => {
|
|
1857
|
-
const u =
|
|
1835
|
+
const u = we("loading");
|
|
1858
1836
|
return f(), w("div", {
|
|
1859
|
-
class:
|
|
1837
|
+
class: I(["relative cc1-form-box", [i.option.table?.fitHeight ? "col" : "no-min-height"]])
|
|
1860
1838
|
}, [
|
|
1861
1839
|
O("div", {
|
|
1862
|
-
class:
|
|
1840
|
+
class: I(["row", [i.option.table?.fitHeight ? "absolute fit" : ""]]),
|
|
1863
1841
|
style: { overflow: "hidden" }
|
|
1864
1842
|
}, [
|
|
1865
1843
|
k(c.$slots, "box-left"),
|
|
1866
1844
|
O("div", {
|
|
1867
|
-
class:
|
|
1845
|
+
class: I(["column fit-width no-wrap", [i.option.table?.fitHeight ? "col" : ""]])
|
|
1868
1846
|
}, [
|
|
1869
|
-
|
|
1870
|
-
V(
|
|
1871
|
-
model: o
|
|
1847
|
+
i.option.search?.show !== !1 ? (f(), w("div", Qe, [
|
|
1848
|
+
V(a(N), {
|
|
1849
|
+
model: a(o).search.form,
|
|
1872
1850
|
inline: "",
|
|
1873
|
-
size:
|
|
1851
|
+
size: i.option.size?.search
|
|
1874
1852
|
}, {
|
|
1875
1853
|
default: h(() => [
|
|
1876
1854
|
k(c.$slots, "search-start", {
|
|
1877
|
-
row: o
|
|
1855
|
+
row: a(o).search.form
|
|
1878
1856
|
}),
|
|
1879
|
-
(f(!0), w(S, null, L(o
|
|
1857
|
+
(f(!0), w(S, null, L(a(o).search.column.list, (s) => (f(), w(S, {
|
|
1880
1858
|
key: s.key
|
|
1881
1859
|
}, [
|
|
1882
|
-
(typeof s.show?.search == "function" ? s.show?.search(o
|
|
1860
|
+
(typeof s.show?.search == "function" ? s.show?.search(a(o).search.form) : s.show?.search) ? (f(), g(a(G), {
|
|
1883
1861
|
key: 0,
|
|
1884
1862
|
label: typeof s.text?.search?.label == "string" ? s.text?.search?.label : s.label,
|
|
1885
|
-
class:
|
|
1863
|
+
class: I({
|
|
1886
1864
|
"hide-label": typeof s.text?.search?.label == "boolean" ? !s.text?.search?.label : !1
|
|
1887
1865
|
})
|
|
1888
1866
|
}, {
|
|
1889
1867
|
default: h(() => [
|
|
1890
1868
|
k(c.$slots, "search-" + s.key, {
|
|
1891
|
-
row: o
|
|
1869
|
+
row: a(o).search.form
|
|
1892
1870
|
}, () => [
|
|
1893
|
-
s.type === "input" ? (f(),
|
|
1871
|
+
s.type === "input" ? (f(), g(a(Q), v({
|
|
1894
1872
|
key: 0,
|
|
1895
|
-
modelValue: o
|
|
1896
|
-
"onUpdate:modelValue": (p) => o
|
|
1897
|
-
placeholder: o
|
|
1873
|
+
modelValue: a(o).search.form[s.key],
|
|
1874
|
+
"onUpdate:modelValue": (p) => a(o).search.form[s.key] = p,
|
|
1875
|
+
placeholder: a(o).search.getPlaceholder(s),
|
|
1898
1876
|
clearable: "",
|
|
1899
1877
|
disabled: s.disabled?.search,
|
|
1900
1878
|
ref_for: !0
|
|
1901
|
-
}, s.options?.search?.input || s.options?.input,
|
|
1879
|
+
}, s.options?.search?.input || s.options?.input, E(s.options?.search?.input?.on || s.options?.input?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : s.type === "switch" ? (f(), g(a(W), v({
|
|
1902
1880
|
key: 1,
|
|
1903
|
-
modelValue: o
|
|
1904
|
-
"onUpdate:modelValue": (p) => o
|
|
1905
|
-
placeholder: o
|
|
1881
|
+
modelValue: a(o).search.form[s.key],
|
|
1882
|
+
"onUpdate:modelValue": (p) => a(o).search.form[s.key] = p,
|
|
1883
|
+
placeholder: a(o).search.getPlaceholder(s, a(b).tCurd("placeholderSelect")),
|
|
1906
1884
|
clearable: "",
|
|
1907
1885
|
disabled: s.disabled?.search,
|
|
1908
1886
|
ref_for: !0
|
|
1909
|
-
}, s.options?.search?.switch || s.options?.switch,
|
|
1887
|
+
}, s.options?.search?.switch || s.options?.switch, E(s.options?.search?.switch?.on || s.options?.switch?.on || {})), {
|
|
1910
1888
|
default: h(() => [
|
|
1911
|
-
(f(),
|
|
1889
|
+
(f(), g(a(K), {
|
|
1912
1890
|
key: s.options?.switch?.activeValue,
|
|
1913
1891
|
label: s.options?.switch?.activeLabel,
|
|
1914
1892
|
value: s.options?.switch?.activeValue
|
|
1915
1893
|
}, null, 8, ["label", "value"])),
|
|
1916
|
-
(f(),
|
|
1894
|
+
(f(), g(a(K), {
|
|
1917
1895
|
key: s.options?.switch?.inactiveValue,
|
|
1918
1896
|
label: s.options?.switch?.inactiveLabel,
|
|
1919
1897
|
value: s.options?.switch?.inactiveValue
|
|
1920
1898
|
}, null, 8, ["label", "value"]))
|
|
1921
1899
|
]),
|
|
1922
1900
|
_: 2
|
|
1923
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : s.type === "select" ? (f(),
|
|
1901
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : s.type === "select" ? (f(), g(a(W), v({
|
|
1924
1902
|
key: 2,
|
|
1925
|
-
modelValue: o
|
|
1926
|
-
"onUpdate:modelValue": (p) => o
|
|
1927
|
-
placeholder: o
|
|
1903
|
+
modelValue: a(o).search.form[s.key],
|
|
1904
|
+
"onUpdate:modelValue": (p) => a(o).search.form[s.key] = p,
|
|
1905
|
+
placeholder: a(o).search.getPlaceholder(s, a(b).tCurd("placeholderSelect")),
|
|
1928
1906
|
clearable: "",
|
|
1929
1907
|
disabled: s.disabled?.search,
|
|
1930
1908
|
ref_for: !0
|
|
1931
|
-
}, s.options?.search?.select || s.options?.select,
|
|
1909
|
+
}, s.options?.search?.select || s.options?.select, E(s.options?.search?.select?.on || s.options?.select?.on || {})), {
|
|
1932
1910
|
default: h(() => [
|
|
1933
|
-
(f(!0), w(S, null, L(s.options?.select?.data, (p) => (f(),
|
|
1911
|
+
(f(!0), w(S, null, L(s.options?.select?.data, (p) => (f(), g(a(K), {
|
|
1934
1912
|
key: p.value,
|
|
1935
1913
|
label: p.label,
|
|
1936
1914
|
value: p.value
|
|
1937
1915
|
}, null, 8, ["label", "value"]))), 128))
|
|
1938
1916
|
]),
|
|
1939
1917
|
_: 2
|
|
1940
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : s.type === "datetime" ? (f(),
|
|
1918
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : s.type === "datetime" ? (f(), g(a(te), v({
|
|
1941
1919
|
key: 3,
|
|
1942
|
-
modelValue: o
|
|
1943
|
-
"onUpdate:modelValue": (p) => o
|
|
1920
|
+
modelValue: a(o).search.form[s.key],
|
|
1921
|
+
"onUpdate:modelValue": (p) => a(o).search.form[s.key] = p,
|
|
1944
1922
|
disabled: s.disabled?.search,
|
|
1945
1923
|
ref_for: !0
|
|
1946
|
-
}, s.options?.search?.datetime || s.options?.datetime,
|
|
1924
|
+
}, s.options?.search?.datetime || s.options?.datetime, E(s.options?.search?.datetime?.on || s.options?.datetime?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : s.type && a(j).customComponent[s.type] ? (f(), g(q(a(j).customComponent[s.type]), v({
|
|
1947
1925
|
key: 4,
|
|
1948
|
-
modelValue: o
|
|
1949
|
-
"onUpdate:modelValue": (p) => o
|
|
1926
|
+
modelValue: a(o).search.form[s.key],
|
|
1927
|
+
"onUpdate:modelValue": (p) => a(o).search.form[s.key] = p,
|
|
1950
1928
|
ref_for: !0
|
|
1951
|
-
}, s.options?.search?.[s.type] || s.options?.[s.type],
|
|
1929
|
+
}, s.options?.search?.[s.type] || s.options?.[s.type], E(s.options?.search?.[s.type]?.on || s.options?.[s.type]?.on || {}), {
|
|
1952
1930
|
disabled: s.disabled?.search
|
|
1953
1931
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : C("", !0)
|
|
1954
1932
|
]),
|
|
1955
1933
|
k(c.$slots, "search-" + s.key + "-right", {
|
|
1956
|
-
row: o
|
|
1934
|
+
row: a(o).search.form
|
|
1957
1935
|
})
|
|
1958
1936
|
]),
|
|
1959
1937
|
_: 2
|
|
1960
1938
|
}, 1032, ["label", "class"])) : C("", !0)
|
|
1961
1939
|
], 64))), 128)),
|
|
1962
1940
|
k(c.$slots, "search-center", {
|
|
1963
|
-
row: o
|
|
1941
|
+
row: a(o).search.form
|
|
1964
1942
|
}),
|
|
1965
|
-
|
|
1943
|
+
i.option.tools?.search || i.option.tools?.reset ? (f(), g(a(G), { key: 0 }, {
|
|
1966
1944
|
default: h(() => [
|
|
1967
|
-
|
|
1945
|
+
i.option.tools?.search ? (f(), g(a(F), {
|
|
1968
1946
|
key: 0,
|
|
1969
1947
|
type: "primary",
|
|
1970
|
-
onClick: o
|
|
1948
|
+
onClick: a(o).search.submit
|
|
1971
1949
|
}, {
|
|
1972
1950
|
default: h(() => [
|
|
1973
|
-
|
|
1951
|
+
D($(a(b).tCurd("search")), 1)
|
|
1974
1952
|
]),
|
|
1975
1953
|
_: 1
|
|
1976
1954
|
}, 8, ["onClick"])) : C("", !0),
|
|
1977
|
-
|
|
1955
|
+
i.option.tools?.reset ? (f(), g(a(F), {
|
|
1978
1956
|
key: 1,
|
|
1979
|
-
onClick: o
|
|
1957
|
+
onClick: a(o).search.reset
|
|
1980
1958
|
}, {
|
|
1981
1959
|
default: h(() => [
|
|
1982
|
-
|
|
1960
|
+
D($(a(b).tCurd("reset")), 1)
|
|
1983
1961
|
]),
|
|
1984
1962
|
_: 1
|
|
1985
1963
|
}, 8, ["onClick"])) : C("", !0)
|
|
@@ -1987,77 +1965,77 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
1987
1965
|
_: 1
|
|
1988
1966
|
})) : C("", !0),
|
|
1989
1967
|
k(c.$slots, "search-end", {
|
|
1990
|
-
row: o
|
|
1968
|
+
row: a(o).search.form
|
|
1991
1969
|
})
|
|
1992
1970
|
]),
|
|
1993
1971
|
_: 3
|
|
1994
1972
|
}, 8, ["model", "size"])
|
|
1995
1973
|
])) : C("", !0),
|
|
1996
|
-
O("div",
|
|
1997
|
-
O("div",
|
|
1998
|
-
|
|
1999
|
-
V(
|
|
1974
|
+
O("div", Ye, [
|
|
1975
|
+
O("div", Ze, [
|
|
1976
|
+
a(n)(i.option.tools?.add) ? (f(), w("div", xe, [
|
|
1977
|
+
V(a(F), {
|
|
2000
1978
|
type: "primary",
|
|
2001
|
-
onClick: m[0] || (m[0] = (s) => o
|
|
2002
|
-
size:
|
|
1979
|
+
onClick: m[0] || (m[0] = (s) => a(o).update.open(a(d).Add)),
|
|
1980
|
+
size: i.option.size?.search
|
|
2003
1981
|
}, {
|
|
2004
1982
|
default: h(() => [
|
|
2005
|
-
|
|
1983
|
+
D($(a(b).tCurd("add")), 1)
|
|
2006
1984
|
]),
|
|
2007
1985
|
_: 1
|
|
2008
1986
|
}, 8, ["size"])
|
|
2009
1987
|
])) : C("", !0),
|
|
2010
|
-
|
|
2011
|
-
V(
|
|
1988
|
+
i.option.table?.selectable && a(n)(i.option.tools?.delete) ? (f(), w("div", _e, [
|
|
1989
|
+
V(a(F), {
|
|
2012
1990
|
type: "danger",
|
|
2013
|
-
onClick: m[1] || (m[1] = (s) => o
|
|
2014
|
-
size:
|
|
1991
|
+
onClick: m[1] || (m[1] = (s) => a(o).remove.open(a(o).table.selection.list)),
|
|
1992
|
+
size: i.option.size?.search
|
|
2015
1993
|
}, {
|
|
2016
1994
|
default: h(() => [
|
|
2017
|
-
|
|
1995
|
+
D($(a(b).tCurd("delete")), 1)
|
|
2018
1996
|
]),
|
|
2019
1997
|
_: 1
|
|
2020
1998
|
}, 8, ["size"])
|
|
2021
1999
|
])) : C("", !0),
|
|
2022
|
-
|
|
2023
|
-
V(
|
|
2000
|
+
i.option.tools?.expand ? (f(), w("div", et, [
|
|
2001
|
+
V(a(F), {
|
|
2024
2002
|
type: "warning",
|
|
2025
|
-
onClick: m[2] || (m[2] = (s) => o
|
|
2026
|
-
size:
|
|
2003
|
+
onClick: m[2] || (m[2] = (s) => a(o).table.expand.all()),
|
|
2004
|
+
size: i.option.size?.search
|
|
2027
2005
|
}, {
|
|
2028
2006
|
default: h(() => [
|
|
2029
|
-
|
|
2007
|
+
D($(a(b).tCurd("expandCollapse")), 1)
|
|
2030
2008
|
]),
|
|
2031
2009
|
_: 1
|
|
2032
2010
|
}, 8, ["size"])
|
|
2033
2011
|
])) : C("", !0),
|
|
2034
|
-
|
|
2012
|
+
i.option.tools?.export?.show ? (f(), g(a(me), {
|
|
2035
2013
|
key: 3,
|
|
2036
|
-
onCommand: o
|
|
2014
|
+
onCommand: a(o).export.click
|
|
2037
2015
|
}, {
|
|
2038
2016
|
dropdown: h(() => [
|
|
2039
|
-
V(
|
|
2040
|
-
size:
|
|
2017
|
+
V(a(he), {
|
|
2018
|
+
size: i.option.size?.search
|
|
2041
2019
|
}, {
|
|
2042
2020
|
default: h(() => [
|
|
2043
|
-
|
|
2021
|
+
i.option.table?.selectable ? (f(), g(a(Y), {
|
|
2044
2022
|
key: 0,
|
|
2045
2023
|
command: "select"
|
|
2046
2024
|
}, {
|
|
2047
2025
|
default: h(() => [
|
|
2048
|
-
|
|
2026
|
+
D($(a(b).tCurd("exportSelect")), 1)
|
|
2049
2027
|
]),
|
|
2050
2028
|
_: 1
|
|
2051
2029
|
})) : C("", !0),
|
|
2052
|
-
V(
|
|
2030
|
+
V(a(Y), { command: "page" }, {
|
|
2053
2031
|
default: h(() => [
|
|
2054
|
-
|
|
2032
|
+
D($(a(b).tCurd("exportPage")), 1)
|
|
2055
2033
|
]),
|
|
2056
2034
|
_: 1
|
|
2057
2035
|
}),
|
|
2058
|
-
V(
|
|
2036
|
+
V(a(Y), { command: "all" }, {
|
|
2059
2037
|
default: h(() => [
|
|
2060
|
-
|
|
2038
|
+
D($(a(b).tCurd("exportAll")), 1)
|
|
2061
2039
|
]),
|
|
2062
2040
|
_: 1
|
|
2063
2041
|
})
|
|
@@ -2066,14 +2044,14 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2066
2044
|
}, 8, ["size"])
|
|
2067
2045
|
]),
|
|
2068
2046
|
default: h(() => [
|
|
2069
|
-
O("div",
|
|
2070
|
-
V(
|
|
2047
|
+
O("div", tt, [
|
|
2048
|
+
V(a(F), {
|
|
2071
2049
|
type: "warning",
|
|
2072
|
-
loading: o
|
|
2073
|
-
size:
|
|
2050
|
+
loading: a(o).export.loading,
|
|
2051
|
+
size: i.option.size?.search
|
|
2074
2052
|
}, {
|
|
2075
2053
|
default: h(() => [
|
|
2076
|
-
|
|
2054
|
+
D($(a(b).tCurd("export")), 1)
|
|
2077
2055
|
]),
|
|
2078
2056
|
_: 1
|
|
2079
2057
|
}, 8, ["loading", "size"])
|
|
@@ -2083,151 +2061,151 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2083
2061
|
}, 8, ["onCommand"])) : C("", !0),
|
|
2084
2062
|
k(c.$slots, "tools-left")
|
|
2085
2063
|
]),
|
|
2086
|
-
O("div",
|
|
2064
|
+
O("div", ot, [
|
|
2087
2065
|
k(c.$slots, "tools-right"),
|
|
2088
|
-
o
|
|
2066
|
+
a(o).page.showTools ? (f(), g(a(le), v({
|
|
2089
2067
|
key: 0,
|
|
2090
|
-
"current-page": o
|
|
2091
|
-
"onUpdate:currentPage": m[3] || (m[3] = (s) => o
|
|
2092
|
-
"page-size": o
|
|
2093
|
-
"onUpdate:pageSize": m[4] || (m[4] = (s) => o
|
|
2068
|
+
"current-page": a(o).page.num,
|
|
2069
|
+
"onUpdate:currentPage": m[3] || (m[3] = (s) => a(o).page.num = s),
|
|
2070
|
+
"page-size": a(o).page.size,
|
|
2071
|
+
"onUpdate:pageSize": m[4] || (m[4] = (s) => a(o).page.size = s),
|
|
2094
2072
|
background: "",
|
|
2095
|
-
"page-sizes": o
|
|
2096
|
-
"pager-count": o
|
|
2097
|
-
layout: o
|
|
2098
|
-
total: o
|
|
2099
|
-
size:
|
|
2100
|
-
onSizeChange: o
|
|
2101
|
-
onCurrentChange: o
|
|
2102
|
-
},
|
|
2103
|
-
|
|
2073
|
+
"page-sizes": a(o).page.sizeList,
|
|
2074
|
+
"pager-count": a(o).page.pagerCount,
|
|
2075
|
+
layout: a(o).page.layout,
|
|
2076
|
+
total: a(o).page.total,
|
|
2077
|
+
size: i.option.size?.table,
|
|
2078
|
+
onSizeChange: a(o).table.getList,
|
|
2079
|
+
onCurrentChange: a(o).table.getList
|
|
2080
|
+
}, i.option.page?.pagination || {}, E(i.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : C("", !0),
|
|
2081
|
+
i.option.tools?.refresh === void 0 || i.option.tools?.refresh ? (f(), w("div", {
|
|
2104
2082
|
key: 1,
|
|
2105
|
-
class:
|
|
2083
|
+
class: I(["refresh-btn", [i.option.size?.search]]),
|
|
2106
2084
|
onClick: m[5] || (m[5] = //@ts-ignore
|
|
2107
|
-
(...s) => o
|
|
2085
|
+
(...s) => a(o).table.getList && a(o).table.getList(...s))
|
|
2108
2086
|
}, [
|
|
2109
|
-
V(
|
|
2087
|
+
V(Me)
|
|
2110
2088
|
], 2)) : C("", !0)
|
|
2111
2089
|
])
|
|
2112
2090
|
]),
|
|
2113
2091
|
O("div", {
|
|
2114
|
-
class:
|
|
2092
|
+
class: I(["fit-width relative form-box", [i.option.table?.fitHeight ? "col " : ""]])
|
|
2115
2093
|
}, [
|
|
2116
2094
|
O("div", {
|
|
2117
|
-
class:
|
|
2095
|
+
class: I(["column form-box-content", [i.option.table?.fitHeight ? "absolute fit" : ""]])
|
|
2118
2096
|
}, [
|
|
2119
|
-
|
|
2120
|
-
data: o
|
|
2121
|
-
border:
|
|
2122
|
-
onSelectionChange: o
|
|
2123
|
-
onSortChange: o
|
|
2124
|
-
"expand-row-keys": o
|
|
2125
|
-
onExpandChange: o
|
|
2126
|
-
},
|
|
2097
|
+
ke((f(), g(a(ge), v({
|
|
2098
|
+
data: a(o).table.data,
|
|
2099
|
+
border: i.option.table?.border === void 0 ? !0 : i.option.table?.border,
|
|
2100
|
+
onSelectionChange: a(o).table.selection.change,
|
|
2101
|
+
onSortChange: a(o).table.sort.change,
|
|
2102
|
+
"expand-row-keys": a(o).table.expand.rowKeys,
|
|
2103
|
+
onExpandChange: a(o).table.expand.change
|
|
2104
|
+
}, i.option.table, E(i.option.table?.on || {})), {
|
|
2127
2105
|
default: h(() => [
|
|
2128
|
-
|
|
2106
|
+
i.option.table?.selectable || a(n)(i.option.tools?.delete) || i.option.tools?.export?.show ? (f(), g(a(x), {
|
|
2129
2107
|
key: 0,
|
|
2130
2108
|
type: "selection",
|
|
2131
|
-
selectable: typeof
|
|
2109
|
+
selectable: typeof i.option.table?.selectable == "function" ? i.option.table?.selectable : void 0,
|
|
2132
2110
|
width: "40",
|
|
2133
2111
|
align: "center",
|
|
2134
2112
|
fixed: "left",
|
|
2135
2113
|
"show-overflow-tooltip": !1
|
|
2136
2114
|
}, null, 8, ["selectable"])) : C("", !0),
|
|
2137
2115
|
V(He, {
|
|
2138
|
-
conf: o
|
|
2139
|
-
columnList: o
|
|
2140
|
-
option:
|
|
2116
|
+
conf: a(o),
|
|
2117
|
+
columnList: a(o).table.column.list,
|
|
2118
|
+
option: i.option
|
|
2141
2119
|
}, _({ _: 2 }, [
|
|
2142
2120
|
L(c.$slots, (s, p) => ({
|
|
2143
2121
|
name: p,
|
|
2144
2122
|
fn: h((y) => [
|
|
2145
|
-
k(c.$slots, p, ve(
|
|
2123
|
+
k(c.$slots, p, Ce(ve(y || {})))
|
|
2146
2124
|
])
|
|
2147
2125
|
}))
|
|
2148
2126
|
]), 1032, ["conf", "columnList", "option"]),
|
|
2149
|
-
|
|
2127
|
+
a(n)(i.option.table?.add) || a(n)(i.option.table?.update) || a(n)(i.option.table?.delete) || a(n)(i.option.table?.view) || c.$slots["table-op-left"] || c.$slots["table-op-right"] ? (f(), g(a(x), v({
|
|
2150
2128
|
key: 1,
|
|
2151
|
-
width: o
|
|
2129
|
+
width: a(o).table.op.width(a(n)(i.option.table?.add), a(n)(i.option.table?.update), a(n)(i.option.table?.delete), a(n)(i.option.table?.view), c.$slots["table-op-left"], c.$slots["table-op-right"]),
|
|
2152
2130
|
align: "center",
|
|
2153
2131
|
fixed: "right"
|
|
2154
|
-
},
|
|
2132
|
+
}, i.option.table?.operate), {
|
|
2155
2133
|
header: h(() => [
|
|
2156
2134
|
k(c.$slots, "table-header-op", {}, () => [
|
|
2157
|
-
|
|
2135
|
+
D($(a(b).tCurd("operation")), 1)
|
|
2158
2136
|
])
|
|
2159
2137
|
]),
|
|
2160
2138
|
default: h(({ row: s }) => [
|
|
2161
|
-
V(
|
|
2162
|
-
size:
|
|
2139
|
+
V(a(N), {
|
|
2140
|
+
size: i.option.size?.table
|
|
2163
2141
|
}, {
|
|
2164
2142
|
default: h(() => [
|
|
2165
2143
|
k(c.$slots, "table-op-left", { row: s }),
|
|
2166
|
-
|
|
2167
|
-
V(
|
|
2144
|
+
i.option.table?.inlineEdit && a(o).inlineEdit.data === s ? (f(), w(S, { key: 0 }, [
|
|
2145
|
+
V(a(F), {
|
|
2168
2146
|
link: "",
|
|
2169
2147
|
type: "info",
|
|
2170
|
-
onClick: o
|
|
2148
|
+
onClick: a(o).inlineEdit.close
|
|
2171
2149
|
}, {
|
|
2172
2150
|
default: h(() => [
|
|
2173
|
-
|
|
2151
|
+
D($(a(b).tCurd("cancel")), 1)
|
|
2174
2152
|
]),
|
|
2175
2153
|
_: 1
|
|
2176
2154
|
}, 8, ["onClick"]),
|
|
2177
|
-
V(
|
|
2155
|
+
V(a(F), {
|
|
2178
2156
|
link: "",
|
|
2179
2157
|
type: "primary",
|
|
2180
|
-
onClick: o
|
|
2181
|
-
loading: o
|
|
2158
|
+
onClick: a(o).update.submit,
|
|
2159
|
+
loading: a(o).update.loading
|
|
2182
2160
|
}, {
|
|
2183
2161
|
default: h(() => [
|
|
2184
|
-
|
|
2162
|
+
D($(a(b).tCurd("confirm")), 1)
|
|
2185
2163
|
]),
|
|
2186
2164
|
_: 1
|
|
2187
2165
|
}, 8, ["onClick", "loading"]),
|
|
2188
2166
|
k(c.$slots, "table-op-edit-right", { row: s })
|
|
2189
2167
|
], 64)) : (f(), w(S, { key: 1 }, [
|
|
2190
|
-
|
|
2168
|
+
a(n)(i.option.table?.add, s) ? (f(), g(a(F), {
|
|
2191
2169
|
key: 0,
|
|
2192
2170
|
link: "",
|
|
2193
2171
|
type: "primary",
|
|
2194
|
-
onClick: (p) => o
|
|
2172
|
+
onClick: (p) => a(o).update.open(a(d).Add, s)
|
|
2195
2173
|
}, {
|
|
2196
2174
|
default: h(() => [
|
|
2197
|
-
|
|
2175
|
+
D($(a(b).tCurd("add")), 1)
|
|
2198
2176
|
]),
|
|
2199
2177
|
_: 2
|
|
2200
2178
|
}, 1032, ["onClick"])) : C("", !0),
|
|
2201
|
-
|
|
2179
|
+
a(n)(i.option.table?.view, s) ? (f(), g(a(F), {
|
|
2202
2180
|
key: 1,
|
|
2203
2181
|
link: "",
|
|
2204
2182
|
type: "primary",
|
|
2205
|
-
onClick: (p) => o
|
|
2183
|
+
onClick: (p) => a(o).update.open(a(d).View, s)
|
|
2206
2184
|
}, {
|
|
2207
2185
|
default: h(() => [
|
|
2208
|
-
|
|
2186
|
+
D($(a(b).tCurd("view")), 1)
|
|
2209
2187
|
]),
|
|
2210
2188
|
_: 2
|
|
2211
2189
|
}, 1032, ["onClick"])) : C("", !0),
|
|
2212
|
-
|
|
2190
|
+
a(n)(i.option.table?.update, s) ? (f(), g(a(F), {
|
|
2213
2191
|
key: 2,
|
|
2214
2192
|
link: "",
|
|
2215
2193
|
type: "warning",
|
|
2216
|
-
onClick: (p) => o
|
|
2194
|
+
onClick: (p) => a(o).update.open(a(d).Update, s)
|
|
2217
2195
|
}, {
|
|
2218
2196
|
default: h(() => [
|
|
2219
|
-
|
|
2197
|
+
D($(a(b).tCurd("edit")), 1)
|
|
2220
2198
|
]),
|
|
2221
2199
|
_: 2
|
|
2222
2200
|
}, 1032, ["onClick"])) : C("", !0),
|
|
2223
|
-
|
|
2201
|
+
a(n)(i.option.table?.delete, s) ? (f(), g(a(F), {
|
|
2224
2202
|
key: 3,
|
|
2225
2203
|
link: "",
|
|
2226
2204
|
type: "danger",
|
|
2227
|
-
onClick: (p) => o
|
|
2205
|
+
onClick: (p) => a(o).remove.open([s])
|
|
2228
2206
|
}, {
|
|
2229
2207
|
default: h(() => [
|
|
2230
|
-
|
|
2208
|
+
D($(a(b).tCurd("delete")), 1)
|
|
2231
2209
|
]),
|
|
2232
2210
|
_: 2
|
|
2233
2211
|
}, 1032, ["onClick"])) : C("", !0),
|
|
@@ -2242,58 +2220,58 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2242
2220
|
]),
|
|
2243
2221
|
_: 3
|
|
2244
2222
|
}, 16, ["data", "border", "onSelectionChange", "onSortChange", "expand-row-keys", "onExpandChange"])), [
|
|
2245
|
-
[u, o
|
|
2223
|
+
[u, a(o).table.loading]
|
|
2246
2224
|
])
|
|
2247
2225
|
], 2)
|
|
2248
2226
|
], 2),
|
|
2249
2227
|
O("div", at, [
|
|
2250
|
-
(
|
|
2228
|
+
(i.option.page?.show === void 0 || i.option.page?.show) && !a(o).page.showTools ? (f(), g(a(le), v({
|
|
2251
2229
|
key: 0,
|
|
2252
|
-
"current-page": o
|
|
2253
|
-
"onUpdate:currentPage": m[6] || (m[6] = (s) => o
|
|
2254
|
-
"page-size": o
|
|
2255
|
-
"onUpdate:pageSize": m[7] || (m[7] = (s) => o
|
|
2230
|
+
"current-page": a(o).page.num,
|
|
2231
|
+
"onUpdate:currentPage": m[6] || (m[6] = (s) => a(o).page.num = s),
|
|
2232
|
+
"page-size": a(o).page.size,
|
|
2233
|
+
"onUpdate:pageSize": m[7] || (m[7] = (s) => a(o).page.size = s),
|
|
2256
2234
|
background: "",
|
|
2257
|
-
"page-sizes": o
|
|
2258
|
-
"pager-count": o
|
|
2259
|
-
layout: o
|
|
2260
|
-
total: o
|
|
2261
|
-
size:
|
|
2262
|
-
onSizeChange: o
|
|
2263
|
-
onCurrentChange: o
|
|
2264
|
-
},
|
|
2235
|
+
"page-sizes": a(o).page.sizeList,
|
|
2236
|
+
"pager-count": a(o).page.pagerCount,
|
|
2237
|
+
layout: a(o).page.layout,
|
|
2238
|
+
total: a(o).page.total,
|
|
2239
|
+
size: i.option.size?.table,
|
|
2240
|
+
onSizeChange: a(o).table.getList,
|
|
2241
|
+
onCurrentChange: a(o).table.getList
|
|
2242
|
+
}, i.option.page?.pagination || {}, E(i.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : C("", !0)
|
|
2265
2243
|
])
|
|
2266
2244
|
], 2),
|
|
2267
2245
|
k(c.$slots, "box-right")
|
|
2268
2246
|
], 2),
|
|
2269
|
-
V(
|
|
2270
|
-
modelValue: o
|
|
2271
|
-
"onUpdate:modelValue": m[8] || (m[8] = (s) => o
|
|
2272
|
-
title: o
|
|
2273
|
-
"before-close": o
|
|
2274
|
-
},
|
|
2247
|
+
V(a(Z), v({
|
|
2248
|
+
modelValue: a(o).update.show,
|
|
2249
|
+
"onUpdate:modelValue": m[8] || (m[8] = (s) => a(o).update.show = s),
|
|
2250
|
+
title: a(o).update.title,
|
|
2251
|
+
"before-close": a(o).update.close
|
|
2252
|
+
}, i.option.dialog), {
|
|
2275
2253
|
footer: h(() => [
|
|
2276
|
-
O("span",
|
|
2277
|
-
V(
|
|
2278
|
-
size:
|
|
2254
|
+
O("span", lt, [
|
|
2255
|
+
V(a(N), {
|
|
2256
|
+
size: i.option.size?.form
|
|
2279
2257
|
}, {
|
|
2280
2258
|
default: h(() => [
|
|
2281
|
-
V(
|
|
2282
|
-
onClick: o
|
|
2259
|
+
V(a(F), {
|
|
2260
|
+
onClick: a(o).update.close
|
|
2283
2261
|
}, {
|
|
2284
2262
|
default: h(() => [
|
|
2285
|
-
|
|
2263
|
+
D($(a(b).tCurd("close")), 1)
|
|
2286
2264
|
]),
|
|
2287
2265
|
_: 1
|
|
2288
2266
|
}, 8, ["onClick"]),
|
|
2289
|
-
o
|
|
2267
|
+
a(o).update.type !== a(d).View ? (f(), g(a(F), {
|
|
2290
2268
|
key: 0,
|
|
2291
2269
|
type: "primary",
|
|
2292
|
-
onClick: o
|
|
2293
|
-
loading: o
|
|
2270
|
+
onClick: a(o).update.submit,
|
|
2271
|
+
loading: a(o).update.loading
|
|
2294
2272
|
}, {
|
|
2295
2273
|
default: h(() => [
|
|
2296
|
-
|
|
2274
|
+
D($(a(b).tCurd("submit")), 1)
|
|
2297
2275
|
]),
|
|
2298
2276
|
_: 1
|
|
2299
2277
|
}, 8, ["onClick", "loading"])) : C("", !0)
|
|
@@ -2303,54 +2281,54 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2303
2281
|
])
|
|
2304
2282
|
]),
|
|
2305
2283
|
default: h(() => [
|
|
2306
|
-
V(
|
|
2284
|
+
V(a(N), {
|
|
2307
2285
|
ref_key: "ruleFormRef",
|
|
2308
2286
|
ref: r,
|
|
2309
|
-
model: o
|
|
2310
|
-
rules: o
|
|
2311
|
-
size:
|
|
2287
|
+
model: a(o).update.form,
|
|
2288
|
+
rules: a(o).update.rules,
|
|
2289
|
+
size: i.option.size?.form
|
|
2312
2290
|
}, {
|
|
2313
2291
|
default: h(() => [
|
|
2314
|
-
o
|
|
2315
|
-
|
|
2292
|
+
a(o).update.showContent ? (f(!0), w(S, { key: 0 }, L(a(o).update.formColumn, (s) => (f(), w(S, null, [
|
|
2293
|
+
a(n)(
|
|
2316
2294
|
(() => {
|
|
2317
|
-
const p = [], y = (
|
|
2318
|
-
|
|
2295
|
+
const p = [], y = (T) => {
|
|
2296
|
+
T?.item?.children ? y(T.item.children) : p.push(...T.map((A) => A.item?.show?.form));
|
|
2319
2297
|
};
|
|
2320
2298
|
return y(s), p;
|
|
2321
2299
|
})(),
|
|
2322
|
-
o
|
|
2323
|
-
o
|
|
2300
|
+
a(o).update.form,
|
|
2301
|
+
a(o).update.type
|
|
2324
2302
|
) ? (f(), w("div", {
|
|
2325
2303
|
key: 0,
|
|
2326
|
-
class:
|
|
2327
|
-
stripe:
|
|
2304
|
+
class: I(["row curd-row", {
|
|
2305
|
+
stripe: i.option.form?.stripe === void 0 ? !0 : i.option.form?.stripe
|
|
2328
2306
|
}])
|
|
2329
2307
|
}, [
|
|
2330
2308
|
k(c.$slots, "form-start", {
|
|
2331
|
-
row: o
|
|
2309
|
+
row: a(o).update.form
|
|
2332
2310
|
}),
|
|
2333
2311
|
(f(!0), w(S, null, L(s, (p) => (f(), w(S, null, [
|
|
2334
|
-
|
|
2312
|
+
a(n)(p.item.show?.form, a(o).update.form, a(o).update.type) ? (f(), w("div", {
|
|
2335
2313
|
key: 0,
|
|
2336
|
-
class:
|
|
2314
|
+
class: I([p.item.form.span > 0 ? `col-${a(o).getColumnSpan(p, s)}` : "col", `form-item-col-${p.item.key}`])
|
|
2337
2315
|
}, [
|
|
2338
|
-
(f(!0), w(S, null, L(p.item.children ? p.children : [p], (y) => (f(),
|
|
2316
|
+
(f(!0), w(S, null, L(p.item.children ? p.children : [p], (y) => (f(), g(Xe, {
|
|
2339
2317
|
key: y.item.key,
|
|
2340
|
-
conf: o
|
|
2318
|
+
conf: a(o),
|
|
2341
2319
|
item: y
|
|
2342
2320
|
}, _({ _: 2 }, [
|
|
2343
|
-
L(c.$slots, (
|
|
2344
|
-
name:
|
|
2345
|
-
fn: h((
|
|
2346
|
-
k(c.$slots,
|
|
2321
|
+
L(c.$slots, (T, A) => ({
|
|
2322
|
+
name: A,
|
|
2323
|
+
fn: h((M) => [
|
|
2324
|
+
k(c.$slots, A, v({ ref_for: !0 }, M || {}))
|
|
2347
2325
|
])
|
|
2348
2326
|
}))
|
|
2349
2327
|
]), 1032, ["conf", "item"]))), 128))
|
|
2350
2328
|
], 2)) : C("", !0)
|
|
2351
2329
|
], 64))), 256)),
|
|
2352
2330
|
k(c.$slots, "form-end", {
|
|
2353
|
-
row: o
|
|
2331
|
+
row: a(o).update.form
|
|
2354
2332
|
})
|
|
2355
2333
|
], 2)) : C("", !0)
|
|
2356
2334
|
], 64))), 256)) : C("", !0)
|
|
@@ -2360,33 +2338,33 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2360
2338
|
]),
|
|
2361
2339
|
_: 3
|
|
2362
2340
|
}, 16, ["modelValue", "title", "before-close"]),
|
|
2363
|
-
V(
|
|
2364
|
-
modelValue: o
|
|
2365
|
-
"onUpdate:modelValue": m[9] || (m[9] = (s) => o
|
|
2366
|
-
title: o
|
|
2341
|
+
V(a(Z), {
|
|
2342
|
+
modelValue: a(o).remove.show,
|
|
2343
|
+
"onUpdate:modelValue": m[9] || (m[9] = (s) => a(o).remove.show = s),
|
|
2344
|
+
title: a(o).remove.title,
|
|
2367
2345
|
"close-on-click-modal": !1
|
|
2368
2346
|
}, {
|
|
2369
2347
|
footer: h(() => [
|
|
2370
2348
|
O("span", nt, [
|
|
2371
|
-
V(
|
|
2372
|
-
size:
|
|
2349
|
+
V(a(N), {
|
|
2350
|
+
size: i.option.size?.form
|
|
2373
2351
|
}, {
|
|
2374
2352
|
default: h(() => [
|
|
2375
|
-
V(
|
|
2376
|
-
onClick: o
|
|
2353
|
+
V(a(F), {
|
|
2354
|
+
onClick: a(o).remove.close
|
|
2377
2355
|
}, {
|
|
2378
2356
|
default: h(() => [
|
|
2379
|
-
|
|
2357
|
+
D($(a(b).tCurd("close")), 1)
|
|
2380
2358
|
]),
|
|
2381
2359
|
_: 1
|
|
2382
2360
|
}, 8, ["onClick"]),
|
|
2383
|
-
V(
|
|
2361
|
+
V(a(F), {
|
|
2384
2362
|
type: "danger",
|
|
2385
|
-
onClick: o
|
|
2386
|
-
loading: o
|
|
2363
|
+
onClick: a(o).remove.submit,
|
|
2364
|
+
loading: a(o).remove.loading
|
|
2387
2365
|
}, {
|
|
2388
2366
|
default: h(() => [
|
|
2389
|
-
|
|
2367
|
+
D($(a(b).tCurd("confirmDelete")), 1)
|
|
2390
2368
|
]),
|
|
2391
2369
|
_: 1
|
|
2392
2370
|
}, 8, ["onClick", "loading"])
|
|
@@ -2396,84 +2374,84 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2396
2374
|
])
|
|
2397
2375
|
]),
|
|
2398
2376
|
default: h(() => [
|
|
2399
|
-
O("div", null,
|
|
2377
|
+
O("div", null, $(a(b).tCurd("confirmDeleteMessage", a(o).remove.items.length)), 1)
|
|
2400
2378
|
]),
|
|
2401
2379
|
_: 1
|
|
2402
2380
|
}, 8, ["modelValue", "title"]),
|
|
2403
|
-
V(
|
|
2381
|
+
V(Fe, {
|
|
2404
2382
|
ref_key: "switchConfirmRef",
|
|
2405
|
-
ref:
|
|
2406
|
-
size:
|
|
2383
|
+
ref: l,
|
|
2384
|
+
size: i.option.size?.form
|
|
2407
2385
|
}, null, 8, ["size"])
|
|
2408
2386
|
], 2);
|
|
2409
2387
|
};
|
|
2410
2388
|
}
|
|
2411
2389
|
});
|
|
2412
|
-
class
|
|
2390
|
+
class ft {
|
|
2413
2391
|
/**
|
|
2414
2392
|
* 通过远程 URL 下载文件,自动创建临时 `<a>` 标签触发浏览器下载
|
|
2415
2393
|
*
|
|
2416
2394
|
* @param href - 文件的远程地址
|
|
2417
2395
|
* @param name - 下载后的文件名,默认 `'download.png'`
|
|
2418
2396
|
*/
|
|
2419
|
-
static async download(
|
|
2397
|
+
static async download(t, d = "download.png") {
|
|
2420
2398
|
const e = document.createElement("a");
|
|
2421
|
-
e.style.display = "none", e.href =
|
|
2399
|
+
e.style.display = "none", e.href = t, e.setAttribute("download", d), typeof e.download > "u" && e.setAttribute("target", "_blank"), document.body.appendChild(e), e.click(), document.body.removeChild(e), window.URL.revokeObjectURL(t);
|
|
2422
2400
|
}
|
|
2423
2401
|
/**
|
|
2424
2402
|
* 将json对象或者json数组导出为json文件保存
|
|
2425
2403
|
* @param data
|
|
2426
2404
|
* @param name
|
|
2427
2405
|
*/
|
|
2428
|
-
static exportJSONFile = (
|
|
2429
|
-
const e = new Blob([JSON.stringify(
|
|
2430
|
-
|
|
2406
|
+
static exportJSONFile = (t, d) => {
|
|
2407
|
+
const e = new Blob([JSON.stringify(t)], { type: "application/json" }), n = URL.createObjectURL(e), o = document.createElement("a");
|
|
2408
|
+
o.href = n, o.download = `${d || "config"}.json`, o.click();
|
|
2431
2409
|
};
|
|
2432
2410
|
/**
|
|
2433
2411
|
* 导入文件内容,默认为json
|
|
2434
2412
|
* @param param
|
|
2435
2413
|
* @returns
|
|
2436
2414
|
*/
|
|
2437
|
-
static importFile = async (
|
|
2438
|
-
const
|
|
2439
|
-
|
|
2440
|
-
const
|
|
2441
|
-
|
|
2442
|
-
const r =
|
|
2415
|
+
static importFile = async (t) => new Promise((d, e) => {
|
|
2416
|
+
const n = document.createElement("input");
|
|
2417
|
+
n.type = "file";
|
|
2418
|
+
const o = t?.accept || ".json";
|
|
2419
|
+
n.accept = o, n.style.display = "none", n.onchange = (l) => {
|
|
2420
|
+
const r = l.target.files[0];
|
|
2443
2421
|
if (!r) {
|
|
2444
|
-
|
|
2422
|
+
U.fail("未选择文件"), e("未选择文件");
|
|
2445
2423
|
return;
|
|
2446
2424
|
}
|
|
2447
2425
|
const c = new FileReader();
|
|
2448
2426
|
c.onload = async (m) => {
|
|
2449
|
-
const u =
|
|
2427
|
+
const u = o == ".json" ? JSON.parse(m.target.result) : m.target.result;
|
|
2450
2428
|
d(u);
|
|
2451
2429
|
}, c.onerror = () => {
|
|
2452
|
-
|
|
2453
|
-
}, c.readAsText(r), document.body.removeChild(
|
|
2454
|
-
}, document.body.appendChild(
|
|
2430
|
+
U.fail("文件读取失败"), e("文件读取失败");
|
|
2431
|
+
}, c.readAsText(r), document.body.removeChild(n);
|
|
2432
|
+
}, document.body.appendChild(n), n.click();
|
|
2455
2433
|
});
|
|
2456
2434
|
}
|
|
2457
|
-
const
|
|
2458
|
-
if (
|
|
2459
|
-
j.customComponent =
|
|
2460
|
-
for (const d in
|
|
2461
|
-
|
|
2435
|
+
const st = (i, t) => {
|
|
2436
|
+
if (i.component("TCurd", it), i.component("TFormList", ae), i.component("TColumn", Ee), t?.customComponent) {
|
|
2437
|
+
j.customComponent = t.customComponent;
|
|
2438
|
+
for (const d in t.customComponent)
|
|
2439
|
+
i.component(d, t.customComponent[d]);
|
|
2462
2440
|
}
|
|
2463
|
-
},
|
|
2464
|
-
install:
|
|
2441
|
+
}, ct = {
|
|
2442
|
+
install: st
|
|
2465
2443
|
};
|
|
2466
2444
|
export {
|
|
2467
2445
|
P as ArrUtil,
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2446
|
+
Ue as ExcelUtil,
|
|
2447
|
+
Ee as TColumn,
|
|
2448
|
+
it as TCurd,
|
|
2449
|
+
ft as TFile,
|
|
2472
2450
|
j as TForm,
|
|
2473
2451
|
z as TFormConfig,
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2452
|
+
b as TFormI18n,
|
|
2453
|
+
ae as TFormList,
|
|
2454
|
+
U as TSys,
|
|
2455
|
+
ct as default,
|
|
2456
|
+
st as install
|
|
2479
2457
|
};
|