cc1-form 1.2.9 → 1.2.11
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 +767 -734
- package/dist/cc1-form.umd.cjs +1 -1
- package/dist/components/TCurd/index.vue.d.ts +40 -26
- package/package.json +1 -1
package/dist/cc1-form.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ElMessage as ce, ElLoading as me, ElForm as W, ElFormItem as ee, ElInput as
|
|
1
|
+
import { ElMessage as ce, ElLoading as me, ElForm as W, ElFormItem as ee, ElInput as x, ElSwitch as Z, ElSelect as q, ElOption as K, ElRadioGroup as le, ElRadio as ne, ElTreeSelect as ue, ElDatePicker as ie, ElDialog as oe, ElButton as L, ElTableColumn as ae, ElDropdown as he, ElDropdownMenu as ge, ElDropdownItem as te, ElPagination as de, ElTable as ye } from "element-plus";
|
|
2
2
|
import "vue-router";
|
|
3
|
-
import { defineComponent as
|
|
3
|
+
import { defineComponent as G, reactive as re, onMounted as fe, resolveComponent as _, createElementBlock as b, createCommentVNode as v, openBlock as f, renderSlot as C, createVNode as E, withCtx as y, createTextVNode as U, Fragment as $, renderList as F, createBlock as g, normalizeClass as I, normalizeStyle as pe, ref as N, unref as o, createElementVNode as D, mergeProps as V, toHandlers as z, resolveDynamicComponent as Q, nextTick as be, toDisplayString as O, getCurrentInstance as we, createSlots as J, withModifiers as ke, resolveDirective as ve, withDirectives as Ce, normalizeProps as Ve, guardReactiveProps as ze } from "vue";
|
|
4
4
|
class M {
|
|
5
5
|
/**
|
|
6
6
|
* Vue Router 实例,需在应用初始化时赋值
|
|
@@ -26,13 +26,13 @@ class M {
|
|
|
26
26
|
* @param data 数据
|
|
27
27
|
* @returns 是否显示
|
|
28
28
|
*/
|
|
29
|
-
static isFun = (
|
|
29
|
+
static isFun = (a, ...p) => Array.isArray(a) ? a.some((s) => typeof s == "function" ? s(...p) : s) : typeof a == "function" ? a(...p) : a;
|
|
30
30
|
/**
|
|
31
31
|
* 获取路由参数,自动获取query、params中的参数, 哪个有就返回哪个
|
|
32
32
|
*/
|
|
33
33
|
static getRouterParams = () => {
|
|
34
|
-
const
|
|
35
|
-
return Object.keys(
|
|
34
|
+
const a = this.router.currentRoute.value.query || {}, p = this.router.currentRoute.value.params || {};
|
|
35
|
+
return Object.keys(a).length ? a : Object.keys(p).length ? p : {};
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
38
38
|
* 模块赋值
|
|
@@ -42,10 +42,10 @@ class M {
|
|
|
42
42
|
* 加载模块
|
|
43
43
|
* @param module
|
|
44
44
|
*/
|
|
45
|
-
static loadModule = async (
|
|
46
|
-
if (!M.moduleObj[
|
|
47
|
-
throw new Error(`模块${
|
|
48
|
-
const p = await M.moduleObj[
|
|
45
|
+
static loadModule = async (a) => {
|
|
46
|
+
if (!M.moduleObj[a])
|
|
47
|
+
throw new Error(`模块${a}未加载,请赋值如:TSys.moduleObj = { ${a}: ()=>import('${a}') }`);
|
|
48
|
+
const p = await M.moduleObj[a]();
|
|
49
49
|
return p.default ?? p;
|
|
50
50
|
};
|
|
51
51
|
/**
|
|
@@ -62,19 +62,19 @@ class M {
|
|
|
62
62
|
* @param type 消息类型
|
|
63
63
|
* @param options 其他选项
|
|
64
64
|
*/
|
|
65
|
-
static showMessage(
|
|
65
|
+
static showMessage(a, p, s = {}) {
|
|
66
66
|
const l = Date.now();
|
|
67
|
-
if (!this.tipMessages[
|
|
68
|
-
this.tipMessages[
|
|
67
|
+
if (!this.tipMessages[a] || l - this.tipMessages[a] > this.tipMessagesGap) {
|
|
68
|
+
this.tipMessages[a] = l;
|
|
69
69
|
const t = Object.assign(
|
|
70
70
|
{
|
|
71
|
-
message:
|
|
71
|
+
message: a,
|
|
72
72
|
type: p
|
|
73
73
|
},
|
|
74
74
|
s
|
|
75
75
|
);
|
|
76
76
|
ce(t), setTimeout(() => {
|
|
77
|
-
delete this.tipMessages[
|
|
77
|
+
delete this.tipMessages[a];
|
|
78
78
|
}, this.tipMessagesGap);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -83,16 +83,16 @@ class M {
|
|
|
83
83
|
* @param content
|
|
84
84
|
* @param options
|
|
85
85
|
*/
|
|
86
|
-
static fail = (
|
|
87
|
-
this.showMessage(
|
|
86
|
+
static fail = (a, p = {}) => {
|
|
87
|
+
this.showMessage(a, "error", p);
|
|
88
88
|
};
|
|
89
89
|
/**
|
|
90
90
|
* 成功提示
|
|
91
91
|
* @param content
|
|
92
92
|
* @param options
|
|
93
93
|
*/
|
|
94
|
-
static success = (
|
|
95
|
-
this.showMessage(
|
|
94
|
+
static success = (a, p = {}) => {
|
|
95
|
+
this.showMessage(a, "success", p);
|
|
96
96
|
};
|
|
97
97
|
static loadingObj = null;
|
|
98
98
|
static loadingTimer = null;
|
|
@@ -101,9 +101,9 @@ class M {
|
|
|
101
101
|
* @param show
|
|
102
102
|
* @param text
|
|
103
103
|
*/
|
|
104
|
-
static loading = (
|
|
104
|
+
static loading = (a = !0, p = "Loading...") => {
|
|
105
105
|
Timer.un(this.loadingTimer), this.loadingTimer = Timer.once(() => {
|
|
106
|
-
|
|
106
|
+
a ? this.loadingObj = me.service({
|
|
107
107
|
lock: !0,
|
|
108
108
|
text: p,
|
|
109
109
|
background: "rgba(0, 0, 0, 0.3)"
|
|
@@ -115,39 +115,39 @@ class M {
|
|
|
115
115
|
* @param url 地址
|
|
116
116
|
* @param isCenter 是否居中
|
|
117
117
|
*/
|
|
118
|
-
static openUrl = (
|
|
118
|
+
static openUrl = (a, p = !0) => {
|
|
119
119
|
if (p) {
|
|
120
120
|
let s = screen.width / 2 - 500, l = screen.height / 2 - 800 / 2 - 30;
|
|
121
121
|
window.open(
|
|
122
|
-
|
|
122
|
+
a,
|
|
123
123
|
"_blank",
|
|
124
124
|
"toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + l + ", left=" + s
|
|
125
125
|
);
|
|
126
126
|
} else
|
|
127
|
-
window.open(
|
|
127
|
+
window.open(a, "DescriptiveWindowName" + StrUtil.getId(), "resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0");
|
|
128
128
|
};
|
|
129
129
|
/**
|
|
130
130
|
* 根据dom id截图并返回图片数据
|
|
131
131
|
* @param param
|
|
132
132
|
* @returns
|
|
133
133
|
*/
|
|
134
|
-
static getImgPic = (
|
|
135
|
-
let l = document.getElementById(
|
|
134
|
+
static getImgPic = (a) => new Promise(async (p, s) => {
|
|
135
|
+
let l = document.getElementById(a.id);
|
|
136
136
|
const t = await M.loadModule("html2canvas");
|
|
137
137
|
try {
|
|
138
138
|
t(l, {
|
|
139
139
|
logging: !1,
|
|
140
140
|
allowTaint: !0,
|
|
141
141
|
scale: window.devicePixelRatio,
|
|
142
|
-
width:
|
|
143
|
-
height:
|
|
144
|
-
windowWidth:
|
|
145
|
-
windowHeight:
|
|
142
|
+
width: a.windowWidth,
|
|
143
|
+
height: a.windowHeight,
|
|
144
|
+
windowWidth: a.windowWidth,
|
|
145
|
+
windowHeight: a.windowHeight,
|
|
146
146
|
useCORS: !0,
|
|
147
147
|
backgroundColor: "#ffffff00"
|
|
148
148
|
}).then(function(e) {
|
|
149
|
-
let
|
|
150
|
-
p(
|
|
149
|
+
let r = e.toDataURL("image/png");
|
|
150
|
+
p(r);
|
|
151
151
|
});
|
|
152
152
|
} catch (e) {
|
|
153
153
|
s(e);
|
|
@@ -511,11 +511,11 @@ class A {
|
|
|
511
511
|
*
|
|
512
512
|
* @param config - 需要覆盖的配置项(深度 Partial)
|
|
513
513
|
*/
|
|
514
|
-
static setConfig = (
|
|
515
|
-
A.config = ObjectUtil.deepMerge(A.config,
|
|
514
|
+
static setConfig = (a) => {
|
|
515
|
+
A.config = ObjectUtil.deepMerge(A.config, a);
|
|
516
516
|
};
|
|
517
517
|
}
|
|
518
|
-
class
|
|
518
|
+
class B {
|
|
519
519
|
/**
|
|
520
520
|
* 自定义组件映射表,key 为组件名(同时作为 column.type 值),value 为 Vue 组件定义
|
|
521
521
|
*
|
|
@@ -533,8 +533,8 @@ class L {
|
|
|
533
533
|
* @param field - 字段的 key 值
|
|
534
534
|
* @returns 该字段对应类型的 options 配置,如 select 类型返回 `options.select`
|
|
535
535
|
*/
|
|
536
|
-
static findOptions = (
|
|
537
|
-
const s =
|
|
536
|
+
static findOptions = (a, p) => {
|
|
537
|
+
const s = a.column.find((t) => t.key === p), l = (t) => t.replace(/-([a-z])/g, (e, r) => r.toUpperCase());
|
|
538
538
|
if (s)
|
|
539
539
|
return s.options[l(s.type)];
|
|
540
540
|
};
|
|
@@ -554,8 +554,8 @@ class L {
|
|
|
554
554
|
}))
|
|
555
555
|
)
|
|
556
556
|
*/
|
|
557
|
-
static setOptionsData = (
|
|
558
|
-
const l =
|
|
557
|
+
static setOptionsData = (a, p, s) => {
|
|
558
|
+
const l = B.findOptions(a, p);
|
|
559
559
|
l && (l.data = s);
|
|
560
560
|
};
|
|
561
561
|
static form = {
|
|
@@ -567,9 +567,9 @@ class L {
|
|
|
567
567
|
* @param treeData 树形数据
|
|
568
568
|
* @param option 组件配置
|
|
569
569
|
*/
|
|
570
|
-
parentId: (
|
|
570
|
+
parentId: (a, p, s, l) => {
|
|
571
571
|
const t = A.config.table.rowKey;
|
|
572
|
-
|
|
572
|
+
a ? p.type === M.EDialog.Add ? (p.form.parentId = a[t], p.form.sort = a.children.length + 1) : p.form.parentId = a.parentId.substring(a.parentId.lastIndexOf(",") + 1) : (p.form.parentId = "0", p.form.sort = s.length + 1), B.setOptionsData(l, "parentId", [{ [t]: "0", title: "根", children: s }]);
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
575
|
};
|
|
@@ -611,24 +611,24 @@ const $e = {
|
|
|
611
611
|
};
|
|
612
612
|
class w {
|
|
613
613
|
/** 解析国际化值:函数则执行并返回字符串,字符串则替换 `{key}` 占位符 */
|
|
614
|
-
static t(
|
|
615
|
-
if (typeof
|
|
616
|
-
return
|
|
617
|
-
|
|
614
|
+
static t(a, ...p) {
|
|
615
|
+
if (typeof a == "function")
|
|
616
|
+
return a(...p);
|
|
617
|
+
a = String(a);
|
|
618
618
|
let s = 0;
|
|
619
|
-
return
|
|
619
|
+
return a.replace(/{([^}]+)}/g, (l, t) => s < p.length ? String(p[s++]) : `{${t}}`);
|
|
620
620
|
}
|
|
621
|
-
static setI18n = (
|
|
622
|
-
w.curd = ObjectUtil.deepMerge(w.curd,
|
|
621
|
+
static setI18n = (a) => {
|
|
622
|
+
w.curd = ObjectUtil.deepMerge(w.curd, a);
|
|
623
623
|
};
|
|
624
624
|
/** 解析curd国际化值 */
|
|
625
|
-
static tCurd(
|
|
626
|
-
return this.t(this.curd[
|
|
625
|
+
static tCurd(a, ...p) {
|
|
626
|
+
return this.t(this.curd[a], ...p);
|
|
627
627
|
}
|
|
628
628
|
/** curd表单 */
|
|
629
629
|
static curd = $e;
|
|
630
630
|
}
|
|
631
|
-
class
|
|
631
|
+
class H {
|
|
632
632
|
/**
|
|
633
633
|
* ID 生成函数,默认使用 `StrUtil.uuid()`,可覆盖为自定义实现
|
|
634
634
|
*/
|
|
@@ -638,14 +638,14 @@ class K {
|
|
|
638
638
|
* @param field 字段名
|
|
639
639
|
* @param row 行数据
|
|
640
640
|
*/
|
|
641
|
-
static setId = (
|
|
642
|
-
p[
|
|
641
|
+
static setId = (a, p, s) => {
|
|
642
|
+
p[a] || (p[a] = []);
|
|
643
643
|
const l = A.config.table.rowKey;
|
|
644
|
-
p[
|
|
644
|
+
p[a].forEach((t) => {
|
|
645
645
|
s.forEach((e) => {
|
|
646
|
-
let
|
|
647
|
-
e.type === "number" && (
|
|
648
|
-
}), t[l] || (t[l] =
|
|
646
|
+
let r = e.default ?? "";
|
|
647
|
+
e.type === "number" && (r = e.default ?? 0), e.type === "boolean" && (r = e.default ?? !1), e.type === "time" && (r = e.default ?? /* @__PURE__ */ new Date()), t[e.value] === void 0 && (t[e.value] = r);
|
|
648
|
+
}), t[l] || (t[l] = H.getIdFun());
|
|
649
649
|
});
|
|
650
650
|
};
|
|
651
651
|
/**
|
|
@@ -655,17 +655,17 @@ class K {
|
|
|
655
655
|
* @param itemFields 元素字段-如:[{label:'',value:''}]
|
|
656
656
|
* @param callback 回调函数
|
|
657
657
|
*/
|
|
658
|
-
static add = (
|
|
658
|
+
static add = (a, p, s, l) => {
|
|
659
659
|
const t = JSONUtil.cp(s);
|
|
660
|
-
|
|
660
|
+
H.setId(a, p, s);
|
|
661
661
|
const e = A.config.table.rowKey;
|
|
662
|
-
p[
|
|
662
|
+
p[a].push(
|
|
663
663
|
t.reduce(
|
|
664
|
-
(
|
|
664
|
+
(r, d) => {
|
|
665
665
|
let m = d.default ?? "";
|
|
666
|
-
return d.type === "number" && (m = d.default ?? 0), d.type === "boolean" && (m = d.default ?? !1), d.type === "time" && (m = d.default ?? /* @__PURE__ */ new Date()),
|
|
666
|
+
return d.type === "number" && (m = d.default ?? 0), d.type === "boolean" && (m = d.default ?? !1), d.type === "time" && (m = d.default ?? /* @__PURE__ */ new Date()), r[d.value] = m, r;
|
|
667
667
|
},
|
|
668
|
-
{ [e]:
|
|
668
|
+
{ [e]: H.getIdFun() }
|
|
669
669
|
)
|
|
670
670
|
), l?.(p);
|
|
671
671
|
};
|
|
@@ -676,9 +676,9 @@ class K {
|
|
|
676
676
|
* @param item 元素-如:{_id:''}
|
|
677
677
|
* @param callback 回调函数
|
|
678
678
|
*/
|
|
679
|
-
static remove = (
|
|
679
|
+
static remove = (a, p, s, l) => {
|
|
680
680
|
const t = A.config.table.rowKey;
|
|
681
|
-
p[
|
|
681
|
+
p[a] = p[a].filter((e) => e[t] !== s[t]), l?.(p);
|
|
682
682
|
};
|
|
683
683
|
/**
|
|
684
684
|
* 获取没有id的数据
|
|
@@ -686,21 +686,21 @@ class K {
|
|
|
686
686
|
* @param childernField 子级字段-如:list、children
|
|
687
687
|
* @returns 没有id的数据
|
|
688
688
|
*/
|
|
689
|
-
static getNoIdData = (
|
|
690
|
-
const s = JSONUtil.cp(
|
|
689
|
+
static getNoIdData = (a, p) => {
|
|
690
|
+
const s = JSONUtil.cp(a), l = A.config.table.rowKey;
|
|
691
691
|
return s.forEach((t) => {
|
|
692
|
-
t[l] && delete t[l], p && t[p] &&
|
|
692
|
+
t[l] && delete t[l], p && t[p] && H.getNoIdData(t[p], p);
|
|
693
693
|
}), s;
|
|
694
694
|
};
|
|
695
695
|
}
|
|
696
|
-
const
|
|
696
|
+
const Ue = {
|
|
697
697
|
key: 0,
|
|
698
698
|
class: "column curd-form-com-list",
|
|
699
699
|
style: { width: "100%", gap: "10px" }
|
|
700
|
-
},
|
|
700
|
+
}, De = { key: 0 }, Ee = {
|
|
701
701
|
class: "row items-center",
|
|
702
702
|
style: { gap: "10px", width: "100%" }
|
|
703
|
-
}, Oe = { key: 1 },
|
|
703
|
+
}, Oe = { key: 1 }, se = /* @__PURE__ */ G({
|
|
704
704
|
__name: "list",
|
|
705
705
|
props: {
|
|
706
706
|
row: {
|
|
@@ -738,88 +738,88 @@ const De = {
|
|
|
738
738
|
}
|
|
739
739
|
},
|
|
740
740
|
emits: ["change"],
|
|
741
|
-
setup(
|
|
742
|
-
const p =
|
|
741
|
+
setup(i, { emit: a }) {
|
|
742
|
+
const p = i, s = re({
|
|
743
743
|
show: !1,
|
|
744
|
-
add: (t, e,
|
|
745
|
-
|
|
744
|
+
add: (t, e, r) => {
|
|
745
|
+
H.add(t, e, r, () => {
|
|
746
746
|
l("change");
|
|
747
747
|
});
|
|
748
748
|
},
|
|
749
|
-
remove: (t, e,
|
|
750
|
-
|
|
749
|
+
remove: (t, e, r) => {
|
|
750
|
+
H.remove(t, e, r, () => {
|
|
751
751
|
l("change");
|
|
752
752
|
});
|
|
753
753
|
}
|
|
754
754
|
});
|
|
755
755
|
fe(() => {
|
|
756
|
-
|
|
756
|
+
H.setId(p.field, p.row, p.itemFields), s.show = !0;
|
|
757
757
|
});
|
|
758
|
-
const l =
|
|
758
|
+
const l = a;
|
|
759
759
|
return (t, e) => {
|
|
760
|
-
const
|
|
761
|
-
return s.show ? (f(), b("div",
|
|
762
|
-
C(t.$slots, "list-start", { row:
|
|
763
|
-
|
|
764
|
-
|
|
760
|
+
const r = _("el-button"), d = _("el-input");
|
|
761
|
+
return s.show ? (f(), b("div", Ue, [
|
|
762
|
+
C(t.$slots, "list-start", { row: i.row }),
|
|
763
|
+
i.addBottom ? v("", !0) : (f(), b("div", De, [
|
|
764
|
+
E(r, {
|
|
765
765
|
link: "",
|
|
766
766
|
type: "primary",
|
|
767
|
-
onClick: e[0] || (e[0] = (m) => s.add(
|
|
767
|
+
onClick: e[0] || (e[0] = (m) => s.add(i.field, i.row, i.itemFields))
|
|
768
768
|
}, {
|
|
769
769
|
default: y(() => e[3] || (e[3] = [
|
|
770
|
-
|
|
770
|
+
U("添加")
|
|
771
771
|
])),
|
|
772
772
|
_: 1
|
|
773
773
|
})
|
|
774
774
|
])),
|
|
775
|
-
(f(!0), b(
|
|
775
|
+
(f(!0), b($, null, F(i.row[i.field], (m) => (f(), b("div", Ee, [
|
|
776
776
|
C(t.$slots, "item-start", {
|
|
777
777
|
item: m,
|
|
778
|
-
row:
|
|
778
|
+
row: i.row
|
|
779
779
|
}),
|
|
780
|
-
(f(!0), b(
|
|
780
|
+
(f(!0), b($, null, F(i.itemFields, (c) => (f(), g(d, {
|
|
781
781
|
modelValue: m[c.value],
|
|
782
782
|
"onUpdate:modelValue": (u) => m[c.value] = u,
|
|
783
|
-
style: pe({ width:
|
|
784
|
-
class: I(
|
|
785
|
-
placeholder: c[
|
|
783
|
+
style: pe({ width: i.inputWidth }),
|
|
784
|
+
class: I(i.inputClass),
|
|
785
|
+
placeholder: c[i.label] || c[i.value],
|
|
786
786
|
onChange: e[1] || (e[1] = (u) => l("change"))
|
|
787
787
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "style", "class", "placeholder"]))), 256)),
|
|
788
788
|
C(t.$slots, "item-end", {
|
|
789
789
|
item: m,
|
|
790
|
-
row:
|
|
790
|
+
row: i.row
|
|
791
791
|
}),
|
|
792
|
-
|
|
792
|
+
E(r, {
|
|
793
793
|
link: "",
|
|
794
794
|
type: "danger",
|
|
795
|
-
onClick: (c) => s.remove(
|
|
795
|
+
onClick: (c) => s.remove(i.field, i.row, m)
|
|
796
796
|
}, {
|
|
797
797
|
default: y(() => e[4] || (e[4] = [
|
|
798
|
-
|
|
798
|
+
U("删除")
|
|
799
799
|
])),
|
|
800
800
|
_: 2
|
|
801
801
|
}, 1032, ["onClick"])
|
|
802
802
|
]))), 256)),
|
|
803
|
-
|
|
804
|
-
|
|
803
|
+
i.addBottom ? (f(), b("div", Oe, [
|
|
804
|
+
E(r, {
|
|
805
805
|
link: "",
|
|
806
806
|
type: "primary",
|
|
807
|
-
onClick: e[2] || (e[2] = (m) => s.add(
|
|
807
|
+
onClick: e[2] || (e[2] = (m) => s.add(i.field, i.row, i.itemFields))
|
|
808
808
|
}, {
|
|
809
809
|
default: y(() => e[5] || (e[5] = [
|
|
810
|
-
|
|
810
|
+
U("添加")
|
|
811
811
|
])),
|
|
812
812
|
_: 1
|
|
813
813
|
})
|
|
814
814
|
])) : v("", !0),
|
|
815
|
-
C(t.$slots, "list-end", { row:
|
|
815
|
+
C(t.$slots, "list-end", { row: i.row })
|
|
816
816
|
])) : v("", !0);
|
|
817
817
|
};
|
|
818
818
|
}
|
|
819
819
|
}), Se = {
|
|
820
820
|
class: "row form-item-content",
|
|
821
821
|
style: { width: "100%" }
|
|
822
|
-
}, Me = { class: "col" }, Ae = { class: "col" }, Fe = ["innerHTML"], Te = /* @__PURE__ */
|
|
822
|
+
}, Me = { class: "col" }, Ae = { class: "col" }, Fe = ["innerHTML"], Te = /* @__PURE__ */ G({
|
|
823
823
|
__name: "column",
|
|
824
824
|
props: {
|
|
825
825
|
/**
|
|
@@ -835,26 +835,26 @@ const De = {
|
|
|
835
835
|
default: ""
|
|
836
836
|
}
|
|
837
837
|
},
|
|
838
|
-
setup(
|
|
839
|
-
const p = M.isFun, s = M.EDialog, l = N(), t =
|
|
838
|
+
setup(i, { expose: a }) {
|
|
839
|
+
const p = M.isFun, s = M.EDialog, l = N(), t = i, e = re({
|
|
840
840
|
rules: {},
|
|
841
841
|
show: !0,
|
|
842
842
|
form: {},
|
|
843
843
|
formDefault: {},
|
|
844
844
|
type: t.type || s.Add,
|
|
845
845
|
formColumn: [],
|
|
846
|
-
getDisabled: (
|
|
847
|
-
getBind: (
|
|
848
|
-
getOn: (
|
|
849
|
-
getColumnSpan: (
|
|
850
|
-
if (
|
|
851
|
-
const m = t.option.form?.maxSpan || 12, c = t.option.form?.defaultSpan || m / 2, k = d.filter((
|
|
852
|
-
return (
|
|
846
|
+
getDisabled: (r) => e.type === s.View ? r.disabled?.view === void 0 ? !0 : r.disabled?.view : r.disabled?.[e.type === s.Add ? "create" : "update"],
|
|
847
|
+
getBind: (r) => r.options?.[e.type === s.Add ? "formAdd" : "formUpdate"]?.[r.type] || r.options?.[r.type] || {},
|
|
848
|
+
getOn: (r) => r.options?.[e.type === s.Add ? "formAdd" : "formUpdate"]?.[r.type]?.on || r.options?.[r.type]?.on || {},
|
|
849
|
+
getColumnSpan: (r, d) => {
|
|
850
|
+
if (r.item.form?.spanCol) {
|
|
851
|
+
const m = t.option.form?.maxSpan || 12, c = t.option.form?.defaultSpan || m / 2, k = d.filter((n) => !M.isFun(n.item.show?.form, e.form, e.type)).reduce((n, h) => n + (h.item.form?.span || c), 0);
|
|
852
|
+
return (r.item.form?.span || c) + k;
|
|
853
853
|
}
|
|
854
|
-
return
|
|
854
|
+
return r.item.form?.span;
|
|
855
855
|
},
|
|
856
856
|
initColumnForm: () => {
|
|
857
|
-
const
|
|
857
|
+
const r = t.option;
|
|
858
858
|
e.formColumn = [], e.rules = {}, e.formDefault = {};
|
|
859
859
|
const d = [], m = t.option.form?.maxSpan || 12, c = t.option.form?.defaultSpan || m / 2;
|
|
860
860
|
let u = [];
|
|
@@ -867,92 +867,92 @@ const De = {
|
|
|
867
867
|
}
|
|
868
868
|
if (e.formDefault[h.key] = h.value, h.isForm && (typeof h.show?.form != "boolean" || h.show?.form)) {
|
|
869
869
|
h.form = h.form || { span: c }, h.form.span = h.form.span ?? c;
|
|
870
|
-
const S = h.form.span, j = u.reduce((R,
|
|
871
|
-
if (u.push({ item: h, span: S }), (
|
|
870
|
+
const S = h.form.span, j = u.reduce((R, Y) => R + Y.span, S), T = u.length;
|
|
871
|
+
if (u.push({ item: h, span: S }), (T === 1 && u[0].span === 0 || j >= m || S === 0 && T > 1) && (d.push(u), u = []), h.rules) {
|
|
872
872
|
const R = {
|
|
873
873
|
input: w.tCurd("placeholderInput"),
|
|
874
874
|
select: w.tCurd("placeholderSelect")
|
|
875
|
-
},
|
|
875
|
+
}, Y = (R[h.type] || R.input) + h.label;
|
|
876
876
|
e.rules[h.key] = typeof h.rules == "boolean" ? [
|
|
877
877
|
{
|
|
878
878
|
required: !0,
|
|
879
|
-
message:
|
|
879
|
+
message: Y,
|
|
880
880
|
trigger: "blur"
|
|
881
881
|
}
|
|
882
882
|
] : h.rules;
|
|
883
883
|
}
|
|
884
884
|
}
|
|
885
|
-
},
|
|
886
|
-
h.isForm = S, Array.isArray(h.children) && h.children.forEach((j) =>
|
|
885
|
+
}, n = (h, S) => {
|
|
886
|
+
h.isForm = S, Array.isArray(h.children) && h.children.forEach((j) => n(j, S));
|
|
887
887
|
};
|
|
888
|
-
|
|
889
|
-
|
|
888
|
+
r.column.forEach((h) => {
|
|
889
|
+
n(h, !0), k(h);
|
|
890
890
|
}), u.length > 0 && d.push(u), e.formColumn = d, e.form = JSONUtil.cp(e.formDefault);
|
|
891
891
|
}
|
|
892
892
|
});
|
|
893
|
-
return e.initColumnForm(),
|
|
893
|
+
return e.initColumnForm(), a({
|
|
894
894
|
ref: l,
|
|
895
895
|
conf: e
|
|
896
|
-
}), (
|
|
896
|
+
}), (r, d) => (f(), g(o(W), {
|
|
897
897
|
ref_key: "ruleFormRef",
|
|
898
898
|
ref: l,
|
|
899
899
|
model: e.form,
|
|
900
900
|
rules: e.rules
|
|
901
901
|
}, {
|
|
902
902
|
default: y(() => [
|
|
903
|
-
e.show ? (f(!0), b(
|
|
904
|
-
|
|
903
|
+
e.show ? (f(!0), b($, { key: 0 }, F(e.formColumn, (m, c) => (f(), b($, { key: c }, [
|
|
904
|
+
o(p)(
|
|
905
905
|
m.map((u) => u.item?.show?.form),
|
|
906
906
|
e.form,
|
|
907
907
|
e.type
|
|
908
908
|
) ? (f(), b("div", {
|
|
909
909
|
key: 0,
|
|
910
910
|
class: I(["row curd-row", {
|
|
911
|
-
stripe:
|
|
911
|
+
stripe: i.option.form?.stripe === void 0 ? !0 : i.option.form?.stripe
|
|
912
912
|
}])
|
|
913
913
|
}, [
|
|
914
|
-
C(
|
|
914
|
+
C(r.$slots, "form-start", {
|
|
915
915
|
row: e.form
|
|
916
916
|
}),
|
|
917
|
-
(f(!0), b(
|
|
917
|
+
(f(!0), b($, null, F(m, (u) => (f(), b($, {
|
|
918
918
|
key: u.item.key
|
|
919
919
|
}, [
|
|
920
|
-
|
|
920
|
+
o(p)(u.item.show?.form, e.form, e.type) ? (f(), b("div", {
|
|
921
921
|
key: 0,
|
|
922
922
|
class: I([u.item.form.span > 0 ? `col-${e.getColumnSpan(u, m)}` : "col", `form-item-col-${u.item.key}`])
|
|
923
923
|
}, [
|
|
924
|
-
|
|
924
|
+
E(o(ee), {
|
|
925
925
|
label: u.item.text?.form?.label ?? u.item.label,
|
|
926
926
|
prop: u.item.key,
|
|
927
|
-
"label-width": u.item.text?.form?.label == "" ? 0 : u.item.form?.labelWidth ||
|
|
927
|
+
"label-width": u.item.text?.form?.label == "" ? 0 : u.item.form?.labelWidth || i.option.form?.labelWidth || "100px"
|
|
928
928
|
}, {
|
|
929
929
|
default: y(() => [
|
|
930
|
-
|
|
931
|
-
C(
|
|
930
|
+
D("div", Se, [
|
|
931
|
+
C(r.$slots, "form-" + u.item.key + "-start", {
|
|
932
932
|
row: e.form,
|
|
933
933
|
item: u.item
|
|
934
934
|
}),
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
C(
|
|
935
|
+
D("div", Me, [
|
|
936
|
+
D("div", Ae, [
|
|
937
|
+
C(r.$slots, "form-" + u.item.key, {
|
|
938
938
|
row: e.form,
|
|
939
939
|
item: u.item
|
|
940
940
|
}, () => [
|
|
941
|
-
u.item.type === "input" ? (f(), g(
|
|
941
|
+
u.item.type === "input" ? (f(), g(o(x), V({
|
|
942
942
|
key: 0,
|
|
943
943
|
modelValue: e.form[u.item.key],
|
|
944
944
|
"onUpdate:modelValue": (k) => e.form[u.item.key] = k,
|
|
945
945
|
ref_for: !0
|
|
946
946
|
}, e.getBind(u.item), z(e.getOn(u.item)), {
|
|
947
947
|
disabled: e.getDisabled(u.item)
|
|
948
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "switch" ? (f(), g(
|
|
948
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "switch" ? (f(), g(o(Z), V({
|
|
949
949
|
key: 1,
|
|
950
950
|
modelValue: e.form[u.item.key],
|
|
951
951
|
"onUpdate:modelValue": (k) => e.form[u.item.key] = k,
|
|
952
952
|
ref_for: !0
|
|
953
953
|
}, e.getBind(u.item), z(e.getOn(u.item)), {
|
|
954
954
|
disabled: e.getDisabled(u.item)
|
|
955
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "select" ? (f(), g(
|
|
955
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "select" ? (f(), g(o(q), V({
|
|
956
956
|
key: 2,
|
|
957
957
|
modelValue: e.form[u.item.key],
|
|
958
958
|
"onUpdate:modelValue": (k) => e.form[u.item.key] = k,
|
|
@@ -962,14 +962,14 @@ const De = {
|
|
|
962
962
|
style: { width: "100%" }
|
|
963
963
|
}), {
|
|
964
964
|
default: y(() => [
|
|
965
|
-
(f(!0), b(
|
|
965
|
+
(f(!0), b($, null, F(u.item.options?.select?.data, (k) => (f(), g(o(K), {
|
|
966
966
|
key: k.value,
|
|
967
967
|
label: k.label,
|
|
968
968
|
value: k.value
|
|
969
969
|
}, null, 8, ["label", "value"]))), 128))
|
|
970
970
|
]),
|
|
971
971
|
_: 2
|
|
972
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "radio" ? (f(), g(
|
|
972
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "radio" ? (f(), g(o(le), V({
|
|
973
973
|
key: 3,
|
|
974
974
|
modelValue: e.form[u.item.key],
|
|
975
975
|
"onUpdate:modelValue": (k) => e.form[u.item.key] = k,
|
|
@@ -979,14 +979,14 @@ const De = {
|
|
|
979
979
|
style: { width: "100%" }
|
|
980
980
|
}), {
|
|
981
981
|
default: y(() => [
|
|
982
|
-
(f(!0), b(
|
|
982
|
+
(f(!0), b($, null, F(u.item.options?.radio?.data, (k) => (f(), g(o(ne), {
|
|
983
983
|
key: k.value,
|
|
984
984
|
label: k.label,
|
|
985
985
|
value: k.value
|
|
986
986
|
}, null, 8, ["label", "value"]))), 128))
|
|
987
987
|
]),
|
|
988
988
|
_: 2
|
|
989
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "list" ? (f(), g(
|
|
989
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "list" ? (f(), g(se, V({
|
|
990
990
|
key: 4,
|
|
991
991
|
row: e.form,
|
|
992
992
|
field: u.item.key,
|
|
@@ -994,7 +994,7 @@ const De = {
|
|
|
994
994
|
}, e.getBind(u.item), z(e.getOn(u.item)), {
|
|
995
995
|
disabled: e.getDisabled(u.item),
|
|
996
996
|
style: { width: "100%" }
|
|
997
|
-
}), null, 16, ["row", "field", "disabled"])) : u.item.type === "treeSelect" ? (f(), g(
|
|
997
|
+
}), null, 16, ["row", "field", "disabled"])) : u.item.type === "treeSelect" ? (f(), g(o(ue), V({
|
|
998
998
|
key: 5,
|
|
999
999
|
modelValue: e.form[u.item.key],
|
|
1000
1000
|
"onUpdate:modelValue": (k) => e.form[u.item.key] = k,
|
|
@@ -1002,14 +1002,14 @@ const De = {
|
|
|
1002
1002
|
}, e.getBind(u.item), z(e.getOn(u.item)), {
|
|
1003
1003
|
disabled: e.getDisabled(u.item),
|
|
1004
1004
|
style: { width: "100%" }
|
|
1005
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "datetime" ? (f(), g(
|
|
1005
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "datetime" ? (f(), g(o(ie), V({
|
|
1006
1006
|
key: 6,
|
|
1007
1007
|
modelValue: e.form[u.item.key],
|
|
1008
1008
|
"onUpdate:modelValue": (k) => e.form[u.item.key] = k,
|
|
1009
1009
|
ref_for: !0
|
|
1010
1010
|
}, e.getBind(u.item), z(e.getOn(u.item)), {
|
|
1011
1011
|
disabled: e.getDisabled(u.item)
|
|
1012
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type && (
|
|
1012
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type && (o(B).customComponent[u.item.type] || o(B).customComponent[u.item.type]?.form) ? (f(), g(Q(o(B).customComponent[u.item.type]?.form || o(B).customComponent[u.item.type]), V({
|
|
1013
1013
|
key: 7,
|
|
1014
1014
|
modelValue: e.form[u.item.key],
|
|
1015
1015
|
"onUpdate:modelValue": (k) => e.form[u.item.key] = k,
|
|
@@ -1018,12 +1018,12 @@ const De = {
|
|
|
1018
1018
|
disabled: e.getDisabled(u.item)
|
|
1019
1019
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : v("", !0)
|
|
1020
1020
|
]),
|
|
1021
|
-
C(
|
|
1021
|
+
C(r.$slots, "form-" + u.item.key + "-right", {
|
|
1022
1022
|
row: e.form,
|
|
1023
1023
|
item: u.item
|
|
1024
1024
|
})
|
|
1025
1025
|
]),
|
|
1026
|
-
C(
|
|
1026
|
+
C(r.$slots, "form-" + u.item.key + "-tip", {
|
|
1027
1027
|
row: e.form,
|
|
1028
1028
|
item: u.item
|
|
1029
1029
|
}, () => [
|
|
@@ -1034,7 +1034,7 @@ const De = {
|
|
|
1034
1034
|
}, null, 8, Fe)) : v("", !0)
|
|
1035
1035
|
])
|
|
1036
1036
|
]),
|
|
1037
|
-
C(
|
|
1037
|
+
C(r.$slots, "form-" + u.item.key + "-end", {
|
|
1038
1038
|
row: e.form,
|
|
1039
1039
|
item: u.item
|
|
1040
1040
|
})
|
|
@@ -1044,7 +1044,7 @@ const De = {
|
|
|
1044
1044
|
}, 1032, ["label", "prop", "label-width"])
|
|
1045
1045
|
], 2)) : v("", !0)
|
|
1046
1046
|
], 64))), 128)),
|
|
1047
|
-
C(
|
|
1047
|
+
C(r.$slots, "form-end", {
|
|
1048
1048
|
row: e.form
|
|
1049
1049
|
})
|
|
1050
1050
|
], 2)) : v("", !0)
|
|
@@ -1054,7 +1054,7 @@ const De = {
|
|
|
1054
1054
|
}, 8, ["model", "rules"]));
|
|
1055
1055
|
}
|
|
1056
1056
|
});
|
|
1057
|
-
class
|
|
1057
|
+
class Le {
|
|
1058
1058
|
/**
|
|
1059
1059
|
* 导出数据为 Excel 文件(.xlsx),自动触发浏览器下载
|
|
1060
1060
|
*
|
|
@@ -1062,20 +1062,20 @@ class Be {
|
|
|
1062
1062
|
* @param columns - 列配置数组,需包含 `key`(数据字段)和 `label`(Excel 表头)
|
|
1063
1063
|
* @param fileName - 文件名(不含扩展名),支持字符串或返回字符串的函数;默认生成「导出数据_日期_时间戳」
|
|
1064
1064
|
*/
|
|
1065
|
-
static exportToExcel = async (
|
|
1066
|
-
if (!
|
|
1067
|
-
const l = await M.loadModule("xlsx"), t =
|
|
1065
|
+
static exportToExcel = async (a, p, s) => {
|
|
1066
|
+
if (!a || a.length === 0) return;
|
|
1067
|
+
const l = await M.loadModule("xlsx"), t = a.map((d) => {
|
|
1068
1068
|
const m = {};
|
|
1069
1069
|
return p.forEach((c) => {
|
|
1070
1070
|
m[c.label] = d[c.key];
|
|
1071
1071
|
}), m;
|
|
1072
|
-
}), e = l.utils.json_to_sheet(t),
|
|
1073
|
-
l.utils.book_append_sheet(
|
|
1072
|
+
}), e = l.utils.json_to_sheet(t), r = l.utils.book_new();
|
|
1073
|
+
l.utils.book_append_sheet(r, e, "Sheet1"), s ? typeof s == "function" && (s = s()) : s = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, l.writeFile(r, `${s}.xlsx`);
|
|
1074
1074
|
};
|
|
1075
1075
|
}
|
|
1076
|
-
const P = M.EDialog,
|
|
1077
|
-
const
|
|
1078
|
-
option:
|
|
1076
|
+
const P = M.EDialog, Be = (i) => {
|
|
1077
|
+
const a = N(), p = N(), s = N(), l = re({
|
|
1078
|
+
option: i.option,
|
|
1079
1079
|
/** 查询区域相关配置对象 */
|
|
1080
1080
|
search: {
|
|
1081
1081
|
/** 查询表单列集合 */
|
|
@@ -1092,18 +1092,18 @@ const P = M.EDialog, Le = (n) => {
|
|
|
1092
1092
|
/** 组装实际要搜索的数据对象 */
|
|
1093
1093
|
getFormData: () => {
|
|
1094
1094
|
let t = {};
|
|
1095
|
-
|
|
1096
|
-
(typeof
|
|
1095
|
+
i.option.column.forEach((r) => {
|
|
1096
|
+
(typeof r.show?.search == "function" ? r.show?.search(l.search.form) : r.show?.search) && (t[r.key] = l.search.form[r.key]);
|
|
1097
1097
|
});
|
|
1098
|
-
const e =
|
|
1098
|
+
const e = i.option.search?.before?.(t);
|
|
1099
1099
|
return e && (t = e), t;
|
|
1100
1100
|
},
|
|
1101
1101
|
/** 重置搜索表单 */
|
|
1102
1102
|
reset: () => {
|
|
1103
1103
|
const t = l.search.formDefault;
|
|
1104
1104
|
Object.keys(t).forEach((e) => {
|
|
1105
|
-
|
|
1106
|
-
}), l.search.form = ObjectUtil.deepMerge(t, {}), l.page.num = 1,
|
|
1105
|
+
i.option.search?.resetMode === "none" ? t[e] = void 0 : t[e] = l.search.formDefault[e];
|
|
1106
|
+
}), l.search.form = ObjectUtil.deepMerge(t, {}), l.page.num = 1, i.option.init !== !1 && l.table.getList();
|
|
1107
1107
|
},
|
|
1108
1108
|
/** 提交搜索表单 */
|
|
1109
1109
|
submit: () => {
|
|
@@ -1117,15 +1117,15 @@ const P = M.EDialog, Le = (n) => {
|
|
|
1117
1117
|
/** 总条数 */
|
|
1118
1118
|
total: 0,
|
|
1119
1119
|
/** 分页控件的布局方式 */
|
|
1120
|
-
layout:
|
|
1120
|
+
layout: i.option.page?.layout || A.config.pagination.layout,
|
|
1121
1121
|
/** 是否显示到工具栏 默认不显示 配置后show属性无效 */
|
|
1122
|
-
showTools:
|
|
1122
|
+
showTools: i.option.page?.showTools || A.config.pagination.showTools,
|
|
1123
1123
|
/** 当前每页条数 */
|
|
1124
|
-
size:
|
|
1124
|
+
size: i.option.page?.size || A.config.pagination.size,
|
|
1125
1125
|
/** 支持切换的每页条数选项 */
|
|
1126
|
-
sizeList:
|
|
1126
|
+
sizeList: i.option.page?.sizeList || A.config.pagination.pageSizes,
|
|
1127
1127
|
/** 分页器计数 */
|
|
1128
|
-
pagerCount:
|
|
1128
|
+
pagerCount: i.option.page?.pagerCount || A.config.pagination.pagerCount,
|
|
1129
1129
|
/** 获取分页查询参数 */
|
|
1130
1130
|
getQuery: (t = {}) => ({
|
|
1131
1131
|
[A.config.field.page.size]: t.size || l.page.size,
|
|
@@ -1138,7 +1138,7 @@ const P = M.EDialog, Le = (n) => {
|
|
|
1138
1138
|
/** 操作列相关配置 */
|
|
1139
1139
|
op: {
|
|
1140
1140
|
/** 动态计算操作列宽度 */
|
|
1141
|
-
width: (...t) => t.filter((
|
|
1141
|
+
width: (...t) => t.filter((r) => r).length * 30 + 60
|
|
1142
1142
|
},
|
|
1143
1143
|
/** 表格加载中状态 */
|
|
1144
1144
|
loading: !1,
|
|
@@ -1159,10 +1159,10 @@ const P = M.EDialog, Le = (n) => {
|
|
|
1159
1159
|
l.table.expand.rowKeys = [];
|
|
1160
1160
|
else {
|
|
1161
1161
|
const t = (e) => {
|
|
1162
|
-
let
|
|
1162
|
+
let r = [];
|
|
1163
1163
|
return e.forEach((d) => {
|
|
1164
|
-
|
|
1165
|
-
}),
|
|
1164
|
+
r.push(d[i.option.table.rowKey]), d.children && d.children.length > 0 && (r = r.concat(t(d.children)));
|
|
1165
|
+
}), r;
|
|
1166
1166
|
};
|
|
1167
1167
|
l.table.expand.rowKeys = t(l.table.data);
|
|
1168
1168
|
}
|
|
@@ -1190,8 +1190,8 @@ const P = M.EDialog, Le = (n) => {
|
|
|
1190
1190
|
toggleExpandAll: () => {
|
|
1191
1191
|
const t = !l.table.header.group.expand;
|
|
1192
1192
|
l.table.header.group.expand = t;
|
|
1193
|
-
const e = (
|
|
1194
|
-
|
|
1193
|
+
const e = (r) => {
|
|
1194
|
+
r.forEach((d) => {
|
|
1195
1195
|
d.table?.header?.group !== void 0 && (d.table.header.group = !t), d.table?.header?.groupKey !== void 0 && (d.table.header.show = t), Array.isArray(d.children) && d.children.length > 0 && e(d.children);
|
|
1196
1196
|
});
|
|
1197
1197
|
};
|
|
@@ -1202,7 +1202,7 @@ const P = M.EDialog, Le = (n) => {
|
|
|
1202
1202
|
/** 获取数据列表接口实现 */
|
|
1203
1203
|
getList: async () => {
|
|
1204
1204
|
l.table.loading = !0;
|
|
1205
|
-
const t =
|
|
1205
|
+
const t = i.option.api.list;
|
|
1206
1206
|
try {
|
|
1207
1207
|
await l.initApiData("init");
|
|
1208
1208
|
let e = {};
|
|
@@ -1213,16 +1213,16 @@ const P = M.EDialog, Le = (n) => {
|
|
|
1213
1213
|
[S.field]: l.table.sort.order
|
|
1214
1214
|
};
|
|
1215
1215
|
}
|
|
1216
|
-
const
|
|
1216
|
+
const r = await t({
|
|
1217
1217
|
...l.page.getQuery(),
|
|
1218
1218
|
...e
|
|
1219
|
-
}), d = A.config.field.result, m =
|
|
1219
|
+
}), d = A.config.field.result, m = r.data || { [d.list]: r };
|
|
1220
1220
|
let c = (Array.isArray(m[d.list]), m[d.list]);
|
|
1221
|
-
const u = l.update.formColumn.flat(),
|
|
1222
|
-
const
|
|
1223
|
-
|
|
1221
|
+
const u = l.update.formColumn.flat(), n = ObjectUtil.deepMerge({ data: c }, {}).data.map((h) => (Object.keys(h).forEach((j) => {
|
|
1222
|
+
const T = u.find((R) => R.item.key === j);
|
|
1223
|
+
T && ["select", "radio"].includes(T.item.type) && (T.item.table.format || (T.item.table.format = (R) => T.item.options[T.item.type].data?.find((Y) => Y.value == R[j])?.label || R[j]));
|
|
1224
1224
|
}), h));
|
|
1225
|
-
l.table.data =
|
|
1225
|
+
l.table.data = i.option.data ? await i.option.data(n, c) : n, l.page.total = m[d.total] || 0;
|
|
1226
1226
|
} catch (e) {
|
|
1227
1227
|
console.error(e);
|
|
1228
1228
|
} finally {
|
|
@@ -1240,11 +1240,11 @@ const P = M.EDialog, Le = (n) => {
|
|
|
1240
1240
|
/** 设置表格多选数据 */
|
|
1241
1241
|
setList: (t, e) => {
|
|
1242
1242
|
l.table.selection.list = [];
|
|
1243
|
-
const
|
|
1244
|
-
if (
|
|
1245
|
-
const d =
|
|
1246
|
-
const k = (
|
|
1247
|
-
for (const h of
|
|
1243
|
+
const r = s.value;
|
|
1244
|
+
if (r?.clearSelection(), !r || !t?.length) return;
|
|
1245
|
+
const d = i.option.table?.rowKey, m = l.table.data, c = (u) => {
|
|
1246
|
+
const k = (n) => {
|
|
1247
|
+
for (const h of n) {
|
|
1248
1248
|
if (d != null && d !== "") {
|
|
1249
1249
|
if (h[d] === u[d]) return h;
|
|
1250
1250
|
} else if (h === u)
|
|
@@ -1261,12 +1261,12 @@ const P = M.EDialog, Le = (n) => {
|
|
|
1261
1261
|
t.forEach((u) => {
|
|
1262
1262
|
const k = c(u) ?? u;
|
|
1263
1263
|
if (e) {
|
|
1264
|
-
const
|
|
1265
|
-
|
|
1264
|
+
const n = () => {
|
|
1265
|
+
r.toggleRowSelection(k, !0, !1);
|
|
1266
1266
|
};
|
|
1267
|
-
e(u) !== !1 &&
|
|
1267
|
+
e(u) !== !1 && n();
|
|
1268
1268
|
} else
|
|
1269
|
-
|
|
1269
|
+
r.toggleRowSelection(k, !0, !1);
|
|
1270
1270
|
});
|
|
1271
1271
|
});
|
|
1272
1272
|
}
|
|
@@ -1295,22 +1295,22 @@ const P = M.EDialog, Le = (n) => {
|
|
|
1295
1295
|
run: {
|
|
1296
1296
|
/** 执行指定方式的导出(如select、page、all) */
|
|
1297
1297
|
start: async (t) => {
|
|
1298
|
-
let e = await l.export.run[t](),
|
|
1298
|
+
let e = await l.export.run[t](), r = i.option.column;
|
|
1299
1299
|
const d = ObjectUtil.deepMerge(
|
|
1300
1300
|
{
|
|
1301
1301
|
data: e,
|
|
1302
|
-
columns:
|
|
1302
|
+
columns: r
|
|
1303
1303
|
},
|
|
1304
1304
|
{}
|
|
1305
|
-
), m =
|
|
1306
|
-
m.before && m.before(d),
|
|
1305
|
+
), m = i.option.tools?.export || {};
|
|
1306
|
+
m.before && m.before(d), Le.exportToExcel(d.data, d.columns, m.fileName);
|
|
1307
1307
|
},
|
|
1308
1308
|
/** 获取当前选中项进行导出 */
|
|
1309
1309
|
select: async () => {
|
|
1310
1310
|
l.export.loading = !0;
|
|
1311
1311
|
try {
|
|
1312
|
-
if (
|
|
1313
|
-
await
|
|
1312
|
+
if (i.option.tools?.export?.select) {
|
|
1313
|
+
await i.option.tools?.export?.select({
|
|
1314
1314
|
...l.page.getQuery(),
|
|
1315
1315
|
items: l.table.selection.list
|
|
1316
1316
|
});
|
|
@@ -1329,8 +1329,8 @@ const P = M.EDialog, Le = (n) => {
|
|
|
1329
1329
|
page: async () => {
|
|
1330
1330
|
l.export.loading = !0;
|
|
1331
1331
|
try {
|
|
1332
|
-
if (
|
|
1333
|
-
await
|
|
1332
|
+
if (i.option.tools?.export?.page) {
|
|
1333
|
+
await i.option.tools?.export?.page({
|
|
1334
1334
|
...l.page.getQuery()
|
|
1335
1335
|
});
|
|
1336
1336
|
return;
|
|
@@ -1348,13 +1348,13 @@ const P = M.EDialog, Le = (n) => {
|
|
|
1348
1348
|
all: async () => {
|
|
1349
1349
|
l.export.loading = !0;
|
|
1350
1350
|
try {
|
|
1351
|
-
if (
|
|
1352
|
-
await
|
|
1351
|
+
if (i.option.tools?.export?.all) {
|
|
1352
|
+
await i.option.tools?.export?.all({
|
|
1353
1353
|
...l.page.getQuery()
|
|
1354
1354
|
});
|
|
1355
1355
|
return;
|
|
1356
1356
|
}
|
|
1357
|
-
const t =
|
|
1357
|
+
const t = i.option.api.list, e = await t({
|
|
1358
1358
|
...l.page.getQuery({
|
|
1359
1359
|
size: 999999,
|
|
1360
1360
|
num: 1
|
|
@@ -1396,7 +1396,7 @@ const P = M.EDialog, Le = (n) => {
|
|
|
1396
1396
|
/** 表单所有列,二维数组结构按行分组 */
|
|
1397
1397
|
formColumn: [],
|
|
1398
1398
|
/** 判断是否禁用当前字段 */
|
|
1399
|
-
getDisabled: (t, e = !1) =>
|
|
1399
|
+
getDisabled: (t, e = !1) => i.option.table?.editMode && e ? t.disabled?.table === void 0 ? !1 : t.disabled?.table : l.update.type === P.View ? t.disabled?.view === void 0 ? !0 : t.disabled?.view : t.disabled?.[l.update.type === P.Add ? "create" : "update"],
|
|
1400
1400
|
/** 获取表单组件绑定属性 */
|
|
1401
1401
|
getBind: (t) => t.options?.[l.update.type === P.Add ? "formAdd" : "formUpdate"]?.[t.type] || t.options?.[t.type] || {},
|
|
1402
1402
|
/** 获取表单组件事件属性 */
|
|
@@ -1412,11 +1412,11 @@ const P = M.EDialog, Le = (n) => {
|
|
|
1412
1412
|
/** 获取表单组件绑定属性和事件 */
|
|
1413
1413
|
getOptions: (t) => {
|
|
1414
1414
|
try {
|
|
1415
|
-
const
|
|
1416
|
-
return
|
|
1417
|
-
options:
|
|
1415
|
+
const r = l.update.formColumn.flat().find((d) => d.item.key === t)?.item;
|
|
1416
|
+
return r ? {
|
|
1417
|
+
options: r.options,
|
|
1418
1418
|
// @ts-ignore
|
|
1419
|
-
bind: l.update.getBind(
|
|
1419
|
+
bind: l.update.getBind(r)
|
|
1420
1420
|
} : { options: {}, bind: {} };
|
|
1421
1421
|
} catch {
|
|
1422
1422
|
return { options: {}, bind: {} };
|
|
@@ -1428,13 +1428,13 @@ const P = M.EDialog, Le = (n) => {
|
|
|
1428
1428
|
data: {},
|
|
1429
1429
|
/** 返回编辑时与原值的变更数据,用于局部更新API */
|
|
1430
1430
|
getApiData: (t) => {
|
|
1431
|
-
if (
|
|
1431
|
+
if (i.option.form?.editAll)
|
|
1432
1432
|
return t;
|
|
1433
1433
|
let e = {
|
|
1434
|
-
[
|
|
1434
|
+
[i.option.table?.rowKey]: l.update.edit.data[i.option.table?.rowKey]
|
|
1435
1435
|
};
|
|
1436
|
-
return Object.keys(l.update.edit.data).forEach((
|
|
1437
|
-
t[
|
|
1436
|
+
return Object.keys(l.update.edit.data).forEach((r) => {
|
|
1437
|
+
t[r] !== l.update.edit.data[r] && (e[r] = t[r]);
|
|
1438
1438
|
}), e;
|
|
1439
1439
|
}
|
|
1440
1440
|
},
|
|
@@ -1445,10 +1445,10 @@ const P = M.EDialog, Le = (n) => {
|
|
|
1445
1445
|
M.loading(!0);
|
|
1446
1446
|
try {
|
|
1447
1447
|
l.update.type = t;
|
|
1448
|
-
const
|
|
1449
|
-
l.update.edit.data = e, l.update.title = w.tCurd(
|
|
1450
|
-
} catch (
|
|
1451
|
-
console.error(
|
|
1448
|
+
const r = t === P.Add;
|
|
1449
|
+
l.update.edit.data = e, l.update.title = w.tCurd(r ? "add" : t === P.View ? "view" : "edit"), l.update.form = ObjectUtil.deepMerge(r ? l.update.formDefault : e, {}), await l.initApiData("update"), await i.option.form?.openBefore?.(l.update.form, l.update), (!i.option.table?.inlineEdit || r) && (l.update.show = !0, l.update.showContent = !0), i.option.form?.openAfter?.(l.update.form, l.update);
|
|
1450
|
+
} catch (r) {
|
|
1451
|
+
console.error(r);
|
|
1452
1452
|
} finally {
|
|
1453
1453
|
M.loading(!1);
|
|
1454
1454
|
}
|
|
@@ -1460,18 +1460,18 @@ const P = M.EDialog, Le = (n) => {
|
|
|
1460
1460
|
await p.value?.validate(async (d, m) => new Promise((c, u) => {
|
|
1461
1461
|
d || (M.fail(w.tCurd("checkFormData")), u(!1)), c();
|
|
1462
1462
|
})), l.update.loading = !0;
|
|
1463
|
-
const t = l.update.type === P.Add ?
|
|
1463
|
+
const t = l.update.type === P.Add ? i.option.api.create : i.option.api.update;
|
|
1464
1464
|
try {
|
|
1465
|
-
await
|
|
1465
|
+
await i.option.form?.submitBefore?.(l.update.form, l.update);
|
|
1466
1466
|
} catch {
|
|
1467
1467
|
l.update.loading = !1;
|
|
1468
1468
|
return;
|
|
1469
1469
|
}
|
|
1470
1470
|
let e = ObjectUtil.deepMerge(l.update.form, {});
|
|
1471
1471
|
delete e.children;
|
|
1472
|
-
const
|
|
1472
|
+
const r = new Set(i.option.column.filter((d) => d.type === "datetime").map((d) => d.key));
|
|
1473
1473
|
Object.keys(e).forEach((d) => {
|
|
1474
|
-
if (
|
|
1474
|
+
if (r.has(d) && e[d] != null) {
|
|
1475
1475
|
const m = new Date(e[d]).getTime();
|
|
1476
1476
|
isNaN(m) || (e[d] = m);
|
|
1477
1477
|
}
|
|
@@ -1480,7 +1480,7 @@ const P = M.EDialog, Le = (n) => {
|
|
|
1480
1480
|
if (!t) return;
|
|
1481
1481
|
await t({
|
|
1482
1482
|
...e
|
|
1483
|
-
}), l.update.close(), await l.table.getList(),
|
|
1483
|
+
}), l.update.close(), await l.table.getList(), i.option.form?.submitAfter?.(e, l.update);
|
|
1484
1484
|
} catch (d) {
|
|
1485
1485
|
console.error(d);
|
|
1486
1486
|
} finally {
|
|
@@ -1490,7 +1490,7 @@ const P = M.EDialog, Le = (n) => {
|
|
|
1490
1490
|
},
|
|
1491
1491
|
/** 关闭弹窗和内容 */
|
|
1492
1492
|
close: () => {
|
|
1493
|
-
l.update.show = !1,
|
|
1493
|
+
l.update.show = !1, i.option.table?.inlineEdit && (l.update.form = {}), setTimeout(() => {
|
|
1494
1494
|
l.update.showContent = !1;
|
|
1495
1495
|
}, 350);
|
|
1496
1496
|
}
|
|
@@ -1521,11 +1521,11 @@ const P = M.EDialog, Le = (n) => {
|
|
|
1521
1521
|
submit: () => {
|
|
1522
1522
|
FunUtil.throttle(async () => {
|
|
1523
1523
|
l.remove.loading = !0;
|
|
1524
|
-
const t =
|
|
1524
|
+
const t = i.option.api.delete;
|
|
1525
1525
|
try {
|
|
1526
1526
|
if (!t) return;
|
|
1527
1527
|
await t({
|
|
1528
|
-
[
|
|
1528
|
+
[i.option.table?.rowKey]: l.remove.items.map((e) => e[i.option.table?.rowKey]),
|
|
1529
1529
|
items: l.remove.items
|
|
1530
1530
|
}), M.success(w.tCurd("operationSuccess")), l.table.data.length <= 1 && l.page.num > 1 && (l.page.num -= 1), l.remove.close(), await l.table.getList();
|
|
1531
1531
|
} catch (e) {
|
|
@@ -1544,9 +1544,9 @@ const P = M.EDialog, Le = (n) => {
|
|
|
1544
1544
|
apiDataMap: {},
|
|
1545
1545
|
/** 获取并绑定curd中所有下拉数据等远程依赖 */
|
|
1546
1546
|
initApiData: async (t) => {
|
|
1547
|
-
const e = [],
|
|
1547
|
+
const e = [], r = (d) => {
|
|
1548
1548
|
if (d.children && d.children.length) {
|
|
1549
|
-
d.children.forEach((m) =>
|
|
1549
|
+
d.children.forEach((m) => r(m));
|
|
1550
1550
|
return;
|
|
1551
1551
|
}
|
|
1552
1552
|
if (d.options?.[d.type]?.dataApi && d.options?.[d.type]?.dataApiConfig?.[t]) {
|
|
@@ -1564,17 +1564,17 @@ const P = M.EDialog, Le = (n) => {
|
|
|
1564
1564
|
e.push(m);
|
|
1565
1565
|
}
|
|
1566
1566
|
};
|
|
1567
|
-
return
|
|
1568
|
-
|
|
1567
|
+
return i.option.column.forEach((d) => {
|
|
1568
|
+
r(d);
|
|
1569
1569
|
}), await Promise.all(e), !0;
|
|
1570
1570
|
},
|
|
1571
1571
|
/** 初始化curd配置(option默认值合并等) */
|
|
1572
1572
|
initCurdConfig: () => {
|
|
1573
1573
|
const t = ObjectUtil.deepMerge(A.config, {});
|
|
1574
|
-
t.table.emptyText = w.tCurd("noData"),
|
|
1575
|
-
const e = ObjectUtil.deepMerge(t,
|
|
1576
|
-
Object.keys(e).forEach((
|
|
1577
|
-
|
|
1574
|
+
t.table.emptyText = w.tCurd("noData"), i.option.size = i.option.size || {}, t.table.size = i.option.size.table || t.size.table, t.form.size = i.option.size.form || t.size.form, t.size.search = i.option.size.search || t.size.search;
|
|
1575
|
+
const e = ObjectUtil.deepMerge(t, i.option || {});
|
|
1576
|
+
Object.keys(e).forEach((r) => {
|
|
1577
|
+
i.option[r] = e[r];
|
|
1578
1578
|
});
|
|
1579
1579
|
},
|
|
1580
1580
|
/**
|
|
@@ -1593,35 +1593,35 @@ const P = M.EDialog, Le = (n) => {
|
|
|
1593
1593
|
},
|
|
1594
1594
|
t.options
|
|
1595
1595
|
);
|
|
1596
|
-
const e = (
|
|
1596
|
+
const e = (r) => {
|
|
1597
1597
|
for (const d in t) {
|
|
1598
1598
|
if (d === "table") {
|
|
1599
|
-
if (
|
|
1600
|
-
|
|
1599
|
+
if (r.table = ObjectUtil.deepMerge(t.table, r.table || {}), r.children) {
|
|
1600
|
+
r.children.forEach((c) => {
|
|
1601
1601
|
e(c);
|
|
1602
1602
|
});
|
|
1603
1603
|
return;
|
|
1604
1604
|
}
|
|
1605
|
-
} else d === "type" ?
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
}),
|
|
1605
|
+
} else d === "type" ? r.type = r.type || t.type : r[d] = ObjectUtil.deepMerge(t[d], r[d] || {});
|
|
1606
|
+
r.options = r.options || {}, r.options[r.type] = r.options[r.type] || {}, r.options[r.type].size = i.option.size.form, ["search", "formAdd", "formUpdate"].forEach((c) => {
|
|
1607
|
+
r.options[c] = r.options[c] || ObjectUtil.deepMerge(r.options, {}), r.options[c][r.type] = r.options[c][r.type] || {}, r.options[c][r.type].size = c === "search" ? i.option.size.search : i.option.size.form;
|
|
1608
|
+
}), r.table = ObjectUtil.deepMerge(r.table, r.options[r.type].table || {});
|
|
1609
1609
|
}
|
|
1610
|
-
|
|
1611
|
-
const c =
|
|
1610
|
+
r.type === "switch" && (r.options.switch.tableBeforeChange = async (d, m) => {
|
|
1611
|
+
const c = r.options?.switch;
|
|
1612
1612
|
try {
|
|
1613
|
-
c.tableConfig?.confirm && await
|
|
1613
|
+
c.tableConfig?.confirm && await a.value?.open({
|
|
1614
1614
|
title: w.tCurd("confirmModify"),
|
|
1615
1615
|
content: w.tCurd("confirmSwitchMessage")
|
|
1616
1616
|
});
|
|
1617
1617
|
try {
|
|
1618
|
-
if (!
|
|
1619
|
-
const u = m[
|
|
1618
|
+
if (!i.option.api.update && !c.tableConfig?.api) return;
|
|
1619
|
+
const u = m[i.option.table?.rowKey];
|
|
1620
1620
|
c.loadingMap || (c.loadingMap = {}), c.loadingMap[u] || (c.loadingMap[u] = { loading: !1 }), c.loadingMap[u].loading = !0;
|
|
1621
|
-
const k = m[d] === c.activeValue ? c.inactiveValue : c.activeValue,
|
|
1622
|
-
if (!
|
|
1621
|
+
const k = m[d] === c.activeValue ? c.inactiveValue : c.activeValue, n = c.tableConfig?.api ? c.tableConfig.api : i.option.api.update;
|
|
1622
|
+
if (!n) return;
|
|
1623
1623
|
try {
|
|
1624
|
-
await
|
|
1624
|
+
await n(
|
|
1625
1625
|
{
|
|
1626
1626
|
...m,
|
|
1627
1627
|
[d]: k
|
|
@@ -1642,112 +1642,112 @@ const P = M.EDialog, Le = (n) => {
|
|
|
1642
1642
|
} catch {
|
|
1643
1643
|
return !1;
|
|
1644
1644
|
}
|
|
1645
|
-
}),
|
|
1645
|
+
}), r.type === "treeSelect" && (r.options.treeSelect.rowKey = i.option.table?.rowKey, r.options.treeSelect.nodeKey = i.option.table?.rowKey);
|
|
1646
1646
|
};
|
|
1647
|
-
|
|
1647
|
+
i.option.column.forEach(e), i.option.table?.column?.forEach(e);
|
|
1648
1648
|
},
|
|
1649
1649
|
getColumnSpan: (t, e) => {
|
|
1650
1650
|
if (t.item.form?.spanCol) {
|
|
1651
|
-
const
|
|
1652
|
-
return (t.item?.form.span ||
|
|
1651
|
+
const r = A.config.form.defaultSpan, m = e.filter((c) => !M.isFun(c.item.show?.form, l.update.form, l.update.type)).reduce((c, u) => c + (u.item.form?.span || r), 0);
|
|
1652
|
+
return (t.item?.form.span || r) + m;
|
|
1653
1653
|
}
|
|
1654
1654
|
return t.item.form.span;
|
|
1655
1655
|
},
|
|
1656
1656
|
/** 初始化配置并生成表单列及默认值及规则 */
|
|
1657
1657
|
initColumnForm: () => {
|
|
1658
|
-
const t =
|
|
1658
|
+
const t = i.option;
|
|
1659
1659
|
l.update.formColumn = [], l.table.column.show = {
|
|
1660
1660
|
list: [],
|
|
1661
1661
|
listSource: []
|
|
1662
1662
|
};
|
|
1663
|
-
const e = [],
|
|
1663
|
+
const e = [], r = i.option.form?.maxSpan || 12, d = i.option.form?.defaultSpan || r / 2;
|
|
1664
1664
|
let m = [];
|
|
1665
|
-
const c = (
|
|
1666
|
-
if (
|
|
1667
|
-
l.table.column.show.list.push(
|
|
1665
|
+
const c = (n) => {
|
|
1666
|
+
if (n.children) {
|
|
1667
|
+
l.table.column.show.list.push(n.key), n.children.forEach((h) => {
|
|
1668
1668
|
c(h);
|
|
1669
1669
|
});
|
|
1670
1670
|
return;
|
|
1671
1671
|
}
|
|
1672
|
-
if (l.update.formDefault[
|
|
1673
|
-
|
|
1674
|
-
let h =
|
|
1672
|
+
if (l.update.formDefault[n.key] = n.value, n.table.table && (n.show.table && l.table.column.show.list.push(n.key), n.table.table && l.table.column.show.listSource.push(n.key)), !(n.isForm && typeof n.show?.form == "boolean") || n.show?.form) {
|
|
1673
|
+
n.form = n.form || { span: d }, n.form.span = n.form.span ?? d;
|
|
1674
|
+
let h = n.form.span, S = m.reduce((T, R) => T + R.span, h);
|
|
1675
1675
|
const j = m.length;
|
|
1676
|
-
if (m.push({ item:
|
|
1677
|
-
const
|
|
1676
|
+
if (m.push({ item: n, span: h }), (j === 1 && m[0].span === 0 || S >= r || h === 0 && j > 1) && (e.push(m), m = []), n.rules) {
|
|
1677
|
+
const T = {
|
|
1678
1678
|
input: w.tCurd("placeholderInput"),
|
|
1679
1679
|
select: w.tCurd("placeholderSelect")
|
|
1680
|
-
}, R = (
|
|
1681
|
-
l.update.rules[
|
|
1680
|
+
}, R = (T[n.type] || T.input) + n.label;
|
|
1681
|
+
l.update.rules[n.key] = typeof n.rules == "boolean" ? [
|
|
1682
1682
|
{
|
|
1683
1683
|
required: !0,
|
|
1684
1684
|
message: R,
|
|
1685
1685
|
trigger: "blur"
|
|
1686
1686
|
}
|
|
1687
|
-
] :
|
|
1687
|
+
] : n.rules;
|
|
1688
1688
|
}
|
|
1689
1689
|
}
|
|
1690
|
-
}, u = (
|
|
1691
|
-
|
|
1690
|
+
}, u = (n, h) => {
|
|
1691
|
+
n.isForm = h, Array.isArray(n.children) && n.children.forEach((S) => u(S, h));
|
|
1692
1692
|
};
|
|
1693
|
-
t.column.forEach((
|
|
1694
|
-
|
|
1695
|
-
}),
|
|
1696
|
-
u(
|
|
1697
|
-
}), l.search.column.list = t.column.concat(t.table?.column || []), l.table.column.list = l.search.column.list.filter((
|
|
1698
|
-
const k =
|
|
1699
|
-
k && Object.keys(k).forEach((
|
|
1700
|
-
l.search.formDefault[
|
|
1701
|
-
}), t.column.forEach((
|
|
1702
|
-
|
|
1693
|
+
t.column.forEach((n) => {
|
|
1694
|
+
n.isForm = !0, u(n, !0), c(n);
|
|
1695
|
+
}), i.option.table?.column?.forEach((n) => {
|
|
1696
|
+
u(n, !1), c(n);
|
|
1697
|
+
}), l.search.column.list = t.column.concat(t.table?.column || []), l.table.column.list = l.search.column.list.filter((n) => n.table?.table), l.search.column.list.sort((n, h) => n.sort?.search - h.sort?.search), l.table.column.list.sort((n, h) => n.sort?.table - h.sort?.table), m.length > 0 && e.push(m), l.update.formColumn = e;
|
|
1698
|
+
const k = i.option.search?.formDefault;
|
|
1699
|
+
k && Object.keys(k).forEach((n) => {
|
|
1700
|
+
l.search.formDefault[n] = k[n];
|
|
1701
|
+
}), t.column.forEach((n) => {
|
|
1702
|
+
n.show?.search || (l.search.formDefault[n.key] = void 0);
|
|
1703
1703
|
}), l.search.form = ObjectUtil.deepMerge(l.search.formDefault, {});
|
|
1704
1704
|
}
|
|
1705
1705
|
});
|
|
1706
1706
|
return l.init(), fe(() => {
|
|
1707
|
-
|
|
1708
|
-
}), { conf: l, switchConfirmRef:
|
|
1709
|
-
}, je = { class: "dialog-footer" }, Re = /* @__PURE__ */
|
|
1707
|
+
i.option.init !== !1 && l.table.getList();
|
|
1708
|
+
}), { conf: l, switchConfirmRef: a, ruleFormRef: p, tableRef: s };
|
|
1709
|
+
}, je = { class: "dialog-footer" }, Re = /* @__PURE__ */ G({
|
|
1710
1710
|
__name: "switchConfirm",
|
|
1711
1711
|
props: {
|
|
1712
1712
|
size: {}
|
|
1713
1713
|
},
|
|
1714
|
-
setup(
|
|
1714
|
+
setup(i, { expose: a }) {
|
|
1715
1715
|
const p = N(!1), s = N("确认修改"), l = N("确认要修改状态吗?");
|
|
1716
1716
|
let t = null, e = null;
|
|
1717
|
-
const
|
|
1717
|
+
const r = (c) => (c?.title && (s.value = c.title), c?.content && (l.value = c.content), p.value = !0, new Promise((u, k) => {
|
|
1718
1718
|
t = u, e = k;
|
|
1719
1719
|
})), d = () => {
|
|
1720
1720
|
p.value = !1, t?.(!0), t = null, e = null;
|
|
1721
1721
|
}, m = () => {
|
|
1722
1722
|
p.value = !1, e?.(new Error("用户取消操作")), t = null, e = null;
|
|
1723
1723
|
};
|
|
1724
|
-
return
|
|
1725
|
-
open:
|
|
1724
|
+
return a({
|
|
1725
|
+
open: r
|
|
1726
1726
|
}), (c, u) => {
|
|
1727
|
-
const k =
|
|
1728
|
-
return f(), g(
|
|
1727
|
+
const k = _("el-form");
|
|
1728
|
+
return f(), g(o(oe), {
|
|
1729
1729
|
modelValue: p.value,
|
|
1730
|
-
"onUpdate:modelValue": u[0] || (u[0] = (
|
|
1730
|
+
"onUpdate:modelValue": u[0] || (u[0] = (n) => p.value = n),
|
|
1731
1731
|
title: s.value,
|
|
1732
1732
|
"close-on-click-modal": !1,
|
|
1733
1733
|
width: "400px"
|
|
1734
1734
|
}, {
|
|
1735
1735
|
footer: y(() => [
|
|
1736
|
-
|
|
1736
|
+
E(k, { size: c.size }, {
|
|
1737
1737
|
default: y(() => [
|
|
1738
|
-
|
|
1739
|
-
|
|
1738
|
+
D("span", je, [
|
|
1739
|
+
E(o(L), { onClick: m }, {
|
|
1740
1740
|
default: y(() => u[1] || (u[1] = [
|
|
1741
|
-
|
|
1741
|
+
U("取消")
|
|
1742
1742
|
])),
|
|
1743
1743
|
_: 1
|
|
1744
1744
|
}),
|
|
1745
|
-
|
|
1745
|
+
E(o(L), {
|
|
1746
1746
|
type: "primary",
|
|
1747
1747
|
onClick: d
|
|
1748
1748
|
}, {
|
|
1749
1749
|
default: y(() => u[2] || (u[2] = [
|
|
1750
|
-
|
|
1750
|
+
U("确认")
|
|
1751
1751
|
])),
|
|
1752
1752
|
_: 1
|
|
1753
1753
|
})
|
|
@@ -1757,84 +1757,84 @@ const P = M.EDialog, Le = (n) => {
|
|
|
1757
1757
|
}, 8, ["size"])
|
|
1758
1758
|
]),
|
|
1759
1759
|
default: y(() => [
|
|
1760
|
-
|
|
1760
|
+
D("div", null, O(l.value), 1)
|
|
1761
1761
|
]),
|
|
1762
1762
|
_: 1
|
|
1763
1763
|
}, 8, ["modelValue", "title"]);
|
|
1764
1764
|
};
|
|
1765
1765
|
}
|
|
1766
|
-
}),
|
|
1767
|
-
const p =
|
|
1768
|
-
for (const [s, l] of
|
|
1766
|
+
}), X = (i, a) => {
|
|
1767
|
+
const p = i.__vccOpts || i;
|
|
1768
|
+
for (const [s, l] of a)
|
|
1769
1769
|
p[s] = l;
|
|
1770
1770
|
return p;
|
|
1771
1771
|
}, Ie = {}, Pe = {
|
|
1772
1772
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1773
1773
|
viewBox: "0 0 1024 1024"
|
|
1774
1774
|
};
|
|
1775
|
-
function
|
|
1776
|
-
return f(), b("svg", Pe,
|
|
1777
|
-
|
|
1775
|
+
function He(i, a) {
|
|
1776
|
+
return f(), b("svg", Pe, a[0] || (a[0] = [
|
|
1777
|
+
D("path", {
|
|
1778
1778
|
fill: "currentColor",
|
|
1779
1779
|
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"
|
|
1780
1780
|
}, null, -1)
|
|
1781
1781
|
]));
|
|
1782
1782
|
}
|
|
1783
|
-
const
|
|
1783
|
+
const Ke = /* @__PURE__ */ X(Ie, [["render", He]]), Ne = {}, We = {
|
|
1784
1784
|
"data-v-58697b5c": "",
|
|
1785
1785
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1786
1786
|
viewBox: "0 0 1024 1024"
|
|
1787
1787
|
};
|
|
1788
|
-
function Je(
|
|
1789
|
-
return f(), b("svg", We,
|
|
1790
|
-
|
|
1788
|
+
function Je(i, a) {
|
|
1789
|
+
return f(), b("svg", We, a[0] || (a[0] = [
|
|
1790
|
+
D("path", {
|
|
1791
1791
|
fill: "currentColor",
|
|
1792
1792
|
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"
|
|
1793
1793
|
}, null, -1)
|
|
1794
1794
|
]));
|
|
1795
1795
|
}
|
|
1796
|
-
const qe = /* @__PURE__ */
|
|
1796
|
+
const qe = /* @__PURE__ */ X(Ne, [["render", Je]]), Qe = {}, Ge = {
|
|
1797
1797
|
"data-v-58697b5c": "",
|
|
1798
1798
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1799
1799
|
viewBox: "0 0 1024 1024"
|
|
1800
1800
|
};
|
|
1801
|
-
function Xe(
|
|
1802
|
-
return f(), b("svg", Ge,
|
|
1803
|
-
|
|
1801
|
+
function Xe(i, a) {
|
|
1802
|
+
return f(), b("svg", Ge, a[0] || (a[0] = [
|
|
1803
|
+
D("path", {
|
|
1804
1804
|
fill: "currentColor",
|
|
1805
1805
|
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"
|
|
1806
1806
|
}, null, -1)
|
|
1807
1807
|
]));
|
|
1808
1808
|
}
|
|
1809
|
-
const Ye = /* @__PURE__ */
|
|
1809
|
+
const Ye = /* @__PURE__ */ X(Qe, [["render", Xe]]), Ze = {}, xe = {
|
|
1810
1810
|
"data-v-58697b5c": "",
|
|
1811
1811
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1812
1812
|
viewBox: "0 0 1024 1024"
|
|
1813
1813
|
};
|
|
1814
|
-
function _e(
|
|
1815
|
-
return f(), b("svg", xe,
|
|
1816
|
-
|
|
1814
|
+
function _e(i, a) {
|
|
1815
|
+
return f(), b("svg", xe, a[0] || (a[0] = [
|
|
1816
|
+
D("path", {
|
|
1817
1817
|
fill: "currentColor",
|
|
1818
1818
|
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"
|
|
1819
1819
|
}, null, -1)
|
|
1820
1820
|
]));
|
|
1821
1821
|
}
|
|
1822
|
-
const et = /* @__PURE__ */
|
|
1822
|
+
const et = /* @__PURE__ */ X(Ze, [["render", _e]]), tt = { class: "row flex-center table-header-label inline" }, ot = { class: "table-header-tooltip" }, at = ["innerHTML"], lt = ["onClick"], nt = { key: 1 }, it = ["onClick", "innerHTML"], rt = /* @__PURE__ */ G({
|
|
1823
1823
|
__name: "tableColumn",
|
|
1824
1824
|
props: {
|
|
1825
1825
|
conf: {},
|
|
1826
1826
|
columnList: {},
|
|
1827
1827
|
option: {}
|
|
1828
1828
|
},
|
|
1829
|
-
setup(
|
|
1830
|
-
const
|
|
1829
|
+
setup(i) {
|
|
1830
|
+
const a = M.isFun, p = we().type;
|
|
1831
1831
|
return (s, l) => {
|
|
1832
|
-
const t =
|
|
1833
|
-
return f(!0), b(
|
|
1832
|
+
const t = _("el-tooltip");
|
|
1833
|
+
return f(!0), b($, null, F(s.columnList, (e) => (f(), b($, {
|
|
1834
1834
|
key: e.key
|
|
1835
1835
|
}, [
|
|
1836
|
-
s.conf.table.column.show.list.includes(e.key) ? (f(), b(
|
|
1837
|
-
e.table?.header?.groupKey === void 0 || e.table.header.show ? (f(), g(
|
|
1836
|
+
s.conf.table.column.show.list.includes(e.key) ? (f(), b($, { key: 0 }, [
|
|
1837
|
+
e.table?.header?.groupKey === void 0 || e.table.header.show ? (f(), g(o(ae), V({
|
|
1838
1838
|
key: 0,
|
|
1839
1839
|
prop: e.key,
|
|
1840
1840
|
label: e.label,
|
|
@@ -1842,173 +1842,177 @@ const et = /* @__PURE__ */ G(Ze, [["render", _e]]), tt = { class: "row flex-cent
|
|
|
1842
1842
|
}, e.table), {
|
|
1843
1843
|
header: y(() => [
|
|
1844
1844
|
C(s.$slots, "table-header-" + e.key, { item: e }, () => [
|
|
1845
|
-
|
|
1845
|
+
D("div", tt, [
|
|
1846
1846
|
e.table?.header?.tooltip ? (f(), g(t, {
|
|
1847
1847
|
key: 0,
|
|
1848
1848
|
effect: "dark",
|
|
1849
|
-
content: e.table?.header?.tooltip,
|
|
1850
1849
|
placement: "top"
|
|
1851
1850
|
}, {
|
|
1851
|
+
content: y(() => [
|
|
1852
|
+
D("div", {
|
|
1853
|
+
innerHTML: e.table?.header?.tooltip
|
|
1854
|
+
}, null, 8, at)
|
|
1855
|
+
]),
|
|
1852
1856
|
default: y(() => [
|
|
1853
|
-
|
|
1854
|
-
|
|
1857
|
+
D("span", ot, [
|
|
1858
|
+
E(qe)
|
|
1855
1859
|
])
|
|
1856
1860
|
]),
|
|
1857
1861
|
_: 2
|
|
1858
|
-
},
|
|
1859
|
-
|
|
1862
|
+
}, 1024)) : v("", !0),
|
|
1863
|
+
U(" " + O(e.label) + " ", 1),
|
|
1860
1864
|
e.table?.header?.group !== void 0 ? (f(), b("span", {
|
|
1861
1865
|
key: 1,
|
|
1862
1866
|
class: "table-header-plus",
|
|
1863
1867
|
onClick: ke(
|
|
1864
1868
|
() => {
|
|
1865
|
-
e.table.header.group = !e.table.header.group, s.columnList.forEach((
|
|
1866
|
-
|
|
1869
|
+
e.table.header.group = !e.table.header.group, s.columnList.forEach((r) => {
|
|
1870
|
+
r.table?.header?.groupKey === e.key && (r.table.header.show = !e.table.header.group);
|
|
1867
1871
|
});
|
|
1868
1872
|
},
|
|
1869
1873
|
["stop"]
|
|
1870
1874
|
)
|
|
1871
1875
|
}, [
|
|
1872
1876
|
e.table.header.group ? (f(), g(Ye, { key: 0 })) : (f(), g(et, { key: 1 }))
|
|
1873
|
-
], 8,
|
|
1877
|
+
], 8, lt)) : v("", !0)
|
|
1874
1878
|
])
|
|
1875
1879
|
])
|
|
1876
1880
|
]),
|
|
1877
|
-
default: y(({ row:
|
|
1878
|
-
e.children ? (f(), b(
|
|
1879
|
-
l[0] || (l[0] =
|
|
1880
|
-
(f(), g(
|
|
1881
|
+
default: y(({ row: r }) => [
|
|
1882
|
+
e.children ? (f(), b($, { key: 0 }, [
|
|
1883
|
+
l[0] || (l[0] = U(" ")),
|
|
1884
|
+
(f(), g(Q(o(p)), {
|
|
1881
1885
|
conf: s.conf,
|
|
1882
1886
|
columnList: e.children,
|
|
1883
1887
|
option: s.option
|
|
1884
1888
|
}, J({ _: 2 }, [
|
|
1885
|
-
|
|
1889
|
+
F(s.$slots, (d, m) => ({
|
|
1886
1890
|
name: m,
|
|
1887
1891
|
fn: y((c) => [
|
|
1888
1892
|
C(s.$slots, m, V({ ref_for: !0 }, c || {}))
|
|
1889
1893
|
])
|
|
1890
1894
|
}))
|
|
1891
1895
|
]), 1032, ["conf", "columnList", "option"]))
|
|
1892
|
-
], 64)) : (f(), b(
|
|
1896
|
+
], 64)) : (f(), b($, { key: 1 }, [
|
|
1893
1897
|
s.option.table?.editMode ? (f(), b("div", {
|
|
1894
1898
|
key: 0,
|
|
1895
1899
|
class: I(["row", ["table-edit-" + e.key]]),
|
|
1896
1900
|
style: { width: "100%" }
|
|
1897
1901
|
}, [
|
|
1898
1902
|
C(s.$slots, "table-edit-left-" + e.key, {
|
|
1899
|
-
row:
|
|
1903
|
+
row: r,
|
|
1900
1904
|
item: e
|
|
1901
1905
|
}),
|
|
1902
|
-
e.type === "input" ? (f(), g(
|
|
1906
|
+
e.type === "input" ? (f(), g(o(x), V({
|
|
1903
1907
|
key: 0,
|
|
1904
|
-
modelValue:
|
|
1905
|
-
"onUpdate:modelValue": (d) =>
|
|
1908
|
+
modelValue: r[e.key],
|
|
1909
|
+
"onUpdate:modelValue": (d) => r[e.key] = d,
|
|
1906
1910
|
disabled: s.conf.update.getDisabled(e, !0),
|
|
1907
1911
|
class: "col",
|
|
1908
1912
|
ref_for: !0
|
|
1909
|
-
}, s.conf.update.getBind(e), z(s.conf.update.getOn(e,
|
|
1913
|
+
}, s.conf.update.getBind(e), z(s.conf.update.getOn(e, r))), J({ _: 2 }, [
|
|
1910
1914
|
e.options?.input?.prepend ? {
|
|
1911
1915
|
name: "prepend",
|
|
1912
1916
|
fn: y(() => [
|
|
1913
|
-
|
|
1917
|
+
U(O(typeof e.options?.input?.prepend == "function" ? e.options?.input?.prepend(r) : e.options?.input?.prepend), 1)
|
|
1914
1918
|
]),
|
|
1915
1919
|
key: "0"
|
|
1916
1920
|
} : void 0
|
|
1917
|
-
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "select" ? (f(), g(
|
|
1921
|
+
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "select" ? (f(), g(o(q), V({
|
|
1918
1922
|
key: 1,
|
|
1919
|
-
modelValue:
|
|
1920
|
-
"onUpdate:modelValue": (d) =>
|
|
1923
|
+
modelValue: r[e.key],
|
|
1924
|
+
"onUpdate:modelValue": (d) => r[e.key] = d,
|
|
1921
1925
|
disabled: s.conf.update.getDisabled(e, !0),
|
|
1922
1926
|
class: "col",
|
|
1923
1927
|
ref_for: !0
|
|
1924
|
-
}, s.conf.update.getBind(e), z(s.conf.update.getOn(e,
|
|
1928
|
+
}, s.conf.update.getBind(e), z(s.conf.update.getOn(e, r))), {
|
|
1925
1929
|
default: y(() => [
|
|
1926
|
-
(f(!0), b(
|
|
1930
|
+
(f(!0), b($, null, F(e.options?.search?.select?.data || e.options?.select?.data, (d) => (f(), g(o(K), {
|
|
1927
1931
|
key: d.value,
|
|
1928
1932
|
label: d.label,
|
|
1929
1933
|
value: d.value
|
|
1930
1934
|
}, null, 8, ["label", "value"]))), 128))
|
|
1931
1935
|
]),
|
|
1932
1936
|
_: 2
|
|
1933
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "switch" ? (f(), g(
|
|
1937
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "switch" ? (f(), g(o(Z), V({
|
|
1934
1938
|
key: 2,
|
|
1935
|
-
modelValue:
|
|
1936
|
-
"onUpdate:modelValue": (d) =>
|
|
1939
|
+
modelValue: r[e.key],
|
|
1940
|
+
"onUpdate:modelValue": (d) => r[e.key] = d,
|
|
1937
1941
|
disabled: s.conf.update.getDisabled(e, !0),
|
|
1938
1942
|
class: "col",
|
|
1939
1943
|
ref_for: !0
|
|
1940
|
-
}, s.conf.update.getBind(e), z(s.conf.update.getOn(e,
|
|
1944
|
+
}, s.conf.update.getBind(e), z(s.conf.update.getOn(e, r))), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : v("", !0),
|
|
1941
1945
|
C(s.$slots, "table-edit-right-" + e.key, {
|
|
1942
|
-
row:
|
|
1946
|
+
row: r,
|
|
1943
1947
|
item: e
|
|
1944
1948
|
})
|
|
1945
|
-
], 2)) : (f(), b(
|
|
1946
|
-
s.conf.update.type ===
|
|
1947
|
-
e.type === "input" ? (f(), g(
|
|
1949
|
+
], 2)) : (f(), b($, { key: 1 }, [
|
|
1950
|
+
s.conf.update.type === o(M).EDialog.Update && o(a)(e.show?.form, s.conf.update.form, o(M).EDialog.Update) && s.option.table?.inlineEdit && s.conf.update.form[s.option.table?.rowKey] === r[s.option.table?.rowKey] && (e.type === "input" || e.type === "select") ? (f(), b($, { key: 0 }, [
|
|
1951
|
+
e.type === "input" ? (f(), g(o(x), V({
|
|
1948
1952
|
key: 0,
|
|
1949
1953
|
modelValue: s.conf.update.form[e.key],
|
|
1950
1954
|
"onUpdate:modelValue": (d) => s.conf.update.form[e.key] = d,
|
|
1951
1955
|
disabled: s.conf.update.getDisabled(e, !0),
|
|
1952
1956
|
ref_for: !0
|
|
1953
|
-
}, s.conf.update.getBind(e), z(s.conf.update.getOn(e,
|
|
1957
|
+
}, s.conf.update.getBind(e), z(s.conf.update.getOn(e, r)), { style: { width: "100%" } }), J({ _: 2 }, [
|
|
1954
1958
|
e.options?.input?.prepend ? {
|
|
1955
1959
|
name: "prepend",
|
|
1956
1960
|
fn: y(() => [
|
|
1957
|
-
|
|
1961
|
+
U(O(typeof e.options?.input?.prepend == "function" ? e.options?.input?.prepend(r) : e.options?.input?.prepend), 1)
|
|
1958
1962
|
]),
|
|
1959
1963
|
key: "0"
|
|
1960
1964
|
} : void 0
|
|
1961
|
-
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "select" ? (f(), g(
|
|
1965
|
+
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "select" ? (f(), g(o(q), V({
|
|
1962
1966
|
key: 1,
|
|
1963
1967
|
modelValue: s.conf.update.form[e.key],
|
|
1964
1968
|
"onUpdate:modelValue": (d) => s.conf.update.form[e.key] = d,
|
|
1965
1969
|
disabled: s.conf.update.getDisabled(e, !0),
|
|
1966
1970
|
ref_for: !0
|
|
1967
|
-
}, s.conf.update.getBind(e), z(s.conf.update.getOn(e,
|
|
1971
|
+
}, s.conf.update.getBind(e), z(s.conf.update.getOn(e, r)), { style: { width: "100%" } }), {
|
|
1968
1972
|
default: y(() => [
|
|
1969
|
-
(f(!0), b(
|
|
1973
|
+
(f(!0), b($, null, F(e.options?.search?.select?.data || e.options?.select?.data, (d) => (f(), g(o(K), {
|
|
1970
1974
|
key: d.value,
|
|
1971
1975
|
label: d.label,
|
|
1972
1976
|
value: d.value
|
|
1973
1977
|
}, null, 8, ["label", "value"]))), 128))
|
|
1974
1978
|
]),
|
|
1975
1979
|
_: 2
|
|
1976
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "switch" ? (f(), g(
|
|
1980
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "switch" ? (f(), g(o(Z), V({
|
|
1977
1981
|
key: 2,
|
|
1978
1982
|
modelValue: s.conf.update.form[e.key],
|
|
1979
1983
|
"onUpdate:modelValue": (d) => s.conf.update.form[e.key] = d,
|
|
1980
1984
|
ref_for: !0
|
|
1981
|
-
}, s.conf.update.getBind(e), z(s.conf.update.getOn(e,
|
|
1985
|
+
}, s.conf.update.getBind(e), z(s.conf.update.getOn(e, r)), {
|
|
1982
1986
|
disabled: s.conf.update.getDisabled(e, !0)
|
|
1983
1987
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : v("", !0)
|
|
1984
1988
|
], 64)) : C(s.$slots, "table-" + e.key, {
|
|
1985
1989
|
key: 1,
|
|
1986
|
-
row:
|
|
1990
|
+
row: r,
|
|
1987
1991
|
item: e
|
|
1988
1992
|
}, () => [
|
|
1989
|
-
|
|
1993
|
+
o(B).customComponent[e.type ?? ""]?.table ? (f(), g(Q(o(B).customComponent[e.type ?? ""]?.table), V({
|
|
1990
1994
|
key: 0,
|
|
1991
|
-
modelValue:
|
|
1992
|
-
"onUpdate:modelValue": (d) =>
|
|
1995
|
+
modelValue: r[e.key],
|
|
1996
|
+
"onUpdate:modelValue": (d) => r[e.key] = d,
|
|
1993
1997
|
ref_for: !0
|
|
1994
|
-
}, e.options?.[e.type ?? ""], z(e.options?.[e.type ?? ""]?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue"])) : e.type === "switch" ? (f(), b(
|
|
1995
|
-
e.options?.switch?.tableConfig?.change ? (f(), g(
|
|
1998
|
+
}, e.options?.[e.type ?? ""], z(e.options?.[e.type ?? ""]?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue"])) : e.type === "switch" ? (f(), b($, { key: 1 }, [
|
|
1999
|
+
e.options?.switch?.tableConfig?.change ? (f(), g(o(Z), V({
|
|
1996
2000
|
key: 0,
|
|
1997
|
-
modelValue:
|
|
1998
|
-
"onUpdate:modelValue": (d) =>
|
|
1999
|
-
loading: e.options?.switch?.loadingMap?.[
|
|
2000
|
-
"before-change": () => e.options?.switch?.tableBeforeChange?.(e.key,
|
|
2001
|
+
modelValue: r[e.key],
|
|
2002
|
+
"onUpdate:modelValue": (d) => r[e.key] = d,
|
|
2003
|
+
loading: e.options?.switch?.loadingMap?.[r[s.option.table?.rowKey]]?.loading,
|
|
2004
|
+
"before-change": () => e.options?.switch?.tableBeforeChange?.(e.key, r),
|
|
2001
2005
|
ref_for: !0
|
|
2002
|
-
}, e.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "loading", "before-change"])) : (f(), b("span",
|
|
2006
|
+
}, e.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "loading", "before-change"])) : (f(), b("span", nt, O(r[e.key] === e.options?.switch?.activeValue ? e.options?.switch?.activeText : e.options?.switch?.inactiveText), 1))
|
|
2003
2007
|
], 64)) : (f(), b("span", {
|
|
2004
2008
|
key: 2,
|
|
2005
2009
|
style: pe({
|
|
2006
2010
|
"--table-text-click-color": e.table?.click?.color
|
|
2007
2011
|
}),
|
|
2008
2012
|
class: I({ "table-text-click": e.table?.click?.callback }),
|
|
2009
|
-
onClick: (d) => e.table?.click?.callback?.(
|
|
2010
|
-
innerHTML: e.table?.format ? e.table?.format(
|
|
2011
|
-
}, null, 14,
|
|
2013
|
+
onClick: (d) => e.table?.click?.callback?.(r),
|
|
2014
|
+
innerHTML: e.table?.format ? e.table?.format(r) : r[e.key]
|
|
2015
|
+
}, null, 14, it))
|
|
2012
2016
|
])
|
|
2013
2017
|
], 64))
|
|
2014
2018
|
], 64))
|
|
@@ -2019,175 +2023,175 @@ const et = /* @__PURE__ */ G(Ze, [["render", _e]]), tt = { class: "row flex-cent
|
|
|
2019
2023
|
], 64))), 128);
|
|
2020
2024
|
};
|
|
2021
2025
|
}
|
|
2022
|
-
}),
|
|
2026
|
+
}), st = {
|
|
2023
2027
|
class: "row form-item-content",
|
|
2024
2028
|
style: { width: "100%" }
|
|
2025
|
-
},
|
|
2029
|
+
}, dt = { class: "col column form-item-content-item" }, ut = { class: "col" }, ft = ["innerHTML"], pt = /* @__PURE__ */ G({
|
|
2026
2030
|
__name: "formColumn",
|
|
2027
2031
|
props: {
|
|
2028
2032
|
conf: {},
|
|
2029
2033
|
item: {}
|
|
2030
2034
|
},
|
|
2031
|
-
setup(
|
|
2032
|
-
return (
|
|
2033
|
-
label:
|
|
2034
|
-
prop:
|
|
2035
|
-
"label-width":
|
|
2035
|
+
setup(i) {
|
|
2036
|
+
return (a, p) => (f(), g(o(ee), {
|
|
2037
|
+
label: a.item.item.text?.form?.label ?? a.item.item.label,
|
|
2038
|
+
prop: a.item.item.key,
|
|
2039
|
+
"label-width": a.item.item.text?.form?.label == "" ? 0 : a.item.item.form?.labelWidth || a.conf.option.form?.labelWidth
|
|
2036
2040
|
}, {
|
|
2037
2041
|
default: y(() => [
|
|
2038
|
-
|
|
2039
|
-
C(
|
|
2040
|
-
row:
|
|
2041
|
-
item:
|
|
2042
|
+
D("div", st, [
|
|
2043
|
+
C(a.$slots, "form-" + a.item.item.key + "-start", {
|
|
2044
|
+
row: a.conf.update.form,
|
|
2045
|
+
item: a.item.item
|
|
2042
2046
|
}),
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
C(
|
|
2046
|
-
row:
|
|
2047
|
-
item:
|
|
2047
|
+
D("div", dt, [
|
|
2048
|
+
D("div", ut, [
|
|
2049
|
+
C(a.$slots, "form-" + a.item.item.key, {
|
|
2050
|
+
row: a.conf.update.form,
|
|
2051
|
+
item: a.item.item
|
|
2048
2052
|
}, () => [
|
|
2049
|
-
|
|
2053
|
+
a.item.item.type === "input" ? (f(), g(o(x), V({
|
|
2050
2054
|
key: 0,
|
|
2051
|
-
modelValue:
|
|
2052
|
-
"onUpdate:modelValue": p[0] || (p[0] = (s) =>
|
|
2053
|
-
},
|
|
2054
|
-
disabled:
|
|
2055
|
+
modelValue: a.conf.update.form[a.item.item.key],
|
|
2056
|
+
"onUpdate:modelValue": p[0] || (p[0] = (s) => a.conf.update.form[a.item.item.key] = s)
|
|
2057
|
+
}, a.conf.update.getBind(a.item.item), z(a.conf.update.getOn(a.item.item)), {
|
|
2058
|
+
disabled: a.conf.update.getDisabled(a.item.item)
|
|
2055
2059
|
}), J({ _: 2 }, [
|
|
2056
|
-
|
|
2060
|
+
a.item.item.options?.input?.prepend ? {
|
|
2057
2061
|
name: "prepend",
|
|
2058
2062
|
fn: y(() => [
|
|
2059
|
-
|
|
2063
|
+
U(O(typeof a.item.item.options?.input?.prepend == "function" ? a.item.item.options?.input?.prepend(a.conf.update.form) : a.item.item.options?.input?.prepend), 1)
|
|
2060
2064
|
]),
|
|
2061
2065
|
key: "0"
|
|
2062
2066
|
} : void 0
|
|
2063
|
-
]), 1040, ["modelValue", "disabled"])) :
|
|
2067
|
+
]), 1040, ["modelValue", "disabled"])) : a.item.item.type === "switch" ? (f(), g(o(Z), V({
|
|
2064
2068
|
key: 1,
|
|
2065
|
-
modelValue:
|
|
2066
|
-
"onUpdate:modelValue": p[1] || (p[1] = (s) =>
|
|
2067
|
-
},
|
|
2068
|
-
disabled:
|
|
2069
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
2069
|
+
modelValue: a.conf.update.form[a.item.item.key],
|
|
2070
|
+
"onUpdate:modelValue": p[1] || (p[1] = (s) => a.conf.update.form[a.item.item.key] = s)
|
|
2071
|
+
}, a.conf.update.getBind(a.item.item), z(a.conf.update.getOn(a.item.item)), {
|
|
2072
|
+
disabled: a.conf.update.getDisabled(a.item.item)
|
|
2073
|
+
}), null, 16, ["modelValue", "disabled"])) : a.item.item.type === "select" ? (f(), g(o(q), V({
|
|
2070
2074
|
key: 2,
|
|
2071
|
-
modelValue:
|
|
2072
|
-
"onUpdate:modelValue": p[2] || (p[2] = (s) =>
|
|
2073
|
-
},
|
|
2074
|
-
disabled:
|
|
2075
|
+
modelValue: a.conf.update.form[a.item.item.key],
|
|
2076
|
+
"onUpdate:modelValue": p[2] || (p[2] = (s) => a.conf.update.form[a.item.item.key] = s)
|
|
2077
|
+
}, a.conf.update.getBind(a.item.item), z(a.conf.update.getOn(a.item.item)), {
|
|
2078
|
+
disabled: a.conf.update.getDisabled(a.item.item),
|
|
2075
2079
|
style: { width: "100%" }
|
|
2076
2080
|
}), {
|
|
2077
2081
|
default: y(() => [
|
|
2078
|
-
(f(!0), b(
|
|
2082
|
+
(f(!0), b($, null, F(a.conf.update.getBind(a.item.item).data, (s) => (f(), g(o(K), {
|
|
2079
2083
|
key: s.value,
|
|
2080
2084
|
label: s.label,
|
|
2081
2085
|
value: s.value
|
|
2082
2086
|
}, null, 8, ["label", "value"]))), 128))
|
|
2083
2087
|
]),
|
|
2084
2088
|
_: 1
|
|
2085
|
-
}, 16, ["modelValue", "disabled"])) :
|
|
2089
|
+
}, 16, ["modelValue", "disabled"])) : a.item.item.type === "radio" ? (f(), g(o(le), V({
|
|
2086
2090
|
key: 3,
|
|
2087
|
-
modelValue:
|
|
2088
|
-
"onUpdate:modelValue": p[3] || (p[3] = (s) =>
|
|
2089
|
-
},
|
|
2090
|
-
disabled:
|
|
2091
|
+
modelValue: a.conf.update.form[a.item.item.key],
|
|
2092
|
+
"onUpdate:modelValue": p[3] || (p[3] = (s) => a.conf.update.form[a.item.item.key] = s)
|
|
2093
|
+
}, a.conf.update.getBind(a.item.item), z(a.conf.update.getOn(a.item.item)), {
|
|
2094
|
+
disabled: a.conf.update.getDisabled(a.item.item),
|
|
2091
2095
|
style: { width: "100%" }
|
|
2092
2096
|
}), {
|
|
2093
2097
|
default: y(() => [
|
|
2094
|
-
(f(!0), b(
|
|
2098
|
+
(f(!0), b($, null, F(a.conf.update.getBind(a.item.item).data, (s) => (f(), g(o(ne), {
|
|
2095
2099
|
key: s.value,
|
|
2096
2100
|
label: s.label,
|
|
2097
2101
|
value: s.value
|
|
2098
2102
|
}, null, 8, ["label", "value"]))), 128))
|
|
2099
2103
|
]),
|
|
2100
2104
|
_: 1
|
|
2101
|
-
}, 16, ["modelValue", "disabled"])) :
|
|
2105
|
+
}, 16, ["modelValue", "disabled"])) : a.item.item.type === "list" ? (f(), g(se, V({
|
|
2102
2106
|
key: 4,
|
|
2103
|
-
row:
|
|
2104
|
-
field:
|
|
2105
|
-
},
|
|
2106
|
-
disabled:
|
|
2107
|
+
row: a.conf.update.form,
|
|
2108
|
+
field: a.item.item.key
|
|
2109
|
+
}, a.conf.update.getBind(a.item.item), z(a.conf.update.getOn(a.item.item)), {
|
|
2110
|
+
disabled: a.conf.update.getDisabled(a.item.item),
|
|
2107
2111
|
style: { width: "100%" }
|
|
2108
|
-
}), null, 16, ["row", "field", "disabled"])) :
|
|
2112
|
+
}), null, 16, ["row", "field", "disabled"])) : a.item.item.type === "treeSelect" ? (f(), g(o(ue), V({
|
|
2109
2113
|
key: 5,
|
|
2110
|
-
modelValue:
|
|
2111
|
-
"onUpdate:modelValue": p[4] || (p[4] = (s) =>
|
|
2112
|
-
},
|
|
2113
|
-
disabled:
|
|
2114
|
+
modelValue: a.conf.update.form[a.item.item.key],
|
|
2115
|
+
"onUpdate:modelValue": p[4] || (p[4] = (s) => a.conf.update.form[a.item.item.key] = s)
|
|
2116
|
+
}, a.conf.update.getBind(a.item.item), z(a.conf.update.getOn(a.item.item)), {
|
|
2117
|
+
disabled: a.conf.update.getDisabled(a.item.item),
|
|
2114
2118
|
style: { width: "100%" }
|
|
2115
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
2119
|
+
}), null, 16, ["modelValue", "disabled"])) : a.item.item.type === "datetime" ? (f(), g(o(ie), V({
|
|
2116
2120
|
key: 6,
|
|
2117
|
-
modelValue:
|
|
2118
|
-
"onUpdate:modelValue": p[5] || (p[5] = (s) =>
|
|
2119
|
-
},
|
|
2120
|
-
disabled:
|
|
2121
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
2121
|
+
modelValue: a.conf.update.form[a.item.item.key],
|
|
2122
|
+
"onUpdate:modelValue": p[5] || (p[5] = (s) => a.conf.update.form[a.item.item.key] = s)
|
|
2123
|
+
}, a.conf.update.getBind(a.item.item), z(a.conf.update.getOn(a.item.item)), {
|
|
2124
|
+
disabled: a.conf.update.getDisabled(a.item.item)
|
|
2125
|
+
}), null, 16, ["modelValue", "disabled"])) : a.item.item.type && (o(B).customComponent[a.item.item.type] || o(B).customComponent[a.item.item.type]?.form) ? (f(), g(Q(o(B).customComponent[a.item.item.type]?.form || o(B).customComponent[a.item.item.type]), V({
|
|
2122
2126
|
key: 7,
|
|
2123
|
-
modelValue:
|
|
2124
|
-
"onUpdate:modelValue": p[6] || (p[6] = (s) =>
|
|
2125
|
-
},
|
|
2126
|
-
disabled:
|
|
2127
|
+
modelValue: a.conf.update.form[a.item.item.key],
|
|
2128
|
+
"onUpdate:modelValue": p[6] || (p[6] = (s) => a.conf.update.form[a.item.item.key] = s)
|
|
2129
|
+
}, a.conf.update.getBind(a.item.item), z(a.conf.update.getOn(a.item.item)), {
|
|
2130
|
+
disabled: a.conf.update.getDisabled(a.item.item)
|
|
2127
2131
|
}), null, 16, ["modelValue", "disabled"])) : v("", !0)
|
|
2128
2132
|
]),
|
|
2129
|
-
C(
|
|
2130
|
-
row:
|
|
2131
|
-
item:
|
|
2133
|
+
C(a.$slots, "form-" + a.item.item.key + "-right", {
|
|
2134
|
+
row: a.conf.update.form,
|
|
2135
|
+
item: a.item.item
|
|
2132
2136
|
})
|
|
2133
2137
|
]),
|
|
2134
|
-
C(
|
|
2135
|
-
row:
|
|
2136
|
-
item:
|
|
2138
|
+
C(a.$slots, "form-" + a.item.item.key + "-tip", {
|
|
2139
|
+
row: a.conf.update.form,
|
|
2140
|
+
item: a.item.item
|
|
2137
2141
|
}, () => [
|
|
2138
|
-
|
|
2142
|
+
a.item.item.form?.tipText ? (f(), b("div", {
|
|
2139
2143
|
key: 0,
|
|
2140
2144
|
class: "form-tip-text",
|
|
2141
|
-
innerHTML: typeof
|
|
2142
|
-
}, null, 8,
|
|
2145
|
+
innerHTML: typeof a.item.item.form?.tipText == "function" ? a.item.item.form?.tipText(a.conf.update.form, a.conf.update.type) : a.item.item.form?.tipText
|
|
2146
|
+
}, null, 8, ft)) : v("", !0)
|
|
2143
2147
|
])
|
|
2144
2148
|
]),
|
|
2145
|
-
C(
|
|
2146
|
-
row:
|
|
2147
|
-
item:
|
|
2149
|
+
C(a.$slots, "form-" + a.item.item.key + "-end", {
|
|
2150
|
+
row: a.conf.update.form,
|
|
2151
|
+
item: a.item.item
|
|
2148
2152
|
})
|
|
2149
2153
|
])
|
|
2150
2154
|
]),
|
|
2151
2155
|
_: 3
|
|
2152
2156
|
}, 8, ["label", "prop", "label-width"]));
|
|
2153
2157
|
}
|
|
2154
|
-
}),
|
|
2158
|
+
}), ct = {}, mt = {
|
|
2155
2159
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2156
2160
|
viewBox: "64 64 896 896"
|
|
2157
2161
|
};
|
|
2158
|
-
function
|
|
2159
|
-
return f(), b("svg",
|
|
2160
|
-
|
|
2162
|
+
function ht(i, a) {
|
|
2163
|
+
return f(), b("svg", mt, a[0] || (a[0] = [
|
|
2164
|
+
D("path", {
|
|
2161
2165
|
fill: "currentColor",
|
|
2162
2166
|
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"
|
|
2163
2167
|
}, null, -1)
|
|
2164
2168
|
]));
|
|
2165
2169
|
}
|
|
2166
|
-
const
|
|
2170
|
+
const gt = /* @__PURE__ */ X(ct, [["render", ht]]), yt = {}, bt = {
|
|
2167
2171
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2168
2172
|
viewBox: "64 64 896 896"
|
|
2169
2173
|
};
|
|
2170
|
-
function
|
|
2171
|
-
return f(), b("svg",
|
|
2172
|
-
|
|
2174
|
+
function wt(i, a) {
|
|
2175
|
+
return f(), b("svg", bt, a[0] || (a[0] = [
|
|
2176
|
+
D("path", {
|
|
2173
2177
|
fill: "currentColor",
|
|
2174
2178
|
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"
|
|
2175
2179
|
}, null, -1)
|
|
2176
2180
|
]));
|
|
2177
2181
|
}
|
|
2178
|
-
const
|
|
2182
|
+
const kt = /* @__PURE__ */ X(yt, [["render", wt]]), vt = {
|
|
2179
2183
|
key: 0,
|
|
2180
2184
|
class: "relative curd-search fit-width"
|
|
2181
|
-
},
|
|
2185
|
+
}, Ct = { class: "mb-10 flex justify-between items-center fit-width" }, Vt = {
|
|
2182
2186
|
class: "flex items-center",
|
|
2183
2187
|
style: { gap: "10px" }
|
|
2184
|
-
},
|
|
2188
|
+
}, zt = { key: 0 }, $t = { key: 1 }, Ut = { key: 2 }, Dt = { class: "export-btn" }, Et = {
|
|
2185
2189
|
key: 1,
|
|
2186
2190
|
class: "export-btn"
|
|
2187
|
-
},
|
|
2191
|
+
}, Ot = {
|
|
2188
2192
|
class: "flex items-center table-tools-right",
|
|
2189
2193
|
style: { gap: "10px" }
|
|
2190
|
-
},
|
|
2194
|
+
}, St = { class: "row justify-end mt-10 mb-10 table-bottom-pagination" }, Mt = { class: "dialog-footer" }, At = { class: "dialog-footer" }, Ft = /* @__PURE__ */ G({
|
|
2191
2195
|
__name: "index",
|
|
2192
2196
|
props: {
|
|
2193
2197
|
/**
|
|
@@ -2197,134 +2201,163 @@ const wt = /* @__PURE__ */ G(gt, [["render", bt]]), kt = {
|
|
|
2197
2201
|
default: {}
|
|
2198
2202
|
}
|
|
2199
2203
|
},
|
|
2200
|
-
setup(
|
|
2201
|
-
const p = M.EDialog, s =
|
|
2202
|
-
return
|
|
2204
|
+
setup(i, { expose: a }) {
|
|
2205
|
+
const p = M.EDialog, s = i, l = M.isFun, { conf: t, switchConfirmRef: e, ruleFormRef: r, tableRef: d } = Be(s);
|
|
2206
|
+
return a({
|
|
2203
2207
|
conf: t
|
|
2204
2208
|
}), (m, c) => {
|
|
2205
|
-
const u =
|
|
2209
|
+
const u = _("el-tooltip"), k = ve("loading");
|
|
2206
2210
|
return f(), b("div", {
|
|
2207
|
-
class: I(["relative cc1-form-box", [
|
|
2211
|
+
class: I(["relative cc1-form-box", [i.option.table?.fitHeight ? "col" : "no-min-height"]])
|
|
2208
2212
|
}, [
|
|
2209
|
-
|
|
2210
|
-
class: I(["row", [
|
|
2213
|
+
D("div", {
|
|
2214
|
+
class: I(["row", [i.option.table?.fitHeight ? "absolute fit" : ""]]),
|
|
2211
2215
|
style: { overflow: "hidden" }
|
|
2212
2216
|
}, [
|
|
2213
2217
|
C(m.$slots, "box-left"),
|
|
2214
|
-
|
|
2215
|
-
class: I(["column fit-width no-wrap", [
|
|
2218
|
+
D("div", {
|
|
2219
|
+
class: I(["column fit-width no-wrap", [i.option.table?.fitHeight ? "col" : ""]])
|
|
2216
2220
|
}, [
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
model:
|
|
2221
|
+
i.option.search?.show !== !1 ? (f(), b("div", vt, [
|
|
2222
|
+
E(o(W), {
|
|
2223
|
+
model: o(t).search.form,
|
|
2220
2224
|
inline: "",
|
|
2221
|
-
size:
|
|
2225
|
+
size: i.option.size?.search
|
|
2222
2226
|
}, {
|
|
2223
2227
|
default: y(() => [
|
|
2224
2228
|
C(m.$slots, "search-start", {
|
|
2225
|
-
row:
|
|
2229
|
+
row: o(t).search.form
|
|
2226
2230
|
}),
|
|
2227
|
-
(f(!0), b(
|
|
2228
|
-
key:
|
|
2231
|
+
(f(!0), b($, null, F(o(t).search.column.list, (n) => (f(), b($, {
|
|
2232
|
+
key: n.key
|
|
2229
2233
|
}, [
|
|
2230
|
-
(
|
|
2234
|
+
C(m.$slots, "search-" + n.key + "-start", {
|
|
2235
|
+
row: o(t).search.form
|
|
2236
|
+
}),
|
|
2237
|
+
(typeof n.show?.search == "function" ? n.show?.search(o(t).search.form) : n.show?.search) ? (f(), g(o(ee), {
|
|
2231
2238
|
key: 0,
|
|
2232
|
-
label:
|
|
2239
|
+
label: n.text?.search?.label ?? n.label
|
|
2233
2240
|
}, {
|
|
2234
2241
|
default: y(() => [
|
|
2235
|
-
C(m.$slots, "search-" +
|
|
2236
|
-
row:
|
|
2242
|
+
C(m.$slots, "search-" + n.key + "-left", {
|
|
2243
|
+
row: o(t).search.form
|
|
2244
|
+
}),
|
|
2245
|
+
C(m.$slots, "search-" + n.key, {
|
|
2246
|
+
row: o(t).search.form
|
|
2237
2247
|
}, () => [
|
|
2238
|
-
|
|
2248
|
+
o(B).customComponent[n.type ?? ""]?.search ? (f(), g(Q(o(B).customComponent[n.type ?? ""]?.search), V({
|
|
2239
2249
|
key: 0,
|
|
2240
|
-
modelValue:
|
|
2241
|
-
"onUpdate:modelValue": (h) =>
|
|
2242
|
-
placeholder: a(t).search.getPlaceholder(r),
|
|
2243
|
-
clearable: "",
|
|
2244
|
-
disabled: r.disabled?.search,
|
|
2250
|
+
modelValue: o(t).search.form[n.key],
|
|
2251
|
+
"onUpdate:modelValue": (h) => o(t).search.form[n.key] = h,
|
|
2245
2252
|
ref_for: !0
|
|
2246
|
-
},
|
|
2253
|
+
}, n.options?.search?.[n.type ?? ""], z(n.options?.search?.[n.type ?? ""]?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue"])) : n.type === "input" ? (f(), g(o(x), V({
|
|
2247
2254
|
key: 1,
|
|
2248
|
-
modelValue:
|
|
2249
|
-
"onUpdate:modelValue": (h) =>
|
|
2250
|
-
placeholder:
|
|
2255
|
+
modelValue: o(t).search.form[n.key],
|
|
2256
|
+
"onUpdate:modelValue": (h) => o(t).search.form[n.key] = h,
|
|
2257
|
+
placeholder: o(t).search.getPlaceholder(n),
|
|
2258
|
+
clearable: "",
|
|
2259
|
+
disabled: n.disabled?.search,
|
|
2260
|
+
ref_for: !0
|
|
2261
|
+
}, n.options?.search?.input || n.options?.input, z(n.options?.search?.input?.on || n.options?.input?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : n.type === "switch" ? (f(), g(o(q), V({
|
|
2262
|
+
key: 2,
|
|
2263
|
+
modelValue: o(t).search.form[n.key],
|
|
2264
|
+
"onUpdate:modelValue": (h) => o(t).search.form[n.key] = h,
|
|
2265
|
+
placeholder: o(t).search.getPlaceholder(n, o(w).tCurd("placeholderSelect")),
|
|
2251
2266
|
clearable: "",
|
|
2252
|
-
disabled:
|
|
2267
|
+
disabled: n.disabled?.search,
|
|
2253
2268
|
ref_for: !0
|
|
2254
|
-
},
|
|
2269
|
+
}, n.options?.search?.switch || n.options?.switch, z(n.options?.search?.switch?.on || n.options?.switch?.on || {})), {
|
|
2255
2270
|
default: y(() => [
|
|
2256
|
-
(f(), g(
|
|
2257
|
-
key:
|
|
2258
|
-
label:
|
|
2259
|
-
value:
|
|
2271
|
+
(f(), g(o(K), {
|
|
2272
|
+
key: n.options?.switch?.activeValue,
|
|
2273
|
+
label: n.options?.switch?.activeText,
|
|
2274
|
+
value: n.options?.switch?.activeValue
|
|
2260
2275
|
}, null, 8, ["label", "value"])),
|
|
2261
|
-
(f(), g(
|
|
2262
|
-
key:
|
|
2263
|
-
label:
|
|
2264
|
-
value:
|
|
2276
|
+
(f(), g(o(K), {
|
|
2277
|
+
key: n.options?.switch?.inactiveValue,
|
|
2278
|
+
label: n.options?.switch?.inactiveText,
|
|
2279
|
+
value: n.options?.switch?.inactiveValue
|
|
2265
2280
|
}, null, 8, ["label", "value"]))
|
|
2266
2281
|
]),
|
|
2267
2282
|
_: 2
|
|
2268
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) :
|
|
2269
|
-
key:
|
|
2270
|
-
modelValue:
|
|
2271
|
-
"onUpdate:modelValue": (h) =>
|
|
2272
|
-
placeholder:
|
|
2283
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : n.type === "select" ? (f(), g(o(q), V({
|
|
2284
|
+
key: 3,
|
|
2285
|
+
modelValue: o(t).search.form[n.key],
|
|
2286
|
+
"onUpdate:modelValue": (h) => o(t).search.form[n.key] = h,
|
|
2287
|
+
placeholder: o(t).search.getPlaceholder(n, o(w).tCurd("placeholderSelect")),
|
|
2273
2288
|
clearable: "",
|
|
2274
|
-
disabled:
|
|
2289
|
+
disabled: n.disabled?.search,
|
|
2275
2290
|
ref_for: !0
|
|
2276
|
-
},
|
|
2291
|
+
}, n.options?.search?.select || n.options?.select, z(n.options?.search?.select?.on || n.options?.select?.on || {})), {
|
|
2277
2292
|
default: y(() => [
|
|
2278
|
-
(f(!0), b(
|
|
2293
|
+
(f(!0), b($, null, F(n.options?.select?.data, (h) => (f(), g(o(K), {
|
|
2279
2294
|
key: h.value,
|
|
2280
2295
|
label: h.label,
|
|
2281
2296
|
value: h.value
|
|
2282
2297
|
}, null, 8, ["label", "value"]))), 128))
|
|
2283
2298
|
]),
|
|
2284
2299
|
_: 2
|
|
2285
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) :
|
|
2286
|
-
key: 3,
|
|
2287
|
-
modelValue: a(t).search.form[r.key],
|
|
2288
|
-
"onUpdate:modelValue": (h) => a(t).search.form[r.key] = h,
|
|
2289
|
-
disabled: r.disabled?.search,
|
|
2290
|
-
ref_for: !0
|
|
2291
|
-
}, r.options?.search?.datetime || r.options?.datetime, z(r.options?.search?.datetime?.on || r.options?.datetime?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : r.type && a(L).customComponent[r.type] ? (f(), g(_(a(L).customComponent[r.type]), V({
|
|
2300
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : n.type === "radio" ? (f(), g(o(le), V({
|
|
2292
2301
|
key: 4,
|
|
2293
|
-
modelValue:
|
|
2294
|
-
"onUpdate:modelValue": (h) =>
|
|
2302
|
+
modelValue: o(t).search.form[n.key],
|
|
2303
|
+
"onUpdate:modelValue": (h) => o(t).search.form[n.key] = h,
|
|
2304
|
+
disabled: n.disabled?.search,
|
|
2295
2305
|
ref_for: !0
|
|
2296
|
-
},
|
|
2297
|
-
|
|
2306
|
+
}, n.options?.search?.radio || n.options?.radio, z(n.options?.search?.radio?.on || n.options?.radio?.on || {})), {
|
|
2307
|
+
default: y(() => [
|
|
2308
|
+
(f(!0), b($, null, F(n.options?.radio?.data, (h) => (f(), g(o(ne), {
|
|
2309
|
+
key: h.value,
|
|
2310
|
+
label: h.label,
|
|
2311
|
+
value: h.value
|
|
2312
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
2313
|
+
]),
|
|
2314
|
+
_: 2
|
|
2315
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.type === "datetime" ? (f(), g(o(ie), V({
|
|
2316
|
+
key: 5,
|
|
2317
|
+
modelValue: o(t).search.form[n.key],
|
|
2318
|
+
"onUpdate:modelValue": (h) => o(t).search.form[n.key] = h,
|
|
2319
|
+
disabled: n.disabled?.search,
|
|
2320
|
+
ref_for: !0
|
|
2321
|
+
}, n.options?.search?.datetime || n.options?.datetime, z(n.options?.search?.datetime?.on || n.options?.datetime?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.type && o(B).customComponent[n.type] ? (f(), g(Q(o(B).customComponent[n.type]), V({
|
|
2322
|
+
key: 6,
|
|
2323
|
+
modelValue: o(t).search.form[n.key],
|
|
2324
|
+
"onUpdate:modelValue": (h) => o(t).search.form[n.key] = h,
|
|
2325
|
+
ref_for: !0
|
|
2326
|
+
}, n.options?.search?.[n.type] || n.options?.[n.type], z(n.options?.search?.[n.type]?.on || n.options?.[n.type]?.on || {}), {
|
|
2327
|
+
disabled: n.disabled?.search
|
|
2298
2328
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : v("", !0)
|
|
2299
2329
|
]),
|
|
2300
|
-
C(m.$slots, "search-" +
|
|
2301
|
-
row:
|
|
2330
|
+
C(m.$slots, "search-" + n.key + "-right", {
|
|
2331
|
+
row: o(t).search.form
|
|
2302
2332
|
})
|
|
2303
2333
|
]),
|
|
2304
2334
|
_: 2
|
|
2305
|
-
}, 1032, ["label"])) : v("", !0)
|
|
2335
|
+
}, 1032, ["label"])) : v("", !0),
|
|
2336
|
+
C(m.$slots, "search-" + n.key + "-end", {
|
|
2337
|
+
row: o(t).search.form
|
|
2338
|
+
})
|
|
2306
2339
|
], 64))), 128)),
|
|
2307
2340
|
C(m.$slots, "search-center", {
|
|
2308
|
-
row:
|
|
2341
|
+
row: o(t).search.form
|
|
2309
2342
|
}),
|
|
2310
|
-
|
|
2343
|
+
i.option.tools?.search || i.option.tools?.reset ? (f(), g(o(ee), { key: 0 }, {
|
|
2311
2344
|
default: y(() => [
|
|
2312
|
-
|
|
2345
|
+
i.option.tools?.search ? (f(), g(o(L), {
|
|
2313
2346
|
key: 0,
|
|
2314
2347
|
type: "primary",
|
|
2315
|
-
onClick:
|
|
2348
|
+
onClick: o(t).search.submit
|
|
2316
2349
|
}, {
|
|
2317
2350
|
default: y(() => [
|
|
2318
|
-
|
|
2351
|
+
U(O(o(w).tCurd("search")), 1)
|
|
2319
2352
|
]),
|
|
2320
2353
|
_: 1
|
|
2321
2354
|
}, 8, ["onClick"])) : v("", !0),
|
|
2322
|
-
|
|
2355
|
+
i.option.tools?.reset ? (f(), g(o(L), {
|
|
2323
2356
|
key: 1,
|
|
2324
|
-
onClick:
|
|
2357
|
+
onClick: o(t).search.reset
|
|
2325
2358
|
}, {
|
|
2326
2359
|
default: y(() => [
|
|
2327
|
-
|
|
2360
|
+
U(O(o(w).tCurd("reset")), 1)
|
|
2328
2361
|
]),
|
|
2329
2362
|
_: 1
|
|
2330
2363
|
}, 8, ["onClick"])) : v("", !0)
|
|
@@ -2332,84 +2365,84 @@ const wt = /* @__PURE__ */ G(gt, [["render", bt]]), kt = {
|
|
|
2332
2365
|
_: 1
|
|
2333
2366
|
})) : v("", !0),
|
|
2334
2367
|
C(m.$slots, "search-end", {
|
|
2335
|
-
row:
|
|
2368
|
+
row: o(t).search.form
|
|
2336
2369
|
})
|
|
2337
2370
|
]),
|
|
2338
2371
|
_: 3
|
|
2339
2372
|
}, 8, ["model", "size"])
|
|
2340
2373
|
])) : v("", !0),
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2374
|
+
D("div", Ct, [
|
|
2375
|
+
D("div", Vt, [
|
|
2376
|
+
o(l)(i.option.tools?.add) ? (f(), b("div", zt, [
|
|
2377
|
+
E(o(L), {
|
|
2345
2378
|
type: "primary",
|
|
2346
|
-
onClick: c[0] || (c[0] = (
|
|
2347
|
-
size:
|
|
2379
|
+
onClick: c[0] || (c[0] = (n) => o(t).update.open(o(p).Add)),
|
|
2380
|
+
size: i.option.size?.search
|
|
2348
2381
|
}, {
|
|
2349
2382
|
default: y(() => [
|
|
2350
|
-
|
|
2383
|
+
U(O(o(w).tCurd("add")), 1)
|
|
2351
2384
|
]),
|
|
2352
2385
|
_: 1
|
|
2353
2386
|
}, 8, ["size"])
|
|
2354
2387
|
])) : v("", !0),
|
|
2355
|
-
|
|
2356
|
-
|
|
2388
|
+
i.option.table?.selectable && o(l)(i.option.tools?.delete) ? (f(), b("div", $t, [
|
|
2389
|
+
E(o(L), {
|
|
2357
2390
|
type: "danger",
|
|
2358
|
-
onClick: c[1] || (c[1] = (
|
|
2359
|
-
size:
|
|
2391
|
+
onClick: c[1] || (c[1] = (n) => o(t).remove.open(o(t).table.selection.list)),
|
|
2392
|
+
size: i.option.size?.search
|
|
2360
2393
|
}, {
|
|
2361
2394
|
default: y(() => [
|
|
2362
|
-
|
|
2395
|
+
U(O(o(w).tCurd("delete")), 1)
|
|
2363
2396
|
]),
|
|
2364
2397
|
_: 1
|
|
2365
2398
|
}, 8, ["size"])
|
|
2366
2399
|
])) : v("", !0),
|
|
2367
|
-
|
|
2368
|
-
|
|
2400
|
+
i.option.tools?.expand ? (f(), b("div", Ut, [
|
|
2401
|
+
E(o(L), {
|
|
2369
2402
|
type: "warning",
|
|
2370
|
-
onClick: c[2] || (c[2] = (
|
|
2371
|
-
size:
|
|
2403
|
+
onClick: c[2] || (c[2] = (n) => o(t).table.expand.all()),
|
|
2404
|
+
size: i.option.size?.search
|
|
2372
2405
|
}, {
|
|
2373
2406
|
default: y(() => [
|
|
2374
|
-
|
|
2407
|
+
U(O(o(w).tCurd("expandCollapse")), 1)
|
|
2375
2408
|
]),
|
|
2376
2409
|
_: 1
|
|
2377
2410
|
}, 8, ["size"])
|
|
2378
2411
|
])) : v("", !0),
|
|
2379
|
-
|
|
2380
|
-
|
|
2412
|
+
i.option.tools?.export?.show ? (f(), b($, { key: 3 }, [
|
|
2413
|
+
i.option.tools?.export?.dropdown?.show ? (f(), g(o(he), {
|
|
2381
2414
|
key: 0,
|
|
2382
|
-
onCommand:
|
|
2415
|
+
onCommand: o(t).export.click
|
|
2383
2416
|
}, {
|
|
2384
2417
|
dropdown: y(() => [
|
|
2385
|
-
|
|
2386
|
-
size:
|
|
2418
|
+
E(o(ge), {
|
|
2419
|
+
size: i.option.size?.search
|
|
2387
2420
|
}, {
|
|
2388
2421
|
default: y(() => [
|
|
2389
|
-
|
|
2422
|
+
i.option.tools?.export?.dropdown?.select && (i.option.table?.selectable || o(l)(i.option.tools?.delete)) ? (f(), g(o(te), {
|
|
2390
2423
|
key: 0,
|
|
2391
2424
|
command: "select"
|
|
2392
2425
|
}, {
|
|
2393
2426
|
default: y(() => [
|
|
2394
|
-
|
|
2427
|
+
U(O(o(w).tCurd("exportSelect")), 1)
|
|
2395
2428
|
]),
|
|
2396
2429
|
_: 1
|
|
2397
2430
|
})) : v("", !0),
|
|
2398
|
-
|
|
2431
|
+
i.option.tools?.export?.dropdown?.page ? (f(), g(o(te), {
|
|
2399
2432
|
key: 1,
|
|
2400
2433
|
command: "page"
|
|
2401
2434
|
}, {
|
|
2402
2435
|
default: y(() => [
|
|
2403
|
-
|
|
2436
|
+
U(O(o(w).tCurd("exportPage")), 1)
|
|
2404
2437
|
]),
|
|
2405
2438
|
_: 1
|
|
2406
2439
|
})) : v("", !0),
|
|
2407
|
-
|
|
2440
|
+
i.option.tools?.export?.dropdown?.all ? (f(), g(o(te), {
|
|
2408
2441
|
key: 2,
|
|
2409
2442
|
command: "all"
|
|
2410
2443
|
}, {
|
|
2411
2444
|
default: y(() => [
|
|
2412
|
-
|
|
2445
|
+
U(O(o(w).tCurd("exportAll")), 1)
|
|
2413
2446
|
]),
|
|
2414
2447
|
_: 1
|
|
2415
2448
|
})) : v("", !0)
|
|
@@ -2418,29 +2451,29 @@ const wt = /* @__PURE__ */ G(gt, [["render", bt]]), kt = {
|
|
|
2418
2451
|
}, 8, ["size"])
|
|
2419
2452
|
]),
|
|
2420
2453
|
default: y(() => [
|
|
2421
|
-
|
|
2422
|
-
|
|
2454
|
+
D("div", Dt, [
|
|
2455
|
+
E(o(L), {
|
|
2423
2456
|
type: "warning",
|
|
2424
|
-
loading:
|
|
2425
|
-
size:
|
|
2457
|
+
loading: o(t).export.loading,
|
|
2458
|
+
size: i.option.size?.search
|
|
2426
2459
|
}, {
|
|
2427
2460
|
default: y(() => [
|
|
2428
|
-
|
|
2461
|
+
U(O(o(w).tCurd("export")), 1)
|
|
2429
2462
|
]),
|
|
2430
2463
|
_: 1
|
|
2431
2464
|
}, 8, ["loading", "size"])
|
|
2432
2465
|
])
|
|
2433
2466
|
]),
|
|
2434
2467
|
_: 1
|
|
2435
|
-
}, 8, ["onCommand"])) : (f(), b("div",
|
|
2436
|
-
|
|
2468
|
+
}, 8, ["onCommand"])) : (f(), b("div", Et, [
|
|
2469
|
+
E(o(L), {
|
|
2437
2470
|
type: "warning",
|
|
2438
|
-
loading:
|
|
2439
|
-
size:
|
|
2440
|
-
onClick: c[3] || (c[3] = (
|
|
2471
|
+
loading: o(t).export.loading,
|
|
2472
|
+
size: i.option.size?.search,
|
|
2473
|
+
onClick: c[3] || (c[3] = (n) => o(t).export.run.start("all"))
|
|
2441
2474
|
}, {
|
|
2442
2475
|
default: y(() => [
|
|
2443
|
-
|
|
2476
|
+
U(O(o(w).tCurd("export")), 1)
|
|
2444
2477
|
]),
|
|
2445
2478
|
_: 1
|
|
2446
2479
|
}, 8, ["loading", "size"])
|
|
@@ -2448,68 +2481,68 @@ const wt = /* @__PURE__ */ G(gt, [["render", bt]]), kt = {
|
|
|
2448
2481
|
], 64)) : v("", !0),
|
|
2449
2482
|
C(m.$slots, "tools-left")
|
|
2450
2483
|
]),
|
|
2451
|
-
|
|
2484
|
+
D("div", Ot, [
|
|
2452
2485
|
C(m.$slots, "tools-right"),
|
|
2453
|
-
|
|
2486
|
+
o(t).page.showTools ? (f(), g(o(de), V({
|
|
2454
2487
|
key: 0,
|
|
2455
|
-
"current-page":
|
|
2456
|
-
"onUpdate:currentPage": c[4] || (c[4] = (
|
|
2457
|
-
"page-size":
|
|
2458
|
-
"onUpdate:pageSize": c[5] || (c[5] = (
|
|
2488
|
+
"current-page": o(t).page.num,
|
|
2489
|
+
"onUpdate:currentPage": c[4] || (c[4] = (n) => o(t).page.num = n),
|
|
2490
|
+
"page-size": o(t).page.size,
|
|
2491
|
+
"onUpdate:pageSize": c[5] || (c[5] = (n) => o(t).page.size = n),
|
|
2459
2492
|
background: "",
|
|
2460
|
-
"page-sizes":
|
|
2461
|
-
"pager-count":
|
|
2462
|
-
layout:
|
|
2463
|
-
total:
|
|
2464
|
-
size:
|
|
2465
|
-
onSizeChange:
|
|
2466
|
-
onCurrentChange:
|
|
2467
|
-
},
|
|
2468
|
-
|
|
2493
|
+
"page-sizes": o(t).page.sizeList,
|
|
2494
|
+
"pager-count": o(t).page.pagerCount,
|
|
2495
|
+
layout: o(t).page.layout,
|
|
2496
|
+
total: o(t).page.total,
|
|
2497
|
+
size: i.option.size?.table,
|
|
2498
|
+
onSizeChange: o(t).table.getList,
|
|
2499
|
+
onCurrentChange: o(t).table.getList
|
|
2500
|
+
}, i.option.page?.pagination || {}, z(i.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : v("", !0),
|
|
2501
|
+
i.option.tools?.expandColumn === void 0 || i.option.tools?.expandColumn ? (f(), g(u, {
|
|
2469
2502
|
key: 1,
|
|
2470
2503
|
effect: "dark",
|
|
2471
|
-
content:
|
|
2504
|
+
content: o(t).table.header.group.expand ? o(w).tCurd("mergeColumn") : o(w).tCurd("expandColumn"),
|
|
2472
2505
|
placement: "top"
|
|
2473
2506
|
}, {
|
|
2474
2507
|
default: y(() => [
|
|
2475
|
-
|
|
2476
|
-
class: I(["refresh-btn", [
|
|
2508
|
+
D("div", {
|
|
2509
|
+
class: I(["refresh-btn", [i.option.size?.search]]),
|
|
2477
2510
|
onClick: c[6] || (c[6] = //@ts-ignore
|
|
2478
|
-
(...
|
|
2511
|
+
(...n) => o(t).table.header.group.toggleExpandAll && o(t).table.header.group.toggleExpandAll(...n))
|
|
2479
2512
|
}, [
|
|
2480
|
-
|
|
2513
|
+
o(t).table.header.group.expand ? (f(), g(gt, { key: 0 })) : (f(), g(kt, { key: 1 }))
|
|
2481
2514
|
], 2)
|
|
2482
2515
|
]),
|
|
2483
2516
|
_: 1
|
|
2484
2517
|
}, 8, ["content"])) : v("", !0),
|
|
2485
|
-
|
|
2518
|
+
i.option.tools?.refresh === void 0 || i.option.tools?.refresh ? (f(), b("div", {
|
|
2486
2519
|
key: 2,
|
|
2487
|
-
class: I(["refresh-btn", [
|
|
2520
|
+
class: I(["refresh-btn", [i.option.size?.search]]),
|
|
2488
2521
|
onClick: c[7] || (c[7] = //@ts-ignore
|
|
2489
|
-
(...
|
|
2522
|
+
(...n) => o(t).table.getList && o(t).table.getList(...n))
|
|
2490
2523
|
}, [
|
|
2491
|
-
|
|
2524
|
+
E(Ke)
|
|
2492
2525
|
], 2)) : v("", !0)
|
|
2493
2526
|
])
|
|
2494
2527
|
]),
|
|
2495
|
-
|
|
2496
|
-
class: I(["fit-width relative form-box", [
|
|
2528
|
+
D("div", {
|
|
2529
|
+
class: I(["fit-width relative form-box", [i.option.table?.fitHeight ? "col " : "", i.option.table?.editMode ? "edit-mode" : ""]])
|
|
2497
2530
|
}, [
|
|
2498
|
-
|
|
2499
|
-
class: I(["column form-box-content", [
|
|
2531
|
+
D("div", {
|
|
2532
|
+
class: I(["column form-box-content", [i.option.table?.fitHeight ? "absolute fit" : ""]])
|
|
2500
2533
|
}, [
|
|
2501
|
-
Ce((f(), g(
|
|
2534
|
+
Ce((f(), g(o(ye), V({
|
|
2502
2535
|
ref_key: "tableRef",
|
|
2503
2536
|
ref: d,
|
|
2504
|
-
data:
|
|
2505
|
-
border:
|
|
2506
|
-
onSelectionChange:
|
|
2507
|
-
onSortChange:
|
|
2508
|
-
"expand-row-keys":
|
|
2509
|
-
onExpandChange:
|
|
2510
|
-
},
|
|
2537
|
+
data: o(t).table.data,
|
|
2538
|
+
border: i.option.table?.border === void 0 ? !0 : i.option.table?.border,
|
|
2539
|
+
onSelectionChange: o(t).table.selection.change,
|
|
2540
|
+
onSortChange: o(t).table.sort.change,
|
|
2541
|
+
"expand-row-keys": o(t).table.expand.rowKeys,
|
|
2542
|
+
onExpandChange: o(t).table.expand.change
|
|
2543
|
+
}, i.option.table, z(i.option.table?.on || {})), {
|
|
2511
2544
|
default: y(() => [
|
|
2512
|
-
(typeof
|
|
2545
|
+
(typeof i.option.table?.selectable == "object" ? i.option.table?.selectable?.show : i.option.table?.selectable) || o(l)(i.option.tools?.delete) || i.option.tools?.export?.show && i.option.tools?.export?.select ? (f(), g(o(ae), V({
|
|
2513
2546
|
key: 0,
|
|
2514
2547
|
type: "selection",
|
|
2515
2548
|
width: "40",
|
|
@@ -2517,106 +2550,106 @@ const wt = /* @__PURE__ */ G(gt, [["render", bt]]), kt = {
|
|
|
2517
2550
|
fixed: "left",
|
|
2518
2551
|
"show-overflow-tooltip": !1,
|
|
2519
2552
|
className: "cc1-form-selectable-column"
|
|
2520
|
-
}, typeof
|
|
2521
|
-
|
|
2522
|
-
conf:
|
|
2523
|
-
columnList:
|
|
2524
|
-
option:
|
|
2553
|
+
}, typeof i.option.table?.selectable == "object" ? i.option.table?.selectable : {}, z(typeof i.option.table?.selectable == "object" ? i.option.table?.selectable?.on || {} : {})), null, 16)) : v("", !0),
|
|
2554
|
+
E(rt, {
|
|
2555
|
+
conf: o(t),
|
|
2556
|
+
columnList: o(t).table.column.list,
|
|
2557
|
+
option: i.option
|
|
2525
2558
|
}, J({ _: 2 }, [
|
|
2526
|
-
|
|
2559
|
+
F(m.$slots, (n, h) => ({
|
|
2527
2560
|
name: h,
|
|
2528
2561
|
fn: y((S) => [
|
|
2529
2562
|
C(m.$slots, h, Ve(ze(S || {})))
|
|
2530
2563
|
])
|
|
2531
2564
|
}))
|
|
2532
2565
|
]), 1032, ["conf", "columnList", "option"]),
|
|
2533
|
-
|
|
2566
|
+
o(l)(i.option.table?.add) || o(l)(i.option.table?.update) || o(l)(i.option.table?.delete) || o(l)(i.option.table?.view) || m.$slots["table-op-left"] || m.$slots["table-op-right"] ? (f(), g(o(ae), V({
|
|
2534
2567
|
key: 1,
|
|
2535
2568
|
width: "auto",
|
|
2536
2569
|
"max-width": "200",
|
|
2537
2570
|
align: "center",
|
|
2538
2571
|
fixed: "right"
|
|
2539
|
-
},
|
|
2572
|
+
}, i.option.table?.operate, { "show-overflow-tooltip": !1 }), {
|
|
2540
2573
|
header: y(() => [
|
|
2541
2574
|
C(m.$slots, "table-header-op", {}, () => [
|
|
2542
|
-
|
|
2575
|
+
U(O(o(w).tCurd("operation")), 1)
|
|
2543
2576
|
])
|
|
2544
2577
|
]),
|
|
2545
|
-
default: y(({ row:
|
|
2546
|
-
|
|
2547
|
-
size:
|
|
2578
|
+
default: y(({ row: n }) => [
|
|
2579
|
+
E(o(W), {
|
|
2580
|
+
size: i.option.size?.table
|
|
2548
2581
|
}, {
|
|
2549
2582
|
default: y(() => [
|
|
2550
|
-
C(m.$slots, "table-op-left", { row:
|
|
2551
|
-
|
|
2552
|
-
|
|
2583
|
+
C(m.$slots, "table-op-left", { row: n }),
|
|
2584
|
+
o(t).update.type === o(p).Update && i.option.table?.inlineEdit && o(t).update.form[s.option.table?.rowKey] === n[s.option.table?.rowKey] ? (f(), b($, { key: 0 }, [
|
|
2585
|
+
E(o(L), {
|
|
2553
2586
|
link: "",
|
|
2554
2587
|
type: "info",
|
|
2555
|
-
onClick:
|
|
2588
|
+
onClick: o(t).update.close
|
|
2556
2589
|
}, {
|
|
2557
2590
|
default: y(() => [
|
|
2558
|
-
|
|
2591
|
+
U(O(o(w).tCurd("cancel")), 1)
|
|
2559
2592
|
]),
|
|
2560
2593
|
_: 1
|
|
2561
2594
|
}, 8, ["onClick"]),
|
|
2562
|
-
|
|
2595
|
+
E(o(L), {
|
|
2563
2596
|
link: "",
|
|
2564
2597
|
type: "primary",
|
|
2565
|
-
onClick:
|
|
2566
|
-
loading:
|
|
2598
|
+
onClick: o(t).update.submit,
|
|
2599
|
+
loading: o(t).update.loading
|
|
2567
2600
|
}, {
|
|
2568
2601
|
default: y(() => [
|
|
2569
|
-
|
|
2602
|
+
U(O(o(w).tCurd("confirm")), 1)
|
|
2570
2603
|
]),
|
|
2571
2604
|
_: 1
|
|
2572
2605
|
}, 8, ["onClick", "loading"]),
|
|
2573
|
-
C(m.$slots, "table-op-edit-right", { row:
|
|
2574
|
-
], 64)) : (f(), b(
|
|
2575
|
-
|
|
2606
|
+
C(m.$slots, "table-op-edit-right", { row: n })
|
|
2607
|
+
], 64)) : (f(), b($, { key: 1 }, [
|
|
2608
|
+
o(l)(i.option.table?.add, n) ? (f(), g(o(L), {
|
|
2576
2609
|
key: 0,
|
|
2577
2610
|
link: "",
|
|
2578
2611
|
type: "primary",
|
|
2579
|
-
onClick: (h) =>
|
|
2612
|
+
onClick: (h) => o(t).update.open(o(p).Add, n)
|
|
2580
2613
|
}, {
|
|
2581
2614
|
default: y(() => [
|
|
2582
|
-
|
|
2615
|
+
U(O(o(w).tCurd("add")), 1)
|
|
2583
2616
|
]),
|
|
2584
2617
|
_: 2
|
|
2585
2618
|
}, 1032, ["onClick"])) : v("", !0),
|
|
2586
|
-
|
|
2619
|
+
o(l)(i.option.table?.view, n) ? (f(), g(o(L), {
|
|
2587
2620
|
key: 1,
|
|
2588
2621
|
link: "",
|
|
2589
2622
|
type: "primary",
|
|
2590
|
-
onClick: (h) =>
|
|
2623
|
+
onClick: (h) => o(t).update.open(o(p).View, n)
|
|
2591
2624
|
}, {
|
|
2592
2625
|
default: y(() => [
|
|
2593
|
-
|
|
2626
|
+
U(O(o(w).tCurd("view")), 1)
|
|
2594
2627
|
]),
|
|
2595
2628
|
_: 2
|
|
2596
2629
|
}, 1032, ["onClick"])) : v("", !0),
|
|
2597
|
-
|
|
2630
|
+
o(l)(i.option.table?.update, n) ? (f(), g(o(L), {
|
|
2598
2631
|
key: 2,
|
|
2599
2632
|
link: "",
|
|
2600
2633
|
type: "warning",
|
|
2601
|
-
onClick: (h) =>
|
|
2634
|
+
onClick: (h) => o(t).update.open(o(p).Update, n)
|
|
2602
2635
|
}, {
|
|
2603
2636
|
default: y(() => [
|
|
2604
|
-
|
|
2637
|
+
U(O(o(w).tCurd("edit")), 1)
|
|
2605
2638
|
]),
|
|
2606
2639
|
_: 2
|
|
2607
2640
|
}, 1032, ["onClick"])) : v("", !0),
|
|
2608
|
-
|
|
2641
|
+
o(l)(i.option.table?.delete, n) ? (f(), g(o(L), {
|
|
2609
2642
|
key: 3,
|
|
2610
2643
|
link: "",
|
|
2611
2644
|
type: "danger",
|
|
2612
|
-
onClick: (h) =>
|
|
2645
|
+
onClick: (h) => o(t).remove.open([n])
|
|
2613
2646
|
}, {
|
|
2614
2647
|
default: y(() => [
|
|
2615
|
-
|
|
2648
|
+
U(O(o(w).tCurd("delete")), 1)
|
|
2616
2649
|
]),
|
|
2617
2650
|
_: 2
|
|
2618
2651
|
}, 1032, ["onClick"])) : v("", !0),
|
|
2619
|
-
C(m.$slots, "table-op-right", { row:
|
|
2652
|
+
C(m.$slots, "table-op-right", { row: n })
|
|
2620
2653
|
], 64))
|
|
2621
2654
|
]),
|
|
2622
2655
|
_: 2
|
|
@@ -2627,58 +2660,58 @@ const wt = /* @__PURE__ */ G(gt, [["render", bt]]), kt = {
|
|
|
2627
2660
|
]),
|
|
2628
2661
|
_: 3
|
|
2629
2662
|
}, 16, ["data", "border", "onSelectionChange", "onSortChange", "expand-row-keys", "onExpandChange"])), [
|
|
2630
|
-
[k,
|
|
2663
|
+
[k, o(t).table.loading]
|
|
2631
2664
|
])
|
|
2632
2665
|
], 2)
|
|
2633
2666
|
], 2),
|
|
2634
|
-
|
|
2635
|
-
(
|
|
2667
|
+
D("div", St, [
|
|
2668
|
+
(i.option.page?.show === void 0 || i.option.page?.show) && !o(t).page.showTools ? (f(), g(o(de), V({
|
|
2636
2669
|
key: 0,
|
|
2637
|
-
"current-page":
|
|
2638
|
-
"onUpdate:currentPage": c[8] || (c[8] = (
|
|
2639
|
-
"page-size":
|
|
2640
|
-
"onUpdate:pageSize": c[9] || (c[9] = (
|
|
2670
|
+
"current-page": o(t).page.num,
|
|
2671
|
+
"onUpdate:currentPage": c[8] || (c[8] = (n) => o(t).page.num = n),
|
|
2672
|
+
"page-size": o(t).page.size,
|
|
2673
|
+
"onUpdate:pageSize": c[9] || (c[9] = (n) => o(t).page.size = n),
|
|
2641
2674
|
background: "",
|
|
2642
|
-
"page-sizes":
|
|
2643
|
-
"pager-count":
|
|
2644
|
-
layout:
|
|
2645
|
-
total:
|
|
2646
|
-
size:
|
|
2647
|
-
onSizeChange:
|
|
2648
|
-
onCurrentChange:
|
|
2649
|
-
},
|
|
2675
|
+
"page-sizes": o(t).page.sizeList,
|
|
2676
|
+
"pager-count": o(t).page.pagerCount,
|
|
2677
|
+
layout: o(t).page.layout,
|
|
2678
|
+
total: o(t).page.total,
|
|
2679
|
+
size: i.option.size?.table,
|
|
2680
|
+
onSizeChange: o(t).table.getList,
|
|
2681
|
+
onCurrentChange: o(t).table.getList
|
|
2682
|
+
}, i.option.page?.pagination || {}, z(i.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : v("", !0)
|
|
2650
2683
|
])
|
|
2651
2684
|
], 2),
|
|
2652
2685
|
C(m.$slots, "box-right")
|
|
2653
2686
|
], 2),
|
|
2654
|
-
|
|
2655
|
-
modelValue:
|
|
2656
|
-
"onUpdate:modelValue": c[10] || (c[10] = (
|
|
2657
|
-
title:
|
|
2658
|
-
"before-close":
|
|
2659
|
-
},
|
|
2687
|
+
E(o(oe), V({
|
|
2688
|
+
modelValue: o(t).update.show,
|
|
2689
|
+
"onUpdate:modelValue": c[10] || (c[10] = (n) => o(t).update.show = n),
|
|
2690
|
+
title: o(t).update.title,
|
|
2691
|
+
"before-close": o(t).update.close
|
|
2692
|
+
}, i.option.dialog), {
|
|
2660
2693
|
footer: y(() => [
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
size:
|
|
2694
|
+
D("span", Mt, [
|
|
2695
|
+
E(o(W), {
|
|
2696
|
+
size: i.option.size?.form
|
|
2664
2697
|
}, {
|
|
2665
2698
|
default: y(() => [
|
|
2666
|
-
|
|
2667
|
-
onClick:
|
|
2699
|
+
E(o(L), {
|
|
2700
|
+
onClick: o(t).update.close
|
|
2668
2701
|
}, {
|
|
2669
2702
|
default: y(() => [
|
|
2670
|
-
|
|
2703
|
+
U(O(o(w).tCurd("close")), 1)
|
|
2671
2704
|
]),
|
|
2672
2705
|
_: 1
|
|
2673
2706
|
}, 8, ["onClick"]),
|
|
2674
|
-
|
|
2707
|
+
o(t).update.type !== o(p).View ? (f(), g(o(L), {
|
|
2675
2708
|
key: 0,
|
|
2676
2709
|
type: "primary",
|
|
2677
|
-
onClick:
|
|
2678
|
-
loading:
|
|
2710
|
+
onClick: o(t).update.submit,
|
|
2711
|
+
loading: o(t).update.loading
|
|
2679
2712
|
}, {
|
|
2680
2713
|
default: y(() => [
|
|
2681
|
-
|
|
2714
|
+
U(O(o(w).tCurd("submit")), 1)
|
|
2682
2715
|
]),
|
|
2683
2716
|
_: 1
|
|
2684
2717
|
}, 8, ["onClick", "loading"])) : v("", !0)
|
|
@@ -2688,55 +2721,55 @@ const wt = /* @__PURE__ */ G(gt, [["render", bt]]), kt = {
|
|
|
2688
2721
|
])
|
|
2689
2722
|
]),
|
|
2690
2723
|
default: y(() => [
|
|
2691
|
-
|
|
2724
|
+
E(o(W), {
|
|
2692
2725
|
ref_key: "ruleFormRef",
|
|
2693
|
-
ref:
|
|
2694
|
-
model:
|
|
2695
|
-
rules:
|
|
2696
|
-
size:
|
|
2726
|
+
ref: r,
|
|
2727
|
+
model: o(t).update.form,
|
|
2728
|
+
rules: o(t).update.rules,
|
|
2729
|
+
size: i.option.size?.form,
|
|
2697
2730
|
class: "update-dialog-form"
|
|
2698
2731
|
}, {
|
|
2699
2732
|
default: y(() => [
|
|
2700
|
-
|
|
2701
|
-
|
|
2733
|
+
o(t).update.showContent ? (f(!0), b($, { key: 0 }, F(o(t).update.formColumn, (n) => (f(), b($, null, [
|
|
2734
|
+
o(l)(
|
|
2702
2735
|
(() => {
|
|
2703
2736
|
const h = [], S = (j) => {
|
|
2704
|
-
j?.item?.children ? S(j.item.children) : h.push(...j.map((
|
|
2737
|
+
j?.item?.children ? S(j.item.children) : h.push(...j.map((T) => T.item?.show?.form));
|
|
2705
2738
|
};
|
|
2706
|
-
return S(
|
|
2739
|
+
return S(n), h;
|
|
2707
2740
|
})(),
|
|
2708
|
-
|
|
2709
|
-
|
|
2741
|
+
o(t).update.form,
|
|
2742
|
+
o(t).update.type
|
|
2710
2743
|
) ? (f(), b("div", {
|
|
2711
2744
|
key: 0,
|
|
2712
2745
|
class: I(["row curd-row", {
|
|
2713
|
-
stripe:
|
|
2746
|
+
stripe: i.option.form?.stripe === void 0 ? !0 : i.option.form?.stripe
|
|
2714
2747
|
}])
|
|
2715
2748
|
}, [
|
|
2716
2749
|
C(m.$slots, "form-start", {
|
|
2717
|
-
row:
|
|
2750
|
+
row: o(t).update.form
|
|
2718
2751
|
}),
|
|
2719
|
-
(f(!0), b(
|
|
2720
|
-
|
|
2752
|
+
(f(!0), b($, null, F(n, (h) => (f(), b($, null, [
|
|
2753
|
+
o(l)(h.item.show?.form, o(t).update.form, o(t).update.type) ? (f(), b("div", {
|
|
2721
2754
|
key: 0,
|
|
2722
|
-
class: I([h.item.form.span > 0 ? `col-${
|
|
2755
|
+
class: I([h.item.form.span > 0 ? `col-${o(t).getColumnSpan(h, n)}` : "col", `form-item-col-${h.item.key}`])
|
|
2723
2756
|
}, [
|
|
2724
|
-
(f(!0), b(
|
|
2757
|
+
(f(!0), b($, null, F(h.item.children ? h.children : [h], (S) => (f(), g(pt, {
|
|
2725
2758
|
key: S.item.key,
|
|
2726
|
-
conf:
|
|
2759
|
+
conf: o(t),
|
|
2727
2760
|
item: S
|
|
2728
2761
|
}, J({ _: 2 }, [
|
|
2729
|
-
|
|
2730
|
-
name:
|
|
2762
|
+
F(m.$slots, (j, T) => ({
|
|
2763
|
+
name: T,
|
|
2731
2764
|
fn: y((R) => [
|
|
2732
|
-
C(m.$slots,
|
|
2765
|
+
C(m.$slots, T, V({ ref_for: !0 }, R || {}))
|
|
2733
2766
|
])
|
|
2734
2767
|
}))
|
|
2735
2768
|
]), 1032, ["conf", "item"]))), 128))
|
|
2736
2769
|
], 2)) : v("", !0)
|
|
2737
2770
|
], 64))), 256)),
|
|
2738
2771
|
C(m.$slots, "form-end", {
|
|
2739
|
-
row:
|
|
2772
|
+
row: o(t).update.form
|
|
2740
2773
|
})
|
|
2741
2774
|
], 2)) : v("", !0)
|
|
2742
2775
|
], 64))), 256)) : v("", !0)
|
|
@@ -2746,33 +2779,33 @@ const wt = /* @__PURE__ */ G(gt, [["render", bt]]), kt = {
|
|
|
2746
2779
|
]),
|
|
2747
2780
|
_: 3
|
|
2748
2781
|
}, 16, ["modelValue", "title", "before-close"]),
|
|
2749
|
-
|
|
2750
|
-
modelValue:
|
|
2751
|
-
"onUpdate:modelValue": c[11] || (c[11] = (
|
|
2752
|
-
title:
|
|
2782
|
+
E(o(oe), {
|
|
2783
|
+
modelValue: o(t).remove.show,
|
|
2784
|
+
"onUpdate:modelValue": c[11] || (c[11] = (n) => o(t).remove.show = n),
|
|
2785
|
+
title: o(t).remove.title,
|
|
2753
2786
|
"close-on-click-modal": !1
|
|
2754
2787
|
}, {
|
|
2755
2788
|
footer: y(() => [
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
size:
|
|
2789
|
+
D("span", At, [
|
|
2790
|
+
E(o(W), {
|
|
2791
|
+
size: i.option.size?.form
|
|
2759
2792
|
}, {
|
|
2760
2793
|
default: y(() => [
|
|
2761
|
-
|
|
2762
|
-
onClick:
|
|
2794
|
+
E(o(L), {
|
|
2795
|
+
onClick: o(t).remove.close
|
|
2763
2796
|
}, {
|
|
2764
2797
|
default: y(() => [
|
|
2765
|
-
|
|
2798
|
+
U(O(o(w).tCurd("close")), 1)
|
|
2766
2799
|
]),
|
|
2767
2800
|
_: 1
|
|
2768
2801
|
}, 8, ["onClick"]),
|
|
2769
|
-
|
|
2802
|
+
E(o(L), {
|
|
2770
2803
|
type: "danger",
|
|
2771
|
-
onClick:
|
|
2772
|
-
loading:
|
|
2804
|
+
onClick: o(t).remove.submit,
|
|
2805
|
+
loading: o(t).remove.loading
|
|
2773
2806
|
}, {
|
|
2774
2807
|
default: y(() => [
|
|
2775
|
-
|
|
2808
|
+
U(O(o(w).tCurd("confirmDelete")), 1)
|
|
2776
2809
|
]),
|
|
2777
2810
|
_: 1
|
|
2778
2811
|
}, 8, ["onClick", "loading"])
|
|
@@ -2782,37 +2815,37 @@ const wt = /* @__PURE__ */ G(gt, [["render", bt]]), kt = {
|
|
|
2782
2815
|
])
|
|
2783
2816
|
]),
|
|
2784
2817
|
default: y(() => [
|
|
2785
|
-
|
|
2818
|
+
D("div", null, O(o(w).tCurd("confirmDeleteMessage", o(t).remove.items.length)), 1)
|
|
2786
2819
|
]),
|
|
2787
2820
|
_: 1
|
|
2788
2821
|
}, 8, ["modelValue", "title"]),
|
|
2789
|
-
|
|
2822
|
+
E(Re, {
|
|
2790
2823
|
ref_key: "switchConfirmRef",
|
|
2791
2824
|
ref: e,
|
|
2792
|
-
size:
|
|
2825
|
+
size: i.option.size?.form
|
|
2793
2826
|
}, null, 8, ["size"])
|
|
2794
2827
|
], 2);
|
|
2795
2828
|
};
|
|
2796
2829
|
}
|
|
2797
2830
|
});
|
|
2798
|
-
class
|
|
2831
|
+
class Rt {
|
|
2799
2832
|
/**
|
|
2800
2833
|
* 通过远程 URL 下载文件,自动创建临时 `<a>` 标签触发浏览器下载
|
|
2801
2834
|
*
|
|
2802
2835
|
* @param href - 文件的远程地址
|
|
2803
2836
|
* @param name - 下载后的文件名,默认 `'download.png'`
|
|
2804
2837
|
*/
|
|
2805
|
-
static async download(
|
|
2838
|
+
static async download(a, p = "download.png") {
|
|
2806
2839
|
const s = document.createElement("a");
|
|
2807
|
-
s.style.display = "none", s.href =
|
|
2840
|
+
s.style.display = "none", s.href = a, s.setAttribute("download", p), typeof s.download > "u" && s.setAttribute("target", "_blank"), document.body.appendChild(s), s.click(), document.body.removeChild(s), window.URL.revokeObjectURL(a);
|
|
2808
2841
|
}
|
|
2809
2842
|
/**
|
|
2810
2843
|
* 将json对象或者json数组导出为json文件保存
|
|
2811
2844
|
* @param data
|
|
2812
2845
|
* @param name
|
|
2813
2846
|
*/
|
|
2814
|
-
static exportJSONFile = (
|
|
2815
|
-
const s = new Blob([JSON.stringify(
|
|
2847
|
+
static exportJSONFile = (a, p) => {
|
|
2848
|
+
const s = new Blob([JSON.stringify(a)], { type: "application/json" }), l = URL.createObjectURL(s), t = document.createElement("a");
|
|
2816
2849
|
t.href = l, t.download = `${p || "config"}.json`, t.click();
|
|
2817
2850
|
};
|
|
2818
2851
|
/**
|
|
@@ -2820,13 +2853,13 @@ class jt {
|
|
|
2820
2853
|
* @param param
|
|
2821
2854
|
* @returns
|
|
2822
2855
|
*/
|
|
2823
|
-
static importFile = async (
|
|
2856
|
+
static importFile = async (a) => new Promise((p, s) => {
|
|
2824
2857
|
const l = document.createElement("input");
|
|
2825
2858
|
l.type = "file";
|
|
2826
|
-
const t =
|
|
2859
|
+
const t = a?.accept || ".json";
|
|
2827
2860
|
l.accept = t, l.style.display = "none", l.onchange = (e) => {
|
|
2828
|
-
const
|
|
2829
|
-
if (!
|
|
2861
|
+
const r = e.target.files[0];
|
|
2862
|
+
if (!r) {
|
|
2830
2863
|
M.fail("未选择文件"), s("未选择文件");
|
|
2831
2864
|
return;
|
|
2832
2865
|
}
|
|
@@ -2836,30 +2869,30 @@ class jt {
|
|
|
2836
2869
|
p(c);
|
|
2837
2870
|
}, d.onerror = () => {
|
|
2838
2871
|
M.fail("文件读取失败"), s("文件读取失败");
|
|
2839
|
-
}, d.readAsText(
|
|
2872
|
+
}, d.readAsText(r), document.body.removeChild(l);
|
|
2840
2873
|
}, document.body.appendChild(l), l.click();
|
|
2841
2874
|
});
|
|
2842
2875
|
}
|
|
2843
|
-
const
|
|
2844
|
-
if (
|
|
2845
|
-
|
|
2846
|
-
for (const p in
|
|
2847
|
-
|
|
2876
|
+
const Tt = (i, a) => {
|
|
2877
|
+
if (i.component("TCurd", Ft), i.component("TFormList", se), i.component("TColumn", Te), a?.customComponent) {
|
|
2878
|
+
B.customComponent = a.customComponent;
|
|
2879
|
+
for (const p in a.customComponent)
|
|
2880
|
+
i.component(p, a.customComponent[p]);
|
|
2848
2881
|
}
|
|
2849
|
-
},
|
|
2850
|
-
install:
|
|
2882
|
+
}, It = {
|
|
2883
|
+
install: Tt
|
|
2851
2884
|
};
|
|
2852
2885
|
export {
|
|
2853
|
-
|
|
2854
|
-
|
|
2886
|
+
H as ArrUtil,
|
|
2887
|
+
Le as ExcelUtil,
|
|
2855
2888
|
Te as TColumn,
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2889
|
+
Ft as TCurd,
|
|
2890
|
+
Rt as TFile,
|
|
2891
|
+
B as TForm,
|
|
2859
2892
|
A as TFormConfig,
|
|
2860
2893
|
w as TFormI18n,
|
|
2861
|
-
|
|
2894
|
+
se as TFormList,
|
|
2862
2895
|
M as TSys,
|
|
2863
|
-
|
|
2864
|
-
|
|
2896
|
+
It as default,
|
|
2897
|
+
Tt as install
|
|
2865
2898
|
};
|