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