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