cc1-form 1.2.2 → 1.2.4
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 +404 -394
- package/dist/cc1-form.umd.cjs +1 -1
- package/dist/components/TCurd/com/form/column.vue.d.ts +56 -0
- package/dist/components/TCurd/formColumn.vue.d.ts +40 -0
- package/dist/components/TCurd/index.d.ts +41 -1
- package/dist/components/TCurd/index.vue.d.ts +90 -2
- package/dist/components/TCurd/indexType.d.ts +6 -2
- package/dist/utils/TFormConfig.d.ts +1 -0
- package/package.json +1 -1
package/dist/cc1-form.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ElMessage as ce, ElLoading as me, ElForm as K, ElFormItem as G, ElInput as Z, ElSwitch as X, ElSelect as W, ElOption as N, ElRadioGroup as re, ElRadio as se, ElTreeSelect as de, ElDatePicker as ae, ElDialog as ee, ElButton as
|
|
1
|
+
import { ElMessage as ce, ElLoading as me, ElForm as K, ElFormItem as G, ElInput as Z, ElSwitch as X, ElSelect as W, ElOption as N, ElRadioGroup as re, ElRadio as se, ElTreeSelect as de, ElDatePicker as ae, ElDialog as ee, ElButton as M, ElTableColumn as te, ElDropdown as he, ElDropdownMenu as ge, ElDropdownItem as _, ElPagination as ie, ElTable as ye } from "element-plus";
|
|
2
2
|
import "vue-router";
|
|
3
|
-
import { defineComponent as J, reactive as le, onMounted as ue, resolveComponent as Y, createElementBlock as
|
|
3
|
+
import { defineComponent as J, reactive as le, onMounted as ue, resolveComponent as Y, createElementBlock as y, createCommentVNode as k, openBlock as u, renderSlot as C, createVNode as z, withCtx as m, createTextVNode as $, Fragment as S, renderList as A, createBlock as h, normalizeClass as j, normalizeStyle as fe, ref as H, unref as o, createElementVNode as F, mergeProps as v, toHandlers as D, resolveDynamicComponent as q, toDisplayString as O, getCurrentInstance as be, createSlots as oe, resolveDirective as we, withDirectives as ke, normalizeProps as Ce, guardReactiveProps as ve } from "vue";
|
|
4
4
|
class U {
|
|
5
5
|
/**
|
|
6
6
|
* Vue Router 实例,需在应用初始化时赋值
|
|
@@ -26,13 +26,13 @@ class U {
|
|
|
26
26
|
* @param data 数据
|
|
27
27
|
* @returns 是否显示
|
|
28
28
|
*/
|
|
29
|
-
static isFun = (a, ...
|
|
29
|
+
static isFun = (a, ...f) => Array.isArray(a) ? a.some((t) => typeof t == "function" ? t(...f) : t) : typeof a == "function" ? a(...f) : a;
|
|
30
30
|
/**
|
|
31
31
|
* 获取路由参数,自动获取query、params中的参数, 哪个有就返回哪个
|
|
32
32
|
*/
|
|
33
33
|
static getRouterParams = () => {
|
|
34
|
-
const a = this.router.currentRoute.value.query || {},
|
|
35
|
-
return Object.keys(a).length ? a : Object.keys(
|
|
34
|
+
const a = this.router.currentRoute.value.query || {}, f = this.router.currentRoute.value.params || {};
|
|
35
|
+
return Object.keys(a).length ? a : Object.keys(f).length ? f : {};
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
38
38
|
* 模块赋值
|
|
@@ -45,8 +45,8 @@ class U {
|
|
|
45
45
|
static loadModule = async (a) => {
|
|
46
46
|
if (!U.moduleObj[a])
|
|
47
47
|
throw new Error(`模块${a}未加载,请赋值如:TSys.moduleObj = { ${a}: ()=>import('${a}') }`);
|
|
48
|
-
const
|
|
49
|
-
return
|
|
48
|
+
const f = await U.moduleObj[a]();
|
|
49
|
+
return f.default ?? f;
|
|
50
50
|
};
|
|
51
51
|
/**
|
|
52
52
|
* 提示信息对象管理
|
|
@@ -62,14 +62,14 @@ class U {
|
|
|
62
62
|
* @param type 消息类型
|
|
63
63
|
* @param options 其他选项
|
|
64
64
|
*/
|
|
65
|
-
static showMessage(a,
|
|
65
|
+
static showMessage(a, f, t = {}) {
|
|
66
66
|
const r = Date.now();
|
|
67
67
|
if (!this.tipMessages[a] || r - this.tipMessages[a] > this.tipMessagesGap) {
|
|
68
68
|
this.tipMessages[a] = r;
|
|
69
69
|
const l = Object.assign(
|
|
70
70
|
{
|
|
71
71
|
message: a,
|
|
72
|
-
type:
|
|
72
|
+
type: f
|
|
73
73
|
},
|
|
74
74
|
t
|
|
75
75
|
);
|
|
@@ -83,16 +83,16 @@ class U {
|
|
|
83
83
|
* @param content
|
|
84
84
|
* @param options
|
|
85
85
|
*/
|
|
86
|
-
static fail = (a,
|
|
87
|
-
this.showMessage(a, "error",
|
|
86
|
+
static fail = (a, f = {}) => {
|
|
87
|
+
this.showMessage(a, "error", f);
|
|
88
88
|
};
|
|
89
89
|
/**
|
|
90
90
|
* 成功提示
|
|
91
91
|
* @param content
|
|
92
92
|
* @param options
|
|
93
93
|
*/
|
|
94
|
-
static success = (a,
|
|
95
|
-
this.showMessage(a, "success",
|
|
94
|
+
static success = (a, f = {}) => {
|
|
95
|
+
this.showMessage(a, "success", f);
|
|
96
96
|
};
|
|
97
97
|
static loadingObj = null;
|
|
98
98
|
static loadingTimer = null;
|
|
@@ -101,11 +101,11 @@ class U {
|
|
|
101
101
|
* @param show
|
|
102
102
|
* @param text
|
|
103
103
|
*/
|
|
104
|
-
static loading = (a = !0,
|
|
104
|
+
static loading = (a = !0, f = "Loading...") => {
|
|
105
105
|
Timer.un(this.loadingTimer), this.loadingTimer = Timer.once(() => {
|
|
106
106
|
a ? this.loadingObj = me.service({
|
|
107
107
|
lock: !0,
|
|
108
|
-
text:
|
|
108
|
+
text: f,
|
|
109
109
|
background: "rgba(0, 0, 0, 0.3)"
|
|
110
110
|
}) : this.loadingObj && (this.loadingObj.close(), this.loadingObj = null);
|
|
111
111
|
}, 50);
|
|
@@ -115,8 +115,8 @@ class U {
|
|
|
115
115
|
* @param url 地址
|
|
116
116
|
* @param isCenter 是否居中
|
|
117
117
|
*/
|
|
118
|
-
static openUrl = (a,
|
|
119
|
-
if (
|
|
118
|
+
static openUrl = (a, f = !0) => {
|
|
119
|
+
if (f) {
|
|
120
120
|
let t = screen.width / 2 - 500, r = screen.height / 2 - 800 / 2 - 30;
|
|
121
121
|
window.open(
|
|
122
122
|
a,
|
|
@@ -131,7 +131,7 @@ class U {
|
|
|
131
131
|
* @param param
|
|
132
132
|
* @returns
|
|
133
133
|
*/
|
|
134
|
-
static getImgPic = (a) => new Promise(async (
|
|
134
|
+
static getImgPic = (a) => new Promise(async (f, t) => {
|
|
135
135
|
let r = document.getElementById(a.id);
|
|
136
136
|
const l = await U.loadModule("html2canvas");
|
|
137
137
|
try {
|
|
@@ -147,7 +147,7 @@ class U {
|
|
|
147
147
|
backgroundColor: "#ffffff00"
|
|
148
148
|
}).then(function(e) {
|
|
149
149
|
let s = e.toDataURL("image/png");
|
|
150
|
-
|
|
150
|
+
f(s);
|
|
151
151
|
});
|
|
152
152
|
} catch (e) {
|
|
153
153
|
t(e);
|
|
@@ -459,6 +459,7 @@ class E {
|
|
|
459
459
|
inactiveValue: !1,
|
|
460
460
|
// inactiveText: TFormI18n.tCurd('switchOff'),
|
|
461
461
|
tableConfig: {
|
|
462
|
+
change: !0,
|
|
462
463
|
confirm: !0,
|
|
463
464
|
loadList: !0
|
|
464
465
|
}
|
|
@@ -528,8 +529,8 @@ class L {
|
|
|
528
529
|
* @param field - 字段的 key 值
|
|
529
530
|
* @returns 该字段对应类型的 options 配置,如 select 类型返回 `options.select`
|
|
530
531
|
*/
|
|
531
|
-
static findOptions = (a,
|
|
532
|
-
const t = a.column.find((l) => l.key ===
|
|
532
|
+
static findOptions = (a, f) => {
|
|
533
|
+
const t = a.column.find((l) => l.key === f), r = (l) => l.replace(/-([a-z])/g, (e, s) => s.toUpperCase());
|
|
533
534
|
if (t)
|
|
534
535
|
return t.options[r(t.type)];
|
|
535
536
|
};
|
|
@@ -549,8 +550,8 @@ class L {
|
|
|
549
550
|
}))
|
|
550
551
|
)
|
|
551
552
|
*/
|
|
552
|
-
static setOptionsData = (a,
|
|
553
|
-
const r = L.findOptions(a,
|
|
553
|
+
static setOptionsData = (a, f, t) => {
|
|
554
|
+
const r = L.findOptions(a, f);
|
|
554
555
|
r && (r.data = t);
|
|
555
556
|
};
|
|
556
557
|
static form = {
|
|
@@ -562,9 +563,9 @@ class L {
|
|
|
562
563
|
* @param treeData 树形数据
|
|
563
564
|
* @param option 组件配置
|
|
564
565
|
*/
|
|
565
|
-
parentId: (a,
|
|
566
|
+
parentId: (a, f, t, r) => {
|
|
566
567
|
const l = E.config.table.rowKey;
|
|
567
|
-
a ?
|
|
568
|
+
a ? f.type === U.EDialog.Add ? (f.form.parentId = a[l], f.form.sort = a.children.length + 1) : f.form.parentId = a.parentId.substring(a.parentId.lastIndexOf(",") + 1) : (f.form.parentId = "0", f.form.sort = t.length + 1), L.setOptionsData(r, "parentId", [{ [l]: "0", title: "根", children: t }]);
|
|
568
569
|
}
|
|
569
570
|
}
|
|
570
571
|
};
|
|
@@ -602,21 +603,21 @@ const Ve = {
|
|
|
602
603
|
confirmModify: "确认修改",
|
|
603
604
|
confirmSwitchMessage: "确认要修改吗?"
|
|
604
605
|
};
|
|
605
|
-
class
|
|
606
|
+
class b {
|
|
606
607
|
/** 解析国际化值:函数则执行并返回字符串,字符串则替换 `{key}` 占位符 */
|
|
607
|
-
static t(a, ...
|
|
608
|
+
static t(a, ...f) {
|
|
608
609
|
if (typeof a == "function")
|
|
609
|
-
return a(...
|
|
610
|
+
return a(...f);
|
|
610
611
|
a = String(a);
|
|
611
612
|
let t = 0;
|
|
612
|
-
return a.replace(/{([^}]+)}/g, (r, l) => t <
|
|
613
|
+
return a.replace(/{([^}]+)}/g, (r, l) => t < f.length ? String(f[t++]) : `{${l}}`);
|
|
613
614
|
}
|
|
614
615
|
static setI18n = (a) => {
|
|
615
|
-
|
|
616
|
+
b.curd = ObjectUtil.deepMerge(b.curd, a);
|
|
616
617
|
};
|
|
617
618
|
/** 解析curd国际化值 */
|
|
618
|
-
static tCurd(a, ...
|
|
619
|
-
return this.t(this.curd[a], ...
|
|
619
|
+
static tCurd(a, ...f) {
|
|
620
|
+
return this.t(this.curd[a], ...f);
|
|
620
621
|
}
|
|
621
622
|
/** curd表单 */
|
|
622
623
|
static curd = Ve;
|
|
@@ -631,10 +632,10 @@ class P {
|
|
|
631
632
|
* @param field 字段名
|
|
632
633
|
* @param row 行数据
|
|
633
634
|
*/
|
|
634
|
-
static setId = (a,
|
|
635
|
-
|
|
635
|
+
static setId = (a, f, t) => {
|
|
636
|
+
f[a] || (f[a] = []);
|
|
636
637
|
const r = E.config.table.rowKey;
|
|
637
|
-
|
|
638
|
+
f[a].forEach((l) => {
|
|
638
639
|
t.forEach((e) => {
|
|
639
640
|
let s = e.default ?? "";
|
|
640
641
|
e.type === "number" && (s = e.default ?? 0), e.type === "boolean" && (s = e.default ?? !1), e.type === "time" && (s = e.default ?? /* @__PURE__ */ new Date()), l[e.value] === void 0 && (l[e.value] = s);
|
|
@@ -648,19 +649,19 @@ class P {
|
|
|
648
649
|
* @param itemFields 元素字段-如:[{label:'',value:''}]
|
|
649
650
|
* @param callback 回调函数
|
|
650
651
|
*/
|
|
651
|
-
static add = (a,
|
|
652
|
+
static add = (a, f, t, r) => {
|
|
652
653
|
const l = JSONUtil.cp(t);
|
|
653
|
-
P.setId(a,
|
|
654
|
+
P.setId(a, f, t);
|
|
654
655
|
const e = E.config.table.rowKey;
|
|
655
|
-
|
|
656
|
+
f[a].push(
|
|
656
657
|
l.reduce(
|
|
657
|
-
(s,
|
|
658
|
-
let
|
|
659
|
-
return
|
|
658
|
+
(s, c) => {
|
|
659
|
+
let p = c.default ?? "";
|
|
660
|
+
return c.type === "number" && (p = c.default ?? 0), c.type === "boolean" && (p = c.default ?? !1), c.type === "time" && (p = c.default ?? /* @__PURE__ */ new Date()), s[c.value] = p, s;
|
|
660
661
|
},
|
|
661
662
|
{ [e]: P.getIdFun() }
|
|
662
663
|
)
|
|
663
|
-
), r?.(
|
|
664
|
+
), r?.(f);
|
|
664
665
|
};
|
|
665
666
|
/**
|
|
666
667
|
* 删除数组元素
|
|
@@ -669,9 +670,9 @@ class P {
|
|
|
669
670
|
* @param item 元素-如:{_id:''}
|
|
670
671
|
* @param callback 回调函数
|
|
671
672
|
*/
|
|
672
|
-
static remove = (a,
|
|
673
|
+
static remove = (a, f, t, r) => {
|
|
673
674
|
const l = E.config.table.rowKey;
|
|
674
|
-
|
|
675
|
+
f[a] = f[a].filter((e) => e[l] !== t[l]), r?.(f);
|
|
675
676
|
};
|
|
676
677
|
/**
|
|
677
678
|
* 获取没有id的数据
|
|
@@ -679,10 +680,10 @@ class P {
|
|
|
679
680
|
* @param childernField 子级字段-如:list、children
|
|
680
681
|
* @returns 没有id的数据
|
|
681
682
|
*/
|
|
682
|
-
static getNoIdData = (a,
|
|
683
|
+
static getNoIdData = (a, f) => {
|
|
683
684
|
const t = JSONUtil.cp(a), r = E.config.table.rowKey;
|
|
684
685
|
return t.forEach((l) => {
|
|
685
|
-
l[r] && delete l[r],
|
|
686
|
+
l[r] && delete l[r], f && l[f] && P.getNoIdData(l[f], f);
|
|
686
687
|
}), t;
|
|
687
688
|
};
|
|
688
689
|
}
|
|
@@ -732,7 +733,7 @@ const ze = {
|
|
|
732
733
|
},
|
|
733
734
|
emits: ["change"],
|
|
734
735
|
setup(i, { emit: a }) {
|
|
735
|
-
const
|
|
736
|
+
const f = i, t = le({
|
|
736
737
|
show: !1,
|
|
737
738
|
add: (l, e, s) => {
|
|
738
739
|
P.add(l, e, s, () => {
|
|
@@ -746,18 +747,18 @@ const ze = {
|
|
|
746
747
|
}
|
|
747
748
|
});
|
|
748
749
|
ue(() => {
|
|
749
|
-
P.setId(
|
|
750
|
+
P.setId(f.field, f.row, f.itemFields), t.show = !0;
|
|
750
751
|
});
|
|
751
752
|
const r = a;
|
|
752
753
|
return (l, e) => {
|
|
753
|
-
const s = Y("el-button"),
|
|
754
|
-
return t.show ? (
|
|
754
|
+
const s = Y("el-button"), c = Y("el-input");
|
|
755
|
+
return t.show ? (u(), y("div", ze, [
|
|
755
756
|
C(l.$slots, "list-start", { row: i.row }),
|
|
756
|
-
i.addBottom ? k("", !0) : (
|
|
757
|
+
i.addBottom ? k("", !0) : (u(), y("div", De, [
|
|
757
758
|
z(s, {
|
|
758
759
|
link: "",
|
|
759
760
|
type: "primary",
|
|
760
|
-
onClick: e[0] || (e[0] = (
|
|
761
|
+
onClick: e[0] || (e[0] = (p) => t.add(i.field, i.row, i.itemFields))
|
|
761
762
|
}, {
|
|
762
763
|
default: m(() => e[3] || (e[3] = [
|
|
763
764
|
$("添加")
|
|
@@ -765,27 +766,27 @@ const ze = {
|
|
|
765
766
|
_: 1
|
|
766
767
|
})
|
|
767
768
|
])),
|
|
768
|
-
(
|
|
769
|
+
(u(!0), y(S, null, A(i.row[i.field], (p) => (u(), y("div", $e, [
|
|
769
770
|
C(l.$slots, "item-start", {
|
|
770
|
-
item:
|
|
771
|
+
item: p,
|
|
771
772
|
row: i.row
|
|
772
773
|
}),
|
|
773
|
-
(
|
|
774
|
-
modelValue:
|
|
775
|
-
"onUpdate:modelValue": (n) =>
|
|
774
|
+
(u(!0), y(S, null, A(i.itemFields, (g) => (u(), h(c, {
|
|
775
|
+
modelValue: p[g.value],
|
|
776
|
+
"onUpdate:modelValue": (n) => p[g.value] = n,
|
|
776
777
|
style: fe({ width: i.inputWidth }),
|
|
777
778
|
class: j(i.inputClass),
|
|
778
779
|
placeholder: g[i.label] || g[i.value],
|
|
779
780
|
onChange: e[1] || (e[1] = (n) => r("change"))
|
|
780
781
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "style", "class", "placeholder"]))), 256)),
|
|
781
782
|
C(l.$slots, "item-end", {
|
|
782
|
-
item:
|
|
783
|
+
item: p,
|
|
783
784
|
row: i.row
|
|
784
785
|
}),
|
|
785
786
|
z(s, {
|
|
786
787
|
link: "",
|
|
787
788
|
type: "danger",
|
|
788
|
-
onClick: (g) => t.remove(i.field, i.row,
|
|
789
|
+
onClick: (g) => t.remove(i.field, i.row, p)
|
|
789
790
|
}, {
|
|
790
791
|
default: m(() => e[4] || (e[4] = [
|
|
791
792
|
$("删除")
|
|
@@ -793,11 +794,11 @@ const ze = {
|
|
|
793
794
|
_: 2
|
|
794
795
|
}, 1032, ["onClick"])
|
|
795
796
|
]))), 256)),
|
|
796
|
-
i.addBottom ? (
|
|
797
|
+
i.addBottom ? (u(), y("div", Se, [
|
|
797
798
|
z(s, {
|
|
798
799
|
link: "",
|
|
799
800
|
type: "primary",
|
|
800
|
-
onClick: e[2] || (e[2] = (
|
|
801
|
+
onClick: e[2] || (e[2] = (p) => t.add(i.field, i.row, i.itemFields))
|
|
801
802
|
}, {
|
|
802
803
|
default: m(() => e[5] || (e[5] = [
|
|
803
804
|
$("添加")
|
|
@@ -812,7 +813,7 @@ const ze = {
|
|
|
812
813
|
}), Ue = {
|
|
813
814
|
class: "row form-item-content",
|
|
814
815
|
style: { width: "100%" }
|
|
815
|
-
}, Oe = { class: "col" }, Ee = { class: "col" }, Fe = ["innerHTML"],
|
|
816
|
+
}, Oe = { class: "col" }, Ee = { class: "col" }, Fe = ["innerHTML"], Te = /* @__PURE__ */ J({
|
|
816
817
|
__name: "column",
|
|
817
818
|
props: {
|
|
818
819
|
/**
|
|
@@ -829,7 +830,7 @@ const ze = {
|
|
|
829
830
|
}
|
|
830
831
|
},
|
|
831
832
|
setup(i, { expose: a }) {
|
|
832
|
-
const
|
|
833
|
+
const f = U.isFun, t = U.EDialog, r = H(), l = i, e = le({
|
|
833
834
|
rules: {},
|
|
834
835
|
show: !0,
|
|
835
836
|
form: {},
|
|
@@ -839,9 +840,9 @@ const ze = {
|
|
|
839
840
|
getDisabled: (s) => e.type === t.View ? s.disabled?.view === void 0 ? !0 : s.disabled?.view : s.disabled?.[e.type === t.Add ? "create" : "update"],
|
|
840
841
|
getBind: (s) => s.options?.[e.type === t.Add ? "formAdd" : "formUpdate"]?.[s.type] || s.options?.[s.type] || {},
|
|
841
842
|
getOn: (s) => s.options?.[e.type === t.Add ? "formAdd" : "formUpdate"]?.[s.type]?.on || s.options?.[s.type]?.on || {},
|
|
842
|
-
getColumnSpan: (s,
|
|
843
|
+
getColumnSpan: (s, c) => {
|
|
843
844
|
if (s.item.form?.spanCol) {
|
|
844
|
-
const
|
|
845
|
+
const p = l.option.form?.maxSpan || 12, g = l.option.form?.defaultSpan || p / 2, d = c.filter((V) => !U.isFun(V.item.show?.form, e.form, e.type)).reduce((V, w) => V + (w.item.form?.span || g), 0);
|
|
845
846
|
return (s.item.form?.span || g) + d;
|
|
846
847
|
}
|
|
847
848
|
return s.item.form?.span;
|
|
@@ -849,22 +850,22 @@ const ze = {
|
|
|
849
850
|
initColumnForm: () => {
|
|
850
851
|
const s = l.option;
|
|
851
852
|
e.formColumn = [], e.rules = {}, e.formDefault = {};
|
|
852
|
-
const
|
|
853
|
+
const c = [], p = l.option.form?.maxSpan || 12, g = l.option.form?.defaultSpan || p / 2;
|
|
853
854
|
let n = [];
|
|
854
855
|
const d = (w) => {
|
|
855
856
|
if (w.children) {
|
|
856
|
-
w.children.forEach((
|
|
857
|
-
d(
|
|
857
|
+
w.children.forEach((T) => {
|
|
858
|
+
d(T);
|
|
858
859
|
});
|
|
859
860
|
return;
|
|
860
861
|
}
|
|
861
862
|
if (e.formDefault[w.key] = w.value, w.isForm && (typeof w.show?.form != "boolean" || w.show?.form)) {
|
|
862
863
|
w.form = w.form || { span: g }, w.form.span = w.form.span ?? g;
|
|
863
|
-
const
|
|
864
|
-
if (n.push({ item: w, span:
|
|
864
|
+
const T = w.form.span, B = n.reduce((Q, x) => Q + x.span, T), I = n.length;
|
|
865
|
+
if (n.push({ item: w, span: T }), (I === 1 && n[0].span === 0 || B >= p || T === 0 && I > 1) && (c.push(n), n = []), w.rules) {
|
|
865
866
|
const Q = {
|
|
866
|
-
input:
|
|
867
|
-
select:
|
|
867
|
+
input: b.tCurd("placeholderInput"),
|
|
868
|
+
select: b.tCurd("placeholderSelect")
|
|
868
869
|
}, x = (Q[w.type] || Q.input) + w.label;
|
|
869
870
|
e.rules[w.key] = typeof w.rules == "boolean" ? [
|
|
870
871
|
{
|
|
@@ -875,30 +876,30 @@ const ze = {
|
|
|
875
876
|
] : w.rules;
|
|
876
877
|
}
|
|
877
878
|
}
|
|
878
|
-
}, V = (w,
|
|
879
|
-
w.isForm =
|
|
879
|
+
}, V = (w, T) => {
|
|
880
|
+
w.isForm = T, Array.isArray(w.children) && w.children.forEach((B) => V(B, T));
|
|
880
881
|
};
|
|
881
882
|
s.column.forEach((w) => {
|
|
882
883
|
V(w, !0), d(w);
|
|
883
|
-
}), n.length > 0 &&
|
|
884
|
+
}), n.length > 0 && c.push(n), e.formColumn = c, e.form = JSONUtil.cp(e.formDefault);
|
|
884
885
|
}
|
|
885
886
|
});
|
|
886
887
|
return e.initColumnForm(), a({
|
|
887
888
|
ref: r,
|
|
888
889
|
conf: e
|
|
889
|
-
}), (s,
|
|
890
|
+
}), (s, c) => (u(), h(o(K), {
|
|
890
891
|
ref_key: "ruleFormRef",
|
|
891
892
|
ref: r,
|
|
892
893
|
model: e.form,
|
|
893
894
|
rules: e.rules
|
|
894
895
|
}, {
|
|
895
896
|
default: m(() => [
|
|
896
|
-
e.show ? (
|
|
897
|
-
o(
|
|
898
|
-
|
|
897
|
+
e.show ? (u(!0), y(S, { key: 0 }, A(e.formColumn, (p, g) => (u(), y(S, { key: g }, [
|
|
898
|
+
o(f)(
|
|
899
|
+
p.map((n) => n.item?.show?.form),
|
|
899
900
|
e.form,
|
|
900
901
|
e.type
|
|
901
|
-
) ? (
|
|
902
|
+
) ? (u(), y("div", {
|
|
902
903
|
key: 0,
|
|
903
904
|
class: j(["row curd-row", {
|
|
904
905
|
stripe: i.option.form?.stripe === void 0 ? !0 : i.option.form?.stripe
|
|
@@ -907,12 +908,12 @@ const ze = {
|
|
|
907
908
|
C(s.$slots, "form-start", {
|
|
908
909
|
row: e.form
|
|
909
910
|
}),
|
|
910
|
-
(
|
|
911
|
+
(u(!0), y(S, null, A(p, (n) => (u(), y(S, {
|
|
911
912
|
key: n.item.key
|
|
912
913
|
}, [
|
|
913
|
-
o(
|
|
914
|
+
o(f)(n.item.show?.form, e.form, e.type) ? (u(), y("div", {
|
|
914
915
|
key: 0,
|
|
915
|
-
class: j([n.item.form.span > 0 ? `col-${e.getColumnSpan(n,
|
|
916
|
+
class: j([n.item.form.span > 0 ? `col-${e.getColumnSpan(n, p)}` : "col", `form-item-col-${n.item.key}`])
|
|
916
917
|
}, [
|
|
917
918
|
z(o(G), {
|
|
918
919
|
class: j({
|
|
@@ -934,21 +935,21 @@ const ze = {
|
|
|
934
935
|
row: e.form,
|
|
935
936
|
item: n.item
|
|
936
937
|
}, () => [
|
|
937
|
-
n.item.type === "input" ? (
|
|
938
|
+
n.item.type === "input" ? (u(), h(o(Z), v({
|
|
938
939
|
key: 0,
|
|
939
940
|
modelValue: e.form[n.item.key],
|
|
940
941
|
"onUpdate:modelValue": (d) => e.form[n.item.key] = d,
|
|
941
942
|
ref_for: !0
|
|
942
943
|
}, e.getBind(n.item), D(e.getOn(n.item)), {
|
|
943
944
|
disabled: e.getDisabled(n.item)
|
|
944
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type === "switch" ? (
|
|
945
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type === "switch" ? (u(), h(o(X), v({
|
|
945
946
|
key: 1,
|
|
946
947
|
modelValue: e.form[n.item.key],
|
|
947
948
|
"onUpdate:modelValue": (d) => e.form[n.item.key] = d,
|
|
948
949
|
ref_for: !0
|
|
949
950
|
}, e.getBind(n.item), D(e.getOn(n.item)), {
|
|
950
951
|
disabled: e.getDisabled(n.item)
|
|
951
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type === "select" ? (
|
|
952
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type === "select" ? (u(), h(o(W), v({
|
|
952
953
|
key: 2,
|
|
953
954
|
modelValue: e.form[n.item.key],
|
|
954
955
|
"onUpdate:modelValue": (d) => e.form[n.item.key] = d,
|
|
@@ -958,14 +959,14 @@ const ze = {
|
|
|
958
959
|
style: { width: "100%" }
|
|
959
960
|
}), {
|
|
960
961
|
default: m(() => [
|
|
961
|
-
(
|
|
962
|
+
(u(!0), y(S, null, A(n.item.options?.select?.data, (d) => (u(), h(o(N), {
|
|
962
963
|
key: d.value,
|
|
963
964
|
label: d.label,
|
|
964
965
|
value: d.value
|
|
965
966
|
}, null, 8, ["label", "value"]))), 128))
|
|
966
967
|
]),
|
|
967
968
|
_: 2
|
|
968
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type === "radio" ? (
|
|
969
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type === "radio" ? (u(), h(o(re), v({
|
|
969
970
|
key: 3,
|
|
970
971
|
modelValue: e.form[n.item.key],
|
|
971
972
|
"onUpdate:modelValue": (d) => e.form[n.item.key] = d,
|
|
@@ -975,14 +976,14 @@ const ze = {
|
|
|
975
976
|
style: { width: "100%" }
|
|
976
977
|
}), {
|
|
977
978
|
default: m(() => [
|
|
978
|
-
(
|
|
979
|
+
(u(!0), y(S, null, A(n.item.options?.radio?.data, (d) => (u(), h(o(se), {
|
|
979
980
|
key: d.value,
|
|
980
981
|
label: d.label,
|
|
981
982
|
value: d.value
|
|
982
983
|
}, null, 8, ["label", "value"]))), 128))
|
|
983
984
|
]),
|
|
984
985
|
_: 2
|
|
985
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type === "list" ? (
|
|
986
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type === "list" ? (u(), h(ne, v({
|
|
986
987
|
key: 4,
|
|
987
988
|
row: e.form,
|
|
988
989
|
field: n.item.key,
|
|
@@ -990,7 +991,7 @@ const ze = {
|
|
|
990
991
|
}, e.getBind(n.item), D(e.getOn(n.item)), {
|
|
991
992
|
disabled: e.getDisabled(n.item),
|
|
992
993
|
style: { width: "100%" }
|
|
993
|
-
}), null, 16, ["row", "field", "disabled"])) : n.item.type === "treeSelect" ? (
|
|
994
|
+
}), null, 16, ["row", "field", "disabled"])) : n.item.type === "treeSelect" ? (u(), h(o(de), v({
|
|
994
995
|
key: 5,
|
|
995
996
|
modelValue: e.form[n.item.key],
|
|
996
997
|
"onUpdate:modelValue": (d) => e.form[n.item.key] = d,
|
|
@@ -998,14 +999,14 @@ const ze = {
|
|
|
998
999
|
}, e.getBind(n.item), D(e.getOn(n.item)), {
|
|
999
1000
|
disabled: e.getDisabled(n.item),
|
|
1000
1001
|
style: { width: "100%" }
|
|
1001
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type === "datetime" ? (
|
|
1002
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type === "datetime" ? (u(), h(o(ae), v({
|
|
1002
1003
|
key: 6,
|
|
1003
1004
|
modelValue: e.form[n.item.key],
|
|
1004
1005
|
"onUpdate:modelValue": (d) => e.form[n.item.key] = d,
|
|
1005
1006
|
ref_for: !0
|
|
1006
1007
|
}, e.getBind(n.item), D(e.getOn(n.item)), {
|
|
1007
1008
|
disabled: e.getDisabled(n.item)
|
|
1008
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type && (o(L).customComponent[n.item.type] || o(L).customComponent[n.item.type]?.form) ? (
|
|
1009
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type && (o(L).customComponent[n.item.type] || o(L).customComponent[n.item.type]?.form) ? (u(), h(q(o(L).customComponent[n.item.type]?.form || o(L).customComponent[n.item.type]), v({
|
|
1009
1010
|
key: 7,
|
|
1010
1011
|
modelValue: e.form[n.item.key],
|
|
1011
1012
|
"onUpdate:modelValue": (d) => e.form[n.item.key] = d,
|
|
@@ -1023,7 +1024,7 @@ const ze = {
|
|
|
1023
1024
|
row: e.form,
|
|
1024
1025
|
item: n.item
|
|
1025
1026
|
}, () => [
|
|
1026
|
-
n.item.form?.tipText ? (
|
|
1027
|
+
n.item.form?.tipText ? (u(), y("div", {
|
|
1027
1028
|
key: 0,
|
|
1028
1029
|
class: "form-tip-text",
|
|
1029
1030
|
innerHTML: typeof n.item.form?.tipText == "function" ? n.item.form?.tipText(e.form, e.type) : n.item.form?.tipText
|
|
@@ -1050,7 +1051,7 @@ const ze = {
|
|
|
1050
1051
|
}, 8, ["model", "rules"]));
|
|
1051
1052
|
}
|
|
1052
1053
|
});
|
|
1053
|
-
class
|
|
1054
|
+
class Me {
|
|
1054
1055
|
/**
|
|
1055
1056
|
* 导出数据为 Excel 文件(.xlsx),自动触发浏览器下载
|
|
1056
1057
|
*
|
|
@@ -1058,19 +1059,19 @@ class Ae {
|
|
|
1058
1059
|
* @param columns - 列配置数组,需包含 `key`(数据字段)和 `label`(Excel 表头)
|
|
1059
1060
|
* @param fileName - 文件名(不含扩展名),支持字符串或返回字符串的函数;默认生成「导出数据_日期_时间戳」
|
|
1060
1061
|
*/
|
|
1061
|
-
static exportToExcel = async (a,
|
|
1062
|
+
static exportToExcel = async (a, f, t) => {
|
|
1062
1063
|
if (!a || a.length === 0) return;
|
|
1063
|
-
const r = await U.loadModule("xlsx"), l = a.map((
|
|
1064
|
-
const
|
|
1065
|
-
return
|
|
1066
|
-
|
|
1067
|
-
}),
|
|
1064
|
+
const r = await U.loadModule("xlsx"), l = a.map((c) => {
|
|
1065
|
+
const p = {};
|
|
1066
|
+
return f.forEach((g) => {
|
|
1067
|
+
p[g.label] = c[g.key];
|
|
1068
|
+
}), p;
|
|
1068
1069
|
}), e = r.utils.json_to_sheet(l), s = r.utils.book_new();
|
|
1069
1070
|
r.utils.book_append_sheet(s, e, "Sheet1"), t ? typeof t == "function" && (t = t()) : t = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, r.writeFile(s, `${t}.xlsx`);
|
|
1070
1071
|
};
|
|
1071
1072
|
}
|
|
1072
|
-
const R = U.EDialog,
|
|
1073
|
-
const a = H(),
|
|
1073
|
+
const R = U.EDialog, Ae = (i) => {
|
|
1074
|
+
const a = H(), f = H(), t = le({
|
|
1074
1075
|
option: i.option,
|
|
1075
1076
|
/** 查询区域相关配置对象 */
|
|
1076
1077
|
search: {
|
|
@@ -1084,7 +1085,7 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1084
1085
|
/** 搜索表单默认值 */
|
|
1085
1086
|
formDefault: {},
|
|
1086
1087
|
/** 获取占位符 */
|
|
1087
|
-
getPlaceholder: (r, l =
|
|
1088
|
+
getPlaceholder: (r, l = b.tCurd("placeholderInput")) => r.text?.search?.placeholder === void 0 ? `${l}${r.label}` : r.text?.search?.placeholder,
|
|
1088
1089
|
/** 组装实际要搜索的数据对象 */
|
|
1089
1090
|
getFormData: () => {
|
|
1090
1091
|
let r = {};
|
|
@@ -1194,13 +1195,13 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1194
1195
|
const e = await r({
|
|
1195
1196
|
...t.page.getQuery(),
|
|
1196
1197
|
...l
|
|
1197
|
-
}), s = E.config.field.result,
|
|
1198
|
-
let
|
|
1199
|
-
const g = t.update.formColumn.flat(), n = JSONUtil.cp(
|
|
1200
|
-
const
|
|
1201
|
-
|
|
1198
|
+
}), s = E.config.field.result, c = e.data || { [s.list]: e };
|
|
1199
|
+
let p = (Array.isArray(c[s.list]), c[s.list]);
|
|
1200
|
+
const g = t.update.formColumn.flat(), n = JSONUtil.cp(p).map((d) => (Object.keys(d).forEach((w) => {
|
|
1201
|
+
const T = g.find((B) => B.item.key === w);
|
|
1202
|
+
T && ["select", "radio"].includes(T.item.type) && (T.item.table.format || (T.item.table.format = (B) => T.item.options[T.item.type].data?.find((I) => I.value == B[w])?.label || B[w]));
|
|
1202
1203
|
}), d));
|
|
1203
|
-
t.table.data = i.option.data ? await i.option.data(n,
|
|
1204
|
+
t.table.data = i.option.data ? await i.option.data(n, p) : n, t.page.total = c[s.total] || 0;
|
|
1204
1205
|
} catch (l) {
|
|
1205
1206
|
console.error(l);
|
|
1206
1207
|
} finally {
|
|
@@ -1244,8 +1245,8 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1244
1245
|
const s = JSONUtil.cp({
|
|
1245
1246
|
data: l,
|
|
1246
1247
|
columns: e
|
|
1247
|
-
}),
|
|
1248
|
-
|
|
1248
|
+
}), c = i.option.tools?.export || {};
|
|
1249
|
+
c.before && c.before(s), Me.exportToExcel(s.data, s.columns, c.fileName);
|
|
1249
1250
|
},
|
|
1250
1251
|
/** 获取当前选中项进行导出 */
|
|
1251
1252
|
select: async () => {
|
|
@@ -1259,7 +1260,7 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1259
1260
|
return;
|
|
1260
1261
|
}
|
|
1261
1262
|
if (t.table.selection.list.length === 0)
|
|
1262
|
-
throw U.fail(
|
|
1263
|
+
throw U.fail(b.tCurd("selectDataToExport")), new Error(b.tCurd("selectDataToExport"));
|
|
1263
1264
|
return t.table.selection.list;
|
|
1264
1265
|
} catch (r) {
|
|
1265
1266
|
console.error(r);
|
|
@@ -1278,7 +1279,7 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1278
1279
|
return;
|
|
1279
1280
|
}
|
|
1280
1281
|
if (t.table.data.length === 0)
|
|
1281
|
-
throw U.fail(
|
|
1282
|
+
throw U.fail(b.tCurd("noData")), new Error(b.tCurd("noData"));
|
|
1282
1283
|
return t.table.data;
|
|
1283
1284
|
} catch (r) {
|
|
1284
1285
|
console.error(r);
|
|
@@ -1380,7 +1381,7 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1380
1381
|
try {
|
|
1381
1382
|
t.update.type = r, await t.initApiData("update");
|
|
1382
1383
|
const e = r === R.Add;
|
|
1383
|
-
t.update.edit.data = l, t.update.title =
|
|
1384
|
+
t.update.edit.data = l, t.update.title = b.tCurd(e ? "add" : r === R.View ? "view" : "edit"), t.update.form = JSONUtil.cp(e ? t.update.formDefault : l), await i.option.form?.openBefore?.(t.update.form, t.update), (!i.option.table?.inlineEdit || e) && (t.update.show = !0, t.update.showContent = !0), i.option.form?.openAfter?.(t.update.form, t.update);
|
|
1384
1385
|
} catch (e) {
|
|
1385
1386
|
console.error(e);
|
|
1386
1387
|
} finally {
|
|
@@ -1391,8 +1392,8 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1391
1392
|
/** 提交增改表单操作 */
|
|
1392
1393
|
submit: () => {
|
|
1393
1394
|
FunUtil.throttle(async () => {
|
|
1394
|
-
await
|
|
1395
|
-
s || (U.fail(
|
|
1395
|
+
await f.value?.validate(async (s, c) => new Promise((p, g) => {
|
|
1396
|
+
s || (U.fail(b.tCurd("checkFormData")), g(!1)), p();
|
|
1396
1397
|
})), t.update.loading = !0;
|
|
1397
1398
|
const r = t.update.type === R.Add ? i.option.api.create : i.option.api.update;
|
|
1398
1399
|
try {
|
|
@@ -1406,8 +1407,8 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1406
1407
|
const e = new Set(i.option.column.filter((s) => s.type === "datetime").map((s) => s.key));
|
|
1407
1408
|
Object.keys(l).forEach((s) => {
|
|
1408
1409
|
if (e.has(s) && l[s] != null) {
|
|
1409
|
-
const
|
|
1410
|
-
isNaN(
|
|
1410
|
+
const c = new Date(l[s]).getTime();
|
|
1411
|
+
isNaN(c) || (l[s] = c);
|
|
1411
1412
|
}
|
|
1412
1413
|
});
|
|
1413
1414
|
try {
|
|
@@ -1432,7 +1433,7 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1432
1433
|
/** 删除操作弹窗与数据对象 */
|
|
1433
1434
|
remove: {
|
|
1434
1435
|
/** 删除弹窗标题 */
|
|
1435
|
-
title:
|
|
1436
|
+
title: b.tCurd("confirmDelete"),
|
|
1436
1437
|
/** 删除弹窗显示控制 */
|
|
1437
1438
|
show: !1,
|
|
1438
1439
|
/** 待删除数据项集合 */
|
|
@@ -1446,7 +1447,7 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1446
1447
|
/** 打开删除弹窗并设置待删除项 */
|
|
1447
1448
|
open: (r) => {
|
|
1448
1449
|
if (r.length === 0) {
|
|
1449
|
-
U.fail(
|
|
1450
|
+
U.fail(b.tCurd("selectDataToDelete"));
|
|
1450
1451
|
return;
|
|
1451
1452
|
}
|
|
1452
1453
|
t.remove.items = r, t.remove.show = !0;
|
|
@@ -1461,7 +1462,7 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1461
1462
|
await r({
|
|
1462
1463
|
[i.option.table?.rowKey]: t.remove.items.map((l) => l[i.option.table?.rowKey]),
|
|
1463
1464
|
items: t.remove.items
|
|
1464
|
-
}), U.success(
|
|
1465
|
+
}), U.success(b.tCurd("operationSuccess")), t.table.data.length <= 1 && t.page.num > 1 && (t.page.num -= 1), t.remove.close(), await t.table.getList();
|
|
1465
1466
|
} catch (l) {
|
|
1466
1467
|
console.error(l);
|
|
1467
1468
|
} finally {
|
|
@@ -1480,22 +1481,22 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1480
1481
|
initApiData: async (r) => {
|
|
1481
1482
|
const l = [], e = (s) => {
|
|
1482
1483
|
if (s.children && s.children.length) {
|
|
1483
|
-
s.children.forEach((
|
|
1484
|
+
s.children.forEach((c) => e(c));
|
|
1484
1485
|
return;
|
|
1485
1486
|
}
|
|
1486
1487
|
if (s.options?.[s.type]?.dataApi && s.options?.[s.type]?.dataApiConfig?.[r]) {
|
|
1487
1488
|
if (t.apiDataMap[s.key] && s.options?.[s.type]?.dataApiConfig?.once) return;
|
|
1488
|
-
const
|
|
1489
|
+
const c = (async () => {
|
|
1489
1490
|
try {
|
|
1490
|
-
let
|
|
1491
|
-
if (
|
|
1491
|
+
let p = await s.options?.[s.type]?.dataApi?.(t.update.form, r);
|
|
1492
|
+
if (p) {
|
|
1492
1493
|
const g = s.options?.[s.type]?.dataPath;
|
|
1493
|
-
!Array.isArray(
|
|
1494
|
+
!Array.isArray(p) && g && (p = ObjectUtil.getPathValue(p, g)), s.options[s.type].data = p, s.options.search[s.type].data = p, s.options.formAdd[s.type].data = p, s.options.formUpdate[s.type].data = p, t.apiDataMap[s.key] = p;
|
|
1494
1495
|
}
|
|
1495
1496
|
} catch {
|
|
1496
1497
|
}
|
|
1497
1498
|
})();
|
|
1498
|
-
l.push(
|
|
1499
|
+
l.push(c);
|
|
1499
1500
|
}
|
|
1500
1501
|
};
|
|
1501
1502
|
return i.option.column.forEach((s) => {
|
|
@@ -1505,7 +1506,7 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1505
1506
|
/** 初始化curd配置(option默认值合并等) */
|
|
1506
1507
|
initCurdConfig: () => {
|
|
1507
1508
|
const r = JSONUtil.cp(E.config);
|
|
1508
|
-
r.table.emptyText =
|
|
1509
|
+
r.table.emptyText = b.tCurd("noData"), i.option.size = i.option.size || {}, r.table.size = i.option.size.table || r.size.table, r.form.size = i.option.size.form || r.size.form, r.size.search = i.option.size.search || r.size.search;
|
|
1509
1510
|
const l = ObjectUtil.deepMerge(r, i.option || {});
|
|
1510
1511
|
Object.keys(l).forEach((e) => {
|
|
1511
1512
|
i.option[e] = l[e];
|
|
@@ -1521,8 +1522,8 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1521
1522
|
r.options = ObjectUtil.deepMerge(
|
|
1522
1523
|
{
|
|
1523
1524
|
switch: {
|
|
1524
|
-
activeText:
|
|
1525
|
-
inactiveText:
|
|
1525
|
+
activeText: b.tCurd("switchOn"),
|
|
1526
|
+
inactiveText: b.tCurd("switchOff")
|
|
1526
1527
|
}
|
|
1527
1528
|
},
|
|
1528
1529
|
r.options
|
|
@@ -1531,35 +1532,42 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1531
1532
|
for (const s in r) {
|
|
1532
1533
|
if (s === "table") {
|
|
1533
1534
|
if (e.table = ObjectUtil.deepMerge(r.table, e.table || {}), e.children) {
|
|
1534
|
-
e.children.forEach((
|
|
1535
|
-
l(
|
|
1535
|
+
e.children.forEach((p) => {
|
|
1536
|
+
l(p);
|
|
1536
1537
|
});
|
|
1537
1538
|
return;
|
|
1538
1539
|
}
|
|
1539
1540
|
} else s === "type" ? e.type = e.type || r.type : e[s] = ObjectUtil.deepMerge(r[s], e[s] || {});
|
|
1540
|
-
e.options = e.options || {}, e.options[e.type] = e.options[e.type] || {}, e.options[e.type].size = i.option.size.form, ["search", "formAdd", "formUpdate"].forEach((
|
|
1541
|
-
e.options[
|
|
1541
|
+
e.options = e.options || {}, e.options[e.type] = e.options[e.type] || {}, e.options[e.type].size = i.option.size.form, ["search", "formAdd", "formUpdate"].forEach((p) => {
|
|
1542
|
+
e.options[p] = e.options[p] || JSONUtil.cp(e.options), e.options[p][e.type] = e.options[p][e.type] || {}, e.options[p][e.type].size = p === "search" ? i.option.size.search : i.option.size.form;
|
|
1542
1543
|
}), e.table = ObjectUtil.deepMerge(e.table, e.options[e.type].table || {});
|
|
1543
1544
|
}
|
|
1544
|
-
e.type === "switch" && (e.options.switch.tableBeforeChange = async (s,
|
|
1545
|
-
const
|
|
1545
|
+
e.type === "switch" && (e.options.switch.tableBeforeChange = async (s, c) => {
|
|
1546
|
+
const p = e.options?.switch;
|
|
1546
1547
|
try {
|
|
1547
|
-
|
|
1548
|
-
title:
|
|
1549
|
-
content:
|
|
1548
|
+
p.tableConfig?.confirm && await a.value?.open({
|
|
1549
|
+
title: b.tCurd("confirmModify"),
|
|
1550
|
+
content: b.tCurd("confirmSwitchMessage")
|
|
1550
1551
|
});
|
|
1551
1552
|
try {
|
|
1552
1553
|
if (!i.option.api.update) return;
|
|
1553
|
-
const g =
|
|
1554
|
-
|
|
1555
|
-
const n =
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1554
|
+
const g = c[i.option.table?.rowKey];
|
|
1555
|
+
p.loadingMap || (p.loadingMap = {}), p.loadingMap[g] || (p.loadingMap[g] = { loading: !1 }), p.loadingMap[g].loading = !0;
|
|
1556
|
+
const n = c[s] === p.activeValue ? p.inactiveValue : p.activeValue, d = p.tableConfig?.api ? p.tableConfig.api : i.option.api.update;
|
|
1557
|
+
try {
|
|
1558
|
+
await d(
|
|
1559
|
+
{
|
|
1560
|
+
...c,
|
|
1561
|
+
[s]: n
|
|
1562
|
+
},
|
|
1563
|
+
"switch"
|
|
1564
|
+
);
|
|
1565
|
+
} catch {
|
|
1566
|
+
return !1;
|
|
1567
|
+
} finally {
|
|
1568
|
+
p.loadingMap[g].loading = !1;
|
|
1569
|
+
}
|
|
1570
|
+
return U.success(b.tCurd("operationSuccess")), p.tableConfig?.loadList && (t.table.loading = !0, t.table.getList(), t.table.loading = !1), !0;
|
|
1563
1571
|
} catch (g) {
|
|
1564
1572
|
return console.error(g), !1;
|
|
1565
1573
|
} finally {
|
|
@@ -1574,8 +1582,8 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1574
1582
|
},
|
|
1575
1583
|
getColumnSpan: (r, l) => {
|
|
1576
1584
|
if (r.item.form?.spanCol) {
|
|
1577
|
-
const e = E.config.form.defaultSpan,
|
|
1578
|
-
return (r.item?.form.span || e) +
|
|
1585
|
+
const e = E.config.form.defaultSpan, c = l.filter((p) => !U.isFun(p.item.show?.form, t.update.form, t.update.type)).reduce((p, g) => p + (g.item.form?.span || e), 0);
|
|
1586
|
+
return (r.item?.form.span || e) + c;
|
|
1579
1587
|
}
|
|
1580
1588
|
return r.item.form.span;
|
|
1581
1589
|
},
|
|
@@ -1587,22 +1595,22 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1587
1595
|
listSource: []
|
|
1588
1596
|
};
|
|
1589
1597
|
const l = [], e = i.option.form?.maxSpan || 12, s = i.option.form?.defaultSpan || e / 2;
|
|
1590
|
-
let
|
|
1591
|
-
const
|
|
1598
|
+
let c = [];
|
|
1599
|
+
const p = (d) => {
|
|
1592
1600
|
if (d.children) {
|
|
1593
1601
|
t.table.column.show.list.push(d.key), d.children.forEach((V) => {
|
|
1594
|
-
|
|
1602
|
+
p(V);
|
|
1595
1603
|
});
|
|
1596
1604
|
return;
|
|
1597
1605
|
}
|
|
1598
1606
|
if (t.update.formDefault[d.key] = d.value, d.table.table && (d.show.table && t.table.column.show.list.push(d.key), d.table.table && t.table.column.show.listSource.push(d.key)), !(d.isForm && typeof d.show?.form == "boolean") || d.show?.form) {
|
|
1599
1607
|
d.form = d.form || { span: s }, d.form.span = d.form.span ?? s;
|
|
1600
|
-
let V = d.form.span, w =
|
|
1601
|
-
const
|
|
1602
|
-
if (
|
|
1608
|
+
let V = d.form.span, w = c.reduce((B, I) => B + I.span, V);
|
|
1609
|
+
const T = c.length;
|
|
1610
|
+
if (c.push({ item: d, span: V }), (T === 1 && c[0].span === 0 || w >= e || V === 0 && T > 1) && (l.push(c), c = []), d.rules) {
|
|
1603
1611
|
const B = {
|
|
1604
|
-
input:
|
|
1605
|
-
select:
|
|
1612
|
+
input: b.tCurd("placeholderInput"),
|
|
1613
|
+
select: b.tCurd("placeholderSelect")
|
|
1606
1614
|
}, I = (B[d.type] || B.input) + d.label;
|
|
1607
1615
|
t.update.rules[d.key] = typeof d.rules == "boolean" ? [
|
|
1608
1616
|
{
|
|
@@ -1617,10 +1625,10 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1617
1625
|
d.isForm = V, Array.isArray(d.children) && d.children.forEach((w) => g(w, V));
|
|
1618
1626
|
};
|
|
1619
1627
|
r.column.forEach((d) => {
|
|
1620
|
-
d.isForm = !0, g(d, !0),
|
|
1628
|
+
d.isForm = !0, g(d, !0), p(d);
|
|
1621
1629
|
}), i.option.table?.column?.forEach((d) => {
|
|
1622
|
-
g(d, !1),
|
|
1623
|
-
}), t.search.column.list = r.column.concat(r.table?.column || []), t.table.column.list = t.search.column.list.filter((d) => d.table?.table), t.search.column.list.sort((d, V) => d.sort?.search - V.sort?.search), t.table.column.list.sort((d, V) => d.sort?.table - V.sort?.table),
|
|
1630
|
+
g(d, !1), p(d);
|
|
1631
|
+
}), t.search.column.list = r.column.concat(r.table?.column || []), t.table.column.list = t.search.column.list.filter((d) => d.table?.table), t.search.column.list.sort((d, V) => d.sort?.search - V.sort?.search), t.table.column.list.sort((d, V) => d.sort?.table - V.sort?.table), c.length > 0 && l.push(c), t.update.formColumn = l;
|
|
1624
1632
|
const n = i.option.search?.formDefault;
|
|
1625
1633
|
n && Object.keys(n).forEach((d) => {
|
|
1626
1634
|
t.search.formDefault[d] = n[d];
|
|
@@ -1631,29 +1639,29 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1631
1639
|
});
|
|
1632
1640
|
return t.init(), ue(() => {
|
|
1633
1641
|
i.option.init !== !1 && t.table.getList();
|
|
1634
|
-
}), { conf: t, switchConfirmRef: a, ruleFormRef:
|
|
1642
|
+
}), { conf: t, switchConfirmRef: a, ruleFormRef: f };
|
|
1635
1643
|
}, Le = { class: "dialog-footer" }, Be = /* @__PURE__ */ J({
|
|
1636
1644
|
__name: "switchConfirm",
|
|
1637
1645
|
props: {
|
|
1638
1646
|
size: {}
|
|
1639
1647
|
},
|
|
1640
1648
|
setup(i, { expose: a }) {
|
|
1641
|
-
const
|
|
1649
|
+
const f = H(!1), t = H("确认修改"), r = H("确认要修改状态吗?");
|
|
1642
1650
|
let l = null, e = null;
|
|
1643
|
-
const s = (g) => (g?.title && (t.value = g.title), g?.content && (r.value = g.content),
|
|
1651
|
+
const s = (g) => (g?.title && (t.value = g.title), g?.content && (r.value = g.content), f.value = !0, new Promise((n, d) => {
|
|
1644
1652
|
l = n, e = d;
|
|
1645
|
-
})),
|
|
1646
|
-
|
|
1647
|
-
},
|
|
1648
|
-
|
|
1653
|
+
})), c = () => {
|
|
1654
|
+
f.value = !1, l?.(!0), l = null, e = null;
|
|
1655
|
+
}, p = () => {
|
|
1656
|
+
f.value = !1, e?.(new Error("用户取消操作")), l = null, e = null;
|
|
1649
1657
|
};
|
|
1650
1658
|
return a({
|
|
1651
1659
|
open: s
|
|
1652
1660
|
}), (g, n) => {
|
|
1653
1661
|
const d = Y("el-form");
|
|
1654
|
-
return
|
|
1655
|
-
modelValue:
|
|
1656
|
-
"onUpdate:modelValue": n[0] || (n[0] = (V) =>
|
|
1662
|
+
return u(), h(o(ee), {
|
|
1663
|
+
modelValue: f.value,
|
|
1664
|
+
"onUpdate:modelValue": n[0] || (n[0] = (V) => f.value = V),
|
|
1657
1665
|
title: t.value,
|
|
1658
1666
|
"close-on-click-modal": !1,
|
|
1659
1667
|
width: "400px"
|
|
@@ -1662,15 +1670,15 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1662
1670
|
z(d, { size: g.size }, {
|
|
1663
1671
|
default: m(() => [
|
|
1664
1672
|
F("span", Le, [
|
|
1665
|
-
z(o(
|
|
1673
|
+
z(o(M), { onClick: p }, {
|
|
1666
1674
|
default: m(() => n[1] || (n[1] = [
|
|
1667
1675
|
$("取消")
|
|
1668
1676
|
])),
|
|
1669
1677
|
_: 1
|
|
1670
1678
|
}),
|
|
1671
|
-
z(o(
|
|
1679
|
+
z(o(M), {
|
|
1672
1680
|
type: "primary",
|
|
1673
|
-
onClick:
|
|
1681
|
+
onClick: c
|
|
1674
1682
|
}, {
|
|
1675
1683
|
default: m(() => n[2] || (n[2] = [
|
|
1676
1684
|
$("确认")
|
|
@@ -1690,16 +1698,16 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1690
1698
|
};
|
|
1691
1699
|
}
|
|
1692
1700
|
}), pe = (i, a) => {
|
|
1693
|
-
const
|
|
1701
|
+
const f = i.__vccOpts || i;
|
|
1694
1702
|
for (const [t, r] of a)
|
|
1695
|
-
|
|
1696
|
-
return
|
|
1703
|
+
f[t] = r;
|
|
1704
|
+
return f;
|
|
1697
1705
|
}, je = {}, Ie = {
|
|
1698
1706
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1699
1707
|
viewBox: "0 0 1024 1024"
|
|
1700
1708
|
};
|
|
1701
1709
|
function Re(i, a) {
|
|
1702
|
-
return
|
|
1710
|
+
return u(), y("svg", Ie, a[0] || (a[0] = [
|
|
1703
1711
|
F("path", {
|
|
1704
1712
|
fill: "currentColor",
|
|
1705
1713
|
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"
|
|
@@ -1712,14 +1720,14 @@ const Pe = /* @__PURE__ */ pe(je, [["render", Re]]), Ke = {}, Ne = {
|
|
|
1712
1720
|
viewBox: "0 0 1024 1024"
|
|
1713
1721
|
};
|
|
1714
1722
|
function He(i, a) {
|
|
1715
|
-
return
|
|
1723
|
+
return u(), y("svg", Ne, a[0] || (a[0] = [
|
|
1716
1724
|
F("path", {
|
|
1717
1725
|
fill: "currentColor",
|
|
1718
1726
|
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"
|
|
1719
1727
|
}, null, -1)
|
|
1720
1728
|
]));
|
|
1721
1729
|
}
|
|
1722
|
-
const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-center table-header-label inline" }, qe = { class: "table-header-tooltip" }, Qe = ["onClick", "innerHTML"],
|
|
1730
|
+
const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-center table-header-label inline" }, qe = { class: "table-header-tooltip" }, Qe = { key: 1 }, Ge = ["onClick", "innerHTML"], Xe = /* @__PURE__ */ J({
|
|
1723
1731
|
__name: "tableColumn",
|
|
1724
1732
|
props: {
|
|
1725
1733
|
conf: {},
|
|
@@ -1727,13 +1735,13 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
1727
1735
|
option: {}
|
|
1728
1736
|
},
|
|
1729
1737
|
setup(i) {
|
|
1730
|
-
const a = U.isFun,
|
|
1738
|
+
const a = U.isFun, f = be().type;
|
|
1731
1739
|
return (t, r) => {
|
|
1732
1740
|
const l = Y("el-tooltip");
|
|
1733
|
-
return
|
|
1741
|
+
return u(!0), y(S, null, A(t.columnList, (e) => (u(), y(S, {
|
|
1734
1742
|
key: e.key
|
|
1735
1743
|
}, [
|
|
1736
|
-
t.conf.table.column.show.list.includes(e.key) ? (
|
|
1744
|
+
t.conf.table.column.show.list.includes(e.key) ? (u(), h(o(te), v({
|
|
1737
1745
|
key: 0,
|
|
1738
1746
|
prop: e.key,
|
|
1739
1747
|
label: e.label,
|
|
@@ -1742,7 +1750,7 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
1742
1750
|
header: m(() => [
|
|
1743
1751
|
C(t.$slots, "table-header-" + e.key, { item: e }, () => [
|
|
1744
1752
|
F("div", We, [
|
|
1745
|
-
e.table?.tooltip ? (
|
|
1753
|
+
e.table?.tooltip ? (u(), h(l, {
|
|
1746
1754
|
key: 0,
|
|
1747
1755
|
effect: "dark",
|
|
1748
1756
|
content: e.table?.tooltip,
|
|
@@ -1760,47 +1768,47 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
1760
1768
|
])
|
|
1761
1769
|
]),
|
|
1762
1770
|
default: m(({ row: s }) => [
|
|
1763
|
-
e.children ? (
|
|
1771
|
+
e.children ? (u(), y(S, { key: 0 }, [
|
|
1764
1772
|
r[0] || (r[0] = $(" ")),
|
|
1765
|
-
(
|
|
1773
|
+
(u(), h(q(o(f)), {
|
|
1766
1774
|
conf: t.conf,
|
|
1767
1775
|
columnList: e.children,
|
|
1768
1776
|
option: t.option
|
|
1769
1777
|
}, oe({ _: 2 }, [
|
|
1770
|
-
|
|
1771
|
-
name:
|
|
1778
|
+
A(t.$slots, (c, p) => ({
|
|
1779
|
+
name: p,
|
|
1772
1780
|
fn: m((g) => [
|
|
1773
|
-
C(t.$slots,
|
|
1781
|
+
C(t.$slots, p, v({ ref_for: !0 }, g || {}))
|
|
1774
1782
|
])
|
|
1775
1783
|
}))
|
|
1776
1784
|
]), 1032, ["conf", "columnList", "option"]))
|
|
1777
|
-
], 64)) : (
|
|
1778
|
-
t.conf.update.type === o(U).EDialog.Update && o(a)(e.show?.form, t.conf.update.form, o(U).EDialog.Update) && t.option.table?.inlineEdit && t.conf.update.form[t.option.table?.rowKey] === s[t.option.table?.rowKey] && (e.type === "input" || e.type === "select") ? (
|
|
1779
|
-
e.type === "input" ? (
|
|
1785
|
+
], 64)) : (u(), y(S, { key: 1 }, [
|
|
1786
|
+
t.conf.update.type === o(U).EDialog.Update && o(a)(e.show?.form, t.conf.update.form, o(U).EDialog.Update) && t.option.table?.inlineEdit && t.conf.update.form[t.option.table?.rowKey] === s[t.option.table?.rowKey] && (e.type === "input" || e.type === "select") ? (u(), y(S, { key: 0 }, [
|
|
1787
|
+
e.type === "input" ? (u(), h(o(Z), v({
|
|
1780
1788
|
key: 0,
|
|
1781
1789
|
modelValue: t.conf.update.form[e.key],
|
|
1782
|
-
"onUpdate:modelValue": (
|
|
1790
|
+
"onUpdate:modelValue": (c) => t.conf.update.form[e.key] = c,
|
|
1783
1791
|
disabled: t.conf.update.getDisabled(e),
|
|
1784
1792
|
ref_for: !0
|
|
1785
|
-
}, t.conf.update.getBind(e), D(t.conf.update.getOn(e)), { style: { width: "100%" } }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "select" ? (
|
|
1793
|
+
}, t.conf.update.getBind(e), D(t.conf.update.getOn(e)), { style: { width: "100%" } }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "select" ? (u(), h(o(W), v({
|
|
1786
1794
|
key: 1,
|
|
1787
1795
|
modelValue: t.conf.update.form[e.key],
|
|
1788
|
-
"onUpdate:modelValue": (
|
|
1796
|
+
"onUpdate:modelValue": (c) => t.conf.update.form[e.key] = c,
|
|
1789
1797
|
disabled: t.conf.update.getDisabled(e),
|
|
1790
1798
|
ref_for: !0
|
|
1791
1799
|
}, t.conf.update.getBind(e), D(t.conf.update.getOn(e)), { style: { width: "100%" } }), {
|
|
1792
1800
|
default: m(() => [
|
|
1793
|
-
(
|
|
1794
|
-
key:
|
|
1795
|
-
label:
|
|
1796
|
-
value:
|
|
1801
|
+
(u(!0), y(S, null, A(e.options?.search?.select?.data || e.options?.select?.data, (c) => (u(), h(o(N), {
|
|
1802
|
+
key: c.value,
|
|
1803
|
+
label: c.label,
|
|
1804
|
+
value: c.value
|
|
1797
1805
|
}, null, 8, ["label", "value"]))), 128))
|
|
1798
1806
|
]),
|
|
1799
1807
|
_: 2
|
|
1800
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "switch" ? (
|
|
1808
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "switch" ? (u(), h(o(X), v({
|
|
1801
1809
|
key: 2,
|
|
1802
1810
|
modelValue: t.conf.update.form[e.key],
|
|
1803
|
-
"onUpdate:modelValue": (
|
|
1811
|
+
"onUpdate:modelValue": (c) => t.conf.update.form[e.key] = c,
|
|
1804
1812
|
ref_for: !0
|
|
1805
1813
|
}, t.conf.update.getBind(e), D(t.conf.update.getOn(e)), {
|
|
1806
1814
|
disabled: t.conf.update.getDisabled(e)
|
|
@@ -1810,27 +1818,29 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
1810
1818
|
row: s,
|
|
1811
1819
|
item: e
|
|
1812
1820
|
}, () => [
|
|
1813
|
-
o(L).customComponent[e.type ?? ""]?.table ? (
|
|
1821
|
+
o(L).customComponent[e.type ?? ""]?.table ? (u(), h(q(o(L).customComponent[e.type ?? ""]?.table), v({
|
|
1814
1822
|
key: 0,
|
|
1815
1823
|
modelValue: s[e.key],
|
|
1816
|
-
"onUpdate:modelValue": (
|
|
1817
|
-
ref_for: !0
|
|
1818
|
-
}, e.options?.[e.type ?? ""], D(e.options?.[e.type ?? ""]?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue"])) : e.type === "switch" ? (f(), h(o(X), v({
|
|
1819
|
-
key: 1,
|
|
1820
|
-
modelValue: s[e.key],
|
|
1821
|
-
"onUpdate:modelValue": (p) => s[e.key] = p,
|
|
1822
|
-
loading: e.options?.switch?.loadingMap?.[s[t.option.table?.rowKey]]?.loading,
|
|
1823
|
-
"before-change": () => e.options?.switch?.tableBeforeChange?.(e.key, s),
|
|
1824
|
+
"onUpdate:modelValue": (c) => s[e.key] = c,
|
|
1824
1825
|
ref_for: !0
|
|
1825
|
-
}, e.options?.
|
|
1826
|
+
}, e.options?.[e.type ?? ""], D(e.options?.[e.type ?? ""]?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue"])) : e.type === "switch" ? (u(), y(S, { key: 1 }, [
|
|
1827
|
+
e.options?.switch?.tableConfig?.change ? (u(), h(o(X), v({
|
|
1828
|
+
key: 0,
|
|
1829
|
+
modelValue: s[e.key],
|
|
1830
|
+
"onUpdate:modelValue": (c) => s[e.key] = c,
|
|
1831
|
+
loading: e.options?.switch?.loadingMap?.[s[t.option.table?.rowKey]]?.loading,
|
|
1832
|
+
"before-change": () => e.options?.switch?.tableBeforeChange?.(e.key, s),
|
|
1833
|
+
ref_for: !0
|
|
1834
|
+
}, e.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "loading", "before-change"])) : (u(), y("span", Qe, O(s[e.key] === e.options?.switch?.activeValue ? e.options?.switch?.activeText : e.options?.switch?.inactiveText), 1))
|
|
1835
|
+
], 64)) : (u(), y("span", {
|
|
1826
1836
|
key: 2,
|
|
1827
1837
|
style: fe({
|
|
1828
1838
|
"--table-text-click-color": e.table?.click?.color
|
|
1829
1839
|
}),
|
|
1830
1840
|
class: j({ "table-text-click": e.table?.click?.callback }),
|
|
1831
|
-
onClick: (
|
|
1841
|
+
onClick: (c) => e.table?.click?.callback?.(s),
|
|
1832
1842
|
innerHTML: e.table?.format ? e.table?.format(s) : s[e.key]
|
|
1833
|
-
}, null, 14,
|
|
1843
|
+
}, null, 14, Ge))
|
|
1834
1844
|
])
|
|
1835
1845
|
], 64))
|
|
1836
1846
|
]),
|
|
@@ -1839,17 +1849,17 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
1839
1849
|
], 64))), 128);
|
|
1840
1850
|
};
|
|
1841
1851
|
}
|
|
1842
|
-
}),
|
|
1852
|
+
}), Ye = {
|
|
1843
1853
|
class: "row form-item-content",
|
|
1844
1854
|
style: { width: "100%" }
|
|
1845
|
-
},
|
|
1855
|
+
}, Ze = { class: "col column form-item-content-item" }, xe = { class: "col" }, _e = ["innerHTML"], et = /* @__PURE__ */ J({
|
|
1846
1856
|
__name: "formColumn",
|
|
1847
1857
|
props: {
|
|
1848
1858
|
conf: {},
|
|
1849
1859
|
item: {}
|
|
1850
1860
|
},
|
|
1851
1861
|
setup(i) {
|
|
1852
|
-
return (a,
|
|
1862
|
+
return (a, f) => (u(), h(o(G), {
|
|
1853
1863
|
class: j({
|
|
1854
1864
|
"hide-label": typeof a.item.item.text?.form?.label == "boolean" ? !a.item.item.text?.form?.label : !1
|
|
1855
1865
|
}),
|
|
@@ -1858,85 +1868,85 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
1858
1868
|
"label-width": a.item.item.form?.labelWidth || a.conf.option.form?.labelWidth
|
|
1859
1869
|
}, {
|
|
1860
1870
|
default: m(() => [
|
|
1861
|
-
F("div",
|
|
1871
|
+
F("div", Ye, [
|
|
1862
1872
|
C(a.$slots, "form-" + a.item.item.key + "-start", {
|
|
1863
1873
|
row: a.conf.update.form,
|
|
1864
1874
|
item: a.item.item
|
|
1865
1875
|
}),
|
|
1866
|
-
F("div",
|
|
1867
|
-
F("div",
|
|
1876
|
+
F("div", Ze, [
|
|
1877
|
+
F("div", xe, [
|
|
1868
1878
|
C(a.$slots, "form-" + a.item.item.key, {
|
|
1869
1879
|
row: a.conf.update.form,
|
|
1870
1880
|
item: a.item.item
|
|
1871
1881
|
}, () => [
|
|
1872
|
-
a.item.item.type === "input" ? (
|
|
1882
|
+
a.item.item.type === "input" ? (u(), h(o(Z), v({
|
|
1873
1883
|
key: 0,
|
|
1874
1884
|
modelValue: a.conf.update.form[a.item.item.key],
|
|
1875
|
-
"onUpdate:modelValue":
|
|
1885
|
+
"onUpdate:modelValue": f[0] || (f[0] = (t) => a.conf.update.form[a.item.item.key] = t)
|
|
1876
1886
|
}, a.conf.update.getBind(a.item.item), D(a.conf.update.getOn(a.item.item)), {
|
|
1877
1887
|
disabled: a.conf.update.getDisabled(a.item.item)
|
|
1878
|
-
}), null, 16, ["modelValue", "disabled"])) : a.item.item.type === "switch" ? (
|
|
1888
|
+
}), null, 16, ["modelValue", "disabled"])) : a.item.item.type === "switch" ? (u(), h(o(X), v({
|
|
1879
1889
|
key: 1,
|
|
1880
1890
|
modelValue: a.conf.update.form[a.item.item.key],
|
|
1881
|
-
"onUpdate:modelValue":
|
|
1891
|
+
"onUpdate:modelValue": f[1] || (f[1] = (t) => a.conf.update.form[a.item.item.key] = t)
|
|
1882
1892
|
}, a.conf.update.getBind(a.item.item), D(a.conf.update.getOn(a.item.item)), {
|
|
1883
1893
|
disabled: a.conf.update.getDisabled(a.item.item)
|
|
1884
|
-
}), null, 16, ["modelValue", "disabled"])) : a.item.item.type === "select" ? (
|
|
1894
|
+
}), null, 16, ["modelValue", "disabled"])) : a.item.item.type === "select" ? (u(), h(o(W), v({
|
|
1885
1895
|
key: 2,
|
|
1886
1896
|
modelValue: a.conf.update.form[a.item.item.key],
|
|
1887
|
-
"onUpdate:modelValue":
|
|
1897
|
+
"onUpdate:modelValue": f[2] || (f[2] = (t) => a.conf.update.form[a.item.item.key] = t)
|
|
1888
1898
|
}, a.conf.update.getBind(a.item.item), D(a.conf.update.getOn(a.item.item)), {
|
|
1889
1899
|
disabled: a.conf.update.getDisabled(a.item.item),
|
|
1890
1900
|
style: { width: "100%" }
|
|
1891
1901
|
}), {
|
|
1892
1902
|
default: m(() => [
|
|
1893
|
-
(
|
|
1903
|
+
(u(!0), y(S, null, A(a.conf.update.getBind(a.item.item).data, (t) => (u(), h(o(N), {
|
|
1894
1904
|
key: t.value,
|
|
1895
1905
|
label: t.label,
|
|
1896
1906
|
value: t.value
|
|
1897
1907
|
}, null, 8, ["label", "value"]))), 128))
|
|
1898
1908
|
]),
|
|
1899
1909
|
_: 1
|
|
1900
|
-
}, 16, ["modelValue", "disabled"])) : a.item.item.type === "radio" ? (
|
|
1910
|
+
}, 16, ["modelValue", "disabled"])) : a.item.item.type === "radio" ? (u(), h(o(re), v({
|
|
1901
1911
|
key: 3,
|
|
1902
1912
|
modelValue: a.conf.update.form[a.item.item.key],
|
|
1903
|
-
"onUpdate:modelValue":
|
|
1913
|
+
"onUpdate:modelValue": f[3] || (f[3] = (t) => a.conf.update.form[a.item.item.key] = t)
|
|
1904
1914
|
}, a.conf.update.getBind(a.item.item), D(a.conf.update.getOn(a.item.item)), {
|
|
1905
1915
|
disabled: a.conf.update.getDisabled(a.item.item),
|
|
1906
1916
|
style: { width: "100%" }
|
|
1907
1917
|
}), {
|
|
1908
1918
|
default: m(() => [
|
|
1909
|
-
(
|
|
1919
|
+
(u(!0), y(S, null, A(a.conf.update.getBind(a.item.item).data, (t) => (u(), h(o(se), {
|
|
1910
1920
|
key: t.value,
|
|
1911
1921
|
label: t.label,
|
|
1912
1922
|
value: t.value
|
|
1913
1923
|
}, null, 8, ["label", "value"]))), 128))
|
|
1914
1924
|
]),
|
|
1915
1925
|
_: 1
|
|
1916
|
-
}, 16, ["modelValue", "disabled"])) : a.item.item.type === "list" ? (
|
|
1926
|
+
}, 16, ["modelValue", "disabled"])) : a.item.item.type === "list" ? (u(), h(ne, v({
|
|
1917
1927
|
key: 4,
|
|
1918
1928
|
row: a.conf.update.form,
|
|
1919
1929
|
field: a.item.item.key
|
|
1920
1930
|
}, a.conf.update.getBind(a.item.item), D(a.conf.update.getOn(a.item.item)), {
|
|
1921
1931
|
disabled: a.conf.update.getDisabled(a.item.item),
|
|
1922
1932
|
style: { width: "100%" }
|
|
1923
|
-
}), null, 16, ["row", "field", "disabled"])) : a.item.item.type === "treeSelect" ? (
|
|
1933
|
+
}), null, 16, ["row", "field", "disabled"])) : a.item.item.type === "treeSelect" ? (u(), h(o(de), v({
|
|
1924
1934
|
key: 5,
|
|
1925
1935
|
modelValue: a.conf.update.form[a.item.item.key],
|
|
1926
|
-
"onUpdate:modelValue":
|
|
1936
|
+
"onUpdate:modelValue": f[4] || (f[4] = (t) => a.conf.update.form[a.item.item.key] = t)
|
|
1927
1937
|
}, a.conf.update.getBind(a.item.item), D(a.conf.update.getOn(a.item.item)), {
|
|
1928
1938
|
disabled: a.conf.update.getDisabled(a.item.item),
|
|
1929
1939
|
style: { width: "100%" }
|
|
1930
|
-
}), null, 16, ["modelValue", "disabled"])) : a.item.item.type === "datetime" ? (
|
|
1940
|
+
}), null, 16, ["modelValue", "disabled"])) : a.item.item.type === "datetime" ? (u(), h(o(ae), v({
|
|
1931
1941
|
key: 6,
|
|
1932
1942
|
modelValue: a.conf.update.form[a.item.item.key],
|
|
1933
|
-
"onUpdate:modelValue":
|
|
1943
|
+
"onUpdate:modelValue": f[5] || (f[5] = (t) => a.conf.update.form[a.item.item.key] = t)
|
|
1934
1944
|
}, a.conf.update.getBind(a.item.item), D(a.conf.update.getOn(a.item.item)), {
|
|
1935
1945
|
disabled: a.conf.update.getDisabled(a.item.item)
|
|
1936
|
-
}), null, 16, ["modelValue", "disabled"])) : a.item.item.type && (o(L).customComponent[a.item.item.type] || o(L).customComponent[a.item.item.type]?.form) ? (
|
|
1946
|
+
}), null, 16, ["modelValue", "disabled"])) : a.item.item.type && (o(L).customComponent[a.item.item.type] || o(L).customComponent[a.item.item.type]?.form) ? (u(), h(q(o(L).customComponent[a.item.item.type]?.form || o(L).customComponent[a.item.item.type]), v({
|
|
1937
1947
|
key: 7,
|
|
1938
1948
|
modelValue: a.conf.update.form[a.item.item.key],
|
|
1939
|
-
"onUpdate:modelValue":
|
|
1949
|
+
"onUpdate:modelValue": f[6] || (f[6] = (t) => a.conf.update.form[a.item.item.key] = t)
|
|
1940
1950
|
}, a.conf.update.getBind(a.item.item), D(a.conf.update.getOn(a.item.item)), {
|
|
1941
1951
|
disabled: a.conf.update.getDisabled(a.item.item)
|
|
1942
1952
|
}), null, 16, ["modelValue", "disabled"])) : k("", !0)
|
|
@@ -1950,11 +1960,11 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
1950
1960
|
row: a.conf.update.form,
|
|
1951
1961
|
item: a.item.item
|
|
1952
1962
|
}, () => [
|
|
1953
|
-
a.item.item.form?.tipText ? (
|
|
1963
|
+
a.item.item.form?.tipText ? (u(), y("div", {
|
|
1954
1964
|
key: 0,
|
|
1955
1965
|
class: "form-tip-text",
|
|
1956
1966
|
innerHTML: typeof a.item.item.form?.tipText == "function" ? a.item.item.form?.tipText(a.conf.update.form, a.conf.update.type) : a.item.item.form?.tipText
|
|
1957
|
-
}, null, 8,
|
|
1967
|
+
}, null, 8, _e)) : k("", !0)
|
|
1958
1968
|
])
|
|
1959
1969
|
]),
|
|
1960
1970
|
C(a.$slots, "form-" + a.item.item.key + "-end", {
|
|
@@ -1966,19 +1976,19 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
1966
1976
|
_: 3
|
|
1967
1977
|
}, 8, ["class", "label", "prop", "label-width"]));
|
|
1968
1978
|
}
|
|
1969
|
-
}),
|
|
1979
|
+
}), tt = {
|
|
1970
1980
|
key: 0,
|
|
1971
1981
|
class: "relative curd-search fit-width"
|
|
1972
|
-
},
|
|
1982
|
+
}, ot = { class: "mb-10 flex justify-between items-center fit-width" }, at = {
|
|
1973
1983
|
class: "flex items-center",
|
|
1974
1984
|
style: { gap: "10px" }
|
|
1975
|
-
},
|
|
1985
|
+
}, lt = { key: 0 }, nt = { key: 1 }, it = { key: 2 }, rt = { class: "export-btn" }, st = {
|
|
1976
1986
|
key: 1,
|
|
1977
1987
|
class: "export-btn"
|
|
1978
|
-
},
|
|
1988
|
+
}, dt = {
|
|
1979
1989
|
class: "flex items-center table-tools-right",
|
|
1980
1990
|
style: { gap: "10px" }
|
|
1981
|
-
},
|
|
1991
|
+
}, ut = { class: "row justify-end mt-10 mb-10 table-bottom-pagination" }, ft = { class: "dialog-footer" }, pt = { class: "dialog-footer" }, ct = /* @__PURE__ */ J({
|
|
1982
1992
|
__name: "index",
|
|
1983
1993
|
props: {
|
|
1984
1994
|
/**
|
|
@@ -1989,36 +1999,36 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
1989
1999
|
}
|
|
1990
2000
|
},
|
|
1991
2001
|
setup(i, { expose: a }) {
|
|
1992
|
-
const
|
|
2002
|
+
const f = U.EDialog, t = i, r = U.isFun, { conf: l, switchConfirmRef: e, ruleFormRef: s } = Ae(t);
|
|
1993
2003
|
return a({
|
|
1994
2004
|
conf: l
|
|
1995
|
-
}), (
|
|
2005
|
+
}), (c, p) => {
|
|
1996
2006
|
const g = we("loading");
|
|
1997
|
-
return
|
|
2007
|
+
return u(), y("div", {
|
|
1998
2008
|
class: j(["relative cc1-form-box", [i.option.table?.fitHeight ? "col" : "no-min-height"]])
|
|
1999
2009
|
}, [
|
|
2000
2010
|
F("div", {
|
|
2001
2011
|
class: j(["row", [i.option.table?.fitHeight ? "absolute fit" : ""]]),
|
|
2002
2012
|
style: { overflow: "hidden" }
|
|
2003
2013
|
}, [
|
|
2004
|
-
C(
|
|
2014
|
+
C(c.$slots, "box-left"),
|
|
2005
2015
|
F("div", {
|
|
2006
2016
|
class: j(["column fit-width no-wrap", [i.option.table?.fitHeight ? "col" : ""]])
|
|
2007
2017
|
}, [
|
|
2008
|
-
i.option.search?.show !== !1 ? (
|
|
2018
|
+
i.option.search?.show !== !1 ? (u(), y("div", tt, [
|
|
2009
2019
|
z(o(K), {
|
|
2010
2020
|
model: o(l).search.form,
|
|
2011
2021
|
inline: "",
|
|
2012
2022
|
size: i.option.size?.search
|
|
2013
2023
|
}, {
|
|
2014
2024
|
default: m(() => [
|
|
2015
|
-
C(
|
|
2025
|
+
C(c.$slots, "search-start", {
|
|
2016
2026
|
row: o(l).search.form
|
|
2017
2027
|
}),
|
|
2018
|
-
(
|
|
2028
|
+
(u(!0), y(S, null, A(o(l).search.column.list, (n) => (u(), y(S, {
|
|
2019
2029
|
key: n.key
|
|
2020
2030
|
}, [
|
|
2021
|
-
(typeof n.show?.search == "function" ? n.show?.search(o(l).search.form) : n.show?.search) ? (
|
|
2031
|
+
(typeof n.show?.search == "function" ? n.show?.search(o(l).search.form) : n.show?.search) ? (u(), h(o(G), {
|
|
2022
2032
|
key: 0,
|
|
2023
2033
|
label: typeof n.text?.search?.label == "string" ? n.text?.search?.label : n.label,
|
|
2024
2034
|
class: j({
|
|
@@ -2026,10 +2036,10 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2026
2036
|
})
|
|
2027
2037
|
}, {
|
|
2028
2038
|
default: m(() => [
|
|
2029
|
-
C(
|
|
2039
|
+
C(c.$slots, "search-" + n.key, {
|
|
2030
2040
|
row: o(l).search.form
|
|
2031
2041
|
}, () => [
|
|
2032
|
-
n.type === "input" ? (
|
|
2042
|
+
n.type === "input" ? (u(), h(o(Z), v({
|
|
2033
2043
|
key: 0,
|
|
2034
2044
|
modelValue: o(l).search.form[n.key],
|
|
2035
2045
|
"onUpdate:modelValue": (d) => o(l).search.form[n.key] = d,
|
|
@@ -2037,52 +2047,52 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2037
2047
|
clearable: "",
|
|
2038
2048
|
disabled: n.disabled?.search,
|
|
2039
2049
|
ref_for: !0
|
|
2040
|
-
}, n.options?.search?.input || n.options?.input, D(n.options?.search?.input?.on || n.options?.input?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : n.type === "switch" ? (
|
|
2050
|
+
}, n.options?.search?.input || n.options?.input, D(n.options?.search?.input?.on || n.options?.input?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : n.type === "switch" ? (u(), h(o(W), v({
|
|
2041
2051
|
key: 1,
|
|
2042
2052
|
modelValue: o(l).search.form[n.key],
|
|
2043
2053
|
"onUpdate:modelValue": (d) => o(l).search.form[n.key] = d,
|
|
2044
|
-
placeholder: o(l).search.getPlaceholder(n, o(
|
|
2054
|
+
placeholder: o(l).search.getPlaceholder(n, o(b).tCurd("placeholderSelect")),
|
|
2045
2055
|
clearable: "",
|
|
2046
2056
|
disabled: n.disabled?.search,
|
|
2047
2057
|
ref_for: !0
|
|
2048
2058
|
}, n.options?.search?.switch || n.options?.switch, D(n.options?.search?.switch?.on || n.options?.switch?.on || {})), {
|
|
2049
2059
|
default: m(() => [
|
|
2050
|
-
(
|
|
2060
|
+
(u(), h(o(N), {
|
|
2051
2061
|
key: n.options?.switch?.activeValue,
|
|
2052
|
-
label: n.options?.switch?.
|
|
2062
|
+
label: n.options?.switch?.activeText,
|
|
2053
2063
|
value: n.options?.switch?.activeValue
|
|
2054
2064
|
}, null, 8, ["label", "value"])),
|
|
2055
|
-
(
|
|
2065
|
+
(u(), h(o(N), {
|
|
2056
2066
|
key: n.options?.switch?.inactiveValue,
|
|
2057
|
-
label: n.options?.switch?.
|
|
2067
|
+
label: n.options?.switch?.inactiveText,
|
|
2058
2068
|
value: n.options?.switch?.inactiveValue
|
|
2059
2069
|
}, null, 8, ["label", "value"]))
|
|
2060
2070
|
]),
|
|
2061
2071
|
_: 2
|
|
2062
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : n.type === "select" ? (
|
|
2072
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : n.type === "select" ? (u(), h(o(W), v({
|
|
2063
2073
|
key: 2,
|
|
2064
2074
|
modelValue: o(l).search.form[n.key],
|
|
2065
2075
|
"onUpdate:modelValue": (d) => o(l).search.form[n.key] = d,
|
|
2066
|
-
placeholder: o(l).search.getPlaceholder(n, o(
|
|
2076
|
+
placeholder: o(l).search.getPlaceholder(n, o(b).tCurd("placeholderSelect")),
|
|
2067
2077
|
clearable: "",
|
|
2068
2078
|
disabled: n.disabled?.search,
|
|
2069
2079
|
ref_for: !0
|
|
2070
2080
|
}, n.options?.search?.select || n.options?.select, D(n.options?.search?.select?.on || n.options?.select?.on || {})), {
|
|
2071
2081
|
default: m(() => [
|
|
2072
|
-
(
|
|
2082
|
+
(u(!0), y(S, null, A(n.options?.select?.data, (d) => (u(), h(o(N), {
|
|
2073
2083
|
key: d.value,
|
|
2074
2084
|
label: d.label,
|
|
2075
2085
|
value: d.value
|
|
2076
2086
|
}, null, 8, ["label", "value"]))), 128))
|
|
2077
2087
|
]),
|
|
2078
2088
|
_: 2
|
|
2079
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : n.type === "datetime" ? (
|
|
2089
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : n.type === "datetime" ? (u(), h(o(ae), v({
|
|
2080
2090
|
key: 3,
|
|
2081
2091
|
modelValue: o(l).search.form[n.key],
|
|
2082
2092
|
"onUpdate:modelValue": (d) => o(l).search.form[n.key] = d,
|
|
2083
2093
|
disabled: n.disabled?.search,
|
|
2084
2094
|
ref_for: !0
|
|
2085
|
-
}, n.options?.search?.datetime || n.options?.datetime, D(n.options?.search?.datetime?.on || n.options?.datetime?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.type && o(L).customComponent[n.type] ? (
|
|
2095
|
+
}, n.options?.search?.datetime || n.options?.datetime, D(n.options?.search?.datetime?.on || n.options?.datetime?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.type && o(L).customComponent[n.type] ? (u(), h(q(o(L).customComponent[n.type]), v({
|
|
2086
2096
|
key: 4,
|
|
2087
2097
|
modelValue: o(l).search.form[n.key],
|
|
2088
2098
|
"onUpdate:modelValue": (d) => o(l).search.form[n.key] = d,
|
|
@@ -2091,87 +2101,87 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2091
2101
|
disabled: n.disabled?.search
|
|
2092
2102
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : k("", !0)
|
|
2093
2103
|
]),
|
|
2094
|
-
C(
|
|
2104
|
+
C(c.$slots, "search-" + n.key + "-right", {
|
|
2095
2105
|
row: o(l).search.form
|
|
2096
2106
|
})
|
|
2097
2107
|
]),
|
|
2098
2108
|
_: 2
|
|
2099
2109
|
}, 1032, ["label", "class"])) : k("", !0)
|
|
2100
2110
|
], 64))), 128)),
|
|
2101
|
-
C(
|
|
2111
|
+
C(c.$slots, "search-center", {
|
|
2102
2112
|
row: o(l).search.form
|
|
2103
2113
|
}),
|
|
2104
|
-
i.option.tools?.search || i.option.tools?.reset ? (
|
|
2114
|
+
i.option.tools?.search || i.option.tools?.reset ? (u(), h(o(G), { key: 0 }, {
|
|
2105
2115
|
default: m(() => [
|
|
2106
|
-
i.option.tools?.search ? (
|
|
2116
|
+
i.option.tools?.search ? (u(), h(o(M), {
|
|
2107
2117
|
key: 0,
|
|
2108
2118
|
type: "primary",
|
|
2109
2119
|
onClick: o(l).search.submit
|
|
2110
2120
|
}, {
|
|
2111
2121
|
default: m(() => [
|
|
2112
|
-
$(O(o(
|
|
2122
|
+
$(O(o(b).tCurd("search")), 1)
|
|
2113
2123
|
]),
|
|
2114
2124
|
_: 1
|
|
2115
2125
|
}, 8, ["onClick"])) : k("", !0),
|
|
2116
|
-
i.option.tools?.reset ? (
|
|
2126
|
+
i.option.tools?.reset ? (u(), h(o(M), {
|
|
2117
2127
|
key: 1,
|
|
2118
2128
|
onClick: o(l).search.reset
|
|
2119
2129
|
}, {
|
|
2120
2130
|
default: m(() => [
|
|
2121
|
-
$(O(o(
|
|
2131
|
+
$(O(o(b).tCurd("reset")), 1)
|
|
2122
2132
|
]),
|
|
2123
2133
|
_: 1
|
|
2124
2134
|
}, 8, ["onClick"])) : k("", !0)
|
|
2125
2135
|
]),
|
|
2126
2136
|
_: 1
|
|
2127
2137
|
})) : k("", !0),
|
|
2128
|
-
C(
|
|
2138
|
+
C(c.$slots, "search-end", {
|
|
2129
2139
|
row: o(l).search.form
|
|
2130
2140
|
})
|
|
2131
2141
|
]),
|
|
2132
2142
|
_: 3
|
|
2133
2143
|
}, 8, ["model", "size"])
|
|
2134
2144
|
])) : k("", !0),
|
|
2135
|
-
F("div",
|
|
2136
|
-
F("div",
|
|
2137
|
-
o(r)(i.option.tools?.add) ? (
|
|
2138
|
-
z(o(
|
|
2145
|
+
F("div", ot, [
|
|
2146
|
+
F("div", at, [
|
|
2147
|
+
o(r)(i.option.tools?.add) ? (u(), y("div", lt, [
|
|
2148
|
+
z(o(M), {
|
|
2139
2149
|
type: "primary",
|
|
2140
|
-
onClick:
|
|
2150
|
+
onClick: p[0] || (p[0] = (n) => o(l).update.open(o(f).Add)),
|
|
2141
2151
|
size: i.option.size?.search
|
|
2142
2152
|
}, {
|
|
2143
2153
|
default: m(() => [
|
|
2144
|
-
$(O(o(
|
|
2154
|
+
$(O(o(b).tCurd("add")), 1)
|
|
2145
2155
|
]),
|
|
2146
2156
|
_: 1
|
|
2147
2157
|
}, 8, ["size"])
|
|
2148
2158
|
])) : k("", !0),
|
|
2149
|
-
i.option.table?.selectable && o(r)(i.option.tools?.delete) ? (
|
|
2150
|
-
z(o(
|
|
2159
|
+
i.option.table?.selectable && o(r)(i.option.tools?.delete) ? (u(), y("div", nt, [
|
|
2160
|
+
z(o(M), {
|
|
2151
2161
|
type: "danger",
|
|
2152
|
-
onClick:
|
|
2162
|
+
onClick: p[1] || (p[1] = (n) => o(l).remove.open(o(l).table.selection.list)),
|
|
2153
2163
|
size: i.option.size?.search
|
|
2154
2164
|
}, {
|
|
2155
2165
|
default: m(() => [
|
|
2156
|
-
$(O(o(
|
|
2166
|
+
$(O(o(b).tCurd("delete")), 1)
|
|
2157
2167
|
]),
|
|
2158
2168
|
_: 1
|
|
2159
2169
|
}, 8, ["size"])
|
|
2160
2170
|
])) : k("", !0),
|
|
2161
|
-
i.option.tools?.expand ? (
|
|
2162
|
-
z(o(
|
|
2171
|
+
i.option.tools?.expand ? (u(), y("div", it, [
|
|
2172
|
+
z(o(M), {
|
|
2163
2173
|
type: "warning",
|
|
2164
|
-
onClick:
|
|
2174
|
+
onClick: p[2] || (p[2] = (n) => o(l).table.expand.all()),
|
|
2165
2175
|
size: i.option.size?.search
|
|
2166
2176
|
}, {
|
|
2167
2177
|
default: m(() => [
|
|
2168
|
-
$(O(o(
|
|
2178
|
+
$(O(o(b).tCurd("expandCollapse")), 1)
|
|
2169
2179
|
]),
|
|
2170
2180
|
_: 1
|
|
2171
2181
|
}, 8, ["size"])
|
|
2172
2182
|
])) : k("", !0),
|
|
2173
|
-
i.option.tools?.export?.show ? (
|
|
2174
|
-
i.option.tools?.export?.dropdown?.show ? (
|
|
2183
|
+
i.option.tools?.export?.show ? (u(), y(S, { key: 3 }, [
|
|
2184
|
+
i.option.tools?.export?.dropdown?.show ? (u(), h(o(he), {
|
|
2175
2185
|
key: 0,
|
|
2176
2186
|
onCommand: o(l).export.click
|
|
2177
2187
|
}, {
|
|
@@ -2180,30 +2190,30 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2180
2190
|
size: i.option.size?.search
|
|
2181
2191
|
}, {
|
|
2182
2192
|
default: m(() => [
|
|
2183
|
-
i.option.tools?.export?.dropdown?.select && (i.option.table?.selectable || o(r)(i.option.tools?.delete)) ? (
|
|
2193
|
+
i.option.tools?.export?.dropdown?.select && (i.option.table?.selectable || o(r)(i.option.tools?.delete)) ? (u(), h(o(_), {
|
|
2184
2194
|
key: 0,
|
|
2185
2195
|
command: "select"
|
|
2186
2196
|
}, {
|
|
2187
2197
|
default: m(() => [
|
|
2188
|
-
$(O(o(
|
|
2198
|
+
$(O(o(b).tCurd("exportSelect")), 1)
|
|
2189
2199
|
]),
|
|
2190
2200
|
_: 1
|
|
2191
2201
|
})) : k("", !0),
|
|
2192
|
-
i.option.tools?.export?.dropdown?.page ? (
|
|
2202
|
+
i.option.tools?.export?.dropdown?.page ? (u(), h(o(_), {
|
|
2193
2203
|
key: 1,
|
|
2194
2204
|
command: "page"
|
|
2195
2205
|
}, {
|
|
2196
2206
|
default: m(() => [
|
|
2197
|
-
$(O(o(
|
|
2207
|
+
$(O(o(b).tCurd("exportPage")), 1)
|
|
2198
2208
|
]),
|
|
2199
2209
|
_: 1
|
|
2200
2210
|
})) : k("", !0),
|
|
2201
|
-
i.option.tools?.export?.dropdown?.all ? (
|
|
2211
|
+
i.option.tools?.export?.dropdown?.all ? (u(), h(o(_), {
|
|
2202
2212
|
key: 2,
|
|
2203
2213
|
command: "all"
|
|
2204
2214
|
}, {
|
|
2205
2215
|
default: m(() => [
|
|
2206
|
-
$(O(o(
|
|
2216
|
+
$(O(o(b).tCurd("exportAll")), 1)
|
|
2207
2217
|
]),
|
|
2208
2218
|
_: 1
|
|
2209
2219
|
})) : k("", !0)
|
|
@@ -2212,44 +2222,44 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2212
2222
|
}, 8, ["size"])
|
|
2213
2223
|
]),
|
|
2214
2224
|
default: m(() => [
|
|
2215
|
-
F("div",
|
|
2216
|
-
z(o(
|
|
2225
|
+
F("div", rt, [
|
|
2226
|
+
z(o(M), {
|
|
2217
2227
|
type: "warning",
|
|
2218
2228
|
loading: o(l).export.loading,
|
|
2219
2229
|
size: i.option.size?.search
|
|
2220
2230
|
}, {
|
|
2221
2231
|
default: m(() => [
|
|
2222
|
-
$(O(o(
|
|
2232
|
+
$(O(o(b).tCurd("export")), 1)
|
|
2223
2233
|
]),
|
|
2224
2234
|
_: 1
|
|
2225
2235
|
}, 8, ["loading", "size"])
|
|
2226
2236
|
])
|
|
2227
2237
|
]),
|
|
2228
2238
|
_: 1
|
|
2229
|
-
}, 8, ["onCommand"])) : (
|
|
2230
|
-
z(o(
|
|
2239
|
+
}, 8, ["onCommand"])) : (u(), y("div", st, [
|
|
2240
|
+
z(o(M), {
|
|
2231
2241
|
type: "warning",
|
|
2232
2242
|
loading: o(l).export.loading,
|
|
2233
2243
|
size: i.option.size?.search,
|
|
2234
|
-
onClick:
|
|
2244
|
+
onClick: p[3] || (p[3] = (n) => o(l).export.run.start("all"))
|
|
2235
2245
|
}, {
|
|
2236
2246
|
default: m(() => [
|
|
2237
|
-
$(O(o(
|
|
2247
|
+
$(O(o(b).tCurd("export")), 1)
|
|
2238
2248
|
]),
|
|
2239
2249
|
_: 1
|
|
2240
2250
|
}, 8, ["loading", "size"])
|
|
2241
2251
|
]))
|
|
2242
2252
|
], 64)) : k("", !0),
|
|
2243
|
-
C(
|
|
2253
|
+
C(c.$slots, "tools-left")
|
|
2244
2254
|
]),
|
|
2245
|
-
F("div",
|
|
2246
|
-
C(
|
|
2247
|
-
o(l).page.showTools ? (
|
|
2255
|
+
F("div", dt, [
|
|
2256
|
+
C(c.$slots, "tools-right"),
|
|
2257
|
+
o(l).page.showTools ? (u(), h(o(ie), v({
|
|
2248
2258
|
key: 0,
|
|
2249
2259
|
"current-page": o(l).page.num,
|
|
2250
|
-
"onUpdate:currentPage":
|
|
2260
|
+
"onUpdate:currentPage": p[4] || (p[4] = (n) => o(l).page.num = n),
|
|
2251
2261
|
"page-size": o(l).page.size,
|
|
2252
|
-
"onUpdate:pageSize":
|
|
2262
|
+
"onUpdate:pageSize": p[5] || (p[5] = (n) => o(l).page.size = n),
|
|
2253
2263
|
background: "",
|
|
2254
2264
|
"page-sizes": o(l).page.sizeList,
|
|
2255
2265
|
"pager-count": o(l).page.pagerCount,
|
|
@@ -2259,10 +2269,10 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2259
2269
|
onSizeChange: o(l).table.getList,
|
|
2260
2270
|
onCurrentChange: o(l).table.getList
|
|
2261
2271
|
}, i.option.page?.pagination || {}, D(i.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : k("", !0),
|
|
2262
|
-
i.option.tools?.refresh === void 0 || i.option.tools?.refresh ? (
|
|
2272
|
+
i.option.tools?.refresh === void 0 || i.option.tools?.refresh ? (u(), y("div", {
|
|
2263
2273
|
key: 1,
|
|
2264
2274
|
class: j(["refresh-btn", [i.option.size?.search]]),
|
|
2265
|
-
onClick:
|
|
2275
|
+
onClick: p[6] || (p[6] = //@ts-ignore
|
|
2266
2276
|
(...n) => o(l).table.getList && o(l).table.getList(...n))
|
|
2267
2277
|
}, [
|
|
2268
2278
|
z(Pe)
|
|
@@ -2275,7 +2285,7 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2275
2285
|
F("div", {
|
|
2276
2286
|
class: j(["column form-box-content", [i.option.table?.fitHeight ? "absolute fit" : ""]])
|
|
2277
2287
|
}, [
|
|
2278
|
-
ke((
|
|
2288
|
+
ke((u(), h(o(ye), v({
|
|
2279
2289
|
data: o(l).table.data,
|
|
2280
2290
|
border: i.option.table?.border === void 0 ? !0 : i.option.table?.border,
|
|
2281
2291
|
onSelectionChange: o(l).table.selection.change,
|
|
@@ -2284,7 +2294,7 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2284
2294
|
onExpandChange: o(l).table.expand.change
|
|
2285
2295
|
}, i.option.table, D(i.option.table?.on || {})), {
|
|
2286
2296
|
default: m(() => [
|
|
2287
|
-
(typeof i.option.table?.selectable == "object" ? i.option.table?.selectable?.show : i.option.table?.selectable) || o(r)(i.option.tools?.delete) || i.option.tools?.export?.show && i.option.tools?.export?.select ? (
|
|
2297
|
+
(typeof i.option.table?.selectable == "object" ? i.option.table?.selectable?.show : i.option.table?.selectable) || o(r)(i.option.tools?.delete) || i.option.tools?.export?.show && i.option.tools?.export?.select ? (u(), h(o(te), v({
|
|
2288
2298
|
key: 0,
|
|
2289
2299
|
type: "selection",
|
|
2290
2300
|
width: "40",
|
|
@@ -2293,27 +2303,27 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2293
2303
|
"show-overflow-tooltip": !1,
|
|
2294
2304
|
className: "cc1-form-selectable-column"
|
|
2295
2305
|
}, typeof i.option.table?.selectable == "object" ? i.option.table?.selectable : {}, D(typeof i.option.table?.selectable == "object" ? i.option.table?.selectable?.on || {} : {})), null, 16)) : k("", !0),
|
|
2296
|
-
z(
|
|
2306
|
+
z(Xe, {
|
|
2297
2307
|
conf: o(l),
|
|
2298
2308
|
columnList: o(l).table.column.list,
|
|
2299
2309
|
option: i.option
|
|
2300
2310
|
}, oe({ _: 2 }, [
|
|
2301
|
-
|
|
2311
|
+
A(c.$slots, (n, d) => ({
|
|
2302
2312
|
name: d,
|
|
2303
2313
|
fn: m((V) => [
|
|
2304
|
-
C(
|
|
2314
|
+
C(c.$slots, d, Ce(ve(V || {})))
|
|
2305
2315
|
])
|
|
2306
2316
|
}))
|
|
2307
2317
|
]), 1032, ["conf", "columnList", "option"]),
|
|
2308
|
-
o(r)(i.option.table?.add) || o(r)(i.option.table?.update) || o(r)(i.option.table?.delete) || o(r)(i.option.table?.view) ||
|
|
2318
|
+
o(r)(i.option.table?.add) || o(r)(i.option.table?.update) || o(r)(i.option.table?.delete) || o(r)(i.option.table?.view) || c.$slots["table-op-left"] || c.$slots["table-op-right"] ? (u(), h(o(te), v({
|
|
2309
2319
|
key: 1,
|
|
2310
|
-
width: o(l).table.op.width(o(r)(i.option.table?.add), o(r)(i.option.table?.update), o(r)(i.option.table?.delete), o(r)(i.option.table?.view),
|
|
2320
|
+
width: o(l).table.op.width(o(r)(i.option.table?.add), o(r)(i.option.table?.update), o(r)(i.option.table?.delete), o(r)(i.option.table?.view), c.$slots["table-op-left"], c.$slots["table-op-right"]),
|
|
2311
2321
|
align: "center",
|
|
2312
2322
|
fixed: "right"
|
|
2313
2323
|
}, i.option.table?.operate), {
|
|
2314
2324
|
header: m(() => [
|
|
2315
|
-
C(
|
|
2316
|
-
$(O(o(
|
|
2325
|
+
C(c.$slots, "table-header-op", {}, () => [
|
|
2326
|
+
$(O(o(b).tCurd("operation")), 1)
|
|
2317
2327
|
])
|
|
2318
2328
|
]),
|
|
2319
2329
|
default: m(({ row: n }) => [
|
|
@@ -2321,76 +2331,76 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2321
2331
|
size: i.option.size?.table
|
|
2322
2332
|
}, {
|
|
2323
2333
|
default: m(() => [
|
|
2324
|
-
C(
|
|
2325
|
-
o(l).update.type === o(
|
|
2326
|
-
z(o(
|
|
2334
|
+
C(c.$slots, "table-op-left", { row: n }),
|
|
2335
|
+
o(l).update.type === o(f).Update && i.option.table?.inlineEdit && o(l).update.form[t.option.table?.rowKey] === n[t.option.table?.rowKey] ? (u(), y(S, { key: 0 }, [
|
|
2336
|
+
z(o(M), {
|
|
2327
2337
|
link: "",
|
|
2328
2338
|
type: "info",
|
|
2329
2339
|
onClick: o(l).update.close
|
|
2330
2340
|
}, {
|
|
2331
2341
|
default: m(() => [
|
|
2332
|
-
$(O(o(
|
|
2342
|
+
$(O(o(b).tCurd("cancel")), 1)
|
|
2333
2343
|
]),
|
|
2334
2344
|
_: 1
|
|
2335
2345
|
}, 8, ["onClick"]),
|
|
2336
|
-
z(o(
|
|
2346
|
+
z(o(M), {
|
|
2337
2347
|
link: "",
|
|
2338
2348
|
type: "primary",
|
|
2339
2349
|
onClick: o(l).update.submit,
|
|
2340
2350
|
loading: o(l).update.loading
|
|
2341
2351
|
}, {
|
|
2342
2352
|
default: m(() => [
|
|
2343
|
-
$(O(o(
|
|
2353
|
+
$(O(o(b).tCurd("confirm")), 1)
|
|
2344
2354
|
]),
|
|
2345
2355
|
_: 1
|
|
2346
2356
|
}, 8, ["onClick", "loading"]),
|
|
2347
|
-
C(
|
|
2348
|
-
], 64)) : (
|
|
2349
|
-
o(r)(i.option.table?.add, n) ? (
|
|
2357
|
+
C(c.$slots, "table-op-edit-right", { row: n })
|
|
2358
|
+
], 64)) : (u(), y(S, { key: 1 }, [
|
|
2359
|
+
o(r)(i.option.table?.add, n) ? (u(), h(o(M), {
|
|
2350
2360
|
key: 0,
|
|
2351
2361
|
link: "",
|
|
2352
2362
|
type: "primary",
|
|
2353
|
-
onClick: (d) => o(l).update.open(o(
|
|
2363
|
+
onClick: (d) => o(l).update.open(o(f).Add, n)
|
|
2354
2364
|
}, {
|
|
2355
2365
|
default: m(() => [
|
|
2356
|
-
$(O(o(
|
|
2366
|
+
$(O(o(b).tCurd("add")), 1)
|
|
2357
2367
|
]),
|
|
2358
2368
|
_: 2
|
|
2359
2369
|
}, 1032, ["onClick"])) : k("", !0),
|
|
2360
|
-
o(r)(i.option.table?.view, n) ? (
|
|
2370
|
+
o(r)(i.option.table?.view, n) ? (u(), h(o(M), {
|
|
2361
2371
|
key: 1,
|
|
2362
2372
|
link: "",
|
|
2363
2373
|
type: "primary",
|
|
2364
|
-
onClick: (d) => o(l).update.open(o(
|
|
2374
|
+
onClick: (d) => o(l).update.open(o(f).View, n)
|
|
2365
2375
|
}, {
|
|
2366
2376
|
default: m(() => [
|
|
2367
|
-
$(O(o(
|
|
2377
|
+
$(O(o(b).tCurd("view")), 1)
|
|
2368
2378
|
]),
|
|
2369
2379
|
_: 2
|
|
2370
2380
|
}, 1032, ["onClick"])) : k("", !0),
|
|
2371
|
-
o(r)(i.option.table?.update, n) ? (
|
|
2381
|
+
o(r)(i.option.table?.update, n) ? (u(), h(o(M), {
|
|
2372
2382
|
key: 2,
|
|
2373
2383
|
link: "",
|
|
2374
2384
|
type: "warning",
|
|
2375
|
-
onClick: (d) => o(l).update.open(o(
|
|
2385
|
+
onClick: (d) => o(l).update.open(o(f).Update, n)
|
|
2376
2386
|
}, {
|
|
2377
2387
|
default: m(() => [
|
|
2378
|
-
$(O(o(
|
|
2388
|
+
$(O(o(b).tCurd("edit")), 1)
|
|
2379
2389
|
]),
|
|
2380
2390
|
_: 2
|
|
2381
2391
|
}, 1032, ["onClick"])) : k("", !0),
|
|
2382
|
-
o(r)(i.option.table?.delete, n) ? (
|
|
2392
|
+
o(r)(i.option.table?.delete, n) ? (u(), h(o(M), {
|
|
2383
2393
|
key: 3,
|
|
2384
2394
|
link: "",
|
|
2385
2395
|
type: "danger",
|
|
2386
2396
|
onClick: (d) => o(l).remove.open([n])
|
|
2387
2397
|
}, {
|
|
2388
2398
|
default: m(() => [
|
|
2389
|
-
$(O(o(
|
|
2399
|
+
$(O(o(b).tCurd("delete")), 1)
|
|
2390
2400
|
]),
|
|
2391
2401
|
_: 2
|
|
2392
2402
|
}, 1032, ["onClick"])) : k("", !0),
|
|
2393
|
-
C(
|
|
2403
|
+
C(c.$slots, "table-op-right", { row: n })
|
|
2394
2404
|
], 64))
|
|
2395
2405
|
]),
|
|
2396
2406
|
_: 2
|
|
@@ -2405,13 +2415,13 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2405
2415
|
])
|
|
2406
2416
|
], 2)
|
|
2407
2417
|
], 2),
|
|
2408
|
-
F("div",
|
|
2409
|
-
(i.option.page?.show === void 0 || i.option.page?.show) && !o(l).page.showTools ? (
|
|
2418
|
+
F("div", ut, [
|
|
2419
|
+
(i.option.page?.show === void 0 || i.option.page?.show) && !o(l).page.showTools ? (u(), h(o(ie), v({
|
|
2410
2420
|
key: 0,
|
|
2411
2421
|
"current-page": o(l).page.num,
|
|
2412
|
-
"onUpdate:currentPage":
|
|
2422
|
+
"onUpdate:currentPage": p[7] || (p[7] = (n) => o(l).page.num = n),
|
|
2413
2423
|
"page-size": o(l).page.size,
|
|
2414
|
-
"onUpdate:pageSize":
|
|
2424
|
+
"onUpdate:pageSize": p[8] || (p[8] = (n) => o(l).page.size = n),
|
|
2415
2425
|
background: "",
|
|
2416
2426
|
"page-sizes": o(l).page.sizeList,
|
|
2417
2427
|
"pager-count": o(l).page.pagerCount,
|
|
@@ -2423,36 +2433,36 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2423
2433
|
}, i.option.page?.pagination || {}, D(i.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : k("", !0)
|
|
2424
2434
|
])
|
|
2425
2435
|
], 2),
|
|
2426
|
-
C(
|
|
2436
|
+
C(c.$slots, "box-right")
|
|
2427
2437
|
], 2),
|
|
2428
2438
|
z(o(ee), v({
|
|
2429
2439
|
modelValue: o(l).update.show,
|
|
2430
|
-
"onUpdate:modelValue":
|
|
2440
|
+
"onUpdate:modelValue": p[9] || (p[9] = (n) => o(l).update.show = n),
|
|
2431
2441
|
title: o(l).update.title,
|
|
2432
2442
|
"before-close": o(l).update.close
|
|
2433
2443
|
}, i.option.dialog), {
|
|
2434
2444
|
footer: m(() => [
|
|
2435
|
-
F("span",
|
|
2445
|
+
F("span", ft, [
|
|
2436
2446
|
z(o(K), {
|
|
2437
2447
|
size: i.option.size?.form
|
|
2438
2448
|
}, {
|
|
2439
2449
|
default: m(() => [
|
|
2440
|
-
z(o(
|
|
2450
|
+
z(o(M), {
|
|
2441
2451
|
onClick: o(l).update.close
|
|
2442
2452
|
}, {
|
|
2443
2453
|
default: m(() => [
|
|
2444
|
-
$(O(o(
|
|
2454
|
+
$(O(o(b).tCurd("close")), 1)
|
|
2445
2455
|
]),
|
|
2446
2456
|
_: 1
|
|
2447
2457
|
}, 8, ["onClick"]),
|
|
2448
|
-
o(l).update.type !== o(
|
|
2458
|
+
o(l).update.type !== o(f).View ? (u(), h(o(M), {
|
|
2449
2459
|
key: 0,
|
|
2450
2460
|
type: "primary",
|
|
2451
2461
|
onClick: o(l).update.submit,
|
|
2452
2462
|
loading: o(l).update.loading
|
|
2453
2463
|
}, {
|
|
2454
2464
|
default: m(() => [
|
|
2455
|
-
$(O(o(
|
|
2465
|
+
$(O(o(b).tCurd("submit")), 1)
|
|
2456
2466
|
]),
|
|
2457
2467
|
_: 1
|
|
2458
2468
|
}, 8, ["onClick", "loading"])) : k("", !0)
|
|
@@ -2470,45 +2480,45 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2470
2480
|
size: i.option.size?.form
|
|
2471
2481
|
}, {
|
|
2472
2482
|
default: m(() => [
|
|
2473
|
-
o(l).update.showContent ? (
|
|
2483
|
+
o(l).update.showContent ? (u(!0), y(S, { key: 0 }, A(o(l).update.formColumn, (n) => (u(), y(S, null, [
|
|
2474
2484
|
o(r)(
|
|
2475
2485
|
(() => {
|
|
2476
2486
|
const d = [], V = (w) => {
|
|
2477
|
-
w?.item?.children ? V(w.item.children) : d.push(...w.map((
|
|
2487
|
+
w?.item?.children ? V(w.item.children) : d.push(...w.map((T) => T.item?.show?.form));
|
|
2478
2488
|
};
|
|
2479
2489
|
return V(n), d;
|
|
2480
2490
|
})(),
|
|
2481
2491
|
o(l).update.form,
|
|
2482
2492
|
o(l).update.type
|
|
2483
|
-
) ? (
|
|
2493
|
+
) ? (u(), y("div", {
|
|
2484
2494
|
key: 0,
|
|
2485
2495
|
class: j(["row curd-row", {
|
|
2486
2496
|
stripe: i.option.form?.stripe === void 0 ? !0 : i.option.form?.stripe
|
|
2487
2497
|
}])
|
|
2488
2498
|
}, [
|
|
2489
|
-
C(
|
|
2499
|
+
C(c.$slots, "form-start", {
|
|
2490
2500
|
row: o(l).update.form
|
|
2491
2501
|
}),
|
|
2492
|
-
(
|
|
2493
|
-
o(r)(d.item.show?.form, o(l).update.form, o(l).update.type) ? (
|
|
2502
|
+
(u(!0), y(S, null, A(n, (d) => (u(), y(S, null, [
|
|
2503
|
+
o(r)(d.item.show?.form, o(l).update.form, o(l).update.type) ? (u(), y("div", {
|
|
2494
2504
|
key: 0,
|
|
2495
2505
|
class: j([d.item.form.span > 0 ? `col-${o(l).getColumnSpan(d, n)}` : "col", `form-item-col-${d.item.key}`])
|
|
2496
2506
|
}, [
|
|
2497
|
-
(
|
|
2507
|
+
(u(!0), y(S, null, A(d.item.children ? d.children : [d], (V) => (u(), h(et, {
|
|
2498
2508
|
key: V.item.key,
|
|
2499
2509
|
conf: o(l),
|
|
2500
2510
|
item: V
|
|
2501
2511
|
}, oe({ _: 2 }, [
|
|
2502
|
-
|
|
2503
|
-
name:
|
|
2512
|
+
A(c.$slots, (w, T) => ({
|
|
2513
|
+
name: T,
|
|
2504
2514
|
fn: m((B) => [
|
|
2505
|
-
C(
|
|
2515
|
+
C(c.$slots, T, v({ ref_for: !0 }, B || {}))
|
|
2506
2516
|
])
|
|
2507
2517
|
}))
|
|
2508
2518
|
]), 1032, ["conf", "item"]))), 128))
|
|
2509
2519
|
], 2)) : k("", !0)
|
|
2510
2520
|
], 64))), 256)),
|
|
2511
|
-
C(
|
|
2521
|
+
C(c.$slots, "form-end", {
|
|
2512
2522
|
row: o(l).update.form
|
|
2513
2523
|
})
|
|
2514
2524
|
], 2)) : k("", !0)
|
|
@@ -2521,31 +2531,31 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2521
2531
|
}, 16, ["modelValue", "title", "before-close"]),
|
|
2522
2532
|
z(o(ee), {
|
|
2523
2533
|
modelValue: o(l).remove.show,
|
|
2524
|
-
"onUpdate:modelValue":
|
|
2534
|
+
"onUpdate:modelValue": p[10] || (p[10] = (n) => o(l).remove.show = n),
|
|
2525
2535
|
title: o(l).remove.title,
|
|
2526
2536
|
"close-on-click-modal": !1
|
|
2527
2537
|
}, {
|
|
2528
2538
|
footer: m(() => [
|
|
2529
|
-
F("span",
|
|
2539
|
+
F("span", pt, [
|
|
2530
2540
|
z(o(K), {
|
|
2531
2541
|
size: i.option.size?.form
|
|
2532
2542
|
}, {
|
|
2533
2543
|
default: m(() => [
|
|
2534
|
-
z(o(
|
|
2544
|
+
z(o(M), {
|
|
2535
2545
|
onClick: o(l).remove.close
|
|
2536
2546
|
}, {
|
|
2537
2547
|
default: m(() => [
|
|
2538
|
-
$(O(o(
|
|
2548
|
+
$(O(o(b).tCurd("close")), 1)
|
|
2539
2549
|
]),
|
|
2540
2550
|
_: 1
|
|
2541
2551
|
}, 8, ["onClick"]),
|
|
2542
|
-
z(o(
|
|
2552
|
+
z(o(M), {
|
|
2543
2553
|
type: "danger",
|
|
2544
2554
|
onClick: o(l).remove.submit,
|
|
2545
2555
|
loading: o(l).remove.loading
|
|
2546
2556
|
}, {
|
|
2547
2557
|
default: m(() => [
|
|
2548
|
-
$(O(o(
|
|
2558
|
+
$(O(o(b).tCurd("confirmDelete")), 1)
|
|
2549
2559
|
]),
|
|
2550
2560
|
_: 1
|
|
2551
2561
|
}, 8, ["onClick", "loading"])
|
|
@@ -2555,7 +2565,7 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2555
2565
|
])
|
|
2556
2566
|
]),
|
|
2557
2567
|
default: m(() => [
|
|
2558
|
-
F("div", null, O(o(
|
|
2568
|
+
F("div", null, O(o(b).tCurd("confirmDeleteMessage", o(l).remove.items.length)), 1)
|
|
2559
2569
|
]),
|
|
2560
2570
|
_: 1
|
|
2561
2571
|
}, 8, ["modelValue", "title"]),
|
|
@@ -2568,32 +2578,32 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2568
2578
|
};
|
|
2569
2579
|
}
|
|
2570
2580
|
});
|
|
2571
|
-
class
|
|
2581
|
+
class bt {
|
|
2572
2582
|
/**
|
|
2573
2583
|
* 通过远程 URL 下载文件,自动创建临时 `<a>` 标签触发浏览器下载
|
|
2574
2584
|
*
|
|
2575
2585
|
* @param href - 文件的远程地址
|
|
2576
2586
|
* @param name - 下载后的文件名,默认 `'download.png'`
|
|
2577
2587
|
*/
|
|
2578
|
-
static async download(a,
|
|
2588
|
+
static async download(a, f = "download.png") {
|
|
2579
2589
|
const t = document.createElement("a");
|
|
2580
|
-
t.style.display = "none", t.href = a, t.setAttribute("download",
|
|
2590
|
+
t.style.display = "none", t.href = a, t.setAttribute("download", f), typeof t.download > "u" && t.setAttribute("target", "_blank"), document.body.appendChild(t), t.click(), document.body.removeChild(t), window.URL.revokeObjectURL(a);
|
|
2581
2591
|
}
|
|
2582
2592
|
/**
|
|
2583
2593
|
* 将json对象或者json数组导出为json文件保存
|
|
2584
2594
|
* @param data
|
|
2585
2595
|
* @param name
|
|
2586
2596
|
*/
|
|
2587
|
-
static exportJSONFile = (a,
|
|
2597
|
+
static exportJSONFile = (a, f) => {
|
|
2588
2598
|
const t = new Blob([JSON.stringify(a)], { type: "application/json" }), r = URL.createObjectURL(t), l = document.createElement("a");
|
|
2589
|
-
l.href = r, l.download = `${
|
|
2599
|
+
l.href = r, l.download = `${f || "config"}.json`, l.click();
|
|
2590
2600
|
};
|
|
2591
2601
|
/**
|
|
2592
2602
|
* 导入文件内容,默认为json
|
|
2593
2603
|
* @param param
|
|
2594
2604
|
* @returns
|
|
2595
2605
|
*/
|
|
2596
|
-
static importFile = async (a) => new Promise((
|
|
2606
|
+
static importFile = async (a) => new Promise((f, t) => {
|
|
2597
2607
|
const r = document.createElement("input");
|
|
2598
2608
|
r.type = "file";
|
|
2599
2609
|
const l = a?.accept || ".json";
|
|
@@ -2603,36 +2613,36 @@ class yt {
|
|
|
2603
2613
|
U.fail("未选择文件"), t("未选择文件");
|
|
2604
2614
|
return;
|
|
2605
2615
|
}
|
|
2606
|
-
const
|
|
2607
|
-
|
|
2608
|
-
const g = l == ".json" ? JSON.parse(
|
|
2609
|
-
|
|
2610
|
-
},
|
|
2616
|
+
const c = new FileReader();
|
|
2617
|
+
c.onload = async (p) => {
|
|
2618
|
+
const g = l == ".json" ? JSON.parse(p.target.result) : p.target.result;
|
|
2619
|
+
f(g);
|
|
2620
|
+
}, c.onerror = () => {
|
|
2611
2621
|
U.fail("文件读取失败"), t("文件读取失败");
|
|
2612
|
-
},
|
|
2622
|
+
}, c.readAsText(s), document.body.removeChild(r);
|
|
2613
2623
|
}, document.body.appendChild(r), r.click();
|
|
2614
2624
|
});
|
|
2615
2625
|
}
|
|
2616
|
-
const
|
|
2617
|
-
if (i.component("TCurd",
|
|
2626
|
+
const mt = (i, a) => {
|
|
2627
|
+
if (i.component("TCurd", ct), i.component("TFormList", ne), i.component("TColumn", Te), a?.customComponent) {
|
|
2618
2628
|
L.customComponent = a.customComponent;
|
|
2619
|
-
for (const
|
|
2620
|
-
i.component(
|
|
2629
|
+
for (const f in a.customComponent)
|
|
2630
|
+
i.component(f, a.customComponent[f]);
|
|
2621
2631
|
}
|
|
2622
|
-
},
|
|
2623
|
-
install:
|
|
2632
|
+
}, wt = {
|
|
2633
|
+
install: mt
|
|
2624
2634
|
};
|
|
2625
2635
|
export {
|
|
2626
2636
|
P as ArrUtil,
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2637
|
+
Me as ExcelUtil,
|
|
2638
|
+
Te as TColumn,
|
|
2639
|
+
ct as TCurd,
|
|
2640
|
+
bt as TFile,
|
|
2631
2641
|
L as TForm,
|
|
2632
2642
|
E as TFormConfig,
|
|
2633
|
-
|
|
2643
|
+
b as TFormI18n,
|
|
2634
2644
|
ne as TFormList,
|
|
2635
2645
|
U as TSys,
|
|
2636
|
-
|
|
2637
|
-
|
|
2646
|
+
wt as default,
|
|
2647
|
+
mt as install
|
|
2638
2648
|
};
|