cc1-form 1.2.22 → 1.2.24
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 +1190 -1174
- package/dist/cc1-form.umd.cjs +1 -1
- package/dist/components/TCurd/index.d.ts +5 -0
- package/dist/components/TCurd/index.vue.d.ts +10 -0
- package/package.json +1 -1
package/dist/cc1-form.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ElMessage as
|
|
1
|
+
import { ElMessage as xe, ElLoading as ze, ElForm as Q, ElFormItem as le, ElInput as ee, ElSwitch as Z, ElSelect as X, ElOption as W, ElRadioGroup as de, ElRadio as se, ElTreeSelect as pe, ElDatePicker as ue, ElDialog as ie, ElButton as T, ElTableColumn as ae, ElDropdown as $e, ElDropdownMenu as Oe, ElDropdownItem as ne, ElPagination as me, ElTable as De } from "element-plus";
|
|
2
2
|
import "vue-router";
|
|
3
|
-
import { defineComponent as
|
|
4
|
-
|
|
3
|
+
import { defineComponent as K, reactive as ce, onMounted as ye, resolveComponent as te, openBlock as d, createElementBlock as b, renderSlot as x, createVNode as E, withCtx as g, createTextVNode as O, createCommentVNode as C, Fragment as $, renderList as A, createBlock as y, normalizeClass as R, normalizeStyle as ge, ref as J, watch as re, unref as l, createElementVNode as U, mergeProps as V, toHandlers as z, resolveDynamicComponent as q, toDisplayString as S, computed as be, getCurrentInstance as Ee, createSlots as G, withModifiers as Ue, resolveDirective as Se, withDirectives as Me, normalizeProps as Fe, guardReactiveProps as Ae } from "vue";
|
|
4
|
+
import { Scope as we } from "cc1-vue3";
|
|
5
|
+
class D {
|
|
5
6
|
/**
|
|
6
7
|
* Vue Router 实例,需在应用初始化时赋值
|
|
7
8
|
*/
|
|
@@ -26,13 +27,13 @@ class O {
|
|
|
26
27
|
* @param data 数据
|
|
27
28
|
* @returns 是否显示
|
|
28
29
|
*/
|
|
29
|
-
static isFun = (
|
|
30
|
+
static isFun = (r, ...s) => Array.isArray(r) ? r.some((c) => typeof c == "function" ? c(...s) : c) : typeof r == "function" ? r(...s) : r;
|
|
30
31
|
/**
|
|
31
32
|
* 获取路由参数,自动获取query、params中的参数, 哪个有就返回哪个
|
|
32
33
|
*/
|
|
33
34
|
static getRouterParams = () => {
|
|
34
|
-
const
|
|
35
|
-
return Object.keys(
|
|
35
|
+
const r = this.router.currentRoute.value.query || {}, s = this.router.currentRoute.value.params || {};
|
|
36
|
+
return Object.keys(r).length ? r : Object.keys(s).length ? s : {};
|
|
36
37
|
};
|
|
37
38
|
/**
|
|
38
39
|
* 模块赋值
|
|
@@ -42,11 +43,11 @@ class O {
|
|
|
42
43
|
* 加载模块
|
|
43
44
|
* @param module
|
|
44
45
|
*/
|
|
45
|
-
static loadModule = async (
|
|
46
|
-
if (!
|
|
47
|
-
throw new Error(`模块${
|
|
48
|
-
const
|
|
49
|
-
return
|
|
46
|
+
static loadModule = async (r) => {
|
|
47
|
+
if (!D.moduleObj[r])
|
|
48
|
+
throw new Error(`模块${r}未加载,请赋值如:TSys.moduleObj = { ${r}: ()=>import('${r}') }`);
|
|
49
|
+
const s = await D.moduleObj[r]();
|
|
50
|
+
return s.default ?? s;
|
|
50
51
|
};
|
|
51
52
|
/**
|
|
52
53
|
* 提示信息对象管理
|
|
@@ -62,19 +63,19 @@ class O {
|
|
|
62
63
|
* @param type 消息类型
|
|
63
64
|
* @param options 其他选项
|
|
64
65
|
*/
|
|
65
|
-
static showMessage(
|
|
66
|
-
const
|
|
67
|
-
if (!this.tipMessages[
|
|
68
|
-
this.tipMessages[
|
|
66
|
+
static showMessage(r, s, c = {}) {
|
|
67
|
+
const o = Date.now();
|
|
68
|
+
if (!this.tipMessages[r] || o - this.tipMessages[r] > this.tipMessagesGap) {
|
|
69
|
+
this.tipMessages[r] = o;
|
|
69
70
|
const t = Object.assign(
|
|
70
71
|
{
|
|
71
|
-
message:
|
|
72
|
-
type:
|
|
72
|
+
message: r,
|
|
73
|
+
type: s
|
|
73
74
|
},
|
|
74
|
-
|
|
75
|
+
c
|
|
75
76
|
);
|
|
76
|
-
|
|
77
|
-
delete this.tipMessages[
|
|
77
|
+
xe(t), setTimeout(() => {
|
|
78
|
+
delete this.tipMessages[r];
|
|
78
79
|
}, this.tipMessagesGap);
|
|
79
80
|
}
|
|
80
81
|
}
|
|
@@ -83,16 +84,16 @@ class O {
|
|
|
83
84
|
* @param content
|
|
84
85
|
* @param options
|
|
85
86
|
*/
|
|
86
|
-
static fail = (
|
|
87
|
-
this.showMessage(
|
|
87
|
+
static fail = (r, s = {}) => {
|
|
88
|
+
this.showMessage(r, "error", s);
|
|
88
89
|
};
|
|
89
90
|
/**
|
|
90
91
|
* 成功提示
|
|
91
92
|
* @param content
|
|
92
93
|
* @param options
|
|
93
94
|
*/
|
|
94
|
-
static success = (
|
|
95
|
-
this.showMessage(
|
|
95
|
+
static success = (r, s = {}) => {
|
|
96
|
+
this.showMessage(r, "success", s);
|
|
96
97
|
};
|
|
97
98
|
static loadingObj = null;
|
|
98
99
|
static loadingTimer = null;
|
|
@@ -101,11 +102,11 @@ class O {
|
|
|
101
102
|
* @param show
|
|
102
103
|
* @param text
|
|
103
104
|
*/
|
|
104
|
-
static loading = (
|
|
105
|
+
static loading = (r = !0, s = "Loading...") => {
|
|
105
106
|
Timer.un(this.loadingTimer), this.loadingTimer = Timer.once(() => {
|
|
106
|
-
|
|
107
|
+
r ? this.loadingObj = ze.service({
|
|
107
108
|
lock: !0,
|
|
108
|
-
text:
|
|
109
|
+
text: s,
|
|
109
110
|
background: "rgba(0, 0, 0, 0.3)"
|
|
110
111
|
}) : this.loadingObj && (this.loadingObj.close(), this.loadingObj = null);
|
|
111
112
|
}, 50);
|
|
@@ -115,46 +116,46 @@ class O {
|
|
|
115
116
|
* @param url 地址
|
|
116
117
|
* @param isCenter 是否居中
|
|
117
118
|
*/
|
|
118
|
-
static openUrl = (
|
|
119
|
-
if (
|
|
120
|
-
let
|
|
119
|
+
static openUrl = (r, s = !0) => {
|
|
120
|
+
if (s) {
|
|
121
|
+
let c = screen.width / 2 - 500, o = screen.height / 2 - 800 / 2 - 30;
|
|
121
122
|
window.open(
|
|
122
|
-
|
|
123
|
+
r,
|
|
123
124
|
"_blank",
|
|
124
|
-
"toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" +
|
|
125
|
+
"toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + o + ", left=" + c
|
|
125
126
|
);
|
|
126
127
|
} else
|
|
127
|
-
window.open(
|
|
128
|
+
window.open(r, "DescriptiveWindowName" + StrUtil.getId(), "resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0");
|
|
128
129
|
};
|
|
129
130
|
/**
|
|
130
131
|
* 根据dom id截图并返回图片数据
|
|
131
132
|
* @param param
|
|
132
133
|
* @returns
|
|
133
134
|
*/
|
|
134
|
-
static getImgPic = (
|
|
135
|
-
let
|
|
136
|
-
const t = await
|
|
135
|
+
static getImgPic = (r) => new Promise(async (s, c) => {
|
|
136
|
+
let o = document.getElementById(r.id);
|
|
137
|
+
const t = await D.loadModule("html2canvas");
|
|
137
138
|
try {
|
|
138
|
-
t(
|
|
139
|
+
t(o, {
|
|
139
140
|
logging: !1,
|
|
140
141
|
allowTaint: !0,
|
|
141
142
|
scale: window.devicePixelRatio,
|
|
142
|
-
width:
|
|
143
|
-
height:
|
|
144
|
-
windowWidth:
|
|
145
|
-
windowHeight:
|
|
143
|
+
width: r.windowWidth,
|
|
144
|
+
height: r.windowHeight,
|
|
145
|
+
windowWidth: r.windowWidth,
|
|
146
|
+
windowHeight: r.windowHeight,
|
|
146
147
|
useCORS: !0,
|
|
147
148
|
backgroundColor: "#ffffff00"
|
|
148
|
-
}).then(function(
|
|
149
|
-
let
|
|
150
|
-
|
|
149
|
+
}).then(function(n) {
|
|
150
|
+
let a = n.toDataURL("image/png");
|
|
151
|
+
s(a);
|
|
151
152
|
});
|
|
152
|
-
} catch (
|
|
153
|
-
n
|
|
153
|
+
} catch (n) {
|
|
154
|
+
c(n);
|
|
154
155
|
}
|
|
155
156
|
});
|
|
156
157
|
}
|
|
157
|
-
class
|
|
158
|
+
class M {
|
|
158
159
|
/**
|
|
159
160
|
* 全局配置对象
|
|
160
161
|
*/
|
|
@@ -515,11 +516,11 @@ class F {
|
|
|
515
516
|
*
|
|
516
517
|
* @param config - 需要覆盖的配置项(深度 Partial)
|
|
517
518
|
*/
|
|
518
|
-
static setConfig = (
|
|
519
|
-
|
|
519
|
+
static setConfig = (r) => {
|
|
520
|
+
M.config = ObjectUtil.deepMerge(M.config, r);
|
|
520
521
|
};
|
|
521
522
|
}
|
|
522
|
-
class
|
|
523
|
+
class j {
|
|
523
524
|
/**
|
|
524
525
|
* 自定义组件映射表,key 为组件名(同时作为 column.type 值),value 为 Vue 组件定义
|
|
525
526
|
*
|
|
@@ -537,10 +538,10 @@ class L {
|
|
|
537
538
|
* @param field - 字段的 key 值
|
|
538
539
|
* @returns 该字段对应类型的 options 配置,如 select 类型返回 `options.select`
|
|
539
540
|
*/
|
|
540
|
-
static findOptions = (
|
|
541
|
-
const
|
|
542
|
-
if (
|
|
543
|
-
return
|
|
541
|
+
static findOptions = (r, s) => {
|
|
542
|
+
const c = r.column.find((t) => t.key === s), o = (t) => t.replace(/-([a-z])/g, (n, a) => a.toUpperCase());
|
|
543
|
+
if (c)
|
|
544
|
+
return c.options[o(c.type)];
|
|
544
545
|
};
|
|
545
546
|
/**
|
|
546
547
|
* 更新组件数据
|
|
@@ -558,9 +559,9 @@ class L {
|
|
|
558
559
|
}))
|
|
559
560
|
)
|
|
560
561
|
*/
|
|
561
|
-
static setOptionsData = (
|
|
562
|
-
const
|
|
563
|
-
|
|
562
|
+
static setOptionsData = (r, s, c) => {
|
|
563
|
+
const o = j.findOptions(r, s);
|
|
564
|
+
o && (o.data = c);
|
|
564
565
|
};
|
|
565
566
|
static form = {
|
|
566
567
|
openBefore: {
|
|
@@ -571,9 +572,9 @@ class L {
|
|
|
571
572
|
* @param treeData 树形数据
|
|
572
573
|
* @param option 组件配置
|
|
573
574
|
*/
|
|
574
|
-
parentId: (
|
|
575
|
-
const t =
|
|
576
|
-
|
|
575
|
+
parentId: (r, s, c, o) => {
|
|
576
|
+
const t = M.config.table.rowKey;
|
|
577
|
+
r ? s.type === D.EDialog.Add ? (s.form.parentId = r[t], s.form.sort = r.children.length + 1) : s.form.parentId = r.parentId.substring(r.parentId.lastIndexOf(",") + 1) : (s.form.parentId = "0", s.form.sort = c.length + 1), j.setOptionsData(o, "parentId", [{ [t]: "0", title: "根", children: c }]);
|
|
577
578
|
}
|
|
578
579
|
}
|
|
579
580
|
};
|
|
@@ -602,7 +603,7 @@ const Te = {
|
|
|
602
603
|
confirmDeleteMessage: "确认要删除【{count}】条数据吗?",
|
|
603
604
|
placeholderInput: "请输入",
|
|
604
605
|
placeholderSelect: "请选择",
|
|
605
|
-
checkFormData: "
|
|
606
|
+
checkFormData: "部分内容未输入或输入错误,请检查",
|
|
606
607
|
selectDataToDelete: "请选择要删除的数据",
|
|
607
608
|
selectDataToExport: "请选择要导出的数据",
|
|
608
609
|
noData: "暂无数据",
|
|
@@ -614,26 +615,26 @@ const Te = {
|
|
|
614
615
|
mergeColumn: "合并栏位",
|
|
615
616
|
expandColumn: "展开栏位"
|
|
616
617
|
};
|
|
617
|
-
class
|
|
618
|
+
class v {
|
|
618
619
|
/** 解析国际化值:函数则执行并返回字符串,字符串则替换 `{key}` 占位符 */
|
|
619
|
-
static t(
|
|
620
|
-
if (typeof
|
|
621
|
-
return
|
|
622
|
-
|
|
623
|
-
let
|
|
624
|
-
return
|
|
620
|
+
static t(r, ...s) {
|
|
621
|
+
if (typeof r == "function")
|
|
622
|
+
return r(...s);
|
|
623
|
+
r = String(r);
|
|
624
|
+
let c = 0;
|
|
625
|
+
return r.replace(/{([^}]+)}/g, (o, t) => c < s.length ? String(s[c++]) : `{${t}}`);
|
|
625
626
|
}
|
|
626
|
-
static setI18n = (
|
|
627
|
-
|
|
627
|
+
static setI18n = (r) => {
|
|
628
|
+
v.curd = ObjectUtil.deepMerge(v.curd, r);
|
|
628
629
|
};
|
|
629
630
|
/** 解析curd国际化值 */
|
|
630
|
-
static tCurd(
|
|
631
|
-
return this.t(this.curd[
|
|
631
|
+
static tCurd(r, ...s) {
|
|
632
|
+
return this.t(this.curd[r], ...s);
|
|
632
633
|
}
|
|
633
634
|
/** curd表单 */
|
|
634
635
|
static curd = Te;
|
|
635
636
|
}
|
|
636
|
-
class
|
|
637
|
+
class H {
|
|
637
638
|
/**
|
|
638
639
|
* ID 生成函数,默认使用 `StrUtil.uuid()`,可覆盖为自定义实现
|
|
639
640
|
*/
|
|
@@ -643,14 +644,14 @@ class P {
|
|
|
643
644
|
* @param field 字段名
|
|
644
645
|
* @param row 行数据
|
|
645
646
|
*/
|
|
646
|
-
static setId = (
|
|
647
|
-
|
|
648
|
-
const
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
let
|
|
652
|
-
|
|
653
|
-
}), t[
|
|
647
|
+
static setId = (r, s, c) => {
|
|
648
|
+
s[r] || (s[r] = []);
|
|
649
|
+
const o = M.config.table.rowKey;
|
|
650
|
+
s[r].forEach((t) => {
|
|
651
|
+
c.forEach((n) => {
|
|
652
|
+
let a = n.default ?? "";
|
|
653
|
+
n.type === "number" && (a = n.default ?? 0), n.type === "boolean" && (a = n.default ?? !1), n.type === "time" && (a = n.default ?? /* @__PURE__ */ new Date()), t[n.value] === void 0 && (t[n.value] = a);
|
|
654
|
+
}), t[o] || (t[o] = H.getIdFun());
|
|
654
655
|
});
|
|
655
656
|
};
|
|
656
657
|
/**
|
|
@@ -660,19 +661,19 @@ class P {
|
|
|
660
661
|
* @param itemFields 元素字段-如:[{label:'',value:''}]
|
|
661
662
|
* @param callback 回调函数
|
|
662
663
|
*/
|
|
663
|
-
static add = (
|
|
664
|
-
const t = JSONUtil.cp(
|
|
665
|
-
|
|
666
|
-
const
|
|
667
|
-
|
|
664
|
+
static add = (r, s, c, o) => {
|
|
665
|
+
const t = JSONUtil.cp(c);
|
|
666
|
+
H.setId(r, s, c);
|
|
667
|
+
const n = M.config.table.rowKey;
|
|
668
|
+
s[r].push(
|
|
668
669
|
t.reduce(
|
|
669
|
-
(
|
|
670
|
-
let m =
|
|
671
|
-
return
|
|
670
|
+
(a, i) => {
|
|
671
|
+
let m = i.default ?? "";
|
|
672
|
+
return i.type === "number" && (m = i.default ?? 0), i.type === "boolean" && (m = i.default ?? !1), i.type === "time" && (m = i.default ?? /* @__PURE__ */ new Date()), a[i.value] = m, a;
|
|
672
673
|
},
|
|
673
|
-
{ [
|
|
674
|
+
{ [n]: H.getIdFun() }
|
|
674
675
|
)
|
|
675
|
-
),
|
|
676
|
+
), o?.(s);
|
|
676
677
|
};
|
|
677
678
|
/**
|
|
678
679
|
* 删除数组元素
|
|
@@ -681,9 +682,9 @@ class P {
|
|
|
681
682
|
* @param item 元素-如:{_id:''}
|
|
682
683
|
* @param callback 回调函数
|
|
683
684
|
*/
|
|
684
|
-
static remove = (
|
|
685
|
-
const t =
|
|
686
|
-
|
|
685
|
+
static remove = (r, s, c, o) => {
|
|
686
|
+
const t = M.config.table.rowKey;
|
|
687
|
+
s[r] = s[r].filter((n) => n[t] !== c[t]), o?.(s);
|
|
687
688
|
};
|
|
688
689
|
/**
|
|
689
690
|
* 获取没有id的数据
|
|
@@ -691,11 +692,11 @@ class P {
|
|
|
691
692
|
* @param childernField 子级字段-如:list、children
|
|
692
693
|
* @returns 没有id的数据
|
|
693
694
|
*/
|
|
694
|
-
static getNoIdData = (
|
|
695
|
-
const
|
|
696
|
-
return
|
|
697
|
-
t[
|
|
698
|
-
}),
|
|
695
|
+
static getNoIdData = (r, s) => {
|
|
696
|
+
const c = JSONUtil.cp(r), o = M.config.table.rowKey;
|
|
697
|
+
return c.forEach((t) => {
|
|
698
|
+
t[o] && delete t[o], s && t[s] && H.getNoIdData(t[s], s);
|
|
699
|
+
}), c;
|
|
699
700
|
};
|
|
700
701
|
}
|
|
701
702
|
const je = {
|
|
@@ -705,7 +706,7 @@ const je = {
|
|
|
705
706
|
}, Le = { key: 0 }, Be = {
|
|
706
707
|
class: "row items-center",
|
|
707
708
|
style: { gap: "10px", width: "100%" }
|
|
708
|
-
}, Re = { key: 1 },
|
|
709
|
+
}, Re = { key: 1 }, fe = /* @__PURE__ */ K({
|
|
709
710
|
__name: "list",
|
|
710
711
|
props: {
|
|
711
712
|
row: {
|
|
@@ -743,88 +744,88 @@ const je = {
|
|
|
743
744
|
}
|
|
744
745
|
},
|
|
745
746
|
emits: ["change"],
|
|
746
|
-
setup(
|
|
747
|
-
const
|
|
747
|
+
setup(e, { emit: r }) {
|
|
748
|
+
const s = e, c = ce({
|
|
748
749
|
show: !1,
|
|
749
|
-
add: (t,
|
|
750
|
-
|
|
751
|
-
|
|
750
|
+
add: (t, n, a) => {
|
|
751
|
+
H.add(t, n, a, () => {
|
|
752
|
+
o("change");
|
|
752
753
|
});
|
|
753
754
|
},
|
|
754
|
-
remove: (t,
|
|
755
|
-
|
|
756
|
-
|
|
755
|
+
remove: (t, n, a) => {
|
|
756
|
+
H.remove(t, n, a, () => {
|
|
757
|
+
o("change");
|
|
757
758
|
});
|
|
758
759
|
}
|
|
759
760
|
});
|
|
760
761
|
ye(() => {
|
|
761
|
-
|
|
762
|
+
H.setId(s.field, s.row, s.itemFields), c.show = !0;
|
|
762
763
|
});
|
|
763
|
-
const
|
|
764
|
-
return (t,
|
|
765
|
-
const
|
|
766
|
-
return
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
764
|
+
const o = r;
|
|
765
|
+
return (t, n) => {
|
|
766
|
+
const a = te("el-button"), i = te("el-input");
|
|
767
|
+
return c.show ? (d(), b("div", je, [
|
|
768
|
+
x(t.$slots, "list-start", { row: e.row }),
|
|
769
|
+
e.addBottom ? C("", !0) : (d(), b("div", Le, [
|
|
770
|
+
E(a, {
|
|
770
771
|
link: "",
|
|
771
772
|
type: "primary",
|
|
772
|
-
onClick:
|
|
773
|
+
onClick: n[0] || (n[0] = (m) => c.add(e.field, e.row, e.itemFields))
|
|
773
774
|
}, {
|
|
774
|
-
default: g(() =>
|
|
775
|
-
|
|
776
|
-
])),
|
|
775
|
+
default: g(() => [...n[3] || (n[3] = [
|
|
776
|
+
O("添加", -1)
|
|
777
|
+
])]),
|
|
777
778
|
_: 1
|
|
778
779
|
})
|
|
779
780
|
])),
|
|
780
|
-
(d(!0), b(
|
|
781
|
-
|
|
781
|
+
(d(!0), b($, null, A(e.row[e.field], (m) => (d(), b("div", Be, [
|
|
782
|
+
x(t.$slots, "item-start", {
|
|
782
783
|
item: m,
|
|
783
|
-
row:
|
|
784
|
+
row: e.row
|
|
784
785
|
}),
|
|
785
|
-
(d(!0), b(
|
|
786
|
-
modelValue: m[
|
|
787
|
-
"onUpdate:modelValue": (
|
|
788
|
-
style: ge({ width:
|
|
789
|
-
class:
|
|
790
|
-
placeholder:
|
|
791
|
-
onChange:
|
|
786
|
+
(d(!0), b($, null, A(e.itemFields, (u) => (d(), y(i, {
|
|
787
|
+
modelValue: m[u.value],
|
|
788
|
+
"onUpdate:modelValue": (w) => m[u.value] = w,
|
|
789
|
+
style: ge({ width: e.inputWidth }),
|
|
790
|
+
class: R(e.inputClass),
|
|
791
|
+
placeholder: u[e.label] || u[e.value],
|
|
792
|
+
onChange: n[1] || (n[1] = (w) => o("change"))
|
|
792
793
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "style", "class", "placeholder"]))), 256)),
|
|
793
|
-
|
|
794
|
+
x(t.$slots, "item-end", {
|
|
794
795
|
item: m,
|
|
795
|
-
row:
|
|
796
|
+
row: e.row
|
|
796
797
|
}),
|
|
797
|
-
|
|
798
|
+
E(a, {
|
|
798
799
|
link: "",
|
|
799
800
|
type: "danger",
|
|
800
|
-
onClick: (
|
|
801
|
+
onClick: (u) => c.remove(e.field, e.row, m)
|
|
801
802
|
}, {
|
|
802
|
-
default: g(() =>
|
|
803
|
-
|
|
804
|
-
])),
|
|
805
|
-
_:
|
|
806
|
-
},
|
|
803
|
+
default: g(() => [...n[4] || (n[4] = [
|
|
804
|
+
O("删除", -1)
|
|
805
|
+
])]),
|
|
806
|
+
_: 1
|
|
807
|
+
}, 8, ["onClick"])
|
|
807
808
|
]))), 256)),
|
|
808
|
-
|
|
809
|
-
|
|
809
|
+
e.addBottom ? (d(), b("div", Re, [
|
|
810
|
+
E(a, {
|
|
810
811
|
link: "",
|
|
811
812
|
type: "primary",
|
|
812
|
-
onClick:
|
|
813
|
+
onClick: n[2] || (n[2] = (m) => c.add(e.field, e.row, e.itemFields))
|
|
813
814
|
}, {
|
|
814
|
-
default: g(() =>
|
|
815
|
-
|
|
816
|
-
])),
|
|
815
|
+
default: g(() => [...n[5] || (n[5] = [
|
|
816
|
+
O("添加", -1)
|
|
817
|
+
])]),
|
|
817
818
|
_: 1
|
|
818
819
|
})
|
|
819
|
-
])) :
|
|
820
|
-
|
|
821
|
-
])) :
|
|
820
|
+
])) : C("", !0),
|
|
821
|
+
x(t.$slots, "list-end", { row: e.row })
|
|
822
|
+
])) : C("", !0);
|
|
822
823
|
};
|
|
823
824
|
}
|
|
824
825
|
}), Ie = {
|
|
825
826
|
class: "row form-item-content",
|
|
826
827
|
style: { width: "100%" }
|
|
827
|
-
},
|
|
828
|
+
}, Pe = { class: "col" }, He = { class: "col" }, Ke = ["innerHTML"], Ne = /* @__PURE__ */ K({
|
|
828
829
|
__name: "column",
|
|
829
830
|
props: {
|
|
830
831
|
/**
|
|
@@ -843,236 +844,230 @@ const je = {
|
|
|
843
844
|
default: {}
|
|
844
845
|
}
|
|
845
846
|
},
|
|
846
|
-
setup(
|
|
847
|
-
const
|
|
847
|
+
setup(e, { expose: r }) {
|
|
848
|
+
const s = D.isFun, c = D.EDialog, o = J(), t = e, n = we.getConf();
|
|
849
|
+
n?.formRef?.set("formRef-" + StrUtil.getId(), o);
|
|
850
|
+
const a = ce({
|
|
848
851
|
rules: {},
|
|
849
852
|
show: !0,
|
|
850
853
|
form: {},
|
|
851
854
|
formDefault: {},
|
|
852
|
-
type: t.type || n.Add,
|
|
855
|
+
type: t.type || n?.update?.type || c.Add,
|
|
853
856
|
formColumn: [],
|
|
854
|
-
getDisabled: (
|
|
855
|
-
if (
|
|
856
|
-
return
|
|
857
|
-
const
|
|
858
|
-
return
|
|
857
|
+
getDisabled: (i) => {
|
|
858
|
+
if (a.type === c.View)
|
|
859
|
+
return i.disabled?.view === void 0 ? !0 : D.isFun(i.disabled?.view, a.form);
|
|
860
|
+
const m = i.disabled?.[a.type === c.Add ? "create" : "update"];
|
|
861
|
+
return D.isFun(m, a.form);
|
|
859
862
|
},
|
|
860
|
-
getBind: (
|
|
861
|
-
getOn: (
|
|
862
|
-
getColumnSpan: (
|
|
863
|
-
if (
|
|
864
|
-
const
|
|
865
|
-
return (
|
|
863
|
+
getBind: (i) => i.options?.[a.type === c.Add ? "formAdd" : "formUpdate"]?.[i.type] || i.options?.[i.type] || {},
|
|
864
|
+
getOn: (i) => i.options?.[a.type === c.Add ? "formAdd" : "formUpdate"]?.[i.type]?.on || i.options?.[i.type]?.on || {},
|
|
865
|
+
getColumnSpan: (i, m) => {
|
|
866
|
+
if (i.item.form?.spanCol) {
|
|
867
|
+
const u = t.option.form?.maxSpan || 12, w = t.option.form?.defaultSpan || u / 2, h = m.filter((p) => !D.isFun(p.item.show?.form, a.form, a.type)).reduce((p, k) => p + (k.item.form?.span || w), 0);
|
|
868
|
+
return (i.item.form?.span || w) + h;
|
|
866
869
|
}
|
|
867
|
-
return
|
|
870
|
+
return i.item.form?.span;
|
|
868
871
|
},
|
|
869
872
|
initColumnForm: () => {
|
|
870
|
-
const
|
|
871
|
-
|
|
872
|
-
const
|
|
873
|
-
let
|
|
874
|
-
const
|
|
875
|
-
if (
|
|
876
|
-
|
|
877
|
-
|
|
873
|
+
const i = t.option;
|
|
874
|
+
a.formColumn = [], a.rules = {}, a.formDefault = {};
|
|
875
|
+
const m = [], u = t.option.form?.maxSpan || 12, w = t.option.form?.defaultSpan || u / 2;
|
|
876
|
+
let f = [];
|
|
877
|
+
const h = (k) => {
|
|
878
|
+
if (k.children) {
|
|
879
|
+
k.children.forEach((F) => {
|
|
880
|
+
h(F);
|
|
878
881
|
});
|
|
879
882
|
return;
|
|
880
883
|
}
|
|
881
|
-
if (
|
|
882
|
-
|
|
883
|
-
const
|
|
884
|
-
if (
|
|
885
|
-
const
|
|
886
|
-
input:
|
|
887
|
-
select:
|
|
888
|
-
},
|
|
889
|
-
|
|
884
|
+
if (a.formDefault[k.key] = k.value, k.isForm && (typeof k.show?.form != "boolean" || k.show?.form)) {
|
|
885
|
+
k.form = k.form || { span: w }, k.form.span = k.form.span ?? w;
|
|
886
|
+
const F = k.form.span, B = f.reduce((I, N) => I + N.span, F), L = f.length;
|
|
887
|
+
if (f.push({ item: k, span: F }), (L === 1 && f[0].span === 0 || B >= u || F === 0 && L > 1) && (m.push(f), f = []), k.rules) {
|
|
888
|
+
const I = {
|
|
889
|
+
input: v.tCurd("placeholderInput"),
|
|
890
|
+
select: v.tCurd("placeholderSelect")
|
|
891
|
+
}, N = (I[k.type] || I.input) + k.label;
|
|
892
|
+
a.rules[k.key] = typeof k.rules == "boolean" ? [
|
|
890
893
|
{
|
|
891
894
|
required: !0,
|
|
892
|
-
message:
|
|
895
|
+
message: N,
|
|
893
896
|
trigger: "blur"
|
|
894
897
|
}
|
|
895
|
-
] :
|
|
898
|
+
] : k.rules;
|
|
896
899
|
}
|
|
897
900
|
}
|
|
898
|
-
},
|
|
899
|
-
|
|
901
|
+
}, p = (k, F) => {
|
|
902
|
+
k.isForm = F, Array.isArray(k.children) && k.children.forEach((B) => p(B, F));
|
|
900
903
|
};
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
}),
|
|
904
|
+
i.column.forEach((k) => {
|
|
905
|
+
p(k, !0), h(k);
|
|
906
|
+
}), f.length > 0 && m.push(f), a.formColumn = m, a.type === c.Add ? a.form = JSONUtil.cp(a.formDefault) : a.form = JSONUtil.cp(t.form);
|
|
904
907
|
}
|
|
905
908
|
});
|
|
906
|
-
return
|
|
907
|
-
() =>
|
|
908
|
-
(
|
|
909
|
-
Object.keys(
|
|
910
|
-
t.form[
|
|
909
|
+
return a.initColumnForm(), t.form && re(
|
|
910
|
+
() => a.form,
|
|
911
|
+
(i) => {
|
|
912
|
+
Object.keys(a.form).forEach((m) => {
|
|
913
|
+
t.form[m] = a.form[m];
|
|
911
914
|
});
|
|
912
915
|
},
|
|
913
916
|
{
|
|
914
917
|
deep: !0,
|
|
915
918
|
immediate: !0
|
|
916
919
|
}
|
|
917
|
-
),
|
|
918
|
-
ref:
|
|
919
|
-
conf:
|
|
920
|
-
}), (
|
|
920
|
+
), r({
|
|
921
|
+
ref: o,
|
|
922
|
+
conf: a
|
|
923
|
+
}), (i, m) => (d(), y(l(Q), {
|
|
921
924
|
ref_key: "ruleFormRef",
|
|
922
|
-
ref:
|
|
923
|
-
model:
|
|
924
|
-
rules:
|
|
925
|
+
ref: o,
|
|
926
|
+
model: a.form,
|
|
927
|
+
rules: a.rules
|
|
925
928
|
}, {
|
|
926
929
|
default: g(() => [
|
|
927
|
-
|
|
928
|
-
l(
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
930
|
+
a.show ? (d(!0), b($, { key: 0 }, A(a.formColumn, (u, w) => (d(), b($, { key: w }, [
|
|
931
|
+
l(s)(
|
|
932
|
+
u.map((f) => f.item?.show?.form),
|
|
933
|
+
a.form,
|
|
934
|
+
a.type
|
|
932
935
|
) ? (d(), b("div", {
|
|
933
936
|
key: 0,
|
|
934
|
-
class:
|
|
935
|
-
stripe:
|
|
937
|
+
class: R(["row curd-row", {
|
|
938
|
+
stripe: e.option.form?.stripe === void 0 ? !0 : e.option.form?.stripe
|
|
936
939
|
}])
|
|
937
940
|
}, [
|
|
938
|
-
|
|
939
|
-
row:
|
|
941
|
+
x(i.$slots, "form-start", {
|
|
942
|
+
row: a.form
|
|
940
943
|
}),
|
|
941
|
-
(d(!0), b(
|
|
942
|
-
key:
|
|
944
|
+
(d(!0), b($, null, A(u, (f) => (d(), b($, {
|
|
945
|
+
key: f.item.key
|
|
943
946
|
}, [
|
|
944
|
-
l(
|
|
947
|
+
l(s)(f.item.show?.form, a.form, a.type) ? (d(), b("div", {
|
|
945
948
|
key: 0,
|
|
946
|
-
class:
|
|
949
|
+
class: R([f.item.form.span > 0 ? `col-${a.getColumnSpan(f, u)}` : "col", `form-item-col-${f.item.key}`])
|
|
947
950
|
}, [
|
|
948
|
-
|
|
949
|
-
label:
|
|
950
|
-
prop:
|
|
951
|
-
"label-width":
|
|
951
|
+
E(l(le), {
|
|
952
|
+
label: f.item.text?.form?.label ?? f.item.label,
|
|
953
|
+
prop: f.item.key,
|
|
954
|
+
"label-width": f.item.text?.form?.label == "" ? 0 : f.item.form?.labelWidth || e.option.form?.labelWidth || "100px"
|
|
952
955
|
}, {
|
|
953
956
|
default: g(() => [
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
row:
|
|
957
|
-
item:
|
|
957
|
+
U("div", Ie, [
|
|
958
|
+
x(i.$slots, "form-" + f.item.key + "-start", {
|
|
959
|
+
row: a.form,
|
|
960
|
+
item: f.item
|
|
958
961
|
}),
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
row:
|
|
963
|
-
item:
|
|
962
|
+
U("div", Pe, [
|
|
963
|
+
U("div", He, [
|
|
964
|
+
x(i.$slots, "form-" + f.item.key, {
|
|
965
|
+
row: a.form,
|
|
966
|
+
item: f.item
|
|
964
967
|
}, () => [
|
|
965
|
-
|
|
968
|
+
f.item.type === "input" ? (d(), y(l(ee), V({
|
|
966
969
|
key: 0,
|
|
967
|
-
modelValue:
|
|
968
|
-
"onUpdate:modelValue": (
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "switch" ? (d(), y(l(Z), C({
|
|
970
|
+
modelValue: a.form[f.item.key],
|
|
971
|
+
"onUpdate:modelValue": (h) => a.form[f.item.key] = h
|
|
972
|
+
}, { ref_for: !0 }, a.getBind(f.item), z(a.getOn(f.item)), {
|
|
973
|
+
disabled: a.getDisabled(f.item)
|
|
974
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : f.item.type === "switch" ? (d(), y(l(Z), V({
|
|
973
975
|
key: 1,
|
|
974
|
-
modelValue:
|
|
975
|
-
"onUpdate:modelValue": (
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type === "select" ? (d(), y(l(X), C({
|
|
976
|
+
modelValue: a.form[f.item.key],
|
|
977
|
+
"onUpdate:modelValue": (h) => a.form[f.item.key] = h
|
|
978
|
+
}, { ref_for: !0 }, a.getBind(f.item), z(a.getOn(f.item)), {
|
|
979
|
+
disabled: a.getDisabled(f.item)
|
|
980
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : f.item.type === "select" ? (d(), y(l(X), V({
|
|
980
981
|
key: 2,
|
|
981
|
-
modelValue:
|
|
982
|
-
"onUpdate:modelValue": (
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
disabled: e.getDisabled(u.item),
|
|
982
|
+
modelValue: a.form[f.item.key],
|
|
983
|
+
"onUpdate:modelValue": (h) => a.form[f.item.key] = h
|
|
984
|
+
}, { ref_for: !0 }, a.getBind(f.item), z(a.getOn(f.item)), {
|
|
985
|
+
disabled: a.getDisabled(f.item),
|
|
986
986
|
style: { width: "100%" }
|
|
987
987
|
}), {
|
|
988
988
|
default: g(() => [
|
|
989
|
-
(d(!0), b(
|
|
990
|
-
key:
|
|
991
|
-
label:
|
|
992
|
-
value:
|
|
989
|
+
(d(!0), b($, null, A(f.item.options?.select?.data, (h) => (d(), y(l(W), {
|
|
990
|
+
key: h.value,
|
|
991
|
+
label: h.label,
|
|
992
|
+
value: h.value
|
|
993
993
|
}, null, 8, ["label", "value"]))), 128))
|
|
994
994
|
]),
|
|
995
995
|
_: 2
|
|
996
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
996
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : f.item.type === "radio" ? (d(), y(l(de), V({
|
|
997
997
|
key: 3,
|
|
998
|
-
modelValue:
|
|
999
|
-
"onUpdate:modelValue": (
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
disabled: e.getDisabled(u.item),
|
|
998
|
+
modelValue: a.form[f.item.key],
|
|
999
|
+
"onUpdate:modelValue": (h) => a.form[f.item.key] = h
|
|
1000
|
+
}, { ref_for: !0 }, a.getBind(f.item), z(a.getOn(f.item)), {
|
|
1001
|
+
disabled: a.getDisabled(f.item),
|
|
1003
1002
|
style: { width: "100%" }
|
|
1004
1003
|
}), {
|
|
1005
1004
|
default: g(() => [
|
|
1006
|
-
(d(!0), b(
|
|
1007
|
-
key:
|
|
1008
|
-
label:
|
|
1009
|
-
value:
|
|
1005
|
+
(d(!0), b($, null, A(f.item.options?.radio?.data, (h) => (d(), y(l(se), {
|
|
1006
|
+
key: h.value,
|
|
1007
|
+
label: h.label,
|
|
1008
|
+
value: h.value
|
|
1010
1009
|
}, null, 8, ["label", "value"]))), 128))
|
|
1011
1010
|
]),
|
|
1012
1011
|
_: 2
|
|
1013
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
1012
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : f.item.type === "list" ? (d(), y(fe, V({
|
|
1014
1013
|
key: 4,
|
|
1015
|
-
row:
|
|
1016
|
-
field:
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
disabled: e.getDisabled(u.item),
|
|
1014
|
+
row: a.form,
|
|
1015
|
+
field: f.item.key
|
|
1016
|
+
}, { ref_for: !0 }, a.getBind(f.item), z(a.getOn(f.item)), {
|
|
1017
|
+
disabled: a.getDisabled(f.item),
|
|
1020
1018
|
style: { width: "100%" }
|
|
1021
|
-
}), null, 16, ["row", "field", "disabled"])) :
|
|
1019
|
+
}), null, 16, ["row", "field", "disabled"])) : f.item.type === "treeSelect" ? (d(), y(l(pe), V({
|
|
1022
1020
|
key: 5,
|
|
1023
|
-
modelValue:
|
|
1024
|
-
"onUpdate:modelValue": (
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
disabled: e.getDisabled(u.item),
|
|
1021
|
+
modelValue: a.form[f.item.key],
|
|
1022
|
+
"onUpdate:modelValue": (h) => a.form[f.item.key] = h
|
|
1023
|
+
}, { ref_for: !0 }, a.getBind(f.item), z(a.getOn(f.item)), {
|
|
1024
|
+
disabled: a.getDisabled(f.item),
|
|
1028
1025
|
style: { width: "100%" }
|
|
1029
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
1026
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : f.item.type === "datetime" ? (d(), y(l(ue), V({
|
|
1030
1027
|
key: 6,
|
|
1031
|
-
modelValue:
|
|
1032
|
-
"onUpdate:modelValue": (
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u.item.type && (l(L).customComponent[u.item.type] || l(L).customComponent[u.item.type]?.form) ? (d(), y(q(l(L).customComponent[u.item.type]?.form || l(L).customComponent[u.item.type]), C({
|
|
1028
|
+
modelValue: a.form[f.item.key],
|
|
1029
|
+
"onUpdate:modelValue": (h) => a.form[f.item.key] = h
|
|
1030
|
+
}, { ref_for: !0 }, a.getBind(f.item), z(a.getOn(f.item)), {
|
|
1031
|
+
disabled: a.getDisabled(f.item)
|
|
1032
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : f.item.type && (l(j).customComponent[f.item.type] || l(j).customComponent[f.item.type]?.form) ? (d(), y(q(l(j).customComponent[f.item.type]?.form || l(j).customComponent[f.item.type]), V({
|
|
1037
1033
|
key: 7,
|
|
1038
|
-
modelValue:
|
|
1039
|
-
"onUpdate:modelValue": (
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : v("", !0)
|
|
1034
|
+
modelValue: a.form[f.item.key],
|
|
1035
|
+
"onUpdate:modelValue": (h) => a.form[f.item.key] = h
|
|
1036
|
+
}, { ref_for: !0 }, a.getBind(f.item), z(a.getOn(f.item)), {
|
|
1037
|
+
disabled: a.getDisabled(f.item)
|
|
1038
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : C("", !0)
|
|
1044
1039
|
]),
|
|
1045
|
-
|
|
1046
|
-
row:
|
|
1047
|
-
item:
|
|
1040
|
+
x(i.$slots, "form-" + f.item.key + "-right", {
|
|
1041
|
+
row: a.form,
|
|
1042
|
+
item: f.item
|
|
1048
1043
|
})
|
|
1049
1044
|
]),
|
|
1050
|
-
|
|
1051
|
-
row:
|
|
1052
|
-
item:
|
|
1045
|
+
x(i.$slots, "form-" + f.item.key + "-tip", {
|
|
1046
|
+
row: a.form,
|
|
1047
|
+
item: f.item
|
|
1053
1048
|
}, () => [
|
|
1054
|
-
|
|
1049
|
+
f.item.form?.tipText ? (d(), b("div", {
|
|
1055
1050
|
key: 0,
|
|
1056
1051
|
class: "form-tip-text",
|
|
1057
|
-
innerHTML: typeof
|
|
1058
|
-
}, null, 8,
|
|
1052
|
+
innerHTML: typeof f.item.form?.tipText == "function" ? f.item.form?.tipText(a.form, a.type) : f.item.form?.tipText
|
|
1053
|
+
}, null, 8, Ke)) : C("", !0)
|
|
1059
1054
|
])
|
|
1060
1055
|
]),
|
|
1061
|
-
|
|
1062
|
-
row:
|
|
1063
|
-
item:
|
|
1056
|
+
x(i.$slots, "form-" + f.item.key + "-end", {
|
|
1057
|
+
row: a.form,
|
|
1058
|
+
item: f.item
|
|
1064
1059
|
})
|
|
1065
1060
|
])
|
|
1066
1061
|
]),
|
|
1067
1062
|
_: 2
|
|
1068
1063
|
}, 1032, ["label", "prop", "label-width"])
|
|
1069
|
-
], 2)) :
|
|
1064
|
+
], 2)) : C("", !0)
|
|
1070
1065
|
], 64))), 128)),
|
|
1071
|
-
|
|
1072
|
-
row:
|
|
1066
|
+
x(i.$slots, "form-end", {
|
|
1067
|
+
row: a.form
|
|
1073
1068
|
})
|
|
1074
|
-
], 2)) :
|
|
1075
|
-
], 64))), 128)) :
|
|
1069
|
+
], 2)) : C("", !0)
|
|
1070
|
+
], 64))), 128)) : C("", !0)
|
|
1076
1071
|
]),
|
|
1077
1072
|
_: 3
|
|
1078
1073
|
}, 8, ["model", "rules"]));
|
|
@@ -1086,26 +1081,26 @@ class We {
|
|
|
1086
1081
|
* @param columns - 列配置数组,需包含 `key`(数据字段)和 `label`(Excel 表头)
|
|
1087
1082
|
* @param fileName - 文件名(不含扩展名),支持字符串或返回字符串的函数;默认生成「导出数据_日期_时间戳」
|
|
1088
1083
|
*/
|
|
1089
|
-
static exportToExcel = async (
|
|
1090
|
-
if (!
|
|
1091
|
-
const
|
|
1084
|
+
static exportToExcel = async (r, s, c) => {
|
|
1085
|
+
if (!r || r.length === 0) return;
|
|
1086
|
+
const o = await D.loadModule("xlsx"), t = r.map((i) => {
|
|
1092
1087
|
const m = {};
|
|
1093
|
-
return
|
|
1094
|
-
m[
|
|
1088
|
+
return s.forEach((u) => {
|
|
1089
|
+
m[u.label] = i[u.key];
|
|
1095
1090
|
}), m;
|
|
1096
|
-
}),
|
|
1097
|
-
|
|
1091
|
+
}), n = o.utils.json_to_sheet(t), a = o.utils.book_new();
|
|
1092
|
+
o.utils.book_append_sheet(a, n, "Sheet1"), c ? typeof c == "function" && (c = c()) : c = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, o.writeFile(a, `${c}.xlsx`);
|
|
1098
1093
|
};
|
|
1099
1094
|
}
|
|
1100
|
-
class
|
|
1095
|
+
class _ {
|
|
1101
1096
|
/**
|
|
1102
1097
|
* 删除对象所有属性
|
|
1103
1098
|
* @param obj 对象
|
|
1104
1099
|
* @returns
|
|
1105
1100
|
*/
|
|
1106
|
-
static delAllKey = (
|
|
1107
|
-
Object.keys(
|
|
1108
|
-
delete
|
|
1101
|
+
static delAllKey = (r) => {
|
|
1102
|
+
Object.keys(r).forEach((s) => {
|
|
1103
|
+
delete r[s];
|
|
1109
1104
|
});
|
|
1110
1105
|
};
|
|
1111
1106
|
/**
|
|
@@ -1115,15 +1110,36 @@ class x {
|
|
|
1115
1110
|
* @param delAll 是否删除目标对象所有属性
|
|
1116
1111
|
* @returns
|
|
1117
1112
|
*/
|
|
1118
|
-
static setValue = (
|
|
1119
|
-
|
|
1120
|
-
o
|
|
1113
|
+
static setValue = (r, s, c = !1) => {
|
|
1114
|
+
c && _.delAllKey(r), Object.keys(s).forEach((o) => {
|
|
1115
|
+
r[o] !== s[o] && (r[o] = s[o]);
|
|
1121
1116
|
});
|
|
1122
1117
|
};
|
|
1123
1118
|
}
|
|
1124
|
-
const
|
|
1125
|
-
const
|
|
1126
|
-
|
|
1119
|
+
const P = D.EDialog, Je = (e) => {
|
|
1120
|
+
const r = J(), s = J(), c = J(), o = ce({
|
|
1121
|
+
/** 需要控制的表单对象引用集合,提交时统一进行校验触发 */
|
|
1122
|
+
formRef: {
|
|
1123
|
+
map: {},
|
|
1124
|
+
set(t, n) {
|
|
1125
|
+
o.formRef.map[t] = n;
|
|
1126
|
+
},
|
|
1127
|
+
validate: () => new Promise(async (t, n) => {
|
|
1128
|
+
try {
|
|
1129
|
+
const a = Object.keys(o.formRef.map);
|
|
1130
|
+
await Promise.all(
|
|
1131
|
+
a.map(
|
|
1132
|
+
(i) => o.formRef.map[i]?.validate(async (m, u) => new Promise((w, f) => {
|
|
1133
|
+
m || f(!1), w(!0);
|
|
1134
|
+
}))
|
|
1135
|
+
)
|
|
1136
|
+
), t(!0);
|
|
1137
|
+
} catch (a) {
|
|
1138
|
+
n(a);
|
|
1139
|
+
}
|
|
1140
|
+
})
|
|
1141
|
+
},
|
|
1142
|
+
option: e.option,
|
|
1127
1143
|
/** 查询区域相关配置对象 */
|
|
1128
1144
|
search: {
|
|
1129
1145
|
/** 查询表单列集合 */
|
|
@@ -1136,28 +1152,28 @@ const K = O.EDialog, Je = (i) => {
|
|
|
1136
1152
|
/** 搜索表单默认值 */
|
|
1137
1153
|
formDefault: {},
|
|
1138
1154
|
/** 获取占位符 */
|
|
1139
|
-
getPlaceholder: (t,
|
|
1155
|
+
getPlaceholder: (t, n = v.tCurd("placeholderInput")) => t.text?.search?.placeholder === void 0 ? `${n}${t.label}` : t.text?.search?.placeholder,
|
|
1140
1156
|
/** 组装实际要搜索的数据对象 */
|
|
1141
1157
|
getFormData: () => {
|
|
1142
1158
|
let t = {};
|
|
1143
|
-
|
|
1144
|
-
(typeof
|
|
1159
|
+
e.option.column.forEach((a) => {
|
|
1160
|
+
(typeof a.show?.search == "function" ? a.show?.search(o.search.form) : a.show?.search) && (t[a.key] = o.search.form[a.key]);
|
|
1145
1161
|
});
|
|
1146
|
-
const
|
|
1147
|
-
return
|
|
1162
|
+
const n = e.option.search?.before?.(t);
|
|
1163
|
+
return n && (t = n), t;
|
|
1148
1164
|
},
|
|
1149
1165
|
/** 重置搜索表单 */
|
|
1150
1166
|
reset: () => {
|
|
1151
|
-
const t =
|
|
1152
|
-
Object.keys(t).forEach((
|
|
1153
|
-
|
|
1167
|
+
const t = o.search.formDefault;
|
|
1168
|
+
Object.keys(t).forEach((a) => {
|
|
1169
|
+
e.option.search?.resetMode === "none" ? t[a] = void 0 : t[a] = o.search.formDefault[a];
|
|
1154
1170
|
});
|
|
1155
|
-
const
|
|
1156
|
-
|
|
1171
|
+
const n = ObjectUtil.deepMerge(t, {});
|
|
1172
|
+
_.setValue(o.search.form, n, !0), o.page.num = 1, e.option.init !== !1 && o.table.getList();
|
|
1157
1173
|
},
|
|
1158
1174
|
/** 提交搜索表单 */
|
|
1159
1175
|
submit: () => {
|
|
1160
|
-
|
|
1176
|
+
o.page.num = 1, o.table.getList();
|
|
1161
1177
|
}
|
|
1162
1178
|
},
|
|
1163
1179
|
/** 分页区域相关配置对象 */
|
|
@@ -1167,20 +1183,20 @@ const K = O.EDialog, Je = (i) => {
|
|
|
1167
1183
|
/** 总条数 */
|
|
1168
1184
|
total: 0,
|
|
1169
1185
|
/** 分页控件的布局方式 */
|
|
1170
|
-
layout:
|
|
1186
|
+
layout: e.option.page?.layout || M.config.pagination.layout,
|
|
1171
1187
|
/** 是否显示到工具栏 默认不显示 配置后show属性无效 */
|
|
1172
|
-
showTools:
|
|
1188
|
+
showTools: e.option.page?.showTools || M.config.pagination.showTools,
|
|
1173
1189
|
/** 当前每页条数 */
|
|
1174
|
-
size:
|
|
1190
|
+
size: e.option.page?.size || M.config.pagination.size,
|
|
1175
1191
|
/** 支持切换的每页条数选项 */
|
|
1176
|
-
sizeList:
|
|
1192
|
+
sizeList: e.option.page?.sizeList || M.config.pagination.pageSizes,
|
|
1177
1193
|
/** 分页器计数 */
|
|
1178
|
-
pagerCount:
|
|
1194
|
+
pagerCount: e.option.page?.pagerCount || M.config.pagination.pagerCount,
|
|
1179
1195
|
/** 获取分页查询参数 */
|
|
1180
1196
|
getQuery: (t = {}) => ({
|
|
1181
|
-
[
|
|
1182
|
-
[
|
|
1183
|
-
...
|
|
1197
|
+
[M.config.field.page.size]: t.size || o.page.size,
|
|
1198
|
+
[M.config.field.page.num]: t.num || o.page.num,
|
|
1199
|
+
...o.search.getFormData()
|
|
1184
1200
|
})
|
|
1185
1201
|
},
|
|
1186
1202
|
/** 表格区域相关配置对象 */
|
|
@@ -1188,7 +1204,7 @@ const K = O.EDialog, Je = (i) => {
|
|
|
1188
1204
|
/** 操作列相关配置 */
|
|
1189
1205
|
op: {
|
|
1190
1206
|
/** 动态计算操作列宽度 */
|
|
1191
|
-
width: (...t) => t.filter((
|
|
1207
|
+
width: (...t) => t.filter((a) => a).length * 30 + 60
|
|
1192
1208
|
},
|
|
1193
1209
|
/** 表格加载中状态 */
|
|
1194
1210
|
loading: !1,
|
|
@@ -1201,22 +1217,22 @@ const K = O.EDialog, Je = (i) => {
|
|
|
1201
1217
|
/** 已经展开的行key集合 */
|
|
1202
1218
|
rowKeys: [],
|
|
1203
1219
|
/** 行展开触发变更函数 */
|
|
1204
|
-
change: (t,
|
|
1220
|
+
change: (t, n) => {
|
|
1205
1221
|
},
|
|
1206
1222
|
/** 全部展开/收起 */
|
|
1207
1223
|
all: () => {
|
|
1208
|
-
if (
|
|
1209
|
-
|
|
1224
|
+
if (o.table.expand.isExpand)
|
|
1225
|
+
o.table.expand.rowKeys = [];
|
|
1210
1226
|
else {
|
|
1211
|
-
const t = (
|
|
1212
|
-
let
|
|
1213
|
-
return
|
|
1214
|
-
|
|
1215
|
-
}),
|
|
1227
|
+
const t = (n) => {
|
|
1228
|
+
let a = [];
|
|
1229
|
+
return n.forEach((i) => {
|
|
1230
|
+
a.push(i[e.option.table.rowKey]), i.children && i.children.length > 0 && (a = a.concat(t(i.children)));
|
|
1231
|
+
}), a;
|
|
1216
1232
|
};
|
|
1217
|
-
|
|
1233
|
+
o.table.expand.rowKeys = t(o.table.data);
|
|
1218
1234
|
}
|
|
1219
|
-
|
|
1235
|
+
o.table.expand.isExpand = !o.table.expand.isExpand;
|
|
1220
1236
|
}
|
|
1221
1237
|
},
|
|
1222
1238
|
/** 表格列相关配置 */
|
|
@@ -1238,47 +1254,47 @@ const K = O.EDialog, Je = (i) => {
|
|
|
1238
1254
|
expand: !1,
|
|
1239
1255
|
/** 全部展开/收起主分组 */
|
|
1240
1256
|
toggleExpandAll: () => {
|
|
1241
|
-
const t = !
|
|
1242
|
-
|
|
1243
|
-
const
|
|
1244
|
-
|
|
1245
|
-
|
|
1257
|
+
const t = !o.table.header.group.expand;
|
|
1258
|
+
o.table.header.group.expand = t;
|
|
1259
|
+
const n = (a) => {
|
|
1260
|
+
a.forEach((i) => {
|
|
1261
|
+
i.table?.header?.group !== void 0 && (i.table.header.group = !t), i.table?.header?.groupKey !== void 0 && (i.table.header.show = t), Array.isArray(i.children) && i.children.length > 0 && n(i.children);
|
|
1246
1262
|
});
|
|
1247
1263
|
};
|
|
1248
|
-
|
|
1264
|
+
n(o.table.column.list);
|
|
1249
1265
|
}
|
|
1250
1266
|
}
|
|
1251
1267
|
},
|
|
1252
1268
|
/** 获取数据列表接口实现 */
|
|
1253
1269
|
getList: async () => {
|
|
1254
|
-
|
|
1255
|
-
const t =
|
|
1270
|
+
o.table.loading = !0;
|
|
1271
|
+
const t = e.option.api.list, n = JSONUtil.cp(o.table.selection.list);
|
|
1256
1272
|
try {
|
|
1257
|
-
await
|
|
1258
|
-
let
|
|
1259
|
-
if (
|
|
1260
|
-
const { props:
|
|
1261
|
-
|
|
1262
|
-
[
|
|
1263
|
-
[
|
|
1273
|
+
await o.initApiData("init");
|
|
1274
|
+
let a = {};
|
|
1275
|
+
if (o.table.sort.prop) {
|
|
1276
|
+
const { props: k, order: F } = M.config.table.sort;
|
|
1277
|
+
a = {
|
|
1278
|
+
[k.field]: o.table.sort.prop,
|
|
1279
|
+
[F.field]: o.table.sort.order
|
|
1264
1280
|
};
|
|
1265
1281
|
}
|
|
1266
|
-
const
|
|
1267
|
-
...
|
|
1268
|
-
...
|
|
1269
|
-
}), m =
|
|
1270
|
-
let
|
|
1271
|
-
const
|
|
1272
|
-
const
|
|
1273
|
-
|
|
1274
|
-
}),
|
|
1275
|
-
|
|
1276
|
-
|
|
1282
|
+
const i = await t({
|
|
1283
|
+
...o.page.getQuery(),
|
|
1284
|
+
...a
|
|
1285
|
+
}), m = M.config.field.result, u = i.data || { [m.list]: i };
|
|
1286
|
+
let w = (Array.isArray(u[m.list]), u[m.list]);
|
|
1287
|
+
const f = o.update.formColumn.flat(), p = ObjectUtil.deepMerge({ data: w }, {}).data.map((k) => (Object.keys(k).forEach((B) => {
|
|
1288
|
+
const L = f.find((I) => I.item.key === B);
|
|
1289
|
+
L && ["select", "radio"].includes(L.item.type) && (L.item.table.format || (L.item.table.format = (I) => L.item.options[L.item.type].data?.find((N) => N.value == I[B])?.label || I[B]));
|
|
1290
|
+
}), k));
|
|
1291
|
+
o.table.data = e.option.data ? await e.option.data(p, w) : p, o.page.total = u[m.total] || 0, setTimeout(() => {
|
|
1292
|
+
o.table.selection.setList(n);
|
|
1277
1293
|
}, 20);
|
|
1278
|
-
} catch (
|
|
1279
|
-
console.error(
|
|
1294
|
+
} catch (a) {
|
|
1295
|
+
console.error(a);
|
|
1280
1296
|
} finally {
|
|
1281
|
-
|
|
1297
|
+
o.table.loading = !1;
|
|
1282
1298
|
}
|
|
1283
1299
|
},
|
|
1284
1300
|
/** 表格多选相关配置 */
|
|
@@ -1287,38 +1303,38 @@ const K = O.EDialog, Je = (i) => {
|
|
|
1287
1303
|
list: [],
|
|
1288
1304
|
/** 选中状态回调 */
|
|
1289
1305
|
change: (t) => {
|
|
1290
|
-
|
|
1306
|
+
o.table.selection.list = t;
|
|
1291
1307
|
},
|
|
1292
1308
|
/** 设置表格多选数据 */
|
|
1293
|
-
setList: (t,
|
|
1294
|
-
|
|
1295
|
-
const
|
|
1296
|
-
if (
|
|
1297
|
-
const
|
|
1298
|
-
const
|
|
1299
|
-
for (const h of
|
|
1300
|
-
if (
|
|
1301
|
-
if (h[
|
|
1302
|
-
} else if (h ===
|
|
1309
|
+
setList: (t, n) => {
|
|
1310
|
+
o.table.selection.list = [];
|
|
1311
|
+
const a = c.value;
|
|
1312
|
+
if (a?.clearSelection(), !a || !t?.length) return;
|
|
1313
|
+
const i = e.option.table?.rowKey, m = (u) => {
|
|
1314
|
+
const w = (f) => {
|
|
1315
|
+
for (const h of f) {
|
|
1316
|
+
if (i != null && i !== "") {
|
|
1317
|
+
if (h[i] === u[i]) return h;
|
|
1318
|
+
} else if (h === u)
|
|
1303
1319
|
return h;
|
|
1304
1320
|
if (Array.isArray(h.children) && h.children.length) {
|
|
1305
|
-
const
|
|
1306
|
-
if (
|
|
1321
|
+
const p = w(h.children);
|
|
1322
|
+
if (p !== void 0) return p;
|
|
1307
1323
|
}
|
|
1308
1324
|
}
|
|
1309
1325
|
};
|
|
1310
|
-
return
|
|
1326
|
+
return w(o.table.data);
|
|
1311
1327
|
};
|
|
1312
|
-
t.forEach((
|
|
1313
|
-
const
|
|
1314
|
-
if (
|
|
1315
|
-
if (
|
|
1316
|
-
const
|
|
1317
|
-
|
|
1328
|
+
t.forEach((u) => {
|
|
1329
|
+
const w = m(u);
|
|
1330
|
+
if (w)
|
|
1331
|
+
if (n) {
|
|
1332
|
+
const f = () => {
|
|
1333
|
+
a.toggleRowSelection(w, !0, !1);
|
|
1318
1334
|
};
|
|
1319
|
-
|
|
1335
|
+
n(u) !== !1 && f();
|
|
1320
1336
|
} else
|
|
1321
|
-
|
|
1337
|
+
a.toggleRowSelection(w, !0, !1);
|
|
1322
1338
|
});
|
|
1323
1339
|
}
|
|
1324
1340
|
},
|
|
@@ -1330,13 +1346,13 @@ const K = O.EDialog, Je = (i) => {
|
|
|
1330
1346
|
order: "",
|
|
1331
1347
|
/** 排序变更回调 */
|
|
1332
1348
|
change: (t) => {
|
|
1333
|
-
|
|
1334
|
-
const
|
|
1335
|
-
if (
|
|
1336
|
-
|
|
1349
|
+
M.config.table.sort.resetPage && (o.page.num = 1);
|
|
1350
|
+
const n = M.config.table.sort;
|
|
1351
|
+
if (n.change) {
|
|
1352
|
+
n.change(t, o);
|
|
1337
1353
|
return;
|
|
1338
1354
|
}
|
|
1339
|
-
|
|
1355
|
+
o.table.sort.prop = t.prop, t.order === null ? (o.table.sort.order = "", o.table.sort.prop = "") : o.table.sort.order = t.order === "ascending" ? n.order.asc : n.order.desc, o.table.getList();
|
|
1340
1356
|
}
|
|
1341
1357
|
}
|
|
1342
1358
|
},
|
|
@@ -1346,76 +1362,76 @@ const K = O.EDialog, Je = (i) => {
|
|
|
1346
1362
|
run: {
|
|
1347
1363
|
/** 执行指定方式的导出(如select、page、all) */
|
|
1348
1364
|
start: async (t) => {
|
|
1349
|
-
let
|
|
1350
|
-
const
|
|
1365
|
+
let n = await o.export.run[t](), a = e.option.column;
|
|
1366
|
+
const i = ObjectUtil.deepMerge(
|
|
1351
1367
|
{
|
|
1352
|
-
data:
|
|
1353
|
-
columns:
|
|
1368
|
+
data: n,
|
|
1369
|
+
columns: a
|
|
1354
1370
|
},
|
|
1355
1371
|
{}
|
|
1356
|
-
), m =
|
|
1357
|
-
m.before && m.before(
|
|
1372
|
+
), m = e.option.tools?.export || {};
|
|
1373
|
+
m.before && m.before(i), We.exportToExcel(i.data, i.columns, m.fileName);
|
|
1358
1374
|
},
|
|
1359
1375
|
/** 获取当前选中项进行导出 */
|
|
1360
1376
|
select: async () => {
|
|
1361
|
-
|
|
1377
|
+
o.export.loading = !0;
|
|
1362
1378
|
try {
|
|
1363
|
-
if (
|
|
1364
|
-
await
|
|
1365
|
-
...
|
|
1366
|
-
items:
|
|
1379
|
+
if (e.option.tools?.export?.select) {
|
|
1380
|
+
await e.option.tools?.export?.select({
|
|
1381
|
+
...o.page.getQuery(),
|
|
1382
|
+
items: o.table.selection.list
|
|
1367
1383
|
});
|
|
1368
1384
|
return;
|
|
1369
1385
|
}
|
|
1370
|
-
if (
|
|
1371
|
-
throw
|
|
1372
|
-
return
|
|
1386
|
+
if (o.table.selection.list.length === 0)
|
|
1387
|
+
throw D.fail(v.tCurd("selectDataToExport")), new Error(v.tCurd("selectDataToExport"));
|
|
1388
|
+
return o.table.selection.list;
|
|
1373
1389
|
} catch (t) {
|
|
1374
1390
|
console.error(t);
|
|
1375
1391
|
} finally {
|
|
1376
|
-
|
|
1392
|
+
o.export.loading = !1;
|
|
1377
1393
|
}
|
|
1378
1394
|
},
|
|
1379
1395
|
/** 导出当前页的数据 */
|
|
1380
1396
|
page: async () => {
|
|
1381
|
-
|
|
1397
|
+
o.export.loading = !0;
|
|
1382
1398
|
try {
|
|
1383
|
-
if (
|
|
1384
|
-
await
|
|
1385
|
-
...
|
|
1399
|
+
if (e.option.tools?.export?.page) {
|
|
1400
|
+
await e.option.tools?.export?.page({
|
|
1401
|
+
...o.page.getQuery()
|
|
1386
1402
|
});
|
|
1387
1403
|
return;
|
|
1388
1404
|
}
|
|
1389
|
-
if (
|
|
1390
|
-
throw
|
|
1391
|
-
return
|
|
1405
|
+
if (o.table.data.length === 0)
|
|
1406
|
+
throw D.fail(v.tCurd("noData")), new Error(v.tCurd("noData"));
|
|
1407
|
+
return o.table.data;
|
|
1392
1408
|
} catch (t) {
|
|
1393
1409
|
console.error(t);
|
|
1394
1410
|
} finally {
|
|
1395
|
-
|
|
1411
|
+
o.export.loading = !1;
|
|
1396
1412
|
}
|
|
1397
1413
|
},
|
|
1398
1414
|
/** 导出所有数据 */
|
|
1399
1415
|
all: async () => {
|
|
1400
|
-
|
|
1416
|
+
o.export.loading = !0;
|
|
1401
1417
|
try {
|
|
1402
|
-
if (
|
|
1403
|
-
await
|
|
1404
|
-
...
|
|
1418
|
+
if (e.option.tools?.export?.all) {
|
|
1419
|
+
await e.option.tools?.export?.all({
|
|
1420
|
+
...o.page.getQuery()
|
|
1405
1421
|
});
|
|
1406
1422
|
return;
|
|
1407
1423
|
}
|
|
1408
|
-
const t =
|
|
1409
|
-
...
|
|
1424
|
+
const t = e.option.api.list, n = await t({
|
|
1425
|
+
...o.page.getQuery({
|
|
1410
1426
|
size: 999999,
|
|
1411
1427
|
num: 1
|
|
1412
1428
|
})
|
|
1413
1429
|
});
|
|
1414
|
-
return (
|
|
1430
|
+
return (n.data || { [M.config.field.result.list]: n })[M.config.field.result.list];
|
|
1415
1431
|
} catch (t) {
|
|
1416
1432
|
console.error(t);
|
|
1417
1433
|
} finally {
|
|
1418
|
-
|
|
1434
|
+
o.export.loading = !1;
|
|
1419
1435
|
}
|
|
1420
1436
|
}
|
|
1421
1437
|
},
|
|
@@ -1423,7 +1439,7 @@ const K = O.EDialog, Je = (i) => {
|
|
|
1423
1439
|
loading: !1,
|
|
1424
1440
|
/** 执行导出操作的触发函数 */
|
|
1425
1441
|
click: (t) => {
|
|
1426
|
-
|
|
1442
|
+
o.export.loading || o.export.run.start(t);
|
|
1427
1443
|
}
|
|
1428
1444
|
},
|
|
1429
1445
|
/** 表单增删改弹窗相关对象 */
|
|
@@ -1439,7 +1455,7 @@ const K = O.EDialog, Je = (i) => {
|
|
|
1439
1455
|
/** 弹窗loading */
|
|
1440
1456
|
loading: !1,
|
|
1441
1457
|
/** 当前操作类型,插入或修改 */
|
|
1442
|
-
type:
|
|
1458
|
+
type: P.Update,
|
|
1443
1459
|
/** 当前操作表单数据 */
|
|
1444
1460
|
form: {},
|
|
1445
1461
|
/** 表单默认值 */
|
|
@@ -1447,34 +1463,34 @@ const K = O.EDialog, Je = (i) => {
|
|
|
1447
1463
|
/** 表单所有列,二维数组结构按行分组 */
|
|
1448
1464
|
formColumn: [],
|
|
1449
1465
|
/** 判断是否禁用当前字段 */
|
|
1450
|
-
getDisabled: (t,
|
|
1451
|
-
if (
|
|
1452
|
-
return t.disabled?.table === void 0 ? !1 :
|
|
1453
|
-
if (
|
|
1454
|
-
return t.disabled?.view === void 0 ? !0 :
|
|
1455
|
-
const
|
|
1456
|
-
return
|
|
1466
|
+
getDisabled: (t, n = !1) => {
|
|
1467
|
+
if (e.option.table?.editMode && n)
|
|
1468
|
+
return t.disabled?.table === void 0 ? !1 : D.isFun(t.disabled?.table, o.update.form);
|
|
1469
|
+
if (o.update.type === P.View)
|
|
1470
|
+
return t.disabled?.view === void 0 ? !0 : D.isFun(t.disabled?.view, o.update.form);
|
|
1471
|
+
const a = t.disabled?.[o.update.type === P.Add ? "create" : "update"];
|
|
1472
|
+
return D.isFun(a, o.update.form);
|
|
1457
1473
|
},
|
|
1458
1474
|
/** 获取表单组件绑定属性 */
|
|
1459
|
-
getBind: (t) => t.options?.[
|
|
1475
|
+
getBind: (t) => t.options?.[o.update.type === P.Add ? "formAdd" : "formUpdate"]?.[t.type] || t.options?.[t.type] || {},
|
|
1460
1476
|
/** 获取表单组件事件属性 */
|
|
1461
|
-
getOn: (t,
|
|
1462
|
-
const
|
|
1463
|
-
return Object.keys(
|
|
1464
|
-
const
|
|
1465
|
-
typeof
|
|
1466
|
-
return
|
|
1467
|
-
} : m[
|
|
1477
|
+
getOn: (t, n) => {
|
|
1478
|
+
const i = t.options?.[o.update.type === P.Add ? "formAdd" : "formUpdate"]?.[t.type]?.on || t.options?.[t.type]?.on || {}, m = {};
|
|
1479
|
+
return Object.keys(i).forEach((u) => {
|
|
1480
|
+
const w = i[u];
|
|
1481
|
+
typeof w == "function" ? m[u] = function(...f) {
|
|
1482
|
+
return w.apply(this, [...f, n || o.update.form, t]);
|
|
1483
|
+
} : m[u] = w;
|
|
1468
1484
|
}), m;
|
|
1469
1485
|
},
|
|
1470
1486
|
/** 获取表单组件绑定属性和事件 */
|
|
1471
1487
|
getOptions: (t) => {
|
|
1472
1488
|
try {
|
|
1473
|
-
const
|
|
1474
|
-
return
|
|
1475
|
-
options:
|
|
1489
|
+
const a = o.update.formColumn.flat().find((i) => i.item.key === t)?.item;
|
|
1490
|
+
return a ? {
|
|
1491
|
+
options: a.options,
|
|
1476
1492
|
// @ts-ignore
|
|
1477
|
-
bind:
|
|
1493
|
+
bind: o.update.getBind(a)
|
|
1478
1494
|
} : { options: {}, bind: {} };
|
|
1479
1495
|
} catch {
|
|
1480
1496
|
return { options: {}, bind: {} };
|
|
@@ -1486,79 +1502,90 @@ const K = O.EDialog, Je = (i) => {
|
|
|
1486
1502
|
data: {},
|
|
1487
1503
|
/** 返回编辑时与原值的变更数据,用于局部更新API */
|
|
1488
1504
|
getApiData: (t) => {
|
|
1489
|
-
if (
|
|
1505
|
+
if (e.option.form?.editAll)
|
|
1490
1506
|
return t;
|
|
1491
|
-
let
|
|
1492
|
-
[
|
|
1507
|
+
let n = {
|
|
1508
|
+
[e.option.table?.rowKey]: o.update.edit.data[e.option.table?.rowKey]
|
|
1493
1509
|
};
|
|
1494
|
-
return Object.keys(
|
|
1495
|
-
t[
|
|
1496
|
-
}),
|
|
1510
|
+
return Object.keys(o.update.edit.data).forEach((a) => {
|
|
1511
|
+
t[a] !== o.update.edit.data[a] && (n[a] = t[a]);
|
|
1512
|
+
}), n;
|
|
1497
1513
|
}
|
|
1498
1514
|
},
|
|
1499
1515
|
view: {},
|
|
1500
1516
|
/** 打开增改弹窗 */
|
|
1501
|
-
open: (t,
|
|
1502
|
-
|
|
1503
|
-
|
|
1517
|
+
open: (t, n) => {
|
|
1518
|
+
o.update.showContent || FunUtil.throttle(async () => {
|
|
1519
|
+
D.loading(!0);
|
|
1504
1520
|
try {
|
|
1505
|
-
|
|
1506
|
-
const
|
|
1507
|
-
|
|
1508
|
-
const
|
|
1509
|
-
|
|
1510
|
-
} catch (
|
|
1511
|
-
console.error(
|
|
1521
|
+
o.update.type = t;
|
|
1522
|
+
const a = t === P.Add;
|
|
1523
|
+
o.update.edit.data = n, o.update.title = v.tCurd(a ? "add" : t === P.View ? "view" : "edit");
|
|
1524
|
+
const i = ObjectUtil.deepMerge(a ? o.update.formDefault : n, {});
|
|
1525
|
+
_.setValue(o.update.form, i, !0), await o.initApiData("update"), await e.option.form?.openBefore?.(o.update.form, o.update), (!e.option.table?.inlineEdit || a) && (o.update.show = !0, o.update.showContent = !0), e.option.form?.openAfter?.(o.update.form, o.update);
|
|
1526
|
+
} catch (a) {
|
|
1527
|
+
console.error(a);
|
|
1512
1528
|
} finally {
|
|
1513
|
-
|
|
1529
|
+
D.loading(!1);
|
|
1514
1530
|
}
|
|
1515
1531
|
});
|
|
1516
1532
|
},
|
|
1517
1533
|
/** 提交增改表单操作 */
|
|
1518
1534
|
submit: () => {
|
|
1519
1535
|
FunUtil.throttle(async () => {
|
|
1520
|
-
await f.value?.validate(async (s, m) => new Promise((p, u) => {
|
|
1521
|
-
s || (O.fail(w.tCurd("checkFormData")), u(!1)), p();
|
|
1522
|
-
})), a.update.loading = !0;
|
|
1523
|
-
const t = a.update.type === K.Add ? i.option.api.create : i.option.api.update;
|
|
1524
1536
|
try {
|
|
1525
|
-
await
|
|
1537
|
+
await Promise.all([
|
|
1538
|
+
s.value?.validate(async (i, m) => new Promise((u, w) => {
|
|
1539
|
+
i || w(!1), u();
|
|
1540
|
+
})),
|
|
1541
|
+
o.formRef.validate()
|
|
1542
|
+
]);
|
|
1526
1543
|
} catch {
|
|
1527
|
-
|
|
1544
|
+
D.fail(v.tCurd("checkFormData"));
|
|
1528
1545
|
return;
|
|
1529
1546
|
}
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1547
|
+
e.form && Object.keys(e.form).forEach((i) => {
|
|
1548
|
+
o.update.form[i] = e.form[i];
|
|
1549
|
+
}), o.update.loading = !0;
|
|
1550
|
+
const t = o.update.type === P.Add ? e.option.api.create : e.option.api.update;
|
|
1551
|
+
try {
|
|
1552
|
+
await e.option.form?.submitBefore?.(o.update.form, o.update);
|
|
1553
|
+
} catch {
|
|
1554
|
+
o.update.loading = !1;
|
|
1555
|
+
return;
|
|
1556
|
+
}
|
|
1557
|
+
let n = ObjectUtil.deepMerge(o.update.form, {});
|
|
1558
|
+
delete n.children;
|
|
1559
|
+
const a = new Set(e.option.column.filter((i) => i.type === "datetime").map((i) => i.key));
|
|
1560
|
+
Object.keys(n).forEach((i) => {
|
|
1561
|
+
if (a.has(i) && n[i] != null) {
|
|
1562
|
+
const m = new Date(n[i]).getTime();
|
|
1563
|
+
isNaN(m) || (n[i] = m);
|
|
1537
1564
|
}
|
|
1538
1565
|
});
|
|
1539
1566
|
try {
|
|
1540
1567
|
if (!t) return;
|
|
1541
1568
|
await t({
|
|
1542
|
-
...
|
|
1543
|
-
}),
|
|
1544
|
-
} catch (
|
|
1545
|
-
console.error(
|
|
1569
|
+
...n
|
|
1570
|
+
}), o.update.close(), await o.table.getList(), e.option.form?.submitAfter?.(n, o.update);
|
|
1571
|
+
} catch (i) {
|
|
1572
|
+
console.error(i);
|
|
1546
1573
|
} finally {
|
|
1547
|
-
|
|
1574
|
+
o.update.loading = !1;
|
|
1548
1575
|
}
|
|
1549
1576
|
});
|
|
1550
1577
|
},
|
|
1551
1578
|
/** 关闭弹窗和内容 */
|
|
1552
1579
|
close: () => {
|
|
1553
|
-
|
|
1554
|
-
|
|
1580
|
+
o.update.show = !1, e.option.table?.inlineEdit && (o.update.form = {}), setTimeout(() => {
|
|
1581
|
+
o.update.showContent = !1;
|
|
1555
1582
|
}, 350);
|
|
1556
1583
|
}
|
|
1557
1584
|
},
|
|
1558
1585
|
/** 删除操作弹窗与数据对象 */
|
|
1559
1586
|
remove: {
|
|
1560
1587
|
/** 删除弹窗标题 */
|
|
1561
|
-
title:
|
|
1588
|
+
title: v.tCurd("deleteTitle"),
|
|
1562
1589
|
/** 删除弹窗显示控制 */
|
|
1563
1590
|
show: !1,
|
|
1564
1591
|
/** 待删除数据项集合 */
|
|
@@ -1567,74 +1594,74 @@ const K = O.EDialog, Je = (i) => {
|
|
|
1567
1594
|
loading: !1,
|
|
1568
1595
|
/** 关闭删除弹窗 */
|
|
1569
1596
|
close: () => {
|
|
1570
|
-
|
|
1597
|
+
o.remove.show = !1;
|
|
1571
1598
|
},
|
|
1572
1599
|
/** 打开删除弹窗并设置待删除项 */
|
|
1573
1600
|
open: (t) => {
|
|
1574
1601
|
if (t.length === 0) {
|
|
1575
|
-
|
|
1602
|
+
D.fail(v.tCurd("selectDataToDelete"));
|
|
1576
1603
|
return;
|
|
1577
1604
|
}
|
|
1578
|
-
|
|
1605
|
+
o.remove.items = t, o.remove.show = !0;
|
|
1579
1606
|
},
|
|
1580
1607
|
/** 执行删除实际操作 */
|
|
1581
1608
|
submit: () => {
|
|
1582
1609
|
FunUtil.throttle(async () => {
|
|
1583
|
-
|
|
1584
|
-
const t =
|
|
1610
|
+
o.remove.loading = !0;
|
|
1611
|
+
const t = e.option.api.delete;
|
|
1585
1612
|
try {
|
|
1586
1613
|
if (!t) return;
|
|
1587
1614
|
await t({
|
|
1588
|
-
[
|
|
1589
|
-
items:
|
|
1590
|
-
}),
|
|
1591
|
-
} catch (
|
|
1592
|
-
console.error(
|
|
1615
|
+
[e.option.table?.rowKey]: o.remove.items.map((n) => n[e.option.table?.rowKey]),
|
|
1616
|
+
items: o.remove.items
|
|
1617
|
+
}), D.success(v.tCurd("operationSuccess")), o.table.data.length <= 1 && o.page.num > 1 && (o.page.num -= 1), o.remove.close(), await o.table.getList();
|
|
1618
|
+
} catch (n) {
|
|
1619
|
+
console.error(n);
|
|
1593
1620
|
} finally {
|
|
1594
|
-
|
|
1621
|
+
o.remove.loading = !1;
|
|
1595
1622
|
}
|
|
1596
1623
|
});
|
|
1597
1624
|
}
|
|
1598
1625
|
},
|
|
1599
1626
|
/** 初始化curd关联所有默认与依赖配置及表单列 */
|
|
1600
1627
|
init: () => {
|
|
1601
|
-
|
|
1628
|
+
o.initCurdConfig(), o.initColumnOptions(), o.initColumnForm();
|
|
1602
1629
|
},
|
|
1603
1630
|
/** 下拉请求等数据缓存 */
|
|
1604
1631
|
apiDataMap: {},
|
|
1605
1632
|
/** 获取并绑定curd中所有下拉数据等远程依赖 */
|
|
1606
1633
|
initApiData: async (t) => {
|
|
1607
|
-
const
|
|
1608
|
-
if (
|
|
1609
|
-
|
|
1634
|
+
const n = [], a = (i) => {
|
|
1635
|
+
if (i.children && i.children.length) {
|
|
1636
|
+
i.children.forEach((m) => a(m));
|
|
1610
1637
|
return;
|
|
1611
1638
|
}
|
|
1612
|
-
if (
|
|
1613
|
-
if (
|
|
1639
|
+
if (i.options?.[i.type]?.dataApi && i.options?.[i.type]?.dataApiConfig?.[t]) {
|
|
1640
|
+
if (o.apiDataMap[i.key] && i.options?.[i.type]?.dataApiConfig?.once) return;
|
|
1614
1641
|
const m = (async () => {
|
|
1615
1642
|
try {
|
|
1616
|
-
let
|
|
1617
|
-
if (
|
|
1618
|
-
const
|
|
1619
|
-
!Array.isArray(
|
|
1643
|
+
let u = await i.options?.[i.type]?.dataApi?.(o.update.form, o.update.type);
|
|
1644
|
+
if (u) {
|
|
1645
|
+
const w = i.options?.[i.type]?.dataPath;
|
|
1646
|
+
!Array.isArray(u) && w && (u = ObjectUtil.getPathValue(u, w)), i.options[i.type].data = u, i.options.search[i.type].data = u, i.options.search[i.options.search.type ?? i.type] || (i.options.search[i.options.search.type ?? i.type] = {}), i.options.search[i.options.search.type ?? i.type].data = u, i.options.formAdd[i.type].data = u, i.options.formUpdate[i.type].data = u, o.apiDataMap[i.key] = u;
|
|
1620
1647
|
}
|
|
1621
1648
|
} catch {
|
|
1622
1649
|
}
|
|
1623
1650
|
})();
|
|
1624
|
-
|
|
1651
|
+
n.push(m);
|
|
1625
1652
|
}
|
|
1626
1653
|
};
|
|
1627
|
-
return
|
|
1628
|
-
|
|
1629
|
-
}), await Promise.all(
|
|
1654
|
+
return e.option.column.forEach((i) => {
|
|
1655
|
+
a(i);
|
|
1656
|
+
}), await Promise.all(n), !0;
|
|
1630
1657
|
},
|
|
1631
1658
|
/** 初始化curd配置(option默认值合并等) */
|
|
1632
1659
|
initCurdConfig: () => {
|
|
1633
|
-
const t = ObjectUtil.deepMerge(
|
|
1634
|
-
t.table.emptyText =
|
|
1635
|
-
const
|
|
1636
|
-
Object.keys(
|
|
1637
|
-
|
|
1660
|
+
const t = ObjectUtil.deepMerge(M.config, {});
|
|
1661
|
+
t.table.emptyText = v.tCurd("noData"), e.option.size = e.option.size || {}, t.table.size = e.option.size.table || t.size.table, t.form.size = e.option.size.form || t.size.form, t.size.search = e.option.size.search || t.size.search;
|
|
1662
|
+
const n = ObjectUtil.deepMerge(t, e.option || {});
|
|
1663
|
+
Object.keys(n).forEach((a) => {
|
|
1664
|
+
e.option[a] = n[a];
|
|
1638
1665
|
});
|
|
1639
1666
|
},
|
|
1640
1667
|
/**
|
|
@@ -1643,205 +1670,205 @@ const K = O.EDialog, Je = (i) => {
|
|
|
1643
1670
|
* @returns
|
|
1644
1671
|
*/
|
|
1645
1672
|
initColumnOptions: () => {
|
|
1646
|
-
let t = JSONUtil.cp(
|
|
1673
|
+
let t = JSONUtil.cp(M.config.columnConfig);
|
|
1647
1674
|
t.options = ObjectUtil.deepMerge(
|
|
1648
1675
|
{
|
|
1649
1676
|
switch: {
|
|
1650
|
-
activeText:
|
|
1651
|
-
inactiveText:
|
|
1677
|
+
activeText: v.tCurd("switchOn"),
|
|
1678
|
+
inactiveText: v.tCurd("switchOff")
|
|
1652
1679
|
}
|
|
1653
1680
|
},
|
|
1654
1681
|
t.options
|
|
1655
1682
|
);
|
|
1656
|
-
const
|
|
1657
|
-
for (const
|
|
1658
|
-
if (
|
|
1659
|
-
if (
|
|
1660
|
-
|
|
1661
|
-
|
|
1683
|
+
const n = (a) => {
|
|
1684
|
+
for (const i in t) {
|
|
1685
|
+
if (i === "table") {
|
|
1686
|
+
if (a.table = ObjectUtil.deepMerge(t.table, a.table || {}), a.children) {
|
|
1687
|
+
a.children.forEach((u) => {
|
|
1688
|
+
n(u);
|
|
1662
1689
|
});
|
|
1663
1690
|
return;
|
|
1664
1691
|
}
|
|
1665
|
-
} else
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
}),
|
|
1692
|
+
} else i === "type" ? a.type = a.type || t.type : a[i] = ObjectUtil.deepMerge(t[i], a[i] || {});
|
|
1693
|
+
a.options = a.options || {}, a.options[a.type] = a.options[a.type] || {}, a.options[a.type].size = e.option.size.form, ["search", "formAdd", "formUpdate"].forEach((u) => {
|
|
1694
|
+
a.options[u] = a.options[u] || ObjectUtil.deepMerge(a.options, {}), a.options[u][a.type] = a.options[u][a.type] || {}, a.options[u][a.type].size = u === "search" ? e.option.size.search : e.option.size.form;
|
|
1695
|
+
}), a.table = ObjectUtil.deepMerge(a.table, a.options[a.type].table || {});
|
|
1669
1696
|
}
|
|
1670
|
-
|
|
1671
|
-
const
|
|
1697
|
+
a.type === "switch" && (a.options.switch.tableBeforeChange = async (i, m) => {
|
|
1698
|
+
const u = a.options?.switch;
|
|
1672
1699
|
try {
|
|
1673
|
-
|
|
1674
|
-
title:
|
|
1675
|
-
content:
|
|
1700
|
+
u.tableConfig?.confirm && await r.value?.open({
|
|
1701
|
+
title: v.tCurd("confirmModify"),
|
|
1702
|
+
content: v.tCurd("confirmSwitchMessage")
|
|
1676
1703
|
});
|
|
1677
1704
|
try {
|
|
1678
|
-
if (!
|
|
1679
|
-
const
|
|
1680
|
-
|
|
1681
|
-
const
|
|
1705
|
+
if (!e.option.api.update && !u.tableConfig?.api) return;
|
|
1706
|
+
const w = m[e.option.table?.rowKey];
|
|
1707
|
+
u.loadingMap || (u.loadingMap = {}), u.loadingMap[w] || (u.loadingMap[w] = { loading: !1 }), u.loadingMap[w].loading = !0;
|
|
1708
|
+
const f = m[i] === u.activeValue ? u.inactiveValue : u.activeValue, h = u.tableConfig?.api ? u.tableConfig.api : e.option.api.update;
|
|
1682
1709
|
if (!h) return;
|
|
1683
1710
|
try {
|
|
1684
1711
|
await h(
|
|
1685
1712
|
{
|
|
1686
1713
|
...m,
|
|
1687
|
-
[
|
|
1714
|
+
[i]: f
|
|
1688
1715
|
},
|
|
1689
1716
|
"switch"
|
|
1690
1717
|
);
|
|
1691
1718
|
} catch {
|
|
1692
1719
|
return !1;
|
|
1693
1720
|
} finally {
|
|
1694
|
-
|
|
1721
|
+
u.loadingMap[w].loading = !1;
|
|
1695
1722
|
}
|
|
1696
|
-
return
|
|
1697
|
-
} catch (
|
|
1698
|
-
return console.error(
|
|
1723
|
+
return D.success(v.tCurd("operationSuccess")), u.tableConfig?.loadList && (o.table.loading = !0, o.table.getList(), o.table.loading = !1), !0;
|
|
1724
|
+
} catch (w) {
|
|
1725
|
+
return console.error(w), !1;
|
|
1699
1726
|
} finally {
|
|
1700
|
-
|
|
1727
|
+
o.table.loading = !1;
|
|
1701
1728
|
}
|
|
1702
1729
|
} catch {
|
|
1703
1730
|
return !1;
|
|
1704
1731
|
}
|
|
1705
|
-
}),
|
|
1732
|
+
}), a.type === "treeSelect" && (a.options.treeSelect.rowKey = e.option.table?.rowKey, a.options.treeSelect.nodeKey = e.option.table?.rowKey);
|
|
1706
1733
|
};
|
|
1707
|
-
|
|
1734
|
+
e.option.column.forEach(n), e.option.table?.column?.forEach(n);
|
|
1708
1735
|
},
|
|
1709
|
-
getColumnSpan: (t,
|
|
1736
|
+
getColumnSpan: (t, n) => {
|
|
1710
1737
|
if (t.item.form?.spanCol) {
|
|
1711
|
-
const
|
|
1712
|
-
return (t.item?.form.span ||
|
|
1738
|
+
const a = M.config.form.defaultSpan, m = n.filter((u) => !D.isFun(u.item.show?.form, o.update.form, o.update.type)).reduce((u, w) => u + (w.item.form?.span || a), 0);
|
|
1739
|
+
return (t.item?.form.span || a) + m;
|
|
1713
1740
|
}
|
|
1714
1741
|
return t.item.form.span;
|
|
1715
1742
|
},
|
|
1716
1743
|
/** 初始化配置并生成表单列及默认值及规则 */
|
|
1717
1744
|
initColumnForm: () => {
|
|
1718
|
-
const t =
|
|
1719
|
-
|
|
1745
|
+
const t = e.option;
|
|
1746
|
+
o.update.formColumn = [], o.table.column.show = {
|
|
1720
1747
|
list: [],
|
|
1721
1748
|
listSource: []
|
|
1722
1749
|
};
|
|
1723
|
-
const
|
|
1750
|
+
const n = [], a = e.option.form?.maxSpan || 12, i = e.option.form?.defaultSpan || a / 2;
|
|
1724
1751
|
let m = [];
|
|
1725
|
-
const
|
|
1726
|
-
if (
|
|
1727
|
-
|
|
1728
|
-
|
|
1752
|
+
const u = (p) => {
|
|
1753
|
+
if (p.children) {
|
|
1754
|
+
o.table.column.show.list.push(p.key), p.children.forEach((k) => {
|
|
1755
|
+
u(k);
|
|
1729
1756
|
});
|
|
1730
1757
|
return;
|
|
1731
1758
|
}
|
|
1732
|
-
if (
|
|
1733
|
-
|
|
1734
|
-
let
|
|
1735
|
-
const
|
|
1736
|
-
if (m.push({ item:
|
|
1737
|
-
const
|
|
1738
|
-
input:
|
|
1739
|
-
select:
|
|
1740
|
-
},
|
|
1759
|
+
if (o.update.formDefault[p.key] = p.value, p.table.table && (p.show.table && o.table.column.show.list.push(p.key), p.table.table && o.table.column.show.listSource.push(p.key)), !(p.isForm && typeof p.show?.form == "boolean") || p.show?.form) {
|
|
1760
|
+
p.form = p.form || { span: i }, p.form.span = p.form.span ?? i;
|
|
1761
|
+
let k = p.form.span, F = m.reduce((L, I) => L + I.span, k);
|
|
1762
|
+
const B = m.length;
|
|
1763
|
+
if (m.push({ item: p, span: k }), (B === 1 && m[0].span === 0 || F >= a || k === 0 && B > 1) && (n.push(m), m = []), p.rules) {
|
|
1764
|
+
const L = {
|
|
1765
|
+
input: v.tCurd("placeholderInput"),
|
|
1766
|
+
select: v.tCurd("placeholderSelect")
|
|
1767
|
+
}, I = (L[p.type] || L.input) + p.label, N = typeof p.rules == "boolean" ? [
|
|
1741
1768
|
{
|
|
1742
1769
|
required: !0,
|
|
1743
|
-
message:
|
|
1770
|
+
message: I,
|
|
1744
1771
|
trigger: "blur"
|
|
1745
1772
|
}
|
|
1746
|
-
] :
|
|
1747
|
-
|
|
1748
|
-
if (
|
|
1749
|
-
const
|
|
1773
|
+
] : p.rules;
|
|
1774
|
+
o.update.rules[p.key] = N.map((oe) => {
|
|
1775
|
+
if (oe.validator) {
|
|
1776
|
+
const ke = oe.validator;
|
|
1750
1777
|
return {
|
|
1751
|
-
...
|
|
1752
|
-
validator: (
|
|
1778
|
+
...oe,
|
|
1779
|
+
validator: (ve, Ce, Ve) => ke(ve, Ce, Ve, o.update.form)
|
|
1753
1780
|
};
|
|
1754
1781
|
}
|
|
1755
|
-
return
|
|
1782
|
+
return oe;
|
|
1756
1783
|
});
|
|
1757
1784
|
}
|
|
1758
1785
|
}
|
|
1759
|
-
},
|
|
1760
|
-
|
|
1786
|
+
}, w = (p, k) => {
|
|
1787
|
+
p.isForm = k, Array.isArray(p.children) && p.children.forEach((F) => w(F, k));
|
|
1761
1788
|
};
|
|
1762
|
-
t.column.forEach((
|
|
1763
|
-
|
|
1764
|
-
}),
|
|
1765
|
-
|
|
1766
|
-
}),
|
|
1767
|
-
const
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
}), t.column.forEach((
|
|
1771
|
-
|
|
1789
|
+
t.column.forEach((p) => {
|
|
1790
|
+
p.isForm = !0, w(p, !0), u(p);
|
|
1791
|
+
}), e.option.table?.column?.forEach((p) => {
|
|
1792
|
+
w(p, !1), u(p);
|
|
1793
|
+
}), o.search.column.list = t.column.concat(t.table?.column || []), o.table.column.list = o.search.column.list.filter((p) => p.table?.table), o.search.column.list.sort((p, k) => p.sort?.search - k.sort?.search), o.table.column.list.sort((p, k) => p.sort?.table - k.sort?.table), m.length > 0 && n.push(m), o.update.formColumn = n;
|
|
1794
|
+
const f = e.option.search?.formDefault;
|
|
1795
|
+
f && Object.keys(f).forEach((p) => {
|
|
1796
|
+
o.search.formDefault[p] = f[p];
|
|
1797
|
+
}), t.column.forEach((p) => {
|
|
1798
|
+
p.show?.search || (o.search.formDefault[p.key] = void 0);
|
|
1772
1799
|
});
|
|
1773
|
-
const h = ObjectUtil.deepMerge(
|
|
1774
|
-
|
|
1800
|
+
const h = ObjectUtil.deepMerge(o.search.formDefault, {});
|
|
1801
|
+
_.setValue(o.search.form, h, !0);
|
|
1775
1802
|
}
|
|
1776
1803
|
});
|
|
1777
|
-
return
|
|
1778
|
-
|
|
1779
|
-
}),
|
|
1780
|
-
() =>
|
|
1804
|
+
return o.init(), ye(() => {
|
|
1805
|
+
e.option.init !== !1 && o.table.getList();
|
|
1806
|
+
}), e.form && re(
|
|
1807
|
+
() => o.update.form,
|
|
1781
1808
|
(t) => {
|
|
1782
|
-
Object.keys(
|
|
1783
|
-
|
|
1809
|
+
Object.keys(o.update.form).forEach((n) => {
|
|
1810
|
+
e.form[n] = o.update.form[n];
|
|
1784
1811
|
});
|
|
1785
1812
|
},
|
|
1786
1813
|
{
|
|
1787
1814
|
deep: !0,
|
|
1788
1815
|
immediate: !0
|
|
1789
1816
|
}
|
|
1790
|
-
),
|
|
1791
|
-
() =>
|
|
1817
|
+
), e.searchForm && re(
|
|
1818
|
+
() => o.search.form,
|
|
1792
1819
|
(t) => {
|
|
1793
|
-
Object.keys(
|
|
1794
|
-
|
|
1820
|
+
Object.keys(o.search.form).forEach((n) => {
|
|
1821
|
+
e.searchForm[n] = o.search.form[n];
|
|
1795
1822
|
});
|
|
1796
1823
|
},
|
|
1797
1824
|
{
|
|
1798
1825
|
deep: !0,
|
|
1799
1826
|
immediate: !0
|
|
1800
1827
|
}
|
|
1801
|
-
), { conf:
|
|
1802
|
-
}, qe = { class: "dialog-footer" }, Qe = /* @__PURE__ */
|
|
1828
|
+
), we.setConf(o), { conf: o, switchConfirmRef: r, ruleFormRef: s, tableRef: c };
|
|
1829
|
+
}, qe = { class: "dialog-footer" }, Qe = /* @__PURE__ */ K({
|
|
1803
1830
|
__name: "switchConfirm",
|
|
1804
1831
|
props: {
|
|
1805
1832
|
size: {}
|
|
1806
1833
|
},
|
|
1807
|
-
setup(
|
|
1808
|
-
const
|
|
1809
|
-
let t = null,
|
|
1810
|
-
const
|
|
1811
|
-
t =
|
|
1812
|
-
})),
|
|
1813
|
-
|
|
1834
|
+
setup(e, { expose: r }) {
|
|
1835
|
+
const s = J(!1), c = J("确认修改"), o = J("确认要修改状态吗?");
|
|
1836
|
+
let t = null, n = null;
|
|
1837
|
+
const a = (u) => (u?.title && (c.value = u.title), u?.content && (o.value = u.content), s.value = !0, new Promise((w, f) => {
|
|
1838
|
+
t = w, n = f;
|
|
1839
|
+
})), i = () => {
|
|
1840
|
+
s.value = !1, t?.(!0), t = null, n = null;
|
|
1814
1841
|
}, m = () => {
|
|
1815
|
-
|
|
1842
|
+
s.value = !1, n?.(new Error("用户取消操作")), t = null, n = null;
|
|
1816
1843
|
};
|
|
1817
|
-
return
|
|
1818
|
-
open:
|
|
1819
|
-
}), (
|
|
1820
|
-
const
|
|
1844
|
+
return r({
|
|
1845
|
+
open: a
|
|
1846
|
+
}), (u, w) => {
|
|
1847
|
+
const f = te("el-form");
|
|
1821
1848
|
return d(), y(l(ie), {
|
|
1822
|
-
modelValue:
|
|
1823
|
-
"onUpdate:modelValue":
|
|
1824
|
-
title:
|
|
1849
|
+
modelValue: s.value,
|
|
1850
|
+
"onUpdate:modelValue": w[0] || (w[0] = (h) => s.value = h),
|
|
1851
|
+
title: c.value,
|
|
1825
1852
|
"close-on-click-modal": !1,
|
|
1826
1853
|
width: "400px"
|
|
1827
1854
|
}, {
|
|
1828
1855
|
footer: g(() => [
|
|
1829
|
-
|
|
1856
|
+
E(f, { size: e.size }, {
|
|
1830
1857
|
default: g(() => [
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
default: g(() =>
|
|
1834
|
-
|
|
1835
|
-
])),
|
|
1858
|
+
U("span", qe, [
|
|
1859
|
+
E(l(T), { onClick: m }, {
|
|
1860
|
+
default: g(() => [...w[1] || (w[1] = [
|
|
1861
|
+
O("取消", -1)
|
|
1862
|
+
])]),
|
|
1836
1863
|
_: 1
|
|
1837
1864
|
}),
|
|
1838
|
-
|
|
1865
|
+
E(l(T), {
|
|
1839
1866
|
type: "primary",
|
|
1840
|
-
onClick:
|
|
1867
|
+
onClick: i
|
|
1841
1868
|
}, {
|
|
1842
|
-
default: g(() =>
|
|
1843
|
-
|
|
1844
|
-
])),
|
|
1869
|
+
default: g(() => [...w[2] || (w[2] = [
|
|
1870
|
+
O("确认", -1)
|
|
1871
|
+
])]),
|
|
1845
1872
|
_: 1
|
|
1846
1873
|
})
|
|
1847
1874
|
])
|
|
@@ -1850,409 +1877,398 @@ const K = O.EDialog, Je = (i) => {
|
|
|
1850
1877
|
}, 8, ["size"])
|
|
1851
1878
|
]),
|
|
1852
1879
|
default: g(() => [
|
|
1853
|
-
|
|
1880
|
+
U("div", null, S(o.value), 1)
|
|
1854
1881
|
]),
|
|
1855
1882
|
_: 1
|
|
1856
1883
|
}, 8, ["modelValue", "title"]);
|
|
1857
1884
|
};
|
|
1858
1885
|
}
|
|
1859
|
-
}), Y = (
|
|
1860
|
-
const
|
|
1861
|
-
for (const [
|
|
1862
|
-
|
|
1863
|
-
return
|
|
1886
|
+
}), Y = (e, r) => {
|
|
1887
|
+
const s = e.__vccOpts || e;
|
|
1888
|
+
for (const [c, o] of r)
|
|
1889
|
+
s[c] = o;
|
|
1890
|
+
return s;
|
|
1864
1891
|
}, Ge = {}, Xe = {
|
|
1865
1892
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1866
1893
|
viewBox: "0 0 1024 1024"
|
|
1867
1894
|
};
|
|
1868
|
-
function Ye(
|
|
1869
|
-
return d(), b("svg", Xe,
|
|
1870
|
-
|
|
1895
|
+
function Ye(e, r) {
|
|
1896
|
+
return d(), b("svg", Xe, [...r[0] || (r[0] = [
|
|
1897
|
+
U("path", {
|
|
1871
1898
|
fill: "currentColor",
|
|
1872
1899
|
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"
|
|
1873
1900
|
}, null, -1)
|
|
1874
|
-
]));
|
|
1901
|
+
])]);
|
|
1875
1902
|
}
|
|
1876
|
-
const Ze = /* @__PURE__ */ Y(Ge, [["render", Ye]]),
|
|
1903
|
+
const Ze = /* @__PURE__ */ Y(Ge, [["render", Ye]]), _e = ["innerHTML"], et = /* @__PURE__ */ K({
|
|
1877
1904
|
__name: "text",
|
|
1878
1905
|
props: {
|
|
1879
1906
|
content: {},
|
|
1880
1907
|
value: {}
|
|
1881
1908
|
},
|
|
1882
|
-
setup(
|
|
1883
|
-
const
|
|
1884
|
-
return (
|
|
1909
|
+
setup(e) {
|
|
1910
|
+
const r = e, s = be(() => typeof r.content == "function" ? r.content(r.value) : r.content);
|
|
1911
|
+
return (c, o) => typeof s.value == "object" ? (d(), y(q(s.value), { key: 0 })) : (d(), b("div", {
|
|
1885
1912
|
key: 1,
|
|
1886
|
-
innerHTML:
|
|
1887
|
-
}, null, 8,
|
|
1913
|
+
innerHTML: s.value
|
|
1914
|
+
}, null, 8, _e));
|
|
1888
1915
|
}
|
|
1889
|
-
}),
|
|
1916
|
+
}), tt = {}, ot = {
|
|
1890
1917
|
"data-v-58697b5c": "",
|
|
1891
1918
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1892
1919
|
viewBox: "0 0 1024 1024"
|
|
1893
1920
|
};
|
|
1894
|
-
function
|
|
1895
|
-
return d(), b("svg",
|
|
1896
|
-
|
|
1921
|
+
function at(e, r) {
|
|
1922
|
+
return d(), b("svg", ot, [...r[0] || (r[0] = [
|
|
1923
|
+
U("path", {
|
|
1897
1924
|
fill: "currentColor",
|
|
1898
1925
|
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"
|
|
1899
1926
|
}, null, -1)
|
|
1900
|
-
]));
|
|
1927
|
+
])]);
|
|
1901
1928
|
}
|
|
1902
|
-
const
|
|
1929
|
+
const lt = /* @__PURE__ */ Y(tt, [["render", at]]), nt = {}, it = {
|
|
1903
1930
|
"data-v-58697b5c": "",
|
|
1904
1931
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1905
1932
|
viewBox: "0 0 1024 1024"
|
|
1906
1933
|
};
|
|
1907
|
-
function
|
|
1908
|
-
return d(), b("svg",
|
|
1909
|
-
|
|
1934
|
+
function rt(e, r) {
|
|
1935
|
+
return d(), b("svg", it, [...r[0] || (r[0] = [
|
|
1936
|
+
U("path", {
|
|
1910
1937
|
fill: "currentColor",
|
|
1911
1938
|
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-38.4 409.6H326.4a38.4 38.4 0 1 0 0 76.8h147.2v147.2a38.4 38.4 0 0 0 76.8 0V550.4h147.2a38.4 38.4 0 0 0 0-76.8H550.4V326.4a38.4 38.4 0 1 0-76.8 0z"
|
|
1912
1939
|
}, null, -1)
|
|
1913
|
-
]));
|
|
1940
|
+
])]);
|
|
1914
1941
|
}
|
|
1915
|
-
const
|
|
1942
|
+
const dt = /* @__PURE__ */ Y(nt, [["render", rt]]), st = {}, ut = {
|
|
1916
1943
|
"data-v-58697b5c": "",
|
|
1917
1944
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1918
1945
|
viewBox: "0 0 1024 1024"
|
|
1919
1946
|
};
|
|
1920
|
-
function
|
|
1921
|
-
return d(), b("svg",
|
|
1922
|
-
|
|
1947
|
+
function ct(e, r) {
|
|
1948
|
+
return d(), b("svg", ut, [...r[0] || (r[0] = [
|
|
1949
|
+
U("path", {
|
|
1923
1950
|
fill: "currentColor",
|
|
1924
1951
|
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896M288 512a38.4 38.4 0 0 0 38.4 38.4h371.2a38.4 38.4 0 0 0 0-76.8H326.4A38.4 38.4 0 0 0 288 512"
|
|
1925
1952
|
}, null, -1)
|
|
1926
|
-
]));
|
|
1953
|
+
])]);
|
|
1927
1954
|
}
|
|
1928
|
-
const ft = /* @__PURE__ */ Y(st, [["render",
|
|
1955
|
+
const ft = /* @__PURE__ */ Y(st, [["render", ct]]), mt = { class: "row flex-center table-header-label inline" }, ht = { class: "table-header-tooltip" }, pt = ["innerHTML"], yt = ["onClick"], gt = { key: 1 }, bt = ["onClick", "innerHTML"], wt = /* @__PURE__ */ K({
|
|
1929
1956
|
__name: "tableColumn",
|
|
1930
1957
|
props: {
|
|
1931
1958
|
conf: {},
|
|
1932
1959
|
columnList: {},
|
|
1933
1960
|
option: {}
|
|
1934
1961
|
},
|
|
1935
|
-
setup(
|
|
1936
|
-
const
|
|
1937
|
-
return (
|
|
1938
|
-
const t =
|
|
1939
|
-
return d(!0), b(
|
|
1940
|
-
key:
|
|
1962
|
+
setup(e) {
|
|
1963
|
+
const r = D.isFun, s = Ee().type;
|
|
1964
|
+
return (c, o) => {
|
|
1965
|
+
const t = te("el-tooltip");
|
|
1966
|
+
return d(!0), b($, null, A(e.columnList, (n) => (d(), b($, {
|
|
1967
|
+
key: n.key
|
|
1941
1968
|
}, [
|
|
1942
|
-
|
|
1943
|
-
|
|
1969
|
+
e.conf.table.column.show.list.includes(n.key) && (n.show?.table === void 0 || l(r)(n.show?.table, e.conf.table.data)) ? (d(), b($, { key: 0 }, [
|
|
1970
|
+
n.table?.header?.groupKey === void 0 || n.table.header.show ? (d(), y(l(ae), V({
|
|
1944
1971
|
key: 0,
|
|
1945
|
-
prop:
|
|
1946
|
-
label:
|
|
1947
|
-
|
|
1948
|
-
}, e.table), {
|
|
1972
|
+
prop: n.key,
|
|
1973
|
+
label: n.label
|
|
1974
|
+
}, { ref_for: !0 }, n.table), {
|
|
1949
1975
|
header: g(() => [
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1976
|
+
x(c.$slots, "table-header-" + n.key, { item: n }, () => [
|
|
1977
|
+
U("div", mt, [
|
|
1978
|
+
n.table?.header?.tooltip ? (d(), y(t, {
|
|
1953
1979
|
key: 0,
|
|
1954
1980
|
effect: "dark",
|
|
1955
1981
|
placement: "top"
|
|
1956
1982
|
}, {
|
|
1957
1983
|
content: g(() => [
|
|
1958
|
-
|
|
1959
|
-
innerHTML:
|
|
1960
|
-
}, null, 8,
|
|
1984
|
+
U("div", {
|
|
1985
|
+
innerHTML: n.table?.header?.tooltip
|
|
1986
|
+
}, null, 8, pt)
|
|
1961
1987
|
]),
|
|
1962
1988
|
default: g(() => [
|
|
1963
|
-
|
|
1964
|
-
|
|
1989
|
+
U("span", ht, [
|
|
1990
|
+
E(lt)
|
|
1965
1991
|
])
|
|
1966
1992
|
]),
|
|
1967
1993
|
_: 2
|
|
1968
|
-
}, 1024)) :
|
|
1969
|
-
|
|
1970
|
-
|
|
1994
|
+
}, 1024)) : C("", !0),
|
|
1995
|
+
O(" " + S(n.label) + " ", 1),
|
|
1996
|
+
n.table?.header?.group !== void 0 ? (d(), b("span", {
|
|
1971
1997
|
key: 1,
|
|
1972
1998
|
class: "table-header-plus",
|
|
1973
1999
|
onClick: Ue(
|
|
1974
2000
|
() => {
|
|
1975
|
-
|
|
1976
|
-
|
|
2001
|
+
n.table.header.group = !n.table.header.group, e.columnList.forEach((a) => {
|
|
2002
|
+
a.table?.header?.groupKey === n.key && (a.table.header.show = !n.table.header.group);
|
|
1977
2003
|
});
|
|
1978
2004
|
},
|
|
1979
2005
|
["stop"]
|
|
1980
2006
|
)
|
|
1981
2007
|
}, [
|
|
1982
|
-
|
|
1983
|
-
], 8,
|
|
2008
|
+
n.table.header.group ? (d(), y(dt, { key: 0 })) : (d(), y(ft, { key: 1 }))
|
|
2009
|
+
], 8, yt)) : C("", !0)
|
|
1984
2010
|
])
|
|
1985
2011
|
])
|
|
1986
2012
|
]),
|
|
1987
|
-
default: g(({ row:
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
(d(), y(q(l(
|
|
1991
|
-
conf:
|
|
1992
|
-
columnList:
|
|
1993
|
-
option:
|
|
2013
|
+
default: g(({ row: a }) => [
|
|
2014
|
+
n.children ? (d(), b($, { key: 0 }, [
|
|
2015
|
+
o[0] || (o[0] = O(" ", -1)),
|
|
2016
|
+
(d(), y(q(l(s)), {
|
|
2017
|
+
conf: e.conf,
|
|
2018
|
+
columnList: n.children,
|
|
2019
|
+
option: e.option
|
|
1994
2020
|
}, G({ _: 2 }, [
|
|
1995
|
-
A(
|
|
2021
|
+
A(c.$slots, (i, m) => ({
|
|
1996
2022
|
name: m,
|
|
1997
|
-
fn: g((
|
|
1998
|
-
|
|
2023
|
+
fn: g((u) => [
|
|
2024
|
+
x(c.$slots, m, V({ ref_for: !0 }, u || {}))
|
|
1999
2025
|
])
|
|
2000
2026
|
}))
|
|
2001
2027
|
]), 1032, ["conf", "columnList", "option"]))
|
|
2002
|
-
], 64)) : (d(), b(
|
|
2003
|
-
|
|
2028
|
+
], 64)) : (d(), b($, { key: 1 }, [
|
|
2029
|
+
e.option.table?.editMode ? (d(), b("div", {
|
|
2004
2030
|
key: 0,
|
|
2005
|
-
class:
|
|
2031
|
+
class: R(["row", ["table-edit-" + n.key]]),
|
|
2006
2032
|
style: { width: "100%" }
|
|
2007
2033
|
}, [
|
|
2008
|
-
|
|
2009
|
-
row:
|
|
2010
|
-
item:
|
|
2034
|
+
x(c.$slots, "table-edit-left-" + n.key, {
|
|
2035
|
+
row: a,
|
|
2036
|
+
item: n
|
|
2011
2037
|
}),
|
|
2012
|
-
|
|
2038
|
+
n.type === "input" ? (d(), y(l(ee), V({
|
|
2013
2039
|
key: 0,
|
|
2014
|
-
modelValue:
|
|
2015
|
-
"onUpdate:modelValue": (
|
|
2016
|
-
disabled:
|
|
2017
|
-
class: "col"
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
e.options?.input?.prepend ? {
|
|
2040
|
+
modelValue: a[n.key],
|
|
2041
|
+
"onUpdate:modelValue": (i) => a[n.key] = i,
|
|
2042
|
+
disabled: e.conf.update.getDisabled(n, !0),
|
|
2043
|
+
class: "col"
|
|
2044
|
+
}, { ref_for: !0 }, e.conf.update.getBind(n), z(e.conf.update.getOn(n, a))), G({ _: 2 }, [
|
|
2045
|
+
n.options?.input?.prepend ? {
|
|
2021
2046
|
name: "prepend",
|
|
2022
2047
|
fn: g(() => [
|
|
2023
|
-
|
|
2048
|
+
O(S(typeof n.options?.input?.prepend == "function" ? n.options?.input?.prepend(a) : n.options?.input?.prepend), 1)
|
|
2024
2049
|
]),
|
|
2025
2050
|
key: "0"
|
|
2026
2051
|
} : void 0
|
|
2027
|
-
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
2052
|
+
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.type === "select" ? (d(), y(l(X), V({
|
|
2028
2053
|
key: 1,
|
|
2029
|
-
modelValue:
|
|
2030
|
-
"onUpdate:modelValue": (
|
|
2031
|
-
disabled:
|
|
2032
|
-
class: "col"
|
|
2033
|
-
|
|
2034
|
-
}, n.conf.update.getBind(e), z(n.conf.update.getOn(e, r))), {
|
|
2054
|
+
modelValue: a[n.key],
|
|
2055
|
+
"onUpdate:modelValue": (i) => a[n.key] = i,
|
|
2056
|
+
disabled: e.conf.update.getDisabled(n, !0),
|
|
2057
|
+
class: "col"
|
|
2058
|
+
}, { ref_for: !0 }, e.conf.update.getBind(n), z(e.conf.update.getOn(n, a))), {
|
|
2035
2059
|
default: g(() => [
|
|
2036
|
-
(d(!0), b(
|
|
2037
|
-
key:
|
|
2038
|
-
label:
|
|
2039
|
-
value:
|
|
2060
|
+
(d(!0), b($, null, A(n.options?.search?.select?.data || n.options?.select?.data, (i) => (d(), y(l(W), {
|
|
2061
|
+
key: i.value,
|
|
2062
|
+
label: i.label,
|
|
2063
|
+
value: i.value
|
|
2040
2064
|
}, null, 8, ["label", "value"]))), 128))
|
|
2041
2065
|
]),
|
|
2042
2066
|
_: 2
|
|
2043
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
2067
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.type === "switch" ? (d(), y(l(Z), V({
|
|
2044
2068
|
key: 2,
|
|
2045
|
-
modelValue:
|
|
2046
|
-
"onUpdate:modelValue": (
|
|
2047
|
-
disabled:
|
|
2048
|
-
class: "col"
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
item: e
|
|
2069
|
+
modelValue: a[n.key],
|
|
2070
|
+
"onUpdate:modelValue": (i) => a[n.key] = i,
|
|
2071
|
+
disabled: e.conf.update.getDisabled(n, !0),
|
|
2072
|
+
class: "col"
|
|
2073
|
+
}, { ref_for: !0 }, e.conf.update.getBind(n), z(e.conf.update.getOn(n, a))), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : C("", !0),
|
|
2074
|
+
x(c.$slots, "table-edit-right-" + n.key, {
|
|
2075
|
+
row: a,
|
|
2076
|
+
item: n
|
|
2054
2077
|
})
|
|
2055
|
-
], 2)) : (d(), b(
|
|
2056
|
-
|
|
2057
|
-
|
|
2078
|
+
], 2)) : (d(), b($, { key: 1 }, [
|
|
2079
|
+
e.conf.update.type === l(D).EDialog.Update && l(r)(n.show?.form, e.conf.update.form, l(D).EDialog.Update) && e.option.table?.inlineEdit && e.conf.update.form[e.option.table?.rowKey] === a[e.option.table?.rowKey] && (n.type === "input" || n.type === "select") ? (d(), b($, { key: 0 }, [
|
|
2080
|
+
n.type === "input" ? (d(), y(l(ee), V({
|
|
2058
2081
|
key: 0,
|
|
2059
|
-
modelValue:
|
|
2060
|
-
"onUpdate:modelValue": (
|
|
2061
|
-
disabled:
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
e.options?.input?.prepend ? {
|
|
2082
|
+
modelValue: e.conf.update.form[n.key],
|
|
2083
|
+
"onUpdate:modelValue": (i) => e.conf.update.form[n.key] = i,
|
|
2084
|
+
disabled: e.conf.update.getDisabled(n, !0)
|
|
2085
|
+
}, { ref_for: !0 }, e.conf.update.getBind(n), z(e.conf.update.getOn(n, a)), { style: { width: "100%" } }), G({ _: 2 }, [
|
|
2086
|
+
n.options?.input?.prepend ? {
|
|
2065
2087
|
name: "prepend",
|
|
2066
2088
|
fn: g(() => [
|
|
2067
|
-
|
|
2089
|
+
O(S(typeof n.options?.input?.prepend == "function" ? n.options?.input?.prepend(a) : n.options?.input?.prepend), 1)
|
|
2068
2090
|
]),
|
|
2069
2091
|
key: "0"
|
|
2070
2092
|
} : void 0
|
|
2071
|
-
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
2093
|
+
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.type === "select" ? (d(), y(l(X), V({
|
|
2072
2094
|
key: 1,
|
|
2073
|
-
modelValue:
|
|
2074
|
-
"onUpdate:modelValue": (
|
|
2075
|
-
disabled:
|
|
2076
|
-
|
|
2077
|
-
}, n.conf.update.getBind(e), z(n.conf.update.getOn(e, r)), { style: { width: "100%" } }), {
|
|
2095
|
+
modelValue: e.conf.update.form[n.key],
|
|
2096
|
+
"onUpdate:modelValue": (i) => e.conf.update.form[n.key] = i,
|
|
2097
|
+
disabled: e.conf.update.getDisabled(n, !0)
|
|
2098
|
+
}, { ref_for: !0 }, e.conf.update.getBind(n), z(e.conf.update.getOn(n, a)), { style: { width: "100%" } }), {
|
|
2078
2099
|
default: g(() => [
|
|
2079
|
-
(d(!0), b(
|
|
2080
|
-
key:
|
|
2081
|
-
label:
|
|
2082
|
-
value:
|
|
2100
|
+
(d(!0), b($, null, A(n.options?.search?.select?.data || n.options?.select?.data, (i) => (d(), y(l(W), {
|
|
2101
|
+
key: i.value,
|
|
2102
|
+
label: i.label,
|
|
2103
|
+
value: i.value
|
|
2083
2104
|
}, null, 8, ["label", "value"]))), 128))
|
|
2084
2105
|
]),
|
|
2085
2106
|
_: 2
|
|
2086
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
2107
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : n.type === "switch" ? (d(), y(l(Z), V({
|
|
2087
2108
|
key: 2,
|
|
2088
|
-
modelValue:
|
|
2089
|
-
"onUpdate:modelValue": (
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
], 64)) : V(n.$slots, "table-" + e.key, {
|
|
2109
|
+
modelValue: e.conf.update.form[n.key],
|
|
2110
|
+
"onUpdate:modelValue": (i) => e.conf.update.form[n.key] = i
|
|
2111
|
+
}, { ref_for: !0 }, e.conf.update.getBind(n), z(e.conf.update.getOn(n, a)), {
|
|
2112
|
+
disabled: e.conf.update.getDisabled(n, !0)
|
|
2113
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : C("", !0)
|
|
2114
|
+
], 64)) : x(c.$slots, "table-" + n.key, {
|
|
2095
2115
|
key: 1,
|
|
2096
|
-
row:
|
|
2097
|
-
item:
|
|
2116
|
+
row: a,
|
|
2117
|
+
item: n
|
|
2098
2118
|
}, () => [
|
|
2099
|
-
l(
|
|
2119
|
+
l(j).customComponent[n.type ?? ""]?.table ? (d(), y(q(l(j).customComponent[n.type ?? ""]?.table), V({
|
|
2100
2120
|
key: 0,
|
|
2101
|
-
modelValue:
|
|
2102
|
-
"onUpdate:modelValue": (
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
e.options?.switch?.tableConfig?.change ? (d(), y(l(Z), C({
|
|
2121
|
+
modelValue: a[n.key],
|
|
2122
|
+
"onUpdate:modelValue": (i) => a[n.key] = i
|
|
2123
|
+
}, { ref_for: !0 }, n.options?.[n.type ?? ""], z(n.options?.[n.type ?? ""]?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue"])) : n.type === "switch" ? (d(), b($, { key: 1 }, [
|
|
2124
|
+
n.options?.switch?.tableConfig?.change ? (d(), y(l(Z), V({
|
|
2106
2125
|
key: 0,
|
|
2107
|
-
modelValue:
|
|
2108
|
-
"onUpdate:modelValue": (
|
|
2109
|
-
loading:
|
|
2110
|
-
"before-change": () =>
|
|
2111
|
-
|
|
2112
|
-
}, e.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "loading", "before-change"])) : (d(), b("span", yt, M(r[e.key] === e.options?.switch?.activeValue ? e.options?.switch?.activeText : e.options?.switch?.inactiveText), 1))
|
|
2126
|
+
modelValue: a[n.key],
|
|
2127
|
+
"onUpdate:modelValue": (i) => a[n.key] = i,
|
|
2128
|
+
loading: n.options?.switch?.loadingMap?.[a[e.option.table?.rowKey]]?.loading,
|
|
2129
|
+
"before-change": () => n.options?.switch?.tableBeforeChange?.(n.key, a)
|
|
2130
|
+
}, { ref_for: !0 }, n.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "loading", "before-change"])) : (d(), b("span", gt, S(a[n.key] === n.options?.switch?.activeValue ? n.options?.switch?.activeText : n.options?.switch?.inactiveText), 1))
|
|
2113
2131
|
], 64)) : (d(), b("span", {
|
|
2114
2132
|
key: 2,
|
|
2115
2133
|
style: ge({
|
|
2116
|
-
"--table-text-click-color":
|
|
2134
|
+
"--table-text-click-color": n.table?.click?.color
|
|
2117
2135
|
}),
|
|
2118
|
-
class:
|
|
2119
|
-
onClick: (
|
|
2120
|
-
innerHTML:
|
|
2121
|
-
}, null, 14,
|
|
2136
|
+
class: R({ "table-text-click": n.table?.click?.callback }),
|
|
2137
|
+
onClick: (i) => n.table?.click?.callback?.(a),
|
|
2138
|
+
innerHTML: n.table?.format ? n.table?.format(a) : a[n.key]
|
|
2139
|
+
}, null, 14, bt))
|
|
2122
2140
|
])
|
|
2123
2141
|
], 64))
|
|
2124
2142
|
], 64))
|
|
2125
2143
|
]),
|
|
2126
2144
|
_: 2
|
|
2127
|
-
}, 1040, ["prop", "label"])) :
|
|
2128
|
-
], 64)) :
|
|
2145
|
+
}, 1040, ["prop", "label"])) : C("", !0)
|
|
2146
|
+
], 64)) : C("", !0)
|
|
2129
2147
|
], 64))), 128);
|
|
2130
2148
|
};
|
|
2131
2149
|
}
|
|
2132
|
-
}),
|
|
2150
|
+
}), kt = {
|
|
2133
2151
|
class: "row form-item-content",
|
|
2134
2152
|
style: { width: "100%" }
|
|
2135
|
-
},
|
|
2153
|
+
}, vt = { class: "col column form-item-content-item" }, Ct = { class: "col" }, Vt = ["innerHTML"], xt = /* @__PURE__ */ K({
|
|
2136
2154
|
__name: "formColumn",
|
|
2137
2155
|
props: {
|
|
2138
2156
|
conf: {},
|
|
2139
2157
|
item: {}
|
|
2140
2158
|
},
|
|
2141
|
-
setup(
|
|
2142
|
-
return (
|
|
2143
|
-
label:
|
|
2144
|
-
prop:
|
|
2145
|
-
"label-width":
|
|
2159
|
+
setup(e) {
|
|
2160
|
+
return (r, s) => (d(), y(l(le), {
|
|
2161
|
+
label: e.item.item.text?.form?.label ?? e.item.item.label,
|
|
2162
|
+
prop: e.item.item.key,
|
|
2163
|
+
"label-width": e.item.item.text?.form?.label == "" ? 0 : e.item.item.form?.labelWidth || e.conf.option.form?.labelWidth
|
|
2146
2164
|
}, {
|
|
2147
2165
|
default: g(() => [
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
row:
|
|
2151
|
-
item:
|
|
2166
|
+
U("div", kt, [
|
|
2167
|
+
x(r.$slots, "form-" + e.item.item.key + "-start", {
|
|
2168
|
+
row: e.conf.update.form,
|
|
2169
|
+
item: e.item.item
|
|
2152
2170
|
}),
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
row:
|
|
2157
|
-
item:
|
|
2171
|
+
U("div", vt, [
|
|
2172
|
+
U("div", Ct, [
|
|
2173
|
+
x(r.$slots, "form-" + e.item.item.key, {
|
|
2174
|
+
row: e.conf.update.form,
|
|
2175
|
+
item: e.item.item
|
|
2158
2176
|
}, () => [
|
|
2159
|
-
|
|
2177
|
+
e.item.item.type === "input" ? (d(), y(l(ee), V({
|
|
2160
2178
|
key: 0,
|
|
2161
|
-
modelValue:
|
|
2162
|
-
"onUpdate:modelValue":
|
|
2163
|
-
},
|
|
2164
|
-
disabled:
|
|
2179
|
+
modelValue: e.conf.update.form[e.item.item.key],
|
|
2180
|
+
"onUpdate:modelValue": s[0] || (s[0] = (c) => e.conf.update.form[e.item.item.key] = c)
|
|
2181
|
+
}, e.conf.update.getBind(e.item.item), z(e.conf.update.getOn(e.item.item)), {
|
|
2182
|
+
disabled: e.conf.update.getDisabled(e.item.item)
|
|
2165
2183
|
}), G({ _: 2 }, [
|
|
2166
|
-
|
|
2184
|
+
e.item.item.options?.input?.prepend ? {
|
|
2167
2185
|
name: "prepend",
|
|
2168
2186
|
fn: g(() => [
|
|
2169
|
-
|
|
2187
|
+
O(S(typeof e.item.item.options?.input?.prepend == "function" ? e.item.item.options?.input?.prepend(e.conf.update.form) : e.item.item.options?.input?.prepend), 1)
|
|
2170
2188
|
]),
|
|
2171
2189
|
key: "0"
|
|
2172
2190
|
} : void 0
|
|
2173
|
-
]), 1040, ["modelValue", "disabled"])) :
|
|
2191
|
+
]), 1040, ["modelValue", "disabled"])) : e.item.item.type === "switch" ? (d(), y(l(Z), V({
|
|
2174
2192
|
key: 1,
|
|
2175
|
-
modelValue:
|
|
2176
|
-
"onUpdate:modelValue":
|
|
2177
|
-
},
|
|
2178
|
-
disabled:
|
|
2179
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
2193
|
+
modelValue: e.conf.update.form[e.item.item.key],
|
|
2194
|
+
"onUpdate:modelValue": s[1] || (s[1] = (c) => e.conf.update.form[e.item.item.key] = c)
|
|
2195
|
+
}, e.conf.update.getBind(e.item.item), z(e.conf.update.getOn(e.item.item)), {
|
|
2196
|
+
disabled: e.conf.update.getDisabled(e.item.item)
|
|
2197
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.item.type === "select" ? (d(), y(l(X), V({
|
|
2180
2198
|
key: 2,
|
|
2181
|
-
modelValue:
|
|
2182
|
-
"onUpdate:modelValue":
|
|
2183
|
-
},
|
|
2184
|
-
disabled:
|
|
2199
|
+
modelValue: e.conf.update.form[e.item.item.key],
|
|
2200
|
+
"onUpdate:modelValue": s[2] || (s[2] = (c) => e.conf.update.form[e.item.item.key] = c)
|
|
2201
|
+
}, e.conf.update.getBind(e.item.item), z(e.conf.update.getOn(e.item.item)), {
|
|
2202
|
+
disabled: e.conf.update.getDisabled(e.item.item),
|
|
2185
2203
|
style: { width: "100%" }
|
|
2186
2204
|
}), {
|
|
2187
2205
|
default: g(() => [
|
|
2188
|
-
(d(!0), b(
|
|
2189
|
-
key:
|
|
2190
|
-
|
|
2191
|
-
}, n, z(n.on || {})), null, 16))), 128))
|
|
2206
|
+
(d(!0), b($, null, A(e.conf.update.getBind(e.item.item).data, (c) => (d(), y(l(W), V({
|
|
2207
|
+
key: c.value
|
|
2208
|
+
}, { ref_for: !0 }, c, z(c.on || {})), null, 16))), 128))
|
|
2192
2209
|
]),
|
|
2193
2210
|
_: 1
|
|
2194
|
-
}, 16, ["modelValue", "disabled"])) :
|
|
2211
|
+
}, 16, ["modelValue", "disabled"])) : e.item.item.type === "radio" ? (d(), y(l(de), V({
|
|
2195
2212
|
key: 3,
|
|
2196
|
-
modelValue:
|
|
2197
|
-
"onUpdate:modelValue":
|
|
2198
|
-
},
|
|
2199
|
-
disabled:
|
|
2213
|
+
modelValue: e.conf.update.form[e.item.item.key],
|
|
2214
|
+
"onUpdate:modelValue": s[3] || (s[3] = (c) => e.conf.update.form[e.item.item.key] = c)
|
|
2215
|
+
}, e.conf.update.getBind(e.item.item), z(e.conf.update.getOn(e.item.item)), {
|
|
2216
|
+
disabled: e.conf.update.getDisabled(e.item.item),
|
|
2200
2217
|
style: { width: "100%" }
|
|
2201
2218
|
}), {
|
|
2202
2219
|
default: g(() => [
|
|
2203
|
-
(d(!0), b(
|
|
2204
|
-
key:
|
|
2205
|
-
|
|
2206
|
-
}, n, z(n.on || {})), null, 16))), 128))
|
|
2220
|
+
(d(!0), b($, null, A(e.conf.update.getBind(e.item.item).data, (c) => (d(), y(l(se), V({
|
|
2221
|
+
key: c.value
|
|
2222
|
+
}, { ref_for: !0 }, c, z(c.on || {})), null, 16))), 128))
|
|
2207
2223
|
]),
|
|
2208
2224
|
_: 1
|
|
2209
|
-
}, 16, ["modelValue", "disabled"])) :
|
|
2225
|
+
}, 16, ["modelValue", "disabled"])) : e.item.item.type === "list" ? (d(), y(fe, V({
|
|
2210
2226
|
key: 4,
|
|
2211
|
-
row:
|
|
2212
|
-
field:
|
|
2213
|
-
},
|
|
2214
|
-
disabled:
|
|
2227
|
+
row: e.conf.update.form,
|
|
2228
|
+
field: e.item.item.key
|
|
2229
|
+
}, e.conf.update.getBind(e.item.item), z(e.conf.update.getOn(e.item.item)), {
|
|
2230
|
+
disabled: e.conf.update.getDisabled(e.item.item),
|
|
2215
2231
|
style: { width: "100%" }
|
|
2216
|
-
}), null, 16, ["row", "field", "disabled"])) :
|
|
2232
|
+
}), null, 16, ["row", "field", "disabled"])) : e.item.item.type === "treeSelect" ? (d(), y(l(pe), V({
|
|
2217
2233
|
key: 5,
|
|
2218
|
-
modelValue:
|
|
2219
|
-
"onUpdate:modelValue":
|
|
2220
|
-
},
|
|
2221
|
-
disabled:
|
|
2234
|
+
modelValue: e.conf.update.form[e.item.item.key],
|
|
2235
|
+
"onUpdate:modelValue": s[4] || (s[4] = (c) => e.conf.update.form[e.item.item.key] = c)
|
|
2236
|
+
}, e.conf.update.getBind(e.item.item), z(e.conf.update.getOn(e.item.item)), {
|
|
2237
|
+
disabled: e.conf.update.getDisabled(e.item.item),
|
|
2222
2238
|
style: { width: "100%" }
|
|
2223
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
2239
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.item.type === "datetime" ? (d(), y(l(ue), V({
|
|
2224
2240
|
key: 6,
|
|
2225
|
-
modelValue:
|
|
2226
|
-
"onUpdate:modelValue":
|
|
2227
|
-
},
|
|
2228
|
-
disabled:
|
|
2229
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
2241
|
+
modelValue: e.conf.update.form[e.item.item.key],
|
|
2242
|
+
"onUpdate:modelValue": s[5] || (s[5] = (c) => e.conf.update.form[e.item.item.key] = c)
|
|
2243
|
+
}, e.conf.update.getBind(e.item.item), z(e.conf.update.getOn(e.item.item)), {
|
|
2244
|
+
disabled: e.conf.update.getDisabled(e.item.item)
|
|
2245
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.item.type && (l(j).customComponent[e.item.item.type] || l(j).customComponent[e.item.item.type]?.form) ? (d(), y(q(l(j).customComponent[e.item.item.type]?.form || l(j).customComponent[e.item.item.type]), V({
|
|
2230
2246
|
key: 7,
|
|
2231
|
-
modelValue:
|
|
2232
|
-
"onUpdate:modelValue":
|
|
2233
|
-
},
|
|
2234
|
-
disabled:
|
|
2235
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
2247
|
+
modelValue: e.conf.update.form[e.item.item.key],
|
|
2248
|
+
"onUpdate:modelValue": s[6] || (s[6] = (c) => e.conf.update.form[e.item.item.key] = c)
|
|
2249
|
+
}, e.conf.update.getBind(e.item.item), z(e.conf.update.getOn(e.item.item)), {
|
|
2250
|
+
disabled: e.conf.update.getDisabled(e.item.item)
|
|
2251
|
+
}), null, 16, ["modelValue", "disabled"])) : C("", !0)
|
|
2236
2252
|
]),
|
|
2237
|
-
|
|
2238
|
-
row:
|
|
2239
|
-
item:
|
|
2253
|
+
x(r.$slots, "form-" + e.item.item.key + "-right", {
|
|
2254
|
+
row: e.conf.update.form,
|
|
2255
|
+
item: e.item.item
|
|
2240
2256
|
})
|
|
2241
2257
|
]),
|
|
2242
|
-
|
|
2243
|
-
row:
|
|
2244
|
-
item:
|
|
2258
|
+
x(r.$slots, "form-" + e.item.item.key + "-tip", {
|
|
2259
|
+
row: e.conf.update.form,
|
|
2260
|
+
item: e.item.item
|
|
2245
2261
|
}, () => [
|
|
2246
|
-
|
|
2262
|
+
e.item.item.form?.tipText ? (d(), b("div", {
|
|
2247
2263
|
key: 0,
|
|
2248
2264
|
class: "form-tip-text",
|
|
2249
|
-
innerHTML: typeof
|
|
2250
|
-
}, null, 8,
|
|
2265
|
+
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
|
|
2266
|
+
}, null, 8, Vt)) : C("", !0)
|
|
2251
2267
|
])
|
|
2252
2268
|
]),
|
|
2253
|
-
|
|
2254
|
-
row:
|
|
2255
|
-
item:
|
|
2269
|
+
x(r.$slots, "form-" + e.item.item.key + "-end", {
|
|
2270
|
+
row: e.conf.update.form,
|
|
2271
|
+
item: e.item.item
|
|
2256
2272
|
})
|
|
2257
2273
|
])
|
|
2258
2274
|
]),
|
|
@@ -2263,114 +2279,114 @@ const ft = /* @__PURE__ */ Y(st, [["render", ut]]), pt = { class: "row flex-cent
|
|
|
2263
2279
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2264
2280
|
viewBox: "64 64 896 896"
|
|
2265
2281
|
};
|
|
2266
|
-
function
|
|
2267
|
-
return d(), b("svg", $t,
|
|
2268
|
-
|
|
2282
|
+
function Ot(e, r) {
|
|
2283
|
+
return d(), b("svg", $t, [...r[0] || (r[0] = [
|
|
2284
|
+
U("path", {
|
|
2269
2285
|
fill: "currentColor",
|
|
2270
2286
|
d: "M482.2 508.4L331.3 389c-3-2.4-7.3-.2-7.3 3.6V478H184V184h204v128c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V144c0-15.5-12.5-28-28-28H144c-15.5 0-28 12.5-28 28v736c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v128H184V546h140v85.4c0 3.8 4.4 6 7.3 3.6l150.9-119.4a4.5 4.5 0 000-7.2zM880 116H596c-15.5 0-28 12.5-28 28v168c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V184h204v294H700v-85.4c0-3.8-4.3-6-7.3-3.6l-151 119.4a4.52 4.52 0 000 7.1l151 119.5c2.9 2.3 7.3.2 7.3-3.6V546h140v294H636V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v168c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V144c0-15.5-12.5-28-28-28z"
|
|
2271
2287
|
}, null, -1)
|
|
2272
|
-
]));
|
|
2288
|
+
])]);
|
|
2273
2289
|
}
|
|
2274
|
-
const
|
|
2290
|
+
const Dt = /* @__PURE__ */ Y(zt, [["render", Ot]]), Et = {}, Ut = {
|
|
2275
2291
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2276
2292
|
viewBox: "64 64 896 896"
|
|
2277
2293
|
};
|
|
2278
|
-
function St(
|
|
2279
|
-
return d(), b("svg", Ut,
|
|
2280
|
-
|
|
2294
|
+
function St(e, r) {
|
|
2295
|
+
return d(), b("svg", Ut, [...r[0] || (r[0] = [
|
|
2296
|
+
U("path", {
|
|
2281
2297
|
fill: "currentColor",
|
|
2282
2298
|
d: "M180 176h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zm724 0h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zM785.3 504.3L657.7 403.6a7.23 7.23 0 00-11.7 5.7V476H378v-62.8c0-6-7-9.4-11.7-5.7L238.7 508.3a7.14 7.14 0 000 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h268v62.8c0 6 7 9.4 11.7 5.7l127.5-100.8c3.8-2.9 3.8-8.5.2-11.4z"
|
|
2283
2299
|
}, null, -1)
|
|
2284
|
-
]));
|
|
2300
|
+
])]);
|
|
2285
2301
|
}
|
|
2286
|
-
const Mt = /* @__PURE__ */ Y(
|
|
2302
|
+
const Mt = /* @__PURE__ */ Y(Et, [["render", St]]), he = /* @__PURE__ */ K({
|
|
2287
2303
|
__name: "searchField",
|
|
2288
2304
|
props: {
|
|
2289
2305
|
item: {},
|
|
2290
2306
|
conf: {},
|
|
2291
2307
|
type: {}
|
|
2292
2308
|
},
|
|
2293
|
-
setup(
|
|
2294
|
-
const
|
|
2295
|
-
get: () =>
|
|
2296
|
-
set: (
|
|
2297
|
-
|
|
2309
|
+
setup(e) {
|
|
2310
|
+
const r = e, s = be({
|
|
2311
|
+
get: () => r.conf.search.form?.[r.item?.key],
|
|
2312
|
+
set: (c) => {
|
|
2313
|
+
r.item?.key !== void 0 && (r.conf.search.form[r.item.key] = c);
|
|
2298
2314
|
}
|
|
2299
2315
|
});
|
|
2300
|
-
return (
|
|
2316
|
+
return (c, o) => l(j).customComponent[e.type ?? ""]?.search ? (d(), y(q(l(j).customComponent[e.type ?? ""]?.search), V({
|
|
2301
2317
|
key: 0,
|
|
2302
|
-
modelValue:
|
|
2303
|
-
"onUpdate:modelValue":
|
|
2304
|
-
},
|
|
2318
|
+
modelValue: s.value,
|
|
2319
|
+
"onUpdate:modelValue": o[0] || (o[0] = (t) => s.value = t)
|
|
2320
|
+
}, e.item.options?.search?.[e.type ?? ""], z(e.item.options?.search?.[e.type ?? ""]?.on || {})), null, 16, ["modelValue"])) : e.type === "input" ? (d(), y(l(ee), V({
|
|
2305
2321
|
key: 1,
|
|
2306
|
-
modelValue:
|
|
2307
|
-
"onUpdate:modelValue":
|
|
2308
|
-
placeholder:
|
|
2322
|
+
modelValue: s.value,
|
|
2323
|
+
"onUpdate:modelValue": o[1] || (o[1] = (t) => s.value = t),
|
|
2324
|
+
placeholder: e.conf.search.getPlaceholder(e.item),
|
|
2309
2325
|
clearable: "",
|
|
2310
|
-
disabled:
|
|
2311
|
-
},
|
|
2326
|
+
disabled: e.item.disabled?.search
|
|
2327
|
+
}, e.item.options?.search?.input || e.item.options?.input, z(e.item.options?.search?.input?.on || e.item.options?.input?.on || {})), null, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "switch" ? (d(), y(l(X), V({
|
|
2312
2328
|
key: 2,
|
|
2313
|
-
modelValue:
|
|
2314
|
-
"onUpdate:modelValue":
|
|
2315
|
-
placeholder:
|
|
2329
|
+
modelValue: s.value,
|
|
2330
|
+
"onUpdate:modelValue": o[2] || (o[2] = (t) => s.value = t),
|
|
2331
|
+
placeholder: e.conf.search.getPlaceholder(e.item, l(v).tCurd("placeholderSelect")),
|
|
2316
2332
|
clearable: "",
|
|
2317
|
-
disabled:
|
|
2318
|
-
},
|
|
2333
|
+
disabled: e.item.disabled?.search
|
|
2334
|
+
}, e.item.options?.search?.switch || e.item.options?.switch, z(e.item.options?.search?.switch?.on || e.item.options?.switch?.on || {})), {
|
|
2319
2335
|
default: g(() => [
|
|
2320
2336
|
(d(), y(l(W), {
|
|
2321
|
-
key:
|
|
2322
|
-
label:
|
|
2323
|
-
value:
|
|
2337
|
+
key: e.item.options?.switch?.activeValue,
|
|
2338
|
+
label: e.item.options?.switch?.activeText,
|
|
2339
|
+
value: e.item.options?.switch?.activeValue
|
|
2324
2340
|
}, null, 8, ["label", "value"])),
|
|
2325
2341
|
(d(), y(l(W), {
|
|
2326
|
-
key:
|
|
2327
|
-
label:
|
|
2328
|
-
value:
|
|
2342
|
+
key: e.item.options?.switch?.inactiveValue,
|
|
2343
|
+
label: e.item.options?.switch?.inactiveText,
|
|
2344
|
+
value: e.item.options?.switch?.inactiveValue
|
|
2329
2345
|
}, null, 8, ["label", "value"]))
|
|
2330
2346
|
]),
|
|
2331
2347
|
_: 1
|
|
2332
|
-
}, 16, ["modelValue", "placeholder", "disabled"])) :
|
|
2348
|
+
}, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "select" ? (d(), y(l(X), V({
|
|
2333
2349
|
key: 3,
|
|
2334
|
-
modelValue:
|
|
2335
|
-
"onUpdate:modelValue":
|
|
2336
|
-
placeholder:
|
|
2350
|
+
modelValue: s.value,
|
|
2351
|
+
"onUpdate:modelValue": o[3] || (o[3] = (t) => s.value = t),
|
|
2352
|
+
placeholder: e.conf.search.getPlaceholder(e.item, l(v).tCurd("placeholderSelect")),
|
|
2337
2353
|
clearable: "",
|
|
2338
|
-
disabled:
|
|
2339
|
-
},
|
|
2354
|
+
disabled: e.item.disabled?.search
|
|
2355
|
+
}, e.item.options?.search?.select || e.item.options?.select, z(e.item.options?.search?.select?.on || e.item.options?.select?.on || {})), {
|
|
2340
2356
|
default: g(() => [
|
|
2341
|
-
(d(!0), b(
|
|
2357
|
+
(d(!0), b($, null, A(e.item.options?.search?.select?.data || e.item.options?.select?.data || [], (t) => (d(), y(l(W), {
|
|
2342
2358
|
key: t.value,
|
|
2343
2359
|
label: t.label,
|
|
2344
2360
|
value: t.value
|
|
2345
2361
|
}, null, 8, ["label", "value"]))), 128))
|
|
2346
2362
|
]),
|
|
2347
2363
|
_: 1
|
|
2348
|
-
}, 16, ["modelValue", "placeholder", "disabled"])) :
|
|
2364
|
+
}, 16, ["modelValue", "placeholder", "disabled"])) : e.type === "radio" ? (d(), y(l(de), V({
|
|
2349
2365
|
key: 4,
|
|
2350
|
-
modelValue:
|
|
2351
|
-
"onUpdate:modelValue":
|
|
2352
|
-
disabled:
|
|
2353
|
-
},
|
|
2366
|
+
modelValue: s.value,
|
|
2367
|
+
"onUpdate:modelValue": o[4] || (o[4] = (t) => s.value = t),
|
|
2368
|
+
disabled: e.item.disabled?.search
|
|
2369
|
+
}, e.item.options?.search?.radio || e.item.options?.radio, z(e.item.options?.search?.radio?.on || e.item.options?.radio?.on || {})), {
|
|
2354
2370
|
default: g(() => [
|
|
2355
|
-
(d(!0), b(
|
|
2371
|
+
(d(!0), b($, null, A(e.item.options?.radio?.data, (t) => (d(), y(l(se), {
|
|
2356
2372
|
key: t.value,
|
|
2357
2373
|
label: t.label,
|
|
2358
2374
|
value: t.value
|
|
2359
2375
|
}, null, 8, ["label", "value"]))), 128))
|
|
2360
2376
|
]),
|
|
2361
2377
|
_: 1
|
|
2362
|
-
}, 16, ["modelValue", "disabled"])) :
|
|
2378
|
+
}, 16, ["modelValue", "disabled"])) : e.type === "datetime" ? (d(), y(l(ue), V({
|
|
2363
2379
|
key: 5,
|
|
2364
|
-
modelValue:
|
|
2365
|
-
"onUpdate:modelValue":
|
|
2366
|
-
disabled:
|
|
2367
|
-
},
|
|
2380
|
+
modelValue: s.value,
|
|
2381
|
+
"onUpdate:modelValue": o[5] || (o[5] = (t) => s.value = t),
|
|
2382
|
+
disabled: e.item.disabled?.search
|
|
2383
|
+
}, e.item.options?.search?.datetime || e.item.options?.datetime, z(e.item.options?.search?.datetime?.on || e.item.options?.datetime?.on || {})), null, 16, ["modelValue", "disabled"])) : e.type && l(j).customComponent[e.type] ? (d(), y(q(l(j).customComponent[e.type]), V({
|
|
2368
2384
|
key: 6,
|
|
2369
|
-
modelValue:
|
|
2370
|
-
"onUpdate:modelValue":
|
|
2371
|
-
},
|
|
2372
|
-
disabled:
|
|
2373
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
2385
|
+
modelValue: s.value,
|
|
2386
|
+
"onUpdate:modelValue": o[6] || (o[6] = (t) => s.value = t)
|
|
2387
|
+
}, e.item.options?.search?.[e.type] || e.item.options?.[e.type], z(e.item.options?.search?.[e.type]?.on || e.item.options?.[e.type]?.on || {}), {
|
|
2388
|
+
disabled: e.item.disabled?.search
|
|
2389
|
+
}), null, 16, ["modelValue", "disabled"])) : C("", !0);
|
|
2374
2390
|
}
|
|
2375
2391
|
}), Ft = {
|
|
2376
2392
|
key: 0,
|
|
@@ -2381,10 +2397,10 @@ const Mt = /* @__PURE__ */ Y(Ot, [["render", St]]), me = /* @__PURE__ */ N({
|
|
|
2381
2397
|
}, jt = { key: 0 }, Lt = { key: 1 }, Bt = { key: 2 }, Rt = { class: "export-btn" }, It = {
|
|
2382
2398
|
key: 1,
|
|
2383
2399
|
class: "export-btn"
|
|
2384
|
-
},
|
|
2400
|
+
}, Pt = {
|
|
2385
2401
|
class: "flex items-center table-tools-right",
|
|
2386
2402
|
style: { gap: "10px" }
|
|
2387
|
-
},
|
|
2403
|
+
}, Ht = { class: "row justify-end mt-10 mb-10 table-bottom-pagination" }, Kt = { class: "dialog-footer" }, Nt = { key: 0 }, Wt = { key: 1 }, Jt = { class: "dialog-footer" }, qt = /* @__PURE__ */ K({
|
|
2388
2404
|
__name: "index",
|
|
2389
2405
|
props: {
|
|
2390
2406
|
/**
|
|
@@ -2406,194 +2422,194 @@ const Mt = /* @__PURE__ */ Y(Ot, [["render", St]]), me = /* @__PURE__ */ N({
|
|
|
2406
2422
|
default: {}
|
|
2407
2423
|
}
|
|
2408
2424
|
},
|
|
2409
|
-
setup(
|
|
2410
|
-
const
|
|
2411
|
-
return
|
|
2425
|
+
setup(e, { expose: r }) {
|
|
2426
|
+
const s = D.EDialog, c = e, o = D.isFun, { conf: t, switchConfirmRef: n, ruleFormRef: a, tableRef: i } = Je(c);
|
|
2427
|
+
return r({
|
|
2412
2428
|
conf: t
|
|
2413
|
-
}), (m,
|
|
2414
|
-
const
|
|
2429
|
+
}), (m, u) => {
|
|
2430
|
+
const w = te("el-tooltip"), f = Se("loading");
|
|
2415
2431
|
return d(), b("div", {
|
|
2416
|
-
class:
|
|
2432
|
+
class: R(["relative cc1-form-box", [e.option.table?.fitHeight ? "col" : "no-min-height"]])
|
|
2417
2433
|
}, [
|
|
2418
|
-
|
|
2419
|
-
class:
|
|
2434
|
+
U("div", {
|
|
2435
|
+
class: R(["row", [e.option.table?.fitHeight ? "absolute fit" : ""]]),
|
|
2420
2436
|
style: { overflow: "hidden" }
|
|
2421
2437
|
}, [
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
class:
|
|
2438
|
+
x(m.$slots, "box-left"),
|
|
2439
|
+
U("div", {
|
|
2440
|
+
class: R(["column fit-width no-wrap", [e.option.table?.fitHeight ? "col" : ""]])
|
|
2425
2441
|
}, [
|
|
2426
|
-
|
|
2427
|
-
|
|
2442
|
+
e.option.search?.show !== !1 ? (d(), b("div", Ft, [
|
|
2443
|
+
E(l(Q), {
|
|
2428
2444
|
model: l(t).search.form,
|
|
2429
2445
|
inline: "",
|
|
2430
|
-
size:
|
|
2446
|
+
size: e.option.size?.search
|
|
2431
2447
|
}, {
|
|
2432
2448
|
default: g(() => [
|
|
2433
|
-
|
|
2449
|
+
x(m.$slots, "search-start", {
|
|
2434
2450
|
row: l(t).search.form
|
|
2435
2451
|
}),
|
|
2436
|
-
(d(!0), b(
|
|
2452
|
+
(d(!0), b($, null, A(l(t).search.column.list, (h) => (d(), b($, {
|
|
2437
2453
|
key: h.key
|
|
2438
2454
|
}, [
|
|
2439
|
-
|
|
2455
|
+
x(m.$slots, "search-" + h.key + "-start", {
|
|
2440
2456
|
row: l(t).search.form
|
|
2441
2457
|
}),
|
|
2442
|
-
(typeof h.show?.search == "function" ? h.show?.search(l(t).search.form) : h.show?.search) ? (d(), y(l(
|
|
2458
|
+
(typeof h.show?.search == "function" ? h.show?.search(l(t).search.form) : h.show?.search) ? (d(), y(l(le), {
|
|
2443
2459
|
key: 0,
|
|
2444
2460
|
label: h.text?.search?.label ?? h.label
|
|
2445
2461
|
}, {
|
|
2446
2462
|
default: g(() => [
|
|
2447
|
-
|
|
2463
|
+
x(m.$slots, "search-" + h.key + "-left", {
|
|
2448
2464
|
row: l(t).search.form
|
|
2449
2465
|
}),
|
|
2450
|
-
|
|
2466
|
+
x(m.$slots, "search-" + h.key, {
|
|
2451
2467
|
row: l(t).search.form
|
|
2452
2468
|
}, () => [
|
|
2453
|
-
h.options?.search?.type ? (d(), y(
|
|
2469
|
+
h.options?.search?.type ? (d(), y(he, {
|
|
2454
2470
|
key: 0,
|
|
2455
2471
|
item: h,
|
|
2456
2472
|
conf: l(t),
|
|
2457
2473
|
type: h.options.search.type
|
|
2458
|
-
}, null, 8, ["item", "conf", "type"])) : (d(), y(
|
|
2474
|
+
}, null, 8, ["item", "conf", "type"])) : (d(), y(he, {
|
|
2459
2475
|
key: 1,
|
|
2460
2476
|
item: h,
|
|
2461
2477
|
conf: l(t),
|
|
2462
2478
|
type: h.type
|
|
2463
2479
|
}, null, 8, ["item", "conf", "type"]))
|
|
2464
2480
|
]),
|
|
2465
|
-
|
|
2481
|
+
x(m.$slots, "search-" + h.key + "-right", {
|
|
2466
2482
|
row: l(t).search.form
|
|
2467
2483
|
})
|
|
2468
2484
|
]),
|
|
2469
2485
|
_: 2
|
|
2470
|
-
}, 1032, ["label"])) :
|
|
2471
|
-
|
|
2486
|
+
}, 1032, ["label"])) : C("", !0),
|
|
2487
|
+
x(m.$slots, "search-" + h.key + "-end", {
|
|
2472
2488
|
row: l(t).search.form
|
|
2473
2489
|
})
|
|
2474
2490
|
], 64))), 128)),
|
|
2475
|
-
|
|
2491
|
+
x(m.$slots, "search-center", {
|
|
2476
2492
|
row: l(t).search.form
|
|
2477
2493
|
}),
|
|
2478
|
-
|
|
2494
|
+
e.option.tools?.search || e.option.tools?.reset ? (d(), y(l(le), { key: 0 }, {
|
|
2479
2495
|
default: g(() => [
|
|
2480
|
-
|
|
2496
|
+
e.option.tools?.search ? (d(), y(l(T), {
|
|
2481
2497
|
key: 0,
|
|
2482
2498
|
type: "primary",
|
|
2483
2499
|
onClick: l(t).search.submit
|
|
2484
2500
|
}, {
|
|
2485
2501
|
default: g(() => [
|
|
2486
|
-
|
|
2502
|
+
O(S(l(v).tCurd("search")), 1)
|
|
2487
2503
|
]),
|
|
2488
2504
|
_: 1
|
|
2489
|
-
}, 8, ["onClick"])) :
|
|
2490
|
-
|
|
2505
|
+
}, 8, ["onClick"])) : C("", !0),
|
|
2506
|
+
e.option.tools?.reset ? (d(), y(l(T), {
|
|
2491
2507
|
key: 1,
|
|
2492
2508
|
onClick: l(t).search.reset
|
|
2493
2509
|
}, {
|
|
2494
2510
|
default: g(() => [
|
|
2495
|
-
|
|
2511
|
+
O(S(l(v).tCurd("reset")), 1)
|
|
2496
2512
|
]),
|
|
2497
2513
|
_: 1
|
|
2498
|
-
}, 8, ["onClick"])) :
|
|
2514
|
+
}, 8, ["onClick"])) : C("", !0)
|
|
2499
2515
|
]),
|
|
2500
2516
|
_: 1
|
|
2501
|
-
})) :
|
|
2502
|
-
|
|
2517
|
+
})) : C("", !0),
|
|
2518
|
+
x(m.$slots, "search-end", {
|
|
2503
2519
|
row: l(t).search.form
|
|
2504
2520
|
})
|
|
2505
2521
|
]),
|
|
2506
2522
|
_: 3
|
|
2507
2523
|
}, 8, ["model", "size"])
|
|
2508
|
-
])) :
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
l(
|
|
2512
|
-
|
|
2524
|
+
])) : C("", !0),
|
|
2525
|
+
U("div", At, [
|
|
2526
|
+
U("div", Tt, [
|
|
2527
|
+
l(o)(e.option.tools?.add) ? (d(), b("div", jt, [
|
|
2528
|
+
E(l(T), {
|
|
2513
2529
|
type: "primary",
|
|
2514
|
-
onClick:
|
|
2515
|
-
size:
|
|
2530
|
+
onClick: u[0] || (u[0] = (h) => l(t).update.open(l(s).Add)),
|
|
2531
|
+
size: e.option.size?.search
|
|
2516
2532
|
}, {
|
|
2517
2533
|
default: g(() => [
|
|
2518
|
-
|
|
2534
|
+
O(S(l(v).tCurd("add")), 1)
|
|
2519
2535
|
]),
|
|
2520
2536
|
_: 1
|
|
2521
2537
|
}, 8, ["size"])
|
|
2522
|
-
])) :
|
|
2523
|
-
|
|
2524
|
-
|
|
2538
|
+
])) : C("", !0),
|
|
2539
|
+
e.option.table?.selectable && l(o)(e.option.tools?.delete) ? (d(), b("div", Lt, [
|
|
2540
|
+
E(l(T), {
|
|
2525
2541
|
type: "danger",
|
|
2526
|
-
onClick:
|
|
2527
|
-
size:
|
|
2542
|
+
onClick: u[1] || (u[1] = (h) => l(t).remove.open(l(t).table.selection.list)),
|
|
2543
|
+
size: e.option.size?.search
|
|
2528
2544
|
}, {
|
|
2529
2545
|
default: g(() => [
|
|
2530
|
-
|
|
2546
|
+
O(S(l(v).tCurd("delete")), 1)
|
|
2531
2547
|
]),
|
|
2532
2548
|
_: 1
|
|
2533
2549
|
}, 8, ["size"])
|
|
2534
|
-
])) :
|
|
2535
|
-
|
|
2536
|
-
|
|
2550
|
+
])) : C("", !0),
|
|
2551
|
+
e.option.tools?.expand ? (d(), b("div", Bt, [
|
|
2552
|
+
E(l(T), {
|
|
2537
2553
|
type: "warning",
|
|
2538
|
-
onClick:
|
|
2539
|
-
size:
|
|
2554
|
+
onClick: u[2] || (u[2] = (h) => l(t).table.expand.all()),
|
|
2555
|
+
size: e.option.size?.search
|
|
2540
2556
|
}, {
|
|
2541
2557
|
default: g(() => [
|
|
2542
|
-
|
|
2558
|
+
O(S(l(v).tCurd("expandCollapse")), 1)
|
|
2543
2559
|
]),
|
|
2544
2560
|
_: 1
|
|
2545
2561
|
}, 8, ["size"])
|
|
2546
|
-
])) :
|
|
2547
|
-
|
|
2548
|
-
|
|
2562
|
+
])) : C("", !0),
|
|
2563
|
+
e.option.tools?.export?.show ? (d(), b($, { key: 3 }, [
|
|
2564
|
+
e.option.tools?.export?.dropdown?.show ? (d(), y(l($e), {
|
|
2549
2565
|
key: 0,
|
|
2550
2566
|
onCommand: l(t).export.click
|
|
2551
2567
|
}, {
|
|
2552
2568
|
dropdown: g(() => [
|
|
2553
|
-
|
|
2554
|
-
size:
|
|
2569
|
+
E(l(Oe), {
|
|
2570
|
+
size: e.option.size?.search
|
|
2555
2571
|
}, {
|
|
2556
2572
|
default: g(() => [
|
|
2557
|
-
|
|
2573
|
+
e.option.tools?.export?.dropdown?.select && (e.option.table?.selectable || l(o)(e.option.tools?.delete)) ? (d(), y(l(ne), {
|
|
2558
2574
|
key: 0,
|
|
2559
2575
|
command: "select"
|
|
2560
2576
|
}, {
|
|
2561
2577
|
default: g(() => [
|
|
2562
|
-
|
|
2578
|
+
O(S(l(v).tCurd("exportSelect")), 1)
|
|
2563
2579
|
]),
|
|
2564
2580
|
_: 1
|
|
2565
|
-
})) :
|
|
2566
|
-
|
|
2581
|
+
})) : C("", !0),
|
|
2582
|
+
e.option.tools?.export?.dropdown?.page ? (d(), y(l(ne), {
|
|
2567
2583
|
key: 1,
|
|
2568
2584
|
command: "page"
|
|
2569
2585
|
}, {
|
|
2570
2586
|
default: g(() => [
|
|
2571
|
-
|
|
2587
|
+
O(S(l(v).tCurd("exportPage")), 1)
|
|
2572
2588
|
]),
|
|
2573
2589
|
_: 1
|
|
2574
|
-
})) :
|
|
2575
|
-
|
|
2590
|
+
})) : C("", !0),
|
|
2591
|
+
e.option.tools?.export?.dropdown?.all ? (d(), y(l(ne), {
|
|
2576
2592
|
key: 2,
|
|
2577
2593
|
command: "all"
|
|
2578
2594
|
}, {
|
|
2579
2595
|
default: g(() => [
|
|
2580
|
-
|
|
2596
|
+
O(S(l(v).tCurd("exportAll")), 1)
|
|
2581
2597
|
]),
|
|
2582
2598
|
_: 1
|
|
2583
|
-
})) :
|
|
2599
|
+
})) : C("", !0)
|
|
2584
2600
|
]),
|
|
2585
2601
|
_: 1
|
|
2586
2602
|
}, 8, ["size"])
|
|
2587
2603
|
]),
|
|
2588
2604
|
default: g(() => [
|
|
2589
|
-
|
|
2590
|
-
|
|
2605
|
+
U("div", Rt, [
|
|
2606
|
+
E(l(T), {
|
|
2591
2607
|
type: "warning",
|
|
2592
2608
|
loading: l(t).export.loading,
|
|
2593
|
-
size:
|
|
2609
|
+
size: e.option.size?.search
|
|
2594
2610
|
}, {
|
|
2595
2611
|
default: g(() => [
|
|
2596
|
-
|
|
2612
|
+
O(S(l(v).tCurd("export")), 1)
|
|
2597
2613
|
]),
|
|
2598
2614
|
_: 1
|
|
2599
2615
|
}, 8, ["loading", "size"])
|
|
@@ -2601,83 +2617,83 @@ const Mt = /* @__PURE__ */ Y(Ot, [["render", St]]), me = /* @__PURE__ */ N({
|
|
|
2601
2617
|
]),
|
|
2602
2618
|
_: 1
|
|
2603
2619
|
}, 8, ["onCommand"])) : (d(), b("div", It, [
|
|
2604
|
-
|
|
2620
|
+
E(l(T), {
|
|
2605
2621
|
type: "warning",
|
|
2606
2622
|
loading: l(t).export.loading,
|
|
2607
|
-
size:
|
|
2608
|
-
onClick:
|
|
2623
|
+
size: e.option.size?.search,
|
|
2624
|
+
onClick: u[3] || (u[3] = (h) => l(t).export.run.start("all"))
|
|
2609
2625
|
}, {
|
|
2610
2626
|
default: g(() => [
|
|
2611
|
-
|
|
2627
|
+
O(S(l(v).tCurd("export")), 1)
|
|
2612
2628
|
]),
|
|
2613
2629
|
_: 1
|
|
2614
2630
|
}, 8, ["loading", "size"])
|
|
2615
2631
|
]))
|
|
2616
|
-
], 64)) :
|
|
2617
|
-
|
|
2632
|
+
], 64)) : C("", !0),
|
|
2633
|
+
x(m.$slots, "tools-left")
|
|
2618
2634
|
]),
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
l(t).page.showTools ? (d(), y(l(
|
|
2635
|
+
U("div", Pt, [
|
|
2636
|
+
x(m.$slots, "tools-right"),
|
|
2637
|
+
l(t).page.showTools ? (d(), y(l(me), V({
|
|
2622
2638
|
key: 0,
|
|
2623
2639
|
"current-page": l(t).page.num,
|
|
2624
|
-
"onUpdate:currentPage":
|
|
2640
|
+
"onUpdate:currentPage": u[4] || (u[4] = (h) => l(t).page.num = h),
|
|
2625
2641
|
"page-size": l(t).page.size,
|
|
2626
|
-
"onUpdate:pageSize":
|
|
2642
|
+
"onUpdate:pageSize": u[5] || (u[5] = (h) => l(t).page.size = h),
|
|
2627
2643
|
background: "",
|
|
2628
2644
|
"page-sizes": l(t).page.sizeList,
|
|
2629
2645
|
"pager-count": l(t).page.pagerCount,
|
|
2630
2646
|
layout: l(t).page.layout,
|
|
2631
2647
|
total: l(t).page.total,
|
|
2632
|
-
size:
|
|
2648
|
+
size: e.option.size?.table,
|
|
2633
2649
|
onSizeChange: l(t).table.getList,
|
|
2634
2650
|
onCurrentChange: l(t).table.getList
|
|
2635
|
-
},
|
|
2636
|
-
|
|
2651
|
+
}, 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"])) : C("", !0),
|
|
2652
|
+
e.option.tools?.expandColumn === void 0 || e.option.tools?.expandColumn ? (d(), y(w, {
|
|
2637
2653
|
key: 1,
|
|
2638
2654
|
effect: "dark",
|
|
2639
|
-
content: l(t).table.header.group.expand ? l(
|
|
2655
|
+
content: l(t).table.header.group.expand ? l(v).tCurd("mergeColumn") : l(v).tCurd("expandColumn"),
|
|
2640
2656
|
placement: "top"
|
|
2641
2657
|
}, {
|
|
2642
2658
|
default: g(() => [
|
|
2643
|
-
|
|
2644
|
-
class:
|
|
2645
|
-
onClick:
|
|
2659
|
+
U("div", {
|
|
2660
|
+
class: R(["refresh-btn", [e.option.size?.search]]),
|
|
2661
|
+
onClick: u[6] || (u[6] = //@ts-ignore
|
|
2646
2662
|
(...h) => l(t).table.header.group.toggleExpandAll && l(t).table.header.group.toggleExpandAll(...h))
|
|
2647
2663
|
}, [
|
|
2648
|
-
l(t).table.header.group.expand ? (d(), y(
|
|
2664
|
+
l(t).table.header.group.expand ? (d(), y(Dt, { key: 0 })) : (d(), y(Mt, { key: 1 }))
|
|
2649
2665
|
], 2)
|
|
2650
2666
|
]),
|
|
2651
2667
|
_: 1
|
|
2652
|
-
}, 8, ["content"])) :
|
|
2653
|
-
|
|
2668
|
+
}, 8, ["content"])) : C("", !0),
|
|
2669
|
+
e.option.tools?.refresh === void 0 || e.option.tools?.refresh ? (d(), b("div", {
|
|
2654
2670
|
key: 2,
|
|
2655
|
-
class:
|
|
2656
|
-
onClick:
|
|
2671
|
+
class: R(["refresh-btn", [e.option.size?.search]]),
|
|
2672
|
+
onClick: u[7] || (u[7] = //@ts-ignore
|
|
2657
2673
|
(...h) => l(t).table.getList && l(t).table.getList(...h))
|
|
2658
2674
|
}, [
|
|
2659
|
-
|
|
2660
|
-
], 2)) :
|
|
2675
|
+
E(Ze)
|
|
2676
|
+
], 2)) : C("", !0)
|
|
2661
2677
|
])
|
|
2662
2678
|
]),
|
|
2663
|
-
|
|
2664
|
-
class:
|
|
2679
|
+
U("div", {
|
|
2680
|
+
class: R(["fit-width relative form-box", [e.option.table?.fitHeight ? "col " : "", e.option.table?.editMode ? "edit-mode" : ""]])
|
|
2665
2681
|
}, [
|
|
2666
|
-
|
|
2667
|
-
class:
|
|
2682
|
+
U("div", {
|
|
2683
|
+
class: R(["column form-box-content", [e.option.table?.fitHeight ? "absolute fit" : ""]])
|
|
2668
2684
|
}, [
|
|
2669
|
-
Me((d(), y(l(
|
|
2685
|
+
Me((d(), y(l(De), V({
|
|
2670
2686
|
ref_key: "tableRef",
|
|
2671
|
-
ref:
|
|
2687
|
+
ref: i,
|
|
2672
2688
|
data: l(t).table.data,
|
|
2673
|
-
border:
|
|
2689
|
+
border: e.option.table?.border === void 0 ? !0 : e.option.table?.border,
|
|
2674
2690
|
onSelectionChange: l(t).table.selection.change,
|
|
2675
2691
|
onSortChange: l(t).table.sort.change,
|
|
2676
2692
|
"expand-row-keys": l(t).table.expand.rowKeys,
|
|
2677
2693
|
onExpandChange: l(t).table.expand.change
|
|
2678
|
-
},
|
|
2694
|
+
}, e.option.table, z(e.option.table?.on || {})), {
|
|
2679
2695
|
default: g(() => [
|
|
2680
|
-
(typeof
|
|
2696
|
+
(typeof e.option.table?.selectable == "object" ? e.option.table?.selectable?.show : e.option.table?.selectable) || l(o)(e.option.tools?.delete) || e.option.tools?.export?.show && e.option.tools?.export?.select ? (d(), y(l(ae), V({
|
|
2681
2697
|
key: 0,
|
|
2682
2698
|
type: "selection",
|
|
2683
2699
|
width: "40",
|
|
@@ -2685,8 +2701,8 @@ const Mt = /* @__PURE__ */ Y(Ot, [["render", St]]), me = /* @__PURE__ */ N({
|
|
|
2685
2701
|
fixed: "left",
|
|
2686
2702
|
"show-overflow-tooltip": !1,
|
|
2687
2703
|
className: "cc1-form-selectable-column"
|
|
2688
|
-
}, typeof
|
|
2689
|
-
(typeof
|
|
2704
|
+
}, typeof e.option.table?.selectable == "object" ? e.option.table?.selectable : {}, z(typeof e.option.table?.selectable == "object" ? e.option.table?.selectable?.on || {} : {})), null, 16)) : C("", !0),
|
|
2705
|
+
(typeof e.option.table?.index == "object" ? e.option.table?.index?.show : e.option.table?.index) ? (d(), y(l(ae), V({
|
|
2690
2706
|
key: 1,
|
|
2691
2707
|
type: "index",
|
|
2692
2708
|
fixed: "left",
|
|
@@ -2695,262 +2711,262 @@ const Mt = /* @__PURE__ */ Y(Ot, [["render", St]]), me = /* @__PURE__ */ N({
|
|
|
2695
2711
|
label: "#",
|
|
2696
2712
|
"show-overflow-tooltip": !1,
|
|
2697
2713
|
className: "cc1-form-index-column"
|
|
2698
|
-
}, typeof
|
|
2699
|
-
|
|
2714
|
+
}, typeof e.option.table?.index == "object" ? e.option.table?.index : {}, z(typeof e.option.table?.index == "object" ? e.option.table?.index?.on || {} : {})), null, 16)) : C("", !0),
|
|
2715
|
+
E(wt, {
|
|
2700
2716
|
conf: l(t),
|
|
2701
2717
|
columnList: l(t).table.column.list,
|
|
2702
|
-
option:
|
|
2718
|
+
option: e.option
|
|
2703
2719
|
}, G({ _: 2 }, [
|
|
2704
|
-
A(m.$slots, (h,
|
|
2705
|
-
name:
|
|
2706
|
-
fn: g((
|
|
2707
|
-
|
|
2720
|
+
A(m.$slots, (h, p) => ({
|
|
2721
|
+
name: p,
|
|
2722
|
+
fn: g((k) => [
|
|
2723
|
+
x(m.$slots, p, Fe(Ae(k || {})))
|
|
2708
2724
|
])
|
|
2709
2725
|
}))
|
|
2710
2726
|
]), 1032, ["conf", "columnList", "option"]),
|
|
2711
|
-
l(
|
|
2727
|
+
l(o)(e.option.table?.add) || l(o)(e.option.table?.update) || l(o)(e.option.table?.delete) || l(o)(e.option.table?.view) || m.$slots["table-op-left"] || m.$slots["table-op-right"] ? (d(), y(l(ae), V({
|
|
2712
2728
|
key: 2,
|
|
2713
2729
|
width: "auto",
|
|
2714
2730
|
"max-width": "200",
|
|
2715
2731
|
align: "center",
|
|
2716
2732
|
fixed: "right"
|
|
2717
|
-
},
|
|
2733
|
+
}, e.option.table?.operate, { "show-overflow-tooltip": !1 }), {
|
|
2718
2734
|
header: g(() => [
|
|
2719
|
-
|
|
2720
|
-
|
|
2735
|
+
x(m.$slots, "table-header-op", {}, () => [
|
|
2736
|
+
O(S(l(v).tCurd("operation")), 1)
|
|
2721
2737
|
])
|
|
2722
2738
|
]),
|
|
2723
2739
|
default: g(({ row: h }) => [
|
|
2724
|
-
|
|
2725
|
-
size:
|
|
2740
|
+
E(l(Q), {
|
|
2741
|
+
size: e.option.size?.table
|
|
2726
2742
|
}, {
|
|
2727
2743
|
default: g(() => [
|
|
2728
|
-
|
|
2729
|
-
l(t).update.type === l(
|
|
2730
|
-
|
|
2744
|
+
x(m.$slots, "table-op-left", { row: h }),
|
|
2745
|
+
l(t).update.type === l(s).Update && e.option.table?.inlineEdit && l(t).update.form[c.option.table?.rowKey] === h[c.option.table?.rowKey] ? (d(), b($, { key: 0 }, [
|
|
2746
|
+
E(l(T), {
|
|
2731
2747
|
link: "",
|
|
2732
2748
|
type: "info",
|
|
2733
2749
|
onClick: l(t).update.close
|
|
2734
2750
|
}, {
|
|
2735
2751
|
default: g(() => [
|
|
2736
|
-
|
|
2752
|
+
O(S(l(v).tCurd("cancel")), 1)
|
|
2737
2753
|
]),
|
|
2738
2754
|
_: 1
|
|
2739
2755
|
}, 8, ["onClick"]),
|
|
2740
|
-
|
|
2756
|
+
E(l(T), {
|
|
2741
2757
|
link: "",
|
|
2742
2758
|
type: "primary",
|
|
2743
2759
|
onClick: l(t).update.submit,
|
|
2744
2760
|
loading: l(t).update.loading
|
|
2745
2761
|
}, {
|
|
2746
2762
|
default: g(() => [
|
|
2747
|
-
|
|
2763
|
+
O(S(l(v).tCurd("confirm")), 1)
|
|
2748
2764
|
]),
|
|
2749
2765
|
_: 1
|
|
2750
2766
|
}, 8, ["onClick", "loading"]),
|
|
2751
|
-
|
|
2752
|
-
], 64)) : (d(), b(
|
|
2753
|
-
l(
|
|
2767
|
+
x(m.$slots, "table-op-edit-right", { row: h })
|
|
2768
|
+
], 64)) : (d(), b($, { key: 1 }, [
|
|
2769
|
+
l(o)(e.option.table?.add, h) ? (d(), y(l(T), {
|
|
2754
2770
|
key: 0,
|
|
2755
2771
|
link: "",
|
|
2756
2772
|
type: "primary",
|
|
2757
|
-
onClick: (
|
|
2773
|
+
onClick: (p) => l(t).update.open(l(s).Add, h)
|
|
2758
2774
|
}, {
|
|
2759
2775
|
default: g(() => [
|
|
2760
|
-
|
|
2776
|
+
O(S(l(v).tCurd("add")), 1)
|
|
2761
2777
|
]),
|
|
2762
|
-
_:
|
|
2763
|
-
},
|
|
2764
|
-
l(
|
|
2778
|
+
_: 1
|
|
2779
|
+
}, 8, ["onClick"])) : C("", !0),
|
|
2780
|
+
l(o)(e.option.table?.view, h) ? (d(), y(l(T), {
|
|
2765
2781
|
key: 1,
|
|
2766
2782
|
link: "",
|
|
2767
2783
|
type: "primary",
|
|
2768
|
-
onClick: (
|
|
2784
|
+
onClick: (p) => l(t).update.open(l(s).View, h)
|
|
2769
2785
|
}, {
|
|
2770
2786
|
default: g(() => [
|
|
2771
|
-
|
|
2787
|
+
O(S(l(v).tCurd("view")), 1)
|
|
2772
2788
|
]),
|
|
2773
|
-
_:
|
|
2774
|
-
},
|
|
2775
|
-
l(
|
|
2789
|
+
_: 1
|
|
2790
|
+
}, 8, ["onClick"])) : C("", !0),
|
|
2791
|
+
l(o)(e.option.table?.update, h) ? (d(), y(l(T), {
|
|
2776
2792
|
key: 2,
|
|
2777
2793
|
link: "",
|
|
2778
2794
|
type: "warning",
|
|
2779
|
-
onClick: (
|
|
2795
|
+
onClick: (p) => l(t).update.open(l(s).Update, h)
|
|
2780
2796
|
}, {
|
|
2781
2797
|
default: g(() => [
|
|
2782
|
-
|
|
2798
|
+
O(S(l(v).tCurd("edit")), 1)
|
|
2783
2799
|
]),
|
|
2784
|
-
_:
|
|
2785
|
-
},
|
|
2786
|
-
l(
|
|
2800
|
+
_: 1
|
|
2801
|
+
}, 8, ["onClick"])) : C("", !0),
|
|
2802
|
+
l(o)(e.option.table?.delete, h) ? (d(), y(l(T), {
|
|
2787
2803
|
key: 3,
|
|
2788
2804
|
link: "",
|
|
2789
2805
|
type: "danger",
|
|
2790
|
-
onClick: (
|
|
2806
|
+
onClick: (p) => l(t).remove.open([h])
|
|
2791
2807
|
}, {
|
|
2792
2808
|
default: g(() => [
|
|
2793
|
-
|
|
2809
|
+
O(S(l(v).tCurd("delete")), 1)
|
|
2794
2810
|
]),
|
|
2795
|
-
_:
|
|
2796
|
-
},
|
|
2797
|
-
|
|
2811
|
+
_: 1
|
|
2812
|
+
}, 8, ["onClick"])) : C("", !0),
|
|
2813
|
+
x(m.$slots, "table-op-right", { row: h })
|
|
2798
2814
|
], 64))
|
|
2799
2815
|
]),
|
|
2800
2816
|
_: 2
|
|
2801
2817
|
}, 1032, ["size"])
|
|
2802
2818
|
]),
|
|
2803
2819
|
_: 3
|
|
2804
|
-
}, 16)) :
|
|
2820
|
+
}, 16)) : C("", !0)
|
|
2805
2821
|
]),
|
|
2806
2822
|
_: 3
|
|
2807
2823
|
}, 16, ["data", "border", "onSelectionChange", "onSortChange", "expand-row-keys", "onExpandChange"])), [
|
|
2808
|
-
[
|
|
2824
|
+
[f, l(t).table.loading]
|
|
2809
2825
|
])
|
|
2810
2826
|
], 2)
|
|
2811
2827
|
], 2),
|
|
2812
|
-
|
|
2813
|
-
(
|
|
2828
|
+
U("div", Ht, [
|
|
2829
|
+
(e.option.page?.show === void 0 || e.option.page?.show) && !l(t).page.showTools ? (d(), y(l(me), V({
|
|
2814
2830
|
key: 0,
|
|
2815
2831
|
"current-page": l(t).page.num,
|
|
2816
|
-
"onUpdate:currentPage":
|
|
2832
|
+
"onUpdate:currentPage": u[8] || (u[8] = (h) => l(t).page.num = h),
|
|
2817
2833
|
"page-size": l(t).page.size,
|
|
2818
|
-
"onUpdate:pageSize":
|
|
2834
|
+
"onUpdate:pageSize": u[9] || (u[9] = (h) => l(t).page.size = h),
|
|
2819
2835
|
background: "",
|
|
2820
2836
|
"page-sizes": l(t).page.sizeList,
|
|
2821
2837
|
"pager-count": l(t).page.pagerCount,
|
|
2822
2838
|
layout: l(t).page.layout,
|
|
2823
2839
|
total: l(t).page.total,
|
|
2824
|
-
size:
|
|
2840
|
+
size: e.option.size?.table,
|
|
2825
2841
|
onSizeChange: l(t).table.getList,
|
|
2826
2842
|
onCurrentChange: l(t).table.getList
|
|
2827
|
-
},
|
|
2843
|
+
}, 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"])) : C("", !0)
|
|
2828
2844
|
])
|
|
2829
2845
|
], 2),
|
|
2830
|
-
|
|
2846
|
+
x(m.$slots, "box-right")
|
|
2831
2847
|
], 2),
|
|
2832
|
-
|
|
2848
|
+
E(l(ie), V({
|
|
2833
2849
|
modelValue: l(t).update.show,
|
|
2834
|
-
"onUpdate:modelValue":
|
|
2850
|
+
"onUpdate:modelValue": u[10] || (u[10] = (h) => l(t).update.show = h),
|
|
2835
2851
|
title: l(t).update.title,
|
|
2836
2852
|
"before-close": l(t).update.close
|
|
2837
|
-
},
|
|
2853
|
+
}, e.option.dialog), {
|
|
2838
2854
|
footer: g(() => [
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
size:
|
|
2855
|
+
U("span", Kt, [
|
|
2856
|
+
E(l(Q), {
|
|
2857
|
+
size: e.option.size?.form
|
|
2842
2858
|
}, {
|
|
2843
2859
|
default: g(() => [
|
|
2844
|
-
|
|
2860
|
+
E(l(T), {
|
|
2845
2861
|
onClick: l(t).update.close
|
|
2846
2862
|
}, {
|
|
2847
2863
|
default: g(() => [
|
|
2848
|
-
|
|
2864
|
+
O(S(l(v).tCurd("close")), 1)
|
|
2849
2865
|
]),
|
|
2850
2866
|
_: 1
|
|
2851
2867
|
}, 8, ["onClick"]),
|
|
2852
|
-
l(t).update.type !== l(
|
|
2868
|
+
l(t).update.type !== l(s).View ? (d(), y(l(T), {
|
|
2853
2869
|
key: 0,
|
|
2854
2870
|
type: "primary",
|
|
2855
2871
|
onClick: l(t).update.submit,
|
|
2856
2872
|
loading: l(t).update.loading
|
|
2857
2873
|
}, {
|
|
2858
2874
|
default: g(() => [
|
|
2859
|
-
|
|
2875
|
+
O(S(l(v).tCurd("submit")), 1)
|
|
2860
2876
|
]),
|
|
2861
2877
|
_: 1
|
|
2862
|
-
}, 8, ["onClick", "loading"])) :
|
|
2878
|
+
}, 8, ["onClick", "loading"])) : C("", !0)
|
|
2863
2879
|
]),
|
|
2864
2880
|
_: 1
|
|
2865
2881
|
}, 8, ["size"])
|
|
2866
2882
|
])
|
|
2867
2883
|
]),
|
|
2868
2884
|
default: g(() => [
|
|
2869
|
-
|
|
2885
|
+
E(l(Q), {
|
|
2870
2886
|
ref_key: "ruleFormRef",
|
|
2871
|
-
ref:
|
|
2887
|
+
ref: a,
|
|
2872
2888
|
model: l(t).update.form,
|
|
2873
2889
|
rules: l(t).update.rules,
|
|
2874
|
-
size:
|
|
2890
|
+
size: e.option.size?.form,
|
|
2875
2891
|
class: "update-dialog-form"
|
|
2876
2892
|
}, {
|
|
2877
2893
|
default: g(() => [
|
|
2878
|
-
l(t).update.showContent ? (d(!0), b(
|
|
2879
|
-
l(
|
|
2894
|
+
l(t).update.showContent ? (d(!0), b($, { key: 0 }, A(l(t).update.formColumn, (h) => (d(), b($, null, [
|
|
2895
|
+
l(o)(
|
|
2880
2896
|
(() => {
|
|
2881
|
-
const
|
|
2882
|
-
|
|
2897
|
+
const p = [], k = (F) => {
|
|
2898
|
+
F?.item?.children ? k(F.item.children) : p.push(...F.map((B) => B.item?.show?.form));
|
|
2883
2899
|
};
|
|
2884
|
-
return
|
|
2900
|
+
return k(h), p;
|
|
2885
2901
|
})(),
|
|
2886
2902
|
l(t).update.form,
|
|
2887
2903
|
l(t).update.type
|
|
2888
2904
|
) ? (d(), b("div", {
|
|
2889
2905
|
key: 0,
|
|
2890
|
-
class:
|
|
2891
|
-
stripe:
|
|
2906
|
+
class: R(["row curd-row", {
|
|
2907
|
+
stripe: e.option.form?.stripe === void 0 ? !0 : e.option.form?.stripe
|
|
2892
2908
|
}])
|
|
2893
2909
|
}, [
|
|
2894
|
-
|
|
2910
|
+
x(m.$slots, "form-start", {
|
|
2895
2911
|
row: l(t).update.form
|
|
2896
2912
|
}),
|
|
2897
|
-
(d(!0), b(
|
|
2898
|
-
l(
|
|
2913
|
+
(d(!0), b($, null, A(h, (p) => (d(), b($, null, [
|
|
2914
|
+
l(o)(p.item.show?.form, l(t).update.form, l(t).update.type) ? (d(), b("div", {
|
|
2899
2915
|
key: 0,
|
|
2900
|
-
class:
|
|
2916
|
+
class: R([p.item.form.span > 0 ? `col-${l(t).getColumnSpan(p, h)}` : "col", `form-item-col-${p.item.key}`])
|
|
2901
2917
|
}, [
|
|
2902
|
-
(d(!0), b(
|
|
2903
|
-
key:
|
|
2918
|
+
(d(!0), b($, null, A(p.item.children ? p.children : [p], (k) => (d(), y(xt, {
|
|
2919
|
+
key: k.item.key,
|
|
2904
2920
|
conf: l(t),
|
|
2905
|
-
item:
|
|
2921
|
+
item: k
|
|
2906
2922
|
}, G({ _: 2 }, [
|
|
2907
|
-
A(m.$slots, (
|
|
2908
|
-
name:
|
|
2909
|
-
fn: g((
|
|
2910
|
-
|
|
2923
|
+
A(m.$slots, (F, B) => ({
|
|
2924
|
+
name: B,
|
|
2925
|
+
fn: g((L) => [
|
|
2926
|
+
x(m.$slots, B, V({ ref_for: !0 }, L || {}))
|
|
2911
2927
|
])
|
|
2912
2928
|
}))
|
|
2913
2929
|
]), 1032, ["conf", "item"]))), 128))
|
|
2914
|
-
], 2)) :
|
|
2930
|
+
], 2)) : C("", !0)
|
|
2915
2931
|
], 64))), 256)),
|
|
2916
|
-
|
|
2932
|
+
x(m.$slots, "form-end", {
|
|
2917
2933
|
row: l(t).update.form
|
|
2918
2934
|
})
|
|
2919
|
-
], 2)) :
|
|
2920
|
-
], 64))), 256)) :
|
|
2935
|
+
], 2)) : C("", !0)
|
|
2936
|
+
], 64))), 256)) : C("", !0)
|
|
2921
2937
|
]),
|
|
2922
2938
|
_: 3
|
|
2923
2939
|
}, 8, ["model", "rules", "size"])
|
|
2924
2940
|
]),
|
|
2925
2941
|
_: 3
|
|
2926
2942
|
}, 16, ["modelValue", "title", "before-close"]),
|
|
2927
|
-
|
|
2943
|
+
E(l(ie), {
|
|
2928
2944
|
modelValue: l(t).remove.show,
|
|
2929
|
-
"onUpdate:modelValue":
|
|
2945
|
+
"onUpdate:modelValue": u[11] || (u[11] = (h) => l(t).remove.show = h),
|
|
2930
2946
|
title: l(t).remove.title,
|
|
2931
2947
|
"close-on-click-modal": !1
|
|
2932
2948
|
}, {
|
|
2933
2949
|
footer: g(() => [
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
size:
|
|
2950
|
+
U("span", Jt, [
|
|
2951
|
+
E(l(Q), {
|
|
2952
|
+
size: e.option.size?.form
|
|
2937
2953
|
}, {
|
|
2938
2954
|
default: g(() => [
|
|
2939
|
-
|
|
2955
|
+
E(l(T), {
|
|
2940
2956
|
onClick: l(t).remove.close
|
|
2941
2957
|
}, {
|
|
2942
2958
|
default: g(() => [
|
|
2943
|
-
|
|
2959
|
+
O(S(l(v).tCurd("close")), 1)
|
|
2944
2960
|
]),
|
|
2945
2961
|
_: 1
|
|
2946
2962
|
}, 8, ["onClick"]),
|
|
2947
|
-
|
|
2963
|
+
E(l(T), {
|
|
2948
2964
|
type: "danger",
|
|
2949
2965
|
onClick: l(t).remove.submit,
|
|
2950
2966
|
loading: l(t).remove.loading
|
|
2951
2967
|
}, {
|
|
2952
2968
|
default: g(() => [
|
|
2953
|
-
|
|
2969
|
+
O(S(l(v).tCurd("confirmDelete")), 1)
|
|
2954
2970
|
]),
|
|
2955
2971
|
_: 1
|
|
2956
2972
|
}, 8, ["onClick", "loading"])
|
|
@@ -2960,89 +2976,89 @@ const Mt = /* @__PURE__ */ Y(Ot, [["render", St]]), me = /* @__PURE__ */ N({
|
|
|
2960
2976
|
])
|
|
2961
2977
|
]),
|
|
2962
2978
|
default: g(() => [
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
content:
|
|
2979
|
+
e.option.dialog?.delete?.content ? (d(), b("div", Nt, [
|
|
2980
|
+
E(et, {
|
|
2981
|
+
content: e.option.dialog?.delete?.content,
|
|
2966
2982
|
value: l(t).remove.items
|
|
2967
2983
|
}, null, 8, ["content", "value"])
|
|
2968
|
-
])) : (d(), b("div", Wt,
|
|
2984
|
+
])) : (d(), b("div", Wt, S(l(v).tCurd("confirmDeleteMessage", l(t).remove.items.length)), 1))
|
|
2969
2985
|
]),
|
|
2970
2986
|
_: 1
|
|
2971
2987
|
}, 8, ["modelValue", "title"]),
|
|
2972
|
-
|
|
2988
|
+
E(Qe, {
|
|
2973
2989
|
ref_key: "switchConfirmRef",
|
|
2974
|
-
ref:
|
|
2975
|
-
size:
|
|
2990
|
+
ref: n,
|
|
2991
|
+
size: e.option.size?.form
|
|
2976
2992
|
}, null, 8, ["size"])
|
|
2977
2993
|
], 2);
|
|
2978
2994
|
};
|
|
2979
2995
|
}
|
|
2980
2996
|
});
|
|
2981
|
-
class
|
|
2997
|
+
class _t {
|
|
2982
2998
|
/**
|
|
2983
2999
|
* 通过远程 URL 下载文件,自动创建临时 `<a>` 标签触发浏览器下载
|
|
2984
3000
|
*
|
|
2985
3001
|
* @param href - 文件的远程地址
|
|
2986
3002
|
* @param name - 下载后的文件名,默认 `'download.png'`
|
|
2987
3003
|
*/
|
|
2988
|
-
static async download(
|
|
2989
|
-
const
|
|
2990
|
-
|
|
3004
|
+
static async download(r, s = "download.png") {
|
|
3005
|
+
const c = document.createElement("a");
|
|
3006
|
+
c.style.display = "none", c.href = r, c.setAttribute("download", s), typeof c.download > "u" && c.setAttribute("target", "_blank"), document.body.appendChild(c), c.click(), document.body.removeChild(c), window.URL.revokeObjectURL(r);
|
|
2991
3007
|
}
|
|
2992
3008
|
/**
|
|
2993
3009
|
* 将json对象或者json数组导出为json文件保存
|
|
2994
3010
|
* @param data
|
|
2995
3011
|
* @param name
|
|
2996
3012
|
*/
|
|
2997
|
-
static exportJSONFile = (
|
|
2998
|
-
const
|
|
2999
|
-
t.href =
|
|
3013
|
+
static exportJSONFile = (r, s) => {
|
|
3014
|
+
const c = new Blob([JSON.stringify(r)], { type: "application/json" }), o = URL.createObjectURL(c), t = document.createElement("a");
|
|
3015
|
+
t.href = o, t.download = `${s || "config"}.json`, t.click();
|
|
3000
3016
|
};
|
|
3001
3017
|
/**
|
|
3002
3018
|
* 导入文件内容,默认为json
|
|
3003
3019
|
* @param param
|
|
3004
3020
|
* @returns
|
|
3005
3021
|
*/
|
|
3006
|
-
static importFile = async (
|
|
3007
|
-
const
|
|
3008
|
-
|
|
3009
|
-
const t =
|
|
3010
|
-
|
|
3011
|
-
const
|
|
3012
|
-
if (!
|
|
3013
|
-
|
|
3022
|
+
static importFile = async (r) => new Promise((s, c) => {
|
|
3023
|
+
const o = document.createElement("input");
|
|
3024
|
+
o.type = "file";
|
|
3025
|
+
const t = r?.accept || ".json";
|
|
3026
|
+
o.accept = t, o.style.display = "none", o.onchange = (n) => {
|
|
3027
|
+
const a = n.target.files[0];
|
|
3028
|
+
if (!a) {
|
|
3029
|
+
D.fail("未选择文件"), c("未选择文件");
|
|
3014
3030
|
return;
|
|
3015
3031
|
}
|
|
3016
|
-
const
|
|
3017
|
-
|
|
3018
|
-
const
|
|
3019
|
-
|
|
3020
|
-
},
|
|
3021
|
-
|
|
3022
|
-
},
|
|
3023
|
-
}, document.body.appendChild(
|
|
3032
|
+
const i = new FileReader();
|
|
3033
|
+
i.onload = async (m) => {
|
|
3034
|
+
const u = t == ".json" ? JSON.parse(m.target.result) : m.target.result;
|
|
3035
|
+
s(u);
|
|
3036
|
+
}, i.onerror = () => {
|
|
3037
|
+
D.fail("文件读取失败"), c("文件读取失败");
|
|
3038
|
+
}, i.readAsText(a), document.body.removeChild(o);
|
|
3039
|
+
}, document.body.appendChild(o), o.click();
|
|
3024
3040
|
});
|
|
3025
3041
|
}
|
|
3026
|
-
const Qt = (
|
|
3027
|
-
if (
|
|
3028
|
-
|
|
3029
|
-
for (const
|
|
3030
|
-
|
|
3042
|
+
const Qt = (e, r) => {
|
|
3043
|
+
if (e.component("TCurd", qt), e.component("TFormList", fe), e.component("TColumn", Ne), r?.customComponent) {
|
|
3044
|
+
j.customComponent = r.customComponent;
|
|
3045
|
+
for (const s in r.customComponent)
|
|
3046
|
+
e.component(s, r.customComponent[s]);
|
|
3031
3047
|
}
|
|
3032
|
-
},
|
|
3048
|
+
}, eo = {
|
|
3033
3049
|
install: Qt
|
|
3034
3050
|
};
|
|
3035
3051
|
export {
|
|
3036
|
-
|
|
3052
|
+
H as ArrUtil,
|
|
3037
3053
|
We as ExcelUtil,
|
|
3038
3054
|
Ne as TColumn,
|
|
3039
3055
|
qt as TCurd,
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3056
|
+
_t as TFile,
|
|
3057
|
+
j as TForm,
|
|
3058
|
+
M as TFormConfig,
|
|
3059
|
+
v as TFormI18n,
|
|
3060
|
+
fe as TFormList,
|
|
3061
|
+
D as TSys,
|
|
3062
|
+
eo as default,
|
|
3047
3063
|
Qt as install
|
|
3048
3064
|
};
|