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