cc1-form 1.1.37 → 1.1.39
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 +1157 -1085
- package/dist/cc1-form.umd.cjs +1 -1
- package/dist/components/TCurd/com/form/column.vue.d.ts +1485 -183
- package/dist/components/TCurd/com/form/list.vue.d.ts +2 -2
- package/dist/components/TCurd/formColumn.vue.d.ts +690 -40
- package/dist/components/TCurd/index.d.ts +709 -77
- package/dist/components/TCurd/index.vue.d.ts +1643 -259
- package/dist/components/TCurd/indexType.d.ts +16 -39
- package/dist/components/TCurd/tableColumn.vue.d.ts +2 -2
- package/dist/utils/TSys.d.ts +1 -1
- package/package.json +1 -1
package/dist/cc1-form.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ElMessage as
|
|
1
|
+
import { ElMessage as ce, ElLoading as me, ElForm as N, ElFormItem as X, ElInput as Y, ElSwitch as oe, ElSelect as W, ElOption as K, ElRadioGroup as re, ElRadio as se, ElTreeSelect as de, ElDatePicker as ae, ElDialog as _, ElButton as A, ElTableColumn as ee, ElDropdown as he, ElDropdownMenu as ge, ElDropdownItem as x, ElPagination as ie, ElTable as be } from "element-plus";
|
|
2
2
|
import "vue-router";
|
|
3
|
-
import { defineComponent as
|
|
4
|
-
class
|
|
3
|
+
import { defineComponent as J, reactive as le, onMounted as ue, resolveComponent as Q, createElementBlock as y, createCommentVNode as C, openBlock as f, renderSlot as k, createElementVNode as O, createVNode as z, withCtx as m, createTextVNode as E, Fragment as $, renderList as L, createBlock as h, normalizeClass as j, normalizeStyle as fe, ref as H, unref as a, mergeProps as v, toHandlers as S, resolveDynamicComponent as q, toDisplayString as T, getCurrentInstance as ye, createSlots as te, resolveDirective as we, withDirectives as ke, normalizeProps as Ce, guardReactiveProps as ve } from "vue";
|
|
4
|
+
class U {
|
|
5
5
|
/**
|
|
6
6
|
* Vue Router 实例,需在应用初始化时赋值
|
|
7
7
|
*/
|
|
@@ -15,7 +15,7 @@ class D {
|
|
|
15
15
|
*/
|
|
16
16
|
static getRouterPath = () => this.router.currentRoute.value.path;
|
|
17
17
|
static EDialog = {
|
|
18
|
-
|
|
18
|
+
Add: "Add",
|
|
19
19
|
Update: "Update",
|
|
20
20
|
View: "View",
|
|
21
21
|
Remove: "Remove"
|
|
@@ -26,13 +26,13 @@ class D {
|
|
|
26
26
|
* @param data 数据
|
|
27
27
|
* @returns 是否显示
|
|
28
28
|
*/
|
|
29
|
-
static isFun = (
|
|
29
|
+
static isFun = (o, ...u) => Array.isArray(o) ? o.some((t) => typeof t == "function" ? t(...u) : t) : typeof o == "function" ? o(...u) : o;
|
|
30
30
|
/**
|
|
31
31
|
* 获取路由参数,自动获取query、params中的参数, 哪个有就返回哪个
|
|
32
32
|
*/
|
|
33
33
|
static getRouterParams = () => {
|
|
34
|
-
const
|
|
35
|
-
return Object.keys(
|
|
34
|
+
const o = this.router.currentRoute.value.query || {}, u = this.router.currentRoute.value.params || {};
|
|
35
|
+
return Object.keys(o).length ? o : Object.keys(u).length ? u : {};
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
38
38
|
* 模块赋值
|
|
@@ -42,11 +42,11 @@ class D {
|
|
|
42
42
|
* 加载模块
|
|
43
43
|
* @param module
|
|
44
44
|
*/
|
|
45
|
-
static loadModule = async (
|
|
46
|
-
if (!
|
|
47
|
-
throw new Error(`模块${
|
|
48
|
-
const
|
|
49
|
-
return
|
|
45
|
+
static loadModule = async (o) => {
|
|
46
|
+
if (!U.moduleObj[o])
|
|
47
|
+
throw new Error(`模块${o}未加载,请赋值如:TSys.moduleObj = { ${o}: ()=>import('${o}') }`);
|
|
48
|
+
const u = await U.moduleObj[o]();
|
|
49
|
+
return u.default ?? u;
|
|
50
50
|
};
|
|
51
51
|
/**
|
|
52
52
|
* 提示信息对象管理
|
|
@@ -62,19 +62,19 @@ class D {
|
|
|
62
62
|
* @param type 消息类型
|
|
63
63
|
* @param options 其他选项
|
|
64
64
|
*/
|
|
65
|
-
static showMessage(
|
|
65
|
+
static showMessage(o, u, t = {}) {
|
|
66
66
|
const i = Date.now();
|
|
67
|
-
if (!this.tipMessages[
|
|
68
|
-
this.tipMessages[
|
|
69
|
-
const
|
|
67
|
+
if (!this.tipMessages[o] || i - this.tipMessages[o] > this.tipMessagesGap) {
|
|
68
|
+
this.tipMessages[o] = i;
|
|
69
|
+
const l = Object.assign(
|
|
70
70
|
{
|
|
71
|
-
message:
|
|
72
|
-
type:
|
|
71
|
+
message: o,
|
|
72
|
+
type: u
|
|
73
73
|
},
|
|
74
|
-
|
|
74
|
+
t
|
|
75
75
|
);
|
|
76
|
-
|
|
77
|
-
delete this.tipMessages[
|
|
76
|
+
ce(l), setTimeout(() => {
|
|
77
|
+
delete this.tipMessages[o];
|
|
78
78
|
}, this.tipMessagesGap);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -83,16 +83,16 @@ class D {
|
|
|
83
83
|
* @param content
|
|
84
84
|
* @param options
|
|
85
85
|
*/
|
|
86
|
-
static fail = (
|
|
87
|
-
this.showMessage(
|
|
86
|
+
static fail = (o, u = {}) => {
|
|
87
|
+
this.showMessage(o, "error", u);
|
|
88
88
|
};
|
|
89
89
|
/**
|
|
90
90
|
* 成功提示
|
|
91
91
|
* @param content
|
|
92
92
|
* @param options
|
|
93
93
|
*/
|
|
94
|
-
static success = (
|
|
95
|
-
this.showMessage(
|
|
94
|
+
static success = (o, u = {}) => {
|
|
95
|
+
this.showMessage(o, "success", u);
|
|
96
96
|
};
|
|
97
97
|
static loadingObj = null;
|
|
98
98
|
static loadingTimer = null;
|
|
@@ -101,11 +101,11 @@ class D {
|
|
|
101
101
|
* @param show
|
|
102
102
|
* @param text
|
|
103
103
|
*/
|
|
104
|
-
static loading = (
|
|
104
|
+
static loading = (o = !0, u = "Loading...") => {
|
|
105
105
|
Timer.un(this.loadingTimer), this.loadingTimer = Timer.once(() => {
|
|
106
|
-
|
|
106
|
+
o ? this.loadingObj = me.service({
|
|
107
107
|
lock: !0,
|
|
108
|
-
text:
|
|
108
|
+
text: u,
|
|
109
109
|
background: "rgba(0, 0, 0, 0.3)"
|
|
110
110
|
}) : this.loadingObj && (this.loadingObj.close(), this.loadingObj = null);
|
|
111
111
|
}, 50);
|
|
@@ -115,46 +115,46 @@ class D {
|
|
|
115
115
|
* @param url 地址
|
|
116
116
|
* @param isCenter 是否居中
|
|
117
117
|
*/
|
|
118
|
-
static openUrl = (
|
|
119
|
-
if (
|
|
120
|
-
let
|
|
118
|
+
static openUrl = (o, u = !0) => {
|
|
119
|
+
if (u) {
|
|
120
|
+
let t = screen.width / 2 - 500, i = 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=" + i + ", left=" +
|
|
124
|
+
"toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + i + ", left=" + t
|
|
125
125
|
);
|
|
126
126
|
} else
|
|
127
|
-
window.open(
|
|
127
|
+
window.open(o, "DescriptiveWindowName" + StrUtil.getId(), "resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0");
|
|
128
128
|
};
|
|
129
129
|
/**
|
|
130
130
|
* 根据dom id截图并返回图片数据
|
|
131
131
|
* @param param
|
|
132
132
|
* @returns
|
|
133
133
|
*/
|
|
134
|
-
static getImgPic = (
|
|
135
|
-
let i = document.getElementById(
|
|
136
|
-
const
|
|
134
|
+
static getImgPic = (o) => new Promise(async (u, t) => {
|
|
135
|
+
let i = document.getElementById(o.id);
|
|
136
|
+
const l = await U.loadModule("html2canvas");
|
|
137
137
|
try {
|
|
138
|
-
|
|
138
|
+
l(i, {
|
|
139
139
|
logging: !1,
|
|
140
140
|
allowTaint: !0,
|
|
141
141
|
scale: window.devicePixelRatio,
|
|
142
|
-
width:
|
|
143
|
-
height:
|
|
144
|
-
windowWidth:
|
|
145
|
-
windowHeight:
|
|
142
|
+
width: o.windowWidth,
|
|
143
|
+
height: o.windowHeight,
|
|
144
|
+
windowWidth: o.windowWidth,
|
|
145
|
+
windowHeight: o.windowHeight,
|
|
146
146
|
useCORS: !0,
|
|
147
147
|
backgroundColor: "#ffffff00"
|
|
148
|
-
}).then(function(
|
|
149
|
-
let
|
|
150
|
-
|
|
148
|
+
}).then(function(e) {
|
|
149
|
+
let s = e.toDataURL("image/png");
|
|
150
|
+
u(s);
|
|
151
151
|
});
|
|
152
|
-
} catch (
|
|
153
|
-
e
|
|
152
|
+
} catch (e) {
|
|
153
|
+
t(e);
|
|
154
154
|
}
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
|
-
class
|
|
157
|
+
class D {
|
|
158
158
|
/**
|
|
159
159
|
* 全局配置对象
|
|
160
160
|
*/
|
|
@@ -489,11 +489,11 @@ class z {
|
|
|
489
489
|
*
|
|
490
490
|
* @param config - 需要覆盖的配置项(深度 Partial)
|
|
491
491
|
*/
|
|
492
|
-
static setConfig = (
|
|
493
|
-
|
|
492
|
+
static setConfig = (o) => {
|
|
493
|
+
D.config = ObjectUtil.deepMerge(D.config, o);
|
|
494
494
|
};
|
|
495
495
|
}
|
|
496
|
-
class
|
|
496
|
+
class M {
|
|
497
497
|
/**
|
|
498
498
|
* 自定义组件映射表,key 为组件名(同时作为 column.type 值),value 为 Vue 组件定义
|
|
499
499
|
*
|
|
@@ -511,10 +511,10 @@ class j {
|
|
|
511
511
|
* @param field - 字段的 key 值
|
|
512
512
|
* @returns 该字段对应类型的 options 配置,如 select 类型返回 `options.select`
|
|
513
513
|
*/
|
|
514
|
-
static findOptions = (
|
|
515
|
-
const
|
|
516
|
-
if (
|
|
517
|
-
return
|
|
514
|
+
static findOptions = (o, u) => {
|
|
515
|
+
const t = o.column.find((l) => l.key === u), i = (l) => l.replace(/-([a-z])/g, (e, s) => s.toUpperCase());
|
|
516
|
+
if (t)
|
|
517
|
+
return t.options[i(t.type)];
|
|
518
518
|
};
|
|
519
519
|
/**
|
|
520
520
|
* 更新组件数据
|
|
@@ -532,9 +532,9 @@ class j {
|
|
|
532
532
|
}))
|
|
533
533
|
)
|
|
534
534
|
*/
|
|
535
|
-
static setOptionsData = (
|
|
536
|
-
const i =
|
|
537
|
-
i && (i.data =
|
|
535
|
+
static setOptionsData = (o, u, t) => {
|
|
536
|
+
const i = M.findOptions(o, u);
|
|
537
|
+
i && (i.data = t);
|
|
538
538
|
};
|
|
539
539
|
static form = {
|
|
540
540
|
openBefore: {
|
|
@@ -545,13 +545,65 @@ class j {
|
|
|
545
545
|
* @param treeData 树形数据
|
|
546
546
|
* @param option 组件配置
|
|
547
547
|
*/
|
|
548
|
-
parentId: (
|
|
549
|
-
const
|
|
550
|
-
|
|
548
|
+
parentId: (o, u, t, i) => {
|
|
549
|
+
const l = D.config.table.rowKey;
|
|
550
|
+
o ? u.type === U.EDialog.Add ? (u.form.parentId = o[l], u.form.sort = o.children.length + 1) : u.form.parentId = o.parentId.substring(o.parentId.lastIndexOf(",") + 1) : (u.form.parentId = "0", u.form.sort = t.length + 1), M.setOptionsData(i, "parentId", [{ [l]: "0", title: "根", children: t }]);
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
553
|
};
|
|
554
554
|
}
|
|
555
|
+
const Ve = {
|
|
556
|
+
search: "搜索",
|
|
557
|
+
add: "新增",
|
|
558
|
+
edit: "编辑",
|
|
559
|
+
view: "查看",
|
|
560
|
+
delete: "删除",
|
|
561
|
+
export: "导出",
|
|
562
|
+
exportSelect: "导出选中",
|
|
563
|
+
exportPage: "导出本页",
|
|
564
|
+
exportAll: "导出全部",
|
|
565
|
+
import: "导入",
|
|
566
|
+
refresh: "刷新",
|
|
567
|
+
reset: "重置",
|
|
568
|
+
expandCollapse: "展开/收缩",
|
|
569
|
+
operation: "操作",
|
|
570
|
+
close: "关闭",
|
|
571
|
+
cancel: "取消",
|
|
572
|
+
submit: "提交",
|
|
573
|
+
confirm: "确认",
|
|
574
|
+
confirmDelete: "确认删除",
|
|
575
|
+
confirmDeleteMessage: "确认要删除【{count}】条数据吗?",
|
|
576
|
+
placeholderInput: "请输入",
|
|
577
|
+
placeholderSelect: "请选择",
|
|
578
|
+
checkFormData: "请检查表单数据",
|
|
579
|
+
selectDataToDelete: "请选择要删除的数据",
|
|
580
|
+
selectDataToExport: "请选择要导出的数据",
|
|
581
|
+
noData: "暂无数据",
|
|
582
|
+
operationSuccess: "操作成功",
|
|
583
|
+
switchOn: "开启",
|
|
584
|
+
switchOff: "关闭",
|
|
585
|
+
confirmModify: "确认修改",
|
|
586
|
+
confirmSwitchMessage: "确认要修改吗?"
|
|
587
|
+
};
|
|
588
|
+
class b {
|
|
589
|
+
/** 解析国际化值:函数则执行并返回字符串,字符串则替换 `{key}` 占位符 */
|
|
590
|
+
static t(o, ...u) {
|
|
591
|
+
if (typeof o == "function")
|
|
592
|
+
return o(...u);
|
|
593
|
+
o = String(o);
|
|
594
|
+
let t = 0;
|
|
595
|
+
return o.replace(/{([^}]+)}/g, (i, l) => t < u.length ? String(u[t++]) : `{${l}}`);
|
|
596
|
+
}
|
|
597
|
+
static setI18n = (o) => {
|
|
598
|
+
b.curd = ObjectUtil.deepMerge(b.curd, o);
|
|
599
|
+
};
|
|
600
|
+
/** 解析curd国际化值 */
|
|
601
|
+
static tCurd(o, ...u) {
|
|
602
|
+
return this.t(this.curd[o], ...u);
|
|
603
|
+
}
|
|
604
|
+
/** curd表单 */
|
|
605
|
+
static curd = Ve;
|
|
606
|
+
}
|
|
555
607
|
class P {
|
|
556
608
|
/**
|
|
557
609
|
* ID 生成函数,默认使用 `StrUtil.uuid()`,可覆盖为自定义实现
|
|
@@ -562,14 +614,14 @@ class P {
|
|
|
562
614
|
* @param field 字段名
|
|
563
615
|
* @param row 行数据
|
|
564
616
|
*/
|
|
565
|
-
static setId = (
|
|
566
|
-
|
|
567
|
-
const i =
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
let
|
|
571
|
-
|
|
572
|
-
}),
|
|
617
|
+
static setId = (o, u, t) => {
|
|
618
|
+
u[o] || (u[o] = []);
|
|
619
|
+
const i = D.config.table.rowKey;
|
|
620
|
+
u[o].forEach((l) => {
|
|
621
|
+
t.forEach((e) => {
|
|
622
|
+
let s = e.default ?? "";
|
|
623
|
+
e.type === "number" && (s = e.default ?? 0), e.type === "boolean" && (s = e.default ?? !1), e.type === "time" && (s = e.default ?? /* @__PURE__ */ new Date()), l[e.value] === void 0 && (l[e.value] = s);
|
|
624
|
+
}), l[i] || (l[i] = P.getIdFun());
|
|
573
625
|
});
|
|
574
626
|
};
|
|
575
627
|
/**
|
|
@@ -579,19 +631,19 @@ class P {
|
|
|
579
631
|
* @param itemFields 元素字段-如:[{label:'',value:''}]
|
|
580
632
|
* @param callback 回调函数
|
|
581
633
|
*/
|
|
582
|
-
static add = (
|
|
583
|
-
const
|
|
584
|
-
P.setId(
|
|
585
|
-
const
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
(
|
|
589
|
-
let
|
|
590
|
-
return
|
|
634
|
+
static add = (o, u, t, i) => {
|
|
635
|
+
const l = JSONUtil.cp(t);
|
|
636
|
+
P.setId(o, u, t);
|
|
637
|
+
const e = D.config.table.rowKey;
|
|
638
|
+
u[o].push(
|
|
639
|
+
l.reduce(
|
|
640
|
+
(s, p) => {
|
|
641
|
+
let c = p.default ?? "";
|
|
642
|
+
return p.type === "number" && (c = p.default ?? 0), p.type === "boolean" && (c = p.default ?? !1), p.type === "time" && (c = p.default ?? /* @__PURE__ */ new Date()), s[p.value] = c, s;
|
|
591
643
|
},
|
|
592
|
-
{ [
|
|
644
|
+
{ [e]: P.getIdFun() }
|
|
593
645
|
)
|
|
594
|
-
), i?.(
|
|
646
|
+
), i?.(u);
|
|
595
647
|
};
|
|
596
648
|
/**
|
|
597
649
|
* 删除数组元素
|
|
@@ -600,9 +652,9 @@ class P {
|
|
|
600
652
|
* @param item 元素-如:{_id:''}
|
|
601
653
|
* @param callback 回调函数
|
|
602
654
|
*/
|
|
603
|
-
static remove = (
|
|
604
|
-
const
|
|
605
|
-
|
|
655
|
+
static remove = (o, u, t, i) => {
|
|
656
|
+
const l = D.config.table.rowKey;
|
|
657
|
+
u[o] = u[o].filter((e) => e[l] !== t[l]), i?.(u);
|
|
606
658
|
};
|
|
607
659
|
/**
|
|
608
660
|
* 获取没有id的数据
|
|
@@ -610,21 +662,21 @@ class P {
|
|
|
610
662
|
* @param childernField 子级字段-如:list、children
|
|
611
663
|
* @returns 没有id的数据
|
|
612
664
|
*/
|
|
613
|
-
static getNoIdData = (
|
|
614
|
-
const
|
|
615
|
-
return
|
|
616
|
-
|
|
617
|
-
}),
|
|
665
|
+
static getNoIdData = (o, u) => {
|
|
666
|
+
const t = JSONUtil.cp(o), i = D.config.table.rowKey;
|
|
667
|
+
return t.forEach((l) => {
|
|
668
|
+
l[i] && delete l[i], u && l[u] && P.getNoIdData(l[u], u);
|
|
669
|
+
}), t;
|
|
618
670
|
};
|
|
619
671
|
}
|
|
620
672
|
const ze = {
|
|
621
673
|
key: 0,
|
|
622
674
|
class: "column",
|
|
623
675
|
style: { width: "100%", gap: "10px" }
|
|
624
|
-
},
|
|
676
|
+
}, De = {
|
|
625
677
|
class: "row items-center",
|
|
626
678
|
style: { gap: "10px", width: "100%" }
|
|
627
|
-
},
|
|
679
|
+
}, ne = /* @__PURE__ */ J({
|
|
628
680
|
__name: "list",
|
|
629
681
|
props: {
|
|
630
682
|
row: {
|
|
@@ -659,73 +711,76 @@ const ze = {
|
|
|
659
711
|
}
|
|
660
712
|
},
|
|
661
713
|
emits: ["change"],
|
|
662
|
-
setup(
|
|
663
|
-
const
|
|
714
|
+
setup(r, { emit: o }) {
|
|
715
|
+
const u = r, t = le({
|
|
664
716
|
show: !1,
|
|
665
|
-
add: (
|
|
666
|
-
P.add(
|
|
717
|
+
add: (l, e, s) => {
|
|
718
|
+
P.add(l, e, s, () => {
|
|
667
719
|
i("change");
|
|
668
720
|
});
|
|
669
721
|
},
|
|
670
|
-
remove: (
|
|
671
|
-
P.remove(
|
|
722
|
+
remove: (l, e, s) => {
|
|
723
|
+
P.remove(l, e, s, () => {
|
|
672
724
|
i("change");
|
|
673
725
|
});
|
|
674
726
|
}
|
|
675
727
|
});
|
|
676
|
-
|
|
677
|
-
P.setId(
|
|
728
|
+
ue(() => {
|
|
729
|
+
P.setId(u.field, u.row, u.itemFields), t.show = !0;
|
|
678
730
|
});
|
|
679
|
-
const i =
|
|
680
|
-
return (
|
|
681
|
-
const
|
|
682
|
-
return
|
|
683
|
-
k(
|
|
731
|
+
const i = o;
|
|
732
|
+
return (l, e) => {
|
|
733
|
+
const s = Q("el-button"), p = Q("el-input");
|
|
734
|
+
return t.show ? (f(), y("div", ze, [
|
|
735
|
+
k(l.$slots, "list-start", { row: r.row }),
|
|
684
736
|
O("div", null, [
|
|
685
|
-
|
|
737
|
+
z(s, {
|
|
686
738
|
link: "",
|
|
687
739
|
type: "primary",
|
|
688
|
-
onClick:
|
|
740
|
+
onClick: e[0] || (e[0] = (c) => t.add(r.field, r.row, r.itemFields))
|
|
689
741
|
}, {
|
|
690
|
-
default:
|
|
742
|
+
default: m(() => e[2] || (e[2] = [
|
|
691
743
|
E("添加")
|
|
692
744
|
])),
|
|
693
745
|
_: 1
|
|
694
746
|
})
|
|
695
747
|
]),
|
|
696
|
-
(f(!0),
|
|
697
|
-
k(
|
|
698
|
-
item:
|
|
699
|
-
row:
|
|
748
|
+
(f(!0), y($, null, L(r.row[r.field], (c) => (f(), y("div", De, [
|
|
749
|
+
k(l.$slots, "item-start", {
|
|
750
|
+
item: c,
|
|
751
|
+
row: r.row
|
|
700
752
|
}),
|
|
701
|
-
(f(!0),
|
|
702
|
-
modelValue:
|
|
703
|
-
"onUpdate:modelValue": (
|
|
704
|
-
style:
|
|
705
|
-
class:
|
|
706
|
-
placeholder:
|
|
707
|
-
onChange:
|
|
753
|
+
(f(!0), y($, null, L(r.itemFields, (g) => (f(), h(p, {
|
|
754
|
+
modelValue: c[g.value],
|
|
755
|
+
"onUpdate:modelValue": (n) => c[g.value] = n,
|
|
756
|
+
style: fe({ width: r.inputWidth }),
|
|
757
|
+
class: j(r.inputClass),
|
|
758
|
+
placeholder: g[r.label] || g[r.value],
|
|
759
|
+
onChange: e[1] || (e[1] = (n) => i("change"))
|
|
708
760
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "style", "class", "placeholder"]))), 256)),
|
|
709
|
-
k(
|
|
710
|
-
item:
|
|
711
|
-
row:
|
|
761
|
+
k(l.$slots, "item-end", {
|
|
762
|
+
item: c,
|
|
763
|
+
row: r.row
|
|
712
764
|
}),
|
|
713
|
-
|
|
765
|
+
z(s, {
|
|
714
766
|
link: "",
|
|
715
767
|
type: "danger",
|
|
716
|
-
onClick: (
|
|
768
|
+
onClick: (g) => t.remove(r.field, r.row, c)
|
|
717
769
|
}, {
|
|
718
|
-
default:
|
|
770
|
+
default: m(() => e[3] || (e[3] = [
|
|
719
771
|
E("删除")
|
|
720
772
|
])),
|
|
721
773
|
_: 2
|
|
722
774
|
}, 1032, ["onClick"])
|
|
723
775
|
]))), 256)),
|
|
724
|
-
k(
|
|
776
|
+
k(l.$slots, "list-end", { row: r.row })
|
|
725
777
|
])) : C("", !0);
|
|
726
778
|
};
|
|
727
779
|
}
|
|
728
|
-
}),
|
|
780
|
+
}), Se = {
|
|
781
|
+
class: "row form-item-content",
|
|
782
|
+
style: { width: "100%" }
|
|
783
|
+
}, Ee = { class: "col" }, $e = { class: "col" }, Oe = ["innerHTML"], Ue = /* @__PURE__ */ J({
|
|
729
784
|
__name: "column",
|
|
730
785
|
props: {
|
|
731
786
|
/**
|
|
@@ -741,202 +796,229 @@ const ze = {
|
|
|
741
796
|
default: ""
|
|
742
797
|
}
|
|
743
798
|
},
|
|
744
|
-
setup(
|
|
745
|
-
const
|
|
799
|
+
setup(r, { expose: o }) {
|
|
800
|
+
const u = U.isFun, t = U.EDialog, i = H(), l = r, e = le({
|
|
746
801
|
rules: {},
|
|
747
802
|
show: !0,
|
|
748
803
|
form: {},
|
|
749
804
|
formDefault: {},
|
|
805
|
+
type: l.type || t.Add,
|
|
750
806
|
formColumn: [],
|
|
751
|
-
getDisabled: (
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
807
|
+
getDisabled: (s) => e.type === t.View ? s.disabled?.view === void 0 ? !0 : s.disabled?.view : s.disabled?.[e.type === t.Add ? "create" : "update"],
|
|
808
|
+
getBind: (s) => s.options?.[e.type === t.Add ? "formAdd" : "formUpdate"]?.[s.type] || s.options?.[s.type] || {},
|
|
809
|
+
getOn: (s) => s.options?.[e.type === t.Add ? "formAdd" : "formUpdate"]?.[s.type]?.on || s.options?.[s.type]?.on || {},
|
|
810
|
+
getColumnSpan: (s, p) => {
|
|
811
|
+
if (s.item.form?.spanCol) {
|
|
812
|
+
const c = l.option.form?.maxSpan || 12, g = l.option.form?.defaultSpan || c / 2, d = p.filter((V) => !U.isFun(V.item.show?.form, e.form, e.type)).reduce((V, w) => V + (w.item.form?.span || g), 0);
|
|
813
|
+
return (s.item.form?.span || g) + d;
|
|
814
|
+
}
|
|
815
|
+
return s.item.form?.span;
|
|
816
|
+
},
|
|
817
|
+
initColumnForm: () => {
|
|
818
|
+
const s = l.option;
|
|
819
|
+
e.formColumn = [], e.rules = {}, e.formDefault = {};
|
|
820
|
+
const p = [], c = l.option.form?.maxSpan || 12, g = l.option.form?.defaultSpan || c / 2;
|
|
821
|
+
let n = [];
|
|
822
|
+
const d = (w) => {
|
|
823
|
+
if (w.children) {
|
|
824
|
+
w.children.forEach((F) => {
|
|
825
|
+
d(F);
|
|
826
|
+
});
|
|
827
|
+
return;
|
|
763
828
|
}
|
|
829
|
+
if (e.formDefault[w.key] = w.value, w.isForm && (typeof w.show?.form != "boolean" || w.show?.form)) {
|
|
830
|
+
w.form = w.form || { span: g }, w.form.span = w.form.span ?? g;
|
|
831
|
+
const F = w.form.span, B = n.reduce((G, Z) => G + Z.span, F), R = n.length;
|
|
832
|
+
if (n.push({ item: w, span: F }), (R === 1 && n[0].span === 0 || B >= c || F === 0 && R > 1) && (p.push(n), n = []), w.rules) {
|
|
833
|
+
const G = {
|
|
834
|
+
input: b.tCurd("placeholderInput"),
|
|
835
|
+
select: b.tCurd("placeholderSelect")
|
|
836
|
+
}, Z = (G[w.type] || G.input) + w.label;
|
|
837
|
+
e.rules[w.key] = typeof w.rules == "boolean" ? [
|
|
838
|
+
{
|
|
839
|
+
required: !0,
|
|
840
|
+
message: Z,
|
|
841
|
+
trigger: "blur"
|
|
842
|
+
}
|
|
843
|
+
] : w.rules;
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
}, V = (w, F) => {
|
|
847
|
+
w.isForm = F, Array.isArray(w.children) && w.children.forEach((B) => V(B, F));
|
|
764
848
|
};
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
}),
|
|
768
|
-
},
|
|
769
|
-
init: async () => {
|
|
770
|
-
a.show = !1, await ge(), a.initColumnForm();
|
|
849
|
+
s.column.forEach((w) => {
|
|
850
|
+
V(w, !0), d(w);
|
|
851
|
+
}), n.length > 0 && p.push(n), e.formColumn = p, e.form = JSONUtil.cp(e.formDefault);
|
|
771
852
|
}
|
|
772
853
|
});
|
|
773
|
-
return
|
|
854
|
+
return e.initColumnForm(), o({
|
|
774
855
|
ref: i,
|
|
775
|
-
conf:
|
|
776
|
-
}), (
|
|
856
|
+
conf: e
|
|
857
|
+
}), (s, p) => (f(), h(a(N), {
|
|
777
858
|
ref_key: "ruleFormRef",
|
|
778
859
|
ref: i,
|
|
779
|
-
model:
|
|
780
|
-
rules:
|
|
860
|
+
model: e.form,
|
|
861
|
+
rules: e.rules
|
|
781
862
|
}, {
|
|
782
|
-
default:
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
863
|
+
default: m(() => [
|
|
864
|
+
e.show ? (f(!0), y($, { key: 0 }, L(e.formColumn, (c, g) => (f(), y($, { key: g }, [
|
|
865
|
+
a(u)(
|
|
866
|
+
c.map((n) => n.item?.show?.form),
|
|
867
|
+
e.form,
|
|
868
|
+
e.type
|
|
869
|
+
) ? (f(), y("div", {
|
|
870
|
+
key: 0,
|
|
871
|
+
class: j(["row curd-row", {
|
|
872
|
+
stripe: r.option.form?.stripe === void 0 ? !0 : r.option.form?.stripe
|
|
873
|
+
}])
|
|
874
|
+
}, [
|
|
875
|
+
k(s.$slots, "form-start", {
|
|
876
|
+
row: e.form
|
|
877
|
+
}),
|
|
878
|
+
(f(!0), y($, null, L(c, (n) => (f(), y($, {
|
|
879
|
+
key: n.item.key
|
|
791
880
|
}, [
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
row: a.form,
|
|
800
|
-
item: u.item
|
|
881
|
+
a(u)(n.item.show?.form, e.form, e.type) ? (f(), y("div", {
|
|
882
|
+
key: 0,
|
|
883
|
+
class: j([n.item.form.span > 0 ? `col-${e.getColumnSpan(n, c)}` : "col", `form-item-col-${n.item.key}`])
|
|
884
|
+
}, [
|
|
885
|
+
z(a(X), {
|
|
886
|
+
class: j({
|
|
887
|
+
"hide-label": typeof n.item.text?.form?.label == "boolean" ? !n.item.text?.form?.label : !1
|
|
801
888
|
}),
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
889
|
+
label: typeof n.item.text?.form?.label == "string" ? n.item.text?.form?.label : n.item.label,
|
|
890
|
+
prop: n.item.key,
|
|
891
|
+
"label-width": n.item.form?.labelWidth || r.option.form?.labelWidth || "100px"
|
|
892
|
+
}, {
|
|
893
|
+
default: m(() => [
|
|
894
|
+
O("div", Se, [
|
|
895
|
+
k(s.$slots, "form-" + n.item.key + "-start", {
|
|
896
|
+
row: e.form,
|
|
897
|
+
item: n.item
|
|
898
|
+
}),
|
|
899
|
+
O("div", Ee, [
|
|
900
|
+
O("div", $e, [
|
|
901
|
+
k(s.$slots, "form-" + n.item.key, {
|
|
902
|
+
row: e.form,
|
|
903
|
+
item: n.item
|
|
904
|
+
}, () => [
|
|
905
|
+
n.item.type === "input" ? (f(), h(a(Y), v({
|
|
906
|
+
key: 0,
|
|
907
|
+
modelValue: e.form[n.item.key],
|
|
908
|
+
"onUpdate:modelValue": (d) => e.form[n.item.key] = d,
|
|
909
|
+
ref_for: !0
|
|
910
|
+
}, e.getBind(n.item), S(e.getOn(n.item)), {
|
|
911
|
+
disabled: e.getDisabled(n.item)
|
|
912
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type === "switch" ? (f(), h(a(oe), v({
|
|
913
|
+
key: 1,
|
|
914
|
+
modelValue: e.form[n.item.key],
|
|
915
|
+
"onUpdate:modelValue": (d) => e.form[n.item.key] = d,
|
|
916
|
+
ref_for: !0
|
|
917
|
+
}, e.getBind(n.item), S(e.getOn(n.item)), {
|
|
918
|
+
disabled: e.getDisabled(n.item)
|
|
919
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type === "select" ? (f(), h(a(W), v({
|
|
920
|
+
key: 2,
|
|
921
|
+
modelValue: e.form[n.item.key],
|
|
922
|
+
"onUpdate:modelValue": (d) => e.form[n.item.key] = d,
|
|
923
|
+
ref_for: !0
|
|
924
|
+
}, e.getBind(n.item), S(e.getOn(n.item)), {
|
|
925
|
+
disabled: e.getDisabled(n.item),
|
|
926
|
+
style: { width: "100%" }
|
|
927
|
+
}), {
|
|
928
|
+
default: m(() => [
|
|
929
|
+
(f(!0), y($, null, L(n.item.options?.select?.data, (d) => (f(), h(a(K), {
|
|
930
|
+
key: d.value,
|
|
931
|
+
label: d.label,
|
|
932
|
+
value: d.value
|
|
933
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
934
|
+
]),
|
|
935
|
+
_: 2
|
|
936
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type === "radio" ? (f(), h(a(re), v({
|
|
937
|
+
key: 3,
|
|
938
|
+
modelValue: e.form[n.item.key],
|
|
939
|
+
"onUpdate:modelValue": (d) => e.form[n.item.key] = d,
|
|
940
|
+
ref_for: !0
|
|
941
|
+
}, e.getBind(n.item), S(e.getOn(n.item)), {
|
|
942
|
+
disabled: e.getDisabled(n.item),
|
|
943
|
+
style: { width: "100%" }
|
|
944
|
+
}), {
|
|
945
|
+
default: m(() => [
|
|
946
|
+
(f(!0), y($, null, L(n.item.options?.radio?.data, (d) => (f(), h(a(se), {
|
|
947
|
+
key: d.value,
|
|
948
|
+
label: d.label,
|
|
949
|
+
value: d.value
|
|
950
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
951
|
+
]),
|
|
952
|
+
_: 2
|
|
953
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type === "list" ? (f(), h(ne, v({
|
|
954
|
+
key: 4,
|
|
955
|
+
row: e.form,
|
|
956
|
+
field: n.item.key,
|
|
957
|
+
ref_for: !0
|
|
958
|
+
}, e.getBind(n.item), S(e.getOn(n.item)), {
|
|
959
|
+
disabled: e.getDisabled(n.item),
|
|
960
|
+
style: { width: "100%" }
|
|
961
|
+
}), null, 16, ["row", "field", "disabled"])) : n.item.type === "treeSelect" ? (f(), h(a(de), v({
|
|
962
|
+
key: 5,
|
|
963
|
+
modelValue: e.form[n.item.key],
|
|
964
|
+
"onUpdate:modelValue": (d) => e.form[n.item.key] = d,
|
|
965
|
+
ref_for: !0
|
|
966
|
+
}, e.getBind(n.item), S(e.getOn(n.item)), {
|
|
967
|
+
disabled: e.getDisabled(n.item),
|
|
968
|
+
style: { width: "100%" }
|
|
969
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type === "datetime" ? (f(), h(a(ae), v({
|
|
970
|
+
key: 6,
|
|
971
|
+
modelValue: e.form[n.item.key],
|
|
972
|
+
"onUpdate:modelValue": (d) => e.form[n.item.key] = d,
|
|
973
|
+
ref_for: !0
|
|
974
|
+
}, e.getBind(n.item), S(e.getOn(n.item)), {
|
|
975
|
+
disabled: e.getDisabled(n.item)
|
|
976
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.item.type && (a(M).customComponent[n.item.type] || a(M).customComponent[n.item.type]?.form) ? (f(), h(q(a(M).customComponent[n.item.type]?.form || a(M).customComponent[n.item.type]), v({
|
|
977
|
+
key: 7,
|
|
978
|
+
modelValue: e.form[n.item.key],
|
|
979
|
+
"onUpdate:modelValue": (d) => e.form[n.item.key] = d,
|
|
980
|
+
ref_for: !0
|
|
981
|
+
}, e.getBind(n.item), S(e.getOn(n.item)), {
|
|
982
|
+
disabled: e.getDisabled(n.item)
|
|
983
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : C("", !0)
|
|
984
|
+
]),
|
|
985
|
+
k(s.$slots, "form-" + n.item.key + "-right", {
|
|
986
|
+
row: e.form,
|
|
987
|
+
item: n.item
|
|
988
|
+
})
|
|
989
|
+
]),
|
|
990
|
+
k(s.$slots, "form-" + n.item.key + "-tip", {
|
|
991
|
+
row: e.form,
|
|
992
|
+
item: n.item
|
|
993
|
+
}, () => [
|
|
994
|
+
n.item.form?.tipText ? (f(), y("div", {
|
|
995
|
+
key: 0,
|
|
996
|
+
class: "form-tip-text",
|
|
997
|
+
innerHTML: typeof n.item.form?.tipText == "function" ? n.item.form?.tipText(e.form, e.type) : n.item.form?.tipText
|
|
998
|
+
}, null, 8, Oe)) : C("", !0)
|
|
999
|
+
])
|
|
835
1000
|
]),
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
ref_for: !0
|
|
842
|
-
}, u.item.options?.list, $(u.item.options?.list?.on || {}), {
|
|
843
|
-
disabled: a.getDisabled(u.item),
|
|
844
|
-
style: { width: "100%" }
|
|
845
|
-
}), null, 16, ["row", "field", "disabled"])) : u.item.type === "treeSelect" ? (f(), b(o(ie), v({
|
|
846
|
-
key: 4,
|
|
847
|
-
modelValue: a.form[u.item.key],
|
|
848
|
-
"onUpdate:modelValue": (s) => a.form[u.item.key] = s,
|
|
849
|
-
ref_for: !0
|
|
850
|
-
}, u.item.options?.treeSelect, $(u.item.options?.treeSelect?.on || {}), {
|
|
851
|
-
disabled: a.getDisabled(u.item),
|
|
852
|
-
style: { width: "100%" }
|
|
853
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "datetime" ? (f(), b(o(te), v({
|
|
854
|
-
key: 5,
|
|
855
|
-
modelValue: a.form[u.item.key],
|
|
856
|
-
"onUpdate:modelValue": (s) => a.form[u.item.key] = s,
|
|
857
|
-
ref_for: !0
|
|
858
|
-
}, u.item.options?.datetime, $(u.item.options?.datetime?.on || {}), {
|
|
859
|
-
disabled: a.getDisabled(u.item)
|
|
860
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type && o(j).customComponent[u.item.type] ? (f(), b(q(o(j).customComponent[u.item.type]), v({
|
|
861
|
-
key: 6,
|
|
862
|
-
modelValue: a.form[u.item.key],
|
|
863
|
-
"onUpdate:modelValue": (s) => a.form[u.item.key] = s,
|
|
864
|
-
ref_for: !0
|
|
865
|
-
}, u.item.options?.[u.item.type], $(u.item.options?.[u.item.type]?.on || {}), {
|
|
866
|
-
disabled: a.getDisabled(u.item)
|
|
867
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : C("", !0)
|
|
1001
|
+
k(s.$slots, "form-" + n.item.key + "-end", {
|
|
1002
|
+
row: e.form,
|
|
1003
|
+
item: n.item
|
|
1004
|
+
})
|
|
1005
|
+
])
|
|
868
1006
|
]),
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
k(r.$slots, "form-end", {
|
|
879
|
-
row: a.form
|
|
880
|
-
})
|
|
881
|
-
]))), 256)) : C("", !0)
|
|
1007
|
+
_: 2
|
|
1008
|
+
}, 1032, ["class", "label", "prop", "label-width"])
|
|
1009
|
+
], 2)) : C("", !0)
|
|
1010
|
+
], 64))), 128)),
|
|
1011
|
+
k(s.$slots, "form-end", {
|
|
1012
|
+
row: e.form
|
|
1013
|
+
})
|
|
1014
|
+
], 2)) : C("", !0)
|
|
1015
|
+
], 64))), 128)) : C("", !0)
|
|
882
1016
|
]),
|
|
883
1017
|
_: 3
|
|
884
1018
|
}, 8, ["model", "rules"]));
|
|
885
1019
|
}
|
|
886
1020
|
});
|
|
887
|
-
|
|
888
|
-
search: "搜索",
|
|
889
|
-
add: "新增",
|
|
890
|
-
edit: "编辑",
|
|
891
|
-
view: "查看",
|
|
892
|
-
delete: "删除",
|
|
893
|
-
export: "导出",
|
|
894
|
-
exportSelect: "导出选中",
|
|
895
|
-
exportPage: "导出本页",
|
|
896
|
-
exportAll: "导出全部",
|
|
897
|
-
import: "导入",
|
|
898
|
-
refresh: "刷新",
|
|
899
|
-
reset: "重置",
|
|
900
|
-
expandCollapse: "展开/收缩",
|
|
901
|
-
operation: "操作",
|
|
902
|
-
close: "关闭",
|
|
903
|
-
cancel: "取消",
|
|
904
|
-
submit: "提交",
|
|
905
|
-
confirm: "确认",
|
|
906
|
-
confirmDelete: "确认删除",
|
|
907
|
-
confirmDeleteMessage: "确认要删除【{count}】条数据吗?",
|
|
908
|
-
placeholderInput: "请输入",
|
|
909
|
-
placeholderSelect: "请选择",
|
|
910
|
-
checkFormData: "请检查表单数据",
|
|
911
|
-
selectDataToDelete: "请选择要删除的数据",
|
|
912
|
-
selectDataToExport: "请选择要导出的数据",
|
|
913
|
-
noData: "暂无数据",
|
|
914
|
-
operationSuccess: "操作成功",
|
|
915
|
-
switchOn: "开启",
|
|
916
|
-
switchOff: "关闭",
|
|
917
|
-
confirmModify: "确认修改",
|
|
918
|
-
confirmSwitchMessage: "确认要修改吗?"
|
|
919
|
-
};
|
|
920
|
-
class g {
|
|
921
|
-
/** 解析国际化值:函数则执行并返回字符串,字符串则替换 `{key}` 占位符 */
|
|
922
|
-
static t(l, ...d) {
|
|
923
|
-
if (typeof l == "function")
|
|
924
|
-
return l(...d);
|
|
925
|
-
l = String(l);
|
|
926
|
-
let e = 0;
|
|
927
|
-
return l.replace(/{([^}]+)}/g, (i, t) => e < d.length ? String(d[e++]) : `{${t}}`);
|
|
928
|
-
}
|
|
929
|
-
static setI18n = (l) => {
|
|
930
|
-
g.curd = ObjectUtil.deepMerge(g.curd, l);
|
|
931
|
-
};
|
|
932
|
-
/** 解析curd国际化值 */
|
|
933
|
-
static tCurd(l, ...d) {
|
|
934
|
-
return this.t(this.curd[l], ...d);
|
|
935
|
-
}
|
|
936
|
-
/** curd表单 */
|
|
937
|
-
static curd = Ue;
|
|
938
|
-
}
|
|
939
|
-
class $e {
|
|
1021
|
+
class Fe {
|
|
940
1022
|
/**
|
|
941
1023
|
* 导出数据为 Excel 文件(.xlsx),自动触发浏览器下载
|
|
942
1024
|
*
|
|
@@ -944,20 +1026,20 @@ class $e {
|
|
|
944
1026
|
* @param columns - 列配置数组,需包含 `key`(数据字段)和 `label`(Excel 表头)
|
|
945
1027
|
* @param fileName - 文件名(不含扩展名),支持字符串或返回字符串的函数;默认生成「导出数据_日期_时间戳」
|
|
946
1028
|
*/
|
|
947
|
-
static exportToExcel = async (
|
|
948
|
-
if (!
|
|
949
|
-
const i = await
|
|
950
|
-
const
|
|
951
|
-
return
|
|
952
|
-
|
|
953
|
-
}),
|
|
954
|
-
}),
|
|
955
|
-
i.utils.book_append_sheet(
|
|
1029
|
+
static exportToExcel = async (o, u, t) => {
|
|
1030
|
+
if (!o || o.length === 0) return;
|
|
1031
|
+
const i = await U.loadModule("xlsx"), l = o.map((p) => {
|
|
1032
|
+
const c = {};
|
|
1033
|
+
return u.forEach((g) => {
|
|
1034
|
+
c[g.label] = p[g.key];
|
|
1035
|
+
}), c;
|
|
1036
|
+
}), e = i.utils.json_to_sheet(l), s = i.utils.book_new();
|
|
1037
|
+
i.utils.book_append_sheet(s, e, "Sheet1"), t ? typeof t == "function" && (t = t()) : t = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, i.writeFile(s, `${t}.xlsx`);
|
|
956
1038
|
};
|
|
957
1039
|
}
|
|
958
|
-
const
|
|
959
|
-
const
|
|
960
|
-
option:
|
|
1040
|
+
const I = U.EDialog, Te = (r) => {
|
|
1041
|
+
const o = H(), u = H(), t = le({
|
|
1042
|
+
option: r.option,
|
|
961
1043
|
/** 查询区域相关配置对象 */
|
|
962
1044
|
search: {
|
|
963
1045
|
/** 查询表单列集合 */
|
|
@@ -970,26 +1052,26 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
970
1052
|
/** 搜索表单默认值 */
|
|
971
1053
|
formDefault: {},
|
|
972
1054
|
/** 获取占位符 */
|
|
973
|
-
getPlaceholder: (i,
|
|
1055
|
+
getPlaceholder: (i, l = b.tCurd("placeholderInput")) => i.text?.search?.placeholder === void 0 ? `${l}${i.label}` : i.text?.search?.placeholder,
|
|
974
1056
|
/** 组装实际要搜索的数据对象 */
|
|
975
1057
|
getFormData: () => {
|
|
976
1058
|
let i = {};
|
|
977
|
-
|
|
978
|
-
(typeof
|
|
1059
|
+
r.option.column.forEach((e) => {
|
|
1060
|
+
(typeof e.show?.search == "function" ? e.show?.search(t.search.form) : e.show?.search) && (i[e.key] = t.search.form[e.key]);
|
|
979
1061
|
});
|
|
980
|
-
const
|
|
981
|
-
return
|
|
1062
|
+
const l = r.option.search?.before?.(i);
|
|
1063
|
+
return l && (i = l), i;
|
|
982
1064
|
},
|
|
983
1065
|
/** 重置搜索表单 */
|
|
984
1066
|
reset: () => {
|
|
985
|
-
const i =
|
|
986
|
-
Object.keys(i).forEach((
|
|
987
|
-
|
|
988
|
-
}),
|
|
1067
|
+
const i = t.search.formDefault;
|
|
1068
|
+
Object.keys(i).forEach((l) => {
|
|
1069
|
+
r.option.search?.resetMode === "none" ? i[l] = void 0 : i[l] = t.search.formDefault[l];
|
|
1070
|
+
}), t.search.form = JSONUtil.cp(i), t.page.num = 1, r.option.init !== !1 && t.table.getList();
|
|
989
1071
|
},
|
|
990
1072
|
/** 提交搜索表单 */
|
|
991
1073
|
submit: () => {
|
|
992
|
-
|
|
1074
|
+
t.page.num = 1, t.table.getList();
|
|
993
1075
|
}
|
|
994
1076
|
},
|
|
995
1077
|
/** 分页区域相关配置对象 */
|
|
@@ -999,22 +1081,22 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
999
1081
|
/** 总条数 */
|
|
1000
1082
|
total: 0,
|
|
1001
1083
|
/** 分页控件的布局方式 */
|
|
1002
|
-
layout:
|
|
1084
|
+
layout: r.option.page?.layout || D.config.pagination.layout,
|
|
1003
1085
|
/** 是否显示到工具栏 默认不显示 配置后show属性无效 */
|
|
1004
|
-
showTools:
|
|
1086
|
+
showTools: r.option.page?.showTools || D.config.pagination.showTools,
|
|
1005
1087
|
/** 当前每页条数 */
|
|
1006
|
-
size:
|
|
1088
|
+
size: r.option.page?.size || D.config.pagination.size,
|
|
1007
1089
|
/** 支持切换的每页条数选项 */
|
|
1008
|
-
sizeList:
|
|
1090
|
+
sizeList: r.option.page?.sizeList || D.config.pagination.pageSizes,
|
|
1009
1091
|
/** 分页器计数 */
|
|
1010
|
-
pagerCount:
|
|
1092
|
+
pagerCount: r.option.page?.pagerCount || D.config.pagination.pagerCount
|
|
1011
1093
|
},
|
|
1012
1094
|
/** 表格区域相关配置对象 */
|
|
1013
1095
|
table: {
|
|
1014
1096
|
/** 操作列相关配置 */
|
|
1015
1097
|
op: {
|
|
1016
1098
|
/** 动态计算操作列宽度 */
|
|
1017
|
-
width: (...i) => i.filter((
|
|
1099
|
+
width: (...i) => i.filter((e) => e).length * 30 + 60
|
|
1018
1100
|
},
|
|
1019
1101
|
/** 表格加载中状态 */
|
|
1020
1102
|
loading: !1,
|
|
@@ -1027,22 +1109,22 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1027
1109
|
/** 已经展开的行key集合 */
|
|
1028
1110
|
rowKeys: [],
|
|
1029
1111
|
/** 行展开触发变更函数 */
|
|
1030
|
-
change: (i,
|
|
1112
|
+
change: (i, l) => {
|
|
1031
1113
|
},
|
|
1032
1114
|
/** 全部展开/收起 */
|
|
1033
1115
|
all: () => {
|
|
1034
|
-
if (
|
|
1035
|
-
|
|
1116
|
+
if (t.table.expand.isExpand)
|
|
1117
|
+
t.table.expand.rowKeys = [];
|
|
1036
1118
|
else {
|
|
1037
|
-
const i = (
|
|
1038
|
-
let
|
|
1039
|
-
return
|
|
1040
|
-
|
|
1041
|
-
}),
|
|
1119
|
+
const i = (l) => {
|
|
1120
|
+
let e = [];
|
|
1121
|
+
return l.forEach((s) => {
|
|
1122
|
+
e.push(s[r.option.table.rowKey]), s.children && s.children.length > 0 && (e = e.concat(i(s.children)));
|
|
1123
|
+
}), e;
|
|
1042
1124
|
};
|
|
1043
|
-
|
|
1125
|
+
t.table.expand.rowKeys = i(t.table.data);
|
|
1044
1126
|
}
|
|
1045
|
-
|
|
1127
|
+
t.table.expand.isExpand = !t.table.expand.isExpand;
|
|
1046
1128
|
}
|
|
1047
1129
|
},
|
|
1048
1130
|
/** 表格列相关配置 */
|
|
@@ -1059,34 +1141,34 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1059
1141
|
},
|
|
1060
1142
|
/** 获取数据列表接口实现 */
|
|
1061
1143
|
getList: async () => {
|
|
1062
|
-
|
|
1063
|
-
const i =
|
|
1144
|
+
t.table.loading = !0;
|
|
1145
|
+
const i = r.option.api.list;
|
|
1064
1146
|
try {
|
|
1065
|
-
await
|
|
1066
|
-
let
|
|
1067
|
-
if (
|
|
1068
|
-
const { props:
|
|
1069
|
-
|
|
1070
|
-
[
|
|
1071
|
-
[
|
|
1147
|
+
await t.initApiData("init");
|
|
1148
|
+
let l = {};
|
|
1149
|
+
if (t.table.sort.prop) {
|
|
1150
|
+
const { props: d, order: V } = D.config.table.sort;
|
|
1151
|
+
l = {
|
|
1152
|
+
[d.field]: t.table.sort.prop,
|
|
1153
|
+
[V.field]: t.table.sort.order
|
|
1072
1154
|
};
|
|
1073
1155
|
}
|
|
1074
|
-
const
|
|
1075
|
-
[
|
|
1076
|
-
[
|
|
1077
|
-
...
|
|
1078
|
-
...
|
|
1079
|
-
}),
|
|
1080
|
-
let
|
|
1081
|
-
const
|
|
1082
|
-
const
|
|
1083
|
-
|
|
1084
|
-
}),
|
|
1085
|
-
|
|
1086
|
-
} catch (
|
|
1087
|
-
console.error(
|
|
1156
|
+
const e = await i({
|
|
1157
|
+
[D.config.page.size]: t.page.size,
|
|
1158
|
+
[D.config.page.num]: t.page.num,
|
|
1159
|
+
...t.search.getFormData(),
|
|
1160
|
+
...l
|
|
1161
|
+
}), s = D.config.result, p = e.data || { [s.list]: e };
|
|
1162
|
+
let c = (Array.isArray(p[s.list]), p[s.list]);
|
|
1163
|
+
const g = t.update.formColumn.flat(), n = JSONUtil.cp(c).map((d) => (Object.keys(d).forEach((w) => {
|
|
1164
|
+
const F = g.find((B) => B.item.key === w);
|
|
1165
|
+
F && ["select", "radio"].includes(F.item.type) && (F.item.table.format || (F.item.table.format = (B) => F.item.options[F.item.type].data?.find((R) => R.value == B[w])?.label || B[w]));
|
|
1166
|
+
}), d));
|
|
1167
|
+
t.table.data = r.option.data ? await r.option.data(n, c) : n, t.page.total = p[s.total] || 0;
|
|
1168
|
+
} catch (l) {
|
|
1169
|
+
console.error(l);
|
|
1088
1170
|
} finally {
|
|
1089
|
-
|
|
1171
|
+
t.table.loading = !1;
|
|
1090
1172
|
}
|
|
1091
1173
|
},
|
|
1092
1174
|
/** 表格多选相关配置 */
|
|
@@ -1095,7 +1177,7 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1095
1177
|
list: [],
|
|
1096
1178
|
/** 选中状态回调 */
|
|
1097
1179
|
change: (i) => {
|
|
1098
|
-
|
|
1180
|
+
t.table.selection.list = i;
|
|
1099
1181
|
}
|
|
1100
1182
|
},
|
|
1101
1183
|
/** 表格排序相关配置 */
|
|
@@ -1106,13 +1188,13 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1106
1188
|
order: "",
|
|
1107
1189
|
/** 排序变更回调 */
|
|
1108
1190
|
change: (i) => {
|
|
1109
|
-
|
|
1110
|
-
const
|
|
1111
|
-
if (
|
|
1112
|
-
|
|
1191
|
+
D.config.table.sort.resetPage && (t.page.num = 1);
|
|
1192
|
+
const l = D.config.table.sort;
|
|
1193
|
+
if (l.change) {
|
|
1194
|
+
l.change(i, t);
|
|
1113
1195
|
return;
|
|
1114
1196
|
}
|
|
1115
|
-
|
|
1197
|
+
t.table.sort.prop = i.prop, i.order === null ? t.table.sort.order = "" : t.table.sort.order = i.order === "ascending" ? l.order.asc : l.order.desc, t.table.getList();
|
|
1116
1198
|
}
|
|
1117
1199
|
}
|
|
1118
1200
|
},
|
|
@@ -1122,46 +1204,46 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1122
1204
|
run: {
|
|
1123
1205
|
/** 执行指定方式的导出(如select、page、all) */
|
|
1124
1206
|
start: async (i) => {
|
|
1125
|
-
let
|
|
1126
|
-
const
|
|
1127
|
-
data:
|
|
1128
|
-
columns:
|
|
1129
|
-
}),
|
|
1130
|
-
|
|
1207
|
+
let l = await t.export.run[i](), e = r.option.column;
|
|
1208
|
+
const s = JSONUtil.cp({
|
|
1209
|
+
data: l,
|
|
1210
|
+
columns: e
|
|
1211
|
+
}), p = r.option.tools?.export || {};
|
|
1212
|
+
p.before && p.before(s), Fe.exportToExcel(s.data, s.columns, p.fileName);
|
|
1131
1213
|
},
|
|
1132
1214
|
/** 获取当前选中项进行导出 */
|
|
1133
1215
|
select: () => {
|
|
1134
|
-
if (
|
|
1135
|
-
throw
|
|
1136
|
-
return
|
|
1216
|
+
if (t.table.selection.list.length === 0)
|
|
1217
|
+
throw U.fail(b.tCurd("selectDataToExport")), new Error(b.tCurd("selectDataToExport"));
|
|
1218
|
+
return t.table.selection.list;
|
|
1137
1219
|
},
|
|
1138
1220
|
/** 导出当前页的数据 */
|
|
1139
1221
|
page: () => {
|
|
1140
|
-
if (
|
|
1141
|
-
throw
|
|
1142
|
-
return
|
|
1222
|
+
if (t.table.data.length === 0)
|
|
1223
|
+
throw U.fail(b.tCurd("noData")), new Error(b.tCurd("noData"));
|
|
1224
|
+
return t.table.data;
|
|
1143
1225
|
},
|
|
1144
1226
|
/** 导出所有数据 */
|
|
1145
1227
|
all: async () => {
|
|
1146
|
-
|
|
1228
|
+
t.export.loading = !0;
|
|
1147
1229
|
try {
|
|
1148
|
-
if (
|
|
1149
|
-
await
|
|
1150
|
-
[
|
|
1151
|
-
[
|
|
1152
|
-
...
|
|
1230
|
+
if (r.option.tools?.export?.all) {
|
|
1231
|
+
await r.option.tools?.export?.all({
|
|
1232
|
+
[D.config.page.size]: t.page.size,
|
|
1233
|
+
[D.config.page.num]: t.page.num,
|
|
1234
|
+
...t.search.getFormData()
|
|
1153
1235
|
});
|
|
1154
1236
|
return;
|
|
1155
1237
|
}
|
|
1156
|
-
const i =
|
|
1157
|
-
[
|
|
1158
|
-
[
|
|
1238
|
+
const i = r.option.api.list, l = await i({
|
|
1239
|
+
[D.config.page.size]: 999999,
|
|
1240
|
+
[D.config.page.num]: 1
|
|
1159
1241
|
});
|
|
1160
|
-
return (
|
|
1242
|
+
return (l.data || { [D.config.result.list]: l })[D.config.result.list];
|
|
1161
1243
|
} catch (i) {
|
|
1162
1244
|
console.error(i);
|
|
1163
1245
|
} finally {
|
|
1164
|
-
|
|
1246
|
+
t.export.loading = !1;
|
|
1165
1247
|
}
|
|
1166
1248
|
}
|
|
1167
1249
|
},
|
|
@@ -1169,7 +1251,7 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1169
1251
|
loading: !1,
|
|
1170
1252
|
/** 执行导出操作的触发函数 */
|
|
1171
1253
|
click: (i) => {
|
|
1172
|
-
|
|
1254
|
+
t.export.loading || t.export.run.start(i);
|
|
1173
1255
|
}
|
|
1174
1256
|
},
|
|
1175
1257
|
/** 表单增删改弹窗相关对象 */
|
|
@@ -1185,7 +1267,7 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1185
1267
|
/** 弹窗loading */
|
|
1186
1268
|
loading: !1,
|
|
1187
1269
|
/** 当前操作类型,插入或修改 */
|
|
1188
|
-
type:
|
|
1270
|
+
type: I.Add,
|
|
1189
1271
|
/** 当前操作表单数据 */
|
|
1190
1272
|
form: {},
|
|
1191
1273
|
/** 表单默认值 */
|
|
@@ -1193,122 +1275,117 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1193
1275
|
/** 表单所有列,二维数组结构按行分组 */
|
|
1194
1276
|
formColumn: [],
|
|
1195
1277
|
/** 判断是否禁用当前字段 */
|
|
1196
|
-
getDisabled: (i) =>
|
|
1278
|
+
getDisabled: (i) => t.update.type === I.View ? i.disabled?.view === void 0 ? !0 : i.disabled?.view : i.disabled?.[t.update.type === I.Add ? "create" : "update"],
|
|
1279
|
+
/** 获取表单组件绑定属性 */
|
|
1280
|
+
getBind: (i) => i.options?.[t.update.type === I.Add ? "formAdd" : "formUpdate"]?.[i.type] || i.options?.[i.type] || {},
|
|
1281
|
+
/** 获取表单组件事件属性 */
|
|
1282
|
+
getOn: (i) => i.options?.[t.update.type === I.Add ? "formAdd" : "formUpdate"]?.[i.type]?.on || i.options?.[i.type]?.on || {},
|
|
1283
|
+
/** 获取表单组件绑定属性和事件 */
|
|
1284
|
+
getBindOnByKey: (i) => {
|
|
1285
|
+
try {
|
|
1286
|
+
const e = t.update.formColumn.flat().find((s) => s.item.key === i)?.item;
|
|
1287
|
+
return e ? {
|
|
1288
|
+
bind: t.update.getBind(e),
|
|
1289
|
+
on: t.update.getOn(e)
|
|
1290
|
+
} : { bind: {}, on: {} };
|
|
1291
|
+
} catch {
|
|
1292
|
+
return { bind: {}, on: {} };
|
|
1293
|
+
}
|
|
1294
|
+
},
|
|
1197
1295
|
/** 编辑相关数据与方法 */
|
|
1198
1296
|
edit: {
|
|
1199
1297
|
/** 当前编辑的数据原始项对象 */
|
|
1200
1298
|
data: {},
|
|
1201
1299
|
/** 返回编辑时与原值的变更数据,用于局部更新API */
|
|
1202
1300
|
getApiData: (i) => {
|
|
1203
|
-
if (
|
|
1301
|
+
if (r.option.form?.editAll)
|
|
1204
1302
|
return i;
|
|
1205
|
-
let
|
|
1206
|
-
[
|
|
1303
|
+
let l = {
|
|
1304
|
+
[r.option.table?.rowKey]: t.update.edit.data[r.option.table?.rowKey]
|
|
1207
1305
|
};
|
|
1208
|
-
return Object.keys(
|
|
1209
|
-
i[
|
|
1210
|
-
}),
|
|
1306
|
+
return Object.keys(t.update.edit.data).forEach((e) => {
|
|
1307
|
+
i[e] !== t.update.edit.data[e] && (l[e] = i[e]);
|
|
1308
|
+
}), l;
|
|
1211
1309
|
}
|
|
1212
1310
|
},
|
|
1213
1311
|
view: {},
|
|
1214
1312
|
/** 打开增改弹窗 */
|
|
1215
|
-
open: (i,
|
|
1216
|
-
|
|
1217
|
-
|
|
1313
|
+
open: (i, l) => {
|
|
1314
|
+
t.update.showContent || FunUtil.throttle(async () => {
|
|
1315
|
+
U.loading(!0);
|
|
1218
1316
|
try {
|
|
1219
|
-
await
|
|
1220
|
-
const
|
|
1221
|
-
if (!
|
|
1222
|
-
|
|
1317
|
+
t.update.type = i, await t.initApiData("update");
|
|
1318
|
+
const e = i === I.Add;
|
|
1319
|
+
if (!e && r.option.table?.inlineEdit) {
|
|
1320
|
+
t.inlineEdit.open(l);
|
|
1223
1321
|
return;
|
|
1224
1322
|
}
|
|
1225
|
-
|
|
1226
|
-
} catch (
|
|
1227
|
-
console.error(
|
|
1323
|
+
t.update.edit.data = l, t.update.title = b.tCurd(e ? "add" : i === I.View ? "view" : "edit"), t.update.form = JSONUtil.cp(e ? t.update.formDefault : l), await r.option.form?.openBefore?.(l, t.update), t.inlineEdit.data || (t.update.show = !0), t.update.showContent = !0, r.option.form?.openAfter?.(l, t.update);
|
|
1324
|
+
} catch (e) {
|
|
1325
|
+
console.error(e);
|
|
1228
1326
|
} finally {
|
|
1229
|
-
|
|
1327
|
+
U.loading(!1);
|
|
1230
1328
|
}
|
|
1231
1329
|
});
|
|
1232
1330
|
},
|
|
1233
1331
|
/** 提交增改表单操作 */
|
|
1234
1332
|
submit: () => {
|
|
1235
1333
|
FunUtil.throttle(async () => {
|
|
1236
|
-
await
|
|
1237
|
-
|
|
1238
|
-
})),
|
|
1239
|
-
const i =
|
|
1334
|
+
await u.value?.validate(async (s, p) => new Promise((c, g) => {
|
|
1335
|
+
s || (U.fail(b.tCurd("checkFormData")), g(!1)), c();
|
|
1336
|
+
})), t.update.loading = !0;
|
|
1337
|
+
const i = t.update.type === I.Add ? r.option.api.create : r.option.api.update;
|
|
1240
1338
|
try {
|
|
1241
|
-
await
|
|
1339
|
+
await r.option.form?.submitBefore?.(t.update.form, t.update);
|
|
1242
1340
|
} catch {
|
|
1243
|
-
|
|
1341
|
+
t.update.loading = !1;
|
|
1244
1342
|
return;
|
|
1245
1343
|
}
|
|
1246
|
-
let
|
|
1247
|
-
delete
|
|
1248
|
-
const
|
|
1249
|
-
Object.keys(
|
|
1250
|
-
if (
|
|
1251
|
-
const
|
|
1252
|
-
isNaN(
|
|
1344
|
+
let l = JSONUtil.cp(t.update.form);
|
|
1345
|
+
delete l.children;
|
|
1346
|
+
const e = new Set(r.option.column.filter((s) => s.type === "datetime").map((s) => s.key));
|
|
1347
|
+
Object.keys(l).forEach((s) => {
|
|
1348
|
+
if (e.has(s) && l[s] != null) {
|
|
1349
|
+
const p = new Date(l[s]).getTime();
|
|
1350
|
+
isNaN(p) || (l[s] = p);
|
|
1253
1351
|
}
|
|
1254
1352
|
});
|
|
1255
1353
|
try {
|
|
1256
1354
|
if (!i) return;
|
|
1257
1355
|
await i({
|
|
1258
|
-
...
|
|
1259
|
-
}),
|
|
1260
|
-
} catch (
|
|
1261
|
-
console.error(
|
|
1356
|
+
...l
|
|
1357
|
+
}), t.update.close(), await t.table.getList(), r.option.form?.submitAfter?.(l, t.update);
|
|
1358
|
+
} catch (s) {
|
|
1359
|
+
console.error(s);
|
|
1262
1360
|
} finally {
|
|
1263
|
-
|
|
1361
|
+
t.update.loading = !1;
|
|
1264
1362
|
}
|
|
1265
1363
|
});
|
|
1266
1364
|
},
|
|
1267
1365
|
/** 关闭弹窗和内容 */
|
|
1268
1366
|
close: () => {
|
|
1269
|
-
|
|
1270
|
-
|
|
1367
|
+
t.update.show = !1, setTimeout(() => {
|
|
1368
|
+
t.update.showContent = !1;
|
|
1271
1369
|
}, 350);
|
|
1272
1370
|
}
|
|
1273
1371
|
},
|
|
1274
1372
|
/** 行内编辑相关对象 */
|
|
1275
1373
|
inlineEdit: {
|
|
1276
1374
|
/** 行内编辑当前行对象 */
|
|
1277
|
-
|
|
1278
|
-
/** 行内编辑表单数据副本 */
|
|
1279
|
-
form: {},
|
|
1280
|
-
/** 行内编辑loading */
|
|
1281
|
-
loading: !1,
|
|
1375
|
+
data: null,
|
|
1282
1376
|
/** 打开行内编辑 */
|
|
1283
1377
|
open: (i) => {
|
|
1284
|
-
|
|
1378
|
+
t.inlineEdit.data = i, t.update.open(I.Update, i);
|
|
1285
1379
|
},
|
|
1286
1380
|
/** 关闭行内编辑 */
|
|
1287
1381
|
close: () => {
|
|
1288
|
-
|
|
1289
|
-
},
|
|
1290
|
-
/** 行内保存提交 */
|
|
1291
|
-
submit: () => {
|
|
1292
|
-
FunUtil.throttle(async () => {
|
|
1293
|
-
e.inlineEdit.loading = !0;
|
|
1294
|
-
const i = n.option.api.update;
|
|
1295
|
-
let t = JSONUtil.cp(e.inlineEdit.form);
|
|
1296
|
-
delete t.children;
|
|
1297
|
-
try {
|
|
1298
|
-
if (!i) return;
|
|
1299
|
-
await i({ ...t }), e.inlineEdit.close(), await e.table.getList(), D.success(g.tCurd("operationSuccess"));
|
|
1300
|
-
} catch (a) {
|
|
1301
|
-
console.error(a);
|
|
1302
|
-
} finally {
|
|
1303
|
-
e.inlineEdit.loading = !1;
|
|
1304
|
-
}
|
|
1305
|
-
});
|
|
1382
|
+
t.inlineEdit.data = null, t.update.close();
|
|
1306
1383
|
}
|
|
1307
1384
|
},
|
|
1308
1385
|
/** 删除操作弹窗与数据对象 */
|
|
1309
1386
|
remove: {
|
|
1310
1387
|
/** 删除弹窗标题 */
|
|
1311
|
-
title:
|
|
1388
|
+
title: b.tCurd("confirmDelete"),
|
|
1312
1389
|
/** 删除弹窗显示控制 */
|
|
1313
1390
|
show: !1,
|
|
1314
1391
|
/** 待删除数据项集合 */
|
|
@@ -1317,74 +1394,74 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1317
1394
|
loading: !1,
|
|
1318
1395
|
/** 关闭删除弹窗 */
|
|
1319
1396
|
close: () => {
|
|
1320
|
-
|
|
1397
|
+
t.remove.show = !1;
|
|
1321
1398
|
},
|
|
1322
1399
|
/** 打开删除弹窗并设置待删除项 */
|
|
1323
1400
|
open: (i) => {
|
|
1324
1401
|
if (i.length === 0) {
|
|
1325
|
-
|
|
1402
|
+
U.fail(b.tCurd("selectDataToDelete"));
|
|
1326
1403
|
return;
|
|
1327
1404
|
}
|
|
1328
|
-
|
|
1405
|
+
t.remove.items = i, t.remove.show = !0;
|
|
1329
1406
|
},
|
|
1330
1407
|
/** 执行删除实际操作 */
|
|
1331
1408
|
submit: () => {
|
|
1332
1409
|
FunUtil.throttle(async () => {
|
|
1333
|
-
|
|
1334
|
-
const i =
|
|
1410
|
+
t.remove.loading = !0;
|
|
1411
|
+
const i = r.option.api.delete;
|
|
1335
1412
|
try {
|
|
1336
1413
|
if (!i) return;
|
|
1337
1414
|
await i({
|
|
1338
|
-
[
|
|
1339
|
-
items:
|
|
1340
|
-
}),
|
|
1341
|
-
} catch (
|
|
1342
|
-
console.error(
|
|
1415
|
+
[r.option.table?.rowKey]: t.remove.items.map((l) => l[r.option.table?.rowKey]),
|
|
1416
|
+
items: t.remove.items
|
|
1417
|
+
}), U.success(b.tCurd("operationSuccess")), t.table.data.length <= 1 && t.page.num > 1 && (t.page.num -= 1), t.remove.close(), await t.table.getList();
|
|
1418
|
+
} catch (l) {
|
|
1419
|
+
console.error(l);
|
|
1343
1420
|
} finally {
|
|
1344
|
-
|
|
1421
|
+
t.remove.loading = !1;
|
|
1345
1422
|
}
|
|
1346
1423
|
});
|
|
1347
1424
|
}
|
|
1348
1425
|
},
|
|
1349
1426
|
/** 初始化curd关联所有默认与依赖配置及表单列 */
|
|
1350
1427
|
init: () => {
|
|
1351
|
-
|
|
1428
|
+
t.initCurdConfig(), t.initColumnOptions(), t.initColumnForm();
|
|
1352
1429
|
},
|
|
1353
1430
|
/** 下拉请求等数据缓存 */
|
|
1354
1431
|
apiDataMap: {},
|
|
1355
1432
|
/** 获取并绑定curd中所有下拉数据等远程依赖 */
|
|
1356
1433
|
initApiData: async (i) => {
|
|
1357
|
-
const
|
|
1358
|
-
if (
|
|
1359
|
-
|
|
1434
|
+
const l = [], e = (s) => {
|
|
1435
|
+
if (s.children && s.children.length) {
|
|
1436
|
+
s.children.forEach((p) => e(p));
|
|
1360
1437
|
return;
|
|
1361
1438
|
}
|
|
1362
|
-
if (
|
|
1363
|
-
if (
|
|
1364
|
-
const
|
|
1439
|
+
if (["select", "radio"].includes(s.type) && s.options?.[s.type]?.dataApi && s.options?.[s.type]?.dataApiConfig?.[i]) {
|
|
1440
|
+
if (t.apiDataMap[s.key] && s.options?.[s.type]?.dataApiConfig?.once) return;
|
|
1441
|
+
const p = (async () => {
|
|
1365
1442
|
try {
|
|
1366
|
-
let
|
|
1367
|
-
if (
|
|
1368
|
-
const
|
|
1369
|
-
|
|
1443
|
+
let c = await s.options?.[s.type]?.dataApi?.(t.update.form, i);
|
|
1444
|
+
if (c) {
|
|
1445
|
+
const g = s.options?.[s.type]?.dataPath;
|
|
1446
|
+
g && (c = ObjectUtil.getPathValue(c, g)), s.options[s.type].data = c, t.apiDataMap[s.key] = c;
|
|
1370
1447
|
}
|
|
1371
1448
|
} catch {
|
|
1372
1449
|
}
|
|
1373
1450
|
})();
|
|
1374
|
-
|
|
1451
|
+
l.push(p);
|
|
1375
1452
|
}
|
|
1376
1453
|
};
|
|
1377
|
-
return
|
|
1378
|
-
|
|
1379
|
-
}), await Promise.all(
|
|
1454
|
+
return r.option.column.forEach((s) => {
|
|
1455
|
+
e(s);
|
|
1456
|
+
}), await Promise.all(l), !0;
|
|
1380
1457
|
},
|
|
1381
1458
|
/** 初始化curd配置(option默认值合并等) */
|
|
1382
1459
|
initCurdConfig: () => {
|
|
1383
|
-
const i = JSONUtil.cp(
|
|
1384
|
-
i.table.emptyText =
|
|
1385
|
-
const
|
|
1386
|
-
Object.keys(
|
|
1387
|
-
|
|
1460
|
+
const i = JSONUtil.cp(D.config);
|
|
1461
|
+
i.table.emptyText = b.tCurd("noData"), r.option.size = r.option.size || {}, i.table.size = r.option.size.table || i.size.table, i.form.size = r.option.size.form || i.size.form, i.size.search = r.option.size.search || i.size.search;
|
|
1462
|
+
const l = ObjectUtil.deepMerge(i, r.option || {});
|
|
1463
|
+
Object.keys(l).forEach((e) => {
|
|
1464
|
+
r.option[e] = l[e];
|
|
1388
1465
|
});
|
|
1389
1466
|
},
|
|
1390
1467
|
/**
|
|
@@ -1393,153 +1470,155 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1393
1470
|
* @returns
|
|
1394
1471
|
*/
|
|
1395
1472
|
initColumnOptions: () => {
|
|
1396
|
-
let i = JSONUtil.cp(
|
|
1473
|
+
let i = JSONUtil.cp(D.config.columnConfig);
|
|
1397
1474
|
i.options = ObjectUtil.deepMerge(i.options, {
|
|
1398
1475
|
switch: {
|
|
1399
|
-
activeLabel:
|
|
1400
|
-
inactiveLabel:
|
|
1476
|
+
activeLabel: b.tCurd("switchOn"),
|
|
1477
|
+
inactiveLabel: b.tCurd("switchOff")
|
|
1401
1478
|
}
|
|
1402
1479
|
});
|
|
1403
|
-
const
|
|
1404
|
-
for (const
|
|
1405
|
-
if (
|
|
1406
|
-
if (
|
|
1407
|
-
|
|
1408
|
-
|
|
1480
|
+
const l = (e) => {
|
|
1481
|
+
for (const s in i) {
|
|
1482
|
+
if (s === "table") {
|
|
1483
|
+
if (e.table = ObjectUtil.deepMerge(i.table, e.table || {}), e.children) {
|
|
1484
|
+
e.children.forEach((c) => {
|
|
1485
|
+
l(c);
|
|
1409
1486
|
});
|
|
1410
1487
|
return;
|
|
1411
1488
|
}
|
|
1412
|
-
} else
|
|
1413
|
-
|
|
1489
|
+
} else s === "type" ? e.type = e.type || i.type : e[s] = ObjectUtil.deepMerge(i[s], e[s] || {});
|
|
1490
|
+
e.options = e.options || {}, e.options[e.type] = e.options[e.type] || {}, e.options[e.type].size = r.option.size.form, ["search", "formAdd", "formUpdate"].forEach((c) => {
|
|
1491
|
+
e.options[c] = e.options[c] || JSONUtil.cp(e.options), e.options[c][e.type] = e.options[c][e.type] || {}, e.options[c][e.type].size = c === "search" ? r.option.size.search : r.option.size.form;
|
|
1492
|
+
}), e.table = ObjectUtil.deepMerge(e.table, e.options[e.type].table || {});
|
|
1414
1493
|
}
|
|
1415
|
-
|
|
1416
|
-
const
|
|
1494
|
+
e.type === "switch" && (e.options.switch.tableBeforeChange = async (s, p) => {
|
|
1495
|
+
const c = e.options?.switch;
|
|
1417
1496
|
try {
|
|
1418
|
-
await
|
|
1419
|
-
title:
|
|
1420
|
-
content:
|
|
1421
|
-
}),
|
|
1497
|
+
await o.value?.open({
|
|
1498
|
+
title: b.tCurd("confirmModify"),
|
|
1499
|
+
content: b.tCurd("confirmSwitchMessage")
|
|
1500
|
+
}), t.table.loading = !0;
|
|
1422
1501
|
try {
|
|
1423
|
-
return
|
|
1424
|
-
[
|
|
1425
|
-
[
|
|
1426
|
-
final(
|
|
1427
|
-
|
|
1502
|
+
return r.option.api.update ? (await r.option.api.update({
|
|
1503
|
+
[r.option.table?.rowKey]: p[r.option.table?.rowKey],
|
|
1504
|
+
[s]: p[s] === c.activeValue ? c.inactiveValue : c.activeValue,
|
|
1505
|
+
final(g, n, d) {
|
|
1506
|
+
t.table.loading = !1;
|
|
1428
1507
|
}
|
|
1429
|
-
}),
|
|
1430
|
-
} catch (
|
|
1431
|
-
return console.error(
|
|
1508
|
+
}), t.table.loading = !1, U.success(b.tCurd("operationSuccess")), t.table.getList(), !0) : void 0;
|
|
1509
|
+
} catch (g) {
|
|
1510
|
+
return console.error(g), !1;
|
|
1432
1511
|
} finally {
|
|
1433
|
-
|
|
1512
|
+
t.table.loading = !1;
|
|
1434
1513
|
}
|
|
1435
1514
|
} catch {
|
|
1436
1515
|
return !1;
|
|
1437
1516
|
}
|
|
1438
|
-
}),
|
|
1517
|
+
}), e.type === "treeSelect" && (e.options.treeSelect.rowKey = r.option.table?.rowKey, e.options.treeSelect.nodeKey = r.option.table?.rowKey);
|
|
1439
1518
|
};
|
|
1440
|
-
|
|
1519
|
+
r.option.column.forEach(l), r.option.table?.column?.forEach(l);
|
|
1441
1520
|
},
|
|
1442
|
-
getColumnSpan: (i,
|
|
1521
|
+
getColumnSpan: (i, l) => {
|
|
1443
1522
|
if (i.item.form?.spanCol) {
|
|
1444
|
-
const
|
|
1445
|
-
return (i.item?.form.span ||
|
|
1523
|
+
const e = D.config.form.defaultSpan, p = l.filter((c) => !U.isFun(c.item.show?.form, t.update.form, t.update.type)).reduce((c, g) => c + (g.item.form?.span || e), 0);
|
|
1524
|
+
return (i.item?.form.span || e) + p;
|
|
1446
1525
|
}
|
|
1447
1526
|
return i.item.form.span;
|
|
1448
1527
|
},
|
|
1449
1528
|
/** 初始化配置并生成表单列及默认值及规则 */
|
|
1450
1529
|
initColumnForm: () => {
|
|
1451
|
-
const i =
|
|
1452
|
-
|
|
1530
|
+
const i = r.option;
|
|
1531
|
+
t.update.formColumn = [], t.table.column.show = {
|
|
1453
1532
|
list: [],
|
|
1454
1533
|
listSource: []
|
|
1455
1534
|
};
|
|
1456
|
-
const
|
|
1457
|
-
let
|
|
1458
|
-
const
|
|
1459
|
-
if (
|
|
1460
|
-
|
|
1461
|
-
|
|
1535
|
+
const l = [], e = r.option.form?.maxSpan || 12, s = r.option.form?.defaultSpan || e / 2;
|
|
1536
|
+
let p = [];
|
|
1537
|
+
const c = (d) => {
|
|
1538
|
+
if (d.children) {
|
|
1539
|
+
t.table.column.show.list.push(d.key), d.children.forEach((V) => {
|
|
1540
|
+
c(V);
|
|
1462
1541
|
});
|
|
1463
1542
|
return;
|
|
1464
1543
|
}
|
|
1465
|
-
if (
|
|
1466
|
-
|
|
1467
|
-
let
|
|
1468
|
-
const
|
|
1469
|
-
if (
|
|
1470
|
-
const
|
|
1471
|
-
input:
|
|
1472
|
-
select:
|
|
1473
|
-
},
|
|
1474
|
-
|
|
1544
|
+
if (t.update.formDefault[d.key] = d.value, d.table.table && (d.show.table && t.table.column.show.list.push(d.key), d.table.table && t.table.column.show.listSource.push(d.key)), !(d.isForm && typeof d.show?.form == "boolean") || d.show?.form) {
|
|
1545
|
+
d.form = d.form || { span: s }, d.form.span = d.form.span ?? s;
|
|
1546
|
+
let V = d.form.span, w = p.reduce((B, R) => B + R.span, V);
|
|
1547
|
+
const F = p.length;
|
|
1548
|
+
if (p.push({ item: d, span: V }), (F === 1 && p[0].span === 0 || w >= e || V === 0 && F > 1) && (l.push(p), p = []), d.rules) {
|
|
1549
|
+
const B = {
|
|
1550
|
+
input: b.tCurd("placeholderInput"),
|
|
1551
|
+
select: b.tCurd("placeholderSelect")
|
|
1552
|
+
}, R = (B[d.type] || B.input) + d.label;
|
|
1553
|
+
t.update.rules[d.key] = typeof d.rules == "boolean" ? [
|
|
1475
1554
|
{
|
|
1476
1555
|
required: !0,
|
|
1477
|
-
message:
|
|
1556
|
+
message: R,
|
|
1478
1557
|
trigger: "blur"
|
|
1479
1558
|
}
|
|
1480
|
-
] :
|
|
1559
|
+
] : d.rules;
|
|
1481
1560
|
}
|
|
1482
1561
|
}
|
|
1483
|
-
},
|
|
1484
|
-
|
|
1562
|
+
}, g = (d, V) => {
|
|
1563
|
+
d.isForm = V, Array.isArray(d.children) && d.children.forEach((w) => g(w, V));
|
|
1485
1564
|
};
|
|
1486
|
-
i.column.forEach((
|
|
1487
|
-
|
|
1488
|
-
}),
|
|
1489
|
-
|
|
1490
|
-
}),
|
|
1491
|
-
const
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
}), i.column.forEach((
|
|
1495
|
-
|
|
1496
|
-
}),
|
|
1565
|
+
i.column.forEach((d) => {
|
|
1566
|
+
d.isForm = !0, g(d, !0), c(d);
|
|
1567
|
+
}), r.option.table?.column?.forEach((d) => {
|
|
1568
|
+
g(d, !1), c(d);
|
|
1569
|
+
}), t.search.column.list = i.column.concat(i.table?.column || []), t.table.column.list = t.search.column.list.filter((d) => d.table?.table), t.search.column.list.sort((d, V) => d.sort?.search - V.sort?.search), t.table.column.list.sort((d, V) => d.sort?.table - V.sort?.table), p.length > 0 && l.push(p), t.update.formColumn = l;
|
|
1570
|
+
const n = r.option.search?.formDefault;
|
|
1571
|
+
n && Object.keys(n).forEach((d) => {
|
|
1572
|
+
t.search.formDefault[d] = n[d];
|
|
1573
|
+
}), i.column.forEach((d) => {
|
|
1574
|
+
d.show?.search || (t.search.formDefault[d.key] = void 0);
|
|
1575
|
+
}), t.search.form = JSONUtil.cp(t.search.formDefault);
|
|
1497
1576
|
}
|
|
1498
1577
|
});
|
|
1499
|
-
return
|
|
1500
|
-
|
|
1501
|
-
}), { conf:
|
|
1502
|
-
},
|
|
1578
|
+
return t.init(), ue(() => {
|
|
1579
|
+
r.option.init !== !1 && t.table.getList();
|
|
1580
|
+
}), { conf: t, switchConfirmRef: o, ruleFormRef: u };
|
|
1581
|
+
}, Ae = { class: "dialog-footer" }, Le = /* @__PURE__ */ J({
|
|
1503
1582
|
__name: "switchConfirm",
|
|
1504
1583
|
props: {
|
|
1505
1584
|
size: {}
|
|
1506
1585
|
},
|
|
1507
|
-
setup(
|
|
1508
|
-
const
|
|
1509
|
-
let
|
|
1510
|
-
const
|
|
1511
|
-
|
|
1512
|
-
})),
|
|
1513
|
-
|
|
1514
|
-
},
|
|
1515
|
-
|
|
1586
|
+
setup(r, { expose: o }) {
|
|
1587
|
+
const u = H(!1), t = H("确认修改"), i = H("确认要修改状态吗?");
|
|
1588
|
+
let l = null, e = null;
|
|
1589
|
+
const s = (g) => (g?.title && (t.value = g.title), g?.content && (i.value = g.content), u.value = !0, new Promise((n, d) => {
|
|
1590
|
+
l = n, e = d;
|
|
1591
|
+
})), p = () => {
|
|
1592
|
+
u.value = !1, l?.(!0), l = null, e = null;
|
|
1593
|
+
}, c = () => {
|
|
1594
|
+
u.value = !1, e?.(new Error("用户取消操作")), l = null, e = null;
|
|
1516
1595
|
};
|
|
1517
|
-
return
|
|
1518
|
-
open:
|
|
1519
|
-
}), (
|
|
1520
|
-
const
|
|
1521
|
-
return f(),
|
|
1522
|
-
modelValue:
|
|
1523
|
-
"onUpdate:modelValue":
|
|
1524
|
-
title:
|
|
1596
|
+
return o({
|
|
1597
|
+
open: s
|
|
1598
|
+
}), (g, n) => {
|
|
1599
|
+
const d = Q("el-form");
|
|
1600
|
+
return f(), h(a(_), {
|
|
1601
|
+
modelValue: u.value,
|
|
1602
|
+
"onUpdate:modelValue": n[0] || (n[0] = (V) => u.value = V),
|
|
1603
|
+
title: t.value,
|
|
1525
1604
|
"close-on-click-modal": !1,
|
|
1526
1605
|
width: "400px"
|
|
1527
1606
|
}, {
|
|
1528
|
-
footer:
|
|
1529
|
-
|
|
1530
|
-
default:
|
|
1531
|
-
O("span",
|
|
1532
|
-
|
|
1533
|
-
default:
|
|
1607
|
+
footer: m(() => [
|
|
1608
|
+
z(d, { size: g.size }, {
|
|
1609
|
+
default: m(() => [
|
|
1610
|
+
O("span", Ae, [
|
|
1611
|
+
z(a(A), { onClick: c }, {
|
|
1612
|
+
default: m(() => n[1] || (n[1] = [
|
|
1534
1613
|
E("取消")
|
|
1535
1614
|
])),
|
|
1536
1615
|
_: 1
|
|
1537
1616
|
}),
|
|
1538
|
-
|
|
1617
|
+
z(a(A), {
|
|
1539
1618
|
type: "primary",
|
|
1540
|
-
onClick:
|
|
1619
|
+
onClick: p
|
|
1541
1620
|
}, {
|
|
1542
|
-
default:
|
|
1621
|
+
default: m(() => n[2] || (n[2] = [
|
|
1543
1622
|
E("确认")
|
|
1544
1623
|
])),
|
|
1545
1624
|
_: 1
|
|
@@ -1549,152 +1628,145 @@ const K = D.EDialog, Oe = (n) => {
|
|
|
1549
1628
|
_: 1
|
|
1550
1629
|
}, 8, ["size"])
|
|
1551
1630
|
]),
|
|
1552
|
-
default:
|
|
1553
|
-
O("div", null,
|
|
1631
|
+
default: m(() => [
|
|
1632
|
+
O("div", null, T(i.value), 1)
|
|
1554
1633
|
]),
|
|
1555
1634
|
_: 1
|
|
1556
1635
|
}, 8, ["modelValue", "title"]);
|
|
1557
1636
|
};
|
|
1558
1637
|
}
|
|
1559
|
-
}),
|
|
1560
|
-
const
|
|
1561
|
-
for (const [
|
|
1562
|
-
|
|
1563
|
-
return
|
|
1564
|
-
},
|
|
1638
|
+
}), pe = (r, o) => {
|
|
1639
|
+
const u = r.__vccOpts || r;
|
|
1640
|
+
for (const [t, i] of o)
|
|
1641
|
+
u[t] = i;
|
|
1642
|
+
return u;
|
|
1643
|
+
}, Me = {}, Be = {
|
|
1565
1644
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1566
1645
|
viewBox: "0 0 1024 1024"
|
|
1567
1646
|
};
|
|
1568
|
-
function
|
|
1569
|
-
return f(),
|
|
1647
|
+
function je(r, o) {
|
|
1648
|
+
return f(), y("svg", Be, o[0] || (o[0] = [
|
|
1570
1649
|
O("path", {
|
|
1571
1650
|
fill: "currentColor",
|
|
1572
1651
|
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"
|
|
1573
1652
|
}, null, -1)
|
|
1574
1653
|
]));
|
|
1575
1654
|
}
|
|
1576
|
-
const
|
|
1655
|
+
const Ie = /* @__PURE__ */ pe(Me, [["render", je]]), Re = {}, Pe = {
|
|
1577
1656
|
"data-v-58697b5c": "",
|
|
1578
1657
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1579
1658
|
viewBox: "0 0 1024 1024"
|
|
1580
1659
|
};
|
|
1581
|
-
function
|
|
1582
|
-
return f(),
|
|
1660
|
+
function Ne(r, o) {
|
|
1661
|
+
return f(), y("svg", Pe, o[0] || (o[0] = [
|
|
1583
1662
|
O("path", {
|
|
1584
1663
|
fill: "currentColor",
|
|
1585
1664
|
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"
|
|
1586
1665
|
}, null, -1)
|
|
1587
1666
|
]));
|
|
1588
1667
|
}
|
|
1589
|
-
const Ke = /* @__PURE__ */
|
|
1668
|
+
const Ke = /* @__PURE__ */ pe(Re, [["render", Ne]]), He = { class: "row flex-center table-header-label inline" }, Je = { class: "table-header-tooltip" }, We = ["onClick", "innerHTML"], qe = /* @__PURE__ */ J({
|
|
1590
1669
|
__name: "tableColumn",
|
|
1591
1670
|
props: {
|
|
1592
1671
|
conf: {},
|
|
1593
1672
|
columnList: {},
|
|
1594
1673
|
option: {}
|
|
1595
1674
|
},
|
|
1596
|
-
setup(
|
|
1597
|
-
const
|
|
1598
|
-
return (
|
|
1599
|
-
const
|
|
1600
|
-
return f(!0),
|
|
1601
|
-
key:
|
|
1675
|
+
setup(r) {
|
|
1676
|
+
const o = U.isFun, u = ye().type;
|
|
1677
|
+
return (t, i) => {
|
|
1678
|
+
const l = Q("el-tooltip");
|
|
1679
|
+
return f(!0), y($, null, L(t.columnList, (e) => (f(), y($, {
|
|
1680
|
+
key: e.key
|
|
1602
1681
|
}, [
|
|
1603
|
-
|
|
1682
|
+
t.conf.table.column.show.list.includes(e.key) ? (f(), h(a(ee), v({
|
|
1604
1683
|
key: 0,
|
|
1605
|
-
prop:
|
|
1606
|
-
label:
|
|
1684
|
+
prop: e.key,
|
|
1685
|
+
label: e.label,
|
|
1607
1686
|
ref_for: !0
|
|
1608
|
-
},
|
|
1609
|
-
header:
|
|
1610
|
-
k(
|
|
1611
|
-
O("div",
|
|
1612
|
-
|
|
1687
|
+
}, e.table), {
|
|
1688
|
+
header: m(() => [
|
|
1689
|
+
k(t.$slots, "table-header-" + e.key, { item: e }, () => [
|
|
1690
|
+
O("div", He, [
|
|
1691
|
+
e.table?.tooltip ? (f(), h(l, {
|
|
1613
1692
|
key: 0,
|
|
1614
1693
|
effect: "dark",
|
|
1615
|
-
content:
|
|
1694
|
+
content: e.table?.tooltip,
|
|
1616
1695
|
placement: "top"
|
|
1617
1696
|
}, {
|
|
1618
|
-
default:
|
|
1619
|
-
O("span",
|
|
1620
|
-
|
|
1697
|
+
default: m(() => [
|
|
1698
|
+
O("span", Je, [
|
|
1699
|
+
z(Ke)
|
|
1621
1700
|
])
|
|
1622
1701
|
]),
|
|
1623
1702
|
_: 2
|
|
1624
1703
|
}, 1032, ["content"])) : C("", !0),
|
|
1625
|
-
E(" " +
|
|
1704
|
+
E(" " + T(e.label), 1)
|
|
1626
1705
|
])
|
|
1627
1706
|
])
|
|
1628
1707
|
]),
|
|
1629
|
-
default:
|
|
1630
|
-
|
|
1708
|
+
default: m(({ row: s }) => [
|
|
1709
|
+
e.children ? (f(), y($, { key: 0 }, [
|
|
1631
1710
|
i[0] || (i[0] = E(" ")),
|
|
1632
|
-
(f(),
|
|
1633
|
-
conf:
|
|
1634
|
-
columnList:
|
|
1635
|
-
option:
|
|
1636
|
-
},
|
|
1637
|
-
L(
|
|
1638
|
-
name:
|
|
1639
|
-
fn:
|
|
1640
|
-
k(
|
|
1711
|
+
(f(), h(q(a(u)), {
|
|
1712
|
+
conf: t.conf,
|
|
1713
|
+
columnList: e.children,
|
|
1714
|
+
option: t.option
|
|
1715
|
+
}, te({ _: 2 }, [
|
|
1716
|
+
L(t.$slots, (p, c) => ({
|
|
1717
|
+
name: c,
|
|
1718
|
+
fn: m((g) => [
|
|
1719
|
+
k(t.$slots, c, v({ ref_for: !0 }, g || {}))
|
|
1641
1720
|
])
|
|
1642
1721
|
}))
|
|
1643
1722
|
]), 1032, ["conf", "columnList", "option"]))
|
|
1644
|
-
], 64)) : (f(),
|
|
1645
|
-
o
|
|
1646
|
-
|
|
1723
|
+
], 64)) : (f(), y($, { key: 1 }, [
|
|
1724
|
+
a(o)(e.show?.form, t.conf.update.form, a(U).EDialog.Update) && t.option.table?.inlineEdit && t.conf.inlineEdit.data === s && (e.type === "input" || e.type === "select") ? (f(), y($, { key: 0 }, [
|
|
1725
|
+
e.type === "input" ? (f(), h(a(Y), v({
|
|
1647
1726
|
key: 0,
|
|
1648
|
-
modelValue:
|
|
1649
|
-
"onUpdate:modelValue": (
|
|
1727
|
+
modelValue: t.conf.update.form[e.key],
|
|
1728
|
+
"onUpdate:modelValue": (p) => t.conf.update.form[e.key] = p,
|
|
1650
1729
|
ref_for: !0
|
|
1651
|
-
},
|
|
1652
|
-
size: "small",
|
|
1653
|
-
style: { width: "100%" },
|
|
1654
|
-
onKeyup: we(e.conf.inlineEdit.submit, ["enter"])
|
|
1655
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "onKeyup"])) : a.type === "select" ? (f(), b(o(W), v({
|
|
1730
|
+
}, t.conf.update.getBind(e), S(t.conf.update.getOn(e)), { style: { width: "100%" } }), null, 16, ["modelValue", "onUpdate:modelValue"])) : e.type === "select" ? (f(), h(a(W), v({
|
|
1656
1731
|
key: 1,
|
|
1657
|
-
modelValue:
|
|
1658
|
-
"onUpdate:modelValue": (
|
|
1732
|
+
modelValue: t.conf.update.form[e.key],
|
|
1733
|
+
"onUpdate:modelValue": (p) => t.conf.update.form[e.key] = p,
|
|
1659
1734
|
ref_for: !0
|
|
1660
|
-
},
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
key: c.value,
|
|
1667
|
-
label: c.label,
|
|
1668
|
-
value: c.value
|
|
1735
|
+
}, t.conf.update.getBind(e), S(t.conf.update.getOn(e)), { style: { width: "100%" } }), {
|
|
1736
|
+
default: m(() => [
|
|
1737
|
+
(f(!0), y($, null, L(e.options?.select?.data, (p) => (f(), h(a(K), {
|
|
1738
|
+
key: p.value,
|
|
1739
|
+
label: p.label,
|
|
1740
|
+
value: p.value
|
|
1669
1741
|
}, null, 8, ["label", "value"]))), 128))
|
|
1670
1742
|
]),
|
|
1671
1743
|
_: 2
|
|
1672
1744
|
}, 1040, ["modelValue", "onUpdate:modelValue"])) : C("", !0)
|
|
1673
|
-
], 64)) : k(
|
|
1745
|
+
], 64)) : k(t.$slots, "table-" + e.key, {
|
|
1674
1746
|
key: 1,
|
|
1675
|
-
row:
|
|
1676
|
-
item:
|
|
1747
|
+
row: s,
|
|
1748
|
+
item: e
|
|
1677
1749
|
}, () => [
|
|
1678
|
-
|
|
1750
|
+
a(M).customComponent[e.type ?? ""]?.table ? (f(), h(q(a(M).customComponent[e.type ?? ""]?.table), v({
|
|
1679
1751
|
key: 0,
|
|
1680
|
-
modelValue:
|
|
1681
|
-
"onUpdate:modelValue": (
|
|
1752
|
+
modelValue: s[e.key],
|
|
1753
|
+
"onUpdate:modelValue": (p) => s[e.key] = p,
|
|
1682
1754
|
ref_for: !0
|
|
1683
|
-
},
|
|
1755
|
+
}, e.options?.[e.type ?? ""], S(e.options?.[e.type ?? ""]?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue"])) : e.type === "switch" ? (f(), h(a(oe), v({
|
|
1684
1756
|
key: 1,
|
|
1685
|
-
modelValue:
|
|
1686
|
-
"onUpdate:modelValue": (
|
|
1687
|
-
"before-change": () =>
|
|
1757
|
+
modelValue: s[e.key],
|
|
1758
|
+
"onUpdate:modelValue": (p) => s[e.key] = p,
|
|
1759
|
+
"before-change": () => e.options?.switch?.tableBeforeChange?.(e.key, s),
|
|
1688
1760
|
ref_for: !0
|
|
1689
|
-
},
|
|
1761
|
+
}, e.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "before-change"])) : (f(), y("span", {
|
|
1690
1762
|
key: 2,
|
|
1691
|
-
style:
|
|
1692
|
-
"--table-text-click-color":
|
|
1763
|
+
style: fe({
|
|
1764
|
+
"--table-text-click-color": e.table?.click?.color
|
|
1693
1765
|
}),
|
|
1694
|
-
class:
|
|
1695
|
-
onClick: (
|
|
1696
|
-
innerHTML:
|
|
1697
|
-
}, null, 14,
|
|
1766
|
+
class: j({ "table-text-click": e.table?.click?.callback }),
|
|
1767
|
+
onClick: (p) => e.table?.click?.callback?.(s),
|
|
1768
|
+
innerHTML: e.table?.format ? e.table?.format(s) : s[e.key]
|
|
1769
|
+
}, null, 14, We))
|
|
1698
1770
|
])
|
|
1699
1771
|
], 64))
|
|
1700
1772
|
]),
|
|
@@ -1703,143 +1775,143 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
1703
1775
|
], 64))), 128);
|
|
1704
1776
|
};
|
|
1705
1777
|
}
|
|
1706
|
-
}),
|
|
1778
|
+
}), Ge = {
|
|
1707
1779
|
class: "row form-item-content",
|
|
1708
1780
|
style: { width: "100%" }
|
|
1709
|
-
},
|
|
1781
|
+
}, Xe = { class: "col" }, Qe = { class: "col" }, Ye = ["innerHTML"], Ze = /* @__PURE__ */ J({
|
|
1710
1782
|
__name: "formColumn",
|
|
1711
1783
|
props: {
|
|
1712
1784
|
conf: {},
|
|
1713
1785
|
item: {}
|
|
1714
1786
|
},
|
|
1715
|
-
setup(
|
|
1716
|
-
return (
|
|
1717
|
-
class:
|
|
1718
|
-
"hide-label": typeof
|
|
1787
|
+
setup(r) {
|
|
1788
|
+
return (o, u) => (f(), h(a(X), {
|
|
1789
|
+
class: j({
|
|
1790
|
+
"hide-label": typeof o.item.item.text?.form?.label == "boolean" ? !o.item.item.text?.form?.label : !1
|
|
1719
1791
|
}),
|
|
1720
|
-
label: typeof
|
|
1721
|
-
prop:
|
|
1722
|
-
"label-width":
|
|
1792
|
+
label: typeof o.item.item.text?.form?.label == "string" ? o.item.item.text?.form?.label : o.item.item.label,
|
|
1793
|
+
prop: o.item.item.key,
|
|
1794
|
+
"label-width": o.item.item.form?.labelWidth || o.conf.option.form?.labelWidth
|
|
1723
1795
|
}, {
|
|
1724
|
-
default:
|
|
1725
|
-
O("div",
|
|
1726
|
-
k(
|
|
1727
|
-
row:
|
|
1728
|
-
item:
|
|
1796
|
+
default: m(() => [
|
|
1797
|
+
O("div", Ge, [
|
|
1798
|
+
k(o.$slots, "form-" + o.item.item.key + "-start", {
|
|
1799
|
+
row: o.conf.update.form,
|
|
1800
|
+
item: o.item.item
|
|
1729
1801
|
}),
|
|
1730
|
-
O("div",
|
|
1731
|
-
O("div",
|
|
1732
|
-
k(
|
|
1733
|
-
row:
|
|
1734
|
-
item:
|
|
1802
|
+
O("div", Xe, [
|
|
1803
|
+
O("div", Qe, [
|
|
1804
|
+
k(o.$slots, "form-" + o.item.item.key, {
|
|
1805
|
+
row: o.conf.update.form,
|
|
1806
|
+
item: o.item.item
|
|
1735
1807
|
}, () => [
|
|
1736
|
-
|
|
1808
|
+
o.item.item.type === "input" ? (f(), h(a(Y), v({
|
|
1737
1809
|
key: 0,
|
|
1738
|
-
modelValue:
|
|
1739
|
-
"onUpdate:modelValue":
|
|
1740
|
-
},
|
|
1741
|
-
disabled:
|
|
1742
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
1810
|
+
modelValue: o.conf.update.form[o.item.item.key],
|
|
1811
|
+
"onUpdate:modelValue": u[0] || (u[0] = (t) => o.conf.update.form[o.item.item.key] = t)
|
|
1812
|
+
}, o.conf.update.getBind(o.item.item), S(o.conf.update.getOn(o.item.item)), {
|
|
1813
|
+
disabled: o.conf.update.getDisabled(o.item.item)
|
|
1814
|
+
}), null, 16, ["modelValue", "disabled"])) : o.item.item.type === "switch" ? (f(), h(a(oe), v({
|
|
1743
1815
|
key: 1,
|
|
1744
|
-
modelValue:
|
|
1745
|
-
"onUpdate:modelValue":
|
|
1746
|
-
},
|
|
1747
|
-
disabled:
|
|
1748
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
1816
|
+
modelValue: o.conf.update.form[o.item.item.key],
|
|
1817
|
+
"onUpdate:modelValue": u[1] || (u[1] = (t) => o.conf.update.form[o.item.item.key] = t)
|
|
1818
|
+
}, o.conf.update.getBind(o.item.item), S(o.conf.update.getOn(o.item.item)), {
|
|
1819
|
+
disabled: o.conf.update.getDisabled(o.item.item)
|
|
1820
|
+
}), null, 16, ["modelValue", "disabled"])) : o.item.item.type === "select" ? (f(), h(a(W), v({
|
|
1749
1821
|
key: 2,
|
|
1750
|
-
modelValue:
|
|
1751
|
-
"onUpdate:modelValue":
|
|
1752
|
-
},
|
|
1753
|
-
disabled:
|
|
1822
|
+
modelValue: o.conf.update.form[o.item.item.key],
|
|
1823
|
+
"onUpdate:modelValue": u[2] || (u[2] = (t) => o.conf.update.form[o.item.item.key] = t)
|
|
1824
|
+
}, o.conf.update.getBind(o.item.item), S(o.conf.update.getOn(o.item.item)), {
|
|
1825
|
+
disabled: o.conf.update.getDisabled(o.item.item),
|
|
1754
1826
|
style: { width: "100%" }
|
|
1755
1827
|
}), {
|
|
1756
|
-
default:
|
|
1757
|
-
(f(!0),
|
|
1758
|
-
key:
|
|
1759
|
-
label:
|
|
1760
|
-
value:
|
|
1828
|
+
default: m(() => [
|
|
1829
|
+
(f(!0), y($, null, L(o.item.item.options?.select?.data, (t) => (f(), h(a(K), {
|
|
1830
|
+
key: t.value,
|
|
1831
|
+
label: t.label,
|
|
1832
|
+
value: t.value
|
|
1761
1833
|
}, null, 8, ["label", "value"]))), 128))
|
|
1762
1834
|
]),
|
|
1763
1835
|
_: 1
|
|
1764
|
-
}, 16, ["modelValue", "disabled"])) :
|
|
1836
|
+
}, 16, ["modelValue", "disabled"])) : o.item.item.type === "radio" ? (f(), h(a(re), v({
|
|
1765
1837
|
key: 3,
|
|
1766
|
-
modelValue:
|
|
1767
|
-
"onUpdate:modelValue":
|
|
1768
|
-
},
|
|
1769
|
-
disabled:
|
|
1838
|
+
modelValue: o.conf.update.form[o.item.item.key],
|
|
1839
|
+
"onUpdate:modelValue": u[3] || (u[3] = (t) => o.conf.update.form[o.item.item.key] = t)
|
|
1840
|
+
}, o.conf.update.getBind(o.item.item), S(o.conf.update.getOn(o.item.item)), {
|
|
1841
|
+
disabled: o.conf.update.getDisabled(o.item.item),
|
|
1770
1842
|
style: { width: "100%" }
|
|
1771
1843
|
}), {
|
|
1772
|
-
default:
|
|
1773
|
-
(f(!0),
|
|
1774
|
-
key:
|
|
1775
|
-
label:
|
|
1776
|
-
value:
|
|
1844
|
+
default: m(() => [
|
|
1845
|
+
(f(!0), y($, null, L(o.item.item.options?.radio?.data, (t) => (f(), h(a(se), {
|
|
1846
|
+
key: t.value,
|
|
1847
|
+
label: t.label,
|
|
1848
|
+
value: t.value
|
|
1777
1849
|
}, null, 8, ["label", "value"]))), 128))
|
|
1778
1850
|
]),
|
|
1779
1851
|
_: 1
|
|
1780
|
-
}, 16, ["modelValue", "disabled"])) :
|
|
1852
|
+
}, 16, ["modelValue", "disabled"])) : o.item.item.type === "list" ? (f(), h(ne, v({
|
|
1781
1853
|
key: 4,
|
|
1782
|
-
row:
|
|
1783
|
-
field:
|
|
1784
|
-
},
|
|
1785
|
-
disabled:
|
|
1854
|
+
row: o.conf.update.form,
|
|
1855
|
+
field: o.item.item.key
|
|
1856
|
+
}, o.conf.update.getBind(o.item.item), S(o.conf.update.getOn(o.item.item)), {
|
|
1857
|
+
disabled: o.conf.update.getDisabled(o.item.item),
|
|
1786
1858
|
style: { width: "100%" }
|
|
1787
|
-
}), null, 16, ["row", "field", "disabled"])) :
|
|
1859
|
+
}), null, 16, ["row", "field", "disabled"])) : o.item.item.type === "treeSelect" ? (f(), h(a(de), v({
|
|
1788
1860
|
key: 5,
|
|
1789
|
-
modelValue:
|
|
1790
|
-
"onUpdate:modelValue":
|
|
1791
|
-
},
|
|
1792
|
-
disabled:
|
|
1861
|
+
modelValue: o.conf.update.form[o.item.item.key],
|
|
1862
|
+
"onUpdate:modelValue": u[4] || (u[4] = (t) => o.conf.update.form[o.item.item.key] = t)
|
|
1863
|
+
}, o.conf.update.getBind(o.item.item), S(o.conf.update.getOn(o.item.item)), {
|
|
1864
|
+
disabled: o.conf.update.getDisabled(o.item.item),
|
|
1793
1865
|
style: { width: "100%" }
|
|
1794
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
1866
|
+
}), null, 16, ["modelValue", "disabled"])) : o.item.item.type === "datetime" ? (f(), h(a(ae), v({
|
|
1795
1867
|
key: 6,
|
|
1796
|
-
modelValue:
|
|
1797
|
-
"onUpdate:modelValue":
|
|
1798
|
-
},
|
|
1799
|
-
disabled:
|
|
1800
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
1868
|
+
modelValue: o.conf.update.form[o.item.item.key],
|
|
1869
|
+
"onUpdate:modelValue": u[5] || (u[5] = (t) => o.conf.update.form[o.item.item.key] = t)
|
|
1870
|
+
}, o.conf.update.getBind(o.item.item), S(o.conf.update.getOn(o.item.item)), {
|
|
1871
|
+
disabled: o.conf.update.getDisabled(o.item.item)
|
|
1872
|
+
}), null, 16, ["modelValue", "disabled"])) : o.item.item.type && (a(M).customComponent[o.item.item.type] || a(M).customComponent[o.item.item.type]?.form) ? (f(), h(q(a(M).customComponent[o.item.item.type]?.form || a(M).customComponent[o.item.item.type]), v({
|
|
1801
1873
|
key: 7,
|
|
1802
|
-
modelValue:
|
|
1803
|
-
"onUpdate:modelValue":
|
|
1804
|
-
},
|
|
1805
|
-
disabled:
|
|
1874
|
+
modelValue: o.conf.update.form[o.item.item.key],
|
|
1875
|
+
"onUpdate:modelValue": u[6] || (u[6] = (t) => o.conf.update.form[o.item.item.key] = t)
|
|
1876
|
+
}, o.conf.update.getBind(o.item.item), S(o.conf.update.getOn(o.item.item)), {
|
|
1877
|
+
disabled: o.conf.update.getDisabled(o.item.item)
|
|
1806
1878
|
}), null, 16, ["modelValue", "disabled"])) : C("", !0)
|
|
1807
1879
|
]),
|
|
1808
|
-
k(
|
|
1809
|
-
row:
|
|
1810
|
-
item:
|
|
1880
|
+
k(o.$slots, "form-" + o.item.item.key + "-right", {
|
|
1881
|
+
row: o.conf.update.form,
|
|
1882
|
+
item: o.item.item
|
|
1811
1883
|
})
|
|
1812
1884
|
]),
|
|
1813
|
-
k(
|
|
1814
|
-
row:
|
|
1815
|
-
item:
|
|
1885
|
+
k(o.$slots, "form-" + o.item.item.key + "-tip", {
|
|
1886
|
+
row: o.conf.update.form,
|
|
1887
|
+
item: o.item.item
|
|
1816
1888
|
}, () => [
|
|
1817
|
-
|
|
1889
|
+
o.item.item.form?.tipText ? (f(), y("div", {
|
|
1818
1890
|
key: 0,
|
|
1819
1891
|
class: "form-tip-text",
|
|
1820
|
-
innerHTML:
|
|
1821
|
-
}, null, 8,
|
|
1892
|
+
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
|
|
1893
|
+
}, null, 8, Ye)) : C("", !0)
|
|
1822
1894
|
])
|
|
1823
1895
|
]),
|
|
1824
|
-
k(
|
|
1825
|
-
row:
|
|
1826
|
-
item:
|
|
1896
|
+
k(o.$slots, "form-" + o.item.item.key + "-end", {
|
|
1897
|
+
row: o.conf.update.form,
|
|
1898
|
+
item: o.item.item
|
|
1827
1899
|
})
|
|
1828
1900
|
])
|
|
1829
1901
|
]),
|
|
1830
1902
|
_: 3
|
|
1831
1903
|
}, 8, ["class", "label", "prop", "label-width"]));
|
|
1832
1904
|
}
|
|
1833
|
-
}),
|
|
1905
|
+
}), xe = {
|
|
1834
1906
|
key: 0,
|
|
1835
1907
|
class: "relative curd-search fit-width"
|
|
1836
|
-
},
|
|
1908
|
+
}, _e = { class: "mb-10 flex justify-between items-center fit-width" }, et = {
|
|
1837
1909
|
class: "flex items-center",
|
|
1838
1910
|
style: { gap: "10px" }
|
|
1839
|
-
},
|
|
1911
|
+
}, tt = { key: 0 }, ot = { key: 1 }, at = { key: 2 }, lt = { class: "export-btn" }, nt = {
|
|
1840
1912
|
class: "flex items-center table-tools-right",
|
|
1841
1913
|
style: { gap: "10px" }
|
|
1842
|
-
},
|
|
1914
|
+
}, it = { class: "row justify-end mt-10 mb-10 table-bottom-pagination" }, rt = { class: "dialog-footer" }, st = { class: "dialog-footer" }, dt = /* @__PURE__ */ J({
|
|
1843
1915
|
__name: "index",
|
|
1844
1916
|
props: {
|
|
1845
1917
|
/**
|
|
@@ -1849,215 +1921,215 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
1849
1921
|
default: {}
|
|
1850
1922
|
}
|
|
1851
1923
|
},
|
|
1852
|
-
setup(
|
|
1853
|
-
const
|
|
1854
|
-
return
|
|
1855
|
-
conf:
|
|
1856
|
-
}), (
|
|
1857
|
-
const
|
|
1858
|
-
return f(),
|
|
1859
|
-
class:
|
|
1924
|
+
setup(r, { expose: o }) {
|
|
1925
|
+
const u = U.EDialog, t = r, i = U.isFun, { conf: l, switchConfirmRef: e, ruleFormRef: s } = Te(t);
|
|
1926
|
+
return o({
|
|
1927
|
+
conf: l
|
|
1928
|
+
}), (p, c) => {
|
|
1929
|
+
const g = we("loading");
|
|
1930
|
+
return f(), y("div", {
|
|
1931
|
+
class: j(["relative cc1-form-box", [r.option.table?.fitHeight ? "col" : "no-min-height"]])
|
|
1860
1932
|
}, [
|
|
1861
1933
|
O("div", {
|
|
1862
|
-
class:
|
|
1934
|
+
class: j(["row", [r.option.table?.fitHeight ? "absolute fit" : ""]]),
|
|
1863
1935
|
style: { overflow: "hidden" }
|
|
1864
1936
|
}, [
|
|
1865
|
-
k(
|
|
1937
|
+
k(p.$slots, "box-left"),
|
|
1866
1938
|
O("div", {
|
|
1867
|
-
class:
|
|
1939
|
+
class: j(["column fit-width no-wrap", [r.option.table?.fitHeight ? "col" : ""]])
|
|
1868
1940
|
}, [
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
model:
|
|
1941
|
+
r.option.search?.show !== !1 ? (f(), y("div", xe, [
|
|
1942
|
+
z(a(N), {
|
|
1943
|
+
model: a(l).search.form,
|
|
1872
1944
|
inline: "",
|
|
1873
|
-
size:
|
|
1945
|
+
size: r.option.size?.search
|
|
1874
1946
|
}, {
|
|
1875
|
-
default:
|
|
1876
|
-
k(
|
|
1877
|
-
row:
|
|
1947
|
+
default: m(() => [
|
|
1948
|
+
k(p.$slots, "search-start", {
|
|
1949
|
+
row: a(l).search.form
|
|
1878
1950
|
}),
|
|
1879
|
-
(f(!0),
|
|
1880
|
-
key:
|
|
1951
|
+
(f(!0), y($, null, L(a(l).search.column.list, (n) => (f(), y($, {
|
|
1952
|
+
key: n.key
|
|
1881
1953
|
}, [
|
|
1882
|
-
(typeof
|
|
1954
|
+
(typeof n.show?.search == "function" ? n.show?.search(a(l).search.form) : n.show?.search) ? (f(), h(a(X), {
|
|
1883
1955
|
key: 0,
|
|
1884
|
-
label: typeof
|
|
1885
|
-
class:
|
|
1886
|
-
"hide-label": typeof
|
|
1956
|
+
label: typeof n.text?.search?.label == "string" ? n.text?.search?.label : n.label,
|
|
1957
|
+
class: j({
|
|
1958
|
+
"hide-label": typeof n.text?.search?.label == "boolean" ? !n.text?.search?.label : !1
|
|
1887
1959
|
})
|
|
1888
1960
|
}, {
|
|
1889
|
-
default:
|
|
1890
|
-
k(
|
|
1891
|
-
row:
|
|
1961
|
+
default: m(() => [
|
|
1962
|
+
k(p.$slots, "search-" + n.key, {
|
|
1963
|
+
row: a(l).search.form
|
|
1892
1964
|
}, () => [
|
|
1893
|
-
|
|
1965
|
+
n.type === "input" ? (f(), h(a(Y), v({
|
|
1894
1966
|
key: 0,
|
|
1895
|
-
modelValue:
|
|
1896
|
-
"onUpdate:modelValue": (
|
|
1897
|
-
placeholder:
|
|
1967
|
+
modelValue: a(l).search.form[n.key],
|
|
1968
|
+
"onUpdate:modelValue": (d) => a(l).search.form[n.key] = d,
|
|
1969
|
+
placeholder: a(l).search.getPlaceholder(n),
|
|
1898
1970
|
clearable: "",
|
|
1899
|
-
disabled:
|
|
1971
|
+
disabled: n.disabled?.search,
|
|
1900
1972
|
ref_for: !0
|
|
1901
|
-
},
|
|
1973
|
+
}, n.options?.search?.input || n.options?.input, S(n.options?.search?.input?.on || n.options?.input?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : n.type === "switch" ? (f(), h(a(W), v({
|
|
1902
1974
|
key: 1,
|
|
1903
|
-
modelValue:
|
|
1904
|
-
"onUpdate:modelValue": (
|
|
1905
|
-
placeholder:
|
|
1975
|
+
modelValue: a(l).search.form[n.key],
|
|
1976
|
+
"onUpdate:modelValue": (d) => a(l).search.form[n.key] = d,
|
|
1977
|
+
placeholder: a(l).search.getPlaceholder(n, a(b).tCurd("placeholderSelect")),
|
|
1906
1978
|
clearable: "",
|
|
1907
|
-
disabled:
|
|
1979
|
+
disabled: n.disabled?.search,
|
|
1908
1980
|
ref_for: !0
|
|
1909
|
-
},
|
|
1910
|
-
default:
|
|
1911
|
-
(f(),
|
|
1912
|
-
key:
|
|
1913
|
-
label:
|
|
1914
|
-
value:
|
|
1981
|
+
}, n.options?.search?.switch || n.options?.switch, S(n.options?.search?.switch?.on || n.options?.switch?.on || {})), {
|
|
1982
|
+
default: m(() => [
|
|
1983
|
+
(f(), h(a(K), {
|
|
1984
|
+
key: n.options?.switch?.activeValue,
|
|
1985
|
+
label: n.options?.switch?.activeLabel,
|
|
1986
|
+
value: n.options?.switch?.activeValue
|
|
1915
1987
|
}, null, 8, ["label", "value"])),
|
|
1916
|
-
(f(),
|
|
1917
|
-
key:
|
|
1918
|
-
label:
|
|
1919
|
-
value:
|
|
1988
|
+
(f(), h(a(K), {
|
|
1989
|
+
key: n.options?.switch?.inactiveValue,
|
|
1990
|
+
label: n.options?.switch?.inactiveLabel,
|
|
1991
|
+
value: n.options?.switch?.inactiveValue
|
|
1920
1992
|
}, null, 8, ["label", "value"]))
|
|
1921
1993
|
]),
|
|
1922
1994
|
_: 2
|
|
1923
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) :
|
|
1995
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : n.type === "select" ? (f(), h(a(W), v({
|
|
1924
1996
|
key: 2,
|
|
1925
|
-
modelValue:
|
|
1926
|
-
"onUpdate:modelValue": (
|
|
1927
|
-
placeholder:
|
|
1997
|
+
modelValue: a(l).search.form[n.key],
|
|
1998
|
+
"onUpdate:modelValue": (d) => a(l).search.form[n.key] = d,
|
|
1999
|
+
placeholder: a(l).search.getPlaceholder(n, a(b).tCurd("placeholderSelect")),
|
|
1928
2000
|
clearable: "",
|
|
1929
|
-
disabled:
|
|
2001
|
+
disabled: n.disabled?.search,
|
|
1930
2002
|
ref_for: !0
|
|
1931
|
-
},
|
|
1932
|
-
default:
|
|
1933
|
-
(f(!0),
|
|
1934
|
-
key:
|
|
1935
|
-
label:
|
|
1936
|
-
value:
|
|
2003
|
+
}, n.options?.search?.select || n.options?.select, S(n.options?.search?.select?.on || n.options?.select?.on || {})), {
|
|
2004
|
+
default: m(() => [
|
|
2005
|
+
(f(!0), y($, null, L(n.options?.select?.data, (d) => (f(), h(a(K), {
|
|
2006
|
+
key: d.value,
|
|
2007
|
+
label: d.label,
|
|
2008
|
+
value: d.value
|
|
1937
2009
|
}, null, 8, ["label", "value"]))), 128))
|
|
1938
2010
|
]),
|
|
1939
2011
|
_: 2
|
|
1940
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) :
|
|
2012
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : n.type === "datetime" ? (f(), h(a(ae), v({
|
|
1941
2013
|
key: 3,
|
|
1942
|
-
modelValue:
|
|
1943
|
-
"onUpdate:modelValue": (
|
|
1944
|
-
disabled:
|
|
2014
|
+
modelValue: a(l).search.form[n.key],
|
|
2015
|
+
"onUpdate:modelValue": (d) => a(l).search.form[n.key] = d,
|
|
2016
|
+
disabled: n.disabled?.search,
|
|
1945
2017
|
ref_for: !0
|
|
1946
|
-
},
|
|
2018
|
+
}, n.options?.search?.datetime || n.options?.datetime, S(n.options?.search?.datetime?.on || n.options?.datetime?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.type && a(M).customComponent[n.type] ? (f(), h(q(a(M).customComponent[n.type]), v({
|
|
1947
2019
|
key: 4,
|
|
1948
|
-
modelValue:
|
|
1949
|
-
"onUpdate:modelValue": (
|
|
2020
|
+
modelValue: a(l).search.form[n.key],
|
|
2021
|
+
"onUpdate:modelValue": (d) => a(l).search.form[n.key] = d,
|
|
1950
2022
|
ref_for: !0
|
|
1951
|
-
},
|
|
1952
|
-
disabled:
|
|
2023
|
+
}, n.options?.search?.[n.type] || n.options?.[n.type], S(n.options?.search?.[n.type]?.on || n.options?.[n.type]?.on || {}), {
|
|
2024
|
+
disabled: n.disabled?.search
|
|
1953
2025
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : C("", !0)
|
|
1954
2026
|
]),
|
|
1955
|
-
k(
|
|
1956
|
-
row:
|
|
2027
|
+
k(p.$slots, "search-" + n.key + "-right", {
|
|
2028
|
+
row: a(l).search.form
|
|
1957
2029
|
})
|
|
1958
2030
|
]),
|
|
1959
2031
|
_: 2
|
|
1960
2032
|
}, 1032, ["label", "class"])) : C("", !0)
|
|
1961
2033
|
], 64))), 128)),
|
|
1962
|
-
k(
|
|
1963
|
-
row:
|
|
2034
|
+
k(p.$slots, "search-center", {
|
|
2035
|
+
row: a(l).search.form
|
|
1964
2036
|
}),
|
|
1965
|
-
|
|
1966
|
-
default:
|
|
1967
|
-
|
|
2037
|
+
r.option.tools?.search || r.option.tools?.reset ? (f(), h(a(X), { key: 0 }, {
|
|
2038
|
+
default: m(() => [
|
|
2039
|
+
r.option.tools?.search ? (f(), h(a(A), {
|
|
1968
2040
|
key: 0,
|
|
1969
2041
|
type: "primary",
|
|
1970
|
-
onClick:
|
|
2042
|
+
onClick: a(l).search.submit
|
|
1971
2043
|
}, {
|
|
1972
|
-
default:
|
|
1973
|
-
E(
|
|
2044
|
+
default: m(() => [
|
|
2045
|
+
E(T(a(b).tCurd("search")), 1)
|
|
1974
2046
|
]),
|
|
1975
2047
|
_: 1
|
|
1976
2048
|
}, 8, ["onClick"])) : C("", !0),
|
|
1977
|
-
|
|
2049
|
+
r.option.tools?.reset ? (f(), h(a(A), {
|
|
1978
2050
|
key: 1,
|
|
1979
|
-
onClick:
|
|
2051
|
+
onClick: a(l).search.reset
|
|
1980
2052
|
}, {
|
|
1981
|
-
default:
|
|
1982
|
-
E(
|
|
2053
|
+
default: m(() => [
|
|
2054
|
+
E(T(a(b).tCurd("reset")), 1)
|
|
1983
2055
|
]),
|
|
1984
2056
|
_: 1
|
|
1985
2057
|
}, 8, ["onClick"])) : C("", !0)
|
|
1986
2058
|
]),
|
|
1987
2059
|
_: 1
|
|
1988
2060
|
})) : C("", !0),
|
|
1989
|
-
k(
|
|
1990
|
-
row:
|
|
2061
|
+
k(p.$slots, "search-end", {
|
|
2062
|
+
row: a(l).search.form
|
|
1991
2063
|
})
|
|
1992
2064
|
]),
|
|
1993
2065
|
_: 3
|
|
1994
2066
|
}, 8, ["model", "size"])
|
|
1995
2067
|
])) : C("", !0),
|
|
1996
|
-
O("div",
|
|
1997
|
-
O("div",
|
|
1998
|
-
|
|
1999
|
-
|
|
2068
|
+
O("div", _e, [
|
|
2069
|
+
O("div", et, [
|
|
2070
|
+
a(i)(r.option.tools?.add) ? (f(), y("div", tt, [
|
|
2071
|
+
z(a(A), {
|
|
2000
2072
|
type: "primary",
|
|
2001
|
-
onClick:
|
|
2002
|
-
size:
|
|
2073
|
+
onClick: c[0] || (c[0] = (n) => a(l).update.open(a(u).Add)),
|
|
2074
|
+
size: r.option.size?.search
|
|
2003
2075
|
}, {
|
|
2004
|
-
default:
|
|
2005
|
-
E(
|
|
2076
|
+
default: m(() => [
|
|
2077
|
+
E(T(a(b).tCurd("add")), 1)
|
|
2006
2078
|
]),
|
|
2007
2079
|
_: 1
|
|
2008
2080
|
}, 8, ["size"])
|
|
2009
2081
|
])) : C("", !0),
|
|
2010
|
-
|
|
2011
|
-
|
|
2082
|
+
r.option.table?.selectable && a(i)(r.option.tools?.delete) ? (f(), y("div", ot, [
|
|
2083
|
+
z(a(A), {
|
|
2012
2084
|
type: "danger",
|
|
2013
|
-
onClick:
|
|
2014
|
-
size:
|
|
2085
|
+
onClick: c[1] || (c[1] = (n) => a(l).remove.open(a(l).table.selection.list)),
|
|
2086
|
+
size: r.option.size?.search
|
|
2015
2087
|
}, {
|
|
2016
|
-
default:
|
|
2017
|
-
E(
|
|
2088
|
+
default: m(() => [
|
|
2089
|
+
E(T(a(b).tCurd("delete")), 1)
|
|
2018
2090
|
]),
|
|
2019
2091
|
_: 1
|
|
2020
2092
|
}, 8, ["size"])
|
|
2021
2093
|
])) : C("", !0),
|
|
2022
|
-
|
|
2023
|
-
|
|
2094
|
+
r.option.tools?.expand ? (f(), y("div", at, [
|
|
2095
|
+
z(a(A), {
|
|
2024
2096
|
type: "warning",
|
|
2025
|
-
onClick:
|
|
2026
|
-
size:
|
|
2097
|
+
onClick: c[2] || (c[2] = (n) => a(l).table.expand.all()),
|
|
2098
|
+
size: r.option.size?.search
|
|
2027
2099
|
}, {
|
|
2028
|
-
default:
|
|
2029
|
-
E(
|
|
2100
|
+
default: m(() => [
|
|
2101
|
+
E(T(a(b).tCurd("expandCollapse")), 1)
|
|
2030
2102
|
]),
|
|
2031
2103
|
_: 1
|
|
2032
2104
|
}, 8, ["size"])
|
|
2033
2105
|
])) : C("", !0),
|
|
2034
|
-
|
|
2106
|
+
r.option.tools?.export?.show ? (f(), h(a(he), {
|
|
2035
2107
|
key: 3,
|
|
2036
|
-
onCommand:
|
|
2108
|
+
onCommand: a(l).export.click
|
|
2037
2109
|
}, {
|
|
2038
|
-
dropdown:
|
|
2039
|
-
|
|
2040
|
-
size:
|
|
2110
|
+
dropdown: m(() => [
|
|
2111
|
+
z(a(ge), {
|
|
2112
|
+
size: r.option.size?.search
|
|
2041
2113
|
}, {
|
|
2042
|
-
default:
|
|
2043
|
-
|
|
2114
|
+
default: m(() => [
|
|
2115
|
+
r.option.table?.selectable ? (f(), h(a(x), {
|
|
2044
2116
|
key: 0,
|
|
2045
2117
|
command: "select"
|
|
2046
2118
|
}, {
|
|
2047
|
-
default:
|
|
2048
|
-
E(
|
|
2119
|
+
default: m(() => [
|
|
2120
|
+
E(T(a(b).tCurd("exportSelect")), 1)
|
|
2049
2121
|
]),
|
|
2050
2122
|
_: 1
|
|
2051
2123
|
})) : C("", !0),
|
|
2052
|
-
|
|
2053
|
-
default:
|
|
2054
|
-
E(
|
|
2124
|
+
z(a(x), { command: "page" }, {
|
|
2125
|
+
default: m(() => [
|
|
2126
|
+
E(T(a(b).tCurd("exportPage")), 1)
|
|
2055
2127
|
]),
|
|
2056
2128
|
_: 1
|
|
2057
2129
|
}),
|
|
2058
|
-
|
|
2059
|
-
default:
|
|
2060
|
-
E(
|
|
2130
|
+
z(a(x), { command: "all" }, {
|
|
2131
|
+
default: m(() => [
|
|
2132
|
+
E(T(a(b).tCurd("exportAll")), 1)
|
|
2061
2133
|
]),
|
|
2062
2134
|
_: 1
|
|
2063
2135
|
})
|
|
@@ -2065,15 +2137,15 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2065
2137
|
_: 1
|
|
2066
2138
|
}, 8, ["size"])
|
|
2067
2139
|
]),
|
|
2068
|
-
default:
|
|
2069
|
-
O("div",
|
|
2070
|
-
|
|
2140
|
+
default: m(() => [
|
|
2141
|
+
O("div", lt, [
|
|
2142
|
+
z(a(A), {
|
|
2071
2143
|
type: "warning",
|
|
2072
|
-
loading:
|
|
2073
|
-
size:
|
|
2144
|
+
loading: a(l).export.loading,
|
|
2145
|
+
size: r.option.size?.search
|
|
2074
2146
|
}, {
|
|
2075
|
-
default:
|
|
2076
|
-
E(
|
|
2147
|
+
default: m(() => [
|
|
2148
|
+
E(T(a(b).tCurd("export")), 1)
|
|
2077
2149
|
]),
|
|
2078
2150
|
_: 1
|
|
2079
2151
|
}, 8, ["loading", "size"])
|
|
@@ -2081,157 +2153,157 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2081
2153
|
]),
|
|
2082
2154
|
_: 1
|
|
2083
2155
|
}, 8, ["onCommand"])) : C("", !0),
|
|
2084
|
-
k(
|
|
2156
|
+
k(p.$slots, "tools-left")
|
|
2085
2157
|
]),
|
|
2086
|
-
O("div",
|
|
2087
|
-
k(
|
|
2088
|
-
|
|
2158
|
+
O("div", nt, [
|
|
2159
|
+
k(p.$slots, "tools-right"),
|
|
2160
|
+
a(l).page.showTools ? (f(), h(a(ie), v({
|
|
2089
2161
|
key: 0,
|
|
2090
|
-
"current-page":
|
|
2091
|
-
"onUpdate:currentPage":
|
|
2092
|
-
"page-size":
|
|
2093
|
-
"onUpdate:pageSize":
|
|
2162
|
+
"current-page": a(l).page.num,
|
|
2163
|
+
"onUpdate:currentPage": c[3] || (c[3] = (n) => a(l).page.num = n),
|
|
2164
|
+
"page-size": a(l).page.size,
|
|
2165
|
+
"onUpdate:pageSize": c[4] || (c[4] = (n) => a(l).page.size = n),
|
|
2094
2166
|
background: "",
|
|
2095
|
-
"page-sizes":
|
|
2096
|
-
"pager-count":
|
|
2097
|
-
layout:
|
|
2098
|
-
total:
|
|
2099
|
-
size:
|
|
2100
|
-
onSizeChange:
|
|
2101
|
-
onCurrentChange:
|
|
2102
|
-
},
|
|
2103
|
-
|
|
2167
|
+
"page-sizes": a(l).page.sizeList,
|
|
2168
|
+
"pager-count": a(l).page.pagerCount,
|
|
2169
|
+
layout: a(l).page.layout,
|
|
2170
|
+
total: a(l).page.total,
|
|
2171
|
+
size: r.option.size?.table,
|
|
2172
|
+
onSizeChange: a(l).table.getList,
|
|
2173
|
+
onCurrentChange: a(l).table.getList
|
|
2174
|
+
}, r.option.page?.pagination || {}, S(r.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : C("", !0),
|
|
2175
|
+
r.option.tools?.refresh === void 0 || r.option.tools?.refresh ? (f(), y("div", {
|
|
2104
2176
|
key: 1,
|
|
2105
|
-
class:
|
|
2106
|
-
onClick:
|
|
2107
|
-
(...
|
|
2177
|
+
class: j(["refresh-btn", [r.option.size?.search]]),
|
|
2178
|
+
onClick: c[5] || (c[5] = //@ts-ignore
|
|
2179
|
+
(...n) => a(l).table.getList && a(l).table.getList(...n))
|
|
2108
2180
|
}, [
|
|
2109
|
-
|
|
2181
|
+
z(Ie)
|
|
2110
2182
|
], 2)) : C("", !0)
|
|
2111
2183
|
])
|
|
2112
2184
|
]),
|
|
2113
2185
|
O("div", {
|
|
2114
|
-
class:
|
|
2186
|
+
class: j(["fit-width relative form-box", [r.option.table?.fitHeight ? "col " : ""]])
|
|
2115
2187
|
}, [
|
|
2116
2188
|
O("div", {
|
|
2117
|
-
class:
|
|
2189
|
+
class: j(["column form-box-content", [r.option.table?.fitHeight ? "absolute fit" : ""]])
|
|
2118
2190
|
}, [
|
|
2119
|
-
|
|
2120
|
-
data:
|
|
2121
|
-
border:
|
|
2122
|
-
onSelectionChange:
|
|
2123
|
-
onSortChange:
|
|
2124
|
-
"expand-row-keys":
|
|
2125
|
-
onExpandChange:
|
|
2126
|
-
},
|
|
2127
|
-
default:
|
|
2128
|
-
|
|
2191
|
+
ke((f(), h(a(be), v({
|
|
2192
|
+
data: a(l).table.data,
|
|
2193
|
+
border: r.option.table?.border === void 0 ? !0 : r.option.table?.border,
|
|
2194
|
+
onSelectionChange: a(l).table.selection.change,
|
|
2195
|
+
onSortChange: a(l).table.sort.change,
|
|
2196
|
+
"expand-row-keys": a(l).table.expand.rowKeys,
|
|
2197
|
+
onExpandChange: a(l).table.expand.change
|
|
2198
|
+
}, r.option.table, S(r.option.table?.on || {})), {
|
|
2199
|
+
default: m(() => [
|
|
2200
|
+
r.option.table?.selectable || a(i)(r.option.tools?.delete) || r.option.tools?.export?.show ? (f(), h(a(ee), {
|
|
2129
2201
|
key: 0,
|
|
2130
2202
|
type: "selection",
|
|
2131
|
-
selectable: typeof
|
|
2203
|
+
selectable: typeof r.option.table?.selectable == "function" ? r.option.table?.selectable : void 0,
|
|
2132
2204
|
width: "40",
|
|
2133
2205
|
align: "center",
|
|
2134
2206
|
fixed: "left",
|
|
2135
2207
|
"show-overflow-tooltip": !1
|
|
2136
2208
|
}, null, 8, ["selectable"])) : C("", !0),
|
|
2137
|
-
|
|
2138
|
-
conf:
|
|
2139
|
-
columnList:
|
|
2140
|
-
option:
|
|
2141
|
-
},
|
|
2142
|
-
L(
|
|
2143
|
-
name:
|
|
2144
|
-
fn:
|
|
2145
|
-
k(
|
|
2209
|
+
z(qe, {
|
|
2210
|
+
conf: a(l),
|
|
2211
|
+
columnList: a(l).table.column.list,
|
|
2212
|
+
option: r.option
|
|
2213
|
+
}, te({ _: 2 }, [
|
|
2214
|
+
L(p.$slots, (n, d) => ({
|
|
2215
|
+
name: d,
|
|
2216
|
+
fn: m((V) => [
|
|
2217
|
+
k(p.$slots, d, Ce(ve(V || {})))
|
|
2146
2218
|
])
|
|
2147
2219
|
}))
|
|
2148
2220
|
]), 1032, ["conf", "columnList", "option"]),
|
|
2149
|
-
|
|
2221
|
+
a(i)(r.option.table?.add) || a(i)(r.option.table?.update) || a(i)(r.option.table?.delete) || a(i)(r.option.table?.view) || p.$slots["table-op-left"] || p.$slots["table-op-right"] ? (f(), h(a(ee), v({
|
|
2150
2222
|
key: 1,
|
|
2151
|
-
width:
|
|
2223
|
+
width: a(l).table.op.width(a(i)(r.option.table?.add), a(i)(r.option.table?.update), a(i)(r.option.table?.delete), a(i)(r.option.table?.view), p.$slots["table-op-left"], p.$slots["table-op-right"]),
|
|
2152
2224
|
align: "center",
|
|
2153
2225
|
fixed: "right"
|
|
2154
|
-
},
|
|
2155
|
-
header:
|
|
2156
|
-
k(
|
|
2157
|
-
E(
|
|
2226
|
+
}, r.option.table?.operate), {
|
|
2227
|
+
header: m(() => [
|
|
2228
|
+
k(p.$slots, "table-header-op", {}, () => [
|
|
2229
|
+
E(T(a(b).tCurd("operation")), 1)
|
|
2158
2230
|
])
|
|
2159
2231
|
]),
|
|
2160
|
-
default:
|
|
2161
|
-
|
|
2162
|
-
size:
|
|
2232
|
+
default: m(({ row: n }) => [
|
|
2233
|
+
z(a(N), {
|
|
2234
|
+
size: r.option.size?.table
|
|
2163
2235
|
}, {
|
|
2164
|
-
default:
|
|
2165
|
-
k(
|
|
2166
|
-
|
|
2167
|
-
|
|
2236
|
+
default: m(() => [
|
|
2237
|
+
k(p.$slots, "table-op-left", { row: n }),
|
|
2238
|
+
r.option.table?.inlineEdit && a(l).inlineEdit.data === n ? (f(), y($, { key: 0 }, [
|
|
2239
|
+
z(a(A), {
|
|
2168
2240
|
link: "",
|
|
2169
2241
|
type: "info",
|
|
2170
|
-
onClick:
|
|
2242
|
+
onClick: a(l).inlineEdit.close
|
|
2171
2243
|
}, {
|
|
2172
|
-
default:
|
|
2173
|
-
E(
|
|
2244
|
+
default: m(() => [
|
|
2245
|
+
E(T(a(b).tCurd("cancel")), 1)
|
|
2174
2246
|
]),
|
|
2175
2247
|
_: 1
|
|
2176
2248
|
}, 8, ["onClick"]),
|
|
2177
|
-
|
|
2249
|
+
z(a(A), {
|
|
2178
2250
|
link: "",
|
|
2179
2251
|
type: "primary",
|
|
2180
|
-
onClick:
|
|
2181
|
-
loading:
|
|
2252
|
+
onClick: a(l).update.submit,
|
|
2253
|
+
loading: a(l).update.loading
|
|
2182
2254
|
}, {
|
|
2183
|
-
default:
|
|
2184
|
-
E(
|
|
2255
|
+
default: m(() => [
|
|
2256
|
+
E(T(a(b).tCurd("confirm")), 1)
|
|
2185
2257
|
]),
|
|
2186
2258
|
_: 1
|
|
2187
2259
|
}, 8, ["onClick", "loading"]),
|
|
2188
|
-
k(
|
|
2189
|
-
], 64)) : (f(),
|
|
2190
|
-
|
|
2260
|
+
k(p.$slots, "table-op-edit-right", { row: n })
|
|
2261
|
+
], 64)) : (f(), y($, { key: 1 }, [
|
|
2262
|
+
a(i)(r.option.table?.add, n) ? (f(), h(a(A), {
|
|
2191
2263
|
key: 0,
|
|
2192
2264
|
link: "",
|
|
2193
2265
|
type: "primary",
|
|
2194
|
-
onClick: (
|
|
2266
|
+
onClick: (d) => a(l).update.open(a(u).Add, n)
|
|
2195
2267
|
}, {
|
|
2196
|
-
default:
|
|
2197
|
-
E(
|
|
2268
|
+
default: m(() => [
|
|
2269
|
+
E(T(a(b).tCurd("add")), 1)
|
|
2198
2270
|
]),
|
|
2199
2271
|
_: 2
|
|
2200
2272
|
}, 1032, ["onClick"])) : C("", !0),
|
|
2201
|
-
|
|
2273
|
+
a(i)(r.option.table?.view, n) ? (f(), h(a(A), {
|
|
2202
2274
|
key: 1,
|
|
2203
2275
|
link: "",
|
|
2204
2276
|
type: "primary",
|
|
2205
|
-
onClick: (
|
|
2277
|
+
onClick: (d) => a(l).update.open(a(u).View, n)
|
|
2206
2278
|
}, {
|
|
2207
|
-
default:
|
|
2208
|
-
E(
|
|
2279
|
+
default: m(() => [
|
|
2280
|
+
E(T(a(b).tCurd("view")), 1)
|
|
2209
2281
|
]),
|
|
2210
2282
|
_: 2
|
|
2211
2283
|
}, 1032, ["onClick"])) : C("", !0),
|
|
2212
|
-
|
|
2284
|
+
a(i)(r.option.table?.update, n) ? (f(), h(a(A), {
|
|
2213
2285
|
key: 2,
|
|
2214
2286
|
link: "",
|
|
2215
2287
|
type: "warning",
|
|
2216
|
-
onClick: (
|
|
2288
|
+
onClick: (d) => a(l).update.open(a(u).Update, n)
|
|
2217
2289
|
}, {
|
|
2218
|
-
default:
|
|
2219
|
-
E(
|
|
2290
|
+
default: m(() => [
|
|
2291
|
+
E(T(a(b).tCurd("edit")), 1)
|
|
2220
2292
|
]),
|
|
2221
2293
|
_: 2
|
|
2222
2294
|
}, 1032, ["onClick"])) : C("", !0),
|
|
2223
|
-
|
|
2295
|
+
a(i)(r.option.table?.delete, n) ? (f(), h(a(A), {
|
|
2224
2296
|
key: 3,
|
|
2225
2297
|
link: "",
|
|
2226
2298
|
type: "danger",
|
|
2227
|
-
onClick: (
|
|
2299
|
+
onClick: (d) => a(l).remove.open([n])
|
|
2228
2300
|
}, {
|
|
2229
|
-
default:
|
|
2230
|
-
E(
|
|
2301
|
+
default: m(() => [
|
|
2302
|
+
E(T(a(b).tCurd("delete")), 1)
|
|
2231
2303
|
]),
|
|
2232
2304
|
_: 2
|
|
2233
2305
|
}, 1032, ["onClick"])) : C("", !0),
|
|
2234
|
-
k(
|
|
2306
|
+
k(p.$slots, "table-op-right", { row: n })
|
|
2235
2307
|
], 64))
|
|
2236
2308
|
]),
|
|
2237
2309
|
_: 2
|
|
@@ -2242,58 +2314,58 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2242
2314
|
]),
|
|
2243
2315
|
_: 3
|
|
2244
2316
|
}, 16, ["data", "border", "onSelectionChange", "onSortChange", "expand-row-keys", "onExpandChange"])), [
|
|
2245
|
-
[
|
|
2317
|
+
[g, a(l).table.loading]
|
|
2246
2318
|
])
|
|
2247
2319
|
], 2)
|
|
2248
2320
|
], 2),
|
|
2249
|
-
O("div",
|
|
2250
|
-
(
|
|
2321
|
+
O("div", it, [
|
|
2322
|
+
(r.option.page?.show === void 0 || r.option.page?.show) && !a(l).page.showTools ? (f(), h(a(ie), v({
|
|
2251
2323
|
key: 0,
|
|
2252
|
-
"current-page":
|
|
2253
|
-
"onUpdate:currentPage":
|
|
2254
|
-
"page-size":
|
|
2255
|
-
"onUpdate:pageSize":
|
|
2324
|
+
"current-page": a(l).page.num,
|
|
2325
|
+
"onUpdate:currentPage": c[6] || (c[6] = (n) => a(l).page.num = n),
|
|
2326
|
+
"page-size": a(l).page.size,
|
|
2327
|
+
"onUpdate:pageSize": c[7] || (c[7] = (n) => a(l).page.size = n),
|
|
2256
2328
|
background: "",
|
|
2257
|
-
"page-sizes":
|
|
2258
|
-
"pager-count":
|
|
2259
|
-
layout:
|
|
2260
|
-
total:
|
|
2261
|
-
size:
|
|
2262
|
-
onSizeChange:
|
|
2263
|
-
onCurrentChange:
|
|
2264
|
-
},
|
|
2329
|
+
"page-sizes": a(l).page.sizeList,
|
|
2330
|
+
"pager-count": a(l).page.pagerCount,
|
|
2331
|
+
layout: a(l).page.layout,
|
|
2332
|
+
total: a(l).page.total,
|
|
2333
|
+
size: r.option.size?.table,
|
|
2334
|
+
onSizeChange: a(l).table.getList,
|
|
2335
|
+
onCurrentChange: a(l).table.getList
|
|
2336
|
+
}, r.option.page?.pagination || {}, S(r.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : C("", !0)
|
|
2265
2337
|
])
|
|
2266
2338
|
], 2),
|
|
2267
|
-
k(
|
|
2339
|
+
k(p.$slots, "box-right")
|
|
2268
2340
|
], 2),
|
|
2269
|
-
|
|
2270
|
-
modelValue:
|
|
2271
|
-
"onUpdate:modelValue":
|
|
2272
|
-
title:
|
|
2273
|
-
"before-close":
|
|
2274
|
-
},
|
|
2275
|
-
footer:
|
|
2276
|
-
O("span",
|
|
2277
|
-
|
|
2278
|
-
size:
|
|
2341
|
+
z(a(_), v({
|
|
2342
|
+
modelValue: a(l).update.show,
|
|
2343
|
+
"onUpdate:modelValue": c[8] || (c[8] = (n) => a(l).update.show = n),
|
|
2344
|
+
title: a(l).update.title,
|
|
2345
|
+
"before-close": a(l).update.close
|
|
2346
|
+
}, r.option.dialog), {
|
|
2347
|
+
footer: m(() => [
|
|
2348
|
+
O("span", rt, [
|
|
2349
|
+
z(a(N), {
|
|
2350
|
+
size: r.option.size?.form
|
|
2279
2351
|
}, {
|
|
2280
|
-
default:
|
|
2281
|
-
|
|
2282
|
-
onClick:
|
|
2352
|
+
default: m(() => [
|
|
2353
|
+
z(a(A), {
|
|
2354
|
+
onClick: a(l).update.close
|
|
2283
2355
|
}, {
|
|
2284
|
-
default:
|
|
2285
|
-
E(
|
|
2356
|
+
default: m(() => [
|
|
2357
|
+
E(T(a(b).tCurd("close")), 1)
|
|
2286
2358
|
]),
|
|
2287
2359
|
_: 1
|
|
2288
2360
|
}, 8, ["onClick"]),
|
|
2289
|
-
|
|
2361
|
+
a(l).update.type !== a(u).View ? (f(), h(a(A), {
|
|
2290
2362
|
key: 0,
|
|
2291
2363
|
type: "primary",
|
|
2292
|
-
onClick:
|
|
2293
|
-
loading:
|
|
2364
|
+
onClick: a(l).update.submit,
|
|
2365
|
+
loading: a(l).update.loading
|
|
2294
2366
|
}, {
|
|
2295
|
-
default:
|
|
2296
|
-
E(
|
|
2367
|
+
default: m(() => [
|
|
2368
|
+
E(T(a(b).tCurd("submit")), 1)
|
|
2297
2369
|
]),
|
|
2298
2370
|
_: 1
|
|
2299
2371
|
}, 8, ["onClick", "loading"])) : C("", !0)
|
|
@@ -2302,55 +2374,55 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2302
2374
|
}, 8, ["size"])
|
|
2303
2375
|
])
|
|
2304
2376
|
]),
|
|
2305
|
-
default:
|
|
2306
|
-
|
|
2377
|
+
default: m(() => [
|
|
2378
|
+
z(a(N), {
|
|
2307
2379
|
ref_key: "ruleFormRef",
|
|
2308
|
-
ref:
|
|
2309
|
-
model:
|
|
2310
|
-
rules:
|
|
2311
|
-
size:
|
|
2380
|
+
ref: s,
|
|
2381
|
+
model: a(l).update.form,
|
|
2382
|
+
rules: a(l).update.rules,
|
|
2383
|
+
size: r.option.size?.form
|
|
2312
2384
|
}, {
|
|
2313
|
-
default:
|
|
2314
|
-
|
|
2315
|
-
|
|
2385
|
+
default: m(() => [
|
|
2386
|
+
a(l).update.showContent ? (f(!0), y($, { key: 0 }, L(a(l).update.formColumn, (n) => (f(), y($, null, [
|
|
2387
|
+
a(i)(
|
|
2316
2388
|
(() => {
|
|
2317
|
-
const
|
|
2318
|
-
|
|
2389
|
+
const d = [], V = (w) => {
|
|
2390
|
+
w?.item?.children ? V(w.item.children) : d.push(...w.map((F) => F.item?.show?.form));
|
|
2319
2391
|
};
|
|
2320
|
-
return
|
|
2392
|
+
return V(n), d;
|
|
2321
2393
|
})(),
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
) ? (f(),
|
|
2394
|
+
a(l).update.form,
|
|
2395
|
+
a(l).update.type
|
|
2396
|
+
) ? (f(), y("div", {
|
|
2325
2397
|
key: 0,
|
|
2326
|
-
class:
|
|
2327
|
-
stripe:
|
|
2398
|
+
class: j(["row curd-row", {
|
|
2399
|
+
stripe: r.option.form?.stripe === void 0 ? !0 : r.option.form?.stripe
|
|
2328
2400
|
}])
|
|
2329
2401
|
}, [
|
|
2330
|
-
k(
|
|
2331
|
-
row:
|
|
2402
|
+
k(p.$slots, "form-start", {
|
|
2403
|
+
row: a(l).update.form
|
|
2332
2404
|
}),
|
|
2333
|
-
(f(!0),
|
|
2334
|
-
|
|
2405
|
+
(f(!0), y($, null, L(n, (d) => (f(), y($, null, [
|
|
2406
|
+
a(i)(d.item.show?.form, a(l).update.form, a(l).update.type) ? (f(), y("div", {
|
|
2335
2407
|
key: 0,
|
|
2336
|
-
class:
|
|
2408
|
+
class: j([d.item.form.span > 0 ? `col-${a(l).getColumnSpan(d, n)}` : "col", `form-item-col-${d.item.key}`])
|
|
2337
2409
|
}, [
|
|
2338
|
-
(f(!0),
|
|
2339
|
-
key:
|
|
2340
|
-
conf:
|
|
2341
|
-
item:
|
|
2342
|
-
},
|
|
2343
|
-
L(
|
|
2344
|
-
name:
|
|
2345
|
-
fn:
|
|
2346
|
-
k(
|
|
2410
|
+
(f(!0), y($, null, L(d.item.children ? d.children : [d], (V) => (f(), h(Ze, {
|
|
2411
|
+
key: V.item.key,
|
|
2412
|
+
conf: a(l),
|
|
2413
|
+
item: V
|
|
2414
|
+
}, te({ _: 2 }, [
|
|
2415
|
+
L(p.$slots, (w, F) => ({
|
|
2416
|
+
name: F,
|
|
2417
|
+
fn: m((B) => [
|
|
2418
|
+
k(p.$slots, F, v({ ref_for: !0 }, B || {}))
|
|
2347
2419
|
])
|
|
2348
2420
|
}))
|
|
2349
2421
|
]), 1032, ["conf", "item"]))), 128))
|
|
2350
2422
|
], 2)) : C("", !0)
|
|
2351
2423
|
], 64))), 256)),
|
|
2352
|
-
k(
|
|
2353
|
-
row:
|
|
2424
|
+
k(p.$slots, "form-end", {
|
|
2425
|
+
row: a(l).update.form
|
|
2354
2426
|
})
|
|
2355
2427
|
], 2)) : C("", !0)
|
|
2356
2428
|
], 64))), 256)) : C("", !0)
|
|
@@ -2360,33 +2432,33 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2360
2432
|
]),
|
|
2361
2433
|
_: 3
|
|
2362
2434
|
}, 16, ["modelValue", "title", "before-close"]),
|
|
2363
|
-
|
|
2364
|
-
modelValue:
|
|
2365
|
-
"onUpdate:modelValue":
|
|
2366
|
-
title:
|
|
2435
|
+
z(a(_), {
|
|
2436
|
+
modelValue: a(l).remove.show,
|
|
2437
|
+
"onUpdate:modelValue": c[9] || (c[9] = (n) => a(l).remove.show = n),
|
|
2438
|
+
title: a(l).remove.title,
|
|
2367
2439
|
"close-on-click-modal": !1
|
|
2368
2440
|
}, {
|
|
2369
|
-
footer:
|
|
2370
|
-
O("span",
|
|
2371
|
-
|
|
2372
|
-
size:
|
|
2441
|
+
footer: m(() => [
|
|
2442
|
+
O("span", st, [
|
|
2443
|
+
z(a(N), {
|
|
2444
|
+
size: r.option.size?.form
|
|
2373
2445
|
}, {
|
|
2374
|
-
default:
|
|
2375
|
-
|
|
2376
|
-
onClick:
|
|
2446
|
+
default: m(() => [
|
|
2447
|
+
z(a(A), {
|
|
2448
|
+
onClick: a(l).remove.close
|
|
2377
2449
|
}, {
|
|
2378
|
-
default:
|
|
2379
|
-
E(
|
|
2450
|
+
default: m(() => [
|
|
2451
|
+
E(T(a(b).tCurd("close")), 1)
|
|
2380
2452
|
]),
|
|
2381
2453
|
_: 1
|
|
2382
2454
|
}, 8, ["onClick"]),
|
|
2383
|
-
|
|
2455
|
+
z(a(A), {
|
|
2384
2456
|
type: "danger",
|
|
2385
|
-
onClick:
|
|
2386
|
-
loading:
|
|
2457
|
+
onClick: a(l).remove.submit,
|
|
2458
|
+
loading: a(l).remove.loading
|
|
2387
2459
|
}, {
|
|
2388
|
-
default:
|
|
2389
|
-
E(
|
|
2460
|
+
default: m(() => [
|
|
2461
|
+
E(T(a(b).tCurd("confirmDelete")), 1)
|
|
2390
2462
|
]),
|
|
2391
2463
|
_: 1
|
|
2392
2464
|
}, 8, ["onClick", "loading"])
|
|
@@ -2395,85 +2467,85 @@ const Ke = /* @__PURE__ */ re(Re, [["render", Ae]]), Ne = { class: "row flex-cen
|
|
|
2395
2467
|
}, 8, ["size"])
|
|
2396
2468
|
])
|
|
2397
2469
|
]),
|
|
2398
|
-
default:
|
|
2399
|
-
O("div", null,
|
|
2470
|
+
default: m(() => [
|
|
2471
|
+
O("div", null, T(a(b).tCurd("confirmDeleteMessage", a(l).remove.items.length)), 1)
|
|
2400
2472
|
]),
|
|
2401
2473
|
_: 1
|
|
2402
2474
|
}, 8, ["modelValue", "title"]),
|
|
2403
|
-
|
|
2475
|
+
z(Le, {
|
|
2404
2476
|
ref_key: "switchConfirmRef",
|
|
2405
|
-
ref:
|
|
2406
|
-
size:
|
|
2477
|
+
ref: e,
|
|
2478
|
+
size: r.option.size?.form
|
|
2407
2479
|
}, null, 8, ["size"])
|
|
2408
2480
|
], 2);
|
|
2409
2481
|
};
|
|
2410
2482
|
}
|
|
2411
2483
|
});
|
|
2412
|
-
class
|
|
2484
|
+
class mt {
|
|
2413
2485
|
/**
|
|
2414
2486
|
* 通过远程 URL 下载文件,自动创建临时 `<a>` 标签触发浏览器下载
|
|
2415
2487
|
*
|
|
2416
2488
|
* @param href - 文件的远程地址
|
|
2417
2489
|
* @param name - 下载后的文件名,默认 `'download.png'`
|
|
2418
2490
|
*/
|
|
2419
|
-
static async download(
|
|
2420
|
-
const
|
|
2421
|
-
|
|
2491
|
+
static async download(o, u = "download.png") {
|
|
2492
|
+
const t = document.createElement("a");
|
|
2493
|
+
t.style.display = "none", t.href = o, t.setAttribute("download", u), typeof t.download > "u" && t.setAttribute("target", "_blank"), document.body.appendChild(t), t.click(), document.body.removeChild(t), window.URL.revokeObjectURL(o);
|
|
2422
2494
|
}
|
|
2423
2495
|
/**
|
|
2424
2496
|
* 将json对象或者json数组导出为json文件保存
|
|
2425
2497
|
* @param data
|
|
2426
2498
|
* @param name
|
|
2427
2499
|
*/
|
|
2428
|
-
static exportJSONFile = (
|
|
2429
|
-
const
|
|
2430
|
-
|
|
2500
|
+
static exportJSONFile = (o, u) => {
|
|
2501
|
+
const t = new Blob([JSON.stringify(o)], { type: "application/json" }), i = URL.createObjectURL(t), l = document.createElement("a");
|
|
2502
|
+
l.href = i, l.download = `${u || "config"}.json`, l.click();
|
|
2431
2503
|
};
|
|
2432
2504
|
/**
|
|
2433
2505
|
* 导入文件内容,默认为json
|
|
2434
2506
|
* @param param
|
|
2435
2507
|
* @returns
|
|
2436
2508
|
*/
|
|
2437
|
-
static importFile = async (
|
|
2509
|
+
static importFile = async (o) => new Promise((u, t) => {
|
|
2438
2510
|
const i = document.createElement("input");
|
|
2439
2511
|
i.type = "file";
|
|
2440
|
-
const
|
|
2441
|
-
i.accept =
|
|
2442
|
-
const
|
|
2443
|
-
if (!
|
|
2444
|
-
|
|
2512
|
+
const l = o?.accept || ".json";
|
|
2513
|
+
i.accept = l, i.style.display = "none", i.onchange = (e) => {
|
|
2514
|
+
const s = e.target.files[0];
|
|
2515
|
+
if (!s) {
|
|
2516
|
+
U.fail("未选择文件"), t("未选择文件");
|
|
2445
2517
|
return;
|
|
2446
2518
|
}
|
|
2447
|
-
const
|
|
2448
|
-
|
|
2449
|
-
const
|
|
2450
|
-
|
|
2451
|
-
},
|
|
2452
|
-
|
|
2453
|
-
},
|
|
2519
|
+
const p = new FileReader();
|
|
2520
|
+
p.onload = async (c) => {
|
|
2521
|
+
const g = l == ".json" ? JSON.parse(c.target.result) : c.target.result;
|
|
2522
|
+
u(g);
|
|
2523
|
+
}, p.onerror = () => {
|
|
2524
|
+
U.fail("文件读取失败"), t("文件读取失败");
|
|
2525
|
+
}, p.readAsText(s), document.body.removeChild(i);
|
|
2454
2526
|
}, document.body.appendChild(i), i.click();
|
|
2455
2527
|
});
|
|
2456
2528
|
}
|
|
2457
|
-
const
|
|
2458
|
-
if (
|
|
2459
|
-
|
|
2460
|
-
for (const
|
|
2461
|
-
|
|
2529
|
+
const ut = (r, o) => {
|
|
2530
|
+
if (r.component("TCurd", dt), r.component("TFormList", ne), r.component("TColumn", Ue), o?.customComponent) {
|
|
2531
|
+
M.customComponent = o.customComponent;
|
|
2532
|
+
for (const u in o.customComponent)
|
|
2533
|
+
r.component(u, o.customComponent[u]);
|
|
2462
2534
|
}
|
|
2463
|
-
},
|
|
2464
|
-
install:
|
|
2535
|
+
}, ht = {
|
|
2536
|
+
install: ut
|
|
2465
2537
|
};
|
|
2466
2538
|
export {
|
|
2467
2539
|
P as ArrUtil,
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2540
|
+
Fe as ExcelUtil,
|
|
2541
|
+
Ue as TColumn,
|
|
2542
|
+
dt as TCurd,
|
|
2543
|
+
mt as TFile,
|
|
2544
|
+
M as TForm,
|
|
2545
|
+
D as TFormConfig,
|
|
2546
|
+
b as TFormI18n,
|
|
2547
|
+
ne as TFormList,
|
|
2548
|
+
U as TSys,
|
|
2549
|
+
ht as default,
|
|
2550
|
+
ut as install
|
|
2479
2551
|
};
|