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