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