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