cc1-form 1.2.2 → 1.2.3
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 +399 -392
- 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 +40 -0
- package/dist/components/TCurd/index.vue.d.ts +88 -0
- package/dist/components/TCurd/indexType.d.ts +4 -0
- 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,39 @@ 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
|
+
...c,
|
|
1560
|
+
[s]: n
|
|
1561
|
+
});
|
|
1562
|
+
} catch {
|
|
1563
|
+
return !1;
|
|
1564
|
+
} finally {
|
|
1565
|
+
p.loadingMap[g].loading = !1;
|
|
1566
|
+
}
|
|
1567
|
+
return U.success(b.tCurd("operationSuccess")), p.tableConfig?.loadList && (t.table.loading = !0, t.table.getList(), t.table.loading = !1), !0;
|
|
1563
1568
|
} catch (g) {
|
|
1564
1569
|
return console.error(g), !1;
|
|
1565
1570
|
} finally {
|
|
@@ -1574,8 +1579,8 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1574
1579
|
},
|
|
1575
1580
|
getColumnSpan: (r, l) => {
|
|
1576
1581
|
if (r.item.form?.spanCol) {
|
|
1577
|
-
const e = E.config.form.defaultSpan,
|
|
1578
|
-
return (r.item?.form.span || e) +
|
|
1582
|
+
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);
|
|
1583
|
+
return (r.item?.form.span || e) + c;
|
|
1579
1584
|
}
|
|
1580
1585
|
return r.item.form.span;
|
|
1581
1586
|
},
|
|
@@ -1587,22 +1592,22 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1587
1592
|
listSource: []
|
|
1588
1593
|
};
|
|
1589
1594
|
const l = [], e = i.option.form?.maxSpan || 12, s = i.option.form?.defaultSpan || e / 2;
|
|
1590
|
-
let
|
|
1591
|
-
const
|
|
1595
|
+
let c = [];
|
|
1596
|
+
const p = (d) => {
|
|
1592
1597
|
if (d.children) {
|
|
1593
1598
|
t.table.column.show.list.push(d.key), d.children.forEach((V) => {
|
|
1594
|
-
|
|
1599
|
+
p(V);
|
|
1595
1600
|
});
|
|
1596
1601
|
return;
|
|
1597
1602
|
}
|
|
1598
1603
|
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
1604
|
d.form = d.form || { span: s }, d.form.span = d.form.span ?? s;
|
|
1600
|
-
let V = d.form.span, w =
|
|
1601
|
-
const
|
|
1602
|
-
if (
|
|
1605
|
+
let V = d.form.span, w = c.reduce((B, I) => B + I.span, V);
|
|
1606
|
+
const T = c.length;
|
|
1607
|
+
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
1608
|
const B = {
|
|
1604
|
-
input:
|
|
1605
|
-
select:
|
|
1609
|
+
input: b.tCurd("placeholderInput"),
|
|
1610
|
+
select: b.tCurd("placeholderSelect")
|
|
1606
1611
|
}, I = (B[d.type] || B.input) + d.label;
|
|
1607
1612
|
t.update.rules[d.key] = typeof d.rules == "boolean" ? [
|
|
1608
1613
|
{
|
|
@@ -1617,10 +1622,10 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1617
1622
|
d.isForm = V, Array.isArray(d.children) && d.children.forEach((w) => g(w, V));
|
|
1618
1623
|
};
|
|
1619
1624
|
r.column.forEach((d) => {
|
|
1620
|
-
d.isForm = !0, g(d, !0),
|
|
1625
|
+
d.isForm = !0, g(d, !0), p(d);
|
|
1621
1626
|
}), 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),
|
|
1627
|
+
g(d, !1), p(d);
|
|
1628
|
+
}), 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
1629
|
const n = i.option.search?.formDefault;
|
|
1625
1630
|
n && Object.keys(n).forEach((d) => {
|
|
1626
1631
|
t.search.formDefault[d] = n[d];
|
|
@@ -1631,29 +1636,29 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1631
1636
|
});
|
|
1632
1637
|
return t.init(), ue(() => {
|
|
1633
1638
|
i.option.init !== !1 && t.table.getList();
|
|
1634
|
-
}), { conf: t, switchConfirmRef: a, ruleFormRef:
|
|
1639
|
+
}), { conf: t, switchConfirmRef: a, ruleFormRef: f };
|
|
1635
1640
|
}, Le = { class: "dialog-footer" }, Be = /* @__PURE__ */ J({
|
|
1636
1641
|
__name: "switchConfirm",
|
|
1637
1642
|
props: {
|
|
1638
1643
|
size: {}
|
|
1639
1644
|
},
|
|
1640
1645
|
setup(i, { expose: a }) {
|
|
1641
|
-
const
|
|
1646
|
+
const f = H(!1), t = H("确认修改"), r = H("确认要修改状态吗?");
|
|
1642
1647
|
let l = null, e = null;
|
|
1643
|
-
const s = (g) => (g?.title && (t.value = g.title), g?.content && (r.value = g.content),
|
|
1648
|
+
const s = (g) => (g?.title && (t.value = g.title), g?.content && (r.value = g.content), f.value = !0, new Promise((n, d) => {
|
|
1644
1649
|
l = n, e = d;
|
|
1645
|
-
})),
|
|
1646
|
-
|
|
1647
|
-
},
|
|
1648
|
-
|
|
1650
|
+
})), c = () => {
|
|
1651
|
+
f.value = !1, l?.(!0), l = null, e = null;
|
|
1652
|
+
}, p = () => {
|
|
1653
|
+
f.value = !1, e?.(new Error("用户取消操作")), l = null, e = null;
|
|
1649
1654
|
};
|
|
1650
1655
|
return a({
|
|
1651
1656
|
open: s
|
|
1652
1657
|
}), (g, n) => {
|
|
1653
1658
|
const d = Y("el-form");
|
|
1654
|
-
return
|
|
1655
|
-
modelValue:
|
|
1656
|
-
"onUpdate:modelValue": n[0] || (n[0] = (V) =>
|
|
1659
|
+
return u(), h(o(ee), {
|
|
1660
|
+
modelValue: f.value,
|
|
1661
|
+
"onUpdate:modelValue": n[0] || (n[0] = (V) => f.value = V),
|
|
1657
1662
|
title: t.value,
|
|
1658
1663
|
"close-on-click-modal": !1,
|
|
1659
1664
|
width: "400px"
|
|
@@ -1662,15 +1667,15 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1662
1667
|
z(d, { size: g.size }, {
|
|
1663
1668
|
default: m(() => [
|
|
1664
1669
|
F("span", Le, [
|
|
1665
|
-
z(o(
|
|
1670
|
+
z(o(M), { onClick: p }, {
|
|
1666
1671
|
default: m(() => n[1] || (n[1] = [
|
|
1667
1672
|
$("取消")
|
|
1668
1673
|
])),
|
|
1669
1674
|
_: 1
|
|
1670
1675
|
}),
|
|
1671
|
-
z(o(
|
|
1676
|
+
z(o(M), {
|
|
1672
1677
|
type: "primary",
|
|
1673
|
-
onClick:
|
|
1678
|
+
onClick: c
|
|
1674
1679
|
}, {
|
|
1675
1680
|
default: m(() => n[2] || (n[2] = [
|
|
1676
1681
|
$("确认")
|
|
@@ -1690,16 +1695,16 @@ const R = U.EDialog, Te = (i) => {
|
|
|
1690
1695
|
};
|
|
1691
1696
|
}
|
|
1692
1697
|
}), pe = (i, a) => {
|
|
1693
|
-
const
|
|
1698
|
+
const f = i.__vccOpts || i;
|
|
1694
1699
|
for (const [t, r] of a)
|
|
1695
|
-
|
|
1696
|
-
return
|
|
1700
|
+
f[t] = r;
|
|
1701
|
+
return f;
|
|
1697
1702
|
}, je = {}, Ie = {
|
|
1698
1703
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1699
1704
|
viewBox: "0 0 1024 1024"
|
|
1700
1705
|
};
|
|
1701
1706
|
function Re(i, a) {
|
|
1702
|
-
return
|
|
1707
|
+
return u(), y("svg", Ie, a[0] || (a[0] = [
|
|
1703
1708
|
F("path", {
|
|
1704
1709
|
fill: "currentColor",
|
|
1705
1710
|
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 +1717,14 @@ const Pe = /* @__PURE__ */ pe(je, [["render", Re]]), Ke = {}, Ne = {
|
|
|
1712
1717
|
viewBox: "0 0 1024 1024"
|
|
1713
1718
|
};
|
|
1714
1719
|
function He(i, a) {
|
|
1715
|
-
return
|
|
1720
|
+
return u(), y("svg", Ne, a[0] || (a[0] = [
|
|
1716
1721
|
F("path", {
|
|
1717
1722
|
fill: "currentColor",
|
|
1718
1723
|
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
1724
|
}, null, -1)
|
|
1720
1725
|
]));
|
|
1721
1726
|
}
|
|
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"],
|
|
1727
|
+
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
1728
|
__name: "tableColumn",
|
|
1724
1729
|
props: {
|
|
1725
1730
|
conf: {},
|
|
@@ -1727,13 +1732,13 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
1727
1732
|
option: {}
|
|
1728
1733
|
},
|
|
1729
1734
|
setup(i) {
|
|
1730
|
-
const a = U.isFun,
|
|
1735
|
+
const a = U.isFun, f = be().type;
|
|
1731
1736
|
return (t, r) => {
|
|
1732
1737
|
const l = Y("el-tooltip");
|
|
1733
|
-
return
|
|
1738
|
+
return u(!0), y(S, null, A(t.columnList, (e) => (u(), y(S, {
|
|
1734
1739
|
key: e.key
|
|
1735
1740
|
}, [
|
|
1736
|
-
t.conf.table.column.show.list.includes(e.key) ? (
|
|
1741
|
+
t.conf.table.column.show.list.includes(e.key) ? (u(), h(o(te), v({
|
|
1737
1742
|
key: 0,
|
|
1738
1743
|
prop: e.key,
|
|
1739
1744
|
label: e.label,
|
|
@@ -1742,7 +1747,7 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
1742
1747
|
header: m(() => [
|
|
1743
1748
|
C(t.$slots, "table-header-" + e.key, { item: e }, () => [
|
|
1744
1749
|
F("div", We, [
|
|
1745
|
-
e.table?.tooltip ? (
|
|
1750
|
+
e.table?.tooltip ? (u(), h(l, {
|
|
1746
1751
|
key: 0,
|
|
1747
1752
|
effect: "dark",
|
|
1748
1753
|
content: e.table?.tooltip,
|
|
@@ -1760,47 +1765,47 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
1760
1765
|
])
|
|
1761
1766
|
]),
|
|
1762
1767
|
default: m(({ row: s }) => [
|
|
1763
|
-
e.children ? (
|
|
1768
|
+
e.children ? (u(), y(S, { key: 0 }, [
|
|
1764
1769
|
r[0] || (r[0] = $(" ")),
|
|
1765
|
-
(
|
|
1770
|
+
(u(), h(q(o(f)), {
|
|
1766
1771
|
conf: t.conf,
|
|
1767
1772
|
columnList: e.children,
|
|
1768
1773
|
option: t.option
|
|
1769
1774
|
}, oe({ _: 2 }, [
|
|
1770
|
-
|
|
1771
|
-
name:
|
|
1775
|
+
A(t.$slots, (c, p) => ({
|
|
1776
|
+
name: p,
|
|
1772
1777
|
fn: m((g) => [
|
|
1773
|
-
C(t.$slots,
|
|
1778
|
+
C(t.$slots, p, v({ ref_for: !0 }, g || {}))
|
|
1774
1779
|
])
|
|
1775
1780
|
}))
|
|
1776
1781
|
]), 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" ? (
|
|
1782
|
+
], 64)) : (u(), y(S, { key: 1 }, [
|
|
1783
|
+
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 }, [
|
|
1784
|
+
e.type === "input" ? (u(), h(o(Z), v({
|
|
1780
1785
|
key: 0,
|
|
1781
1786
|
modelValue: t.conf.update.form[e.key],
|
|
1782
|
-
"onUpdate:modelValue": (
|
|
1787
|
+
"onUpdate:modelValue": (c) => t.conf.update.form[e.key] = c,
|
|
1783
1788
|
disabled: t.conf.update.getDisabled(e),
|
|
1784
1789
|
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" ? (
|
|
1790
|
+
}, 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
1791
|
key: 1,
|
|
1787
1792
|
modelValue: t.conf.update.form[e.key],
|
|
1788
|
-
"onUpdate:modelValue": (
|
|
1793
|
+
"onUpdate:modelValue": (c) => t.conf.update.form[e.key] = c,
|
|
1789
1794
|
disabled: t.conf.update.getDisabled(e),
|
|
1790
1795
|
ref_for: !0
|
|
1791
1796
|
}, t.conf.update.getBind(e), D(t.conf.update.getOn(e)), { style: { width: "100%" } }), {
|
|
1792
1797
|
default: m(() => [
|
|
1793
|
-
(
|
|
1794
|
-
key:
|
|
1795
|
-
label:
|
|
1796
|
-
value:
|
|
1798
|
+
(u(!0), y(S, null, A(e.options?.search?.select?.data || e.options?.select?.data, (c) => (u(), h(o(N), {
|
|
1799
|
+
key: c.value,
|
|
1800
|
+
label: c.label,
|
|
1801
|
+
value: c.value
|
|
1797
1802
|
}, null, 8, ["label", "value"]))), 128))
|
|
1798
1803
|
]),
|
|
1799
1804
|
_: 2
|
|
1800
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "switch" ? (
|
|
1805
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "switch" ? (u(), h(o(X), v({
|
|
1801
1806
|
key: 2,
|
|
1802
1807
|
modelValue: t.conf.update.form[e.key],
|
|
1803
|
-
"onUpdate:modelValue": (
|
|
1808
|
+
"onUpdate:modelValue": (c) => t.conf.update.form[e.key] = c,
|
|
1804
1809
|
ref_for: !0
|
|
1805
1810
|
}, t.conf.update.getBind(e), D(t.conf.update.getOn(e)), {
|
|
1806
1811
|
disabled: t.conf.update.getDisabled(e)
|
|
@@ -1810,27 +1815,29 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
1810
1815
|
row: s,
|
|
1811
1816
|
item: e
|
|
1812
1817
|
}, () => [
|
|
1813
|
-
o(L).customComponent[e.type ?? ""]?.table ? (
|
|
1818
|
+
o(L).customComponent[e.type ?? ""]?.table ? (u(), h(q(o(L).customComponent[e.type ?? ""]?.table), v({
|
|
1814
1819
|
key: 0,
|
|
1815
1820
|
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),
|
|
1821
|
+
"onUpdate:modelValue": (c) => s[e.key] = c,
|
|
1824
1822
|
ref_for: !0
|
|
1825
|
-
}, e.options?.
|
|
1823
|
+
}, e.options?.[e.type ?? ""], D(e.options?.[e.type ?? ""]?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue"])) : e.type === "switch" ? (u(), y(S, { key: 1 }, [
|
|
1824
|
+
e.options?.switch?.tableConfig?.change ? (u(), h(o(X), v({
|
|
1825
|
+
key: 0,
|
|
1826
|
+
modelValue: s[e.key],
|
|
1827
|
+
"onUpdate:modelValue": (c) => s[e.key] = c,
|
|
1828
|
+
loading: e.options?.switch?.loadingMap?.[s[t.option.table?.rowKey]]?.loading,
|
|
1829
|
+
"before-change": () => e.options?.switch?.tableBeforeChange?.(e.key, s),
|
|
1830
|
+
ref_for: !0
|
|
1831
|
+
}, 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))
|
|
1832
|
+
], 64)) : (u(), y("span", {
|
|
1826
1833
|
key: 2,
|
|
1827
1834
|
style: fe({
|
|
1828
1835
|
"--table-text-click-color": e.table?.click?.color
|
|
1829
1836
|
}),
|
|
1830
1837
|
class: j({ "table-text-click": e.table?.click?.callback }),
|
|
1831
|
-
onClick: (
|
|
1838
|
+
onClick: (c) => e.table?.click?.callback?.(s),
|
|
1832
1839
|
innerHTML: e.table?.format ? e.table?.format(s) : s[e.key]
|
|
1833
|
-
}, null, 14,
|
|
1840
|
+
}, null, 14, Ge))
|
|
1834
1841
|
])
|
|
1835
1842
|
], 64))
|
|
1836
1843
|
]),
|
|
@@ -1839,17 +1846,17 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
1839
1846
|
], 64))), 128);
|
|
1840
1847
|
};
|
|
1841
1848
|
}
|
|
1842
|
-
}),
|
|
1849
|
+
}), Ye = {
|
|
1843
1850
|
class: "row form-item-content",
|
|
1844
1851
|
style: { width: "100%" }
|
|
1845
|
-
},
|
|
1852
|
+
}, Ze = { class: "col column form-item-content-item" }, xe = { class: "col" }, _e = ["innerHTML"], et = /* @__PURE__ */ J({
|
|
1846
1853
|
__name: "formColumn",
|
|
1847
1854
|
props: {
|
|
1848
1855
|
conf: {},
|
|
1849
1856
|
item: {}
|
|
1850
1857
|
},
|
|
1851
1858
|
setup(i) {
|
|
1852
|
-
return (a,
|
|
1859
|
+
return (a, f) => (u(), h(o(G), {
|
|
1853
1860
|
class: j({
|
|
1854
1861
|
"hide-label": typeof a.item.item.text?.form?.label == "boolean" ? !a.item.item.text?.form?.label : !1
|
|
1855
1862
|
}),
|
|
@@ -1858,85 +1865,85 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
1858
1865
|
"label-width": a.item.item.form?.labelWidth || a.conf.option.form?.labelWidth
|
|
1859
1866
|
}, {
|
|
1860
1867
|
default: m(() => [
|
|
1861
|
-
F("div",
|
|
1868
|
+
F("div", Ye, [
|
|
1862
1869
|
C(a.$slots, "form-" + a.item.item.key + "-start", {
|
|
1863
1870
|
row: a.conf.update.form,
|
|
1864
1871
|
item: a.item.item
|
|
1865
1872
|
}),
|
|
1866
|
-
F("div",
|
|
1867
|
-
F("div",
|
|
1873
|
+
F("div", Ze, [
|
|
1874
|
+
F("div", xe, [
|
|
1868
1875
|
C(a.$slots, "form-" + a.item.item.key, {
|
|
1869
1876
|
row: a.conf.update.form,
|
|
1870
1877
|
item: a.item.item
|
|
1871
1878
|
}, () => [
|
|
1872
|
-
a.item.item.type === "input" ? (
|
|
1879
|
+
a.item.item.type === "input" ? (u(), h(o(Z), v({
|
|
1873
1880
|
key: 0,
|
|
1874
1881
|
modelValue: a.conf.update.form[a.item.item.key],
|
|
1875
|
-
"onUpdate:modelValue":
|
|
1882
|
+
"onUpdate:modelValue": f[0] || (f[0] = (t) => a.conf.update.form[a.item.item.key] = t)
|
|
1876
1883
|
}, a.conf.update.getBind(a.item.item), D(a.conf.update.getOn(a.item.item)), {
|
|
1877
1884
|
disabled: a.conf.update.getDisabled(a.item.item)
|
|
1878
|
-
}), null, 16, ["modelValue", "disabled"])) : a.item.item.type === "switch" ? (
|
|
1885
|
+
}), null, 16, ["modelValue", "disabled"])) : a.item.item.type === "switch" ? (u(), h(o(X), v({
|
|
1879
1886
|
key: 1,
|
|
1880
1887
|
modelValue: a.conf.update.form[a.item.item.key],
|
|
1881
|
-
"onUpdate:modelValue":
|
|
1888
|
+
"onUpdate:modelValue": f[1] || (f[1] = (t) => a.conf.update.form[a.item.item.key] = t)
|
|
1882
1889
|
}, a.conf.update.getBind(a.item.item), D(a.conf.update.getOn(a.item.item)), {
|
|
1883
1890
|
disabled: a.conf.update.getDisabled(a.item.item)
|
|
1884
|
-
}), null, 16, ["modelValue", "disabled"])) : a.item.item.type === "select" ? (
|
|
1891
|
+
}), null, 16, ["modelValue", "disabled"])) : a.item.item.type === "select" ? (u(), h(o(W), v({
|
|
1885
1892
|
key: 2,
|
|
1886
1893
|
modelValue: a.conf.update.form[a.item.item.key],
|
|
1887
|
-
"onUpdate:modelValue":
|
|
1894
|
+
"onUpdate:modelValue": f[2] || (f[2] = (t) => a.conf.update.form[a.item.item.key] = t)
|
|
1888
1895
|
}, a.conf.update.getBind(a.item.item), D(a.conf.update.getOn(a.item.item)), {
|
|
1889
1896
|
disabled: a.conf.update.getDisabled(a.item.item),
|
|
1890
1897
|
style: { width: "100%" }
|
|
1891
1898
|
}), {
|
|
1892
1899
|
default: m(() => [
|
|
1893
|
-
(
|
|
1900
|
+
(u(!0), y(S, null, A(a.conf.update.getBind(a.item.item).data, (t) => (u(), h(o(N), {
|
|
1894
1901
|
key: t.value,
|
|
1895
1902
|
label: t.label,
|
|
1896
1903
|
value: t.value
|
|
1897
1904
|
}, null, 8, ["label", "value"]))), 128))
|
|
1898
1905
|
]),
|
|
1899
1906
|
_: 1
|
|
1900
|
-
}, 16, ["modelValue", "disabled"])) : a.item.item.type === "radio" ? (
|
|
1907
|
+
}, 16, ["modelValue", "disabled"])) : a.item.item.type === "radio" ? (u(), h(o(re), v({
|
|
1901
1908
|
key: 3,
|
|
1902
1909
|
modelValue: a.conf.update.form[a.item.item.key],
|
|
1903
|
-
"onUpdate:modelValue":
|
|
1910
|
+
"onUpdate:modelValue": f[3] || (f[3] = (t) => a.conf.update.form[a.item.item.key] = t)
|
|
1904
1911
|
}, a.conf.update.getBind(a.item.item), D(a.conf.update.getOn(a.item.item)), {
|
|
1905
1912
|
disabled: a.conf.update.getDisabled(a.item.item),
|
|
1906
1913
|
style: { width: "100%" }
|
|
1907
1914
|
}), {
|
|
1908
1915
|
default: m(() => [
|
|
1909
|
-
(
|
|
1916
|
+
(u(!0), y(S, null, A(a.conf.update.getBind(a.item.item).data, (t) => (u(), h(o(se), {
|
|
1910
1917
|
key: t.value,
|
|
1911
1918
|
label: t.label,
|
|
1912
1919
|
value: t.value
|
|
1913
1920
|
}, null, 8, ["label", "value"]))), 128))
|
|
1914
1921
|
]),
|
|
1915
1922
|
_: 1
|
|
1916
|
-
}, 16, ["modelValue", "disabled"])) : a.item.item.type === "list" ? (
|
|
1923
|
+
}, 16, ["modelValue", "disabled"])) : a.item.item.type === "list" ? (u(), h(ne, v({
|
|
1917
1924
|
key: 4,
|
|
1918
1925
|
row: a.conf.update.form,
|
|
1919
1926
|
field: a.item.item.key
|
|
1920
1927
|
}, a.conf.update.getBind(a.item.item), D(a.conf.update.getOn(a.item.item)), {
|
|
1921
1928
|
disabled: a.conf.update.getDisabled(a.item.item),
|
|
1922
1929
|
style: { width: "100%" }
|
|
1923
|
-
}), null, 16, ["row", "field", "disabled"])) : a.item.item.type === "treeSelect" ? (
|
|
1930
|
+
}), null, 16, ["row", "field", "disabled"])) : a.item.item.type === "treeSelect" ? (u(), h(o(de), v({
|
|
1924
1931
|
key: 5,
|
|
1925
1932
|
modelValue: a.conf.update.form[a.item.item.key],
|
|
1926
|
-
"onUpdate:modelValue":
|
|
1933
|
+
"onUpdate:modelValue": f[4] || (f[4] = (t) => a.conf.update.form[a.item.item.key] = t)
|
|
1927
1934
|
}, a.conf.update.getBind(a.item.item), D(a.conf.update.getOn(a.item.item)), {
|
|
1928
1935
|
disabled: a.conf.update.getDisabled(a.item.item),
|
|
1929
1936
|
style: { width: "100%" }
|
|
1930
|
-
}), null, 16, ["modelValue", "disabled"])) : a.item.item.type === "datetime" ? (
|
|
1937
|
+
}), null, 16, ["modelValue", "disabled"])) : a.item.item.type === "datetime" ? (u(), h(o(ae), v({
|
|
1931
1938
|
key: 6,
|
|
1932
1939
|
modelValue: a.conf.update.form[a.item.item.key],
|
|
1933
|
-
"onUpdate:modelValue":
|
|
1940
|
+
"onUpdate:modelValue": f[5] || (f[5] = (t) => a.conf.update.form[a.item.item.key] = t)
|
|
1934
1941
|
}, a.conf.update.getBind(a.item.item), D(a.conf.update.getOn(a.item.item)), {
|
|
1935
1942
|
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) ? (
|
|
1943
|
+
}), 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
1944
|
key: 7,
|
|
1938
1945
|
modelValue: a.conf.update.form[a.item.item.key],
|
|
1939
|
-
"onUpdate:modelValue":
|
|
1946
|
+
"onUpdate:modelValue": f[6] || (f[6] = (t) => a.conf.update.form[a.item.item.key] = t)
|
|
1940
1947
|
}, a.conf.update.getBind(a.item.item), D(a.conf.update.getOn(a.item.item)), {
|
|
1941
1948
|
disabled: a.conf.update.getDisabled(a.item.item)
|
|
1942
1949
|
}), null, 16, ["modelValue", "disabled"])) : k("", !0)
|
|
@@ -1950,11 +1957,11 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
1950
1957
|
row: a.conf.update.form,
|
|
1951
1958
|
item: a.item.item
|
|
1952
1959
|
}, () => [
|
|
1953
|
-
a.item.item.form?.tipText ? (
|
|
1960
|
+
a.item.item.form?.tipText ? (u(), y("div", {
|
|
1954
1961
|
key: 0,
|
|
1955
1962
|
class: "form-tip-text",
|
|
1956
1963
|
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,
|
|
1964
|
+
}, null, 8, _e)) : k("", !0)
|
|
1958
1965
|
])
|
|
1959
1966
|
]),
|
|
1960
1967
|
C(a.$slots, "form-" + a.item.item.key + "-end", {
|
|
@@ -1966,19 +1973,19 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
1966
1973
|
_: 3
|
|
1967
1974
|
}, 8, ["class", "label", "prop", "label-width"]));
|
|
1968
1975
|
}
|
|
1969
|
-
}),
|
|
1976
|
+
}), tt = {
|
|
1970
1977
|
key: 0,
|
|
1971
1978
|
class: "relative curd-search fit-width"
|
|
1972
|
-
},
|
|
1979
|
+
}, ot = { class: "mb-10 flex justify-between items-center fit-width" }, at = {
|
|
1973
1980
|
class: "flex items-center",
|
|
1974
1981
|
style: { gap: "10px" }
|
|
1975
|
-
},
|
|
1982
|
+
}, lt = { key: 0 }, nt = { key: 1 }, it = { key: 2 }, rt = { class: "export-btn" }, st = {
|
|
1976
1983
|
key: 1,
|
|
1977
1984
|
class: "export-btn"
|
|
1978
|
-
},
|
|
1985
|
+
}, dt = {
|
|
1979
1986
|
class: "flex items-center table-tools-right",
|
|
1980
1987
|
style: { gap: "10px" }
|
|
1981
|
-
},
|
|
1988
|
+
}, ut = { class: "row justify-end mt-10 mb-10 table-bottom-pagination" }, ft = { class: "dialog-footer" }, pt = { class: "dialog-footer" }, ct = /* @__PURE__ */ J({
|
|
1982
1989
|
__name: "index",
|
|
1983
1990
|
props: {
|
|
1984
1991
|
/**
|
|
@@ -1989,36 +1996,36 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
1989
1996
|
}
|
|
1990
1997
|
},
|
|
1991
1998
|
setup(i, { expose: a }) {
|
|
1992
|
-
const
|
|
1999
|
+
const f = U.EDialog, t = i, r = U.isFun, { conf: l, switchConfirmRef: e, ruleFormRef: s } = Ae(t);
|
|
1993
2000
|
return a({
|
|
1994
2001
|
conf: l
|
|
1995
|
-
}), (
|
|
2002
|
+
}), (c, p) => {
|
|
1996
2003
|
const g = we("loading");
|
|
1997
|
-
return
|
|
2004
|
+
return u(), y("div", {
|
|
1998
2005
|
class: j(["relative cc1-form-box", [i.option.table?.fitHeight ? "col" : "no-min-height"]])
|
|
1999
2006
|
}, [
|
|
2000
2007
|
F("div", {
|
|
2001
2008
|
class: j(["row", [i.option.table?.fitHeight ? "absolute fit" : ""]]),
|
|
2002
2009
|
style: { overflow: "hidden" }
|
|
2003
2010
|
}, [
|
|
2004
|
-
C(
|
|
2011
|
+
C(c.$slots, "box-left"),
|
|
2005
2012
|
F("div", {
|
|
2006
2013
|
class: j(["column fit-width no-wrap", [i.option.table?.fitHeight ? "col" : ""]])
|
|
2007
2014
|
}, [
|
|
2008
|
-
i.option.search?.show !== !1 ? (
|
|
2015
|
+
i.option.search?.show !== !1 ? (u(), y("div", tt, [
|
|
2009
2016
|
z(o(K), {
|
|
2010
2017
|
model: o(l).search.form,
|
|
2011
2018
|
inline: "",
|
|
2012
2019
|
size: i.option.size?.search
|
|
2013
2020
|
}, {
|
|
2014
2021
|
default: m(() => [
|
|
2015
|
-
C(
|
|
2022
|
+
C(c.$slots, "search-start", {
|
|
2016
2023
|
row: o(l).search.form
|
|
2017
2024
|
}),
|
|
2018
|
-
(
|
|
2025
|
+
(u(!0), y(S, null, A(o(l).search.column.list, (n) => (u(), y(S, {
|
|
2019
2026
|
key: n.key
|
|
2020
2027
|
}, [
|
|
2021
|
-
(typeof n.show?.search == "function" ? n.show?.search(o(l).search.form) : n.show?.search) ? (
|
|
2028
|
+
(typeof n.show?.search == "function" ? n.show?.search(o(l).search.form) : n.show?.search) ? (u(), h(o(G), {
|
|
2022
2029
|
key: 0,
|
|
2023
2030
|
label: typeof n.text?.search?.label == "string" ? n.text?.search?.label : n.label,
|
|
2024
2031
|
class: j({
|
|
@@ -2026,10 +2033,10 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2026
2033
|
})
|
|
2027
2034
|
}, {
|
|
2028
2035
|
default: m(() => [
|
|
2029
|
-
C(
|
|
2036
|
+
C(c.$slots, "search-" + n.key, {
|
|
2030
2037
|
row: o(l).search.form
|
|
2031
2038
|
}, () => [
|
|
2032
|
-
n.type === "input" ? (
|
|
2039
|
+
n.type === "input" ? (u(), h(o(Z), v({
|
|
2033
2040
|
key: 0,
|
|
2034
2041
|
modelValue: o(l).search.form[n.key],
|
|
2035
2042
|
"onUpdate:modelValue": (d) => o(l).search.form[n.key] = d,
|
|
@@ -2037,52 +2044,52 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2037
2044
|
clearable: "",
|
|
2038
2045
|
disabled: n.disabled?.search,
|
|
2039
2046
|
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" ? (
|
|
2047
|
+
}, 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
2048
|
key: 1,
|
|
2042
2049
|
modelValue: o(l).search.form[n.key],
|
|
2043
2050
|
"onUpdate:modelValue": (d) => o(l).search.form[n.key] = d,
|
|
2044
|
-
placeholder: o(l).search.getPlaceholder(n, o(
|
|
2051
|
+
placeholder: o(l).search.getPlaceholder(n, o(b).tCurd("placeholderSelect")),
|
|
2045
2052
|
clearable: "",
|
|
2046
2053
|
disabled: n.disabled?.search,
|
|
2047
2054
|
ref_for: !0
|
|
2048
2055
|
}, n.options?.search?.switch || n.options?.switch, D(n.options?.search?.switch?.on || n.options?.switch?.on || {})), {
|
|
2049
2056
|
default: m(() => [
|
|
2050
|
-
(
|
|
2057
|
+
(u(), h(o(N), {
|
|
2051
2058
|
key: n.options?.switch?.activeValue,
|
|
2052
2059
|
label: n.options?.switch?.activeLabel,
|
|
2053
2060
|
value: n.options?.switch?.activeValue
|
|
2054
2061
|
}, null, 8, ["label", "value"])),
|
|
2055
|
-
(
|
|
2062
|
+
(u(), h(o(N), {
|
|
2056
2063
|
key: n.options?.switch?.inactiveValue,
|
|
2057
2064
|
label: n.options?.switch?.inactiveLabel,
|
|
2058
2065
|
value: n.options?.switch?.inactiveValue
|
|
2059
2066
|
}, null, 8, ["label", "value"]))
|
|
2060
2067
|
]),
|
|
2061
2068
|
_: 2
|
|
2062
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : n.type === "select" ? (
|
|
2069
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : n.type === "select" ? (u(), h(o(W), v({
|
|
2063
2070
|
key: 2,
|
|
2064
2071
|
modelValue: o(l).search.form[n.key],
|
|
2065
2072
|
"onUpdate:modelValue": (d) => o(l).search.form[n.key] = d,
|
|
2066
|
-
placeholder: o(l).search.getPlaceholder(n, o(
|
|
2073
|
+
placeholder: o(l).search.getPlaceholder(n, o(b).tCurd("placeholderSelect")),
|
|
2067
2074
|
clearable: "",
|
|
2068
2075
|
disabled: n.disabled?.search,
|
|
2069
2076
|
ref_for: !0
|
|
2070
2077
|
}, n.options?.search?.select || n.options?.select, D(n.options?.search?.select?.on || n.options?.select?.on || {})), {
|
|
2071
2078
|
default: m(() => [
|
|
2072
|
-
(
|
|
2079
|
+
(u(!0), y(S, null, A(n.options?.select?.data, (d) => (u(), h(o(N), {
|
|
2073
2080
|
key: d.value,
|
|
2074
2081
|
label: d.label,
|
|
2075
2082
|
value: d.value
|
|
2076
2083
|
}, null, 8, ["label", "value"]))), 128))
|
|
2077
2084
|
]),
|
|
2078
2085
|
_: 2
|
|
2079
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : n.type === "datetime" ? (
|
|
2086
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : n.type === "datetime" ? (u(), h(o(ae), v({
|
|
2080
2087
|
key: 3,
|
|
2081
2088
|
modelValue: o(l).search.form[n.key],
|
|
2082
2089
|
"onUpdate:modelValue": (d) => o(l).search.form[n.key] = d,
|
|
2083
2090
|
disabled: n.disabled?.search,
|
|
2084
2091
|
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] ? (
|
|
2092
|
+
}, 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
2093
|
key: 4,
|
|
2087
2094
|
modelValue: o(l).search.form[n.key],
|
|
2088
2095
|
"onUpdate:modelValue": (d) => o(l).search.form[n.key] = d,
|
|
@@ -2091,87 +2098,87 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2091
2098
|
disabled: n.disabled?.search
|
|
2092
2099
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : k("", !0)
|
|
2093
2100
|
]),
|
|
2094
|
-
C(
|
|
2101
|
+
C(c.$slots, "search-" + n.key + "-right", {
|
|
2095
2102
|
row: o(l).search.form
|
|
2096
2103
|
})
|
|
2097
2104
|
]),
|
|
2098
2105
|
_: 2
|
|
2099
2106
|
}, 1032, ["label", "class"])) : k("", !0)
|
|
2100
2107
|
], 64))), 128)),
|
|
2101
|
-
C(
|
|
2108
|
+
C(c.$slots, "search-center", {
|
|
2102
2109
|
row: o(l).search.form
|
|
2103
2110
|
}),
|
|
2104
|
-
i.option.tools?.search || i.option.tools?.reset ? (
|
|
2111
|
+
i.option.tools?.search || i.option.tools?.reset ? (u(), h(o(G), { key: 0 }, {
|
|
2105
2112
|
default: m(() => [
|
|
2106
|
-
i.option.tools?.search ? (
|
|
2113
|
+
i.option.tools?.search ? (u(), h(o(M), {
|
|
2107
2114
|
key: 0,
|
|
2108
2115
|
type: "primary",
|
|
2109
2116
|
onClick: o(l).search.submit
|
|
2110
2117
|
}, {
|
|
2111
2118
|
default: m(() => [
|
|
2112
|
-
$(O(o(
|
|
2119
|
+
$(O(o(b).tCurd("search")), 1)
|
|
2113
2120
|
]),
|
|
2114
2121
|
_: 1
|
|
2115
2122
|
}, 8, ["onClick"])) : k("", !0),
|
|
2116
|
-
i.option.tools?.reset ? (
|
|
2123
|
+
i.option.tools?.reset ? (u(), h(o(M), {
|
|
2117
2124
|
key: 1,
|
|
2118
2125
|
onClick: o(l).search.reset
|
|
2119
2126
|
}, {
|
|
2120
2127
|
default: m(() => [
|
|
2121
|
-
$(O(o(
|
|
2128
|
+
$(O(o(b).tCurd("reset")), 1)
|
|
2122
2129
|
]),
|
|
2123
2130
|
_: 1
|
|
2124
2131
|
}, 8, ["onClick"])) : k("", !0)
|
|
2125
2132
|
]),
|
|
2126
2133
|
_: 1
|
|
2127
2134
|
})) : k("", !0),
|
|
2128
|
-
C(
|
|
2135
|
+
C(c.$slots, "search-end", {
|
|
2129
2136
|
row: o(l).search.form
|
|
2130
2137
|
})
|
|
2131
2138
|
]),
|
|
2132
2139
|
_: 3
|
|
2133
2140
|
}, 8, ["model", "size"])
|
|
2134
2141
|
])) : k("", !0),
|
|
2135
|
-
F("div",
|
|
2136
|
-
F("div",
|
|
2137
|
-
o(r)(i.option.tools?.add) ? (
|
|
2138
|
-
z(o(
|
|
2142
|
+
F("div", ot, [
|
|
2143
|
+
F("div", at, [
|
|
2144
|
+
o(r)(i.option.tools?.add) ? (u(), y("div", lt, [
|
|
2145
|
+
z(o(M), {
|
|
2139
2146
|
type: "primary",
|
|
2140
|
-
onClick:
|
|
2147
|
+
onClick: p[0] || (p[0] = (n) => o(l).update.open(o(f).Add)),
|
|
2141
2148
|
size: i.option.size?.search
|
|
2142
2149
|
}, {
|
|
2143
2150
|
default: m(() => [
|
|
2144
|
-
$(O(o(
|
|
2151
|
+
$(O(o(b).tCurd("add")), 1)
|
|
2145
2152
|
]),
|
|
2146
2153
|
_: 1
|
|
2147
2154
|
}, 8, ["size"])
|
|
2148
2155
|
])) : k("", !0),
|
|
2149
|
-
i.option.table?.selectable && o(r)(i.option.tools?.delete) ? (
|
|
2150
|
-
z(o(
|
|
2156
|
+
i.option.table?.selectable && o(r)(i.option.tools?.delete) ? (u(), y("div", nt, [
|
|
2157
|
+
z(o(M), {
|
|
2151
2158
|
type: "danger",
|
|
2152
|
-
onClick:
|
|
2159
|
+
onClick: p[1] || (p[1] = (n) => o(l).remove.open(o(l).table.selection.list)),
|
|
2153
2160
|
size: i.option.size?.search
|
|
2154
2161
|
}, {
|
|
2155
2162
|
default: m(() => [
|
|
2156
|
-
$(O(o(
|
|
2163
|
+
$(O(o(b).tCurd("delete")), 1)
|
|
2157
2164
|
]),
|
|
2158
2165
|
_: 1
|
|
2159
2166
|
}, 8, ["size"])
|
|
2160
2167
|
])) : k("", !0),
|
|
2161
|
-
i.option.tools?.expand ? (
|
|
2162
|
-
z(o(
|
|
2168
|
+
i.option.tools?.expand ? (u(), y("div", it, [
|
|
2169
|
+
z(o(M), {
|
|
2163
2170
|
type: "warning",
|
|
2164
|
-
onClick:
|
|
2171
|
+
onClick: p[2] || (p[2] = (n) => o(l).table.expand.all()),
|
|
2165
2172
|
size: i.option.size?.search
|
|
2166
2173
|
}, {
|
|
2167
2174
|
default: m(() => [
|
|
2168
|
-
$(O(o(
|
|
2175
|
+
$(O(o(b).tCurd("expandCollapse")), 1)
|
|
2169
2176
|
]),
|
|
2170
2177
|
_: 1
|
|
2171
2178
|
}, 8, ["size"])
|
|
2172
2179
|
])) : k("", !0),
|
|
2173
|
-
i.option.tools?.export?.show ? (
|
|
2174
|
-
i.option.tools?.export?.dropdown?.show ? (
|
|
2180
|
+
i.option.tools?.export?.show ? (u(), y(S, { key: 3 }, [
|
|
2181
|
+
i.option.tools?.export?.dropdown?.show ? (u(), h(o(he), {
|
|
2175
2182
|
key: 0,
|
|
2176
2183
|
onCommand: o(l).export.click
|
|
2177
2184
|
}, {
|
|
@@ -2180,30 +2187,30 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2180
2187
|
size: i.option.size?.search
|
|
2181
2188
|
}, {
|
|
2182
2189
|
default: m(() => [
|
|
2183
|
-
i.option.tools?.export?.dropdown?.select && (i.option.table?.selectable || o(r)(i.option.tools?.delete)) ? (
|
|
2190
|
+
i.option.tools?.export?.dropdown?.select && (i.option.table?.selectable || o(r)(i.option.tools?.delete)) ? (u(), h(o(_), {
|
|
2184
2191
|
key: 0,
|
|
2185
2192
|
command: "select"
|
|
2186
2193
|
}, {
|
|
2187
2194
|
default: m(() => [
|
|
2188
|
-
$(O(o(
|
|
2195
|
+
$(O(o(b).tCurd("exportSelect")), 1)
|
|
2189
2196
|
]),
|
|
2190
2197
|
_: 1
|
|
2191
2198
|
})) : k("", !0),
|
|
2192
|
-
i.option.tools?.export?.dropdown?.page ? (
|
|
2199
|
+
i.option.tools?.export?.dropdown?.page ? (u(), h(o(_), {
|
|
2193
2200
|
key: 1,
|
|
2194
2201
|
command: "page"
|
|
2195
2202
|
}, {
|
|
2196
2203
|
default: m(() => [
|
|
2197
|
-
$(O(o(
|
|
2204
|
+
$(O(o(b).tCurd("exportPage")), 1)
|
|
2198
2205
|
]),
|
|
2199
2206
|
_: 1
|
|
2200
2207
|
})) : k("", !0),
|
|
2201
|
-
i.option.tools?.export?.dropdown?.all ? (
|
|
2208
|
+
i.option.tools?.export?.dropdown?.all ? (u(), h(o(_), {
|
|
2202
2209
|
key: 2,
|
|
2203
2210
|
command: "all"
|
|
2204
2211
|
}, {
|
|
2205
2212
|
default: m(() => [
|
|
2206
|
-
$(O(o(
|
|
2213
|
+
$(O(o(b).tCurd("exportAll")), 1)
|
|
2207
2214
|
]),
|
|
2208
2215
|
_: 1
|
|
2209
2216
|
})) : k("", !0)
|
|
@@ -2212,44 +2219,44 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2212
2219
|
}, 8, ["size"])
|
|
2213
2220
|
]),
|
|
2214
2221
|
default: m(() => [
|
|
2215
|
-
F("div",
|
|
2216
|
-
z(o(
|
|
2222
|
+
F("div", rt, [
|
|
2223
|
+
z(o(M), {
|
|
2217
2224
|
type: "warning",
|
|
2218
2225
|
loading: o(l).export.loading,
|
|
2219
2226
|
size: i.option.size?.search
|
|
2220
2227
|
}, {
|
|
2221
2228
|
default: m(() => [
|
|
2222
|
-
$(O(o(
|
|
2229
|
+
$(O(o(b).tCurd("export")), 1)
|
|
2223
2230
|
]),
|
|
2224
2231
|
_: 1
|
|
2225
2232
|
}, 8, ["loading", "size"])
|
|
2226
2233
|
])
|
|
2227
2234
|
]),
|
|
2228
2235
|
_: 1
|
|
2229
|
-
}, 8, ["onCommand"])) : (
|
|
2230
|
-
z(o(
|
|
2236
|
+
}, 8, ["onCommand"])) : (u(), y("div", st, [
|
|
2237
|
+
z(o(M), {
|
|
2231
2238
|
type: "warning",
|
|
2232
2239
|
loading: o(l).export.loading,
|
|
2233
2240
|
size: i.option.size?.search,
|
|
2234
|
-
onClick:
|
|
2241
|
+
onClick: p[3] || (p[3] = (n) => o(l).export.run.start("all"))
|
|
2235
2242
|
}, {
|
|
2236
2243
|
default: m(() => [
|
|
2237
|
-
$(O(o(
|
|
2244
|
+
$(O(o(b).tCurd("export")), 1)
|
|
2238
2245
|
]),
|
|
2239
2246
|
_: 1
|
|
2240
2247
|
}, 8, ["loading", "size"])
|
|
2241
2248
|
]))
|
|
2242
2249
|
], 64)) : k("", !0),
|
|
2243
|
-
C(
|
|
2250
|
+
C(c.$slots, "tools-left")
|
|
2244
2251
|
]),
|
|
2245
|
-
F("div",
|
|
2246
|
-
C(
|
|
2247
|
-
o(l).page.showTools ? (
|
|
2252
|
+
F("div", dt, [
|
|
2253
|
+
C(c.$slots, "tools-right"),
|
|
2254
|
+
o(l).page.showTools ? (u(), h(o(ie), v({
|
|
2248
2255
|
key: 0,
|
|
2249
2256
|
"current-page": o(l).page.num,
|
|
2250
|
-
"onUpdate:currentPage":
|
|
2257
|
+
"onUpdate:currentPage": p[4] || (p[4] = (n) => o(l).page.num = n),
|
|
2251
2258
|
"page-size": o(l).page.size,
|
|
2252
|
-
"onUpdate:pageSize":
|
|
2259
|
+
"onUpdate:pageSize": p[5] || (p[5] = (n) => o(l).page.size = n),
|
|
2253
2260
|
background: "",
|
|
2254
2261
|
"page-sizes": o(l).page.sizeList,
|
|
2255
2262
|
"pager-count": o(l).page.pagerCount,
|
|
@@ -2259,10 +2266,10 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2259
2266
|
onSizeChange: o(l).table.getList,
|
|
2260
2267
|
onCurrentChange: o(l).table.getList
|
|
2261
2268
|
}, 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 ? (
|
|
2269
|
+
i.option.tools?.refresh === void 0 || i.option.tools?.refresh ? (u(), y("div", {
|
|
2263
2270
|
key: 1,
|
|
2264
2271
|
class: j(["refresh-btn", [i.option.size?.search]]),
|
|
2265
|
-
onClick:
|
|
2272
|
+
onClick: p[6] || (p[6] = //@ts-ignore
|
|
2266
2273
|
(...n) => o(l).table.getList && o(l).table.getList(...n))
|
|
2267
2274
|
}, [
|
|
2268
2275
|
z(Pe)
|
|
@@ -2275,7 +2282,7 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2275
2282
|
F("div", {
|
|
2276
2283
|
class: j(["column form-box-content", [i.option.table?.fitHeight ? "absolute fit" : ""]])
|
|
2277
2284
|
}, [
|
|
2278
|
-
ke((
|
|
2285
|
+
ke((u(), h(o(ye), v({
|
|
2279
2286
|
data: o(l).table.data,
|
|
2280
2287
|
border: i.option.table?.border === void 0 ? !0 : i.option.table?.border,
|
|
2281
2288
|
onSelectionChange: o(l).table.selection.change,
|
|
@@ -2284,7 +2291,7 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2284
2291
|
onExpandChange: o(l).table.expand.change
|
|
2285
2292
|
}, i.option.table, D(i.option.table?.on || {})), {
|
|
2286
2293
|
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 ? (
|
|
2294
|
+
(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
2295
|
key: 0,
|
|
2289
2296
|
type: "selection",
|
|
2290
2297
|
width: "40",
|
|
@@ -2293,27 +2300,27 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2293
2300
|
"show-overflow-tooltip": !1,
|
|
2294
2301
|
className: "cc1-form-selectable-column"
|
|
2295
2302
|
}, 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(
|
|
2303
|
+
z(Xe, {
|
|
2297
2304
|
conf: o(l),
|
|
2298
2305
|
columnList: o(l).table.column.list,
|
|
2299
2306
|
option: i.option
|
|
2300
2307
|
}, oe({ _: 2 }, [
|
|
2301
|
-
|
|
2308
|
+
A(c.$slots, (n, d) => ({
|
|
2302
2309
|
name: d,
|
|
2303
2310
|
fn: m((V) => [
|
|
2304
|
-
C(
|
|
2311
|
+
C(c.$slots, d, Ce(ve(V || {})))
|
|
2305
2312
|
])
|
|
2306
2313
|
}))
|
|
2307
2314
|
]), 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) ||
|
|
2315
|
+
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
2316
|
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),
|
|
2317
|
+
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
2318
|
align: "center",
|
|
2312
2319
|
fixed: "right"
|
|
2313
2320
|
}, i.option.table?.operate), {
|
|
2314
2321
|
header: m(() => [
|
|
2315
|
-
C(
|
|
2316
|
-
$(O(o(
|
|
2322
|
+
C(c.$slots, "table-header-op", {}, () => [
|
|
2323
|
+
$(O(o(b).tCurd("operation")), 1)
|
|
2317
2324
|
])
|
|
2318
2325
|
]),
|
|
2319
2326
|
default: m(({ row: n }) => [
|
|
@@ -2321,76 +2328,76 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2321
2328
|
size: i.option.size?.table
|
|
2322
2329
|
}, {
|
|
2323
2330
|
default: m(() => [
|
|
2324
|
-
C(
|
|
2325
|
-
o(l).update.type === o(
|
|
2326
|
-
z(o(
|
|
2331
|
+
C(c.$slots, "table-op-left", { row: n }),
|
|
2332
|
+
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 }, [
|
|
2333
|
+
z(o(M), {
|
|
2327
2334
|
link: "",
|
|
2328
2335
|
type: "info",
|
|
2329
2336
|
onClick: o(l).update.close
|
|
2330
2337
|
}, {
|
|
2331
2338
|
default: m(() => [
|
|
2332
|
-
$(O(o(
|
|
2339
|
+
$(O(o(b).tCurd("cancel")), 1)
|
|
2333
2340
|
]),
|
|
2334
2341
|
_: 1
|
|
2335
2342
|
}, 8, ["onClick"]),
|
|
2336
|
-
z(o(
|
|
2343
|
+
z(o(M), {
|
|
2337
2344
|
link: "",
|
|
2338
2345
|
type: "primary",
|
|
2339
2346
|
onClick: o(l).update.submit,
|
|
2340
2347
|
loading: o(l).update.loading
|
|
2341
2348
|
}, {
|
|
2342
2349
|
default: m(() => [
|
|
2343
|
-
$(O(o(
|
|
2350
|
+
$(O(o(b).tCurd("confirm")), 1)
|
|
2344
2351
|
]),
|
|
2345
2352
|
_: 1
|
|
2346
2353
|
}, 8, ["onClick", "loading"]),
|
|
2347
|
-
C(
|
|
2348
|
-
], 64)) : (
|
|
2349
|
-
o(r)(i.option.table?.add, n) ? (
|
|
2354
|
+
C(c.$slots, "table-op-edit-right", { row: n })
|
|
2355
|
+
], 64)) : (u(), y(S, { key: 1 }, [
|
|
2356
|
+
o(r)(i.option.table?.add, n) ? (u(), h(o(M), {
|
|
2350
2357
|
key: 0,
|
|
2351
2358
|
link: "",
|
|
2352
2359
|
type: "primary",
|
|
2353
|
-
onClick: (d) => o(l).update.open(o(
|
|
2360
|
+
onClick: (d) => o(l).update.open(o(f).Add, n)
|
|
2354
2361
|
}, {
|
|
2355
2362
|
default: m(() => [
|
|
2356
|
-
$(O(o(
|
|
2363
|
+
$(O(o(b).tCurd("add")), 1)
|
|
2357
2364
|
]),
|
|
2358
2365
|
_: 2
|
|
2359
2366
|
}, 1032, ["onClick"])) : k("", !0),
|
|
2360
|
-
o(r)(i.option.table?.view, n) ? (
|
|
2367
|
+
o(r)(i.option.table?.view, n) ? (u(), h(o(M), {
|
|
2361
2368
|
key: 1,
|
|
2362
2369
|
link: "",
|
|
2363
2370
|
type: "primary",
|
|
2364
|
-
onClick: (d) => o(l).update.open(o(
|
|
2371
|
+
onClick: (d) => o(l).update.open(o(f).View, n)
|
|
2365
2372
|
}, {
|
|
2366
2373
|
default: m(() => [
|
|
2367
|
-
$(O(o(
|
|
2374
|
+
$(O(o(b).tCurd("view")), 1)
|
|
2368
2375
|
]),
|
|
2369
2376
|
_: 2
|
|
2370
2377
|
}, 1032, ["onClick"])) : k("", !0),
|
|
2371
|
-
o(r)(i.option.table?.update, n) ? (
|
|
2378
|
+
o(r)(i.option.table?.update, n) ? (u(), h(o(M), {
|
|
2372
2379
|
key: 2,
|
|
2373
2380
|
link: "",
|
|
2374
2381
|
type: "warning",
|
|
2375
|
-
onClick: (d) => o(l).update.open(o(
|
|
2382
|
+
onClick: (d) => o(l).update.open(o(f).Update, n)
|
|
2376
2383
|
}, {
|
|
2377
2384
|
default: m(() => [
|
|
2378
|
-
$(O(o(
|
|
2385
|
+
$(O(o(b).tCurd("edit")), 1)
|
|
2379
2386
|
]),
|
|
2380
2387
|
_: 2
|
|
2381
2388
|
}, 1032, ["onClick"])) : k("", !0),
|
|
2382
|
-
o(r)(i.option.table?.delete, n) ? (
|
|
2389
|
+
o(r)(i.option.table?.delete, n) ? (u(), h(o(M), {
|
|
2383
2390
|
key: 3,
|
|
2384
2391
|
link: "",
|
|
2385
2392
|
type: "danger",
|
|
2386
2393
|
onClick: (d) => o(l).remove.open([n])
|
|
2387
2394
|
}, {
|
|
2388
2395
|
default: m(() => [
|
|
2389
|
-
$(O(o(
|
|
2396
|
+
$(O(o(b).tCurd("delete")), 1)
|
|
2390
2397
|
]),
|
|
2391
2398
|
_: 2
|
|
2392
2399
|
}, 1032, ["onClick"])) : k("", !0),
|
|
2393
|
-
C(
|
|
2400
|
+
C(c.$slots, "table-op-right", { row: n })
|
|
2394
2401
|
], 64))
|
|
2395
2402
|
]),
|
|
2396
2403
|
_: 2
|
|
@@ -2405,13 +2412,13 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2405
2412
|
])
|
|
2406
2413
|
], 2)
|
|
2407
2414
|
], 2),
|
|
2408
|
-
F("div",
|
|
2409
|
-
(i.option.page?.show === void 0 || i.option.page?.show) && !o(l).page.showTools ? (
|
|
2415
|
+
F("div", ut, [
|
|
2416
|
+
(i.option.page?.show === void 0 || i.option.page?.show) && !o(l).page.showTools ? (u(), h(o(ie), v({
|
|
2410
2417
|
key: 0,
|
|
2411
2418
|
"current-page": o(l).page.num,
|
|
2412
|
-
"onUpdate:currentPage":
|
|
2419
|
+
"onUpdate:currentPage": p[7] || (p[7] = (n) => o(l).page.num = n),
|
|
2413
2420
|
"page-size": o(l).page.size,
|
|
2414
|
-
"onUpdate:pageSize":
|
|
2421
|
+
"onUpdate:pageSize": p[8] || (p[8] = (n) => o(l).page.size = n),
|
|
2415
2422
|
background: "",
|
|
2416
2423
|
"page-sizes": o(l).page.sizeList,
|
|
2417
2424
|
"pager-count": o(l).page.pagerCount,
|
|
@@ -2423,36 +2430,36 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2423
2430
|
}, 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
2431
|
])
|
|
2425
2432
|
], 2),
|
|
2426
|
-
C(
|
|
2433
|
+
C(c.$slots, "box-right")
|
|
2427
2434
|
], 2),
|
|
2428
2435
|
z(o(ee), v({
|
|
2429
2436
|
modelValue: o(l).update.show,
|
|
2430
|
-
"onUpdate:modelValue":
|
|
2437
|
+
"onUpdate:modelValue": p[9] || (p[9] = (n) => o(l).update.show = n),
|
|
2431
2438
|
title: o(l).update.title,
|
|
2432
2439
|
"before-close": o(l).update.close
|
|
2433
2440
|
}, i.option.dialog), {
|
|
2434
2441
|
footer: m(() => [
|
|
2435
|
-
F("span",
|
|
2442
|
+
F("span", ft, [
|
|
2436
2443
|
z(o(K), {
|
|
2437
2444
|
size: i.option.size?.form
|
|
2438
2445
|
}, {
|
|
2439
2446
|
default: m(() => [
|
|
2440
|
-
z(o(
|
|
2447
|
+
z(o(M), {
|
|
2441
2448
|
onClick: o(l).update.close
|
|
2442
2449
|
}, {
|
|
2443
2450
|
default: m(() => [
|
|
2444
|
-
$(O(o(
|
|
2451
|
+
$(O(o(b).tCurd("close")), 1)
|
|
2445
2452
|
]),
|
|
2446
2453
|
_: 1
|
|
2447
2454
|
}, 8, ["onClick"]),
|
|
2448
|
-
o(l).update.type !== o(
|
|
2455
|
+
o(l).update.type !== o(f).View ? (u(), h(o(M), {
|
|
2449
2456
|
key: 0,
|
|
2450
2457
|
type: "primary",
|
|
2451
2458
|
onClick: o(l).update.submit,
|
|
2452
2459
|
loading: o(l).update.loading
|
|
2453
2460
|
}, {
|
|
2454
2461
|
default: m(() => [
|
|
2455
|
-
$(O(o(
|
|
2462
|
+
$(O(o(b).tCurd("submit")), 1)
|
|
2456
2463
|
]),
|
|
2457
2464
|
_: 1
|
|
2458
2465
|
}, 8, ["onClick", "loading"])) : k("", !0)
|
|
@@ -2470,45 +2477,45 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2470
2477
|
size: i.option.size?.form
|
|
2471
2478
|
}, {
|
|
2472
2479
|
default: m(() => [
|
|
2473
|
-
o(l).update.showContent ? (
|
|
2480
|
+
o(l).update.showContent ? (u(!0), y(S, { key: 0 }, A(o(l).update.formColumn, (n) => (u(), y(S, null, [
|
|
2474
2481
|
o(r)(
|
|
2475
2482
|
(() => {
|
|
2476
2483
|
const d = [], V = (w) => {
|
|
2477
|
-
w?.item?.children ? V(w.item.children) : d.push(...w.map((
|
|
2484
|
+
w?.item?.children ? V(w.item.children) : d.push(...w.map((T) => T.item?.show?.form));
|
|
2478
2485
|
};
|
|
2479
2486
|
return V(n), d;
|
|
2480
2487
|
})(),
|
|
2481
2488
|
o(l).update.form,
|
|
2482
2489
|
o(l).update.type
|
|
2483
|
-
) ? (
|
|
2490
|
+
) ? (u(), y("div", {
|
|
2484
2491
|
key: 0,
|
|
2485
2492
|
class: j(["row curd-row", {
|
|
2486
2493
|
stripe: i.option.form?.stripe === void 0 ? !0 : i.option.form?.stripe
|
|
2487
2494
|
}])
|
|
2488
2495
|
}, [
|
|
2489
|
-
C(
|
|
2496
|
+
C(c.$slots, "form-start", {
|
|
2490
2497
|
row: o(l).update.form
|
|
2491
2498
|
}),
|
|
2492
|
-
(
|
|
2493
|
-
o(r)(d.item.show?.form, o(l).update.form, o(l).update.type) ? (
|
|
2499
|
+
(u(!0), y(S, null, A(n, (d) => (u(), y(S, null, [
|
|
2500
|
+
o(r)(d.item.show?.form, o(l).update.form, o(l).update.type) ? (u(), y("div", {
|
|
2494
2501
|
key: 0,
|
|
2495
2502
|
class: j([d.item.form.span > 0 ? `col-${o(l).getColumnSpan(d, n)}` : "col", `form-item-col-${d.item.key}`])
|
|
2496
2503
|
}, [
|
|
2497
|
-
(
|
|
2504
|
+
(u(!0), y(S, null, A(d.item.children ? d.children : [d], (V) => (u(), h(et, {
|
|
2498
2505
|
key: V.item.key,
|
|
2499
2506
|
conf: o(l),
|
|
2500
2507
|
item: V
|
|
2501
2508
|
}, oe({ _: 2 }, [
|
|
2502
|
-
|
|
2503
|
-
name:
|
|
2509
|
+
A(c.$slots, (w, T) => ({
|
|
2510
|
+
name: T,
|
|
2504
2511
|
fn: m((B) => [
|
|
2505
|
-
C(
|
|
2512
|
+
C(c.$slots, T, v({ ref_for: !0 }, B || {}))
|
|
2506
2513
|
])
|
|
2507
2514
|
}))
|
|
2508
2515
|
]), 1032, ["conf", "item"]))), 128))
|
|
2509
2516
|
], 2)) : k("", !0)
|
|
2510
2517
|
], 64))), 256)),
|
|
2511
|
-
C(
|
|
2518
|
+
C(c.$slots, "form-end", {
|
|
2512
2519
|
row: o(l).update.form
|
|
2513
2520
|
})
|
|
2514
2521
|
], 2)) : k("", !0)
|
|
@@ -2521,31 +2528,31 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2521
2528
|
}, 16, ["modelValue", "title", "before-close"]),
|
|
2522
2529
|
z(o(ee), {
|
|
2523
2530
|
modelValue: o(l).remove.show,
|
|
2524
|
-
"onUpdate:modelValue":
|
|
2531
|
+
"onUpdate:modelValue": p[10] || (p[10] = (n) => o(l).remove.show = n),
|
|
2525
2532
|
title: o(l).remove.title,
|
|
2526
2533
|
"close-on-click-modal": !1
|
|
2527
2534
|
}, {
|
|
2528
2535
|
footer: m(() => [
|
|
2529
|
-
F("span",
|
|
2536
|
+
F("span", pt, [
|
|
2530
2537
|
z(o(K), {
|
|
2531
2538
|
size: i.option.size?.form
|
|
2532
2539
|
}, {
|
|
2533
2540
|
default: m(() => [
|
|
2534
|
-
z(o(
|
|
2541
|
+
z(o(M), {
|
|
2535
2542
|
onClick: o(l).remove.close
|
|
2536
2543
|
}, {
|
|
2537
2544
|
default: m(() => [
|
|
2538
|
-
$(O(o(
|
|
2545
|
+
$(O(o(b).tCurd("close")), 1)
|
|
2539
2546
|
]),
|
|
2540
2547
|
_: 1
|
|
2541
2548
|
}, 8, ["onClick"]),
|
|
2542
|
-
z(o(
|
|
2549
|
+
z(o(M), {
|
|
2543
2550
|
type: "danger",
|
|
2544
2551
|
onClick: o(l).remove.submit,
|
|
2545
2552
|
loading: o(l).remove.loading
|
|
2546
2553
|
}, {
|
|
2547
2554
|
default: m(() => [
|
|
2548
|
-
$(O(o(
|
|
2555
|
+
$(O(o(b).tCurd("confirmDelete")), 1)
|
|
2549
2556
|
]),
|
|
2550
2557
|
_: 1
|
|
2551
2558
|
}, 8, ["onClick", "loading"])
|
|
@@ -2555,7 +2562,7 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2555
2562
|
])
|
|
2556
2563
|
]),
|
|
2557
2564
|
default: m(() => [
|
|
2558
|
-
F("div", null, O(o(
|
|
2565
|
+
F("div", null, O(o(b).tCurd("confirmDeleteMessage", o(l).remove.items.length)), 1)
|
|
2559
2566
|
]),
|
|
2560
2567
|
_: 1
|
|
2561
2568
|
}, 8, ["modelValue", "title"]),
|
|
@@ -2568,32 +2575,32 @@ const Je = /* @__PURE__ */ pe(Ke, [["render", He]]), We = { class: "row flex-cen
|
|
|
2568
2575
|
};
|
|
2569
2576
|
}
|
|
2570
2577
|
});
|
|
2571
|
-
class
|
|
2578
|
+
class bt {
|
|
2572
2579
|
/**
|
|
2573
2580
|
* 通过远程 URL 下载文件,自动创建临时 `<a>` 标签触发浏览器下载
|
|
2574
2581
|
*
|
|
2575
2582
|
* @param href - 文件的远程地址
|
|
2576
2583
|
* @param name - 下载后的文件名,默认 `'download.png'`
|
|
2577
2584
|
*/
|
|
2578
|
-
static async download(a,
|
|
2585
|
+
static async download(a, f = "download.png") {
|
|
2579
2586
|
const t = document.createElement("a");
|
|
2580
|
-
t.style.display = "none", t.href = a, t.setAttribute("download",
|
|
2587
|
+
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
2588
|
}
|
|
2582
2589
|
/**
|
|
2583
2590
|
* 将json对象或者json数组导出为json文件保存
|
|
2584
2591
|
* @param data
|
|
2585
2592
|
* @param name
|
|
2586
2593
|
*/
|
|
2587
|
-
static exportJSONFile = (a,
|
|
2594
|
+
static exportJSONFile = (a, f) => {
|
|
2588
2595
|
const t = new Blob([JSON.stringify(a)], { type: "application/json" }), r = URL.createObjectURL(t), l = document.createElement("a");
|
|
2589
|
-
l.href = r, l.download = `${
|
|
2596
|
+
l.href = r, l.download = `${f || "config"}.json`, l.click();
|
|
2590
2597
|
};
|
|
2591
2598
|
/**
|
|
2592
2599
|
* 导入文件内容,默认为json
|
|
2593
2600
|
* @param param
|
|
2594
2601
|
* @returns
|
|
2595
2602
|
*/
|
|
2596
|
-
static importFile = async (a) => new Promise((
|
|
2603
|
+
static importFile = async (a) => new Promise((f, t) => {
|
|
2597
2604
|
const r = document.createElement("input");
|
|
2598
2605
|
r.type = "file";
|
|
2599
2606
|
const l = a?.accept || ".json";
|
|
@@ -2603,36 +2610,36 @@ class yt {
|
|
|
2603
2610
|
U.fail("未选择文件"), t("未选择文件");
|
|
2604
2611
|
return;
|
|
2605
2612
|
}
|
|
2606
|
-
const
|
|
2607
|
-
|
|
2608
|
-
const g = l == ".json" ? JSON.parse(
|
|
2609
|
-
|
|
2610
|
-
},
|
|
2613
|
+
const c = new FileReader();
|
|
2614
|
+
c.onload = async (p) => {
|
|
2615
|
+
const g = l == ".json" ? JSON.parse(p.target.result) : p.target.result;
|
|
2616
|
+
f(g);
|
|
2617
|
+
}, c.onerror = () => {
|
|
2611
2618
|
U.fail("文件读取失败"), t("文件读取失败");
|
|
2612
|
-
},
|
|
2619
|
+
}, c.readAsText(s), document.body.removeChild(r);
|
|
2613
2620
|
}, document.body.appendChild(r), r.click();
|
|
2614
2621
|
});
|
|
2615
2622
|
}
|
|
2616
|
-
const
|
|
2617
|
-
if (i.component("TCurd",
|
|
2623
|
+
const mt = (i, a) => {
|
|
2624
|
+
if (i.component("TCurd", ct), i.component("TFormList", ne), i.component("TColumn", Te), a?.customComponent) {
|
|
2618
2625
|
L.customComponent = a.customComponent;
|
|
2619
|
-
for (const
|
|
2620
|
-
i.component(
|
|
2626
|
+
for (const f in a.customComponent)
|
|
2627
|
+
i.component(f, a.customComponent[f]);
|
|
2621
2628
|
}
|
|
2622
|
-
},
|
|
2623
|
-
install:
|
|
2629
|
+
}, wt = {
|
|
2630
|
+
install: mt
|
|
2624
2631
|
};
|
|
2625
2632
|
export {
|
|
2626
2633
|
P as ArrUtil,
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2634
|
+
Me as ExcelUtil,
|
|
2635
|
+
Te as TColumn,
|
|
2636
|
+
ct as TCurd,
|
|
2637
|
+
bt as TFile,
|
|
2631
2638
|
L as TForm,
|
|
2632
2639
|
E as TFormConfig,
|
|
2633
|
-
|
|
2640
|
+
b as TFormI18n,
|
|
2634
2641
|
ne as TFormList,
|
|
2635
2642
|
U as TSys,
|
|
2636
|
-
|
|
2637
|
-
|
|
2643
|
+
wt as default,
|
|
2644
|
+
mt as install
|
|
2638
2645
|
};
|