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