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