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