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