cc1-form 1.2.23 → 1.2.24
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.css +1 -1
- package/dist/cc1-form.js +1060 -1061
- package/dist/cc1-form.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/cc1-form.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ElMessage as xe, ElLoading as ze, ElForm as
|
|
1
|
+
import { ElMessage as xe, ElLoading as ze, ElForm as Q, ElFormItem as le, ElInput as ee, ElSwitch as Z, ElSelect as X, ElOption as W, ElRadioGroup as de, ElRadio as se, ElTreeSelect as pe, ElDatePicker as ue, ElDialog as ie, ElButton as T, ElTableColumn as ae, ElDropdown as $e, ElDropdownMenu as Oe, ElDropdownItem as ne, ElPagination as me, ElTable as De } from "element-plus";
|
|
2
2
|
import "vue-router";
|
|
3
|
-
import { defineComponent as K, reactive as ce, onMounted as ye, resolveComponent as
|
|
3
|
+
import { defineComponent as K, reactive as ce, onMounted as ye, resolveComponent as te, openBlock as d, createElementBlock as b, renderSlot as x, createVNode as E, withCtx as g, createTextVNode as O, createCommentVNode as C, Fragment as $, renderList as A, createBlock as y, normalizeClass as R, normalizeStyle as ge, ref as J, watch as re, unref as l, createElementVNode as U, mergeProps as V, toHandlers as z, resolveDynamicComponent as q, toDisplayString as S, computed as be, getCurrentInstance as Ee, createSlots as G, withModifiers as Ue, resolveDirective as Se, withDirectives as Me, normalizeProps as Fe, guardReactiveProps as Ae } from "vue";
|
|
4
4
|
import { Scope as we } from "cc1-vue3";
|
|
5
5
|
class D {
|
|
6
6
|
/**
|
|
@@ -27,13 +27,13 @@ class D {
|
|
|
27
27
|
* @param data 数据
|
|
28
28
|
* @returns 是否显示
|
|
29
29
|
*/
|
|
30
|
-
static isFun = (r, ...
|
|
30
|
+
static isFun = (r, ...s) => Array.isArray(r) ? r.some((c) => typeof c == "function" ? c(...s) : c) : typeof r == "function" ? r(...s) : r;
|
|
31
31
|
/**
|
|
32
32
|
* 获取路由参数,自动获取query、params中的参数, 哪个有就返回哪个
|
|
33
33
|
*/
|
|
34
34
|
static getRouterParams = () => {
|
|
35
|
-
const r = this.router.currentRoute.value.query || {},
|
|
36
|
-
return Object.keys(r).length ? r : Object.keys(
|
|
35
|
+
const r = this.router.currentRoute.value.query || {}, s = this.router.currentRoute.value.params || {};
|
|
36
|
+
return Object.keys(r).length ? r : Object.keys(s).length ? s : {};
|
|
37
37
|
};
|
|
38
38
|
/**
|
|
39
39
|
* 模块赋值
|
|
@@ -46,8 +46,8 @@ class D {
|
|
|
46
46
|
static loadModule = async (r) => {
|
|
47
47
|
if (!D.moduleObj[r])
|
|
48
48
|
throw new Error(`模块${r}未加载,请赋值如:TSys.moduleObj = { ${r}: ()=>import('${r}') }`);
|
|
49
|
-
const
|
|
50
|
-
return
|
|
49
|
+
const s = await D.moduleObj[r]();
|
|
50
|
+
return s.default ?? s;
|
|
51
51
|
};
|
|
52
52
|
/**
|
|
53
53
|
* 提示信息对象管理
|
|
@@ -63,18 +63,18 @@ class D {
|
|
|
63
63
|
* @param type 消息类型
|
|
64
64
|
* @param options 其他选项
|
|
65
65
|
*/
|
|
66
|
-
static showMessage(r,
|
|
67
|
-
const
|
|
68
|
-
if (!this.tipMessages[r] ||
|
|
69
|
-
this.tipMessages[r] =
|
|
70
|
-
const
|
|
66
|
+
static showMessage(r, s, c = {}) {
|
|
67
|
+
const o = Date.now();
|
|
68
|
+
if (!this.tipMessages[r] || o - this.tipMessages[r] > this.tipMessagesGap) {
|
|
69
|
+
this.tipMessages[r] = o;
|
|
70
|
+
const t = Object.assign(
|
|
71
71
|
{
|
|
72
72
|
message: r,
|
|
73
|
-
type:
|
|
73
|
+
type: s
|
|
74
74
|
},
|
|
75
|
-
|
|
75
|
+
c
|
|
76
76
|
);
|
|
77
|
-
xe(
|
|
77
|
+
xe(t), setTimeout(() => {
|
|
78
78
|
delete this.tipMessages[r];
|
|
79
79
|
}, this.tipMessagesGap);
|
|
80
80
|
}
|
|
@@ -84,16 +84,16 @@ class D {
|
|
|
84
84
|
* @param content
|
|
85
85
|
* @param options
|
|
86
86
|
*/
|
|
87
|
-
static fail = (r,
|
|
88
|
-
this.showMessage(r, "error",
|
|
87
|
+
static fail = (r, s = {}) => {
|
|
88
|
+
this.showMessage(r, "error", s);
|
|
89
89
|
};
|
|
90
90
|
/**
|
|
91
91
|
* 成功提示
|
|
92
92
|
* @param content
|
|
93
93
|
* @param options
|
|
94
94
|
*/
|
|
95
|
-
static success = (r,
|
|
96
|
-
this.showMessage(r, "success",
|
|
95
|
+
static success = (r, s = {}) => {
|
|
96
|
+
this.showMessage(r, "success", s);
|
|
97
97
|
};
|
|
98
98
|
static loadingObj = null;
|
|
99
99
|
static loadingTimer = null;
|
|
@@ -102,11 +102,11 @@ class D {
|
|
|
102
102
|
* @param show
|
|
103
103
|
* @param text
|
|
104
104
|
*/
|
|
105
|
-
static loading = (r = !0,
|
|
105
|
+
static loading = (r = !0, s = "Loading...") => {
|
|
106
106
|
Timer.un(this.loadingTimer), this.loadingTimer = Timer.once(() => {
|
|
107
107
|
r ? this.loadingObj = ze.service({
|
|
108
108
|
lock: !0,
|
|
109
|
-
text:
|
|
109
|
+
text: s,
|
|
110
110
|
background: "rgba(0, 0, 0, 0.3)"
|
|
111
111
|
}) : this.loadingObj && (this.loadingObj.close(), this.loadingObj = null);
|
|
112
112
|
}, 50);
|
|
@@ -116,13 +116,13 @@ class D {
|
|
|
116
116
|
* @param url 地址
|
|
117
117
|
* @param isCenter 是否居中
|
|
118
118
|
*/
|
|
119
|
-
static openUrl = (r,
|
|
120
|
-
if (
|
|
121
|
-
let
|
|
119
|
+
static openUrl = (r, s = !0) => {
|
|
120
|
+
if (s) {
|
|
121
|
+
let c = screen.width / 2 - 500, o = screen.height / 2 - 800 / 2 - 30;
|
|
122
122
|
window.open(
|
|
123
123
|
r,
|
|
124
124
|
"_blank",
|
|
125
|
-
"toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" +
|
|
125
|
+
"toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + o + ", left=" + c
|
|
126
126
|
);
|
|
127
127
|
} else
|
|
128
128
|
window.open(r, "DescriptiveWindowName" + StrUtil.getId(), "resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0");
|
|
@@ -132,11 +132,11 @@ class D {
|
|
|
132
132
|
* @param param
|
|
133
133
|
* @returns
|
|
134
134
|
*/
|
|
135
|
-
static getImgPic = (r) => new Promise(async (
|
|
136
|
-
let
|
|
137
|
-
const
|
|
135
|
+
static getImgPic = (r) => new Promise(async (s, c) => {
|
|
136
|
+
let o = document.getElementById(r.id);
|
|
137
|
+
const t = await D.loadModule("html2canvas");
|
|
138
138
|
try {
|
|
139
|
-
o
|
|
139
|
+
t(o, {
|
|
140
140
|
logging: !1,
|
|
141
141
|
allowTaint: !0,
|
|
142
142
|
scale: window.devicePixelRatio,
|
|
@@ -146,12 +146,12 @@ class D {
|
|
|
146
146
|
windowHeight: r.windowHeight,
|
|
147
147
|
useCORS: !0,
|
|
148
148
|
backgroundColor: "#ffffff00"
|
|
149
|
-
}).then(function(
|
|
150
|
-
let
|
|
151
|
-
|
|
149
|
+
}).then(function(n) {
|
|
150
|
+
let a = n.toDataURL("image/png");
|
|
151
|
+
s(a);
|
|
152
152
|
});
|
|
153
|
-
} catch (
|
|
154
|
-
|
|
153
|
+
} catch (n) {
|
|
154
|
+
c(n);
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
157
|
}
|
|
@@ -538,10 +538,10 @@ class j {
|
|
|
538
538
|
* @param field - 字段的 key 值
|
|
539
539
|
* @returns 该字段对应类型的 options 配置,如 select 类型返回 `options.select`
|
|
540
540
|
*/
|
|
541
|
-
static findOptions = (r,
|
|
542
|
-
const
|
|
543
|
-
if (
|
|
544
|
-
return
|
|
541
|
+
static findOptions = (r, s) => {
|
|
542
|
+
const c = r.column.find((t) => t.key === s), o = (t) => t.replace(/-([a-z])/g, (n, a) => a.toUpperCase());
|
|
543
|
+
if (c)
|
|
544
|
+
return c.options[o(c.type)];
|
|
545
545
|
};
|
|
546
546
|
/**
|
|
547
547
|
* 更新组件数据
|
|
@@ -559,9 +559,9 @@ class j {
|
|
|
559
559
|
}))
|
|
560
560
|
)
|
|
561
561
|
*/
|
|
562
|
-
static setOptionsData = (r,
|
|
563
|
-
const
|
|
564
|
-
|
|
562
|
+
static setOptionsData = (r, s, c) => {
|
|
563
|
+
const o = j.findOptions(r, s);
|
|
564
|
+
o && (o.data = c);
|
|
565
565
|
};
|
|
566
566
|
static form = {
|
|
567
567
|
openBefore: {
|
|
@@ -572,9 +572,9 @@ class j {
|
|
|
572
572
|
* @param treeData 树形数据
|
|
573
573
|
* @param option 组件配置
|
|
574
574
|
*/
|
|
575
|
-
parentId: (r,
|
|
576
|
-
const
|
|
577
|
-
r ?
|
|
575
|
+
parentId: (r, s, c, o) => {
|
|
576
|
+
const t = M.config.table.rowKey;
|
|
577
|
+
r ? s.type === D.EDialog.Add ? (s.form.parentId = r[t], s.form.sort = r.children.length + 1) : s.form.parentId = r.parentId.substring(r.parentId.lastIndexOf(",") + 1) : (s.form.parentId = "0", s.form.sort = c.length + 1), j.setOptionsData(o, "parentId", [{ [t]: "0", title: "根", children: c }]);
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
580
|
};
|
|
@@ -615,21 +615,21 @@ const Te = {
|
|
|
615
615
|
mergeColumn: "合并栏位",
|
|
616
616
|
expandColumn: "展开栏位"
|
|
617
617
|
};
|
|
618
|
-
class
|
|
618
|
+
class v {
|
|
619
619
|
/** 解析国际化值:函数则执行并返回字符串,字符串则替换 `{key}` 占位符 */
|
|
620
|
-
static t(r, ...
|
|
620
|
+
static t(r, ...s) {
|
|
621
621
|
if (typeof r == "function")
|
|
622
|
-
return r(...
|
|
622
|
+
return r(...s);
|
|
623
623
|
r = String(r);
|
|
624
|
-
let
|
|
625
|
-
return r.replace(/{([^}]+)}/g, (
|
|
624
|
+
let c = 0;
|
|
625
|
+
return r.replace(/{([^}]+)}/g, (o, t) => c < s.length ? String(s[c++]) : `{${t}}`);
|
|
626
626
|
}
|
|
627
627
|
static setI18n = (r) => {
|
|
628
|
-
|
|
628
|
+
v.curd = ObjectUtil.deepMerge(v.curd, r);
|
|
629
629
|
};
|
|
630
630
|
/** 解析curd国际化值 */
|
|
631
|
-
static tCurd(r, ...
|
|
632
|
-
return this.t(this.curd[r], ...
|
|
631
|
+
static tCurd(r, ...s) {
|
|
632
|
+
return this.t(this.curd[r], ...s);
|
|
633
633
|
}
|
|
634
634
|
/** curd表单 */
|
|
635
635
|
static curd = Te;
|
|
@@ -644,14 +644,14 @@ class H {
|
|
|
644
644
|
* @param field 字段名
|
|
645
645
|
* @param row 行数据
|
|
646
646
|
*/
|
|
647
|
-
static setId = (r,
|
|
648
|
-
|
|
649
|
-
const
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
let
|
|
653
|
-
|
|
654
|
-
}), o
|
|
647
|
+
static setId = (r, s, c) => {
|
|
648
|
+
s[r] || (s[r] = []);
|
|
649
|
+
const o = M.config.table.rowKey;
|
|
650
|
+
s[r].forEach((t) => {
|
|
651
|
+
c.forEach((n) => {
|
|
652
|
+
let a = n.default ?? "";
|
|
653
|
+
n.type === "number" && (a = n.default ?? 0), n.type === "boolean" && (a = n.default ?? !1), n.type === "time" && (a = n.default ?? /* @__PURE__ */ new Date()), t[n.value] === void 0 && (t[n.value] = a);
|
|
654
|
+
}), t[o] || (t[o] = H.getIdFun());
|
|
655
655
|
});
|
|
656
656
|
};
|
|
657
657
|
/**
|
|
@@ -661,19 +661,19 @@ class H {
|
|
|
661
661
|
* @param itemFields 元素字段-如:[{label:'',value:''}]
|
|
662
662
|
* @param callback 回调函数
|
|
663
663
|
*/
|
|
664
|
-
static add = (r,
|
|
665
|
-
const
|
|
666
|
-
H.setId(r,
|
|
667
|
-
const
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
(
|
|
671
|
-
let
|
|
672
|
-
return i.type === "number" && (
|
|
664
|
+
static add = (r, s, c, o) => {
|
|
665
|
+
const t = JSONUtil.cp(c);
|
|
666
|
+
H.setId(r, s, c);
|
|
667
|
+
const n = M.config.table.rowKey;
|
|
668
|
+
s[r].push(
|
|
669
|
+
t.reduce(
|
|
670
|
+
(a, i) => {
|
|
671
|
+
let m = i.default ?? "";
|
|
672
|
+
return i.type === "number" && (m = i.default ?? 0), i.type === "boolean" && (m = i.default ?? !1), i.type === "time" && (m = i.default ?? /* @__PURE__ */ new Date()), a[i.value] = m, a;
|
|
673
673
|
},
|
|
674
|
-
{ [
|
|
674
|
+
{ [n]: H.getIdFun() }
|
|
675
675
|
)
|
|
676
|
-
),
|
|
676
|
+
), o?.(s);
|
|
677
677
|
};
|
|
678
678
|
/**
|
|
679
679
|
* 删除数组元素
|
|
@@ -682,9 +682,9 @@ class H {
|
|
|
682
682
|
* @param item 元素-如:{_id:''}
|
|
683
683
|
* @param callback 回调函数
|
|
684
684
|
*/
|
|
685
|
-
static remove = (r,
|
|
686
|
-
const
|
|
687
|
-
|
|
685
|
+
static remove = (r, s, c, o) => {
|
|
686
|
+
const t = M.config.table.rowKey;
|
|
687
|
+
s[r] = s[r].filter((n) => n[t] !== c[t]), o?.(s);
|
|
688
688
|
};
|
|
689
689
|
/**
|
|
690
690
|
* 获取没有id的数据
|
|
@@ -692,11 +692,11 @@ class H {
|
|
|
692
692
|
* @param childernField 子级字段-如:list、children
|
|
693
693
|
* @returns 没有id的数据
|
|
694
694
|
*/
|
|
695
|
-
static getNoIdData = (r,
|
|
696
|
-
const
|
|
697
|
-
return
|
|
698
|
-
o
|
|
699
|
-
}),
|
|
695
|
+
static getNoIdData = (r, s) => {
|
|
696
|
+
const c = JSONUtil.cp(r), o = M.config.table.rowKey;
|
|
697
|
+
return c.forEach((t) => {
|
|
698
|
+
t[o] && delete t[o], s && t[s] && H.getNoIdData(t[s], s);
|
|
699
|
+
}), c;
|
|
700
700
|
};
|
|
701
701
|
}
|
|
702
702
|
const je = {
|
|
@@ -745,81 +745,81 @@ const je = {
|
|
|
745
745
|
},
|
|
746
746
|
emits: ["change"],
|
|
747
747
|
setup(e, { emit: r }) {
|
|
748
|
-
const
|
|
748
|
+
const s = e, c = ce({
|
|
749
749
|
show: !1,
|
|
750
|
-
add: (
|
|
751
|
-
H.add(
|
|
752
|
-
|
|
750
|
+
add: (t, n, a) => {
|
|
751
|
+
H.add(t, n, a, () => {
|
|
752
|
+
o("change");
|
|
753
753
|
});
|
|
754
754
|
},
|
|
755
|
-
remove: (
|
|
756
|
-
H.remove(
|
|
757
|
-
|
|
755
|
+
remove: (t, n, a) => {
|
|
756
|
+
H.remove(t, n, a, () => {
|
|
757
|
+
o("change");
|
|
758
758
|
});
|
|
759
759
|
}
|
|
760
760
|
});
|
|
761
761
|
ye(() => {
|
|
762
|
-
H.setId(
|
|
762
|
+
H.setId(s.field, s.row, s.itemFields), c.show = !0;
|
|
763
763
|
});
|
|
764
|
-
const
|
|
765
|
-
return (
|
|
766
|
-
const
|
|
767
|
-
return
|
|
768
|
-
|
|
769
|
-
e.addBottom ?
|
|
770
|
-
E(
|
|
764
|
+
const o = r;
|
|
765
|
+
return (t, n) => {
|
|
766
|
+
const a = te("el-button"), i = te("el-input");
|
|
767
|
+
return c.show ? (d(), b("div", je, [
|
|
768
|
+
x(t.$slots, "list-start", { row: e.row }),
|
|
769
|
+
e.addBottom ? C("", !0) : (d(), b("div", Le, [
|
|
770
|
+
E(a, {
|
|
771
771
|
link: "",
|
|
772
772
|
type: "primary",
|
|
773
|
-
onClick:
|
|
773
|
+
onClick: n[0] || (n[0] = (m) => c.add(e.field, e.row, e.itemFields))
|
|
774
774
|
}, {
|
|
775
|
-
default: g(() => [...
|
|
775
|
+
default: g(() => [...n[3] || (n[3] = [
|
|
776
776
|
O("添加", -1)
|
|
777
777
|
])]),
|
|
778
778
|
_: 1
|
|
779
779
|
})
|
|
780
780
|
])),
|
|
781
|
-
(
|
|
782
|
-
|
|
783
|
-
item:
|
|
781
|
+
(d(!0), b($, null, A(e.row[e.field], (m) => (d(), b("div", Be, [
|
|
782
|
+
x(t.$slots, "item-start", {
|
|
783
|
+
item: m,
|
|
784
784
|
row: e.row
|
|
785
785
|
}),
|
|
786
|
-
(
|
|
787
|
-
modelValue:
|
|
788
|
-
"onUpdate:modelValue": (
|
|
786
|
+
(d(!0), b($, null, A(e.itemFields, (u) => (d(), y(i, {
|
|
787
|
+
modelValue: m[u.value],
|
|
788
|
+
"onUpdate:modelValue": (w) => m[u.value] = w,
|
|
789
789
|
style: ge({ width: e.inputWidth }),
|
|
790
790
|
class: R(e.inputClass),
|
|
791
|
-
placeholder:
|
|
792
|
-
onChange:
|
|
791
|
+
placeholder: u[e.label] || u[e.value],
|
|
792
|
+
onChange: n[1] || (n[1] = (w) => o("change"))
|
|
793
793
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "style", "class", "placeholder"]))), 256)),
|
|
794
|
-
|
|
795
|
-
item:
|
|
794
|
+
x(t.$slots, "item-end", {
|
|
795
|
+
item: m,
|
|
796
796
|
row: e.row
|
|
797
797
|
}),
|
|
798
|
-
E(
|
|
798
|
+
E(a, {
|
|
799
799
|
link: "",
|
|
800
800
|
type: "danger",
|
|
801
|
-
onClick: (
|
|
801
|
+
onClick: (u) => c.remove(e.field, e.row, m)
|
|
802
802
|
}, {
|
|
803
|
-
default: g(() => [...
|
|
803
|
+
default: g(() => [...n[4] || (n[4] = [
|
|
804
804
|
O("删除", -1)
|
|
805
805
|
])]),
|
|
806
806
|
_: 1
|
|
807
807
|
}, 8, ["onClick"])
|
|
808
808
|
]))), 256)),
|
|
809
|
-
e.addBottom ? (
|
|
810
|
-
E(
|
|
809
|
+
e.addBottom ? (d(), b("div", Re, [
|
|
810
|
+
E(a, {
|
|
811
811
|
link: "",
|
|
812
812
|
type: "primary",
|
|
813
|
-
onClick:
|
|
813
|
+
onClick: n[2] || (n[2] = (m) => c.add(e.field, e.row, e.itemFields))
|
|
814
814
|
}, {
|
|
815
|
-
default: g(() => [...
|
|
815
|
+
default: g(() => [...n[5] || (n[5] = [
|
|
816
816
|
O("添加", -1)
|
|
817
817
|
])]),
|
|
818
818
|
_: 1
|
|
819
819
|
})
|
|
820
|
-
])) :
|
|
821
|
-
|
|
822
|
-
])) :
|
|
820
|
+
])) : C("", !0),
|
|
821
|
+
x(t.$slots, "list-end", { row: e.row })
|
|
822
|
+
])) : C("", !0);
|
|
823
823
|
};
|
|
824
824
|
}
|
|
825
825
|
}), Ie = {
|
|
@@ -845,75 +845,72 @@ const je = {
|
|
|
845
845
|
}
|
|
846
846
|
},
|
|
847
847
|
setup(e, { expose: r }) {
|
|
848
|
-
const
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
} catch {
|
|
852
|
-
}
|
|
853
|
-
const t = ce({
|
|
848
|
+
const s = D.isFun, c = D.EDialog, o = J(), t = e, n = we.getConf();
|
|
849
|
+
n?.formRef?.set("formRef-" + StrUtil.getId(), o);
|
|
850
|
+
const a = ce({
|
|
854
851
|
rules: {},
|
|
855
852
|
show: !0,
|
|
856
853
|
form: {},
|
|
857
854
|
formDefault: {},
|
|
858
|
-
type:
|
|
855
|
+
type: t.type || n?.update?.type || c.Add,
|
|
859
856
|
formColumn: [],
|
|
860
|
-
getDisabled: (
|
|
861
|
-
if (
|
|
862
|
-
return
|
|
863
|
-
const
|
|
864
|
-
return D.isFun(
|
|
857
|
+
getDisabled: (i) => {
|
|
858
|
+
if (a.type === c.View)
|
|
859
|
+
return i.disabled?.view === void 0 ? !0 : D.isFun(i.disabled?.view, a.form);
|
|
860
|
+
const m = i.disabled?.[a.type === c.Add ? "create" : "update"];
|
|
861
|
+
return D.isFun(m, a.form);
|
|
865
862
|
},
|
|
866
|
-
getBind: (
|
|
867
|
-
getOn: (
|
|
868
|
-
getColumnSpan: (
|
|
869
|
-
if (
|
|
870
|
-
const
|
|
871
|
-
return (
|
|
863
|
+
getBind: (i) => i.options?.[a.type === c.Add ? "formAdd" : "formUpdate"]?.[i.type] || i.options?.[i.type] || {},
|
|
864
|
+
getOn: (i) => i.options?.[a.type === c.Add ? "formAdd" : "formUpdate"]?.[i.type]?.on || i.options?.[i.type]?.on || {},
|
|
865
|
+
getColumnSpan: (i, m) => {
|
|
866
|
+
if (i.item.form?.spanCol) {
|
|
867
|
+
const u = t.option.form?.maxSpan || 12, w = t.option.form?.defaultSpan || u / 2, h = m.filter((p) => !D.isFun(p.item.show?.form, a.form, a.type)).reduce((p, k) => p + (k.item.form?.span || w), 0);
|
|
868
|
+
return (i.item.form?.span || w) + h;
|
|
872
869
|
}
|
|
873
|
-
return
|
|
870
|
+
return i.item.form?.span;
|
|
874
871
|
},
|
|
875
872
|
initColumnForm: () => {
|
|
876
|
-
const
|
|
877
|
-
|
|
878
|
-
const
|
|
879
|
-
let
|
|
880
|
-
const
|
|
881
|
-
if (
|
|
882
|
-
|
|
883
|
-
|
|
873
|
+
const i = t.option;
|
|
874
|
+
a.formColumn = [], a.rules = {}, a.formDefault = {};
|
|
875
|
+
const m = [], u = t.option.form?.maxSpan || 12, w = t.option.form?.defaultSpan || u / 2;
|
|
876
|
+
let f = [];
|
|
877
|
+
const h = (k) => {
|
|
878
|
+
if (k.children) {
|
|
879
|
+
k.children.forEach((F) => {
|
|
880
|
+
h(F);
|
|
884
881
|
});
|
|
885
882
|
return;
|
|
886
883
|
}
|
|
887
|
-
if (
|
|
888
|
-
|
|
889
|
-
const
|
|
890
|
-
if (
|
|
891
|
-
const
|
|
892
|
-
input:
|
|
893
|
-
select:
|
|
894
|
-
},
|
|
895
|
-
|
|
884
|
+
if (a.formDefault[k.key] = k.value, k.isForm && (typeof k.show?.form != "boolean" || k.show?.form)) {
|
|
885
|
+
k.form = k.form || { span: w }, k.form.span = k.form.span ?? w;
|
|
886
|
+
const F = k.form.span, B = f.reduce((I, N) => I + N.span, F), L = f.length;
|
|
887
|
+
if (f.push({ item: k, span: F }), (L === 1 && f[0].span === 0 || B >= u || F === 0 && L > 1) && (m.push(f), f = []), k.rules) {
|
|
888
|
+
const I = {
|
|
889
|
+
input: v.tCurd("placeholderInput"),
|
|
890
|
+
select: v.tCurd("placeholderSelect")
|
|
891
|
+
}, N = (I[k.type] || I.input) + k.label;
|
|
892
|
+
a.rules[k.key] = typeof k.rules == "boolean" ? [
|
|
896
893
|
{
|
|
897
894
|
required: !0,
|
|
898
|
-
message:
|
|
895
|
+
message: N,
|
|
899
896
|
trigger: "blur"
|
|
900
897
|
}
|
|
901
|
-
] :
|
|
898
|
+
] : k.rules;
|
|
902
899
|
}
|
|
903
900
|
}
|
|
904
|
-
}, p = (
|
|
905
|
-
|
|
901
|
+
}, p = (k, F) => {
|
|
902
|
+
k.isForm = F, Array.isArray(k.children) && k.children.forEach((B) => p(B, F));
|
|
906
903
|
};
|
|
907
|
-
|
|
908
|
-
p(
|
|
909
|
-
}),
|
|
904
|
+
i.column.forEach((k) => {
|
|
905
|
+
p(k, !0), h(k);
|
|
906
|
+
}), f.length > 0 && m.push(f), a.formColumn = m, a.type === c.Add ? a.form = JSONUtil.cp(a.formDefault) : a.form = JSONUtil.cp(t.form);
|
|
910
907
|
}
|
|
911
908
|
});
|
|
912
|
-
return
|
|
913
|
-
() =>
|
|
914
|
-
(
|
|
915
|
-
Object.keys(
|
|
916
|
-
|
|
909
|
+
return a.initColumnForm(), t.form && re(
|
|
910
|
+
() => a.form,
|
|
911
|
+
(i) => {
|
|
912
|
+
Object.keys(a.form).forEach((m) => {
|
|
913
|
+
t.form[m] = a.form[m];
|
|
917
914
|
});
|
|
918
915
|
},
|
|
919
916
|
{
|
|
@@ -921,156 +918,156 @@ const je = {
|
|
|
921
918
|
immediate: !0
|
|
922
919
|
}
|
|
923
920
|
), r({
|
|
924
|
-
ref:
|
|
925
|
-
conf:
|
|
926
|
-
}), (
|
|
921
|
+
ref: o,
|
|
922
|
+
conf: a
|
|
923
|
+
}), (i, m) => (d(), y(l(Q), {
|
|
927
924
|
ref_key: "ruleFormRef",
|
|
928
|
-
ref:
|
|
929
|
-
model:
|
|
930
|
-
rules:
|
|
925
|
+
ref: o,
|
|
926
|
+
model: a.form,
|
|
927
|
+
rules: a.rules
|
|
931
928
|
}, {
|
|
932
929
|
default: g(() => [
|
|
933
|
-
|
|
934
|
-
l(
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
) ? (
|
|
930
|
+
a.show ? (d(!0), b($, { key: 0 }, A(a.formColumn, (u, w) => (d(), b($, { key: w }, [
|
|
931
|
+
l(s)(
|
|
932
|
+
u.map((f) => f.item?.show?.form),
|
|
933
|
+
a.form,
|
|
934
|
+
a.type
|
|
935
|
+
) ? (d(), b("div", {
|
|
939
936
|
key: 0,
|
|
940
937
|
class: R(["row curd-row", {
|
|
941
938
|
stripe: e.option.form?.stripe === void 0 ? !0 : e.option.form?.stripe
|
|
942
939
|
}])
|
|
943
940
|
}, [
|
|
944
|
-
|
|
945
|
-
row:
|
|
941
|
+
x(i.$slots, "form-start", {
|
|
942
|
+
row: a.form
|
|
946
943
|
}),
|
|
947
|
-
(
|
|
948
|
-
key:
|
|
944
|
+
(d(!0), b($, null, A(u, (f) => (d(), b($, {
|
|
945
|
+
key: f.item.key
|
|
949
946
|
}, [
|
|
950
|
-
l(
|
|
947
|
+
l(s)(f.item.show?.form, a.form, a.type) ? (d(), b("div", {
|
|
951
948
|
key: 0,
|
|
952
|
-
class: R([
|
|
949
|
+
class: R([f.item.form.span > 0 ? `col-${a.getColumnSpan(f, u)}` : "col", `form-item-col-${f.item.key}`])
|
|
953
950
|
}, [
|
|
954
|
-
E(l(
|
|
955
|
-
label:
|
|
956
|
-
prop:
|
|
957
|
-
"label-width":
|
|
951
|
+
E(l(le), {
|
|
952
|
+
label: f.item.text?.form?.label ?? f.item.label,
|
|
953
|
+
prop: f.item.key,
|
|
954
|
+
"label-width": f.item.text?.form?.label == "" ? 0 : f.item.form?.labelWidth || e.option.form?.labelWidth || "100px"
|
|
958
955
|
}, {
|
|
959
956
|
default: g(() => [
|
|
960
957
|
U("div", Ie, [
|
|
961
|
-
|
|
962
|
-
row:
|
|
963
|
-
item:
|
|
958
|
+
x(i.$slots, "form-" + f.item.key + "-start", {
|
|
959
|
+
row: a.form,
|
|
960
|
+
item: f.item
|
|
964
961
|
}),
|
|
965
962
|
U("div", Pe, [
|
|
966
963
|
U("div", He, [
|
|
967
|
-
|
|
968
|
-
row:
|
|
969
|
-
item:
|
|
964
|
+
x(i.$slots, "form-" + f.item.key, {
|
|
965
|
+
row: a.form,
|
|
966
|
+
item: f.item
|
|
970
967
|
}, () => [
|
|
971
|
-
|
|
968
|
+
f.item.type === "input" ? (d(), y(l(ee), V({
|
|
972
969
|
key: 0,
|
|
973
|
-
modelValue:
|
|
974
|
-
"onUpdate:modelValue": (
|
|
975
|
-
}, { ref_for: !0 },
|
|
976
|
-
disabled:
|
|
977
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
970
|
+
modelValue: a.form[f.item.key],
|
|
971
|
+
"onUpdate:modelValue": (h) => a.form[f.item.key] = h
|
|
972
|
+
}, { ref_for: !0 }, a.getBind(f.item), z(a.getOn(f.item)), {
|
|
973
|
+
disabled: a.getDisabled(f.item)
|
|
974
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : f.item.type === "switch" ? (d(), y(l(Z), V({
|
|
978
975
|
key: 1,
|
|
979
|
-
modelValue:
|
|
980
|
-
"onUpdate:modelValue": (
|
|
981
|
-
}, { ref_for: !0 },
|
|
982
|
-
disabled:
|
|
983
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
976
|
+
modelValue: a.form[f.item.key],
|
|
977
|
+
"onUpdate:modelValue": (h) => a.form[f.item.key] = h
|
|
978
|
+
}, { ref_for: !0 }, a.getBind(f.item), z(a.getOn(f.item)), {
|
|
979
|
+
disabled: a.getDisabled(f.item)
|
|
980
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : f.item.type === "select" ? (d(), y(l(X), V({
|
|
984
981
|
key: 2,
|
|
985
|
-
modelValue:
|
|
986
|
-
"onUpdate:modelValue": (
|
|
987
|
-
}, { ref_for: !0 },
|
|
988
|
-
disabled:
|
|
982
|
+
modelValue: a.form[f.item.key],
|
|
983
|
+
"onUpdate:modelValue": (h) => a.form[f.item.key] = h
|
|
984
|
+
}, { ref_for: !0 }, a.getBind(f.item), z(a.getOn(f.item)), {
|
|
985
|
+
disabled: a.getDisabled(f.item),
|
|
989
986
|
style: { width: "100%" }
|
|
990
987
|
}), {
|
|
991
988
|
default: g(() => [
|
|
992
|
-
(
|
|
993
|
-
key:
|
|
994
|
-
label:
|
|
995
|
-
value:
|
|
989
|
+
(d(!0), b($, null, A(f.item.options?.select?.data, (h) => (d(), y(l(W), {
|
|
990
|
+
key: h.value,
|
|
991
|
+
label: h.label,
|
|
992
|
+
value: h.value
|
|
996
993
|
}, null, 8, ["label", "value"]))), 128))
|
|
997
994
|
]),
|
|
998
995
|
_: 2
|
|
999
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
996
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : f.item.type === "radio" ? (d(), y(l(de), V({
|
|
1000
997
|
key: 3,
|
|
1001
|
-
modelValue:
|
|
1002
|
-
"onUpdate:modelValue": (
|
|
1003
|
-
}, { ref_for: !0 },
|
|
1004
|
-
disabled:
|
|
998
|
+
modelValue: a.form[f.item.key],
|
|
999
|
+
"onUpdate:modelValue": (h) => a.form[f.item.key] = h
|
|
1000
|
+
}, { ref_for: !0 }, a.getBind(f.item), z(a.getOn(f.item)), {
|
|
1001
|
+
disabled: a.getDisabled(f.item),
|
|
1005
1002
|
style: { width: "100%" }
|
|
1006
1003
|
}), {
|
|
1007
1004
|
default: g(() => [
|
|
1008
|
-
(
|
|
1009
|
-
key:
|
|
1010
|
-
label:
|
|
1011
|
-
value:
|
|
1005
|
+
(d(!0), b($, null, A(f.item.options?.radio?.data, (h) => (d(), y(l(se), {
|
|
1006
|
+
key: h.value,
|
|
1007
|
+
label: h.label,
|
|
1008
|
+
value: h.value
|
|
1012
1009
|
}, null, 8, ["label", "value"]))), 128))
|
|
1013
1010
|
]),
|
|
1014
1011
|
_: 2
|
|
1015
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
1012
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : f.item.type === "list" ? (d(), y(fe, V({
|
|
1016
1013
|
key: 4,
|
|
1017
|
-
row:
|
|
1018
|
-
field:
|
|
1019
|
-
}, { ref_for: !0 },
|
|
1020
|
-
disabled:
|
|
1014
|
+
row: a.form,
|
|
1015
|
+
field: f.item.key
|
|
1016
|
+
}, { ref_for: !0 }, a.getBind(f.item), z(a.getOn(f.item)), {
|
|
1017
|
+
disabled: a.getDisabled(f.item),
|
|
1021
1018
|
style: { width: "100%" }
|
|
1022
|
-
}), null, 16, ["row", "field", "disabled"])) :
|
|
1019
|
+
}), null, 16, ["row", "field", "disabled"])) : f.item.type === "treeSelect" ? (d(), y(l(pe), V({
|
|
1023
1020
|
key: 5,
|
|
1024
|
-
modelValue:
|
|
1025
|
-
"onUpdate:modelValue": (
|
|
1026
|
-
}, { ref_for: !0 },
|
|
1027
|
-
disabled:
|
|
1021
|
+
modelValue: a.form[f.item.key],
|
|
1022
|
+
"onUpdate:modelValue": (h) => a.form[f.item.key] = h
|
|
1023
|
+
}, { ref_for: !0 }, a.getBind(f.item), z(a.getOn(f.item)), {
|
|
1024
|
+
disabled: a.getDisabled(f.item),
|
|
1028
1025
|
style: { width: "100%" }
|
|
1029
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
1026
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : f.item.type === "datetime" ? (d(), y(l(ue), V({
|
|
1030
1027
|
key: 6,
|
|
1031
|
-
modelValue:
|
|
1032
|
-
"onUpdate:modelValue": (
|
|
1033
|
-
}, { ref_for: !0 },
|
|
1034
|
-
disabled:
|
|
1035
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
1028
|
+
modelValue: a.form[f.item.key],
|
|
1029
|
+
"onUpdate:modelValue": (h) => a.form[f.item.key] = h
|
|
1030
|
+
}, { ref_for: !0 }, a.getBind(f.item), z(a.getOn(f.item)), {
|
|
1031
|
+
disabled: a.getDisabled(f.item)
|
|
1032
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : f.item.type && (l(j).customComponent[f.item.type] || l(j).customComponent[f.item.type]?.form) ? (d(), y(q(l(j).customComponent[f.item.type]?.form || l(j).customComponent[f.item.type]), V({
|
|
1036
1033
|
key: 7,
|
|
1037
|
-
modelValue:
|
|
1038
|
-
"onUpdate:modelValue": (
|
|
1039
|
-
}, { ref_for: !0 },
|
|
1040
|
-
disabled:
|
|
1041
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
1034
|
+
modelValue: a.form[f.item.key],
|
|
1035
|
+
"onUpdate:modelValue": (h) => a.form[f.item.key] = h
|
|
1036
|
+
}, { ref_for: !0 }, a.getBind(f.item), z(a.getOn(f.item)), {
|
|
1037
|
+
disabled: a.getDisabled(f.item)
|
|
1038
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : C("", !0)
|
|
1042
1039
|
]),
|
|
1043
|
-
|
|
1044
|
-
row:
|
|
1045
|
-
item:
|
|
1040
|
+
x(i.$slots, "form-" + f.item.key + "-right", {
|
|
1041
|
+
row: a.form,
|
|
1042
|
+
item: f.item
|
|
1046
1043
|
})
|
|
1047
1044
|
]),
|
|
1048
|
-
|
|
1049
|
-
row:
|
|
1050
|
-
item:
|
|
1045
|
+
x(i.$slots, "form-" + f.item.key + "-tip", {
|
|
1046
|
+
row: a.form,
|
|
1047
|
+
item: f.item
|
|
1051
1048
|
}, () => [
|
|
1052
|
-
|
|
1049
|
+
f.item.form?.tipText ? (d(), b("div", {
|
|
1053
1050
|
key: 0,
|
|
1054
1051
|
class: "form-tip-text",
|
|
1055
|
-
innerHTML: typeof
|
|
1056
|
-
}, null, 8, Ke)) :
|
|
1052
|
+
innerHTML: typeof f.item.form?.tipText == "function" ? f.item.form?.tipText(a.form, a.type) : f.item.form?.tipText
|
|
1053
|
+
}, null, 8, Ke)) : C("", !0)
|
|
1057
1054
|
])
|
|
1058
1055
|
]),
|
|
1059
|
-
|
|
1060
|
-
row:
|
|
1061
|
-
item:
|
|
1056
|
+
x(i.$slots, "form-" + f.item.key + "-end", {
|
|
1057
|
+
row: a.form,
|
|
1058
|
+
item: f.item
|
|
1062
1059
|
})
|
|
1063
1060
|
])
|
|
1064
1061
|
]),
|
|
1065
1062
|
_: 2
|
|
1066
1063
|
}, 1032, ["label", "prop", "label-width"])
|
|
1067
|
-
], 2)) :
|
|
1064
|
+
], 2)) : C("", !0)
|
|
1068
1065
|
], 64))), 128)),
|
|
1069
|
-
|
|
1070
|
-
row:
|
|
1066
|
+
x(i.$slots, "form-end", {
|
|
1067
|
+
row: a.form
|
|
1071
1068
|
})
|
|
1072
|
-
], 2)) :
|
|
1073
|
-
], 64))), 128)) :
|
|
1069
|
+
], 2)) : C("", !0)
|
|
1070
|
+
], 64))), 128)) : C("", !0)
|
|
1074
1071
|
]),
|
|
1075
1072
|
_: 3
|
|
1076
1073
|
}, 8, ["model", "rules"]));
|
|
@@ -1084,26 +1081,26 @@ class We {
|
|
|
1084
1081
|
* @param columns - 列配置数组,需包含 `key`(数据字段)和 `label`(Excel 表头)
|
|
1085
1082
|
* @param fileName - 文件名(不含扩展名),支持字符串或返回字符串的函数;默认生成「导出数据_日期_时间戳」
|
|
1086
1083
|
*/
|
|
1087
|
-
static exportToExcel = async (r,
|
|
1084
|
+
static exportToExcel = async (r, s, c) => {
|
|
1088
1085
|
if (!r || r.length === 0) return;
|
|
1089
|
-
const
|
|
1090
|
-
const
|
|
1091
|
-
return
|
|
1092
|
-
|
|
1093
|
-
}),
|
|
1094
|
-
}),
|
|
1095
|
-
|
|
1086
|
+
const o = await D.loadModule("xlsx"), t = r.map((i) => {
|
|
1087
|
+
const m = {};
|
|
1088
|
+
return s.forEach((u) => {
|
|
1089
|
+
m[u.label] = i[u.key];
|
|
1090
|
+
}), m;
|
|
1091
|
+
}), n = o.utils.json_to_sheet(t), a = o.utils.book_new();
|
|
1092
|
+
o.utils.book_append_sheet(a, n, "Sheet1"), c ? typeof c == "function" && (c = c()) : c = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, o.writeFile(a, `${c}.xlsx`);
|
|
1096
1093
|
};
|
|
1097
1094
|
}
|
|
1098
|
-
class
|
|
1095
|
+
class _ {
|
|
1099
1096
|
/**
|
|
1100
1097
|
* 删除对象所有属性
|
|
1101
1098
|
* @param obj 对象
|
|
1102
1099
|
* @returns
|
|
1103
1100
|
*/
|
|
1104
1101
|
static delAllKey = (r) => {
|
|
1105
|
-
Object.keys(r).forEach((
|
|
1106
|
-
delete r[
|
|
1102
|
+
Object.keys(r).forEach((s) => {
|
|
1103
|
+
delete r[s];
|
|
1107
1104
|
});
|
|
1108
1105
|
};
|
|
1109
1106
|
/**
|
|
@@ -1113,30 +1110,32 @@ class Z {
|
|
|
1113
1110
|
* @param delAll 是否删除目标对象所有属性
|
|
1114
1111
|
* @returns
|
|
1115
1112
|
*/
|
|
1116
|
-
static setValue = (r,
|
|
1117
|
-
|
|
1118
|
-
r[
|
|
1113
|
+
static setValue = (r, s, c = !1) => {
|
|
1114
|
+
c && _.delAllKey(r), Object.keys(s).forEach((o) => {
|
|
1115
|
+
r[o] !== s[o] && (r[o] = s[o]);
|
|
1119
1116
|
});
|
|
1120
1117
|
};
|
|
1121
1118
|
}
|
|
1122
1119
|
const P = D.EDialog, Je = (e) => {
|
|
1123
|
-
const r =
|
|
1120
|
+
const r = J(), s = J(), c = J(), o = ce({
|
|
1124
1121
|
/** 需要控制的表单对象引用集合,提交时统一进行校验触发 */
|
|
1125
1122
|
formRef: {
|
|
1126
1123
|
map: {},
|
|
1127
|
-
set(
|
|
1128
|
-
|
|
1124
|
+
set(t, n) {
|
|
1125
|
+
o.formRef.map[t] = n;
|
|
1129
1126
|
},
|
|
1130
|
-
validate: () => new Promise(async (
|
|
1127
|
+
validate: () => new Promise(async (t, n) => {
|
|
1131
1128
|
try {
|
|
1132
|
-
const
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
t(
|
|
1129
|
+
const a = Object.keys(o.formRef.map);
|
|
1130
|
+
await Promise.all(
|
|
1131
|
+
a.map(
|
|
1132
|
+
(i) => o.formRef.map[i]?.validate(async (m, u) => new Promise((w, f) => {
|
|
1133
|
+
m || f(!1), w(!0);
|
|
1134
|
+
}))
|
|
1135
|
+
)
|
|
1136
|
+
), t(!0);
|
|
1137
|
+
} catch (a) {
|
|
1138
|
+
n(a);
|
|
1140
1139
|
}
|
|
1141
1140
|
})
|
|
1142
1141
|
},
|
|
@@ -1153,28 +1152,28 @@ const P = D.EDialog, Je = (e) => {
|
|
|
1153
1152
|
/** 搜索表单默认值 */
|
|
1154
1153
|
formDefault: {},
|
|
1155
1154
|
/** 获取占位符 */
|
|
1156
|
-
getPlaceholder: (
|
|
1155
|
+
getPlaceholder: (t, n = v.tCurd("placeholderInput")) => t.text?.search?.placeholder === void 0 ? `${n}${t.label}` : t.text?.search?.placeholder,
|
|
1157
1156
|
/** 组装实际要搜索的数据对象 */
|
|
1158
1157
|
getFormData: () => {
|
|
1159
|
-
let
|
|
1160
|
-
e.option.column.forEach((
|
|
1161
|
-
(typeof
|
|
1158
|
+
let t = {};
|
|
1159
|
+
e.option.column.forEach((a) => {
|
|
1160
|
+
(typeof a.show?.search == "function" ? a.show?.search(o.search.form) : a.show?.search) && (t[a.key] = o.search.form[a.key]);
|
|
1162
1161
|
});
|
|
1163
|
-
const
|
|
1164
|
-
return
|
|
1162
|
+
const n = e.option.search?.before?.(t);
|
|
1163
|
+
return n && (t = n), t;
|
|
1165
1164
|
},
|
|
1166
1165
|
/** 重置搜索表单 */
|
|
1167
1166
|
reset: () => {
|
|
1168
|
-
const
|
|
1169
|
-
Object.keys(
|
|
1170
|
-
e.option.search?.resetMode === "none" ?
|
|
1167
|
+
const t = o.search.formDefault;
|
|
1168
|
+
Object.keys(t).forEach((a) => {
|
|
1169
|
+
e.option.search?.resetMode === "none" ? t[a] = void 0 : t[a] = o.search.formDefault[a];
|
|
1171
1170
|
});
|
|
1172
|
-
const
|
|
1173
|
-
|
|
1171
|
+
const n = ObjectUtil.deepMerge(t, {});
|
|
1172
|
+
_.setValue(o.search.form, n, !0), o.page.num = 1, e.option.init !== !1 && o.table.getList();
|
|
1174
1173
|
},
|
|
1175
1174
|
/** 提交搜索表单 */
|
|
1176
1175
|
submit: () => {
|
|
1177
|
-
|
|
1176
|
+
o.page.num = 1, o.table.getList();
|
|
1178
1177
|
}
|
|
1179
1178
|
},
|
|
1180
1179
|
/** 分页区域相关配置对象 */
|
|
@@ -1194,10 +1193,10 @@ const P = D.EDialog, Je = (e) => {
|
|
|
1194
1193
|
/** 分页器计数 */
|
|
1195
1194
|
pagerCount: e.option.page?.pagerCount || M.config.pagination.pagerCount,
|
|
1196
1195
|
/** 获取分页查询参数 */
|
|
1197
|
-
getQuery: (
|
|
1198
|
-
[M.config.field.page.size]:
|
|
1199
|
-
[M.config.field.page.num]:
|
|
1200
|
-
...
|
|
1196
|
+
getQuery: (t = {}) => ({
|
|
1197
|
+
[M.config.field.page.size]: t.size || o.page.size,
|
|
1198
|
+
[M.config.field.page.num]: t.num || o.page.num,
|
|
1199
|
+
...o.search.getFormData()
|
|
1201
1200
|
})
|
|
1202
1201
|
},
|
|
1203
1202
|
/** 表格区域相关配置对象 */
|
|
@@ -1205,7 +1204,7 @@ const P = D.EDialog, Je = (e) => {
|
|
|
1205
1204
|
/** 操作列相关配置 */
|
|
1206
1205
|
op: {
|
|
1207
1206
|
/** 动态计算操作列宽度 */
|
|
1208
|
-
width: (...
|
|
1207
|
+
width: (...t) => t.filter((a) => a).length * 30 + 60
|
|
1209
1208
|
},
|
|
1210
1209
|
/** 表格加载中状态 */
|
|
1211
1210
|
loading: !1,
|
|
@@ -1218,22 +1217,22 @@ const P = D.EDialog, Je = (e) => {
|
|
|
1218
1217
|
/** 已经展开的行key集合 */
|
|
1219
1218
|
rowKeys: [],
|
|
1220
1219
|
/** 行展开触发变更函数 */
|
|
1221
|
-
change: (
|
|
1220
|
+
change: (t, n) => {
|
|
1222
1221
|
},
|
|
1223
1222
|
/** 全部展开/收起 */
|
|
1224
1223
|
all: () => {
|
|
1225
|
-
if (
|
|
1226
|
-
|
|
1224
|
+
if (o.table.expand.isExpand)
|
|
1225
|
+
o.table.expand.rowKeys = [];
|
|
1227
1226
|
else {
|
|
1228
|
-
const
|
|
1229
|
-
let
|
|
1230
|
-
return
|
|
1231
|
-
|
|
1232
|
-
}),
|
|
1227
|
+
const t = (n) => {
|
|
1228
|
+
let a = [];
|
|
1229
|
+
return n.forEach((i) => {
|
|
1230
|
+
a.push(i[e.option.table.rowKey]), i.children && i.children.length > 0 && (a = a.concat(t(i.children)));
|
|
1231
|
+
}), a;
|
|
1233
1232
|
};
|
|
1234
|
-
|
|
1233
|
+
o.table.expand.rowKeys = t(o.table.data);
|
|
1235
1234
|
}
|
|
1236
|
-
|
|
1235
|
+
o.table.expand.isExpand = !o.table.expand.isExpand;
|
|
1237
1236
|
}
|
|
1238
1237
|
},
|
|
1239
1238
|
/** 表格列相关配置 */
|
|
@@ -1255,47 +1254,47 @@ const P = D.EDialog, Je = (e) => {
|
|
|
1255
1254
|
expand: !1,
|
|
1256
1255
|
/** 全部展开/收起主分组 */
|
|
1257
1256
|
toggleExpandAll: () => {
|
|
1258
|
-
const
|
|
1259
|
-
|
|
1260
|
-
const
|
|
1261
|
-
|
|
1262
|
-
i.table?.header?.group !== void 0 && (i.table.header.group = !
|
|
1257
|
+
const t = !o.table.header.group.expand;
|
|
1258
|
+
o.table.header.group.expand = t;
|
|
1259
|
+
const n = (a) => {
|
|
1260
|
+
a.forEach((i) => {
|
|
1261
|
+
i.table?.header?.group !== void 0 && (i.table.header.group = !t), i.table?.header?.groupKey !== void 0 && (i.table.header.show = t), Array.isArray(i.children) && i.children.length > 0 && n(i.children);
|
|
1263
1262
|
});
|
|
1264
1263
|
};
|
|
1265
|
-
|
|
1264
|
+
n(o.table.column.list);
|
|
1266
1265
|
}
|
|
1267
1266
|
}
|
|
1268
1267
|
},
|
|
1269
1268
|
/** 获取数据列表接口实现 */
|
|
1270
1269
|
getList: async () => {
|
|
1271
|
-
|
|
1272
|
-
const
|
|
1270
|
+
o.table.loading = !0;
|
|
1271
|
+
const t = e.option.api.list, n = JSONUtil.cp(o.table.selection.list);
|
|
1273
1272
|
try {
|
|
1274
|
-
await
|
|
1275
|
-
let
|
|
1276
|
-
if (
|
|
1277
|
-
const { props:
|
|
1278
|
-
|
|
1279
|
-
[
|
|
1280
|
-
[
|
|
1273
|
+
await o.initApiData("init");
|
|
1274
|
+
let a = {};
|
|
1275
|
+
if (o.table.sort.prop) {
|
|
1276
|
+
const { props: k, order: F } = M.config.table.sort;
|
|
1277
|
+
a = {
|
|
1278
|
+
[k.field]: o.table.sort.prop,
|
|
1279
|
+
[F.field]: o.table.sort.order
|
|
1281
1280
|
};
|
|
1282
1281
|
}
|
|
1283
|
-
const i = await
|
|
1284
|
-
...
|
|
1285
|
-
...
|
|
1286
|
-
}),
|
|
1287
|
-
let
|
|
1288
|
-
const
|
|
1289
|
-
const
|
|
1290
|
-
|
|
1291
|
-
}),
|
|
1292
|
-
|
|
1293
|
-
|
|
1282
|
+
const i = await t({
|
|
1283
|
+
...o.page.getQuery(),
|
|
1284
|
+
...a
|
|
1285
|
+
}), m = M.config.field.result, u = i.data || { [m.list]: i };
|
|
1286
|
+
let w = (Array.isArray(u[m.list]), u[m.list]);
|
|
1287
|
+
const f = o.update.formColumn.flat(), p = ObjectUtil.deepMerge({ data: w }, {}).data.map((k) => (Object.keys(k).forEach((B) => {
|
|
1288
|
+
const L = f.find((I) => I.item.key === B);
|
|
1289
|
+
L && ["select", "radio"].includes(L.item.type) && (L.item.table.format || (L.item.table.format = (I) => L.item.options[L.item.type].data?.find((N) => N.value == I[B])?.label || I[B]));
|
|
1290
|
+
}), k));
|
|
1291
|
+
o.table.data = e.option.data ? await e.option.data(p, w) : p, o.page.total = u[m.total] || 0, setTimeout(() => {
|
|
1292
|
+
o.table.selection.setList(n);
|
|
1294
1293
|
}, 20);
|
|
1295
|
-
} catch (
|
|
1296
|
-
console.error(
|
|
1294
|
+
} catch (a) {
|
|
1295
|
+
console.error(a);
|
|
1297
1296
|
} finally {
|
|
1298
|
-
|
|
1297
|
+
o.table.loading = !1;
|
|
1299
1298
|
}
|
|
1300
1299
|
},
|
|
1301
1300
|
/** 表格多选相关配置 */
|
|
@@ -1303,39 +1302,39 @@ const P = D.EDialog, Je = (e) => {
|
|
|
1303
1302
|
/** 已选数据项 */
|
|
1304
1303
|
list: [],
|
|
1305
1304
|
/** 选中状态回调 */
|
|
1306
|
-
change: (
|
|
1307
|
-
|
|
1305
|
+
change: (t) => {
|
|
1306
|
+
o.table.selection.list = t;
|
|
1308
1307
|
},
|
|
1309
1308
|
/** 设置表格多选数据 */
|
|
1310
|
-
setList: (
|
|
1311
|
-
|
|
1312
|
-
const
|
|
1313
|
-
if (
|
|
1314
|
-
const i = e.option.table?.rowKey,
|
|
1315
|
-
const
|
|
1316
|
-
for (const
|
|
1309
|
+
setList: (t, n) => {
|
|
1310
|
+
o.table.selection.list = [];
|
|
1311
|
+
const a = c.value;
|
|
1312
|
+
if (a?.clearSelection(), !a || !t?.length) return;
|
|
1313
|
+
const i = e.option.table?.rowKey, m = (u) => {
|
|
1314
|
+
const w = (f) => {
|
|
1315
|
+
for (const h of f) {
|
|
1317
1316
|
if (i != null && i !== "") {
|
|
1318
|
-
if (
|
|
1319
|
-
} else if (
|
|
1320
|
-
return
|
|
1321
|
-
if (Array.isArray(
|
|
1322
|
-
const
|
|
1323
|
-
if (
|
|
1317
|
+
if (h[i] === u[i]) return h;
|
|
1318
|
+
} else if (h === u)
|
|
1319
|
+
return h;
|
|
1320
|
+
if (Array.isArray(h.children) && h.children.length) {
|
|
1321
|
+
const p = w(h.children);
|
|
1322
|
+
if (p !== void 0) return p;
|
|
1324
1323
|
}
|
|
1325
1324
|
}
|
|
1326
1325
|
};
|
|
1327
|
-
return
|
|
1326
|
+
return w(o.table.data);
|
|
1328
1327
|
};
|
|
1329
|
-
|
|
1330
|
-
const
|
|
1331
|
-
if (
|
|
1332
|
-
if (
|
|
1333
|
-
const
|
|
1334
|
-
|
|
1328
|
+
t.forEach((u) => {
|
|
1329
|
+
const w = m(u);
|
|
1330
|
+
if (w)
|
|
1331
|
+
if (n) {
|
|
1332
|
+
const f = () => {
|
|
1333
|
+
a.toggleRowSelection(w, !0, !1);
|
|
1335
1334
|
};
|
|
1336
|
-
|
|
1335
|
+
n(u) !== !1 && f();
|
|
1337
1336
|
} else
|
|
1338
|
-
|
|
1337
|
+
a.toggleRowSelection(w, !0, !1);
|
|
1339
1338
|
});
|
|
1340
1339
|
}
|
|
1341
1340
|
},
|
|
@@ -1346,14 +1345,14 @@ const P = D.EDialog, Je = (e) => {
|
|
|
1346
1345
|
/** 当前排序顺序值 */
|
|
1347
1346
|
order: "",
|
|
1348
1347
|
/** 排序变更回调 */
|
|
1349
|
-
change: (
|
|
1350
|
-
M.config.table.sort.resetPage && (
|
|
1351
|
-
const
|
|
1352
|
-
if (
|
|
1353
|
-
|
|
1348
|
+
change: (t) => {
|
|
1349
|
+
M.config.table.sort.resetPage && (o.page.num = 1);
|
|
1350
|
+
const n = M.config.table.sort;
|
|
1351
|
+
if (n.change) {
|
|
1352
|
+
n.change(t, o);
|
|
1354
1353
|
return;
|
|
1355
1354
|
}
|
|
1356
|
-
|
|
1355
|
+
o.table.sort.prop = t.prop, t.order === null ? (o.table.sort.order = "", o.table.sort.prop = "") : o.table.sort.order = t.order === "ascending" ? n.order.asc : n.order.desc, o.table.getList();
|
|
1357
1356
|
}
|
|
1358
1357
|
}
|
|
1359
1358
|
},
|
|
@@ -1362,85 +1361,85 @@ const P = D.EDialog, Je = (e) => {
|
|
|
1362
1361
|
/** 导出逻辑方法集合 */
|
|
1363
1362
|
run: {
|
|
1364
1363
|
/** 执行指定方式的导出(如select、page、all) */
|
|
1365
|
-
start: async (
|
|
1366
|
-
let
|
|
1364
|
+
start: async (t) => {
|
|
1365
|
+
let n = await o.export.run[t](), a = e.option.column;
|
|
1367
1366
|
const i = ObjectUtil.deepMerge(
|
|
1368
1367
|
{
|
|
1369
|
-
data:
|
|
1370
|
-
columns:
|
|
1368
|
+
data: n,
|
|
1369
|
+
columns: a
|
|
1371
1370
|
},
|
|
1372
1371
|
{}
|
|
1373
|
-
),
|
|
1374
|
-
|
|
1372
|
+
), m = e.option.tools?.export || {};
|
|
1373
|
+
m.before && m.before(i), We.exportToExcel(i.data, i.columns, m.fileName);
|
|
1375
1374
|
},
|
|
1376
1375
|
/** 获取当前选中项进行导出 */
|
|
1377
1376
|
select: async () => {
|
|
1378
|
-
|
|
1377
|
+
o.export.loading = !0;
|
|
1379
1378
|
try {
|
|
1380
1379
|
if (e.option.tools?.export?.select) {
|
|
1381
1380
|
await e.option.tools?.export?.select({
|
|
1382
|
-
...
|
|
1383
|
-
items:
|
|
1381
|
+
...o.page.getQuery(),
|
|
1382
|
+
items: o.table.selection.list
|
|
1384
1383
|
});
|
|
1385
1384
|
return;
|
|
1386
1385
|
}
|
|
1387
|
-
if (
|
|
1388
|
-
throw D.fail(
|
|
1389
|
-
return
|
|
1390
|
-
} catch (
|
|
1391
|
-
console.error(
|
|
1386
|
+
if (o.table.selection.list.length === 0)
|
|
1387
|
+
throw D.fail(v.tCurd("selectDataToExport")), new Error(v.tCurd("selectDataToExport"));
|
|
1388
|
+
return o.table.selection.list;
|
|
1389
|
+
} catch (t) {
|
|
1390
|
+
console.error(t);
|
|
1392
1391
|
} finally {
|
|
1393
|
-
|
|
1392
|
+
o.export.loading = !1;
|
|
1394
1393
|
}
|
|
1395
1394
|
},
|
|
1396
1395
|
/** 导出当前页的数据 */
|
|
1397
1396
|
page: async () => {
|
|
1398
|
-
|
|
1397
|
+
o.export.loading = !0;
|
|
1399
1398
|
try {
|
|
1400
1399
|
if (e.option.tools?.export?.page) {
|
|
1401
1400
|
await e.option.tools?.export?.page({
|
|
1402
|
-
...
|
|
1401
|
+
...o.page.getQuery()
|
|
1403
1402
|
});
|
|
1404
1403
|
return;
|
|
1405
1404
|
}
|
|
1406
|
-
if (
|
|
1407
|
-
throw D.fail(
|
|
1408
|
-
return
|
|
1409
|
-
} catch (
|
|
1410
|
-
console.error(
|
|
1405
|
+
if (o.table.data.length === 0)
|
|
1406
|
+
throw D.fail(v.tCurd("noData")), new Error(v.tCurd("noData"));
|
|
1407
|
+
return o.table.data;
|
|
1408
|
+
} catch (t) {
|
|
1409
|
+
console.error(t);
|
|
1411
1410
|
} finally {
|
|
1412
|
-
|
|
1411
|
+
o.export.loading = !1;
|
|
1413
1412
|
}
|
|
1414
1413
|
},
|
|
1415
1414
|
/** 导出所有数据 */
|
|
1416
1415
|
all: async () => {
|
|
1417
|
-
|
|
1416
|
+
o.export.loading = !0;
|
|
1418
1417
|
try {
|
|
1419
1418
|
if (e.option.tools?.export?.all) {
|
|
1420
1419
|
await e.option.tools?.export?.all({
|
|
1421
|
-
...
|
|
1420
|
+
...o.page.getQuery()
|
|
1422
1421
|
});
|
|
1423
1422
|
return;
|
|
1424
1423
|
}
|
|
1425
|
-
const
|
|
1426
|
-
...
|
|
1424
|
+
const t = e.option.api.list, n = await t({
|
|
1425
|
+
...o.page.getQuery({
|
|
1427
1426
|
size: 999999,
|
|
1428
1427
|
num: 1
|
|
1429
1428
|
})
|
|
1430
1429
|
});
|
|
1431
|
-
return (
|
|
1432
|
-
} catch (
|
|
1433
|
-
console.error(
|
|
1430
|
+
return (n.data || { [M.config.field.result.list]: n })[M.config.field.result.list];
|
|
1431
|
+
} catch (t) {
|
|
1432
|
+
console.error(t);
|
|
1434
1433
|
} finally {
|
|
1435
|
-
|
|
1434
|
+
o.export.loading = !1;
|
|
1436
1435
|
}
|
|
1437
1436
|
}
|
|
1438
1437
|
},
|
|
1439
1438
|
/** 导出时loading状态 */
|
|
1440
1439
|
loading: !1,
|
|
1441
1440
|
/** 执行导出操作的触发函数 */
|
|
1442
|
-
click: (
|
|
1443
|
-
|
|
1441
|
+
click: (t) => {
|
|
1442
|
+
o.export.loading || o.export.run.start(t);
|
|
1444
1443
|
}
|
|
1445
1444
|
},
|
|
1446
1445
|
/** 表单增删改弹窗相关对象 */
|
|
@@ -1464,34 +1463,34 @@ const P = D.EDialog, Je = (e) => {
|
|
|
1464
1463
|
/** 表单所有列,二维数组结构按行分组 */
|
|
1465
1464
|
formColumn: [],
|
|
1466
1465
|
/** 判断是否禁用当前字段 */
|
|
1467
|
-
getDisabled: (
|
|
1468
|
-
if (e.option.table?.editMode &&
|
|
1469
|
-
return
|
|
1470
|
-
if (
|
|
1471
|
-
return
|
|
1472
|
-
const
|
|
1473
|
-
return D.isFun(
|
|
1466
|
+
getDisabled: (t, n = !1) => {
|
|
1467
|
+
if (e.option.table?.editMode && n)
|
|
1468
|
+
return t.disabled?.table === void 0 ? !1 : D.isFun(t.disabled?.table, o.update.form);
|
|
1469
|
+
if (o.update.type === P.View)
|
|
1470
|
+
return t.disabled?.view === void 0 ? !0 : D.isFun(t.disabled?.view, o.update.form);
|
|
1471
|
+
const a = t.disabled?.[o.update.type === P.Add ? "create" : "update"];
|
|
1472
|
+
return D.isFun(a, o.update.form);
|
|
1474
1473
|
},
|
|
1475
1474
|
/** 获取表单组件绑定属性 */
|
|
1476
|
-
getBind: (
|
|
1475
|
+
getBind: (t) => t.options?.[o.update.type === P.Add ? "formAdd" : "formUpdate"]?.[t.type] || t.options?.[t.type] || {},
|
|
1477
1476
|
/** 获取表单组件事件属性 */
|
|
1478
|
-
getOn: (
|
|
1479
|
-
const i =
|
|
1480
|
-
return Object.keys(i).forEach((
|
|
1481
|
-
const
|
|
1482
|
-
typeof
|
|
1483
|
-
return
|
|
1484
|
-
} :
|
|
1485
|
-
}),
|
|
1477
|
+
getOn: (t, n) => {
|
|
1478
|
+
const i = t.options?.[o.update.type === P.Add ? "formAdd" : "formUpdate"]?.[t.type]?.on || t.options?.[t.type]?.on || {}, m = {};
|
|
1479
|
+
return Object.keys(i).forEach((u) => {
|
|
1480
|
+
const w = i[u];
|
|
1481
|
+
typeof w == "function" ? m[u] = function(...f) {
|
|
1482
|
+
return w.apply(this, [...f, n || o.update.form, t]);
|
|
1483
|
+
} : m[u] = w;
|
|
1484
|
+
}), m;
|
|
1486
1485
|
},
|
|
1487
1486
|
/** 获取表单组件绑定属性和事件 */
|
|
1488
|
-
getOptions: (
|
|
1487
|
+
getOptions: (t) => {
|
|
1489
1488
|
try {
|
|
1490
|
-
const
|
|
1491
|
-
return
|
|
1492
|
-
options:
|
|
1489
|
+
const a = o.update.formColumn.flat().find((i) => i.item.key === t)?.item;
|
|
1490
|
+
return a ? {
|
|
1491
|
+
options: a.options,
|
|
1493
1492
|
// @ts-ignore
|
|
1494
|
-
bind:
|
|
1493
|
+
bind: o.update.getBind(a)
|
|
1495
1494
|
} : { options: {}, bind: {} };
|
|
1496
1495
|
} catch {
|
|
1497
1496
|
return { options: {}, bind: {} };
|
|
@@ -1502,30 +1501,30 @@ const P = D.EDialog, Je = (e) => {
|
|
|
1502
1501
|
/** 当前编辑的数据原始项对象 */
|
|
1503
1502
|
data: {},
|
|
1504
1503
|
/** 返回编辑时与原值的变更数据,用于局部更新API */
|
|
1505
|
-
getApiData: (
|
|
1504
|
+
getApiData: (t) => {
|
|
1506
1505
|
if (e.option.form?.editAll)
|
|
1507
|
-
return
|
|
1508
|
-
let
|
|
1509
|
-
[e.option.table?.rowKey]:
|
|
1506
|
+
return t;
|
|
1507
|
+
let n = {
|
|
1508
|
+
[e.option.table?.rowKey]: o.update.edit.data[e.option.table?.rowKey]
|
|
1510
1509
|
};
|
|
1511
|
-
return Object.keys(
|
|
1512
|
-
|
|
1513
|
-
}),
|
|
1510
|
+
return Object.keys(o.update.edit.data).forEach((a) => {
|
|
1511
|
+
t[a] !== o.update.edit.data[a] && (n[a] = t[a]);
|
|
1512
|
+
}), n;
|
|
1514
1513
|
}
|
|
1515
1514
|
},
|
|
1516
1515
|
view: {},
|
|
1517
1516
|
/** 打开增改弹窗 */
|
|
1518
|
-
open: (
|
|
1519
|
-
|
|
1517
|
+
open: (t, n) => {
|
|
1518
|
+
o.update.showContent || FunUtil.throttle(async () => {
|
|
1520
1519
|
D.loading(!0);
|
|
1521
1520
|
try {
|
|
1522
|
-
|
|
1523
|
-
const
|
|
1524
|
-
|
|
1525
|
-
const i = ObjectUtil.deepMerge(
|
|
1526
|
-
|
|
1527
|
-
} catch (
|
|
1528
|
-
console.error(
|
|
1521
|
+
o.update.type = t;
|
|
1522
|
+
const a = t === P.Add;
|
|
1523
|
+
o.update.edit.data = n, o.update.title = v.tCurd(a ? "add" : t === P.View ? "view" : "edit");
|
|
1524
|
+
const i = ObjectUtil.deepMerge(a ? o.update.formDefault : n, {});
|
|
1525
|
+
_.setValue(o.update.form, i, !0), await o.initApiData("update"), await e.option.form?.openBefore?.(o.update.form, o.update), (!e.option.table?.inlineEdit || a) && (o.update.show = !0, o.update.showContent = !0), e.option.form?.openAfter?.(o.update.form, o.update);
|
|
1526
|
+
} catch (a) {
|
|
1527
|
+
console.error(a);
|
|
1529
1528
|
} finally {
|
|
1530
1529
|
D.loading(!1);
|
|
1531
1530
|
}
|
|
@@ -1536,57 +1535,57 @@ const P = D.EDialog, Je = (e) => {
|
|
|
1536
1535
|
FunUtil.throttle(async () => {
|
|
1537
1536
|
try {
|
|
1538
1537
|
await Promise.all([
|
|
1539
|
-
|
|
1540
|
-
i ||
|
|
1538
|
+
s.value?.validate(async (i, m) => new Promise((u, w) => {
|
|
1539
|
+
i || w(!1), u();
|
|
1541
1540
|
})),
|
|
1542
|
-
|
|
1541
|
+
o.formRef.validate()
|
|
1543
1542
|
]);
|
|
1544
1543
|
} catch {
|
|
1545
|
-
D.fail(
|
|
1544
|
+
D.fail(v.tCurd("checkFormData"));
|
|
1546
1545
|
return;
|
|
1547
1546
|
}
|
|
1548
1547
|
e.form && Object.keys(e.form).forEach((i) => {
|
|
1549
|
-
|
|
1550
|
-
}),
|
|
1551
|
-
const
|
|
1548
|
+
o.update.form[i] = e.form[i];
|
|
1549
|
+
}), o.update.loading = !0;
|
|
1550
|
+
const t = o.update.type === P.Add ? e.option.api.create : e.option.api.update;
|
|
1552
1551
|
try {
|
|
1553
|
-
await e.option.form?.submitBefore?.(
|
|
1552
|
+
await e.option.form?.submitBefore?.(o.update.form, o.update);
|
|
1554
1553
|
} catch {
|
|
1555
|
-
|
|
1554
|
+
o.update.loading = !1;
|
|
1556
1555
|
return;
|
|
1557
1556
|
}
|
|
1558
|
-
let
|
|
1559
|
-
delete
|
|
1560
|
-
const
|
|
1561
|
-
Object.keys(
|
|
1562
|
-
if (
|
|
1563
|
-
const
|
|
1564
|
-
isNaN(
|
|
1557
|
+
let n = ObjectUtil.deepMerge(o.update.form, {});
|
|
1558
|
+
delete n.children;
|
|
1559
|
+
const a = new Set(e.option.column.filter((i) => i.type === "datetime").map((i) => i.key));
|
|
1560
|
+
Object.keys(n).forEach((i) => {
|
|
1561
|
+
if (a.has(i) && n[i] != null) {
|
|
1562
|
+
const m = new Date(n[i]).getTime();
|
|
1563
|
+
isNaN(m) || (n[i] = m);
|
|
1565
1564
|
}
|
|
1566
1565
|
});
|
|
1567
1566
|
try {
|
|
1568
|
-
if (!
|
|
1569
|
-
await
|
|
1570
|
-
...
|
|
1571
|
-
}),
|
|
1567
|
+
if (!t) return;
|
|
1568
|
+
await t({
|
|
1569
|
+
...n
|
|
1570
|
+
}), o.update.close(), await o.table.getList(), e.option.form?.submitAfter?.(n, o.update);
|
|
1572
1571
|
} catch (i) {
|
|
1573
1572
|
console.error(i);
|
|
1574
1573
|
} finally {
|
|
1575
|
-
|
|
1574
|
+
o.update.loading = !1;
|
|
1576
1575
|
}
|
|
1577
1576
|
});
|
|
1578
1577
|
},
|
|
1579
1578
|
/** 关闭弹窗和内容 */
|
|
1580
1579
|
close: () => {
|
|
1581
|
-
|
|
1582
|
-
|
|
1580
|
+
o.update.show = !1, e.option.table?.inlineEdit && (o.update.form = {}), setTimeout(() => {
|
|
1581
|
+
o.update.showContent = !1;
|
|
1583
1582
|
}, 350);
|
|
1584
1583
|
}
|
|
1585
1584
|
},
|
|
1586
1585
|
/** 删除操作弹窗与数据对象 */
|
|
1587
1586
|
remove: {
|
|
1588
1587
|
/** 删除弹窗标题 */
|
|
1589
|
-
title:
|
|
1588
|
+
title: v.tCurd("deleteTitle"),
|
|
1590
1589
|
/** 删除弹窗显示控制 */
|
|
1591
1590
|
show: !1,
|
|
1592
1591
|
/** 待删除数据项集合 */
|
|
@@ -1595,74 +1594,74 @@ const P = D.EDialog, Je = (e) => {
|
|
|
1595
1594
|
loading: !1,
|
|
1596
1595
|
/** 关闭删除弹窗 */
|
|
1597
1596
|
close: () => {
|
|
1598
|
-
|
|
1597
|
+
o.remove.show = !1;
|
|
1599
1598
|
},
|
|
1600
1599
|
/** 打开删除弹窗并设置待删除项 */
|
|
1601
|
-
open: (
|
|
1602
|
-
if (
|
|
1603
|
-
D.fail(
|
|
1600
|
+
open: (t) => {
|
|
1601
|
+
if (t.length === 0) {
|
|
1602
|
+
D.fail(v.tCurd("selectDataToDelete"));
|
|
1604
1603
|
return;
|
|
1605
1604
|
}
|
|
1606
|
-
|
|
1605
|
+
o.remove.items = t, o.remove.show = !0;
|
|
1607
1606
|
},
|
|
1608
1607
|
/** 执行删除实际操作 */
|
|
1609
1608
|
submit: () => {
|
|
1610
1609
|
FunUtil.throttle(async () => {
|
|
1611
|
-
|
|
1612
|
-
const
|
|
1610
|
+
o.remove.loading = !0;
|
|
1611
|
+
const t = e.option.api.delete;
|
|
1613
1612
|
try {
|
|
1614
|
-
if (!
|
|
1615
|
-
await
|
|
1616
|
-
[e.option.table?.rowKey]:
|
|
1617
|
-
items:
|
|
1618
|
-
}), D.success(
|
|
1619
|
-
} catch (
|
|
1620
|
-
console.error(
|
|
1613
|
+
if (!t) return;
|
|
1614
|
+
await t({
|
|
1615
|
+
[e.option.table?.rowKey]: o.remove.items.map((n) => n[e.option.table?.rowKey]),
|
|
1616
|
+
items: o.remove.items
|
|
1617
|
+
}), D.success(v.tCurd("operationSuccess")), o.table.data.length <= 1 && o.page.num > 1 && (o.page.num -= 1), o.remove.close(), await o.table.getList();
|
|
1618
|
+
} catch (n) {
|
|
1619
|
+
console.error(n);
|
|
1621
1620
|
} finally {
|
|
1622
|
-
|
|
1621
|
+
o.remove.loading = !1;
|
|
1623
1622
|
}
|
|
1624
1623
|
});
|
|
1625
1624
|
}
|
|
1626
1625
|
},
|
|
1627
1626
|
/** 初始化curd关联所有默认与依赖配置及表单列 */
|
|
1628
1627
|
init: () => {
|
|
1629
|
-
|
|
1628
|
+
o.initCurdConfig(), o.initColumnOptions(), o.initColumnForm();
|
|
1630
1629
|
},
|
|
1631
1630
|
/** 下拉请求等数据缓存 */
|
|
1632
1631
|
apiDataMap: {},
|
|
1633
1632
|
/** 获取并绑定curd中所有下拉数据等远程依赖 */
|
|
1634
|
-
initApiData: async (
|
|
1635
|
-
const
|
|
1633
|
+
initApiData: async (t) => {
|
|
1634
|
+
const n = [], a = (i) => {
|
|
1636
1635
|
if (i.children && i.children.length) {
|
|
1637
|
-
i.children.forEach((
|
|
1636
|
+
i.children.forEach((m) => a(m));
|
|
1638
1637
|
return;
|
|
1639
1638
|
}
|
|
1640
|
-
if (i.options?.[i.type]?.dataApi && i.options?.[i.type]?.dataApiConfig?.[
|
|
1641
|
-
if (
|
|
1642
|
-
const
|
|
1639
|
+
if (i.options?.[i.type]?.dataApi && i.options?.[i.type]?.dataApiConfig?.[t]) {
|
|
1640
|
+
if (o.apiDataMap[i.key] && i.options?.[i.type]?.dataApiConfig?.once) return;
|
|
1641
|
+
const m = (async () => {
|
|
1643
1642
|
try {
|
|
1644
|
-
let
|
|
1645
|
-
if (
|
|
1646
|
-
const
|
|
1647
|
-
!Array.isArray(
|
|
1643
|
+
let u = await i.options?.[i.type]?.dataApi?.(o.update.form, o.update.type);
|
|
1644
|
+
if (u) {
|
|
1645
|
+
const w = i.options?.[i.type]?.dataPath;
|
|
1646
|
+
!Array.isArray(u) && w && (u = ObjectUtil.getPathValue(u, w)), i.options[i.type].data = u, i.options.search[i.type].data = u, i.options.search[i.options.search.type ?? i.type] || (i.options.search[i.options.search.type ?? i.type] = {}), i.options.search[i.options.search.type ?? i.type].data = u, i.options.formAdd[i.type].data = u, i.options.formUpdate[i.type].data = u, o.apiDataMap[i.key] = u;
|
|
1648
1647
|
}
|
|
1649
1648
|
} catch {
|
|
1650
1649
|
}
|
|
1651
1650
|
})();
|
|
1652
|
-
|
|
1651
|
+
n.push(m);
|
|
1653
1652
|
}
|
|
1654
1653
|
};
|
|
1655
1654
|
return e.option.column.forEach((i) => {
|
|
1656
|
-
|
|
1657
|
-
}), await Promise.all(
|
|
1655
|
+
a(i);
|
|
1656
|
+
}), await Promise.all(n), !0;
|
|
1658
1657
|
},
|
|
1659
1658
|
/** 初始化curd配置(option默认值合并等) */
|
|
1660
1659
|
initCurdConfig: () => {
|
|
1661
|
-
const
|
|
1662
|
-
|
|
1663
|
-
const
|
|
1664
|
-
Object.keys(
|
|
1665
|
-
e.option[
|
|
1660
|
+
const t = ObjectUtil.deepMerge(M.config, {});
|
|
1661
|
+
t.table.emptyText = v.tCurd("noData"), e.option.size = e.option.size || {}, t.table.size = e.option.size.table || t.size.table, t.form.size = e.option.size.form || t.size.form, t.size.search = e.option.size.search || t.size.search;
|
|
1662
|
+
const n = ObjectUtil.deepMerge(t, e.option || {});
|
|
1663
|
+
Object.keys(n).forEach((a) => {
|
|
1664
|
+
e.option[a] = n[a];
|
|
1666
1665
|
});
|
|
1667
1666
|
},
|
|
1668
1667
|
/**
|
|
@@ -1671,144 +1670,144 @@ const P = D.EDialog, Je = (e) => {
|
|
|
1671
1670
|
* @returns
|
|
1672
1671
|
*/
|
|
1673
1672
|
initColumnOptions: () => {
|
|
1674
|
-
let
|
|
1675
|
-
|
|
1673
|
+
let t = JSONUtil.cp(M.config.columnConfig);
|
|
1674
|
+
t.options = ObjectUtil.deepMerge(
|
|
1676
1675
|
{
|
|
1677
1676
|
switch: {
|
|
1678
|
-
activeText:
|
|
1679
|
-
inactiveText:
|
|
1677
|
+
activeText: v.tCurd("switchOn"),
|
|
1678
|
+
inactiveText: v.tCurd("switchOff")
|
|
1680
1679
|
}
|
|
1681
1680
|
},
|
|
1682
|
-
|
|
1681
|
+
t.options
|
|
1683
1682
|
);
|
|
1684
|
-
const
|
|
1685
|
-
for (const i in
|
|
1683
|
+
const n = (a) => {
|
|
1684
|
+
for (const i in t) {
|
|
1686
1685
|
if (i === "table") {
|
|
1687
|
-
if (
|
|
1688
|
-
|
|
1689
|
-
|
|
1686
|
+
if (a.table = ObjectUtil.deepMerge(t.table, a.table || {}), a.children) {
|
|
1687
|
+
a.children.forEach((u) => {
|
|
1688
|
+
n(u);
|
|
1690
1689
|
});
|
|
1691
1690
|
return;
|
|
1692
1691
|
}
|
|
1693
|
-
} else i === "type" ?
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
}),
|
|
1692
|
+
} else i === "type" ? a.type = a.type || t.type : a[i] = ObjectUtil.deepMerge(t[i], a[i] || {});
|
|
1693
|
+
a.options = a.options || {}, a.options[a.type] = a.options[a.type] || {}, a.options[a.type].size = e.option.size.form, ["search", "formAdd", "formUpdate"].forEach((u) => {
|
|
1694
|
+
a.options[u] = a.options[u] || ObjectUtil.deepMerge(a.options, {}), a.options[u][a.type] = a.options[u][a.type] || {}, a.options[u][a.type].size = u === "search" ? e.option.size.search : e.option.size.form;
|
|
1695
|
+
}), a.table = ObjectUtil.deepMerge(a.table, a.options[a.type].table || {});
|
|
1697
1696
|
}
|
|
1698
|
-
|
|
1699
|
-
const
|
|
1697
|
+
a.type === "switch" && (a.options.switch.tableBeforeChange = async (i, m) => {
|
|
1698
|
+
const u = a.options?.switch;
|
|
1700
1699
|
try {
|
|
1701
|
-
|
|
1702
|
-
title:
|
|
1703
|
-
content:
|
|
1700
|
+
u.tableConfig?.confirm && await r.value?.open({
|
|
1701
|
+
title: v.tCurd("confirmModify"),
|
|
1702
|
+
content: v.tCurd("confirmSwitchMessage")
|
|
1704
1703
|
});
|
|
1705
1704
|
try {
|
|
1706
|
-
if (!e.option.api.update && !
|
|
1707
|
-
const
|
|
1708
|
-
|
|
1709
|
-
const
|
|
1710
|
-
if (!
|
|
1705
|
+
if (!e.option.api.update && !u.tableConfig?.api) return;
|
|
1706
|
+
const w = m[e.option.table?.rowKey];
|
|
1707
|
+
u.loadingMap || (u.loadingMap = {}), u.loadingMap[w] || (u.loadingMap[w] = { loading: !1 }), u.loadingMap[w].loading = !0;
|
|
1708
|
+
const f = m[i] === u.activeValue ? u.inactiveValue : u.activeValue, h = u.tableConfig?.api ? u.tableConfig.api : e.option.api.update;
|
|
1709
|
+
if (!h) return;
|
|
1711
1710
|
try {
|
|
1712
|
-
await
|
|
1711
|
+
await h(
|
|
1713
1712
|
{
|
|
1714
|
-
...
|
|
1715
|
-
[i]:
|
|
1713
|
+
...m,
|
|
1714
|
+
[i]: f
|
|
1716
1715
|
},
|
|
1717
1716
|
"switch"
|
|
1718
1717
|
);
|
|
1719
1718
|
} catch {
|
|
1720
1719
|
return !1;
|
|
1721
1720
|
} finally {
|
|
1722
|
-
|
|
1721
|
+
u.loadingMap[w].loading = !1;
|
|
1723
1722
|
}
|
|
1724
|
-
return D.success(
|
|
1725
|
-
} catch (
|
|
1726
|
-
return console.error(
|
|
1723
|
+
return D.success(v.tCurd("operationSuccess")), u.tableConfig?.loadList && (o.table.loading = !0, o.table.getList(), o.table.loading = !1), !0;
|
|
1724
|
+
} catch (w) {
|
|
1725
|
+
return console.error(w), !1;
|
|
1727
1726
|
} finally {
|
|
1728
|
-
|
|
1727
|
+
o.table.loading = !1;
|
|
1729
1728
|
}
|
|
1730
1729
|
} catch {
|
|
1731
1730
|
return !1;
|
|
1732
1731
|
}
|
|
1733
|
-
}),
|
|
1732
|
+
}), a.type === "treeSelect" && (a.options.treeSelect.rowKey = e.option.table?.rowKey, a.options.treeSelect.nodeKey = e.option.table?.rowKey);
|
|
1734
1733
|
};
|
|
1735
|
-
e.option.column.forEach(
|
|
1734
|
+
e.option.column.forEach(n), e.option.table?.column?.forEach(n);
|
|
1736
1735
|
},
|
|
1737
|
-
getColumnSpan: (
|
|
1738
|
-
if (
|
|
1739
|
-
const
|
|
1740
|
-
return (
|
|
1736
|
+
getColumnSpan: (t, n) => {
|
|
1737
|
+
if (t.item.form?.spanCol) {
|
|
1738
|
+
const a = M.config.form.defaultSpan, m = n.filter((u) => !D.isFun(u.item.show?.form, o.update.form, o.update.type)).reduce((u, w) => u + (w.item.form?.span || a), 0);
|
|
1739
|
+
return (t.item?.form.span || a) + m;
|
|
1741
1740
|
}
|
|
1742
|
-
return
|
|
1741
|
+
return t.item.form.span;
|
|
1743
1742
|
},
|
|
1744
1743
|
/** 初始化配置并生成表单列及默认值及规则 */
|
|
1745
1744
|
initColumnForm: () => {
|
|
1746
|
-
const
|
|
1747
|
-
|
|
1745
|
+
const t = e.option;
|
|
1746
|
+
o.update.formColumn = [], o.table.column.show = {
|
|
1748
1747
|
list: [],
|
|
1749
1748
|
listSource: []
|
|
1750
1749
|
};
|
|
1751
|
-
const
|
|
1752
|
-
let
|
|
1753
|
-
const
|
|
1754
|
-
if (
|
|
1755
|
-
|
|
1756
|
-
|
|
1750
|
+
const n = [], a = e.option.form?.maxSpan || 12, i = e.option.form?.defaultSpan || a / 2;
|
|
1751
|
+
let m = [];
|
|
1752
|
+
const u = (p) => {
|
|
1753
|
+
if (p.children) {
|
|
1754
|
+
o.table.column.show.list.push(p.key), p.children.forEach((k) => {
|
|
1755
|
+
u(k);
|
|
1757
1756
|
});
|
|
1758
1757
|
return;
|
|
1759
1758
|
}
|
|
1760
|
-
if (
|
|
1761
|
-
|
|
1762
|
-
let
|
|
1763
|
-
const B =
|
|
1764
|
-
if (
|
|
1765
|
-
const
|
|
1766
|
-
input:
|
|
1767
|
-
select:
|
|
1768
|
-
}, I = (
|
|
1759
|
+
if (o.update.formDefault[p.key] = p.value, p.table.table && (p.show.table && o.table.column.show.list.push(p.key), p.table.table && o.table.column.show.listSource.push(p.key)), !(p.isForm && typeof p.show?.form == "boolean") || p.show?.form) {
|
|
1760
|
+
p.form = p.form || { span: i }, p.form.span = p.form.span ?? i;
|
|
1761
|
+
let k = p.form.span, F = m.reduce((L, I) => L + I.span, k);
|
|
1762
|
+
const B = m.length;
|
|
1763
|
+
if (m.push({ item: p, span: k }), (B === 1 && m[0].span === 0 || F >= a || k === 0 && B > 1) && (n.push(m), m = []), p.rules) {
|
|
1764
|
+
const L = {
|
|
1765
|
+
input: v.tCurd("placeholderInput"),
|
|
1766
|
+
select: v.tCurd("placeholderSelect")
|
|
1767
|
+
}, I = (L[p.type] || L.input) + p.label, N = typeof p.rules == "boolean" ? [
|
|
1769
1768
|
{
|
|
1770
1769
|
required: !0,
|
|
1771
1770
|
message: I,
|
|
1772
1771
|
trigger: "blur"
|
|
1773
1772
|
}
|
|
1774
|
-
] :
|
|
1775
|
-
|
|
1776
|
-
if (
|
|
1777
|
-
const ke =
|
|
1773
|
+
] : p.rules;
|
|
1774
|
+
o.update.rules[p.key] = N.map((oe) => {
|
|
1775
|
+
if (oe.validator) {
|
|
1776
|
+
const ke = oe.validator;
|
|
1778
1777
|
return {
|
|
1779
|
-
...
|
|
1780
|
-
validator: (ve, Ce, Ve) => ke(ve, Ce, Ve,
|
|
1778
|
+
...oe,
|
|
1779
|
+
validator: (ve, Ce, Ve) => ke(ve, Ce, Ve, o.update.form)
|
|
1781
1780
|
};
|
|
1782
1781
|
}
|
|
1783
|
-
return
|
|
1782
|
+
return oe;
|
|
1784
1783
|
});
|
|
1785
1784
|
}
|
|
1786
1785
|
}
|
|
1787
|
-
},
|
|
1788
|
-
|
|
1786
|
+
}, w = (p, k) => {
|
|
1787
|
+
p.isForm = k, Array.isArray(p.children) && p.children.forEach((F) => w(F, k));
|
|
1789
1788
|
};
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
}), e.option.table?.column?.forEach((
|
|
1793
|
-
|
|
1794
|
-
}),
|
|
1795
|
-
const
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
}),
|
|
1799
|
-
|
|
1789
|
+
t.column.forEach((p) => {
|
|
1790
|
+
p.isForm = !0, w(p, !0), u(p);
|
|
1791
|
+
}), e.option.table?.column?.forEach((p) => {
|
|
1792
|
+
w(p, !1), u(p);
|
|
1793
|
+
}), o.search.column.list = t.column.concat(t.table?.column || []), o.table.column.list = o.search.column.list.filter((p) => p.table?.table), o.search.column.list.sort((p, k) => p.sort?.search - k.sort?.search), o.table.column.list.sort((p, k) => p.sort?.table - k.sort?.table), m.length > 0 && n.push(m), o.update.formColumn = n;
|
|
1794
|
+
const f = e.option.search?.formDefault;
|
|
1795
|
+
f && Object.keys(f).forEach((p) => {
|
|
1796
|
+
o.search.formDefault[p] = f[p];
|
|
1797
|
+
}), t.column.forEach((p) => {
|
|
1798
|
+
p.show?.search || (o.search.formDefault[p.key] = void 0);
|
|
1800
1799
|
});
|
|
1801
|
-
const
|
|
1802
|
-
|
|
1800
|
+
const h = ObjectUtil.deepMerge(o.search.formDefault, {});
|
|
1801
|
+
_.setValue(o.search.form, h, !0);
|
|
1803
1802
|
}
|
|
1804
1803
|
});
|
|
1805
|
-
return
|
|
1806
|
-
e.option.init !== !1 &&
|
|
1804
|
+
return o.init(), ye(() => {
|
|
1805
|
+
e.option.init !== !1 && o.table.getList();
|
|
1807
1806
|
}), e.form && re(
|
|
1808
|
-
() =>
|
|
1809
|
-
(
|
|
1810
|
-
Object.keys(
|
|
1811
|
-
e.form[
|
|
1807
|
+
() => o.update.form,
|
|
1808
|
+
(t) => {
|
|
1809
|
+
Object.keys(o.update.form).forEach((n) => {
|
|
1810
|
+
e.form[n] = o.update.form[n];
|
|
1812
1811
|
});
|
|
1813
1812
|
},
|
|
1814
1813
|
{
|
|
@@ -1816,58 +1815,58 @@ const P = D.EDialog, Je = (e) => {
|
|
|
1816
1815
|
immediate: !0
|
|
1817
1816
|
}
|
|
1818
1817
|
), e.searchForm && re(
|
|
1819
|
-
() =>
|
|
1820
|
-
(
|
|
1821
|
-
Object.keys(
|
|
1822
|
-
e.searchForm[
|
|
1818
|
+
() => o.search.form,
|
|
1819
|
+
(t) => {
|
|
1820
|
+
Object.keys(o.search.form).forEach((n) => {
|
|
1821
|
+
e.searchForm[n] = o.search.form[n];
|
|
1823
1822
|
});
|
|
1824
1823
|
},
|
|
1825
1824
|
{
|
|
1826
1825
|
deep: !0,
|
|
1827
1826
|
immediate: !0
|
|
1828
1827
|
}
|
|
1829
|
-
), we.setConf(
|
|
1828
|
+
), we.setConf(o), { conf: o, switchConfirmRef: r, ruleFormRef: s, tableRef: c };
|
|
1830
1829
|
}, qe = { class: "dialog-footer" }, Qe = /* @__PURE__ */ K({
|
|
1831
1830
|
__name: "switchConfirm",
|
|
1832
1831
|
props: {
|
|
1833
1832
|
size: {}
|
|
1834
1833
|
},
|
|
1835
1834
|
setup(e, { expose: r }) {
|
|
1836
|
-
const
|
|
1837
|
-
let
|
|
1838
|
-
const
|
|
1839
|
-
|
|
1835
|
+
const s = J(!1), c = J("确认修改"), o = J("确认要修改状态吗?");
|
|
1836
|
+
let t = null, n = null;
|
|
1837
|
+
const a = (u) => (u?.title && (c.value = u.title), u?.content && (o.value = u.content), s.value = !0, new Promise((w, f) => {
|
|
1838
|
+
t = w, n = f;
|
|
1840
1839
|
})), i = () => {
|
|
1841
|
-
|
|
1842
|
-
},
|
|
1843
|
-
|
|
1840
|
+
s.value = !1, t?.(!0), t = null, n = null;
|
|
1841
|
+
}, m = () => {
|
|
1842
|
+
s.value = !1, n?.(new Error("用户取消操作")), t = null, n = null;
|
|
1844
1843
|
};
|
|
1845
1844
|
return r({
|
|
1846
|
-
open:
|
|
1847
|
-
}), (
|
|
1848
|
-
const
|
|
1849
|
-
return
|
|
1850
|
-
modelValue:
|
|
1851
|
-
"onUpdate:modelValue":
|
|
1852
|
-
title:
|
|
1845
|
+
open: a
|
|
1846
|
+
}), (u, w) => {
|
|
1847
|
+
const f = te("el-form");
|
|
1848
|
+
return d(), y(l(ie), {
|
|
1849
|
+
modelValue: s.value,
|
|
1850
|
+
"onUpdate:modelValue": w[0] || (w[0] = (h) => s.value = h),
|
|
1851
|
+
title: c.value,
|
|
1853
1852
|
"close-on-click-modal": !1,
|
|
1854
1853
|
width: "400px"
|
|
1855
1854
|
}, {
|
|
1856
1855
|
footer: g(() => [
|
|
1857
|
-
E(
|
|
1856
|
+
E(f, { size: e.size }, {
|
|
1858
1857
|
default: g(() => [
|
|
1859
1858
|
U("span", qe, [
|
|
1860
|
-
E(l(
|
|
1861
|
-
default: g(() => [...
|
|
1859
|
+
E(l(T), { onClick: m }, {
|
|
1860
|
+
default: g(() => [...w[1] || (w[1] = [
|
|
1862
1861
|
O("取消", -1)
|
|
1863
1862
|
])]),
|
|
1864
1863
|
_: 1
|
|
1865
1864
|
}),
|
|
1866
|
-
E(l(
|
|
1865
|
+
E(l(T), {
|
|
1867
1866
|
type: "primary",
|
|
1868
1867
|
onClick: i
|
|
1869
1868
|
}, {
|
|
1870
|
-
default: g(() => [...
|
|
1869
|
+
default: g(() => [...w[2] || (w[2] = [
|
|
1871
1870
|
O("确认", -1)
|
|
1872
1871
|
])]),
|
|
1873
1872
|
_: 1
|
|
@@ -1878,40 +1877,40 @@ const P = D.EDialog, Je = (e) => {
|
|
|
1878
1877
|
}, 8, ["size"])
|
|
1879
1878
|
]),
|
|
1880
1879
|
default: g(() => [
|
|
1881
|
-
U("div", null, S(
|
|
1880
|
+
U("div", null, S(o.value), 1)
|
|
1882
1881
|
]),
|
|
1883
1882
|
_: 1
|
|
1884
1883
|
}, 8, ["modelValue", "title"]);
|
|
1885
1884
|
};
|
|
1886
1885
|
}
|
|
1887
|
-
}),
|
|
1888
|
-
const
|
|
1889
|
-
for (const [
|
|
1890
|
-
|
|
1891
|
-
return
|
|
1886
|
+
}), Y = (e, r) => {
|
|
1887
|
+
const s = e.__vccOpts || e;
|
|
1888
|
+
for (const [c, o] of r)
|
|
1889
|
+
s[c] = o;
|
|
1890
|
+
return s;
|
|
1892
1891
|
}, Ge = {}, Xe = {
|
|
1893
1892
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1894
1893
|
viewBox: "0 0 1024 1024"
|
|
1895
1894
|
};
|
|
1896
1895
|
function Ye(e, r) {
|
|
1897
|
-
return
|
|
1896
|
+
return d(), b("svg", Xe, [...r[0] || (r[0] = [
|
|
1898
1897
|
U("path", {
|
|
1899
1898
|
fill: "currentColor",
|
|
1900
1899
|
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"
|
|
1901
1900
|
}, null, -1)
|
|
1902
1901
|
])]);
|
|
1903
1902
|
}
|
|
1904
|
-
const Ze = /* @__PURE__ */
|
|
1903
|
+
const Ze = /* @__PURE__ */ Y(Ge, [["render", Ye]]), _e = ["innerHTML"], et = /* @__PURE__ */ K({
|
|
1905
1904
|
__name: "text",
|
|
1906
1905
|
props: {
|
|
1907
1906
|
content: {},
|
|
1908
1907
|
value: {}
|
|
1909
1908
|
},
|
|
1910
1909
|
setup(e) {
|
|
1911
|
-
const r = e,
|
|
1912
|
-
return (
|
|
1910
|
+
const r = e, s = be(() => typeof r.content == "function" ? r.content(r.value) : r.content);
|
|
1911
|
+
return (c, o) => typeof s.value == "object" ? (d(), y(q(s.value), { key: 0 })) : (d(), b("div", {
|
|
1913
1912
|
key: 1,
|
|
1914
|
-
innerHTML:
|
|
1913
|
+
innerHTML: s.value
|
|
1915
1914
|
}, null, 8, _e));
|
|
1916
1915
|
}
|
|
1917
1916
|
}), tt = {}, ot = {
|
|
@@ -1920,40 +1919,40 @@ const Ze = /* @__PURE__ */ X(Ge, [["render", Ye]]), _e = ["innerHTML"], et = /*
|
|
|
1920
1919
|
viewBox: "0 0 1024 1024"
|
|
1921
1920
|
};
|
|
1922
1921
|
function at(e, r) {
|
|
1923
|
-
return
|
|
1922
|
+
return d(), b("svg", ot, [...r[0] || (r[0] = [
|
|
1924
1923
|
U("path", {
|
|
1925
1924
|
fill: "currentColor",
|
|
1926
1925
|
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"
|
|
1927
1926
|
}, null, -1)
|
|
1928
1927
|
])]);
|
|
1929
1928
|
}
|
|
1930
|
-
const lt = /* @__PURE__ */
|
|
1929
|
+
const lt = /* @__PURE__ */ Y(tt, [["render", at]]), nt = {}, it = {
|
|
1931
1930
|
"data-v-58697b5c": "",
|
|
1932
1931
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1933
1932
|
viewBox: "0 0 1024 1024"
|
|
1934
1933
|
};
|
|
1935
1934
|
function rt(e, r) {
|
|
1936
|
-
return
|
|
1935
|
+
return d(), b("svg", it, [...r[0] || (r[0] = [
|
|
1937
1936
|
U("path", {
|
|
1938
1937
|
fill: "currentColor",
|
|
1939
1938
|
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-38.4 409.6H326.4a38.4 38.4 0 1 0 0 76.8h147.2v147.2a38.4 38.4 0 0 0 76.8 0V550.4h147.2a38.4 38.4 0 0 0 0-76.8H550.4V326.4a38.4 38.4 0 1 0-76.8 0z"
|
|
1940
1939
|
}, null, -1)
|
|
1941
1940
|
])]);
|
|
1942
1941
|
}
|
|
1943
|
-
const dt = /* @__PURE__ */
|
|
1942
|
+
const dt = /* @__PURE__ */ Y(nt, [["render", rt]]), st = {}, ut = {
|
|
1944
1943
|
"data-v-58697b5c": "",
|
|
1945
1944
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1946
1945
|
viewBox: "0 0 1024 1024"
|
|
1947
1946
|
};
|
|
1948
1947
|
function ct(e, r) {
|
|
1949
|
-
return
|
|
1948
|
+
return d(), b("svg", ut, [...r[0] || (r[0] = [
|
|
1950
1949
|
U("path", {
|
|
1951
1950
|
fill: "currentColor",
|
|
1952
1951
|
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896M288 512a38.4 38.4 0 0 0 38.4 38.4h371.2a38.4 38.4 0 0 0 0-76.8H326.4A38.4 38.4 0 0 0 288 512"
|
|
1953
1952
|
}, null, -1)
|
|
1954
1953
|
])]);
|
|
1955
1954
|
}
|
|
1956
|
-
const ft = /* @__PURE__ */
|
|
1955
|
+
const ft = /* @__PURE__ */ Y(st, [["render", ct]]), mt = { class: "row flex-center table-header-label inline" }, ht = { class: "table-header-tooltip" }, pt = ["innerHTML"], yt = ["onClick"], gt = { key: 1 }, bt = ["onClick", "innerHTML"], wt = /* @__PURE__ */ K({
|
|
1957
1956
|
__name: "tableColumn",
|
|
1958
1957
|
props: {
|
|
1959
1958
|
conf: {},
|
|
@@ -1961,29 +1960,29 @@ const ft = /* @__PURE__ */ X(st, [["render", ct]]), mt = { class: "row flex-cent
|
|
|
1961
1960
|
option: {}
|
|
1962
1961
|
},
|
|
1963
1962
|
setup(e) {
|
|
1964
|
-
const r = D.isFun,
|
|
1965
|
-
return (
|
|
1966
|
-
const
|
|
1967
|
-
return
|
|
1968
|
-
key:
|
|
1963
|
+
const r = D.isFun, s = Ee().type;
|
|
1964
|
+
return (c, o) => {
|
|
1965
|
+
const t = te("el-tooltip");
|
|
1966
|
+
return d(!0), b($, null, A(e.columnList, (n) => (d(), b($, {
|
|
1967
|
+
key: n.key
|
|
1969
1968
|
}, [
|
|
1970
|
-
e.conf.table.column.show.list.includes(
|
|
1971
|
-
|
|
1969
|
+
e.conf.table.column.show.list.includes(n.key) && (n.show?.table === void 0 || l(r)(n.show?.table, e.conf.table.data)) ? (d(), b($, { key: 0 }, [
|
|
1970
|
+
n.table?.header?.groupKey === void 0 || n.table.header.show ? (d(), y(l(ae), V({
|
|
1972
1971
|
key: 0,
|
|
1973
|
-
prop:
|
|
1974
|
-
label:
|
|
1975
|
-
}, { ref_for: !0 },
|
|
1972
|
+
prop: n.key,
|
|
1973
|
+
label: n.label
|
|
1974
|
+
}, { ref_for: !0 }, n.table), {
|
|
1976
1975
|
header: g(() => [
|
|
1977
|
-
|
|
1976
|
+
x(c.$slots, "table-header-" + n.key, { item: n }, () => [
|
|
1978
1977
|
U("div", mt, [
|
|
1979
|
-
|
|
1978
|
+
n.table?.header?.tooltip ? (d(), y(t, {
|
|
1980
1979
|
key: 0,
|
|
1981
1980
|
effect: "dark",
|
|
1982
1981
|
placement: "top"
|
|
1983
1982
|
}, {
|
|
1984
1983
|
content: g(() => [
|
|
1985
1984
|
U("div", {
|
|
1986
|
-
innerHTML:
|
|
1985
|
+
innerHTML: n.table?.header?.tooltip
|
|
1987
1986
|
}, null, 8, pt)
|
|
1988
1987
|
]),
|
|
1989
1988
|
default: g(() => [
|
|
@@ -1992,159 +1991,159 @@ const ft = /* @__PURE__ */ X(st, [["render", ct]]), mt = { class: "row flex-cent
|
|
|
1992
1991
|
])
|
|
1993
1992
|
]),
|
|
1994
1993
|
_: 2
|
|
1995
|
-
}, 1024)) :
|
|
1996
|
-
O(" " + S(
|
|
1997
|
-
|
|
1994
|
+
}, 1024)) : C("", !0),
|
|
1995
|
+
O(" " + S(n.label) + " ", 1),
|
|
1996
|
+
n.table?.header?.group !== void 0 ? (d(), b("span", {
|
|
1998
1997
|
key: 1,
|
|
1999
1998
|
class: "table-header-plus",
|
|
2000
1999
|
onClick: Ue(
|
|
2001
2000
|
() => {
|
|
2002
|
-
|
|
2003
|
-
|
|
2001
|
+
n.table.header.group = !n.table.header.group, e.columnList.forEach((a) => {
|
|
2002
|
+
a.table?.header?.groupKey === n.key && (a.table.header.show = !n.table.header.group);
|
|
2004
2003
|
});
|
|
2005
2004
|
},
|
|
2006
2005
|
["stop"]
|
|
2007
2006
|
)
|
|
2008
2007
|
}, [
|
|
2009
|
-
|
|
2010
|
-
], 8, yt)) :
|
|
2008
|
+
n.table.header.group ? (d(), y(dt, { key: 0 })) : (d(), y(ft, { key: 1 }))
|
|
2009
|
+
], 8, yt)) : C("", !0)
|
|
2011
2010
|
])
|
|
2012
2011
|
])
|
|
2013
2012
|
]),
|
|
2014
|
-
default: g(({ row:
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
(
|
|
2013
|
+
default: g(({ row: a }) => [
|
|
2014
|
+
n.children ? (d(), b($, { key: 0 }, [
|
|
2015
|
+
o[0] || (o[0] = O(" ", -1)),
|
|
2016
|
+
(d(), y(q(l(s)), {
|
|
2018
2017
|
conf: e.conf,
|
|
2019
|
-
columnList:
|
|
2018
|
+
columnList: n.children,
|
|
2020
2019
|
option: e.option
|
|
2021
|
-
},
|
|
2022
|
-
|
|
2023
|
-
name:
|
|
2024
|
-
fn: g((
|
|
2025
|
-
|
|
2020
|
+
}, G({ _: 2 }, [
|
|
2021
|
+
A(c.$slots, (i, m) => ({
|
|
2022
|
+
name: m,
|
|
2023
|
+
fn: g((u) => [
|
|
2024
|
+
x(c.$slots, m, V({ ref_for: !0 }, u || {}))
|
|
2026
2025
|
])
|
|
2027
2026
|
}))
|
|
2028
2027
|
]), 1032, ["conf", "columnList", "option"]))
|
|
2029
|
-
], 64)) : (
|
|
2030
|
-
e.option.table?.editMode ? (
|
|
2028
|
+
], 64)) : (d(), b($, { key: 1 }, [
|
|
2029
|
+
e.option.table?.editMode ? (d(), b("div", {
|
|
2031
2030
|
key: 0,
|
|
2032
|
-
class: R(["row", ["table-edit-" +
|
|
2031
|
+
class: R(["row", ["table-edit-" + n.key]]),
|
|
2033
2032
|
style: { width: "100%" }
|
|
2034
2033
|
}, [
|
|
2035
|
-
|
|
2036
|
-
row:
|
|
2037
|
-
item:
|
|
2034
|
+
x(c.$slots, "table-edit-left-" + n.key, {
|
|
2035
|
+
row: a,
|
|
2036
|
+
item: n
|
|
2038
2037
|
}),
|
|
2039
|
-
|
|
2038
|
+
n.type === "input" ? (d(), y(l(ee), V({
|
|
2040
2039
|
key: 0,
|
|
2041
|
-
modelValue: n
|
|
2042
|
-
"onUpdate:modelValue": (i) => n
|
|
2043
|
-
disabled: e.conf.update.getDisabled(
|
|
2040
|
+
modelValue: a[n.key],
|
|
2041
|
+
"onUpdate:modelValue": (i) => a[n.key] = i,
|
|
2042
|
+
disabled: e.conf.update.getDisabled(n, !0),
|
|
2044
2043
|
class: "col"
|
|
2045
|
-
}, { ref_for: !0 }, e.conf.update.getBind(
|
|
2046
|
-
|
|
2044
|
+
}, { ref_for: !0 }, e.conf.update.getBind(n), z(e.conf.update.getOn(n, a))), G({ _: 2 }, [
|
|
2045
|
+
n.options?.input?.prepend ? {
|
|
2047
2046
|
name: "prepend",
|
|
2048
2047
|
fn: g(() => [
|
|
2049
|
-
O(S(typeof
|
|
2048
|
+
O(S(typeof n.options?.input?.prepend == "function" ? n.options?.input?.prepend(a) : n.options?.input?.prepend), 1)
|
|
2050
2049
|
]),
|
|
2051
2050
|
key: "0"
|
|
2052
2051
|
} : void 0
|
|
2053
|
-
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
2052
|
+
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.type === "select" ? (d(), y(l(X), V({
|
|
2054
2053
|
key: 1,
|
|
2055
|
-
modelValue: n
|
|
2056
|
-
"onUpdate:modelValue": (i) => n
|
|
2057
|
-
disabled: e.conf.update.getDisabled(
|
|
2054
|
+
modelValue: a[n.key],
|
|
2055
|
+
"onUpdate:modelValue": (i) => a[n.key] = i,
|
|
2056
|
+
disabled: e.conf.update.getDisabled(n, !0),
|
|
2058
2057
|
class: "col"
|
|
2059
|
-
}, { ref_for: !0 }, e.conf.update.getBind(
|
|
2058
|
+
}, { ref_for: !0 }, e.conf.update.getBind(n), z(e.conf.update.getOn(n, a))), {
|
|
2060
2059
|
default: g(() => [
|
|
2061
|
-
(
|
|
2060
|
+
(d(!0), b($, null, A(n.options?.search?.select?.data || n.options?.select?.data, (i) => (d(), y(l(W), {
|
|
2062
2061
|
key: i.value,
|
|
2063
2062
|
label: i.label,
|
|
2064
2063
|
value: i.value
|
|
2065
2064
|
}, null, 8, ["label", "value"]))), 128))
|
|
2066
2065
|
]),
|
|
2067
2066
|
_: 2
|
|
2068
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
2067
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.type === "switch" ? (d(), y(l(Z), V({
|
|
2069
2068
|
key: 2,
|
|
2070
|
-
modelValue: n
|
|
2071
|
-
"onUpdate:modelValue": (i) => n
|
|
2072
|
-
disabled: e.conf.update.getDisabled(
|
|
2069
|
+
modelValue: a[n.key],
|
|
2070
|
+
"onUpdate:modelValue": (i) => a[n.key] = i,
|
|
2071
|
+
disabled: e.conf.update.getDisabled(n, !0),
|
|
2073
2072
|
class: "col"
|
|
2074
|
-
}, { ref_for: !0 }, e.conf.update.getBind(
|
|
2075
|
-
|
|
2076
|
-
row:
|
|
2077
|
-
item:
|
|
2073
|
+
}, { ref_for: !0 }, e.conf.update.getBind(n), z(e.conf.update.getOn(n, a))), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : C("", !0),
|
|
2074
|
+
x(c.$slots, "table-edit-right-" + n.key, {
|
|
2075
|
+
row: a,
|
|
2076
|
+
item: n
|
|
2078
2077
|
})
|
|
2079
|
-
], 2)) : (
|
|
2080
|
-
e.conf.update.type === l(D).EDialog.Update && l(r)(
|
|
2081
|
-
|
|
2078
|
+
], 2)) : (d(), b($, { key: 1 }, [
|
|
2079
|
+
e.conf.update.type === l(D).EDialog.Update && l(r)(n.show?.form, e.conf.update.form, l(D).EDialog.Update) && e.option.table?.inlineEdit && e.conf.update.form[e.option.table?.rowKey] === a[e.option.table?.rowKey] && (n.type === "input" || n.type === "select") ? (d(), b($, { key: 0 }, [
|
|
2080
|
+
n.type === "input" ? (d(), y(l(ee), V({
|
|
2082
2081
|
key: 0,
|
|
2083
|
-
modelValue: e.conf.update.form[
|
|
2084
|
-
"onUpdate:modelValue": (i) => e.conf.update.form[
|
|
2085
|
-
disabled: e.conf.update.getDisabled(
|
|
2086
|
-
}, { ref_for: !0 }, e.conf.update.getBind(
|
|
2087
|
-
|
|
2082
|
+
modelValue: e.conf.update.form[n.key],
|
|
2083
|
+
"onUpdate:modelValue": (i) => e.conf.update.form[n.key] = i,
|
|
2084
|
+
disabled: e.conf.update.getDisabled(n, !0)
|
|
2085
|
+
}, { ref_for: !0 }, e.conf.update.getBind(n), z(e.conf.update.getOn(n, a)), { style: { width: "100%" } }), G({ _: 2 }, [
|
|
2086
|
+
n.options?.input?.prepend ? {
|
|
2088
2087
|
name: "prepend",
|
|
2089
2088
|
fn: g(() => [
|
|
2090
|
-
O(S(typeof
|
|
2089
|
+
O(S(typeof n.options?.input?.prepend == "function" ? n.options?.input?.prepend(a) : n.options?.input?.prepend), 1)
|
|
2091
2090
|
]),
|
|
2092
2091
|
key: "0"
|
|
2093
2092
|
} : void 0
|
|
2094
|
-
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
2093
|
+
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.type === "select" ? (d(), y(l(X), V({
|
|
2095
2094
|
key: 1,
|
|
2096
|
-
modelValue: e.conf.update.form[
|
|
2097
|
-
"onUpdate:modelValue": (i) => e.conf.update.form[
|
|
2098
|
-
disabled: e.conf.update.getDisabled(
|
|
2099
|
-
}, { ref_for: !0 }, e.conf.update.getBind(
|
|
2095
|
+
modelValue: e.conf.update.form[n.key],
|
|
2096
|
+
"onUpdate:modelValue": (i) => e.conf.update.form[n.key] = i,
|
|
2097
|
+
disabled: e.conf.update.getDisabled(n, !0)
|
|
2098
|
+
}, { ref_for: !0 }, e.conf.update.getBind(n), z(e.conf.update.getOn(n, a)), { style: { width: "100%" } }), {
|
|
2100
2099
|
default: g(() => [
|
|
2101
|
-
(
|
|
2100
|
+
(d(!0), b($, null, A(n.options?.search?.select?.data || n.options?.select?.data, (i) => (d(), y(l(W), {
|
|
2102
2101
|
key: i.value,
|
|
2103
2102
|
label: i.label,
|
|
2104
2103
|
value: i.value
|
|
2105
2104
|
}, null, 8, ["label", "value"]))), 128))
|
|
2106
2105
|
]),
|
|
2107
2106
|
_: 2
|
|
2108
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
2107
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.type === "switch" ? (d(), y(l(Z), V({
|
|
2109
2108
|
key: 2,
|
|
2110
|
-
modelValue: e.conf.update.form[
|
|
2111
|
-
"onUpdate:modelValue": (i) => e.conf.update.form[
|
|
2112
|
-
}, { ref_for: !0 }, e.conf.update.getBind(
|
|
2113
|
-
disabled: e.conf.update.getDisabled(
|
|
2114
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
2115
|
-
], 64)) :
|
|
2109
|
+
modelValue: e.conf.update.form[n.key],
|
|
2110
|
+
"onUpdate:modelValue": (i) => e.conf.update.form[n.key] = i
|
|
2111
|
+
}, { ref_for: !0 }, e.conf.update.getBind(n), z(e.conf.update.getOn(n, a)), {
|
|
2112
|
+
disabled: e.conf.update.getDisabled(n, !0)
|
|
2113
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : C("", !0)
|
|
2114
|
+
], 64)) : x(c.$slots, "table-" + n.key, {
|
|
2116
2115
|
key: 1,
|
|
2117
|
-
row:
|
|
2118
|
-
item:
|
|
2116
|
+
row: a,
|
|
2117
|
+
item: n
|
|
2119
2118
|
}, () => [
|
|
2120
|
-
l(j).customComponent[
|
|
2119
|
+
l(j).customComponent[n.type ?? ""]?.table ? (d(), y(q(l(j).customComponent[n.type ?? ""]?.table), V({
|
|
2121
2120
|
key: 0,
|
|
2122
|
-
modelValue: n
|
|
2123
|
-
"onUpdate:modelValue": (i) => n
|
|
2124
|
-
}, { ref_for: !0 },
|
|
2125
|
-
|
|
2121
|
+
modelValue: a[n.key],
|
|
2122
|
+
"onUpdate:modelValue": (i) => a[n.key] = i
|
|
2123
|
+
}, { ref_for: !0 }, n.options?.[n.type ?? ""], z(n.options?.[n.type ?? ""]?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue"])) : n.type === "switch" ? (d(), b($, { key: 1 }, [
|
|
2124
|
+
n.options?.switch?.tableConfig?.change ? (d(), y(l(Z), V({
|
|
2126
2125
|
key: 0,
|
|
2127
|
-
modelValue: n
|
|
2128
|
-
"onUpdate:modelValue": (i) => n
|
|
2129
|
-
loading:
|
|
2130
|
-
"before-change": () =>
|
|
2131
|
-
}, { ref_for: !0 },
|
|
2132
|
-
], 64)) : (
|
|
2126
|
+
modelValue: a[n.key],
|
|
2127
|
+
"onUpdate:modelValue": (i) => a[n.key] = i,
|
|
2128
|
+
loading: n.options?.switch?.loadingMap?.[a[e.option.table?.rowKey]]?.loading,
|
|
2129
|
+
"before-change": () => n.options?.switch?.tableBeforeChange?.(n.key, a)
|
|
2130
|
+
}, { ref_for: !0 }, n.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "loading", "before-change"])) : (d(), b("span", gt, S(a[n.key] === n.options?.switch?.activeValue ? n.options?.switch?.activeText : n.options?.switch?.inactiveText), 1))
|
|
2131
|
+
], 64)) : (d(), b("span", {
|
|
2133
2132
|
key: 2,
|
|
2134
2133
|
style: ge({
|
|
2135
|
-
"--table-text-click-color":
|
|
2134
|
+
"--table-text-click-color": n.table?.click?.color
|
|
2136
2135
|
}),
|
|
2137
|
-
class: R({ "table-text-click":
|
|
2138
|
-
onClick: (i) =>
|
|
2139
|
-
innerHTML:
|
|
2136
|
+
class: R({ "table-text-click": n.table?.click?.callback }),
|
|
2137
|
+
onClick: (i) => n.table?.click?.callback?.(a),
|
|
2138
|
+
innerHTML: n.table?.format ? n.table?.format(a) : a[n.key]
|
|
2140
2139
|
}, null, 14, bt))
|
|
2141
2140
|
])
|
|
2142
2141
|
], 64))
|
|
2143
2142
|
], 64))
|
|
2144
2143
|
]),
|
|
2145
2144
|
_: 2
|
|
2146
|
-
}, 1040, ["prop", "label"])) :
|
|
2147
|
-
], 64)) :
|
|
2145
|
+
}, 1040, ["prop", "label"])) : C("", !0)
|
|
2146
|
+
], 64)) : C("", !0)
|
|
2148
2147
|
], 64))), 128);
|
|
2149
2148
|
};
|
|
2150
2149
|
}
|
|
@@ -2158,30 +2157,30 @@ const ft = /* @__PURE__ */ X(st, [["render", ct]]), mt = { class: "row flex-cent
|
|
|
2158
2157
|
item: {}
|
|
2159
2158
|
},
|
|
2160
2159
|
setup(e) {
|
|
2161
|
-
return (r,
|
|
2160
|
+
return (r, s) => (d(), y(l(le), {
|
|
2162
2161
|
label: e.item.item.text?.form?.label ?? e.item.item.label,
|
|
2163
2162
|
prop: e.item.item.key,
|
|
2164
2163
|
"label-width": e.item.item.text?.form?.label == "" ? 0 : e.item.item.form?.labelWidth || e.conf.option.form?.labelWidth
|
|
2165
2164
|
}, {
|
|
2166
2165
|
default: g(() => [
|
|
2167
2166
|
U("div", kt, [
|
|
2168
|
-
|
|
2167
|
+
x(r.$slots, "form-" + e.item.item.key + "-start", {
|
|
2169
2168
|
row: e.conf.update.form,
|
|
2170
2169
|
item: e.item.item
|
|
2171
2170
|
}),
|
|
2172
2171
|
U("div", vt, [
|
|
2173
2172
|
U("div", Ct, [
|
|
2174
|
-
|
|
2173
|
+
x(r.$slots, "form-" + e.item.item.key, {
|
|
2175
2174
|
row: e.conf.update.form,
|
|
2176
2175
|
item: e.item.item
|
|
2177
2176
|
}, () => [
|
|
2178
|
-
e.item.item.type === "input" ? (
|
|
2177
|
+
e.item.item.type === "input" ? (d(), y(l(ee), V({
|
|
2179
2178
|
key: 0,
|
|
2180
2179
|
modelValue: e.conf.update.form[e.item.item.key],
|
|
2181
|
-
"onUpdate:modelValue":
|
|
2182
|
-
}, e.conf.update.getBind(e.item.item),
|
|
2180
|
+
"onUpdate:modelValue": s[0] || (s[0] = (c) => e.conf.update.form[e.item.item.key] = c)
|
|
2181
|
+
}, e.conf.update.getBind(e.item.item), z(e.conf.update.getOn(e.item.item)), {
|
|
2183
2182
|
disabled: e.conf.update.getDisabled(e.item.item)
|
|
2184
|
-
}),
|
|
2183
|
+
}), G({ _: 2 }, [
|
|
2185
2184
|
e.item.item.options?.input?.prepend ? {
|
|
2186
2185
|
name: "prepend",
|
|
2187
2186
|
fn: g(() => [
|
|
@@ -2189,85 +2188,85 @@ const ft = /* @__PURE__ */ X(st, [["render", ct]]), mt = { class: "row flex-cent
|
|
|
2189
2188
|
]),
|
|
2190
2189
|
key: "0"
|
|
2191
2190
|
} : void 0
|
|
2192
|
-
]), 1040, ["modelValue", "disabled"])) : e.item.item.type === "switch" ? (
|
|
2191
|
+
]), 1040, ["modelValue", "disabled"])) : e.item.item.type === "switch" ? (d(), y(l(Z), V({
|
|
2193
2192
|
key: 1,
|
|
2194
2193
|
modelValue: e.conf.update.form[e.item.item.key],
|
|
2195
|
-
"onUpdate:modelValue":
|
|
2196
|
-
}, e.conf.update.getBind(e.item.item),
|
|
2194
|
+
"onUpdate:modelValue": s[1] || (s[1] = (c) => e.conf.update.form[e.item.item.key] = c)
|
|
2195
|
+
}, e.conf.update.getBind(e.item.item), z(e.conf.update.getOn(e.item.item)), {
|
|
2197
2196
|
disabled: e.conf.update.getDisabled(e.item.item)
|
|
2198
|
-
}), null, 16, ["modelValue", "disabled"])) : e.item.item.type === "select" ? (
|
|
2197
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.item.type === "select" ? (d(), y(l(X), V({
|
|
2199
2198
|
key: 2,
|
|
2200
2199
|
modelValue: e.conf.update.form[e.item.item.key],
|
|
2201
|
-
"onUpdate:modelValue":
|
|
2202
|
-
}, e.conf.update.getBind(e.item.item),
|
|
2200
|
+
"onUpdate:modelValue": s[2] || (s[2] = (c) => e.conf.update.form[e.item.item.key] = c)
|
|
2201
|
+
}, e.conf.update.getBind(e.item.item), z(e.conf.update.getOn(e.item.item)), {
|
|
2203
2202
|
disabled: e.conf.update.getDisabled(e.item.item),
|
|
2204
2203
|
style: { width: "100%" }
|
|
2205
2204
|
}), {
|
|
2206
2205
|
default: g(() => [
|
|
2207
|
-
(
|
|
2208
|
-
key:
|
|
2209
|
-
}, { ref_for: !0 },
|
|
2206
|
+
(d(!0), b($, null, A(e.conf.update.getBind(e.item.item).data, (c) => (d(), y(l(W), V({
|
|
2207
|
+
key: c.value
|
|
2208
|
+
}, { ref_for: !0 }, c, z(c.on || {})), null, 16))), 128))
|
|
2210
2209
|
]),
|
|
2211
2210
|
_: 1
|
|
2212
|
-
}, 16, ["modelValue", "disabled"])) : e.item.item.type === "radio" ? (
|
|
2211
|
+
}, 16, ["modelValue", "disabled"])) : e.item.item.type === "radio" ? (d(), y(l(de), V({
|
|
2213
2212
|
key: 3,
|
|
2214
2213
|
modelValue: e.conf.update.form[e.item.item.key],
|
|
2215
|
-
"onUpdate:modelValue":
|
|
2216
|
-
}, e.conf.update.getBind(e.item.item),
|
|
2214
|
+
"onUpdate:modelValue": s[3] || (s[3] = (c) => e.conf.update.form[e.item.item.key] = c)
|
|
2215
|
+
}, e.conf.update.getBind(e.item.item), z(e.conf.update.getOn(e.item.item)), {
|
|
2217
2216
|
disabled: e.conf.update.getDisabled(e.item.item),
|
|
2218
2217
|
style: { width: "100%" }
|
|
2219
2218
|
}), {
|
|
2220
2219
|
default: g(() => [
|
|
2221
|
-
(
|
|
2222
|
-
key:
|
|
2223
|
-
}, { ref_for: !0 },
|
|
2220
|
+
(d(!0), b($, null, A(e.conf.update.getBind(e.item.item).data, (c) => (d(), y(l(se), V({
|
|
2221
|
+
key: c.value
|
|
2222
|
+
}, { ref_for: !0 }, c, z(c.on || {})), null, 16))), 128))
|
|
2224
2223
|
]),
|
|
2225
2224
|
_: 1
|
|
2226
|
-
}, 16, ["modelValue", "disabled"])) : e.item.item.type === "list" ? (
|
|
2225
|
+
}, 16, ["modelValue", "disabled"])) : e.item.item.type === "list" ? (d(), y(fe, V({
|
|
2227
2226
|
key: 4,
|
|
2228
2227
|
row: e.conf.update.form,
|
|
2229
2228
|
field: e.item.item.key
|
|
2230
|
-
}, e.conf.update.getBind(e.item.item),
|
|
2229
|
+
}, e.conf.update.getBind(e.item.item), z(e.conf.update.getOn(e.item.item)), {
|
|
2231
2230
|
disabled: e.conf.update.getDisabled(e.item.item),
|
|
2232
2231
|
style: { width: "100%" }
|
|
2233
|
-
}), null, 16, ["row", "field", "disabled"])) : e.item.item.type === "treeSelect" ? (
|
|
2232
|
+
}), null, 16, ["row", "field", "disabled"])) : e.item.item.type === "treeSelect" ? (d(), y(l(pe), V({
|
|
2234
2233
|
key: 5,
|
|
2235
2234
|
modelValue: e.conf.update.form[e.item.item.key],
|
|
2236
|
-
"onUpdate:modelValue":
|
|
2237
|
-
}, e.conf.update.getBind(e.item.item),
|
|
2235
|
+
"onUpdate:modelValue": s[4] || (s[4] = (c) => e.conf.update.form[e.item.item.key] = c)
|
|
2236
|
+
}, e.conf.update.getBind(e.item.item), z(e.conf.update.getOn(e.item.item)), {
|
|
2238
2237
|
disabled: e.conf.update.getDisabled(e.item.item),
|
|
2239
2238
|
style: { width: "100%" }
|
|
2240
|
-
}), null, 16, ["modelValue", "disabled"])) : e.item.item.type === "datetime" ? (
|
|
2239
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.item.type === "datetime" ? (d(), y(l(ue), V({
|
|
2241
2240
|
key: 6,
|
|
2242
2241
|
modelValue: e.conf.update.form[e.item.item.key],
|
|
2243
|
-
"onUpdate:modelValue":
|
|
2244
|
-
}, e.conf.update.getBind(e.item.item),
|
|
2242
|
+
"onUpdate:modelValue": s[5] || (s[5] = (c) => e.conf.update.form[e.item.item.key] = c)
|
|
2243
|
+
}, e.conf.update.getBind(e.item.item), z(e.conf.update.getOn(e.item.item)), {
|
|
2245
2244
|
disabled: e.conf.update.getDisabled(e.item.item)
|
|
2246
|
-
}), null, 16, ["modelValue", "disabled"])) : e.item.item.type && (l(j).customComponent[e.item.item.type] || l(j).customComponent[e.item.item.type]?.form) ? (
|
|
2245
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.item.type && (l(j).customComponent[e.item.item.type] || l(j).customComponent[e.item.item.type]?.form) ? (d(), y(q(l(j).customComponent[e.item.item.type]?.form || l(j).customComponent[e.item.item.type]), V({
|
|
2247
2246
|
key: 7,
|
|
2248
2247
|
modelValue: e.conf.update.form[e.item.item.key],
|
|
2249
|
-
"onUpdate:modelValue":
|
|
2250
|
-
}, e.conf.update.getBind(e.item.item),
|
|
2248
|
+
"onUpdate:modelValue": s[6] || (s[6] = (c) => e.conf.update.form[e.item.item.key] = c)
|
|
2249
|
+
}, e.conf.update.getBind(e.item.item), z(e.conf.update.getOn(e.item.item)), {
|
|
2251
2250
|
disabled: e.conf.update.getDisabled(e.item.item)
|
|
2252
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
2251
|
+
}), null, 16, ["modelValue", "disabled"])) : C("", !0)
|
|
2253
2252
|
]),
|
|
2254
|
-
|
|
2253
|
+
x(r.$slots, "form-" + e.item.item.key + "-right", {
|
|
2255
2254
|
row: e.conf.update.form,
|
|
2256
2255
|
item: e.item.item
|
|
2257
2256
|
})
|
|
2258
2257
|
]),
|
|
2259
|
-
|
|
2258
|
+
x(r.$slots, "form-" + e.item.item.key + "-tip", {
|
|
2260
2259
|
row: e.conf.update.form,
|
|
2261
2260
|
item: e.item.item
|
|
2262
2261
|
}, () => [
|
|
2263
|
-
e.item.item.form?.tipText ? (
|
|
2262
|
+
e.item.item.form?.tipText ? (d(), b("div", {
|
|
2264
2263
|
key: 0,
|
|
2265
2264
|
class: "form-tip-text",
|
|
2266
2265
|
innerHTML: typeof e.item.item.form?.tipText == "function" ? e.item.item.form?.tipText(e.conf.update.form, e.conf.update.type) : e.item.item.form?.tipText
|
|
2267
|
-
}, null, 8, Vt)) :
|
|
2266
|
+
}, null, 8, Vt)) : C("", !0)
|
|
2268
2267
|
])
|
|
2269
2268
|
]),
|
|
2270
|
-
|
|
2269
|
+
x(r.$slots, "form-" + e.item.item.key + "-end", {
|
|
2271
2270
|
row: e.conf.update.form,
|
|
2272
2271
|
item: e.item.item
|
|
2273
2272
|
})
|
|
@@ -2281,26 +2280,26 @@ const ft = /* @__PURE__ */ X(st, [["render", ct]]), mt = { class: "row flex-cent
|
|
|
2281
2280
|
viewBox: "64 64 896 896"
|
|
2282
2281
|
};
|
|
2283
2282
|
function Ot(e, r) {
|
|
2284
|
-
return
|
|
2283
|
+
return d(), b("svg", $t, [...r[0] || (r[0] = [
|
|
2285
2284
|
U("path", {
|
|
2286
2285
|
fill: "currentColor",
|
|
2287
2286
|
d: "M482.2 508.4L331.3 389c-3-2.4-7.3-.2-7.3 3.6V478H184V184h204v128c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V144c0-15.5-12.5-28-28-28H144c-15.5 0-28 12.5-28 28v736c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v128H184V546h140v85.4c0 3.8 4.4 6 7.3 3.6l150.9-119.4a4.5 4.5 0 000-7.2zM880 116H596c-15.5 0-28 12.5-28 28v168c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V184h204v294H700v-85.4c0-3.8-4.3-6-7.3-3.6l-151 119.4a4.52 4.52 0 000 7.1l151 119.5c2.9 2.3 7.3.2 7.3-3.6V546h140v294H636V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v168c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V144c0-15.5-12.5-28-28-28z"
|
|
2288
2287
|
}, null, -1)
|
|
2289
2288
|
])]);
|
|
2290
2289
|
}
|
|
2291
|
-
const Dt = /* @__PURE__ */
|
|
2290
|
+
const Dt = /* @__PURE__ */ Y(zt, [["render", Ot]]), Et = {}, Ut = {
|
|
2292
2291
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2293
2292
|
viewBox: "64 64 896 896"
|
|
2294
2293
|
};
|
|
2295
2294
|
function St(e, r) {
|
|
2296
|
-
return
|
|
2295
|
+
return d(), b("svg", Ut, [...r[0] || (r[0] = [
|
|
2297
2296
|
U("path", {
|
|
2298
2297
|
fill: "currentColor",
|
|
2299
2298
|
d: "M180 176h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zm724 0h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zM785.3 504.3L657.7 403.6a7.23 7.23 0 00-11.7 5.7V476H378v-62.8c0-6-7-9.4-11.7-5.7L238.7 508.3a7.14 7.14 0 000 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h268v62.8c0 6 7 9.4 11.7 5.7l127.5-100.8c3.8-2.9 3.8-8.5.2-11.4z"
|
|
2300
2299
|
}, null, -1)
|
|
2301
2300
|
])]);
|
|
2302
2301
|
}
|
|
2303
|
-
const Mt = /* @__PURE__ */
|
|
2302
|
+
const Mt = /* @__PURE__ */ Y(Et, [["render", St]]), he = /* @__PURE__ */ K({
|
|
2304
2303
|
__name: "searchField",
|
|
2305
2304
|
props: {
|
|
2306
2305
|
item: {},
|
|
@@ -2308,86 +2307,86 @@ const Mt = /* @__PURE__ */ X(Et, [["render", St]]), he = /* @__PURE__ */ K({
|
|
|
2308
2307
|
type: {}
|
|
2309
2308
|
},
|
|
2310
2309
|
setup(e) {
|
|
2311
|
-
const r = e,
|
|
2310
|
+
const r = e, s = be({
|
|
2312
2311
|
get: () => r.conf.search.form?.[r.item?.key],
|
|
2313
|
-
set: (
|
|
2314
|
-
r.item?.key !== void 0 && (r.conf.search.form[r.item.key] =
|
|
2312
|
+
set: (c) => {
|
|
2313
|
+
r.item?.key !== void 0 && (r.conf.search.form[r.item.key] = c);
|
|
2315
2314
|
}
|
|
2316
2315
|
});
|
|
2317
|
-
return (
|
|
2316
|
+
return (c, o) => l(j).customComponent[e.type ?? ""]?.search ? (d(), y(q(l(j).customComponent[e.type ?? ""]?.search), V({
|
|
2318
2317
|
key: 0,
|
|
2319
|
-
modelValue:
|
|
2320
|
-
"onUpdate:modelValue":
|
|
2321
|
-
}, e.item.options?.search?.[e.type ?? ""],
|
|
2318
|
+
modelValue: s.value,
|
|
2319
|
+
"onUpdate:modelValue": o[0] || (o[0] = (t) => s.value = t)
|
|
2320
|
+
}, e.item.options?.search?.[e.type ?? ""], z(e.item.options?.search?.[e.type ?? ""]?.on || {})), null, 16, ["modelValue"])) : e.type === "input" ? (d(), y(l(ee), V({
|
|
2322
2321
|
key: 1,
|
|
2323
|
-
modelValue:
|
|
2324
|
-
"onUpdate:modelValue":
|
|
2322
|
+
modelValue: s.value,
|
|
2323
|
+
"onUpdate:modelValue": o[1] || (o[1] = (t) => s.value = t),
|
|
2325
2324
|
placeholder: e.conf.search.getPlaceholder(e.item),
|
|
2326
2325
|
clearable: "",
|
|
2327
2326
|
disabled: e.item.disabled?.search
|
|
2328
|
-
}, e.item.options?.search?.input || e.item.options?.input,
|
|
2327
|
+
}, e.item.options?.search?.input || e.item.options?.input, z(e.item.options?.search?.input?.on || e.item.options?.input?.on || {})), null, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "switch" ? (d(), y(l(X), V({
|
|
2329
2328
|
key: 2,
|
|
2330
|
-
modelValue:
|
|
2331
|
-
"onUpdate:modelValue":
|
|
2332
|
-
placeholder: e.conf.search.getPlaceholder(e.item, l(
|
|
2329
|
+
modelValue: s.value,
|
|
2330
|
+
"onUpdate:modelValue": o[2] || (o[2] = (t) => s.value = t),
|
|
2331
|
+
placeholder: e.conf.search.getPlaceholder(e.item, l(v).tCurd("placeholderSelect")),
|
|
2333
2332
|
clearable: "",
|
|
2334
2333
|
disabled: e.item.disabled?.search
|
|
2335
|
-
}, e.item.options?.search?.switch || e.item.options?.switch,
|
|
2334
|
+
}, e.item.options?.search?.switch || e.item.options?.switch, z(e.item.options?.search?.switch?.on || e.item.options?.switch?.on || {})), {
|
|
2336
2335
|
default: g(() => [
|
|
2337
|
-
(
|
|
2336
|
+
(d(), y(l(W), {
|
|
2338
2337
|
key: e.item.options?.switch?.activeValue,
|
|
2339
2338
|
label: e.item.options?.switch?.activeText,
|
|
2340
2339
|
value: e.item.options?.switch?.activeValue
|
|
2341
2340
|
}, null, 8, ["label", "value"])),
|
|
2342
|
-
(
|
|
2341
|
+
(d(), y(l(W), {
|
|
2343
2342
|
key: e.item.options?.switch?.inactiveValue,
|
|
2344
2343
|
label: e.item.options?.switch?.inactiveText,
|
|
2345
2344
|
value: e.item.options?.switch?.inactiveValue
|
|
2346
2345
|
}, null, 8, ["label", "value"]))
|
|
2347
2346
|
]),
|
|
2348
2347
|
_: 1
|
|
2349
|
-
}, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "select" ? (
|
|
2348
|
+
}, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "select" ? (d(), y(l(X), V({
|
|
2350
2349
|
key: 3,
|
|
2351
|
-
modelValue:
|
|
2352
|
-
"onUpdate:modelValue":
|
|
2353
|
-
placeholder: e.conf.search.getPlaceholder(e.item, l(
|
|
2350
|
+
modelValue: s.value,
|
|
2351
|
+
"onUpdate:modelValue": o[3] || (o[3] = (t) => s.value = t),
|
|
2352
|
+
placeholder: e.conf.search.getPlaceholder(e.item, l(v).tCurd("placeholderSelect")),
|
|
2354
2353
|
clearable: "",
|
|
2355
2354
|
disabled: e.item.disabled?.search
|
|
2356
|
-
}, e.item.options?.search?.select || e.item.options?.select,
|
|
2355
|
+
}, e.item.options?.search?.select || e.item.options?.select, z(e.item.options?.search?.select?.on || e.item.options?.select?.on || {})), {
|
|
2357
2356
|
default: g(() => [
|
|
2358
|
-
(
|
|
2359
|
-
key:
|
|
2360
|
-
label:
|
|
2361
|
-
value:
|
|
2357
|
+
(d(!0), b($, null, A(e.item.options?.search?.select?.data || e.item.options?.select?.data || [], (t) => (d(), y(l(W), {
|
|
2358
|
+
key: t.value,
|
|
2359
|
+
label: t.label,
|
|
2360
|
+
value: t.value
|
|
2362
2361
|
}, null, 8, ["label", "value"]))), 128))
|
|
2363
2362
|
]),
|
|
2364
2363
|
_: 1
|
|
2365
|
-
}, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "radio" ? (
|
|
2364
|
+
}, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "radio" ? (d(), y(l(de), V({
|
|
2366
2365
|
key: 4,
|
|
2367
|
-
modelValue:
|
|
2368
|
-
"onUpdate:modelValue":
|
|
2366
|
+
modelValue: s.value,
|
|
2367
|
+
"onUpdate:modelValue": o[4] || (o[4] = (t) => s.value = t),
|
|
2369
2368
|
disabled: e.item.disabled?.search
|
|
2370
|
-
}, e.item.options?.search?.radio || e.item.options?.radio,
|
|
2369
|
+
}, e.item.options?.search?.radio || e.item.options?.radio, z(e.item.options?.search?.radio?.on || e.item.options?.radio?.on || {})), {
|
|
2371
2370
|
default: g(() => [
|
|
2372
|
-
(
|
|
2373
|
-
key:
|
|
2374
|
-
label:
|
|
2375
|
-
value:
|
|
2371
|
+
(d(!0), b($, null, A(e.item.options?.radio?.data, (t) => (d(), y(l(se), {
|
|
2372
|
+
key: t.value,
|
|
2373
|
+
label: t.label,
|
|
2374
|
+
value: t.value
|
|
2376
2375
|
}, null, 8, ["label", "value"]))), 128))
|
|
2377
2376
|
]),
|
|
2378
2377
|
_: 1
|
|
2379
|
-
}, 16, ["modelValue", "disabled"])) : e.type === "datetime" ? (
|
|
2378
|
+
}, 16, ["modelValue", "disabled"])) : e.type === "datetime" ? (d(), y(l(ue), V({
|
|
2380
2379
|
key: 5,
|
|
2381
|
-
modelValue:
|
|
2382
|
-
"onUpdate:modelValue":
|
|
2380
|
+
modelValue: s.value,
|
|
2381
|
+
"onUpdate:modelValue": o[5] || (o[5] = (t) => s.value = t),
|
|
2383
2382
|
disabled: e.item.disabled?.search
|
|
2384
|
-
}, e.item.options?.search?.datetime || e.item.options?.datetime,
|
|
2383
|
+
}, e.item.options?.search?.datetime || e.item.options?.datetime, z(e.item.options?.search?.datetime?.on || e.item.options?.datetime?.on || {})), null, 16, ["modelValue", "disabled"])) : e.type && l(j).customComponent[e.type] ? (d(), y(q(l(j).customComponent[e.type]), V({
|
|
2385
2384
|
key: 6,
|
|
2386
|
-
modelValue:
|
|
2387
|
-
"onUpdate:modelValue":
|
|
2388
|
-
}, e.item.options?.search?.[e.type] || e.item.options?.[e.type],
|
|
2385
|
+
modelValue: s.value,
|
|
2386
|
+
"onUpdate:modelValue": o[6] || (o[6] = (t) => s.value = t)
|
|
2387
|
+
}, e.item.options?.search?.[e.type] || e.item.options?.[e.type], z(e.item.options?.search?.[e.type]?.on || e.item.options?.[e.type]?.on || {}), {
|
|
2389
2388
|
disabled: e.item.disabled?.search
|
|
2390
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
2389
|
+
}), null, 16, ["modelValue", "disabled"])) : C("", !0);
|
|
2391
2390
|
}
|
|
2392
2391
|
}), Ft = {
|
|
2393
2392
|
key: 0,
|
|
@@ -2424,257 +2423,257 @@ const Mt = /* @__PURE__ */ X(Et, [["render", St]]), he = /* @__PURE__ */ K({
|
|
|
2424
2423
|
}
|
|
2425
2424
|
},
|
|
2426
2425
|
setup(e, { expose: r }) {
|
|
2427
|
-
const
|
|
2426
|
+
const s = D.EDialog, c = e, o = D.isFun, { conf: t, switchConfirmRef: n, ruleFormRef: a, tableRef: i } = Je(c);
|
|
2428
2427
|
return r({
|
|
2429
|
-
conf:
|
|
2430
|
-
}), (
|
|
2431
|
-
const
|
|
2432
|
-
return
|
|
2428
|
+
conf: t
|
|
2429
|
+
}), (m, u) => {
|
|
2430
|
+
const w = te("el-tooltip"), f = Se("loading");
|
|
2431
|
+
return d(), b("div", {
|
|
2433
2432
|
class: R(["relative cc1-form-box", [e.option.table?.fitHeight ? "col" : "no-min-height"]])
|
|
2434
2433
|
}, [
|
|
2435
2434
|
U("div", {
|
|
2436
2435
|
class: R(["row", [e.option.table?.fitHeight ? "absolute fit" : ""]]),
|
|
2437
2436
|
style: { overflow: "hidden" }
|
|
2438
2437
|
}, [
|
|
2439
|
-
|
|
2438
|
+
x(m.$slots, "box-left"),
|
|
2440
2439
|
U("div", {
|
|
2441
2440
|
class: R(["column fit-width no-wrap", [e.option.table?.fitHeight ? "col" : ""]])
|
|
2442
2441
|
}, [
|
|
2443
|
-
e.option.search?.show !== !1 ? (
|
|
2444
|
-
E(l(
|
|
2445
|
-
model: l(
|
|
2442
|
+
e.option.search?.show !== !1 ? (d(), b("div", Ft, [
|
|
2443
|
+
E(l(Q), {
|
|
2444
|
+
model: l(t).search.form,
|
|
2446
2445
|
inline: "",
|
|
2447
2446
|
size: e.option.size?.search
|
|
2448
2447
|
}, {
|
|
2449
2448
|
default: g(() => [
|
|
2450
|
-
|
|
2451
|
-
row: l(
|
|
2449
|
+
x(m.$slots, "search-start", {
|
|
2450
|
+
row: l(t).search.form
|
|
2452
2451
|
}),
|
|
2453
|
-
(
|
|
2454
|
-
key:
|
|
2452
|
+
(d(!0), b($, null, A(l(t).search.column.list, (h) => (d(), b($, {
|
|
2453
|
+
key: h.key
|
|
2455
2454
|
}, [
|
|
2456
|
-
|
|
2457
|
-
row: l(
|
|
2455
|
+
x(m.$slots, "search-" + h.key + "-start", {
|
|
2456
|
+
row: l(t).search.form
|
|
2458
2457
|
}),
|
|
2459
|
-
(typeof
|
|
2458
|
+
(typeof h.show?.search == "function" ? h.show?.search(l(t).search.form) : h.show?.search) ? (d(), y(l(le), {
|
|
2460
2459
|
key: 0,
|
|
2461
|
-
label:
|
|
2460
|
+
label: h.text?.search?.label ?? h.label
|
|
2462
2461
|
}, {
|
|
2463
2462
|
default: g(() => [
|
|
2464
|
-
|
|
2465
|
-
row: l(
|
|
2463
|
+
x(m.$slots, "search-" + h.key + "-left", {
|
|
2464
|
+
row: l(t).search.form
|
|
2466
2465
|
}),
|
|
2467
|
-
|
|
2468
|
-
row: l(
|
|
2466
|
+
x(m.$slots, "search-" + h.key, {
|
|
2467
|
+
row: l(t).search.form
|
|
2469
2468
|
}, () => [
|
|
2470
|
-
|
|
2469
|
+
h.options?.search?.type ? (d(), y(he, {
|
|
2471
2470
|
key: 0,
|
|
2472
|
-
item:
|
|
2473
|
-
conf: l(
|
|
2474
|
-
type:
|
|
2475
|
-
}, null, 8, ["item", "conf", "type"])) : (
|
|
2471
|
+
item: h,
|
|
2472
|
+
conf: l(t),
|
|
2473
|
+
type: h.options.search.type
|
|
2474
|
+
}, null, 8, ["item", "conf", "type"])) : (d(), y(he, {
|
|
2476
2475
|
key: 1,
|
|
2477
|
-
item:
|
|
2478
|
-
conf: l(
|
|
2479
|
-
type:
|
|
2476
|
+
item: h,
|
|
2477
|
+
conf: l(t),
|
|
2478
|
+
type: h.type
|
|
2480
2479
|
}, null, 8, ["item", "conf", "type"]))
|
|
2481
2480
|
]),
|
|
2482
|
-
|
|
2483
|
-
row: l(
|
|
2481
|
+
x(m.$slots, "search-" + h.key + "-right", {
|
|
2482
|
+
row: l(t).search.form
|
|
2484
2483
|
})
|
|
2485
2484
|
]),
|
|
2486
2485
|
_: 2
|
|
2487
|
-
}, 1032, ["label"])) :
|
|
2488
|
-
|
|
2489
|
-
row: l(
|
|
2486
|
+
}, 1032, ["label"])) : C("", !0),
|
|
2487
|
+
x(m.$slots, "search-" + h.key + "-end", {
|
|
2488
|
+
row: l(t).search.form
|
|
2490
2489
|
})
|
|
2491
2490
|
], 64))), 128)),
|
|
2492
|
-
|
|
2493
|
-
row: l(
|
|
2491
|
+
x(m.$slots, "search-center", {
|
|
2492
|
+
row: l(t).search.form
|
|
2494
2493
|
}),
|
|
2495
|
-
e.option.tools?.search || e.option.tools?.reset ? (
|
|
2494
|
+
e.option.tools?.search || e.option.tools?.reset ? (d(), y(l(le), { key: 0 }, {
|
|
2496
2495
|
default: g(() => [
|
|
2497
|
-
e.option.tools?.search ? (
|
|
2496
|
+
e.option.tools?.search ? (d(), y(l(T), {
|
|
2498
2497
|
key: 0,
|
|
2499
2498
|
type: "primary",
|
|
2500
|
-
onClick: l(
|
|
2499
|
+
onClick: l(t).search.submit
|
|
2501
2500
|
}, {
|
|
2502
2501
|
default: g(() => [
|
|
2503
|
-
O(S(l(
|
|
2502
|
+
O(S(l(v).tCurd("search")), 1)
|
|
2504
2503
|
]),
|
|
2505
2504
|
_: 1
|
|
2506
|
-
}, 8, ["onClick"])) :
|
|
2507
|
-
e.option.tools?.reset ? (
|
|
2505
|
+
}, 8, ["onClick"])) : C("", !0),
|
|
2506
|
+
e.option.tools?.reset ? (d(), y(l(T), {
|
|
2508
2507
|
key: 1,
|
|
2509
|
-
onClick: l(
|
|
2508
|
+
onClick: l(t).search.reset
|
|
2510
2509
|
}, {
|
|
2511
2510
|
default: g(() => [
|
|
2512
|
-
O(S(l(
|
|
2511
|
+
O(S(l(v).tCurd("reset")), 1)
|
|
2513
2512
|
]),
|
|
2514
2513
|
_: 1
|
|
2515
|
-
}, 8, ["onClick"])) :
|
|
2514
|
+
}, 8, ["onClick"])) : C("", !0)
|
|
2516
2515
|
]),
|
|
2517
2516
|
_: 1
|
|
2518
|
-
})) :
|
|
2519
|
-
|
|
2520
|
-
row: l(
|
|
2517
|
+
})) : C("", !0),
|
|
2518
|
+
x(m.$slots, "search-end", {
|
|
2519
|
+
row: l(t).search.form
|
|
2521
2520
|
})
|
|
2522
2521
|
]),
|
|
2523
2522
|
_: 3
|
|
2524
2523
|
}, 8, ["model", "size"])
|
|
2525
|
-
])) :
|
|
2524
|
+
])) : C("", !0),
|
|
2526
2525
|
U("div", At, [
|
|
2527
2526
|
U("div", Tt, [
|
|
2528
|
-
l(
|
|
2529
|
-
E(l(
|
|
2527
|
+
l(o)(e.option.tools?.add) ? (d(), b("div", jt, [
|
|
2528
|
+
E(l(T), {
|
|
2530
2529
|
type: "primary",
|
|
2531
|
-
onClick:
|
|
2530
|
+
onClick: u[0] || (u[0] = (h) => l(t).update.open(l(s).Add)),
|
|
2532
2531
|
size: e.option.size?.search
|
|
2533
2532
|
}, {
|
|
2534
2533
|
default: g(() => [
|
|
2535
|
-
O(S(l(
|
|
2534
|
+
O(S(l(v).tCurd("add")), 1)
|
|
2536
2535
|
]),
|
|
2537
2536
|
_: 1
|
|
2538
2537
|
}, 8, ["size"])
|
|
2539
|
-
])) :
|
|
2540
|
-
e.option.table?.selectable && l(
|
|
2541
|
-
E(l(
|
|
2538
|
+
])) : C("", !0),
|
|
2539
|
+
e.option.table?.selectable && l(o)(e.option.tools?.delete) ? (d(), b("div", Lt, [
|
|
2540
|
+
E(l(T), {
|
|
2542
2541
|
type: "danger",
|
|
2543
|
-
onClick:
|
|
2542
|
+
onClick: u[1] || (u[1] = (h) => l(t).remove.open(l(t).table.selection.list)),
|
|
2544
2543
|
size: e.option.size?.search
|
|
2545
2544
|
}, {
|
|
2546
2545
|
default: g(() => [
|
|
2547
|
-
O(S(l(
|
|
2546
|
+
O(S(l(v).tCurd("delete")), 1)
|
|
2548
2547
|
]),
|
|
2549
2548
|
_: 1
|
|
2550
2549
|
}, 8, ["size"])
|
|
2551
|
-
])) :
|
|
2552
|
-
e.option.tools?.expand ? (
|
|
2553
|
-
E(l(
|
|
2550
|
+
])) : C("", !0),
|
|
2551
|
+
e.option.tools?.expand ? (d(), b("div", Bt, [
|
|
2552
|
+
E(l(T), {
|
|
2554
2553
|
type: "warning",
|
|
2555
|
-
onClick:
|
|
2554
|
+
onClick: u[2] || (u[2] = (h) => l(t).table.expand.all()),
|
|
2556
2555
|
size: e.option.size?.search
|
|
2557
2556
|
}, {
|
|
2558
2557
|
default: g(() => [
|
|
2559
|
-
O(S(l(
|
|
2558
|
+
O(S(l(v).tCurd("expandCollapse")), 1)
|
|
2560
2559
|
]),
|
|
2561
2560
|
_: 1
|
|
2562
2561
|
}, 8, ["size"])
|
|
2563
|
-
])) :
|
|
2564
|
-
e.option.tools?.export?.show ? (
|
|
2565
|
-
e.option.tools?.export?.dropdown?.show ? (
|
|
2562
|
+
])) : C("", !0),
|
|
2563
|
+
e.option.tools?.export?.show ? (d(), b($, { key: 3 }, [
|
|
2564
|
+
e.option.tools?.export?.dropdown?.show ? (d(), y(l($e), {
|
|
2566
2565
|
key: 0,
|
|
2567
|
-
onCommand: l(
|
|
2566
|
+
onCommand: l(t).export.click
|
|
2568
2567
|
}, {
|
|
2569
2568
|
dropdown: g(() => [
|
|
2570
2569
|
E(l(Oe), {
|
|
2571
2570
|
size: e.option.size?.search
|
|
2572
2571
|
}, {
|
|
2573
2572
|
default: g(() => [
|
|
2574
|
-
e.option.tools?.export?.dropdown?.select && (e.option.table?.selectable || l(
|
|
2573
|
+
e.option.tools?.export?.dropdown?.select && (e.option.table?.selectable || l(o)(e.option.tools?.delete)) ? (d(), y(l(ne), {
|
|
2575
2574
|
key: 0,
|
|
2576
2575
|
command: "select"
|
|
2577
2576
|
}, {
|
|
2578
2577
|
default: g(() => [
|
|
2579
|
-
O(S(l(
|
|
2578
|
+
O(S(l(v).tCurd("exportSelect")), 1)
|
|
2580
2579
|
]),
|
|
2581
2580
|
_: 1
|
|
2582
|
-
})) :
|
|
2583
|
-
e.option.tools?.export?.dropdown?.page ? (
|
|
2581
|
+
})) : C("", !0),
|
|
2582
|
+
e.option.tools?.export?.dropdown?.page ? (d(), y(l(ne), {
|
|
2584
2583
|
key: 1,
|
|
2585
2584
|
command: "page"
|
|
2586
2585
|
}, {
|
|
2587
2586
|
default: g(() => [
|
|
2588
|
-
O(S(l(
|
|
2587
|
+
O(S(l(v).tCurd("exportPage")), 1)
|
|
2589
2588
|
]),
|
|
2590
2589
|
_: 1
|
|
2591
|
-
})) :
|
|
2592
|
-
e.option.tools?.export?.dropdown?.all ? (
|
|
2590
|
+
})) : C("", !0),
|
|
2591
|
+
e.option.tools?.export?.dropdown?.all ? (d(), y(l(ne), {
|
|
2593
2592
|
key: 2,
|
|
2594
2593
|
command: "all"
|
|
2595
2594
|
}, {
|
|
2596
2595
|
default: g(() => [
|
|
2597
|
-
O(S(l(
|
|
2596
|
+
O(S(l(v).tCurd("exportAll")), 1)
|
|
2598
2597
|
]),
|
|
2599
2598
|
_: 1
|
|
2600
|
-
})) :
|
|
2599
|
+
})) : C("", !0)
|
|
2601
2600
|
]),
|
|
2602
2601
|
_: 1
|
|
2603
2602
|
}, 8, ["size"])
|
|
2604
2603
|
]),
|
|
2605
2604
|
default: g(() => [
|
|
2606
2605
|
U("div", Rt, [
|
|
2607
|
-
E(l(
|
|
2606
|
+
E(l(T), {
|
|
2608
2607
|
type: "warning",
|
|
2609
|
-
loading: l(
|
|
2608
|
+
loading: l(t).export.loading,
|
|
2610
2609
|
size: e.option.size?.search
|
|
2611
2610
|
}, {
|
|
2612
2611
|
default: g(() => [
|
|
2613
|
-
O(S(l(
|
|
2612
|
+
O(S(l(v).tCurd("export")), 1)
|
|
2614
2613
|
]),
|
|
2615
2614
|
_: 1
|
|
2616
2615
|
}, 8, ["loading", "size"])
|
|
2617
2616
|
])
|
|
2618
2617
|
]),
|
|
2619
2618
|
_: 1
|
|
2620
|
-
}, 8, ["onCommand"])) : (
|
|
2621
|
-
E(l(
|
|
2619
|
+
}, 8, ["onCommand"])) : (d(), b("div", It, [
|
|
2620
|
+
E(l(T), {
|
|
2622
2621
|
type: "warning",
|
|
2623
|
-
loading: l(
|
|
2622
|
+
loading: l(t).export.loading,
|
|
2624
2623
|
size: e.option.size?.search,
|
|
2625
|
-
onClick:
|
|
2624
|
+
onClick: u[3] || (u[3] = (h) => l(t).export.run.start("all"))
|
|
2626
2625
|
}, {
|
|
2627
2626
|
default: g(() => [
|
|
2628
|
-
O(S(l(
|
|
2627
|
+
O(S(l(v).tCurd("export")), 1)
|
|
2629
2628
|
]),
|
|
2630
2629
|
_: 1
|
|
2631
2630
|
}, 8, ["loading", "size"])
|
|
2632
2631
|
]))
|
|
2633
|
-
], 64)) :
|
|
2634
|
-
|
|
2632
|
+
], 64)) : C("", !0),
|
|
2633
|
+
x(m.$slots, "tools-left")
|
|
2635
2634
|
]),
|
|
2636
2635
|
U("div", Pt, [
|
|
2637
|
-
|
|
2638
|
-
l(
|
|
2636
|
+
x(m.$slots, "tools-right"),
|
|
2637
|
+
l(t).page.showTools ? (d(), y(l(me), V({
|
|
2639
2638
|
key: 0,
|
|
2640
|
-
"current-page": l(
|
|
2641
|
-
"onUpdate:currentPage":
|
|
2642
|
-
"page-size": l(
|
|
2643
|
-
"onUpdate:pageSize":
|
|
2639
|
+
"current-page": l(t).page.num,
|
|
2640
|
+
"onUpdate:currentPage": u[4] || (u[4] = (h) => l(t).page.num = h),
|
|
2641
|
+
"page-size": l(t).page.size,
|
|
2642
|
+
"onUpdate:pageSize": u[5] || (u[5] = (h) => l(t).page.size = h),
|
|
2644
2643
|
background: "",
|
|
2645
|
-
"page-sizes": l(
|
|
2646
|
-
"pager-count": l(
|
|
2647
|
-
layout: l(
|
|
2648
|
-
total: l(
|
|
2644
|
+
"page-sizes": l(t).page.sizeList,
|
|
2645
|
+
"pager-count": l(t).page.pagerCount,
|
|
2646
|
+
layout: l(t).page.layout,
|
|
2647
|
+
total: l(t).page.total,
|
|
2649
2648
|
size: e.option.size?.table,
|
|
2650
|
-
onSizeChange: l(
|
|
2651
|
-
onCurrentChange: l(
|
|
2652
|
-
}, e.option.page?.pagination || {},
|
|
2653
|
-
e.option.tools?.expandColumn === void 0 || e.option.tools?.expandColumn ? (
|
|
2649
|
+
onSizeChange: l(t).table.getList,
|
|
2650
|
+
onCurrentChange: l(t).table.getList
|
|
2651
|
+
}, e.option.page?.pagination || {}, z(e.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : C("", !0),
|
|
2652
|
+
e.option.tools?.expandColumn === void 0 || e.option.tools?.expandColumn ? (d(), y(w, {
|
|
2654
2653
|
key: 1,
|
|
2655
2654
|
effect: "dark",
|
|
2656
|
-
content: l(
|
|
2655
|
+
content: l(t).table.header.group.expand ? l(v).tCurd("mergeColumn") : l(v).tCurd("expandColumn"),
|
|
2657
2656
|
placement: "top"
|
|
2658
2657
|
}, {
|
|
2659
2658
|
default: g(() => [
|
|
2660
2659
|
U("div", {
|
|
2661
2660
|
class: R(["refresh-btn", [e.option.size?.search]]),
|
|
2662
|
-
onClick:
|
|
2663
|
-
(...
|
|
2661
|
+
onClick: u[6] || (u[6] = //@ts-ignore
|
|
2662
|
+
(...h) => l(t).table.header.group.toggleExpandAll && l(t).table.header.group.toggleExpandAll(...h))
|
|
2664
2663
|
}, [
|
|
2665
|
-
l(
|
|
2664
|
+
l(t).table.header.group.expand ? (d(), y(Dt, { key: 0 })) : (d(), y(Mt, { key: 1 }))
|
|
2666
2665
|
], 2)
|
|
2667
2666
|
]),
|
|
2668
2667
|
_: 1
|
|
2669
|
-
}, 8, ["content"])) :
|
|
2670
|
-
e.option.tools?.refresh === void 0 || e.option.tools?.refresh ? (
|
|
2668
|
+
}, 8, ["content"])) : C("", !0),
|
|
2669
|
+
e.option.tools?.refresh === void 0 || e.option.tools?.refresh ? (d(), b("div", {
|
|
2671
2670
|
key: 2,
|
|
2672
2671
|
class: R(["refresh-btn", [e.option.size?.search]]),
|
|
2673
|
-
onClick:
|
|
2674
|
-
(...
|
|
2672
|
+
onClick: u[7] || (u[7] = //@ts-ignore
|
|
2673
|
+
(...h) => l(t).table.getList && l(t).table.getList(...h))
|
|
2675
2674
|
}, [
|
|
2676
2675
|
E(Ze)
|
|
2677
|
-
], 2)) :
|
|
2676
|
+
], 2)) : C("", !0)
|
|
2678
2677
|
])
|
|
2679
2678
|
]),
|
|
2680
2679
|
U("div", {
|
|
@@ -2683,18 +2682,18 @@ const Mt = /* @__PURE__ */ X(Et, [["render", St]]), he = /* @__PURE__ */ K({
|
|
|
2683
2682
|
U("div", {
|
|
2684
2683
|
class: R(["column form-box-content", [e.option.table?.fitHeight ? "absolute fit" : ""]])
|
|
2685
2684
|
}, [
|
|
2686
|
-
Me((
|
|
2685
|
+
Me((d(), y(l(De), V({
|
|
2687
2686
|
ref_key: "tableRef",
|
|
2688
2687
|
ref: i,
|
|
2689
|
-
data: l(
|
|
2688
|
+
data: l(t).table.data,
|
|
2690
2689
|
border: e.option.table?.border === void 0 ? !0 : e.option.table?.border,
|
|
2691
|
-
onSelectionChange: l(
|
|
2692
|
-
onSortChange: l(
|
|
2693
|
-
"expand-row-keys": l(
|
|
2694
|
-
onExpandChange: l(
|
|
2695
|
-
}, e.option.table,
|
|
2690
|
+
onSelectionChange: l(t).table.selection.change,
|
|
2691
|
+
onSortChange: l(t).table.sort.change,
|
|
2692
|
+
"expand-row-keys": l(t).table.expand.rowKeys,
|
|
2693
|
+
onExpandChange: l(t).table.expand.change
|
|
2694
|
+
}, e.option.table, z(e.option.table?.on || {})), {
|
|
2696
2695
|
default: g(() => [
|
|
2697
|
-
(typeof e.option.table?.selectable == "object" ? e.option.table?.selectable?.show : e.option.table?.selectable) || l(
|
|
2696
|
+
(typeof e.option.table?.selectable == "object" ? e.option.table?.selectable?.show : e.option.table?.selectable) || l(o)(e.option.tools?.delete) || e.option.tools?.export?.show && e.option.tools?.export?.select ? (d(), y(l(ae), V({
|
|
2698
2697
|
key: 0,
|
|
2699
2698
|
type: "selection",
|
|
2700
2699
|
width: "40",
|
|
@@ -2702,8 +2701,8 @@ const Mt = /* @__PURE__ */ X(Et, [["render", St]]), he = /* @__PURE__ */ K({
|
|
|
2702
2701
|
fixed: "left",
|
|
2703
2702
|
"show-overflow-tooltip": !1,
|
|
2704
2703
|
className: "cc1-form-selectable-column"
|
|
2705
|
-
}, typeof e.option.table?.selectable == "object" ? e.option.table?.selectable : {},
|
|
2706
|
-
(typeof e.option.table?.index == "object" ? e.option.table?.index?.show : e.option.table?.index) ? (
|
|
2704
|
+
}, typeof e.option.table?.selectable == "object" ? e.option.table?.selectable : {}, z(typeof e.option.table?.selectable == "object" ? e.option.table?.selectable?.on || {} : {})), null, 16)) : C("", !0),
|
|
2705
|
+
(typeof e.option.table?.index == "object" ? e.option.table?.index?.show : e.option.table?.index) ? (d(), y(l(ae), V({
|
|
2707
2706
|
key: 1,
|
|
2708
2707
|
type: "index",
|
|
2709
2708
|
fixed: "left",
|
|
@@ -2712,20 +2711,20 @@ const Mt = /* @__PURE__ */ X(Et, [["render", St]]), he = /* @__PURE__ */ K({
|
|
|
2712
2711
|
label: "#",
|
|
2713
2712
|
"show-overflow-tooltip": !1,
|
|
2714
2713
|
className: "cc1-form-index-column"
|
|
2715
|
-
}, typeof e.option.table?.index == "object" ? e.option.table?.index : {},
|
|
2714
|
+
}, typeof e.option.table?.index == "object" ? e.option.table?.index : {}, z(typeof e.option.table?.index == "object" ? e.option.table?.index?.on || {} : {})), null, 16)) : C("", !0),
|
|
2716
2715
|
E(wt, {
|
|
2717
|
-
conf: l(
|
|
2718
|
-
columnList: l(
|
|
2716
|
+
conf: l(t),
|
|
2717
|
+
columnList: l(t).table.column.list,
|
|
2719
2718
|
option: e.option
|
|
2720
|
-
},
|
|
2721
|
-
|
|
2722
|
-
name:
|
|
2723
|
-
fn: g((
|
|
2724
|
-
|
|
2719
|
+
}, G({ _: 2 }, [
|
|
2720
|
+
A(m.$slots, (h, p) => ({
|
|
2721
|
+
name: p,
|
|
2722
|
+
fn: g((k) => [
|
|
2723
|
+
x(m.$slots, p, Fe(Ae(k || {})))
|
|
2725
2724
|
])
|
|
2726
2725
|
}))
|
|
2727
2726
|
]), 1032, ["conf", "columnList", "option"]),
|
|
2728
|
-
l(
|
|
2727
|
+
l(o)(e.option.table?.add) || l(o)(e.option.table?.update) || l(o)(e.option.table?.delete) || l(o)(e.option.table?.view) || m.$slots["table-op-left"] || m.$slots["table-op-right"] ? (d(), y(l(ae), V({
|
|
2729
2728
|
key: 2,
|
|
2730
2729
|
width: "auto",
|
|
2731
2730
|
"max-width": "200",
|
|
@@ -2733,208 +2732,208 @@ const Mt = /* @__PURE__ */ X(Et, [["render", St]]), he = /* @__PURE__ */ K({
|
|
|
2733
2732
|
fixed: "right"
|
|
2734
2733
|
}, e.option.table?.operate, { "show-overflow-tooltip": !1 }), {
|
|
2735
2734
|
header: g(() => [
|
|
2736
|
-
|
|
2737
|
-
O(S(l(
|
|
2735
|
+
x(m.$slots, "table-header-op", {}, () => [
|
|
2736
|
+
O(S(l(v).tCurd("operation")), 1)
|
|
2738
2737
|
])
|
|
2739
2738
|
]),
|
|
2740
|
-
default: g(({ row:
|
|
2741
|
-
E(l(
|
|
2739
|
+
default: g(({ row: h }) => [
|
|
2740
|
+
E(l(Q), {
|
|
2742
2741
|
size: e.option.size?.table
|
|
2743
2742
|
}, {
|
|
2744
2743
|
default: g(() => [
|
|
2745
|
-
|
|
2746
|
-
l(
|
|
2747
|
-
E(l(
|
|
2744
|
+
x(m.$slots, "table-op-left", { row: h }),
|
|
2745
|
+
l(t).update.type === l(s).Update && e.option.table?.inlineEdit && l(t).update.form[c.option.table?.rowKey] === h[c.option.table?.rowKey] ? (d(), b($, { key: 0 }, [
|
|
2746
|
+
E(l(T), {
|
|
2748
2747
|
link: "",
|
|
2749
2748
|
type: "info",
|
|
2750
|
-
onClick: l(
|
|
2749
|
+
onClick: l(t).update.close
|
|
2751
2750
|
}, {
|
|
2752
2751
|
default: g(() => [
|
|
2753
|
-
O(S(l(
|
|
2752
|
+
O(S(l(v).tCurd("cancel")), 1)
|
|
2754
2753
|
]),
|
|
2755
2754
|
_: 1
|
|
2756
2755
|
}, 8, ["onClick"]),
|
|
2757
|
-
E(l(
|
|
2756
|
+
E(l(T), {
|
|
2758
2757
|
link: "",
|
|
2759
2758
|
type: "primary",
|
|
2760
|
-
onClick: l(
|
|
2761
|
-
loading: l(
|
|
2759
|
+
onClick: l(t).update.submit,
|
|
2760
|
+
loading: l(t).update.loading
|
|
2762
2761
|
}, {
|
|
2763
2762
|
default: g(() => [
|
|
2764
|
-
O(S(l(
|
|
2763
|
+
O(S(l(v).tCurd("confirm")), 1)
|
|
2765
2764
|
]),
|
|
2766
2765
|
_: 1
|
|
2767
2766
|
}, 8, ["onClick", "loading"]),
|
|
2768
|
-
|
|
2769
|
-
], 64)) : (
|
|
2770
|
-
l(
|
|
2767
|
+
x(m.$slots, "table-op-edit-right", { row: h })
|
|
2768
|
+
], 64)) : (d(), b($, { key: 1 }, [
|
|
2769
|
+
l(o)(e.option.table?.add, h) ? (d(), y(l(T), {
|
|
2771
2770
|
key: 0,
|
|
2772
2771
|
link: "",
|
|
2773
2772
|
type: "primary",
|
|
2774
|
-
onClick: (
|
|
2773
|
+
onClick: (p) => l(t).update.open(l(s).Add, h)
|
|
2775
2774
|
}, {
|
|
2776
2775
|
default: g(() => [
|
|
2777
|
-
O(S(l(
|
|
2776
|
+
O(S(l(v).tCurd("add")), 1)
|
|
2778
2777
|
]),
|
|
2779
2778
|
_: 1
|
|
2780
|
-
}, 8, ["onClick"])) :
|
|
2781
|
-
l(
|
|
2779
|
+
}, 8, ["onClick"])) : C("", !0),
|
|
2780
|
+
l(o)(e.option.table?.view, h) ? (d(), y(l(T), {
|
|
2782
2781
|
key: 1,
|
|
2783
2782
|
link: "",
|
|
2784
2783
|
type: "primary",
|
|
2785
|
-
onClick: (
|
|
2784
|
+
onClick: (p) => l(t).update.open(l(s).View, h)
|
|
2786
2785
|
}, {
|
|
2787
2786
|
default: g(() => [
|
|
2788
|
-
O(S(l(
|
|
2787
|
+
O(S(l(v).tCurd("view")), 1)
|
|
2789
2788
|
]),
|
|
2790
2789
|
_: 1
|
|
2791
|
-
}, 8, ["onClick"])) :
|
|
2792
|
-
l(
|
|
2790
|
+
}, 8, ["onClick"])) : C("", !0),
|
|
2791
|
+
l(o)(e.option.table?.update, h) ? (d(), y(l(T), {
|
|
2793
2792
|
key: 2,
|
|
2794
2793
|
link: "",
|
|
2795
2794
|
type: "warning",
|
|
2796
|
-
onClick: (
|
|
2795
|
+
onClick: (p) => l(t).update.open(l(s).Update, h)
|
|
2797
2796
|
}, {
|
|
2798
2797
|
default: g(() => [
|
|
2799
|
-
O(S(l(
|
|
2798
|
+
O(S(l(v).tCurd("edit")), 1)
|
|
2800
2799
|
]),
|
|
2801
2800
|
_: 1
|
|
2802
|
-
}, 8, ["onClick"])) :
|
|
2803
|
-
l(
|
|
2801
|
+
}, 8, ["onClick"])) : C("", !0),
|
|
2802
|
+
l(o)(e.option.table?.delete, h) ? (d(), y(l(T), {
|
|
2804
2803
|
key: 3,
|
|
2805
2804
|
link: "",
|
|
2806
2805
|
type: "danger",
|
|
2807
|
-
onClick: (
|
|
2806
|
+
onClick: (p) => l(t).remove.open([h])
|
|
2808
2807
|
}, {
|
|
2809
2808
|
default: g(() => [
|
|
2810
|
-
O(S(l(
|
|
2809
|
+
O(S(l(v).tCurd("delete")), 1)
|
|
2811
2810
|
]),
|
|
2812
2811
|
_: 1
|
|
2813
|
-
}, 8, ["onClick"])) :
|
|
2814
|
-
|
|
2812
|
+
}, 8, ["onClick"])) : C("", !0),
|
|
2813
|
+
x(m.$slots, "table-op-right", { row: h })
|
|
2815
2814
|
], 64))
|
|
2816
2815
|
]),
|
|
2817
2816
|
_: 2
|
|
2818
2817
|
}, 1032, ["size"])
|
|
2819
2818
|
]),
|
|
2820
2819
|
_: 3
|
|
2821
|
-
}, 16)) :
|
|
2820
|
+
}, 16)) : C("", !0)
|
|
2822
2821
|
]),
|
|
2823
2822
|
_: 3
|
|
2824
2823
|
}, 16, ["data", "border", "onSelectionChange", "onSortChange", "expand-row-keys", "onExpandChange"])), [
|
|
2825
|
-
[
|
|
2824
|
+
[f, l(t).table.loading]
|
|
2826
2825
|
])
|
|
2827
2826
|
], 2)
|
|
2828
2827
|
], 2),
|
|
2829
2828
|
U("div", Ht, [
|
|
2830
|
-
(e.option.page?.show === void 0 || e.option.page?.show) && !l(
|
|
2829
|
+
(e.option.page?.show === void 0 || e.option.page?.show) && !l(t).page.showTools ? (d(), y(l(me), V({
|
|
2831
2830
|
key: 0,
|
|
2832
|
-
"current-page": l(
|
|
2833
|
-
"onUpdate:currentPage":
|
|
2834
|
-
"page-size": l(
|
|
2835
|
-
"onUpdate:pageSize":
|
|
2831
|
+
"current-page": l(t).page.num,
|
|
2832
|
+
"onUpdate:currentPage": u[8] || (u[8] = (h) => l(t).page.num = h),
|
|
2833
|
+
"page-size": l(t).page.size,
|
|
2834
|
+
"onUpdate:pageSize": u[9] || (u[9] = (h) => l(t).page.size = h),
|
|
2836
2835
|
background: "",
|
|
2837
|
-
"page-sizes": l(
|
|
2838
|
-
"pager-count": l(
|
|
2839
|
-
layout: l(
|
|
2840
|
-
total: l(
|
|
2836
|
+
"page-sizes": l(t).page.sizeList,
|
|
2837
|
+
"pager-count": l(t).page.pagerCount,
|
|
2838
|
+
layout: l(t).page.layout,
|
|
2839
|
+
total: l(t).page.total,
|
|
2841
2840
|
size: e.option.size?.table,
|
|
2842
|
-
onSizeChange: l(
|
|
2843
|
-
onCurrentChange: l(
|
|
2844
|
-
}, e.option.page?.pagination || {},
|
|
2841
|
+
onSizeChange: l(t).table.getList,
|
|
2842
|
+
onCurrentChange: l(t).table.getList
|
|
2843
|
+
}, e.option.page?.pagination || {}, z(e.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : C("", !0)
|
|
2845
2844
|
])
|
|
2846
2845
|
], 2),
|
|
2847
|
-
|
|
2846
|
+
x(m.$slots, "box-right")
|
|
2848
2847
|
], 2),
|
|
2849
|
-
E(l(ie),
|
|
2850
|
-
modelValue: l(
|
|
2851
|
-
"onUpdate:modelValue":
|
|
2852
|
-
title: l(
|
|
2853
|
-
"before-close": l(
|
|
2848
|
+
E(l(ie), V({
|
|
2849
|
+
modelValue: l(t).update.show,
|
|
2850
|
+
"onUpdate:modelValue": u[10] || (u[10] = (h) => l(t).update.show = h),
|
|
2851
|
+
title: l(t).update.title,
|
|
2852
|
+
"before-close": l(t).update.close
|
|
2854
2853
|
}, e.option.dialog), {
|
|
2855
2854
|
footer: g(() => [
|
|
2856
2855
|
U("span", Kt, [
|
|
2857
|
-
E(l(
|
|
2856
|
+
E(l(Q), {
|
|
2858
2857
|
size: e.option.size?.form
|
|
2859
2858
|
}, {
|
|
2860
2859
|
default: g(() => [
|
|
2861
|
-
E(l(
|
|
2862
|
-
onClick: l(
|
|
2860
|
+
E(l(T), {
|
|
2861
|
+
onClick: l(t).update.close
|
|
2863
2862
|
}, {
|
|
2864
2863
|
default: g(() => [
|
|
2865
|
-
O(S(l(
|
|
2864
|
+
O(S(l(v).tCurd("close")), 1)
|
|
2866
2865
|
]),
|
|
2867
2866
|
_: 1
|
|
2868
2867
|
}, 8, ["onClick"]),
|
|
2869
|
-
l(
|
|
2868
|
+
l(t).update.type !== l(s).View ? (d(), y(l(T), {
|
|
2870
2869
|
key: 0,
|
|
2871
2870
|
type: "primary",
|
|
2872
|
-
onClick: l(
|
|
2873
|
-
loading: l(
|
|
2871
|
+
onClick: l(t).update.submit,
|
|
2872
|
+
loading: l(t).update.loading
|
|
2874
2873
|
}, {
|
|
2875
2874
|
default: g(() => [
|
|
2876
|
-
O(S(l(
|
|
2875
|
+
O(S(l(v).tCurd("submit")), 1)
|
|
2877
2876
|
]),
|
|
2878
2877
|
_: 1
|
|
2879
|
-
}, 8, ["onClick", "loading"])) :
|
|
2878
|
+
}, 8, ["onClick", "loading"])) : C("", !0)
|
|
2880
2879
|
]),
|
|
2881
2880
|
_: 1
|
|
2882
2881
|
}, 8, ["size"])
|
|
2883
2882
|
])
|
|
2884
2883
|
]),
|
|
2885
2884
|
default: g(() => [
|
|
2886
|
-
E(l(
|
|
2885
|
+
E(l(Q), {
|
|
2887
2886
|
ref_key: "ruleFormRef",
|
|
2888
|
-
ref:
|
|
2889
|
-
model: l(
|
|
2890
|
-
rules: l(
|
|
2887
|
+
ref: a,
|
|
2888
|
+
model: l(t).update.form,
|
|
2889
|
+
rules: l(t).update.rules,
|
|
2891
2890
|
size: e.option.size?.form,
|
|
2892
2891
|
class: "update-dialog-form"
|
|
2893
2892
|
}, {
|
|
2894
2893
|
default: g(() => [
|
|
2895
|
-
l(
|
|
2896
|
-
l(
|
|
2894
|
+
l(t).update.showContent ? (d(!0), b($, { key: 0 }, A(l(t).update.formColumn, (h) => (d(), b($, null, [
|
|
2895
|
+
l(o)(
|
|
2897
2896
|
(() => {
|
|
2898
|
-
const
|
|
2899
|
-
|
|
2897
|
+
const p = [], k = (F) => {
|
|
2898
|
+
F?.item?.children ? k(F.item.children) : p.push(...F.map((B) => B.item?.show?.form));
|
|
2900
2899
|
};
|
|
2901
|
-
return
|
|
2900
|
+
return k(h), p;
|
|
2902
2901
|
})(),
|
|
2903
|
-
l(
|
|
2904
|
-
l(
|
|
2905
|
-
) ? (
|
|
2902
|
+
l(t).update.form,
|
|
2903
|
+
l(t).update.type
|
|
2904
|
+
) ? (d(), b("div", {
|
|
2906
2905
|
key: 0,
|
|
2907
2906
|
class: R(["row curd-row", {
|
|
2908
2907
|
stripe: e.option.form?.stripe === void 0 ? !0 : e.option.form?.stripe
|
|
2909
2908
|
}])
|
|
2910
2909
|
}, [
|
|
2911
|
-
|
|
2912
|
-
row: l(
|
|
2910
|
+
x(m.$slots, "form-start", {
|
|
2911
|
+
row: l(t).update.form
|
|
2913
2912
|
}),
|
|
2914
|
-
(
|
|
2915
|
-
l(
|
|
2913
|
+
(d(!0), b($, null, A(h, (p) => (d(), b($, null, [
|
|
2914
|
+
l(o)(p.item.show?.form, l(t).update.form, l(t).update.type) ? (d(), b("div", {
|
|
2916
2915
|
key: 0,
|
|
2917
|
-
class: R([
|
|
2916
|
+
class: R([p.item.form.span > 0 ? `col-${l(t).getColumnSpan(p, h)}` : "col", `form-item-col-${p.item.key}`])
|
|
2918
2917
|
}, [
|
|
2919
|
-
(
|
|
2920
|
-
key:
|
|
2921
|
-
conf: l(
|
|
2922
|
-
item:
|
|
2923
|
-
},
|
|
2924
|
-
|
|
2918
|
+
(d(!0), b($, null, A(p.item.children ? p.children : [p], (k) => (d(), y(xt, {
|
|
2919
|
+
key: k.item.key,
|
|
2920
|
+
conf: l(t),
|
|
2921
|
+
item: k
|
|
2922
|
+
}, G({ _: 2 }, [
|
|
2923
|
+
A(m.$slots, (F, B) => ({
|
|
2925
2924
|
name: B,
|
|
2926
|
-
fn: g((
|
|
2927
|
-
|
|
2925
|
+
fn: g((L) => [
|
|
2926
|
+
x(m.$slots, B, V({ ref_for: !0 }, L || {}))
|
|
2928
2927
|
])
|
|
2929
2928
|
}))
|
|
2930
2929
|
]), 1032, ["conf", "item"]))), 128))
|
|
2931
|
-
], 2)) :
|
|
2930
|
+
], 2)) : C("", !0)
|
|
2932
2931
|
], 64))), 256)),
|
|
2933
|
-
|
|
2934
|
-
row: l(
|
|
2932
|
+
x(m.$slots, "form-end", {
|
|
2933
|
+
row: l(t).update.form
|
|
2935
2934
|
})
|
|
2936
|
-
], 2)) :
|
|
2937
|
-
], 64))), 256)) :
|
|
2935
|
+
], 2)) : C("", !0)
|
|
2936
|
+
], 64))), 256)) : C("", !0)
|
|
2938
2937
|
]),
|
|
2939
2938
|
_: 3
|
|
2940
2939
|
}, 8, ["model", "rules", "size"])
|
|
@@ -2942,32 +2941,32 @@ const Mt = /* @__PURE__ */ X(Et, [["render", St]]), he = /* @__PURE__ */ K({
|
|
|
2942
2941
|
_: 3
|
|
2943
2942
|
}, 16, ["modelValue", "title", "before-close"]),
|
|
2944
2943
|
E(l(ie), {
|
|
2945
|
-
modelValue: l(
|
|
2946
|
-
"onUpdate:modelValue":
|
|
2947
|
-
title: l(
|
|
2944
|
+
modelValue: l(t).remove.show,
|
|
2945
|
+
"onUpdate:modelValue": u[11] || (u[11] = (h) => l(t).remove.show = h),
|
|
2946
|
+
title: l(t).remove.title,
|
|
2948
2947
|
"close-on-click-modal": !1
|
|
2949
2948
|
}, {
|
|
2950
2949
|
footer: g(() => [
|
|
2951
2950
|
U("span", Jt, [
|
|
2952
|
-
E(l(
|
|
2951
|
+
E(l(Q), {
|
|
2953
2952
|
size: e.option.size?.form
|
|
2954
2953
|
}, {
|
|
2955
2954
|
default: g(() => [
|
|
2956
|
-
E(l(
|
|
2957
|
-
onClick: l(
|
|
2955
|
+
E(l(T), {
|
|
2956
|
+
onClick: l(t).remove.close
|
|
2958
2957
|
}, {
|
|
2959
2958
|
default: g(() => [
|
|
2960
|
-
O(S(l(
|
|
2959
|
+
O(S(l(v).tCurd("close")), 1)
|
|
2961
2960
|
]),
|
|
2962
2961
|
_: 1
|
|
2963
2962
|
}, 8, ["onClick"]),
|
|
2964
|
-
E(l(
|
|
2963
|
+
E(l(T), {
|
|
2965
2964
|
type: "danger",
|
|
2966
|
-
onClick: l(
|
|
2967
|
-
loading: l(
|
|
2965
|
+
onClick: l(t).remove.submit,
|
|
2966
|
+
loading: l(t).remove.loading
|
|
2968
2967
|
}, {
|
|
2969
2968
|
default: g(() => [
|
|
2970
|
-
O(S(l(
|
|
2969
|
+
O(S(l(v).tCurd("confirmDelete")), 1)
|
|
2971
2970
|
]),
|
|
2972
2971
|
_: 1
|
|
2973
2972
|
}, 8, ["onClick", "loading"])
|
|
@@ -2977,18 +2976,18 @@ const Mt = /* @__PURE__ */ X(Et, [["render", St]]), he = /* @__PURE__ */ K({
|
|
|
2977
2976
|
])
|
|
2978
2977
|
]),
|
|
2979
2978
|
default: g(() => [
|
|
2980
|
-
e.option.dialog?.delete?.content ? (
|
|
2979
|
+
e.option.dialog?.delete?.content ? (d(), b("div", Nt, [
|
|
2981
2980
|
E(et, {
|
|
2982
2981
|
content: e.option.dialog?.delete?.content,
|
|
2983
|
-
value: l(
|
|
2982
|
+
value: l(t).remove.items
|
|
2984
2983
|
}, null, 8, ["content", "value"])
|
|
2985
|
-
])) : (
|
|
2984
|
+
])) : (d(), b("div", Wt, S(l(v).tCurd("confirmDeleteMessage", l(t).remove.items.length)), 1))
|
|
2986
2985
|
]),
|
|
2987
2986
|
_: 1
|
|
2988
2987
|
}, 8, ["modelValue", "title"]),
|
|
2989
2988
|
E(Qe, {
|
|
2990
2989
|
ref_key: "switchConfirmRef",
|
|
2991
|
-
ref:
|
|
2990
|
+
ref: n,
|
|
2992
2991
|
size: e.option.size?.form
|
|
2993
2992
|
}, null, 8, ["size"])
|
|
2994
2993
|
], 2);
|
|
@@ -3002,49 +3001,49 @@ class _t {
|
|
|
3002
3001
|
* @param href - 文件的远程地址
|
|
3003
3002
|
* @param name - 下载后的文件名,默认 `'download.png'`
|
|
3004
3003
|
*/
|
|
3005
|
-
static async download(r,
|
|
3006
|
-
const
|
|
3007
|
-
|
|
3004
|
+
static async download(r, s = "download.png") {
|
|
3005
|
+
const c = document.createElement("a");
|
|
3006
|
+
c.style.display = "none", c.href = r, c.setAttribute("download", s), typeof c.download > "u" && c.setAttribute("target", "_blank"), document.body.appendChild(c), c.click(), document.body.removeChild(c), window.URL.revokeObjectURL(r);
|
|
3008
3007
|
}
|
|
3009
3008
|
/**
|
|
3010
3009
|
* 将json对象或者json数组导出为json文件保存
|
|
3011
3010
|
* @param data
|
|
3012
3011
|
* @param name
|
|
3013
3012
|
*/
|
|
3014
|
-
static exportJSONFile = (r,
|
|
3015
|
-
const
|
|
3016
|
-
|
|
3013
|
+
static exportJSONFile = (r, s) => {
|
|
3014
|
+
const c = new Blob([JSON.stringify(r)], { type: "application/json" }), o = URL.createObjectURL(c), t = document.createElement("a");
|
|
3015
|
+
t.href = o, t.download = `${s || "config"}.json`, t.click();
|
|
3017
3016
|
};
|
|
3018
3017
|
/**
|
|
3019
3018
|
* 导入文件内容,默认为json
|
|
3020
3019
|
* @param param
|
|
3021
3020
|
* @returns
|
|
3022
3021
|
*/
|
|
3023
|
-
static importFile = async (r) => new Promise((
|
|
3024
|
-
const
|
|
3025
|
-
|
|
3026
|
-
const
|
|
3027
|
-
|
|
3028
|
-
const
|
|
3029
|
-
if (!
|
|
3030
|
-
D.fail("未选择文件"),
|
|
3022
|
+
static importFile = async (r) => new Promise((s, c) => {
|
|
3023
|
+
const o = document.createElement("input");
|
|
3024
|
+
o.type = "file";
|
|
3025
|
+
const t = r?.accept || ".json";
|
|
3026
|
+
o.accept = t, o.style.display = "none", o.onchange = (n) => {
|
|
3027
|
+
const a = n.target.files[0];
|
|
3028
|
+
if (!a) {
|
|
3029
|
+
D.fail("未选择文件"), c("未选择文件");
|
|
3031
3030
|
return;
|
|
3032
3031
|
}
|
|
3033
3032
|
const i = new FileReader();
|
|
3034
|
-
i.onload = async (
|
|
3035
|
-
const
|
|
3036
|
-
u
|
|
3033
|
+
i.onload = async (m) => {
|
|
3034
|
+
const u = t == ".json" ? JSON.parse(m.target.result) : m.target.result;
|
|
3035
|
+
s(u);
|
|
3037
3036
|
}, i.onerror = () => {
|
|
3038
|
-
D.fail("文件读取失败"),
|
|
3039
|
-
}, i.readAsText(
|
|
3040
|
-
}, document.body.appendChild(
|
|
3037
|
+
D.fail("文件读取失败"), c("文件读取失败");
|
|
3038
|
+
}, i.readAsText(a), document.body.removeChild(o);
|
|
3039
|
+
}, document.body.appendChild(o), o.click();
|
|
3041
3040
|
});
|
|
3042
3041
|
}
|
|
3043
3042
|
const Qt = (e, r) => {
|
|
3044
3043
|
if (e.component("TCurd", qt), e.component("TFormList", fe), e.component("TColumn", Ne), r?.customComponent) {
|
|
3045
3044
|
j.customComponent = r.customComponent;
|
|
3046
|
-
for (const
|
|
3047
|
-
e.component(
|
|
3045
|
+
for (const s in r.customComponent)
|
|
3046
|
+
e.component(s, r.customComponent[s]);
|
|
3048
3047
|
}
|
|
3049
3048
|
}, eo = {
|
|
3050
3049
|
install: Qt
|
|
@@ -3057,7 +3056,7 @@ export {
|
|
|
3057
3056
|
_t as TFile,
|
|
3058
3057
|
j as TForm,
|
|
3059
3058
|
M as TFormConfig,
|
|
3060
|
-
|
|
3059
|
+
v as TFormI18n,
|
|
3061
3060
|
fe as TFormList,
|
|
3062
3061
|
D as TSys,
|
|
3063
3062
|
eo as default,
|