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