cc1-form 1.1.31 → 1.1.33
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 +338 -339
- package/dist/cc1-form.umd.cjs +1 -1
- package/dist/components/TCurd/index.d.ts +465 -0
- package/dist/components/TCurd/index.vue.d.ts +1002 -72
- package/dist/components/TCurd/indexType.d.ts +19 -0
- package/dist/utils/TFormConfig.d.ts +2 -4
- package/package.json +1 -1
package/dist/cc1-form.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElMessage as de, ElLoading as ue, ElForm as Q, ElFormItem 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 M, ElTableColumn as Z, ElRadioGroup as ce, ElRadio as fe, ElDropdown as pe, ElDropdownMenu as me, ElDropdownItem as X, ElTable as he, ElPagination as be } from "element-plus";
|
|
2
2
|
import "vue-router";
|
|
3
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 I, createBlock as b, normalizeClass as A, normalizeStyle as ie, ref as B, nextTick as ye, unref as l, mergeProps as v, toHandlers as F, resolveDynamicComponent as G, toDisplayString as 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 $ {
|
|
@@ -26,13 +26,13 @@ class $ {
|
|
|
26
26
|
* @param data 数据
|
|
27
27
|
* @returns 是否显示
|
|
28
28
|
*/
|
|
29
|
-
static isFun = (
|
|
29
|
+
static isFun = (t, ...s) => Array.isArray(t) ? t.some((e) => typeof e == "function" ? e(...s) : e) : typeof t == "function" ? t(...s) : t;
|
|
30
30
|
/**
|
|
31
31
|
* 获取路由参数,自动获取query、params中的参数, 哪个有就返回哪个
|
|
32
32
|
*/
|
|
33
33
|
static getRouterParams = () => {
|
|
34
|
-
const
|
|
35
|
-
return Object.keys(
|
|
34
|
+
const t = this.router.currentRoute.value.query || {}, s = this.router.currentRoute.value.params || {};
|
|
35
|
+
return Object.keys(t).length ? t : Object.keys(s).length ? s : {};
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
38
38
|
* 模块赋值
|
|
@@ -42,10 +42,10 @@ class $ {
|
|
|
42
42
|
* 加载模块
|
|
43
43
|
* @param module
|
|
44
44
|
*/
|
|
45
|
-
static loadModule = async (
|
|
46
|
-
if (!$.moduleObj[
|
|
47
|
-
throw new Error(`模块${
|
|
48
|
-
const s = await $.moduleObj[
|
|
45
|
+
static loadModule = async (t) => {
|
|
46
|
+
if (!$.moduleObj[t])
|
|
47
|
+
throw new Error(`模块${t}未加载,请赋值如:TSys.moduleObj = { ${t}: ()=>import('${t}') }`);
|
|
48
|
+
const s = await $.moduleObj[t]();
|
|
49
49
|
return s.default ?? s;
|
|
50
50
|
};
|
|
51
51
|
/**
|
|
@@ -62,19 +62,19 @@ class $ {
|
|
|
62
62
|
* @param type 消息类型
|
|
63
63
|
* @param options 其他选项
|
|
64
64
|
*/
|
|
65
|
-
static showMessage(
|
|
65
|
+
static showMessage(t, s, e = {}) {
|
|
66
66
|
const n = Date.now();
|
|
67
|
-
if (!this.tipMessages[
|
|
68
|
-
this.tipMessages[
|
|
69
|
-
const
|
|
67
|
+
if (!this.tipMessages[t] || n - this.tipMessages[t] > this.tipMessagesGap) {
|
|
68
|
+
this.tipMessages[t] = n;
|
|
69
|
+
const o = Object.assign(
|
|
70
70
|
{
|
|
71
|
-
message:
|
|
71
|
+
message: t,
|
|
72
72
|
type: s
|
|
73
73
|
},
|
|
74
74
|
e
|
|
75
75
|
);
|
|
76
|
-
de(
|
|
77
|
-
delete this.tipMessages[
|
|
76
|
+
de(o), setTimeout(() => {
|
|
77
|
+
delete this.tipMessages[t];
|
|
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 = (t, s = {}) => {
|
|
87
|
+
this.showMessage(t, "error", s);
|
|
88
88
|
};
|
|
89
89
|
/**
|
|
90
90
|
* 成功提示
|
|
91
91
|
* @param content
|
|
92
92
|
* @param options
|
|
93
93
|
*/
|
|
94
|
-
static success = (
|
|
95
|
-
this.showMessage(
|
|
94
|
+
static success = (t, s = {}) => {
|
|
95
|
+
this.showMessage(t, "success", s);
|
|
96
96
|
};
|
|
97
97
|
static loadingObj = null;
|
|
98
98
|
static loadingTimer = null;
|
|
@@ -101,9 +101,9 @@ class $ {
|
|
|
101
101
|
* @param show
|
|
102
102
|
* @param text
|
|
103
103
|
*/
|
|
104
|
-
static loading = (
|
|
104
|
+
static loading = (t = !0, s = "Loading...") => {
|
|
105
105
|
Timer.un(this.loadingTimer), this.loadingTimer = Timer.once(() => {
|
|
106
|
-
|
|
106
|
+
t ? this.loadingObj = ue.service({
|
|
107
107
|
lock: !0,
|
|
108
108
|
text: s,
|
|
109
109
|
background: "rgba(0, 0, 0, 0.3)"
|
|
@@ -115,34 +115,34 @@ class $ {
|
|
|
115
115
|
* @param url 地址
|
|
116
116
|
* @param isCenter 是否居中
|
|
117
117
|
*/
|
|
118
|
-
static openUrl = (
|
|
118
|
+
static openUrl = (t, s = !0) => {
|
|
119
119
|
if (s) {
|
|
120
120
|
let e = screen.width / 2 - 500, n = screen.height / 2 - 800 / 2 - 30;
|
|
121
121
|
window.open(
|
|
122
|
-
|
|
122
|
+
t,
|
|
123
123
|
"_blank",
|
|
124
124
|
"toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + n + ", left=" + e
|
|
125
125
|
);
|
|
126
126
|
} else
|
|
127
|
-
window.open(
|
|
127
|
+
window.open(t, "DescriptiveWindowName" + StrUtil.getId(), "resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0");
|
|
128
128
|
};
|
|
129
129
|
/**
|
|
130
130
|
* 根据dom id截图并返回图片数据
|
|
131
131
|
* @param param
|
|
132
132
|
* @returns
|
|
133
133
|
*/
|
|
134
|
-
static getImgPic = (
|
|
135
|
-
let n = document.getElementById(
|
|
136
|
-
const
|
|
134
|
+
static getImgPic = (t) => new Promise(async (s, e) => {
|
|
135
|
+
let n = document.getElementById(t.id);
|
|
136
|
+
const o = await $.loadModule("html2canvas");
|
|
137
137
|
try {
|
|
138
|
-
|
|
138
|
+
o(n, {
|
|
139
139
|
logging: !1,
|
|
140
140
|
allowTaint: !0,
|
|
141
141
|
scale: window.devicePixelRatio,
|
|
142
|
-
width:
|
|
143
|
-
height:
|
|
144
|
-
windowWidth:
|
|
145
|
-
windowHeight:
|
|
142
|
+
width: t.windowWidth,
|
|
143
|
+
height: t.windowHeight,
|
|
144
|
+
windowWidth: t.windowWidth,
|
|
145
|
+
windowHeight: t.windowHeight,
|
|
146
146
|
useCORS: !0,
|
|
147
147
|
backgroundColor: "#ffffff00"
|
|
148
148
|
}).then(function(a) {
|
|
@@ -271,6 +271,8 @@ class V {
|
|
|
271
271
|
},
|
|
272
272
|
/** 表格配置 */
|
|
273
273
|
table: {
|
|
274
|
+
/** 表头标签宽度 默认100px */
|
|
275
|
+
labelWidth: "100px",
|
|
274
276
|
/** 空文本 - 取自TFormI18n.tCurd('noData') */
|
|
275
277
|
emptyText: "",
|
|
276
278
|
/** 表头单元格类名 */
|
|
@@ -346,10 +348,6 @@ class V {
|
|
|
346
348
|
* 新增编辑表单配置 默认值
|
|
347
349
|
*/
|
|
348
350
|
form: {
|
|
349
|
-
/**
|
|
350
|
-
* 标签宽度
|
|
351
|
-
*/
|
|
352
|
-
labelWidth: "100px",
|
|
353
351
|
/**
|
|
354
352
|
* 宽度
|
|
355
353
|
*/
|
|
@@ -465,8 +463,8 @@ class V {
|
|
|
465
463
|
*
|
|
466
464
|
* @param config - 需要覆盖的配置项(深度 Partial)
|
|
467
465
|
*/
|
|
468
|
-
static setConfig = (
|
|
469
|
-
V.config = ObjectUtil.deepMerge(V.config,
|
|
466
|
+
static setConfig = (t) => {
|
|
467
|
+
V.config = ObjectUtil.deepMerge(V.config, t);
|
|
470
468
|
};
|
|
471
469
|
}
|
|
472
470
|
class T {
|
|
@@ -486,8 +484,8 @@ class T {
|
|
|
486
484
|
* @param field - 字段的 key 值
|
|
487
485
|
* @returns 该字段对应类型的 options 配置,如 select 类型返回 `options.select`
|
|
488
486
|
*/
|
|
489
|
-
static findOptions = (
|
|
490
|
-
const e =
|
|
487
|
+
static findOptions = (t, s) => {
|
|
488
|
+
const e = t.column.find((o) => o.key === s), n = (o) => o.replace(/-([a-z])/g, (a, d) => d.toUpperCase());
|
|
491
489
|
if (e)
|
|
492
490
|
return e.options[n(e.type)];
|
|
493
491
|
};
|
|
@@ -507,8 +505,8 @@ class T {
|
|
|
507
505
|
}))
|
|
508
506
|
)
|
|
509
507
|
*/
|
|
510
|
-
static setOptionsData = (
|
|
511
|
-
const n = T.findOptions(
|
|
508
|
+
static setOptionsData = (t, s, e) => {
|
|
509
|
+
const n = T.findOptions(t, s);
|
|
512
510
|
n && (n.data = e);
|
|
513
511
|
};
|
|
514
512
|
static form = {
|
|
@@ -520,9 +518,9 @@ class T {
|
|
|
520
518
|
* @param treeData 树形数据
|
|
521
519
|
* @param option 组件配置
|
|
522
520
|
*/
|
|
523
|
-
parentId: (
|
|
524
|
-
const
|
|
525
|
-
|
|
521
|
+
parentId: (t, s, e, n) => {
|
|
522
|
+
const o = V.config.table.rowKey;
|
|
523
|
+
t ? s.type === $.EDialog.Insert ? (s.form.parentId = t[o], s.form.sort = t.children.length + 1) : s.form.parentId = t.parentId.substring(t.parentId.lastIndexOf(",") + 1) : (s.form.parentId = "0", s.form.sort = e.length + 1), T.setOptionsData(n, "parentId", [{ [o]: "0", title: "根", children: e }]);
|
|
526
524
|
}
|
|
527
525
|
}
|
|
528
526
|
};
|
|
@@ -537,14 +535,14 @@ class R {
|
|
|
537
535
|
* @param field 字段名
|
|
538
536
|
* @param row 行数据
|
|
539
537
|
*/
|
|
540
|
-
static setId = (
|
|
541
|
-
s[
|
|
538
|
+
static setId = (t, s, e) => {
|
|
539
|
+
s[t] || (s[t] = []);
|
|
542
540
|
const n = V.config.table.rowKey;
|
|
543
|
-
s[
|
|
541
|
+
s[t].forEach((o) => {
|
|
544
542
|
e.forEach((a) => {
|
|
545
543
|
let d = a.default ?? "";
|
|
546
|
-
a.type === "number" && (d = a.default ?? 0), a.type === "boolean" && (d = a.default ?? !1), a.type === "time" && (d = a.default ?? /* @__PURE__ */ new Date()),
|
|
547
|
-
}),
|
|
544
|
+
a.type === "number" && (d = a.default ?? 0), a.type === "boolean" && (d = a.default ?? !1), a.type === "time" && (d = a.default ?? /* @__PURE__ */ new Date()), o[a.value] === void 0 && (o[a.value] = d);
|
|
545
|
+
}), o[n] || (o[n] = R.getIdFun());
|
|
548
546
|
});
|
|
549
547
|
};
|
|
550
548
|
/**
|
|
@@ -554,12 +552,12 @@ class R {
|
|
|
554
552
|
* @param itemFields 元素字段-如:[{label:'',value:''}]
|
|
555
553
|
* @param callback 回调函数
|
|
556
554
|
*/
|
|
557
|
-
static add = (
|
|
558
|
-
const
|
|
559
|
-
R.setId(
|
|
555
|
+
static add = (t, s, e, n) => {
|
|
556
|
+
const o = JSONUtil.cp(e);
|
|
557
|
+
R.setId(t, s, e);
|
|
560
558
|
const a = V.config.table.rowKey;
|
|
561
|
-
s[
|
|
562
|
-
|
|
559
|
+
s[t].push(
|
|
560
|
+
o.reduce(
|
|
563
561
|
(d, p) => {
|
|
564
562
|
let m = p.default ?? "";
|
|
565
563
|
return p.type === "number" && (m = p.default ?? 0), p.type === "boolean" && (m = p.default ?? !1), p.type === "time" && (m = p.default ?? /* @__PURE__ */ new Date()), d[p.value] = m, d;
|
|
@@ -575,9 +573,9 @@ class R {
|
|
|
575
573
|
* @param item 元素-如:{_id:''}
|
|
576
574
|
* @param callback 回调函数
|
|
577
575
|
*/
|
|
578
|
-
static remove = (
|
|
579
|
-
const
|
|
580
|
-
s[
|
|
576
|
+
static remove = (t, s, e, n) => {
|
|
577
|
+
const o = V.config.table.rowKey;
|
|
578
|
+
s[t] = s[t].filter((a) => a[o] !== e[o]), n?.(s);
|
|
581
579
|
};
|
|
582
580
|
/**
|
|
583
581
|
* 获取没有id的数据
|
|
@@ -585,10 +583,10 @@ class R {
|
|
|
585
583
|
* @param childernField 子级字段-如:list、children
|
|
586
584
|
* @returns 没有id的数据
|
|
587
585
|
*/
|
|
588
|
-
static getNoIdData = (
|
|
589
|
-
const e = JSONUtil.cp(
|
|
590
|
-
return e.forEach((
|
|
591
|
-
|
|
586
|
+
static getNoIdData = (t, s) => {
|
|
587
|
+
const e = JSONUtil.cp(t), n = V.config.table.rowKey;
|
|
588
|
+
return e.forEach((o) => {
|
|
589
|
+
o[n] && delete o[n], s && o[s] && R.getNoIdData(o[s], s);
|
|
592
590
|
}), e;
|
|
593
591
|
};
|
|
594
592
|
}
|
|
@@ -634,16 +632,16 @@ const Ee = {
|
|
|
634
632
|
}
|
|
635
633
|
},
|
|
636
634
|
emits: ["change"],
|
|
637
|
-
setup(r, { emit:
|
|
635
|
+
setup(r, { emit: t }) {
|
|
638
636
|
const s = r, e = oe({
|
|
639
637
|
show: !1,
|
|
640
|
-
add: (
|
|
641
|
-
R.add(
|
|
638
|
+
add: (o, a, d) => {
|
|
639
|
+
R.add(o, a, d, () => {
|
|
642
640
|
n("change");
|
|
643
641
|
});
|
|
644
642
|
},
|
|
645
|
-
remove: (
|
|
646
|
-
R.remove(
|
|
643
|
+
remove: (o, a, d) => {
|
|
644
|
+
R.remove(o, a, d, () => {
|
|
647
645
|
n("change");
|
|
648
646
|
});
|
|
649
647
|
}
|
|
@@ -651,11 +649,11 @@ const Ee = {
|
|
|
651
649
|
ne(() => {
|
|
652
650
|
R.setId(s.field, s.row, s.itemFields), e.show = !0;
|
|
653
651
|
});
|
|
654
|
-
const n =
|
|
655
|
-
return (
|
|
652
|
+
const n = t;
|
|
653
|
+
return (o, a) => {
|
|
656
654
|
const d = x("el-button"), p = x("el-input");
|
|
657
655
|
return e.show ? (c(), g("div", Ee, [
|
|
658
|
-
k(
|
|
656
|
+
k(o.$slots, "list-start", { row: r.row }),
|
|
659
657
|
O("div", null, [
|
|
660
658
|
D(d, {
|
|
661
659
|
link: "",
|
|
@@ -669,7 +667,7 @@ const Ee = {
|
|
|
669
667
|
})
|
|
670
668
|
]),
|
|
671
669
|
(c(!0), g(S, null, I(r.row[r.field], (m) => (c(), g("div", De, [
|
|
672
|
-
k(
|
|
670
|
+
k(o.$slots, "item-start", {
|
|
673
671
|
item: m,
|
|
674
672
|
row: r.row
|
|
675
673
|
}),
|
|
@@ -681,7 +679,7 @@ const Ee = {
|
|
|
681
679
|
placeholder: u[r.label] || u[r.value],
|
|
682
680
|
onChange: a[1] || (a[1] = (i) => n("change"))
|
|
683
681
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "style", "class", "placeholder"]))), 256)),
|
|
684
|
-
k(
|
|
682
|
+
k(o.$slots, "item-end", {
|
|
685
683
|
item: m,
|
|
686
684
|
row: r.row
|
|
687
685
|
}),
|
|
@@ -696,7 +694,7 @@ const Ee = {
|
|
|
696
694
|
_: 2
|
|
697
695
|
}, 1032, ["onClick"])
|
|
698
696
|
]))), 256)),
|
|
699
|
-
k(
|
|
697
|
+
k(o.$slots, "list-end", { row: r.row })
|
|
700
698
|
])) : C("", !0);
|
|
701
699
|
};
|
|
702
700
|
}
|
|
@@ -716,18 +714,18 @@ const Ee = {
|
|
|
716
714
|
default: ""
|
|
717
715
|
}
|
|
718
716
|
},
|
|
719
|
-
setup(r, { expose:
|
|
720
|
-
const s = $.isFun, e = $.EDialog, n = B(),
|
|
717
|
+
setup(r, { expose: t }) {
|
|
718
|
+
const s = $.isFun, e = $.EDialog, n = B(), o = r, a = oe({
|
|
721
719
|
rules: {},
|
|
722
720
|
show: !0,
|
|
723
721
|
form: {},
|
|
724
722
|
formDefault: {},
|
|
725
723
|
formColumn: [],
|
|
726
|
-
getDisabled: (d) => d.disabled?.[(
|
|
724
|
+
getDisabled: (d) => d.disabled?.[(o.type || e.Insert) === e.Insert ? "create" : "update"],
|
|
727
725
|
initColumnForm: async () => {
|
|
728
|
-
const d =
|
|
726
|
+
const d = o.option;
|
|
729
727
|
a.formColumn = [];
|
|
730
|
-
const p = [], m =
|
|
728
|
+
const p = [], m = o.option.form?.maxSpan || 12, u = o.option.form?.defaultSpan || m;
|
|
731
729
|
let i = [];
|
|
732
730
|
const f = (w) => {
|
|
733
731
|
if (a.formDefault[w.key] = w.value, w.isForm) {
|
|
@@ -745,7 +743,7 @@ const Ee = {
|
|
|
745
743
|
a.show = !1, await ye(), a.initColumnForm();
|
|
746
744
|
}
|
|
747
745
|
});
|
|
748
|
-
return a.initColumnForm(),
|
|
746
|
+
return a.initColumnForm(), t({
|
|
749
747
|
ref: n,
|
|
750
748
|
conf: a
|
|
751
749
|
}), (d, p) => (c(), b(l(Q), {
|
|
@@ -764,7 +762,7 @@ const Ee = {
|
|
|
764
762
|
key: 0,
|
|
765
763
|
class: A(u.item.form.span > 0 ? `col-${u.item.form.span}` : "col")
|
|
766
764
|
}, [
|
|
767
|
-
D(l(
|
|
765
|
+
D(l(H), {
|
|
768
766
|
label: u.item.label,
|
|
769
767
|
prop: u.item.key,
|
|
770
768
|
"label-width": u.item.form?.labelWidth || "100px"
|
|
@@ -792,7 +790,7 @@ const Ee = {
|
|
|
792
790
|
ref_for: !0
|
|
793
791
|
}, u.item.options?.switch, F(u.item.options?.switch?.on || {}), {
|
|
794
792
|
disabled: a.getDisabled(u.item)
|
|
795
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "select" ? (c(), b(l(
|
|
793
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "select" ? (c(), b(l(W), v({
|
|
796
794
|
key: 2,
|
|
797
795
|
modelValue: a.form[u.item.key],
|
|
798
796
|
"onUpdate:modelValue": (i) => a.form[u.item.key] = i,
|
|
@@ -894,19 +892,19 @@ const Ue = {
|
|
|
894
892
|
};
|
|
895
893
|
class y {
|
|
896
894
|
/** 解析国际化值:函数则执行并返回字符串,字符串则替换 `{key}` 占位符 */
|
|
897
|
-
static t(
|
|
898
|
-
if (typeof
|
|
899
|
-
return
|
|
900
|
-
|
|
895
|
+
static t(t, ...s) {
|
|
896
|
+
if (typeof t == "function")
|
|
897
|
+
return t(...s);
|
|
898
|
+
t = String(t);
|
|
901
899
|
let e = 0;
|
|
902
|
-
return
|
|
900
|
+
return t.replace(/{([^}]+)}/g, (n, o) => e < s.length ? String(s[e++]) : `{${o}}`);
|
|
903
901
|
}
|
|
904
|
-
static setI18n = (
|
|
905
|
-
y.curd = ObjectUtil.deepMerge(y.curd,
|
|
902
|
+
static setI18n = (t) => {
|
|
903
|
+
y.curd = ObjectUtil.deepMerge(y.curd, t);
|
|
906
904
|
};
|
|
907
905
|
/** 解析curd国际化值 */
|
|
908
|
-
static tCurd(
|
|
909
|
-
return this.t(this.curd[
|
|
906
|
+
static tCurd(t, ...s) {
|
|
907
|
+
return this.t(this.curd[t], ...s);
|
|
910
908
|
}
|
|
911
909
|
/** curd表单 */
|
|
912
910
|
static curd = Ue;
|
|
@@ -919,19 +917,20 @@ class Oe {
|
|
|
919
917
|
* @param columns - 列配置数组,需包含 `key`(数据字段)和 `label`(Excel 表头)
|
|
920
918
|
* @param fileName - 文件名(不含扩展名),支持字符串或返回字符串的函数;默认生成「导出数据_日期_时间戳」
|
|
921
919
|
*/
|
|
922
|
-
static exportToExcel = async (
|
|
923
|
-
if (!
|
|
924
|
-
const n = await $.loadModule("xlsx"),
|
|
920
|
+
static exportToExcel = async (t, s, e) => {
|
|
921
|
+
if (!t || t.length === 0) return;
|
|
922
|
+
const n = await $.loadModule("xlsx"), o = t.map((p) => {
|
|
925
923
|
const m = {};
|
|
926
924
|
return s.forEach((u) => {
|
|
927
925
|
m[u.label] = p[u.key];
|
|
928
926
|
}), m;
|
|
929
|
-
}), a = n.utils.json_to_sheet(
|
|
927
|
+
}), a = n.utils.json_to_sheet(o), d = n.utils.book_new();
|
|
930
928
|
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`);
|
|
931
929
|
};
|
|
932
930
|
}
|
|
933
931
|
const K = $.EDialog, Fe = (r) => {
|
|
934
|
-
const
|
|
932
|
+
const t = B(), s = B(), e = oe({
|
|
933
|
+
option: r.option,
|
|
935
934
|
/** 查询区域相关配置对象 */
|
|
936
935
|
search: {
|
|
937
936
|
/** 查询表单列集合 */
|
|
@@ -944,21 +943,21 @@ const K = $.EDialog, Fe = (r) => {
|
|
|
944
943
|
/** 搜索表单默认值 */
|
|
945
944
|
formDefault: {},
|
|
946
945
|
/** 获取占位符 */
|
|
947
|
-
getPlaceholder: (n,
|
|
946
|
+
getPlaceholder: (n, o = y.tCurd("placeholderInput")) => n.text?.search?.placeholder === void 0 ? `${o}${n.label}` : n.text?.search?.placeholder,
|
|
948
947
|
/** 组装实际要搜索的数据对象 */
|
|
949
948
|
getFormData: () => {
|
|
950
949
|
let n = {};
|
|
951
950
|
r.option.column.forEach((a) => {
|
|
952
951
|
(typeof a.show?.search == "function" ? a.show?.search(e.search.form) : a.show?.search) && (n[a.key] = e.search.form[a.key]);
|
|
953
952
|
});
|
|
954
|
-
const
|
|
955
|
-
return
|
|
953
|
+
const o = r.option.search?.before?.(n);
|
|
954
|
+
return o && (n = o), n;
|
|
956
955
|
},
|
|
957
956
|
/** 重置搜索表单 */
|
|
958
957
|
reset: () => {
|
|
959
958
|
const n = e.search.formDefault;
|
|
960
|
-
Object.keys(n).forEach((
|
|
961
|
-
r.option.search?.resetMode === "none" ? n[
|
|
959
|
+
Object.keys(n).forEach((o) => {
|
|
960
|
+
r.option.search?.resetMode === "none" ? n[o] = void 0 : n[o] = e.search.formDefault[o];
|
|
962
961
|
}), e.search.form = JSONUtil.cp(n), e.page.num = 1, r.option.init !== !1 && e.table.getList();
|
|
963
962
|
},
|
|
964
963
|
/** 提交搜索表单 */
|
|
@@ -999,16 +998,16 @@ const K = $.EDialog, Fe = (r) => {
|
|
|
999
998
|
/** 已经展开的行key集合 */
|
|
1000
999
|
rowKeys: [],
|
|
1001
1000
|
/** 行展开触发变更函数 */
|
|
1002
|
-
change: (n,
|
|
1001
|
+
change: (n, o) => {
|
|
1003
1002
|
},
|
|
1004
1003
|
/** 全部展开/收起 */
|
|
1005
1004
|
all: () => {
|
|
1006
1005
|
if (e.table.expand.isExpand)
|
|
1007
1006
|
e.table.expand.rowKeys = [];
|
|
1008
1007
|
else {
|
|
1009
|
-
const n = (
|
|
1008
|
+
const n = (o) => {
|
|
1010
1009
|
let a = [];
|
|
1011
|
-
return
|
|
1010
|
+
return o.forEach((d) => {
|
|
1012
1011
|
a.push(d[r.option.table.rowKey]), d.children && d.children.length > 0 && (a = a.concat(n(d.children)));
|
|
1013
1012
|
}), a;
|
|
1014
1013
|
};
|
|
@@ -1035,10 +1034,10 @@ const K = $.EDialog, Fe = (r) => {
|
|
|
1035
1034
|
const n = r.option.api.list;
|
|
1036
1035
|
try {
|
|
1037
1036
|
await e.initApiData("init");
|
|
1038
|
-
let
|
|
1037
|
+
let o = {};
|
|
1039
1038
|
if (e.table.sort.prop) {
|
|
1040
1039
|
const { props: f, order: w } = V.config.table.sort;
|
|
1041
|
-
|
|
1040
|
+
o = {
|
|
1042
1041
|
[f.field]: e.table.sort.prop,
|
|
1043
1042
|
[w.field]: e.table.sort.order
|
|
1044
1043
|
};
|
|
@@ -1047,7 +1046,7 @@ const K = $.EDialog, Fe = (r) => {
|
|
|
1047
1046
|
[V.config.page.size]: e.page.size,
|
|
1048
1047
|
[V.config.page.num]: e.page.num,
|
|
1049
1048
|
...e.search.getFormData(),
|
|
1050
|
-
...
|
|
1049
|
+
...o
|
|
1051
1050
|
}), d = V.config.result, p = a.data || { [d.list]: a };
|
|
1052
1051
|
let m = (Array.isArray(p[d.list]), p[d.list]);
|
|
1053
1052
|
const u = e.update.formColumn.flat(), i = JSONUtil.cp(m).map((f) => (Object.keys(f).forEach((L) => {
|
|
@@ -1055,8 +1054,8 @@ const K = $.EDialog, Fe = (r) => {
|
|
|
1055
1054
|
j && ["select", "radio"].includes(j.item.type) && (j.item.table.format || (j.item.table.format = (z) => j.item.options[j.item.type].data?.find((P) => P.value == z[L])?.label || z[L]));
|
|
1056
1055
|
}), f));
|
|
1057
1056
|
e.table.data = r.option.data ? await r.option.data(i, m) : i, e.page.total = p[d.total] || 0;
|
|
1058
|
-
} catch (
|
|
1059
|
-
console.error(
|
|
1057
|
+
} catch (o) {
|
|
1058
|
+
console.error(o);
|
|
1060
1059
|
} finally {
|
|
1061
1060
|
e.table.loading = !1;
|
|
1062
1061
|
}
|
|
@@ -1079,12 +1078,12 @@ const K = $.EDialog, Fe = (r) => {
|
|
|
1079
1078
|
/** 排序变更回调 */
|
|
1080
1079
|
change: (n) => {
|
|
1081
1080
|
V.config.table.sort.resetPage && (e.page.num = 1);
|
|
1082
|
-
const
|
|
1083
|
-
if (
|
|
1084
|
-
|
|
1081
|
+
const o = V.config.table.sort;
|
|
1082
|
+
if (o.change) {
|
|
1083
|
+
o.change(n, e);
|
|
1085
1084
|
return;
|
|
1086
1085
|
}
|
|
1087
|
-
e.table.sort.prop = n.prop, n.order === null ? e.table.sort.order = "" : e.table.sort.order = n.order === "ascending" ?
|
|
1086
|
+
e.table.sort.prop = n.prop, n.order === null ? e.table.sort.order = "" : e.table.sort.order = n.order === "ascending" ? o.order.asc : o.order.desc, e.table.getList();
|
|
1088
1087
|
}
|
|
1089
1088
|
}
|
|
1090
1089
|
},
|
|
@@ -1094,9 +1093,9 @@ const K = $.EDialog, Fe = (r) => {
|
|
|
1094
1093
|
run: {
|
|
1095
1094
|
/** 执行指定方式的导出(如select、page、all) */
|
|
1096
1095
|
start: async (n) => {
|
|
1097
|
-
let
|
|
1096
|
+
let o = await e.export.run[n](), a = r.option.column;
|
|
1098
1097
|
const d = JSONUtil.cp({
|
|
1099
|
-
data:
|
|
1098
|
+
data: o,
|
|
1100
1099
|
columns: a
|
|
1101
1100
|
}), p = r.option.tools?.export || {};
|
|
1102
1101
|
p.before && p.before(d), Oe.exportToExcel(d.data, d.columns, p.fileName);
|
|
@@ -1125,11 +1124,11 @@ const K = $.EDialog, Fe = (r) => {
|
|
|
1125
1124
|
});
|
|
1126
1125
|
return;
|
|
1127
1126
|
}
|
|
1128
|
-
const n = r.option.api.list,
|
|
1127
|
+
const n = r.option.api.list, o = await n({
|
|
1129
1128
|
[V.config.page.size]: 999999,
|
|
1130
1129
|
[V.config.page.num]: 1
|
|
1131
1130
|
});
|
|
1132
|
-
return (
|
|
1131
|
+
return (o.data || { [V.config.result.list]: o })[V.config.result.list];
|
|
1133
1132
|
} catch (n) {
|
|
1134
1133
|
console.error(n);
|
|
1135
1134
|
} finally {
|
|
@@ -1174,27 +1173,27 @@ const K = $.EDialog, Fe = (r) => {
|
|
|
1174
1173
|
getApiData: (n) => {
|
|
1175
1174
|
if (r.option.form?.editAll)
|
|
1176
1175
|
return n;
|
|
1177
|
-
let
|
|
1176
|
+
let o = {
|
|
1178
1177
|
[r.option.table?.rowKey]: e.update.edit.data[r.option.table?.rowKey]
|
|
1179
1178
|
};
|
|
1180
1179
|
return Object.keys(e.update.edit.data).forEach((a) => {
|
|
1181
|
-
n[a] !== e.update.edit.data[a] && (
|
|
1182
|
-
}),
|
|
1180
|
+
n[a] !== e.update.edit.data[a] && (o[a] = n[a]);
|
|
1181
|
+
}), o;
|
|
1183
1182
|
}
|
|
1184
1183
|
},
|
|
1185
1184
|
view: {},
|
|
1186
1185
|
/** 打开增改弹窗 */
|
|
1187
|
-
open: (n,
|
|
1186
|
+
open: (n, o) => {
|
|
1188
1187
|
e.update.showContent || FunUtil.throttle(async () => {
|
|
1189
1188
|
$.loading(!0);
|
|
1190
1189
|
try {
|
|
1191
1190
|
await e.initApiData("update");
|
|
1192
1191
|
const a = n === K.Insert;
|
|
1193
1192
|
if (!a && r.option.table?.inlineEdit) {
|
|
1194
|
-
e.inlineEdit.open(
|
|
1193
|
+
e.inlineEdit.open(o);
|
|
1195
1194
|
return;
|
|
1196
1195
|
}
|
|
1197
|
-
e.update.type = n, e.update.edit.data =
|
|
1196
|
+
e.update.type = n, e.update.edit.data = o, e.update.title = y.tCurd(a ? "add" : n === K.View ? "view" : "edit"), e.update.form = JSONUtil.cp(a ? e.update.formDefault : o), await r.option.form?.openBefore?.(o, e.update), e.update.show = !0, e.update.showContent = !0, r.option.form?.openAfter?.(o, e.update);
|
|
1198
1197
|
} catch (a) {
|
|
1199
1198
|
console.error(a);
|
|
1200
1199
|
} finally {
|
|
@@ -1209,20 +1208,20 @@ const K = $.EDialog, Fe = (r) => {
|
|
|
1209
1208
|
d || ($.fail(y.tCurd("checkFormData")), u(!1)), m();
|
|
1210
1209
|
})), e.update.loading = !0;
|
|
1211
1210
|
const n = e.update.type === K.Insert ? r.option.api.create : r.option.api.update;
|
|
1212
|
-
let
|
|
1213
|
-
delete
|
|
1211
|
+
let o = JSONUtil.cp(e.update.form);
|
|
1212
|
+
delete o.children, await r.option.form?.submitBefore?.(o, e.update);
|
|
1214
1213
|
const a = new Set(r.option.column.filter((d) => d.type === "datetime").map((d) => d.key));
|
|
1215
|
-
Object.keys(
|
|
1216
|
-
if (a.has(d) &&
|
|
1217
|
-
const p = new Date(
|
|
1218
|
-
isNaN(p) || (
|
|
1214
|
+
Object.keys(o).forEach((d) => {
|
|
1215
|
+
if (a.has(d) && o[d] != null) {
|
|
1216
|
+
const p = new Date(o[d]).getTime();
|
|
1217
|
+
isNaN(p) || (o[d] = p);
|
|
1219
1218
|
}
|
|
1220
1219
|
});
|
|
1221
1220
|
try {
|
|
1222
1221
|
if (!n) return;
|
|
1223
1222
|
await n({
|
|
1224
|
-
...
|
|
1225
|
-
}), e.update.close(), await e.table.getList(), r.option.form?.submitAfter?.(
|
|
1223
|
+
...o
|
|
1224
|
+
}), e.update.close(), await e.table.getList(), r.option.form?.submitAfter?.(o, e.update);
|
|
1226
1225
|
} catch (d) {
|
|
1227
1226
|
console.error(d);
|
|
1228
1227
|
} finally {
|
|
@@ -1258,11 +1257,11 @@ const K = $.EDialog, Fe = (r) => {
|
|
|
1258
1257
|
FunUtil.throttle(async () => {
|
|
1259
1258
|
e.inlineEdit.loading = !0;
|
|
1260
1259
|
const n = r.option.api.update;
|
|
1261
|
-
let
|
|
1262
|
-
delete
|
|
1260
|
+
let o = JSONUtil.cp(e.inlineEdit.form);
|
|
1261
|
+
delete o.children;
|
|
1263
1262
|
try {
|
|
1264
1263
|
if (!n) return;
|
|
1265
|
-
await n({ ...
|
|
1264
|
+
await n({ ...o }), e.inlineEdit.close(), await e.table.getList(), $.success(y.tCurd("operationSuccess"));
|
|
1266
1265
|
} catch (a) {
|
|
1267
1266
|
console.error(a);
|
|
1268
1267
|
} finally {
|
|
@@ -1301,11 +1300,11 @@ const K = $.EDialog, Fe = (r) => {
|
|
|
1301
1300
|
try {
|
|
1302
1301
|
if (!n) return;
|
|
1303
1302
|
await n({
|
|
1304
|
-
[r.option.table?.rowKey]: e.remove.items.map((
|
|
1303
|
+
[r.option.table?.rowKey]: e.remove.items.map((o) => o[r.option.table?.rowKey]),
|
|
1305
1304
|
items: e.remove.items
|
|
1306
1305
|
}), $.success(y.tCurd("operationSuccess")), e.table.data.length <= 1 && e.page.num > 1 && (e.page.num -= 1), e.remove.close(), await e.table.getList();
|
|
1307
|
-
} catch (
|
|
1308
|
-
console.error(
|
|
1306
|
+
} catch (o) {
|
|
1307
|
+
console.error(o);
|
|
1309
1308
|
} finally {
|
|
1310
1309
|
e.remove.loading = !1;
|
|
1311
1310
|
}
|
|
@@ -1320,7 +1319,7 @@ const K = $.EDialog, Fe = (r) => {
|
|
|
1320
1319
|
apiDataMap: {},
|
|
1321
1320
|
/** 获取并绑定curd中所有下拉数据等远程依赖 */
|
|
1322
1321
|
initApiData: async (n) => {
|
|
1323
|
-
const
|
|
1322
|
+
const o = [], a = (d) => {
|
|
1324
1323
|
if (d.children && d.children.length) {
|
|
1325
1324
|
d.children.forEach((p) => a(p));
|
|
1326
1325
|
return;
|
|
@@ -1337,20 +1336,20 @@ const K = $.EDialog, Fe = (r) => {
|
|
|
1337
1336
|
} catch {
|
|
1338
1337
|
}
|
|
1339
1338
|
})();
|
|
1340
|
-
|
|
1339
|
+
o.push(p);
|
|
1341
1340
|
}
|
|
1342
1341
|
};
|
|
1343
1342
|
return r.option.column.forEach((d) => {
|
|
1344
1343
|
a(d);
|
|
1345
|
-
}), await Promise.all(
|
|
1344
|
+
}), await Promise.all(o), !0;
|
|
1346
1345
|
},
|
|
1347
1346
|
/** 初始化curd配置(option默认值合并等) */
|
|
1348
1347
|
initCurdConfig: () => {
|
|
1349
1348
|
const n = JSONUtil.cp(V.config);
|
|
1350
1349
|
n.table.emptyText = y.tCurd("noData");
|
|
1351
|
-
const
|
|
1352
|
-
Object.keys(
|
|
1353
|
-
r.option[a] =
|
|
1350
|
+
const o = ObjectUtil.deepMerge(n, r.option || {});
|
|
1351
|
+
Object.keys(o).forEach((a) => {
|
|
1352
|
+
r.option[a] = o[a];
|
|
1354
1353
|
});
|
|
1355
1354
|
},
|
|
1356
1355
|
/**
|
|
@@ -1366,17 +1365,17 @@ const K = $.EDialog, Fe = (r) => {
|
|
|
1366
1365
|
inactiveLabel: y.tCurd("switchOff")
|
|
1367
1366
|
}
|
|
1368
1367
|
});
|
|
1369
|
-
const
|
|
1368
|
+
const o = (a) => {
|
|
1370
1369
|
if (a.table = ObjectUtil.deepMerge(n.table, a.table || {}), a.children) {
|
|
1371
1370
|
a.children.forEach((d) => {
|
|
1372
|
-
|
|
1371
|
+
o(d);
|
|
1373
1372
|
});
|
|
1374
1373
|
return;
|
|
1375
1374
|
}
|
|
1376
1375
|
a.options = ObjectUtil.deepMerge(n.options, a.options || {}), a.form = ObjectUtil.deepMerge(n.form, a.form || {}), a.show = ObjectUtil.deepMerge(n.show, a.show || {}), a.sort = ObjectUtil.deepMerge(n.sort, a.sort || {}), a.type = a.type || n.type, a.type === "switch" && (a.options.switch.tableBeforeChange = async (d, p) => {
|
|
1377
1376
|
const m = a.options?.switch;
|
|
1378
1377
|
try {
|
|
1379
|
-
await
|
|
1378
|
+
await t.value?.open({
|
|
1380
1379
|
title: y.tCurd("confirmModify"),
|
|
1381
1380
|
content: y.tCurd("confirmSwitchMessage")
|
|
1382
1381
|
}), e.table.loading = !0;
|
|
@@ -1398,11 +1397,11 @@ const K = $.EDialog, Fe = (r) => {
|
|
|
1398
1397
|
}
|
|
1399
1398
|
}), a.type === "tree-select" && (a.options.treeSelect.rowKey = r.option.table?.rowKey, a.options.treeSelect.nodeKey = r.option.table?.rowKey);
|
|
1400
1399
|
};
|
|
1401
|
-
r.option.column.forEach(
|
|
1400
|
+
r.option.column.forEach(o), r.option.table?.column?.forEach(o);
|
|
1402
1401
|
},
|
|
1403
|
-
getColumnSpan: (n,
|
|
1402
|
+
getColumnSpan: (n, o) => {
|
|
1404
1403
|
if (n.item.form?.spanCol) {
|
|
1405
|
-
const a = V.config.form.defaultSpan, p =
|
|
1404
|
+
const a = V.config.form.defaultSpan, p = o.filter((m) => !$.isFun(m.item.show?.form, e.update.form, e.update.type)).reduce((m, u) => m + (u.item.form?.span || a), 0);
|
|
1406
1405
|
return (n.item?.form.span || a) + p;
|
|
1407
1406
|
}
|
|
1408
1407
|
return n.item.form.span;
|
|
@@ -1414,7 +1413,7 @@ const K = $.EDialog, Fe = (r) => {
|
|
|
1414
1413
|
list: [],
|
|
1415
1414
|
listSource: []
|
|
1416
1415
|
};
|
|
1417
|
-
const
|
|
1416
|
+
const o = [], a = r.option.form?.maxSpan || 12, d = r.option.form?.defaultSpan || a / 2;
|
|
1418
1417
|
let p = [];
|
|
1419
1418
|
const m = (f) => {
|
|
1420
1419
|
if (f.children) {
|
|
@@ -1427,7 +1426,7 @@ const K = $.EDialog, Fe = (r) => {
|
|
|
1427
1426
|
f.form = f.form || { span: d }, f.form.span = f.form.span ?? d;
|
|
1428
1427
|
let w = f.form.span, L = p.reduce((z, P) => z + P.span, w);
|
|
1429
1428
|
const j = p.length;
|
|
1430
|
-
if (p.push({ item: f, span: w }), (j === 1 && p[0].span === 0 || L >= a || w === 0 && j > 1) && (
|
|
1429
|
+
if (p.push({ item: f, span: w }), (j === 1 && p[0].span === 0 || L >= a || w === 0 && j > 1) && (o.push(p), p = []), f.rules) {
|
|
1431
1430
|
const z = {
|
|
1432
1431
|
input: y.tCurd("placeholderInput"),
|
|
1433
1432
|
select: y.tCurd("placeholderSelect")
|
|
@@ -1448,7 +1447,7 @@ const K = $.EDialog, Fe = (r) => {
|
|
|
1448
1447
|
f.isForm = !0, u(f, !0), m(f);
|
|
1449
1448
|
}), r.option.table?.column?.forEach((f) => {
|
|
1450
1449
|
u(f, !1), m(f);
|
|
1451
|
-
}), e.search.column.list = n.column.concat(n.table?.column || []), e.table.column.list = e.search.column.list.filter((f) => f.table?.table), e.search.column.list.sort((f, w) => f.sort?.search - w.sort?.search), e.table.column.list.sort((f, w) => f.sort?.table - w.sort?.table), p.length > 0 &&
|
|
1450
|
+
}), e.search.column.list = n.column.concat(n.table?.column || []), e.table.column.list = e.search.column.list.filter((f) => f.table?.table), e.search.column.list.sort((f, w) => f.sort?.search - w.sort?.search), e.table.column.list.sort((f, w) => f.sort?.table - w.sort?.table), p.length > 0 && o.push(p), e.update.formColumn = o;
|
|
1452
1451
|
const i = r.option.search?.formDefault;
|
|
1453
1452
|
i && Object.keys(i).forEach((f) => {
|
|
1454
1453
|
e.search.formDefault[f] = i[f];
|
|
@@ -1459,20 +1458,20 @@ const K = $.EDialog, Fe = (r) => {
|
|
|
1459
1458
|
});
|
|
1460
1459
|
return e.init(), ne(() => {
|
|
1461
1460
|
r.option.init !== !1 && e.table.getList();
|
|
1462
|
-
}), { conf: e, switchConfirmRef:
|
|
1461
|
+
}), { conf: e, switchConfirmRef: t, ruleFormRef: s };
|
|
1463
1462
|
}, Me = { class: "dialog-footer" }, Ie = /* @__PURE__ */ J({
|
|
1464
1463
|
__name: "switchConfirm",
|
|
1465
|
-
setup(r, { expose:
|
|
1464
|
+
setup(r, { expose: t }) {
|
|
1466
1465
|
const s = B(!1), e = B("确认修改"), n = B("确认要修改状态吗?");
|
|
1467
|
-
let
|
|
1466
|
+
let o = null, a = null;
|
|
1468
1467
|
const d = (u) => (u?.title && (e.value = u.title), u?.content && (n.value = u.content), s.value = !0, new Promise((i, f) => {
|
|
1469
|
-
|
|
1468
|
+
o = i, a = f;
|
|
1470
1469
|
})), p = () => {
|
|
1471
|
-
s.value = !1,
|
|
1470
|
+
s.value = !1, o?.(!0), o = null, a = null;
|
|
1472
1471
|
}, m = () => {
|
|
1473
|
-
s.value = !1, a?.(new Error("用户取消操作")),
|
|
1472
|
+
s.value = !1, a?.(new Error("用户取消操作")), o = null, a = null;
|
|
1474
1473
|
};
|
|
1475
|
-
return
|
|
1474
|
+
return t({
|
|
1476
1475
|
open: d
|
|
1477
1476
|
}), (u, i) => (c(), b(l(Y), {
|
|
1478
1477
|
modelValue: s.value,
|
|
@@ -1506,17 +1505,17 @@ const K = $.EDialog, Fe = (r) => {
|
|
|
1506
1505
|
_: 1
|
|
1507
1506
|
}, 8, ["modelValue", "title"]));
|
|
1508
1507
|
}
|
|
1509
|
-
}), re = (r,
|
|
1508
|
+
}), re = (r, t) => {
|
|
1510
1509
|
const s = r.__vccOpts || r;
|
|
1511
|
-
for (const [e, n] of
|
|
1510
|
+
for (const [e, n] of t)
|
|
1512
1511
|
s[e] = n;
|
|
1513
1512
|
return s;
|
|
1514
1513
|
}, Le = {}, je = {
|
|
1515
1514
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1516
1515
|
viewBox: "0 0 1024 1024"
|
|
1517
1516
|
};
|
|
1518
|
-
function ze(r,
|
|
1519
|
-
return c(), g("svg", je,
|
|
1517
|
+
function ze(r, t) {
|
|
1518
|
+
return c(), g("svg", je, t[0] || (t[0] = [
|
|
1520
1519
|
O("path", {
|
|
1521
1520
|
fill: "currentColor",
|
|
1522
1521
|
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"
|
|
@@ -1528,15 +1527,15 @@ const Te = /* @__PURE__ */ re(Le, [["render", ze]]), Re = {}, Pe = {
|
|
|
1528
1527
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1529
1528
|
viewBox: "0 0 1024 1024"
|
|
1530
1529
|
};
|
|
1531
|
-
function Ae(r,
|
|
1532
|
-
return c(), g("svg", Pe,
|
|
1530
|
+
function Ae(r, t) {
|
|
1531
|
+
return c(), g("svg", Pe, t[0] || (t[0] = [
|
|
1533
1532
|
O("path", {
|
|
1534
1533
|
fill: "currentColor",
|
|
1535
1534
|
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"
|
|
1536
1535
|
}, null, -1)
|
|
1537
1536
|
]));
|
|
1538
1537
|
}
|
|
1539
|
-
const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-center table-header-label inline" }, Be = { class: "table-header-tooltip" }, Je = ["onClick", "innerHTML"],
|
|
1538
|
+
const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-center table-header-label inline" }, Be = { class: "table-header-tooltip" }, Je = ["onClick", "innerHTML"], We = /* @__PURE__ */ J({
|
|
1540
1539
|
__name: "tableColumn",
|
|
1541
1540
|
props: {
|
|
1542
1541
|
conf: {},
|
|
@@ -1544,9 +1543,9 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
1544
1543
|
option: {}
|
|
1545
1544
|
},
|
|
1546
1545
|
setup(r) {
|
|
1547
|
-
const
|
|
1546
|
+
const t = $.isFun, s = ge().type;
|
|
1548
1547
|
return (e, n) => {
|
|
1549
|
-
const
|
|
1548
|
+
const o = x("el-tooltip");
|
|
1550
1549
|
return c(!0), g(S, null, I(e.columnList, (a) => (c(), g(S, {
|
|
1551
1550
|
key: a.key
|
|
1552
1551
|
}, [
|
|
@@ -1559,7 +1558,7 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
1559
1558
|
header: h(() => [
|
|
1560
1559
|
k(e.$slots, "table-header-" + a.key, { item: a }, () => [
|
|
1561
1560
|
O("div", Ne, [
|
|
1562
|
-
a.table?.tooltip ? (c(), b(
|
|
1561
|
+
a.table?.tooltip ? (c(), b(o, {
|
|
1563
1562
|
key: 0,
|
|
1564
1563
|
effect: "dark",
|
|
1565
1564
|
content: a.table?.tooltip,
|
|
@@ -1592,7 +1591,7 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
1592
1591
|
}))
|
|
1593
1592
|
]), 1032, ["conf", "columnList", "option"]))
|
|
1594
1593
|
], 64)) : (c(), g(S, { key: 1 }, [
|
|
1595
|
-
l(
|
|
1594
|
+
l(t)(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 }, [
|
|
1596
1595
|
a.type === "input" ? (c(), b(l(q), v({
|
|
1597
1596
|
key: 0,
|
|
1598
1597
|
modelValue: e.conf.inlineEdit.form[a.key],
|
|
@@ -1602,7 +1601,7 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
1602
1601
|
size: "small",
|
|
1603
1602
|
style: { width: "100%" },
|
|
1604
1603
|
onKeyup: we(e.conf.inlineEdit.submit, ["enter"])
|
|
1605
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "onKeyup"])) : a.type === "select" ? (c(), b(l(
|
|
1604
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "onKeyup"])) : a.type === "select" ? (c(), b(l(W), v({
|
|
1606
1605
|
key: 1,
|
|
1607
1606
|
modelValue: e.conf.inlineEdit.form[a.key],
|
|
1608
1607
|
"onUpdate:modelValue": (p) => e.conf.inlineEdit.form[a.key] = p,
|
|
@@ -1648,7 +1647,7 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
1648
1647
|
], 64))), 128);
|
|
1649
1648
|
};
|
|
1650
1649
|
}
|
|
1651
|
-
}),
|
|
1650
|
+
}), He = {
|
|
1652
1651
|
class: "row form-item-content",
|
|
1653
1652
|
style: { width: "100%" }
|
|
1654
1653
|
}, qe = { class: "col" }, Ge = { class: "col" }, Xe = ["innerHTML"], Qe = /* @__PURE__ */ J({
|
|
@@ -1658,117 +1657,117 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
1658
1657
|
item: {}
|
|
1659
1658
|
},
|
|
1660
1659
|
setup(r) {
|
|
1661
|
-
return (
|
|
1660
|
+
return (t, s) => (c(), b(l(H), {
|
|
1662
1661
|
class: A({
|
|
1663
|
-
"hide-label": typeof
|
|
1662
|
+
"hide-label": typeof t.item.item.text?.form?.label == "boolean" ? !t.item.item.text?.form?.label : !1
|
|
1664
1663
|
}),
|
|
1665
|
-
label: typeof
|
|
1666
|
-
prop:
|
|
1667
|
-
"label-width":
|
|
1664
|
+
label: typeof t.item.item.text?.form?.label == "string" ? t.item.item.text?.form?.label : t.item.item.label,
|
|
1665
|
+
prop: t.item.item.key,
|
|
1666
|
+
"label-width": t.item.item.form?.labelWidth || t.conf.option.form?.labelWidth || t.conf.option.form?.labelWidth
|
|
1668
1667
|
}, {
|
|
1669
1668
|
default: h(() => [
|
|
1670
|
-
O("div",
|
|
1671
|
-
k(
|
|
1672
|
-
row:
|
|
1673
|
-
item:
|
|
1669
|
+
O("div", He, [
|
|
1670
|
+
k(t.$slots, "form-" + t.item.item.key + "-start", {
|
|
1671
|
+
row: t.conf.update.form,
|
|
1672
|
+
item: t.item.item
|
|
1674
1673
|
}),
|
|
1675
1674
|
O("div", qe, [
|
|
1676
1675
|
O("div", Ge, [
|
|
1677
|
-
k(
|
|
1678
|
-
row:
|
|
1679
|
-
item:
|
|
1676
|
+
k(t.$slots, "form-" + t.item.item.key, {
|
|
1677
|
+
row: t.conf.update.form,
|
|
1678
|
+
item: t.item.item
|
|
1680
1679
|
}, () => [
|
|
1681
|
-
|
|
1680
|
+
t.item.item.type === "input" ? (c(), b(l(q), v({
|
|
1682
1681
|
key: 0,
|
|
1683
|
-
modelValue:
|
|
1684
|
-
"onUpdate:modelValue": s[0] || (s[0] = (e) =>
|
|
1685
|
-
},
|
|
1686
|
-
disabled:
|
|
1687
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
1682
|
+
modelValue: t.conf.update.form[t.item.item.key],
|
|
1683
|
+
"onUpdate:modelValue": s[0] || (s[0] = (e) => t.conf.update.form[t.item.item.key] = e)
|
|
1684
|
+
}, t.item.item.options?.input, F(t.item.item.options?.input?.on || {}), {
|
|
1685
|
+
disabled: t.conf.update.getDisabled(t.item.item)
|
|
1686
|
+
}), null, 16, ["modelValue", "disabled"])) : t.item.item.type === "switch" ? (c(), b(l(ee), v({
|
|
1688
1687
|
key: 1,
|
|
1689
|
-
modelValue:
|
|
1690
|
-
"onUpdate:modelValue": s[1] || (s[1] = (e) =>
|
|
1691
|
-
},
|
|
1692
|
-
disabled:
|
|
1693
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
1688
|
+
modelValue: t.conf.update.form[t.item.item.key],
|
|
1689
|
+
"onUpdate:modelValue": s[1] || (s[1] = (e) => t.conf.update.form[t.item.item.key] = e)
|
|
1690
|
+
}, t.item.item.options?.switch, {
|
|
1691
|
+
disabled: t.conf.update.getDisabled(t.item.item)
|
|
1692
|
+
}), null, 16, ["modelValue", "disabled"])) : t.item.item.type === "select" ? (c(), b(l(W), v({
|
|
1694
1693
|
key: 2,
|
|
1695
|
-
modelValue:
|
|
1696
|
-
"onUpdate:modelValue": s[2] || (s[2] = (e) =>
|
|
1697
|
-
},
|
|
1698
|
-
disabled:
|
|
1694
|
+
modelValue: t.conf.update.form[t.item.item.key],
|
|
1695
|
+
"onUpdate:modelValue": s[2] || (s[2] = (e) => t.conf.update.form[t.item.item.key] = e)
|
|
1696
|
+
}, t.item.item.options?.select, F(t.item.item.options?.select?.on || {}), {
|
|
1697
|
+
disabled: t.conf.update.getDisabled(t.item.item),
|
|
1699
1698
|
style: { width: "100%" }
|
|
1700
1699
|
}), {
|
|
1701
1700
|
default: h(() => [
|
|
1702
|
-
(c(!0), g(S, null, I(
|
|
1701
|
+
(c(!0), g(S, null, I(t.item.item.options?.select?.data, (e) => (c(), b(l(N), {
|
|
1703
1702
|
key: e.value,
|
|
1704
1703
|
label: e.label,
|
|
1705
1704
|
value: e.value
|
|
1706
1705
|
}, null, 8, ["label", "value"]))), 128))
|
|
1707
1706
|
]),
|
|
1708
1707
|
_: 1
|
|
1709
|
-
}, 16, ["modelValue", "disabled"])) :
|
|
1708
|
+
}, 16, ["modelValue", "disabled"])) : t.item.item.type === "radio" ? (c(), b(l(ce), v({
|
|
1710
1709
|
key: 3,
|
|
1711
|
-
modelValue:
|
|
1712
|
-
"onUpdate:modelValue": s[3] || (s[3] = (e) =>
|
|
1713
|
-
},
|
|
1714
|
-
disabled:
|
|
1710
|
+
modelValue: t.conf.update.form[t.item.item.key],
|
|
1711
|
+
"onUpdate:modelValue": s[3] || (s[3] = (e) => t.conf.update.form[t.item.item.key] = e)
|
|
1712
|
+
}, t.item.item.options?.radio, F(t.item.item.options?.radio?.on || {}), {
|
|
1713
|
+
disabled: t.conf.update.getDisabled(t.item.item),
|
|
1715
1714
|
style: { width: "100%" }
|
|
1716
1715
|
}), {
|
|
1717
1716
|
default: h(() => [
|
|
1718
|
-
(c(!0), g(S, null, I(
|
|
1717
|
+
(c(!0), g(S, null, I(t.item.item.options?.radio?.data, (e) => (c(), b(l(fe), {
|
|
1719
1718
|
key: e.value,
|
|
1720
1719
|
label: e.label,
|
|
1721
1720
|
value: e.value
|
|
1722
1721
|
}, null, 8, ["label", "value"]))), 128))
|
|
1723
1722
|
]),
|
|
1724
1723
|
_: 1
|
|
1725
|
-
}, 16, ["modelValue", "disabled"])) :
|
|
1724
|
+
}, 16, ["modelValue", "disabled"])) : t.item.item.type === "list" ? (c(), b(le, v({
|
|
1726
1725
|
key: 4,
|
|
1727
|
-
row:
|
|
1728
|
-
field:
|
|
1729
|
-
},
|
|
1730
|
-
disabled:
|
|
1726
|
+
row: t.conf.update.form,
|
|
1727
|
+
field: t.item.item.key
|
|
1728
|
+
}, t.item.item.options?.list, F(t.item.item.options?.list?.on || {}), {
|
|
1729
|
+
disabled: t.conf.update.getDisabled(t.item.item),
|
|
1731
1730
|
style: { width: "100%" }
|
|
1732
|
-
}), null, 16, ["row", "field", "disabled"])) :
|
|
1731
|
+
}), null, 16, ["row", "field", "disabled"])) : t.item.item.type === "tree-select" ? (c(), b(l(ae), v({
|
|
1733
1732
|
key: 5,
|
|
1734
|
-
modelValue:
|
|
1735
|
-
"onUpdate:modelValue": s[4] || (s[4] = (e) =>
|
|
1736
|
-
},
|
|
1737
|
-
disabled:
|
|
1733
|
+
modelValue: t.conf.update.form[t.item.item.key],
|
|
1734
|
+
"onUpdate:modelValue": s[4] || (s[4] = (e) => t.conf.update.form[t.item.item.key] = e)
|
|
1735
|
+
}, t.item.item.options?.treeSelect, F(t.item.item.options?.treeSelect?.on || {}), {
|
|
1736
|
+
disabled: t.conf.update.getDisabled(t.item.item),
|
|
1738
1737
|
style: { width: "100%" }
|
|
1739
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
1738
|
+
}), null, 16, ["modelValue", "disabled"])) : t.item.item.type === "datetime" ? (c(), b(l(te), v({
|
|
1740
1739
|
key: 6,
|
|
1741
|
-
modelValue:
|
|
1742
|
-
"onUpdate:modelValue": s[5] || (s[5] = (e) =>
|
|
1743
|
-
},
|
|
1744
|
-
disabled:
|
|
1745
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
1740
|
+
modelValue: t.conf.update.form[t.item.item.key],
|
|
1741
|
+
"onUpdate:modelValue": s[5] || (s[5] = (e) => t.conf.update.form[t.item.item.key] = e)
|
|
1742
|
+
}, t.item.item.options?.datetime, F(t.item.item.options?.datetime?.on || {}), {
|
|
1743
|
+
disabled: t.conf.update.getDisabled(t.item.item)
|
|
1744
|
+
}), null, 16, ["modelValue", "disabled"])) : t.item.item.type && l(T).customComponent[t.item.item.type] ? (c(), b(G(l(T).customComponent[t.item.item.type]), v({
|
|
1746
1745
|
key: 7,
|
|
1747
|
-
modelValue:
|
|
1748
|
-
"onUpdate:modelValue": s[6] || (s[6] = (e) =>
|
|
1749
|
-
},
|
|
1750
|
-
disabled:
|
|
1746
|
+
modelValue: t.conf.update.form[t.item.item.key],
|
|
1747
|
+
"onUpdate:modelValue": s[6] || (s[6] = (e) => t.conf.update.form[t.item.item.key] = e)
|
|
1748
|
+
}, t.item.item.options?.[t.item.item.type], F(t.item.item.options?.[t.item.item.type]?.on || {}), {
|
|
1749
|
+
disabled: t.conf.update.getDisabled(t.item.item)
|
|
1751
1750
|
}), null, 16, ["modelValue", "disabled"])) : C("", !0)
|
|
1752
1751
|
]),
|
|
1753
|
-
k(
|
|
1754
|
-
row:
|
|
1755
|
-
item:
|
|
1752
|
+
k(t.$slots, "form-" + t.item.item.key + "-right", {
|
|
1753
|
+
row: t.conf.update.form,
|
|
1754
|
+
item: t.item.item
|
|
1756
1755
|
})
|
|
1757
1756
|
]),
|
|
1758
|
-
k(
|
|
1759
|
-
row:
|
|
1760
|
-
item:
|
|
1757
|
+
k(t.$slots, "form-" + t.item.item.key + "-tip", {
|
|
1758
|
+
row: t.conf.update.form,
|
|
1759
|
+
item: t.item.item
|
|
1761
1760
|
}, () => [
|
|
1762
|
-
|
|
1761
|
+
t.item.item.form?.tipText ? (c(), g("div", {
|
|
1763
1762
|
key: 0,
|
|
1764
1763
|
class: "form-tip-text",
|
|
1765
|
-
innerHTML:
|
|
1764
|
+
innerHTML: t.item.item.form?.tipText
|
|
1766
1765
|
}, null, 8, Xe)) : C("", !0)
|
|
1767
1766
|
])
|
|
1768
1767
|
]),
|
|
1769
|
-
k(
|
|
1770
|
-
row:
|
|
1771
|
-
item:
|
|
1768
|
+
k(t.$slots, "form-" + t.item.item.key + "-end", {
|
|
1769
|
+
row: t.conf.update.form,
|
|
1770
|
+
item: t.item.item
|
|
1772
1771
|
})
|
|
1773
1772
|
])
|
|
1774
1773
|
]),
|
|
@@ -1797,10 +1796,10 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
1797
1796
|
default: {}
|
|
1798
1797
|
}
|
|
1799
1798
|
},
|
|
1800
|
-
setup(r, { expose:
|
|
1801
|
-
const s = $.EDialog, e = r, n = $.isFun, { conf:
|
|
1802
|
-
return
|
|
1803
|
-
conf:
|
|
1799
|
+
setup(r, { expose: t }) {
|
|
1800
|
+
const s = $.EDialog, e = r, n = $.isFun, { conf: o, switchConfirmRef: a, ruleFormRef: d } = Fe(e);
|
|
1801
|
+
return t({
|
|
1802
|
+
conf: o
|
|
1804
1803
|
}), (p, m) => {
|
|
1805
1804
|
const u = ke("loading");
|
|
1806
1805
|
return c(), g("div", Ye, [
|
|
@@ -1809,17 +1808,17 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
1809
1808
|
O("div", xe, [
|
|
1810
1809
|
r.option.search?.show !== !1 ? (c(), g("div", _e, [
|
|
1811
1810
|
D(l(Q), {
|
|
1812
|
-
model: l(
|
|
1811
|
+
model: l(o).search.form,
|
|
1813
1812
|
inline: ""
|
|
1814
1813
|
}, {
|
|
1815
1814
|
default: h(() => [
|
|
1816
1815
|
k(p.$slots, "search-start", {
|
|
1817
|
-
row: l(
|
|
1816
|
+
row: l(o).search.form
|
|
1818
1817
|
}),
|
|
1819
|
-
(c(!0), g(S, null, I(l(
|
|
1818
|
+
(c(!0), g(S, null, I(l(o).search.column.list, (i) => (c(), g(S, {
|
|
1820
1819
|
key: i.key
|
|
1821
1820
|
}, [
|
|
1822
|
-
(typeof i.show?.search == "function" ? i.show?.search(l(
|
|
1821
|
+
(typeof i.show?.search == "function" ? i.show?.search(l(o).search.form) : i.show?.search) ? (c(), b(l(H), {
|
|
1823
1822
|
key: 0,
|
|
1824
1823
|
label: typeof i.text?.search?.label == "string" ? i.text?.search?.label : i.label,
|
|
1825
1824
|
class: A({
|
|
@@ -1828,21 +1827,21 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
1828
1827
|
}, {
|
|
1829
1828
|
default: h(() => [
|
|
1830
1829
|
k(p.$slots, "search-" + i.key, {
|
|
1831
|
-
row: l(
|
|
1830
|
+
row: l(o).search.form
|
|
1832
1831
|
}, () => [
|
|
1833
1832
|
i.type === "input" ? (c(), b(l(q), v({
|
|
1834
1833
|
key: 0,
|
|
1835
|
-
modelValue: l(
|
|
1836
|
-
"onUpdate:modelValue": (f) => l(
|
|
1837
|
-
placeholder: l(
|
|
1834
|
+
modelValue: l(o).search.form[i.key],
|
|
1835
|
+
"onUpdate:modelValue": (f) => l(o).search.form[i.key] = f,
|
|
1836
|
+
placeholder: l(o).search.getPlaceholder(i),
|
|
1838
1837
|
clearable: "",
|
|
1839
1838
|
disabled: i.disabled?.search,
|
|
1840
1839
|
ref_for: !0
|
|
1841
|
-
}, 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(
|
|
1840
|
+
}, 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({
|
|
1842
1841
|
key: 1,
|
|
1843
|
-
modelValue: l(
|
|
1844
|
-
"onUpdate:modelValue": (f) => l(
|
|
1845
|
-
placeholder: l(
|
|
1842
|
+
modelValue: l(o).search.form[i.key],
|
|
1843
|
+
"onUpdate:modelValue": (f) => l(o).search.form[i.key] = f,
|
|
1844
|
+
placeholder: l(o).search.getPlaceholder(i, l(y).tCurd("placeholderSelect")),
|
|
1846
1845
|
clearable: "",
|
|
1847
1846
|
disabled: i.disabled?.search,
|
|
1848
1847
|
ref_for: !0
|
|
@@ -1860,11 +1859,11 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
1860
1859
|
}, null, 8, ["label", "value"]))
|
|
1861
1860
|
]),
|
|
1862
1861
|
_: 2
|
|
1863
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : i.type === "select" ? (c(), b(l(
|
|
1862
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : i.type === "select" ? (c(), b(l(W), v({
|
|
1864
1863
|
key: 2,
|
|
1865
|
-
modelValue: l(
|
|
1866
|
-
"onUpdate:modelValue": (f) => l(
|
|
1867
|
-
placeholder: l(
|
|
1864
|
+
modelValue: l(o).search.form[i.key],
|
|
1865
|
+
"onUpdate:modelValue": (f) => l(o).search.form[i.key] = f,
|
|
1866
|
+
placeholder: l(o).search.getPlaceholder(i, l(y).tCurd("placeholderSelect")),
|
|
1868
1867
|
clearable: "",
|
|
1869
1868
|
disabled: i.disabled?.search,
|
|
1870
1869
|
ref_for: !0
|
|
@@ -1879,35 +1878,35 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
1879
1878
|
_: 2
|
|
1880
1879
|
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : i.type === "datetime" ? (c(), b(l(te), v({
|
|
1881
1880
|
key: 3,
|
|
1882
|
-
modelValue: l(
|
|
1883
|
-
"onUpdate:modelValue": (f) => l(
|
|
1881
|
+
modelValue: l(o).search.form[i.key],
|
|
1882
|
+
"onUpdate:modelValue": (f) => l(o).search.form[i.key] = f,
|
|
1884
1883
|
disabled: i.disabled?.search,
|
|
1885
1884
|
ref_for: !0
|
|
1886
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(T).customComponent[i.type] ? (c(), b(G(l(T).customComponent[i.type]), v({
|
|
1887
1886
|
key: 4,
|
|
1888
|
-
modelValue: l(
|
|
1889
|
-
"onUpdate:modelValue": (f) => l(
|
|
1887
|
+
modelValue: l(o).search.form[i.key],
|
|
1888
|
+
"onUpdate:modelValue": (f) => l(o).search.form[i.key] = f,
|
|
1890
1889
|
ref_for: !0
|
|
1891
1890
|
}, i.options?.search?.[i.type] || i.options?.[i.type], F(i.options?.search?.[i.type]?.on || i.options?.[i.type]?.on || {}), {
|
|
1892
1891
|
disabled: i.disabled?.search
|
|
1893
1892
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : C("", !0)
|
|
1894
1893
|
]),
|
|
1895
1894
|
k(p.$slots, "search-" + i.key + "-right", {
|
|
1896
|
-
row: l(
|
|
1895
|
+
row: l(o).search.form
|
|
1897
1896
|
})
|
|
1898
1897
|
]),
|
|
1899
1898
|
_: 2
|
|
1900
1899
|
}, 1032, ["label", "class"])) : C("", !0)
|
|
1901
1900
|
], 64))), 128)),
|
|
1902
1901
|
k(p.$slots, "search-center", {
|
|
1903
|
-
row: l(
|
|
1902
|
+
row: l(o).search.form
|
|
1904
1903
|
}),
|
|
1905
|
-
r.option.tools?.search || r.option.tools?.reset ? (c(), b(l(
|
|
1904
|
+
r.option.tools?.search || r.option.tools?.reset ? (c(), b(l(H), { key: 0 }, {
|
|
1906
1905
|
default: h(() => [
|
|
1907
1906
|
r.option.tools?.search ? (c(), b(l(M), {
|
|
1908
1907
|
key: 0,
|
|
1909
1908
|
type: "primary",
|
|
1910
|
-
onClick: l(
|
|
1909
|
+
onClick: l(o).search.submit
|
|
1911
1910
|
}, {
|
|
1912
1911
|
default: h(() => [
|
|
1913
1912
|
E(U(l(y).tCurd("search")), 1)
|
|
@@ -1916,7 +1915,7 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
1916
1915
|
}, 8, ["onClick"])) : C("", !0),
|
|
1917
1916
|
r.option.tools?.reset ? (c(), b(l(M), {
|
|
1918
1917
|
key: 1,
|
|
1919
|
-
onClick: l(
|
|
1918
|
+
onClick: l(o).search.reset
|
|
1920
1919
|
}, {
|
|
1921
1920
|
default: h(() => [
|
|
1922
1921
|
E(U(l(y).tCurd("reset")), 1)
|
|
@@ -1927,7 +1926,7 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
1927
1926
|
_: 1
|
|
1928
1927
|
})) : C("", !0),
|
|
1929
1928
|
k(p.$slots, "search-end", {
|
|
1930
|
-
row: l(
|
|
1929
|
+
row: l(o).search.form
|
|
1931
1930
|
})
|
|
1932
1931
|
]),
|
|
1933
1932
|
_: 3
|
|
@@ -1938,7 +1937,7 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
1938
1937
|
l(n)(r.option.tools?.add) ? (c(), g("div", ot, [
|
|
1939
1938
|
D(l(M), {
|
|
1940
1939
|
type: "primary",
|
|
1941
|
-
onClick: m[0] || (m[0] = (i) => l(
|
|
1940
|
+
onClick: m[0] || (m[0] = (i) => l(o).update.open(l(s).Insert))
|
|
1942
1941
|
}, {
|
|
1943
1942
|
default: h(() => [
|
|
1944
1943
|
E(U(l(y).tCurd("add")), 1)
|
|
@@ -1949,7 +1948,7 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
1949
1948
|
r.option.table?.selectable && l(n)(r.option.tools?.delete) ? (c(), g("div", lt, [
|
|
1950
1949
|
D(l(M), {
|
|
1951
1950
|
type: "danger",
|
|
1952
|
-
onClick: m[1] || (m[1] = (i) => l(
|
|
1951
|
+
onClick: m[1] || (m[1] = (i) => l(o).remove.open(l(o).table.selection.list))
|
|
1953
1952
|
}, {
|
|
1954
1953
|
default: h(() => [
|
|
1955
1954
|
E(U(l(y).tCurd("delete")), 1)
|
|
@@ -1960,7 +1959,7 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
1960
1959
|
r.option.tools?.expand ? (c(), g("div", at, [
|
|
1961
1960
|
D(l(M), {
|
|
1962
1961
|
type: "warning",
|
|
1963
|
-
onClick: m[2] || (m[2] = (i) => l(
|
|
1962
|
+
onClick: m[2] || (m[2] = (i) => l(o).table.expand.all())
|
|
1964
1963
|
}, {
|
|
1965
1964
|
default: h(() => [
|
|
1966
1965
|
E(U(l(y).tCurd("expandCollapse")), 1)
|
|
@@ -1970,7 +1969,7 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
1970
1969
|
])) : C("", !0),
|
|
1971
1970
|
r.option.tools?.export?.show ? (c(), b(l(pe), {
|
|
1972
1971
|
key: 3,
|
|
1973
|
-
onCommand: l(
|
|
1972
|
+
onCommand: l(o).export.click
|
|
1974
1973
|
}, {
|
|
1975
1974
|
dropdown: h(() => [
|
|
1976
1975
|
D(l(me), null, {
|
|
@@ -2004,7 +2003,7 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2004
2003
|
O("div", nt, [
|
|
2005
2004
|
D(l(M), {
|
|
2006
2005
|
type: "warning",
|
|
2007
|
-
loading: l(
|
|
2006
|
+
loading: l(o).export.loading
|
|
2008
2007
|
}, {
|
|
2009
2008
|
default: h(() => [
|
|
2010
2009
|
E(U(l(y).tCurd("export")), 1)
|
|
@@ -2023,7 +2022,7 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2023
2022
|
key: 0,
|
|
2024
2023
|
class: "refresh-btn",
|
|
2025
2024
|
onClick: m[3] || (m[3] = //@ts-ignore
|
|
2026
|
-
(...i) => l(
|
|
2025
|
+
(...i) => l(o).table.getList && l(o).table.getList(...i))
|
|
2027
2026
|
}, [
|
|
2028
2027
|
D(Te)
|
|
2029
2028
|
])) : C("", !0)
|
|
@@ -2032,12 +2031,12 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2032
2031
|
O("div", rt, [
|
|
2033
2032
|
O("div", st, [
|
|
2034
2033
|
Ce((c(), b(l(he), v({
|
|
2035
|
-
data: l(
|
|
2034
|
+
data: l(o).table.data,
|
|
2036
2035
|
border: r.option.table?.border === void 0 ? !0 : r.option.table?.border,
|
|
2037
|
-
onSelectionChange: l(
|
|
2038
|
-
onSortChange: l(
|
|
2039
|
-
"expand-row-keys": l(
|
|
2040
|
-
onExpandChange: l(
|
|
2036
|
+
onSelectionChange: l(o).table.selection.change,
|
|
2037
|
+
onSortChange: l(o).table.sort.change,
|
|
2038
|
+
"expand-row-keys": l(o).table.expand.rowKeys,
|
|
2039
|
+
onExpandChange: l(o).table.expand.change
|
|
2041
2040
|
}, r.option.table, F(r.option.table?.on || {})), {
|
|
2042
2041
|
default: h(() => [
|
|
2043
2042
|
r.option.table?.selectable || l(n)(r.option.tools?.delete) || r.option.tools?.export?.show ? (c(), b(l(Z), {
|
|
@@ -2049,9 +2048,9 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2049
2048
|
fixed: "left",
|
|
2050
2049
|
"show-overflow-tooltip": !1
|
|
2051
2050
|
}, null, 8, ["selectable"])) : C("", !0),
|
|
2052
|
-
D(
|
|
2053
|
-
conf: l(
|
|
2054
|
-
columnList: l(
|
|
2051
|
+
D(We, {
|
|
2052
|
+
conf: l(o),
|
|
2053
|
+
columnList: l(o).table.column.list,
|
|
2055
2054
|
option: r.option
|
|
2056
2055
|
}, _({ _: 2 }, [
|
|
2057
2056
|
I(p.$slots, (i, f) => ({
|
|
@@ -2063,7 +2062,7 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2063
2062
|
]), 1032, ["conf", "columnList", "option"]),
|
|
2064
2063
|
l(n)(r.option.table?.add) || l(n)(r.option.table?.update) || l(n)(r.option.table?.delete) || l(n)(r.option.table?.view) || p.$slots["table-op-left"] || p.$slots["table-op-right"] ? (c(), b(l(Z), v({
|
|
2065
2064
|
key: 1,
|
|
2066
|
-
width: l(
|
|
2065
|
+
width: l(o).table.op.width(l(n)(r.option.table?.add), l(n)(r.option.table?.update), l(n)(r.option.table?.delete), l(n)(r.option.table?.view), p.$slots["table-op-left"], p.$slots["table-op-right"]),
|
|
2067
2066
|
align: "center",
|
|
2068
2067
|
fixed: "right"
|
|
2069
2068
|
}, r.option.table?.operate), {
|
|
@@ -2074,11 +2073,11 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2074
2073
|
]),
|
|
2075
2074
|
default: h(({ row: i }) => [
|
|
2076
2075
|
k(p.$slots, "table-op-left", { row: i }),
|
|
2077
|
-
r.option.table?.inlineEdit && l(
|
|
2076
|
+
r.option.table?.inlineEdit && l(o).inlineEdit.row === i ? (c(), g(S, { key: 0 }, [
|
|
2078
2077
|
D(l(M), {
|
|
2079
2078
|
link: "",
|
|
2080
2079
|
type: "info",
|
|
2081
|
-
onClick: l(
|
|
2080
|
+
onClick: l(o).inlineEdit.close
|
|
2082
2081
|
}, {
|
|
2083
2082
|
default: h(() => [
|
|
2084
2083
|
E(U(l(y).tCurd("cancel")), 1)
|
|
@@ -2088,8 +2087,8 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2088
2087
|
D(l(M), {
|
|
2089
2088
|
link: "",
|
|
2090
2089
|
type: "primary",
|
|
2091
|
-
onClick: l(
|
|
2092
|
-
loading: l(
|
|
2090
|
+
onClick: l(o).inlineEdit.submit,
|
|
2091
|
+
loading: l(o).inlineEdit.loading
|
|
2093
2092
|
}, {
|
|
2094
2093
|
default: h(() => [
|
|
2095
2094
|
E(U(l(y).tCurd("confirm")), 1)
|
|
@@ -2102,7 +2101,7 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2102
2101
|
key: 0,
|
|
2103
2102
|
link: "",
|
|
2104
2103
|
type: "primary",
|
|
2105
|
-
onClick: (f) => l(
|
|
2104
|
+
onClick: (f) => l(o).update.open(l(s).Insert, i)
|
|
2106
2105
|
}, {
|
|
2107
2106
|
default: h(() => [
|
|
2108
2107
|
E(U(l(y).tCurd("add")), 1)
|
|
@@ -2113,7 +2112,7 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2113
2112
|
key: 1,
|
|
2114
2113
|
link: "",
|
|
2115
2114
|
type: "primary",
|
|
2116
|
-
onClick: (f) => l(
|
|
2115
|
+
onClick: (f) => l(o).update.open(l(s).View, i)
|
|
2117
2116
|
}, {
|
|
2118
2117
|
default: h(() => [
|
|
2119
2118
|
E(U(l(y).tCurd("view")), 1)
|
|
@@ -2124,7 +2123,7 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2124
2123
|
key: 2,
|
|
2125
2124
|
link: "",
|
|
2126
2125
|
type: "warning",
|
|
2127
|
-
onClick: (f) => l(
|
|
2126
|
+
onClick: (f) => l(o).update.open(l(s).Update, i)
|
|
2128
2127
|
}, {
|
|
2129
2128
|
default: h(() => [
|
|
2130
2129
|
E(U(l(y).tCurd("edit")), 1)
|
|
@@ -2135,7 +2134,7 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2135
2134
|
key: 3,
|
|
2136
2135
|
link: "",
|
|
2137
2136
|
type: "danger",
|
|
2138
|
-
onClick: (f) => l(
|
|
2137
|
+
onClick: (f) => l(o).remove.open([i])
|
|
2139
2138
|
}, {
|
|
2140
2139
|
default: h(() => [
|
|
2141
2140
|
E(U(l(y).tCurd("delete")), 1)
|
|
@@ -2150,50 +2149,50 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2150
2149
|
]),
|
|
2151
2150
|
_: 3
|
|
2152
2151
|
}, 16, ["data", "border", "onSelectionChange", "onSortChange", "expand-row-keys", "onExpandChange"])), [
|
|
2153
|
-
[u, l(
|
|
2152
|
+
[u, l(o).table.loading]
|
|
2154
2153
|
])
|
|
2155
2154
|
])
|
|
2156
2155
|
]),
|
|
2157
2156
|
O("div", dt, [
|
|
2158
2157
|
r.option.page?.show === void 0 || r.option.page?.show ? (c(), b(l(be), v({
|
|
2159
2158
|
key: 0,
|
|
2160
|
-
"current-page": l(
|
|
2161
|
-
"onUpdate:currentPage": m[4] || (m[4] = (i) => l(
|
|
2162
|
-
"page-size": l(
|
|
2163
|
-
"onUpdate:pageSize": m[5] || (m[5] = (i) => l(
|
|
2159
|
+
"current-page": l(o).page.num,
|
|
2160
|
+
"onUpdate:currentPage": m[4] || (m[4] = (i) => l(o).page.num = i),
|
|
2161
|
+
"page-size": l(o).page.size,
|
|
2162
|
+
"onUpdate:pageSize": m[5] || (m[5] = (i) => l(o).page.size = i),
|
|
2164
2163
|
background: "",
|
|
2165
|
-
"page-sizes": l(
|
|
2166
|
-
"pager-count": l(
|
|
2167
|
-
layout: l(
|
|
2168
|
-
total: l(
|
|
2169
|
-
onSizeChange: l(
|
|
2170
|
-
onCurrentChange: l(
|
|
2164
|
+
"page-sizes": l(o).page.sizeList,
|
|
2165
|
+
"pager-count": l(o).page.pagerCount,
|
|
2166
|
+
layout: l(o).page.layout,
|
|
2167
|
+
total: l(o).page.total,
|
|
2168
|
+
onSizeChange: l(o).table.getList,
|
|
2169
|
+
onCurrentChange: l(o).table.getList
|
|
2171
2170
|
}, r.option.page?.pagination || {}, F(r.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "onSizeChange", "onCurrentChange"])) : C("", !0)
|
|
2172
2171
|
])
|
|
2173
2172
|
]),
|
|
2174
2173
|
k(p.$slots, "box-right")
|
|
2175
2174
|
]),
|
|
2176
2175
|
D(l(Y), v({
|
|
2177
|
-
modelValue: l(
|
|
2178
|
-
"onUpdate:modelValue": m[6] || (m[6] = (i) => l(
|
|
2179
|
-
title: l(
|
|
2180
|
-
"before-close": l(
|
|
2176
|
+
modelValue: l(o).update.show,
|
|
2177
|
+
"onUpdate:modelValue": m[6] || (m[6] = (i) => l(o).update.show = i),
|
|
2178
|
+
title: l(o).update.title,
|
|
2179
|
+
"before-close": l(o).update.close
|
|
2181
2180
|
}, r.option.dialog), {
|
|
2182
2181
|
footer: h(() => [
|
|
2183
2182
|
O("span", ut, [
|
|
2184
2183
|
D(l(M), {
|
|
2185
|
-
onClick: l(
|
|
2184
|
+
onClick: l(o).update.close
|
|
2186
2185
|
}, {
|
|
2187
2186
|
default: h(() => [
|
|
2188
2187
|
E(U(l(y).tCurd("close")), 1)
|
|
2189
2188
|
]),
|
|
2190
2189
|
_: 1
|
|
2191
2190
|
}, 8, ["onClick"]),
|
|
2192
|
-
l(
|
|
2191
|
+
l(o).update.type !== l(s).View ? (c(), b(l(M), {
|
|
2193
2192
|
key: 0,
|
|
2194
2193
|
type: "primary",
|
|
2195
|
-
onClick: l(
|
|
2196
|
-
loading: l(
|
|
2194
|
+
onClick: l(o).update.submit,
|
|
2195
|
+
loading: l(o).update.loading
|
|
2197
2196
|
}, {
|
|
2198
2197
|
default: h(() => [
|
|
2199
2198
|
E(U(l(y).tCurd("submit")), 1)
|
|
@@ -2206,11 +2205,11 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2206
2205
|
D(l(Q), {
|
|
2207
2206
|
ref_key: "ruleFormRef",
|
|
2208
2207
|
ref: d,
|
|
2209
|
-
model: l(
|
|
2210
|
-
rules: l(
|
|
2208
|
+
model: l(o).update.form,
|
|
2209
|
+
rules: l(o).update.rules
|
|
2211
2210
|
}, {
|
|
2212
2211
|
default: h(() => [
|
|
2213
|
-
l(
|
|
2212
|
+
l(o).update.showContent ? (c(!0), g(S, { key: 0 }, I(l(o).update.formColumn, (i) => (c(), g(S, null, [
|
|
2214
2213
|
l(n)(
|
|
2215
2214
|
(() => {
|
|
2216
2215
|
const f = [], w = (L) => {
|
|
@@ -2218,8 +2217,8 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2218
2217
|
};
|
|
2219
2218
|
return w(i), f;
|
|
2220
2219
|
})(),
|
|
2221
|
-
l(
|
|
2222
|
-
l(
|
|
2220
|
+
l(o).update.form,
|
|
2221
|
+
l(o).update.type
|
|
2223
2222
|
) ? (c(), g("div", {
|
|
2224
2223
|
key: 0,
|
|
2225
2224
|
class: A(["row curd-row", {
|
|
@@ -2227,16 +2226,16 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2227
2226
|
}])
|
|
2228
2227
|
}, [
|
|
2229
2228
|
k(p.$slots, "form-start", {
|
|
2230
|
-
row: l(
|
|
2229
|
+
row: l(o).update.form
|
|
2231
2230
|
}),
|
|
2232
2231
|
(c(!0), g(S, null, I(i, (f) => (c(), g(S, null, [
|
|
2233
|
-
l(n)(f.item.show?.form, l(
|
|
2232
|
+
l(n)(f.item.show?.form, l(o).update.form, l(o).update.type) ? (c(), g("div", {
|
|
2234
2233
|
key: 0,
|
|
2235
|
-
class: A([f.item.form.span > 0 ? `col-${l(
|
|
2234
|
+
class: A([f.item.form.span > 0 ? `col-${l(o).getColumnSpan(f, i)}` : "col", `form-item-col-${f.item.key}`])
|
|
2236
2235
|
}, [
|
|
2237
2236
|
(c(!0), g(S, null, I(f.item.children ? f.children : [f], (w) => (c(), b(Qe, {
|
|
2238
2237
|
key: w.item.key,
|
|
2239
|
-
conf: l(
|
|
2238
|
+
conf: l(o),
|
|
2240
2239
|
item: w
|
|
2241
2240
|
}, _({ _: 2 }, [
|
|
2242
2241
|
I(p.$slots, (L, j) => ({
|
|
@@ -2249,7 +2248,7 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2249
2248
|
], 2)) : C("", !0)
|
|
2250
2249
|
], 64))), 256)),
|
|
2251
2250
|
k(p.$slots, "form-end", {
|
|
2252
|
-
row: l(
|
|
2251
|
+
row: l(o).update.form
|
|
2253
2252
|
})
|
|
2254
2253
|
], 2)) : C("", !0)
|
|
2255
2254
|
], 64))), 256)) : C("", !0)
|
|
@@ -2260,15 +2259,15 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2260
2259
|
_: 3
|
|
2261
2260
|
}, 16, ["modelValue", "title", "before-close"]),
|
|
2262
2261
|
D(l(Y), {
|
|
2263
|
-
modelValue: l(
|
|
2264
|
-
"onUpdate:modelValue": m[7] || (m[7] = (i) => l(
|
|
2265
|
-
title: l(
|
|
2262
|
+
modelValue: l(o).remove.show,
|
|
2263
|
+
"onUpdate:modelValue": m[7] || (m[7] = (i) => l(o).remove.show = i),
|
|
2264
|
+
title: l(o).remove.title,
|
|
2266
2265
|
"close-on-click-modal": !1
|
|
2267
2266
|
}, {
|
|
2268
2267
|
footer: h(() => [
|
|
2269
2268
|
O("span", ct, [
|
|
2270
2269
|
D(l(M), {
|
|
2271
|
-
onClick: l(
|
|
2270
|
+
onClick: l(o).remove.close
|
|
2272
2271
|
}, {
|
|
2273
2272
|
default: h(() => [
|
|
2274
2273
|
E(U(l(y).tCurd("close")), 1)
|
|
@@ -2277,8 +2276,8 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2277
2276
|
}, 8, ["onClick"]),
|
|
2278
2277
|
D(l(M), {
|
|
2279
2278
|
type: "danger",
|
|
2280
|
-
onClick: l(
|
|
2281
|
-
loading: l(
|
|
2279
|
+
onClick: l(o).remove.submit,
|
|
2280
|
+
loading: l(o).remove.loading
|
|
2282
2281
|
}, {
|
|
2283
2282
|
default: h(() => [
|
|
2284
2283
|
E(U(l(y).tCurd("confirmDelete")), 1)
|
|
@@ -2288,7 +2287,7 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2288
2287
|
])
|
|
2289
2288
|
]),
|
|
2290
2289
|
default: h(() => [
|
|
2291
|
-
O("div", null, U(l(y).tCurd("confirmDeleteMessage", l(
|
|
2290
|
+
O("div", null, U(l(y).tCurd("confirmDeleteMessage", l(o).remove.items.length)), 1)
|
|
2292
2291
|
]),
|
|
2293
2292
|
_: 1
|
|
2294
2293
|
}, 8, ["modelValue", "title"]),
|
|
@@ -2307,29 +2306,29 @@ class yt {
|
|
|
2307
2306
|
* @param href - 文件的远程地址
|
|
2308
2307
|
* @param name - 下载后的文件名,默认 `'download.png'`
|
|
2309
2308
|
*/
|
|
2310
|
-
static async download(
|
|
2309
|
+
static async download(t, s = "download.png") {
|
|
2311
2310
|
const e = document.createElement("a");
|
|
2312
|
-
e.style.display = "none", e.href =
|
|
2311
|
+
e.style.display = "none", e.href = t, e.setAttribute("download", s), typeof e.download > "u" && e.setAttribute("target", "_blank"), document.body.appendChild(e), e.click(), document.body.removeChild(e), window.URL.revokeObjectURL(t);
|
|
2313
2312
|
}
|
|
2314
2313
|
/**
|
|
2315
2314
|
* 将json对象或者json数组导出为json文件保存
|
|
2316
2315
|
* @param data
|
|
2317
2316
|
* @param name
|
|
2318
2317
|
*/
|
|
2319
|
-
static exportJSONFile = (
|
|
2320
|
-
const e = new Blob([JSON.stringify(
|
|
2321
|
-
|
|
2318
|
+
static exportJSONFile = (t, s) => {
|
|
2319
|
+
const e = new Blob([JSON.stringify(t)], { type: "application/json" }), n = URL.createObjectURL(e), o = document.createElement("a");
|
|
2320
|
+
o.href = n, o.download = `${s || "config"}.json`, o.click();
|
|
2322
2321
|
};
|
|
2323
2322
|
/**
|
|
2324
2323
|
* 导入文件内容,默认为json
|
|
2325
2324
|
* @param param
|
|
2326
2325
|
* @returns
|
|
2327
2326
|
*/
|
|
2328
|
-
static importFile = async (
|
|
2327
|
+
static importFile = async (t) => new Promise((s, e) => {
|
|
2329
2328
|
const n = document.createElement("input");
|
|
2330
2329
|
n.type = "file";
|
|
2331
|
-
const
|
|
2332
|
-
n.accept =
|
|
2330
|
+
const o = t?.accept || ".json";
|
|
2331
|
+
n.accept = o, n.style.display = "none", n.onchange = (a) => {
|
|
2333
2332
|
const d = a.target.files[0];
|
|
2334
2333
|
if (!d) {
|
|
2335
2334
|
$.fail("未选择文件"), e("未选择文件");
|
|
@@ -2337,7 +2336,7 @@ class yt {
|
|
|
2337
2336
|
}
|
|
2338
2337
|
const p = new FileReader();
|
|
2339
2338
|
p.onload = async (m) => {
|
|
2340
|
-
const u =
|
|
2339
|
+
const u = o == ".json" ? JSON.parse(m.target.result) : m.target.result;
|
|
2341
2340
|
s(u);
|
|
2342
2341
|
}, p.onerror = () => {
|
|
2343
2342
|
$.fail("文件读取失败"), e("文件读取失败");
|
|
@@ -2345,11 +2344,11 @@ class yt {
|
|
|
2345
2344
|
}, document.body.appendChild(n), n.click();
|
|
2346
2345
|
});
|
|
2347
2346
|
}
|
|
2348
|
-
const pt = (r,
|
|
2349
|
-
if (r.component("TCurd", ft), r.component("TFormList", le), r.component("TColumn", Se),
|
|
2350
|
-
T.customComponent =
|
|
2351
|
-
for (const s in
|
|
2352
|
-
r.component(s,
|
|
2347
|
+
const pt = (r, t) => {
|
|
2348
|
+
if (r.component("TCurd", ft), r.component("TFormList", le), r.component("TColumn", Se), t?.customComponent) {
|
|
2349
|
+
T.customComponent = t.customComponent;
|
|
2350
|
+
for (const s in t.customComponent)
|
|
2351
|
+
r.component(s, t.customComponent[s]);
|
|
2353
2352
|
}
|
|
2354
2353
|
}, gt = {
|
|
2355
2354
|
install: pt
|