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