cc1-form 1.3.7 → 1.3.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 +1946 -1668
- package/dist/cc1-form.umd.cjs +7 -1
- package/dist/components/TCurd/com/form/list.vue.d.ts +2 -2
- package/dist/components/TCurd/core/table.d.ts +110 -2
- package/dist/components/TCurd/index.d.ts +133 -3
- package/dist/components/TCurd/index.vue.d.ts +287 -23
- package/dist/components/TCurd/indexType.d.ts +39 -2
- package/dist/sortable.esm-BNoi9mdn.js +1645 -0
- package/dist/utils/TFormConfig.d.ts +13 -0
- package/dist/utils/TFormI18n.d.ts +12 -0
- package/package.json +3 -1
package/dist/cc1-form.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ElMessage as
|
|
1
|
+
import { ElMessage as it, ElLoading as st, ElFormItem as he, ElInput as fe, ElInputNumber as dt, ElSwitch as ge, ElSelect as ce, ElOption as ne, ElRadioGroup as je, ElRadioButton as ut, ElRadio as Pe, ElCheckboxGroup as ft, ElCheckboxButton as ct, ElCheckbox as pt, ElColorPicker as mt, ElSlider as bt, ElTreeSelect as gt, ElDatePicker as Ke, ElForm as oe, ElDialog as $e, ElButton as K, ElTableColumn as ue, ElDropdown as Ue, ElDropdownMenu as Ae, ElDropdownItem as de, ElPagination as Be, ElTable as ht } from "element-plus";
|
|
2
2
|
import "vue-router";
|
|
3
|
-
import { defineComponent as
|
|
4
|
-
import { Scope as
|
|
5
|
-
class
|
|
3
|
+
import { defineComponent as Q, reactive as ie, onMounted as He, resolveComponent as pe, openBlock as m, createElementBlock as C, renderSlot as E, createVNode as O, withCtx as h, createTextVNode as M, createCommentVNode as V, Fragment as A, renderList as G, createBlock as y, normalizeClass as J, normalizeStyle as ye, ref as Y, watch as Ne, nextTick as Ce, unref as i, createElementVNode as D, mergeProps as S, toHandlers as $, createSlots as Z, toDisplayString as R, resolveDynamicComponent as ee, computed as ae, onUnmounted as Ie, normalizeProps as Oe, guardReactiveProps as Me, getCurrentInstance as Ge, onBeforeUnmount as yt, withModifiers as wt, resolveDirective as vt, withDirectives as kt } from "vue";
|
|
4
|
+
import { Scope as Fe } from "cc1-vue3";
|
|
5
|
+
class z {
|
|
6
6
|
/**
|
|
7
7
|
* Vue Router 实例,需在应用初始化时赋值
|
|
8
8
|
*/
|
|
@@ -27,13 +27,13 @@ class $ {
|
|
|
27
27
|
* @param data 数据
|
|
28
28
|
* @returns 是否显示
|
|
29
29
|
*/
|
|
30
|
-
static isFun = (
|
|
30
|
+
static isFun = (o, ...s) => Array.isArray(o) ? o.some((t) => typeof t == "function" ? t(...s) : t) : typeof o == "function" ? o(...s) : o;
|
|
31
31
|
/**
|
|
32
32
|
* 获取路由参数,自动获取query、params中的参数, 哪个有就返回哪个
|
|
33
33
|
*/
|
|
34
34
|
static getRouterParams = () => {
|
|
35
|
-
const
|
|
36
|
-
return Object.keys(
|
|
35
|
+
const o = this.router.currentRoute.value.query || {}, s = this.router.currentRoute.value.params || {};
|
|
36
|
+
return Object.keys(o).length ? o : Object.keys(s).length ? s : {};
|
|
37
37
|
};
|
|
38
38
|
/**
|
|
39
39
|
* 模块赋值
|
|
@@ -43,11 +43,11 @@ class $ {
|
|
|
43
43
|
* 加载模块
|
|
44
44
|
* @param module
|
|
45
45
|
*/
|
|
46
|
-
static loadModule = async (
|
|
47
|
-
if (
|
|
48
|
-
throw new Error(`模块${
|
|
49
|
-
const
|
|
50
|
-
return
|
|
46
|
+
static loadModule = async (o) => {
|
|
47
|
+
if (!z.moduleObj[o])
|
|
48
|
+
throw new Error(`模块${o}未加载,请赋值如:TSys.moduleObj = { ${o}: ()=>import('${o}') }`);
|
|
49
|
+
const s = await z.moduleObj[o]();
|
|
50
|
+
return s.default ?? s;
|
|
51
51
|
};
|
|
52
52
|
/**
|
|
53
53
|
* 提示信息对象管理
|
|
@@ -63,19 +63,19 @@ class $ {
|
|
|
63
63
|
* @param type 消息类型
|
|
64
64
|
* @param options 其他选项
|
|
65
65
|
*/
|
|
66
|
-
static showMessage(
|
|
67
|
-
const
|
|
68
|
-
if (!this.tipMessages[
|
|
69
|
-
this.tipMessages[
|
|
70
|
-
const
|
|
66
|
+
static showMessage(o, s, t = {}) {
|
|
67
|
+
const n = Date.now();
|
|
68
|
+
if (!this.tipMessages[o] || n - this.tipMessages[o] > this.tipMessagesGap) {
|
|
69
|
+
this.tipMessages[o] = n;
|
|
70
|
+
const e = Object.assign(
|
|
71
71
|
{
|
|
72
|
-
message:
|
|
73
|
-
type:
|
|
72
|
+
message: o,
|
|
73
|
+
type: s
|
|
74
74
|
},
|
|
75
|
-
|
|
75
|
+
t
|
|
76
76
|
);
|
|
77
|
-
|
|
78
|
-
delete this.tipMessages[
|
|
77
|
+
it(e), setTimeout(() => {
|
|
78
|
+
delete this.tipMessages[o];
|
|
79
79
|
}, this.tipMessagesGap);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -84,16 +84,16 @@ class $ {
|
|
|
84
84
|
* @param content
|
|
85
85
|
* @param options
|
|
86
86
|
*/
|
|
87
|
-
static fail = (
|
|
88
|
-
this.showMessage(
|
|
87
|
+
static fail = (o, s = {}) => {
|
|
88
|
+
this.showMessage(o, "error", s);
|
|
89
89
|
};
|
|
90
90
|
/**
|
|
91
91
|
* 成功提示
|
|
92
92
|
* @param content
|
|
93
93
|
* @param options
|
|
94
94
|
*/
|
|
95
|
-
static success = (
|
|
96
|
-
this.showMessage(
|
|
95
|
+
static success = (o, s = {}) => {
|
|
96
|
+
this.showMessage(o, "success", s);
|
|
97
97
|
};
|
|
98
98
|
static loadingObj = null;
|
|
99
99
|
static loadingTimer = null;
|
|
@@ -102,11 +102,11 @@ class $ {
|
|
|
102
102
|
* @param show
|
|
103
103
|
* @param text
|
|
104
104
|
*/
|
|
105
|
-
static loading = (
|
|
105
|
+
static loading = (o = !0, s = "Loading...") => {
|
|
106
106
|
Timer.un(this.loadingTimer), this.loadingTimer = Timer.once(() => {
|
|
107
|
-
|
|
107
|
+
o ? this.loadingObj = st.service({
|
|
108
108
|
lock: !0,
|
|
109
|
-
text:
|
|
109
|
+
text: s,
|
|
110
110
|
background: "rgba(0, 0, 0, 0.3)"
|
|
111
111
|
}) : this.loadingObj && (this.loadingObj.close(), this.loadingObj = null);
|
|
112
112
|
}, 50);
|
|
@@ -116,46 +116,46 @@ class $ {
|
|
|
116
116
|
* @param url 地址
|
|
117
117
|
* @param isCenter 是否居中
|
|
118
118
|
*/
|
|
119
|
-
static openUrl = (
|
|
120
|
-
if (
|
|
121
|
-
let
|
|
119
|
+
static openUrl = (o, s = !0) => {
|
|
120
|
+
if (s) {
|
|
121
|
+
let t = screen.width / 2 - 500, n = screen.height / 2 - 800 / 2 - 30;
|
|
122
122
|
window.open(
|
|
123
|
-
|
|
123
|
+
o,
|
|
124
124
|
"_blank",
|
|
125
|
-
"toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" +
|
|
125
|
+
"toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + n + ", left=" + t
|
|
126
126
|
);
|
|
127
127
|
} else
|
|
128
|
-
window.open(
|
|
128
|
+
window.open(o, "DescriptiveWindowName" + StrUtil.getId(), "resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0");
|
|
129
129
|
};
|
|
130
130
|
/**
|
|
131
131
|
* 根据dom id截图并返回图片数据
|
|
132
132
|
* @param param
|
|
133
133
|
* @returns
|
|
134
134
|
*/
|
|
135
|
-
static getImgPic = (
|
|
136
|
-
let
|
|
137
|
-
const
|
|
135
|
+
static getImgPic = (o) => new Promise(async (s, t) => {
|
|
136
|
+
let n = document.getElementById(o.id);
|
|
137
|
+
const e = await z.loadModule("html2canvas");
|
|
138
138
|
try {
|
|
139
|
-
|
|
139
|
+
e(n, {
|
|
140
140
|
logging: !1,
|
|
141
141
|
allowTaint: !0,
|
|
142
142
|
scale: window.devicePixelRatio,
|
|
143
|
-
width:
|
|
144
|
-
height:
|
|
145
|
-
windowWidth:
|
|
146
|
-
windowHeight:
|
|
143
|
+
width: o.windowWidth,
|
|
144
|
+
height: o.windowHeight,
|
|
145
|
+
windowWidth: o.windowWidth,
|
|
146
|
+
windowHeight: o.windowHeight,
|
|
147
147
|
useCORS: !0,
|
|
148
148
|
backgroundColor: "#ffffff00"
|
|
149
|
-
}).then(function(
|
|
150
|
-
let
|
|
151
|
-
|
|
149
|
+
}).then(function(r) {
|
|
150
|
+
let l = r.toDataURL("image/png");
|
|
151
|
+
s(l);
|
|
152
152
|
});
|
|
153
|
-
} catch (
|
|
154
|
-
|
|
153
|
+
} catch (r) {
|
|
154
|
+
t(r);
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
|
-
class
|
|
158
|
+
class T {
|
|
159
159
|
/**
|
|
160
160
|
* 全局配置对象
|
|
161
161
|
*/
|
|
@@ -381,7 +381,20 @@ class L {
|
|
|
381
381
|
change: void 0
|
|
382
382
|
},
|
|
383
383
|
/** 是否填充剩余高度 默认填充 */
|
|
384
|
-
fitHeight: !0
|
|
384
|
+
fitHeight: !0,
|
|
385
|
+
sortable: {
|
|
386
|
+
show: !1,
|
|
387
|
+
button: !1,
|
|
388
|
+
saveButton: !0,
|
|
389
|
+
width: 54,
|
|
390
|
+
label: "",
|
|
391
|
+
fixed: "left",
|
|
392
|
+
page: !1,
|
|
393
|
+
scroll: !1,
|
|
394
|
+
field: "sortNo",
|
|
395
|
+
rule: "index",
|
|
396
|
+
api: {}
|
|
397
|
+
}
|
|
385
398
|
},
|
|
386
399
|
columnConfig: {
|
|
387
400
|
type: "input",
|
|
@@ -516,11 +529,11 @@ class L {
|
|
|
516
529
|
*
|
|
517
530
|
* @param config - 需要覆盖的配置项(深度 Partial)
|
|
518
531
|
*/
|
|
519
|
-
static setConfig = (
|
|
520
|
-
|
|
532
|
+
static setConfig = (o) => {
|
|
533
|
+
T.config = ObjectUtil.deepMerge(T.config, o);
|
|
521
534
|
};
|
|
522
535
|
}
|
|
523
|
-
class
|
|
536
|
+
class q {
|
|
524
537
|
/**
|
|
525
538
|
* 自定义组件映射表,key 为组件名(同时作为 column.type 值),value 为 Vue 组件定义
|
|
526
539
|
*
|
|
@@ -542,10 +555,10 @@ class W {
|
|
|
542
555
|
* @param field - 字段的 key 值
|
|
543
556
|
* @returns 该字段对应类型的 options 配置,如 select 类型返回 `options.select`
|
|
544
557
|
*/
|
|
545
|
-
static findOptions = (
|
|
546
|
-
const
|
|
547
|
-
if (
|
|
548
|
-
return
|
|
558
|
+
static findOptions = (o, s) => {
|
|
559
|
+
const t = o.column.find((e) => e.key === s), n = (e) => e.replace(/-([a-z])/g, (r, l) => l.toUpperCase());
|
|
560
|
+
if (t)
|
|
561
|
+
return t.options[n(t.type)];
|
|
549
562
|
};
|
|
550
563
|
/**
|
|
551
564
|
* 更新组件数据
|
|
@@ -563,9 +576,9 @@ class W {
|
|
|
563
576
|
}))
|
|
564
577
|
)
|
|
565
578
|
*/
|
|
566
|
-
static setOptionsData = (
|
|
567
|
-
const
|
|
568
|
-
|
|
579
|
+
static setOptionsData = (o, s, t) => {
|
|
580
|
+
const n = q.findOptions(o, s);
|
|
581
|
+
n && (n.data = t);
|
|
569
582
|
};
|
|
570
583
|
static form = {
|
|
571
584
|
openBefore: {
|
|
@@ -576,14 +589,14 @@ class W {
|
|
|
576
589
|
* @param treeData 树形数据
|
|
577
590
|
* @param option 组件配置
|
|
578
591
|
*/
|
|
579
|
-
parentId: (
|
|
580
|
-
const
|
|
581
|
-
|
|
592
|
+
parentId: (o, s, t, n) => {
|
|
593
|
+
const e = T.config.table.rowKey;
|
|
594
|
+
o ? s.type === z.EDialog.Add ? (s.form.parentId = o[e], s.form.sort = o.children.length + 1) : s.form.parentId = o.parentId.substring(o.parentId.lastIndexOf(",") + 1) : (s.form.parentId = "0", s.form.sort = t.length + 1), q.setOptionsData(n, "parentId", [{ [e]: "0", title: "根", children: t }]);
|
|
582
595
|
}
|
|
583
596
|
}
|
|
584
597
|
};
|
|
585
598
|
}
|
|
586
|
-
class
|
|
599
|
+
class X {
|
|
587
600
|
/**
|
|
588
601
|
* ID 生成函数,默认使用 `StrUtil.uuid()`,可覆盖为自定义实现
|
|
589
602
|
*/
|
|
@@ -593,14 +606,14 @@ class Q {
|
|
|
593
606
|
* @param field 字段名
|
|
594
607
|
* @param row 行数据
|
|
595
608
|
*/
|
|
596
|
-
static setId = (
|
|
597
|
-
|
|
598
|
-
const
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
let
|
|
602
|
-
|
|
603
|
-
}),
|
|
609
|
+
static setId = (o, s, t) => {
|
|
610
|
+
s[o] || (s[o] = []);
|
|
611
|
+
const n = T.config.table.rowKey;
|
|
612
|
+
s[o].forEach((e) => {
|
|
613
|
+
t.forEach((r) => {
|
|
614
|
+
let l = r.default ?? "";
|
|
615
|
+
r.type === "number" && (l = r.default ?? 0), r.type === "boolean" && (l = r.default ?? !1), r.type === "time" && (l = r.default ?? /* @__PURE__ */ new Date()), e[r.value] === void 0 && (e[r.value] = l);
|
|
616
|
+
}), e[n] || (e[n] = X.getIdFun());
|
|
604
617
|
});
|
|
605
618
|
};
|
|
606
619
|
/**
|
|
@@ -610,19 +623,19 @@ class Q {
|
|
|
610
623
|
* @param itemFields 元素字段-如:[{label:'',value:''}]
|
|
611
624
|
* @param callback 回调函数
|
|
612
625
|
*/
|
|
613
|
-
static add = (
|
|
614
|
-
const
|
|
615
|
-
|
|
616
|
-
const
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
(
|
|
620
|
-
let
|
|
621
|
-
return
|
|
626
|
+
static add = (o, s, t, n) => {
|
|
627
|
+
const e = JSONUtil.cp(t);
|
|
628
|
+
X.setId(o, s, t);
|
|
629
|
+
const r = T.config.table.rowKey;
|
|
630
|
+
s[o].push(
|
|
631
|
+
e.reduce(
|
|
632
|
+
(l, u) => {
|
|
633
|
+
let f = u.default ?? "";
|
|
634
|
+
return u.type === "number" && (f = u.default ?? 0), u.type === "boolean" && (f = u.default ?? !1), u.type === "time" && (f = u.default ?? /* @__PURE__ */ new Date()), l[u.value] = f, l;
|
|
622
635
|
},
|
|
623
|
-
{ [
|
|
636
|
+
{ [r]: X.getIdFun() }
|
|
624
637
|
)
|
|
625
|
-
),
|
|
638
|
+
), n?.(s);
|
|
626
639
|
};
|
|
627
640
|
/**
|
|
628
641
|
* 删除数组元素
|
|
@@ -631,9 +644,9 @@ class Q {
|
|
|
631
644
|
* @param item 元素-如:{_id:''}
|
|
632
645
|
* @param callback 回调函数
|
|
633
646
|
*/
|
|
634
|
-
static remove = (
|
|
635
|
-
const
|
|
636
|
-
|
|
647
|
+
static remove = (o, s, t, n) => {
|
|
648
|
+
const e = T.config.table.rowKey;
|
|
649
|
+
s[o] = s[o].filter((r) => r[e] !== t[e]), n?.(s);
|
|
637
650
|
};
|
|
638
651
|
/**
|
|
639
652
|
* 获取没有id的数据
|
|
@@ -641,21 +654,21 @@ class Q {
|
|
|
641
654
|
* @param childernField 子级字段-如:list、children
|
|
642
655
|
* @returns 没有id的数据
|
|
643
656
|
*/
|
|
644
|
-
static getNoIdData = (
|
|
645
|
-
const
|
|
646
|
-
return
|
|
647
|
-
|
|
648
|
-
}),
|
|
657
|
+
static getNoIdData = (o, s) => {
|
|
658
|
+
const t = JSONUtil.cp(o), n = T.config.table.rowKey;
|
|
659
|
+
return t.forEach((e) => {
|
|
660
|
+
e[n] && delete e[n], s && e[s] && X.getNoIdData(e[s], s);
|
|
661
|
+
}), t;
|
|
649
662
|
};
|
|
650
663
|
}
|
|
651
|
-
const
|
|
664
|
+
const Ct = {
|
|
652
665
|
key: 0,
|
|
653
666
|
class: "column curd-form-com-list",
|
|
654
667
|
style: { width: "100%", gap: "10px" }
|
|
655
|
-
},
|
|
668
|
+
}, Vt = { key: 0 }, St = {
|
|
656
669
|
class: "row items-center",
|
|
657
670
|
style: { gap: "10px", width: "100%" }
|
|
658
|
-
},
|
|
671
|
+
}, Et = { key: 1 }, We = /* @__PURE__ */ Q({
|
|
659
672
|
__name: "list",
|
|
660
673
|
props: {
|
|
661
674
|
row: {
|
|
@@ -693,88 +706,88 @@ const kt = {
|
|
|
693
706
|
}
|
|
694
707
|
},
|
|
695
708
|
emits: ["change"],
|
|
696
|
-
setup(
|
|
697
|
-
const
|
|
709
|
+
setup(a, { emit: o }) {
|
|
710
|
+
const s = a, t = ie({
|
|
698
711
|
show: !1,
|
|
699
|
-
add: (
|
|
700
|
-
|
|
701
|
-
|
|
712
|
+
add: (e, r, l) => {
|
|
713
|
+
X.add(e, r, l, () => {
|
|
714
|
+
n("change");
|
|
702
715
|
});
|
|
703
716
|
},
|
|
704
|
-
remove: (
|
|
705
|
-
|
|
706
|
-
|
|
717
|
+
remove: (e, r, l) => {
|
|
718
|
+
X.remove(e, r, l, () => {
|
|
719
|
+
n("change");
|
|
707
720
|
});
|
|
708
721
|
}
|
|
709
722
|
});
|
|
710
|
-
|
|
711
|
-
|
|
723
|
+
He(() => {
|
|
724
|
+
X.setId(s.field, s.row, s.itemFields), t.show = !0;
|
|
712
725
|
});
|
|
713
|
-
const
|
|
714
|
-
return (
|
|
715
|
-
const
|
|
716
|
-
return
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
726
|
+
const n = o;
|
|
727
|
+
return (e, r) => {
|
|
728
|
+
const l = pe("el-button"), u = pe("el-input");
|
|
729
|
+
return t.show ? (m(), C("div", Ct, [
|
|
730
|
+
E(e.$slots, "list-start", { row: a.row }),
|
|
731
|
+
a.addBottom ? V("", !0) : (m(), C("div", Vt, [
|
|
732
|
+
O(l, {
|
|
720
733
|
link: "",
|
|
721
734
|
type: "primary",
|
|
722
|
-
onClick:
|
|
735
|
+
onClick: r[0] || (r[0] = (f) => t.add(a.field, a.row, a.itemFields))
|
|
723
736
|
}, {
|
|
724
|
-
default:
|
|
725
|
-
M("添加"
|
|
726
|
-
])
|
|
737
|
+
default: h(() => r[3] || (r[3] = [
|
|
738
|
+
M("添加")
|
|
739
|
+
])),
|
|
727
740
|
_: 1
|
|
728
741
|
})
|
|
729
742
|
])),
|
|
730
|
-
(
|
|
731
|
-
|
|
732
|
-
item:
|
|
733
|
-
row:
|
|
743
|
+
(m(!0), C(A, null, G(a.row[a.field], (f) => (m(), C("div", St, [
|
|
744
|
+
E(e.$slots, "item-start", {
|
|
745
|
+
item: f,
|
|
746
|
+
row: a.row
|
|
734
747
|
}),
|
|
735
|
-
(
|
|
736
|
-
modelValue:
|
|
737
|
-
"onUpdate:modelValue": (
|
|
738
|
-
style:
|
|
739
|
-
class: J(
|
|
740
|
-
placeholder: d[
|
|
741
|
-
onChange:
|
|
748
|
+
(m(!0), C(A, null, G(a.itemFields, (d) => (m(), y(u, {
|
|
749
|
+
modelValue: f[d.value],
|
|
750
|
+
"onUpdate:modelValue": (b) => f[d.value] = b,
|
|
751
|
+
style: ye({ width: a.inputWidth }),
|
|
752
|
+
class: J(a.inputClass),
|
|
753
|
+
placeholder: d[a.label] || d[a.value],
|
|
754
|
+
onChange: r[1] || (r[1] = (b) => n("change"))
|
|
742
755
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "style", "class", "placeholder"]))), 256)),
|
|
743
|
-
|
|
744
|
-
item:
|
|
745
|
-
row:
|
|
756
|
+
E(e.$slots, "item-end", {
|
|
757
|
+
item: f,
|
|
758
|
+
row: a.row
|
|
746
759
|
}),
|
|
747
|
-
|
|
760
|
+
O(l, {
|
|
748
761
|
link: "",
|
|
749
762
|
type: "danger",
|
|
750
|
-
onClick: (d) =>
|
|
763
|
+
onClick: (d) => t.remove(a.field, a.row, f)
|
|
751
764
|
}, {
|
|
752
|
-
default:
|
|
753
|
-
M("删除"
|
|
754
|
-
])
|
|
755
|
-
_:
|
|
756
|
-
},
|
|
765
|
+
default: h(() => r[4] || (r[4] = [
|
|
766
|
+
M("删除")
|
|
767
|
+
])),
|
|
768
|
+
_: 2
|
|
769
|
+
}, 1032, ["onClick"])
|
|
757
770
|
]))), 256)),
|
|
758
|
-
|
|
759
|
-
|
|
771
|
+
a.addBottom ? (m(), C("div", Et, [
|
|
772
|
+
O(l, {
|
|
760
773
|
link: "",
|
|
761
774
|
type: "primary",
|
|
762
|
-
onClick:
|
|
775
|
+
onClick: r[2] || (r[2] = (f) => t.add(a.field, a.row, a.itemFields))
|
|
763
776
|
}, {
|
|
764
|
-
default:
|
|
765
|
-
M("添加"
|
|
766
|
-
])
|
|
777
|
+
default: h(() => r[5] || (r[5] = [
|
|
778
|
+
M("添加")
|
|
779
|
+
])),
|
|
767
780
|
_: 1
|
|
768
781
|
})
|
|
769
782
|
])) : V("", !0),
|
|
770
|
-
|
|
783
|
+
E(e.$slots, "list-end", { row: a.row })
|
|
771
784
|
])) : V("", !0);
|
|
772
785
|
};
|
|
773
786
|
}
|
|
774
|
-
}),
|
|
787
|
+
}), zt = {
|
|
775
788
|
class: "row form-item-content",
|
|
776
789
|
style: { width: "100%" }
|
|
777
|
-
},
|
|
790
|
+
}, $t = { class: "col column form-item-content-item" }, Ot = { class: "col" }, Mt = ["innerHTML"], Ft = /* @__PURE__ */ Q({
|
|
778
791
|
__name: "field",
|
|
779
792
|
props: {
|
|
780
793
|
item: {},
|
|
@@ -785,180 +798,185 @@ const kt = {
|
|
|
785
798
|
getOn: { type: Function },
|
|
786
799
|
getDisabled: { type: Function }
|
|
787
800
|
},
|
|
788
|
-
setup(
|
|
789
|
-
const
|
|
790
|
-
const
|
|
791
|
-
return
|
|
792
|
-
},
|
|
793
|
-
|
|
801
|
+
setup(a) {
|
|
802
|
+
const o = a, s = Y(), t = () => {
|
|
803
|
+
const e = s.value?.validateState;
|
|
804
|
+
return e && typeof e == "object" && "value" in e ? e.value : e;
|
|
805
|
+
}, n = () => {
|
|
806
|
+
t() === "error" && s.value?.clearValidate?.();
|
|
794
807
|
};
|
|
795
|
-
return
|
|
796
|
-
() =>
|
|
808
|
+
return Ne(
|
|
809
|
+
() => o.form?.[o.item.key],
|
|
797
810
|
() => {
|
|
798
|
-
|
|
811
|
+
n(), Ce(() => n());
|
|
799
812
|
},
|
|
800
813
|
{ deep: !0, flush: "post" }
|
|
801
|
-
), (
|
|
814
|
+
), (e, r) => (m(), y(i(he), {
|
|
802
815
|
ref_key: "formItemRef",
|
|
803
|
-
ref:
|
|
816
|
+
ref: s,
|
|
804
817
|
label: e.item.text?.form?.label ?? e.item.label,
|
|
805
818
|
prop: e.item.key,
|
|
806
819
|
"label-width": e.item.text?.form?.label == "" ? 0 : e.item.form?.labelWidth || e.labelWidth
|
|
807
820
|
}, {
|
|
808
|
-
default:
|
|
809
|
-
|
|
810
|
-
|
|
821
|
+
default: h(() => [
|
|
822
|
+
D("div", zt, [
|
|
823
|
+
E(e.$slots, "form-" + e.item.key + "-start", {
|
|
811
824
|
row: e.form,
|
|
812
825
|
item: e.item
|
|
813
826
|
}),
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
827
|
+
D("div", $t, [
|
|
828
|
+
D("div", Ot, [
|
|
829
|
+
E(e.$slots, "form-" + e.item.key, {
|
|
817
830
|
row: e.form,
|
|
818
831
|
item: e.item
|
|
819
832
|
}, () => [
|
|
820
|
-
e.item.type === "input" ? (
|
|
833
|
+
e.item.type === "input" ? (m(), y(i(fe), S({
|
|
821
834
|
key: 0,
|
|
822
835
|
modelValue: e.form[e.item.key],
|
|
823
|
-
"onUpdate:modelValue":
|
|
824
|
-
}, e.getBind(e.item),
|
|
836
|
+
"onUpdate:modelValue": r[0] || (r[0] = (l) => e.form[e.item.key] = l)
|
|
837
|
+
}, e.getBind(e.item), $(e.getOn(e.item)), {
|
|
825
838
|
disabled: e.getDisabled(e.item)
|
|
826
|
-
}),
|
|
839
|
+
}), Z({ _: 2 }, [
|
|
827
840
|
e.getBind(e.item).prepend ? {
|
|
828
841
|
name: "prepend",
|
|
829
|
-
fn:
|
|
830
|
-
M(
|
|
842
|
+
fn: h(() => [
|
|
843
|
+
M(R(typeof e.getBind(e.item).prepend == "function" ? e.getBind(e.item).prepend(e.form) : e.getBind(e.item).prepend), 1)
|
|
831
844
|
]),
|
|
832
845
|
key: "0"
|
|
833
846
|
} : void 0
|
|
834
|
-
]), 1040, ["modelValue", "disabled"])) : e.item.type === "number" ? (
|
|
847
|
+
]), 1040, ["modelValue", "disabled"])) : e.item.type === "number" ? (m(), y(i(dt), S({
|
|
835
848
|
key: 1,
|
|
836
849
|
modelValue: e.form[e.item.key],
|
|
837
|
-
"onUpdate:modelValue":
|
|
838
|
-
}, e.getBind(e.item),
|
|
850
|
+
"onUpdate:modelValue": r[1] || (r[1] = (l) => e.form[e.item.key] = l)
|
|
851
|
+
}, e.getBind(e.item), $(e.getOn(e.item)), {
|
|
839
852
|
disabled: e.getDisabled(e.item)
|
|
840
|
-
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "textarea" ? (
|
|
853
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "textarea" ? (m(), y(i(fe), S({
|
|
841
854
|
key: 2,
|
|
842
855
|
type: "textarea",
|
|
843
856
|
modelValue: e.form[e.item.key],
|
|
844
|
-
"onUpdate:modelValue":
|
|
845
|
-
}, e.getBind(e.item),
|
|
857
|
+
"onUpdate:modelValue": r[2] || (r[2] = (l) => e.form[e.item.key] = l)
|
|
858
|
+
}, e.getBind(e.item), $(e.getOn(e.item)), {
|
|
846
859
|
disabled: e.getDisabled(e.item)
|
|
847
|
-
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "switch" ? (
|
|
860
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "switch" ? (m(), y(i(ge), S({
|
|
848
861
|
key: 3,
|
|
849
862
|
modelValue: e.form[e.item.key],
|
|
850
|
-
"onUpdate:modelValue":
|
|
851
|
-
}, e.getBind(e.item),
|
|
863
|
+
"onUpdate:modelValue": r[3] || (r[3] = (l) => e.form[e.item.key] = l)
|
|
864
|
+
}, e.getBind(e.item), $(e.getOn(e.item)), {
|
|
852
865
|
disabled: e.getDisabled(e.item)
|
|
853
|
-
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "select" ? (
|
|
866
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "select" ? (m(), y(i(ce), S({
|
|
854
867
|
key: 4,
|
|
855
868
|
modelValue: e.form[e.item.key],
|
|
856
|
-
"onUpdate:modelValue":
|
|
857
|
-
}, e.getBind(e.item),
|
|
869
|
+
"onUpdate:modelValue": r[4] || (r[4] = (l) => e.form[e.item.key] = l)
|
|
870
|
+
}, e.getBind(e.item), $(e.getOn(e.item)), {
|
|
858
871
|
disabled: e.getDisabled(e.item),
|
|
859
872
|
style: { width: "100%" }
|
|
860
873
|
}), {
|
|
861
|
-
default:
|
|
862
|
-
(
|
|
863
|
-
key:
|
|
864
|
-
|
|
874
|
+
default: h(() => [
|
|
875
|
+
(m(!0), C(A, null, G(e.getBind(e.item).data || [], (l) => (m(), y(i(ne), S({
|
|
876
|
+
key: l.value,
|
|
877
|
+
ref_for: !0
|
|
878
|
+
}, l, $(l.on || {})), null, 16))), 128))
|
|
865
879
|
]),
|
|
866
880
|
_: 1
|
|
867
|
-
}, 16, ["modelValue", "disabled"])) : e.item.type === "radio" ? (
|
|
881
|
+
}, 16, ["modelValue", "disabled"])) : e.item.type === "radio" ? (m(), y(i(je), S({
|
|
868
882
|
key: 5,
|
|
869
883
|
modelValue: e.form[e.item.key],
|
|
870
|
-
"onUpdate:modelValue":
|
|
871
|
-
}, e.getBind(e.item),
|
|
884
|
+
"onUpdate:modelValue": r[5] || (r[5] = (l) => e.form[e.item.key] = l)
|
|
885
|
+
}, e.getBind(e.item), $(e.getOn(e.item)), {
|
|
872
886
|
disabled: e.getDisabled(e.item),
|
|
873
887
|
style: { width: "100%" }
|
|
874
888
|
}), {
|
|
875
|
-
default:
|
|
876
|
-
e.getBind(e.item).type === "group" ? (
|
|
877
|
-
key:
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
889
|
+
default: h(() => [
|
|
890
|
+
e.getBind(e.item).type === "group" ? (m(!0), C(A, { key: 0 }, G(e.getBind(e.item).data || [], (l) => (m(), y(i(ut), S({
|
|
891
|
+
key: l.value,
|
|
892
|
+
ref_for: !0
|
|
893
|
+
}, l, $(l.on || {})), null, 16))), 128)) : (m(!0), C(A, { key: 1 }, G(e.getBind(e.item).data || [], (l) => (m(), y(i(Pe), S({
|
|
894
|
+
key: l.value,
|
|
895
|
+
ref_for: !0
|
|
896
|
+
}, l, $(l.on || {})), null, 16))), 128))
|
|
881
897
|
]),
|
|
882
898
|
_: 1
|
|
883
|
-
}, 16, ["modelValue", "disabled"])) : e.item.type === "checkbox" ? (
|
|
899
|
+
}, 16, ["modelValue", "disabled"])) : e.item.type === "checkbox" ? (m(), y(i(ft), S({
|
|
884
900
|
key: 6,
|
|
885
901
|
modelValue: e.form[e.item.key],
|
|
886
|
-
"onUpdate:modelValue":
|
|
887
|
-
}, e.getBind(e.item),
|
|
902
|
+
"onUpdate:modelValue": r[6] || (r[6] = (l) => e.form[e.item.key] = l)
|
|
903
|
+
}, e.getBind(e.item), $(e.getOn(e.item)), {
|
|
888
904
|
disabled: e.getDisabled(e.item),
|
|
889
905
|
style: { width: "100%" }
|
|
890
906
|
}), {
|
|
891
|
-
default:
|
|
892
|
-
e.getBind(e.item).type === "group" ? (
|
|
893
|
-
key:
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
907
|
+
default: h(() => [
|
|
908
|
+
e.getBind(e.item).type === "group" ? (m(!0), C(A, { key: 0 }, G(e.getBind(e.item).data || [], (l) => (m(), y(i(ct), S({
|
|
909
|
+
key: l.value,
|
|
910
|
+
ref_for: !0
|
|
911
|
+
}, l, $(l.on || {})), null, 16))), 128)) : (m(!0), C(A, { key: 1 }, G(e.getBind(e.item).data || [], (l) => (m(), y(i(pt), S({
|
|
912
|
+
key: l.value,
|
|
913
|
+
ref_for: !0
|
|
914
|
+
}, l, $(l.on || {})), null, 16))), 128))
|
|
897
915
|
]),
|
|
898
916
|
_: 1
|
|
899
|
-
}, 16, ["modelValue", "disabled"])) : e.item.type === "color" ? (
|
|
917
|
+
}, 16, ["modelValue", "disabled"])) : e.item.type === "color" ? (m(), y(i(mt), S({
|
|
900
918
|
key: 7,
|
|
901
919
|
modelValue: e.form[e.item.key],
|
|
902
|
-
"onUpdate:modelValue":
|
|
903
|
-
}, e.getBind(e.item),
|
|
920
|
+
"onUpdate:modelValue": r[7] || (r[7] = (l) => e.form[e.item.key] = l)
|
|
921
|
+
}, e.getBind(e.item), $(e.getOn(e.item)), {
|
|
904
922
|
disabled: e.getDisabled(e.item)
|
|
905
|
-
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "slider" ? (
|
|
923
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "slider" ? (m(), y(i(bt), S({
|
|
906
924
|
key: 8,
|
|
907
925
|
modelValue: e.form[e.item.key],
|
|
908
|
-
"onUpdate:modelValue":
|
|
909
|
-
}, e.getBind(e.item),
|
|
926
|
+
"onUpdate:modelValue": r[8] || (r[8] = (l) => e.form[e.item.key] = l)
|
|
927
|
+
}, e.getBind(e.item), $(e.getOn(e.item)), {
|
|
910
928
|
disabled: e.getDisabled(e.item)
|
|
911
|
-
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "list" ? (
|
|
929
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "list" ? (m(), y(We, S({
|
|
912
930
|
key: 9,
|
|
913
931
|
row: e.form,
|
|
914
932
|
field: e.item.key
|
|
915
|
-
}, e.getBind(e.item),
|
|
933
|
+
}, e.getBind(e.item), $(e.getOn(e.item)), {
|
|
916
934
|
disabled: e.getDisabled(e.item),
|
|
917
935
|
style: { width: "100%" }
|
|
918
|
-
}), null, 16, ["row", "field", "disabled"])) : e.item.type === "treeSelect" ? (
|
|
936
|
+
}), null, 16, ["row", "field", "disabled"])) : e.item.type === "treeSelect" ? (m(), y(i(gt), S({
|
|
919
937
|
key: 10,
|
|
920
938
|
modelValue: e.form[e.item.key],
|
|
921
|
-
"onUpdate:modelValue":
|
|
922
|
-
}, e.getBind(e.item),
|
|
939
|
+
"onUpdate:modelValue": r[9] || (r[9] = (l) => e.form[e.item.key] = l)
|
|
940
|
+
}, e.getBind(e.item), $(e.getOn(e.item)), {
|
|
923
941
|
disabled: e.getDisabled(e.item),
|
|
924
942
|
style: { width: "100%" }
|
|
925
|
-
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "datetime" ? (
|
|
943
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type === "datetime" ? (m(), y(i(Ke), S({
|
|
926
944
|
key: 11,
|
|
927
945
|
modelValue: e.form[e.item.key],
|
|
928
|
-
"onUpdate:modelValue":
|
|
929
|
-
}, e.getBind(e.item),
|
|
946
|
+
"onUpdate:modelValue": r[10] || (r[10] = (l) => e.form[e.item.key] = l)
|
|
947
|
+
}, e.getBind(e.item), $(e.getOn(e.item)), {
|
|
930
948
|
disabled: e.getDisabled(e.item)
|
|
931
|
-
}), null, 16, ["modelValue", "disabled"])) : e.item.type && typeof e.item.type == "object" ? (
|
|
949
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type && typeof e.item.type == "object" ? (m(), y(ee(e.item.type), S({
|
|
932
950
|
key: 12,
|
|
933
951
|
modelValue: e.form[e.item.key],
|
|
934
|
-
"onUpdate:modelValue":
|
|
935
|
-
}, e.getBind(e.item),
|
|
952
|
+
"onUpdate:modelValue": r[11] || (r[11] = (l) => e.form[e.item.key] = l)
|
|
953
|
+
}, e.getBind(e.item), $(e.getOn(e.item)), {
|
|
936
954
|
disabled: e.getDisabled(e.item)
|
|
937
|
-
}), null, 16, ["modelValue", "disabled"])) : e.item.type && (
|
|
955
|
+
}), null, 16, ["modelValue", "disabled"])) : e.item.type && (i(q).customComponent[e.item.type] || i(q).customComponent[e.item.type]?.form) ? (m(), y(ee(i(q).customComponent[e.item.type]?.form || i(q).customComponent[e.item.type]), S({
|
|
938
956
|
key: 13,
|
|
939
957
|
modelValue: e.form[e.item.key],
|
|
940
|
-
"onUpdate:modelValue":
|
|
941
|
-
}, e.getBind(e.item),
|
|
958
|
+
"onUpdate:modelValue": r[12] || (r[12] = (l) => e.form[e.item.key] = l)
|
|
959
|
+
}, e.getBind(e.item), $(e.getOn(e.item)), {
|
|
942
960
|
disabled: e.getDisabled(e.item)
|
|
943
961
|
}), null, 16, ["modelValue", "disabled"])) : V("", !0)
|
|
944
962
|
]),
|
|
945
|
-
|
|
963
|
+
E(e.$slots, "form-" + e.item.key + "-right", {
|
|
946
964
|
row: e.form,
|
|
947
965
|
item: e.item
|
|
948
966
|
})
|
|
949
967
|
]),
|
|
950
|
-
|
|
968
|
+
E(e.$slots, "form-" + e.item.key + "-tip", {
|
|
951
969
|
row: e.form,
|
|
952
970
|
item: e.item
|
|
953
971
|
}, () => [
|
|
954
|
-
e.item.form?.tipText ? (
|
|
972
|
+
e.item.form?.tipText ? (m(), C("div", {
|
|
955
973
|
key: 0,
|
|
956
974
|
class: "form-tip-text",
|
|
957
975
|
innerHTML: typeof e.item.form?.tipText == "function" ? e.item.form?.tipText(e.form, e.type) : e.item.form?.tipText
|
|
958
|
-
}, null, 8,
|
|
976
|
+
}, null, 8, Mt)) : V("", !0)
|
|
959
977
|
])
|
|
960
978
|
]),
|
|
961
|
-
|
|
979
|
+
E(e.$slots, "form-" + e.item.key + "-end", {
|
|
962
980
|
row: e.form,
|
|
963
981
|
item: e.item
|
|
964
982
|
})
|
|
@@ -968,7 +986,7 @@ const kt = {
|
|
|
968
986
|
}, 8, ["label", "prop", "label-width"]));
|
|
969
987
|
}
|
|
970
988
|
});
|
|
971
|
-
const
|
|
989
|
+
const Rt = {
|
|
972
990
|
search: "搜索",
|
|
973
991
|
add: "新增",
|
|
974
992
|
edit: "编辑",
|
|
@@ -1002,36 +1020,42 @@ const Mt = {
|
|
|
1002
1020
|
confirmModify: "确认修改",
|
|
1003
1021
|
confirmSwitchMessage: "确认要修改吗?",
|
|
1004
1022
|
mergeColumn: "合并栏位",
|
|
1005
|
-
expandColumn: "展开栏位"
|
|
1023
|
+
expandColumn: "展开栏位",
|
|
1024
|
+
sortable: "拖拽进行排序,点击保存排序可保存排序结果",
|
|
1025
|
+
sortableStart: "排序",
|
|
1026
|
+
sortableAction: "排序操作",
|
|
1027
|
+
sortableSave: "保存排序",
|
|
1028
|
+
sortableExit: "退出排序",
|
|
1029
|
+
sortableUpdateApiRequired: "未配置排序保存接口"
|
|
1006
1030
|
};
|
|
1007
|
-
class
|
|
1031
|
+
class k {
|
|
1008
1032
|
/** 解析国际化值:函数则执行并返回字符串,字符串则替换 `{key}` 占位符 */
|
|
1009
|
-
static t(
|
|
1010
|
-
if (typeof
|
|
1011
|
-
return
|
|
1012
|
-
|
|
1013
|
-
let
|
|
1014
|
-
return
|
|
1033
|
+
static t(o, ...s) {
|
|
1034
|
+
if (typeof o == "function")
|
|
1035
|
+
return o(...s);
|
|
1036
|
+
o = String(o);
|
|
1037
|
+
let t = 0;
|
|
1038
|
+
return o.replace(/{([^}]+)}/g, (n, e) => t < s.length ? String(s[t++]) : `{${e}}`);
|
|
1015
1039
|
}
|
|
1016
|
-
static setI18n = (
|
|
1017
|
-
|
|
1040
|
+
static setI18n = (o) => {
|
|
1041
|
+
k.curd = ObjectUtil.deepMerge(k.curd, o);
|
|
1018
1042
|
};
|
|
1019
1043
|
/** 解析curd国际化值 */
|
|
1020
|
-
static tCurd(
|
|
1021
|
-
return this.t(this.curd[
|
|
1044
|
+
static tCurd(o, ...s) {
|
|
1045
|
+
return this.t(this.curd[o], ...s);
|
|
1022
1046
|
}
|
|
1023
1047
|
/** curd表单 */
|
|
1024
|
-
static curd =
|
|
1048
|
+
static curd = Rt;
|
|
1025
1049
|
}
|
|
1026
|
-
class
|
|
1050
|
+
class x {
|
|
1027
1051
|
/**
|
|
1028
1052
|
* 删除对象所有属性
|
|
1029
1053
|
* @param obj 对象
|
|
1030
1054
|
* @returns
|
|
1031
1055
|
*/
|
|
1032
|
-
static delAllKey = (
|
|
1033
|
-
Object.keys(
|
|
1034
|
-
delete
|
|
1056
|
+
static delAllKey = (o) => {
|
|
1057
|
+
Object.keys(o).forEach((s) => {
|
|
1058
|
+
delete o[s];
|
|
1035
1059
|
});
|
|
1036
1060
|
};
|
|
1037
1061
|
/**
|
|
@@ -1041,52 +1065,52 @@ class Z {
|
|
|
1041
1065
|
* @param delAll 是否删除目标对象所有属性
|
|
1042
1066
|
* @returns
|
|
1043
1067
|
*/
|
|
1044
|
-
static setValue = (
|
|
1045
|
-
|
|
1046
|
-
|
|
1068
|
+
static setValue = (o, s, t = !1) => {
|
|
1069
|
+
t && x.delAllKey(o), Object.keys(s).forEach((n) => {
|
|
1070
|
+
o[n] !== s[n] && (o[n] = s[n]);
|
|
1047
1071
|
});
|
|
1048
1072
|
};
|
|
1049
1073
|
}
|
|
1050
|
-
const we = (
|
|
1051
|
-
const
|
|
1052
|
-
const
|
|
1053
|
-
return
|
|
1074
|
+
const we = (a) => {
|
|
1075
|
+
const o = ie({}), s = () => typeof a == "function" ? a() : a, t = () => {
|
|
1076
|
+
const n = s();
|
|
1077
|
+
return n ?? o;
|
|
1054
1078
|
};
|
|
1055
1079
|
return {
|
|
1056
|
-
internal:
|
|
1057
|
-
isExternal: () =>
|
|
1080
|
+
internal: o,
|
|
1081
|
+
isExternal: () => s() != null,
|
|
1058
1082
|
get() {
|
|
1059
|
-
return
|
|
1083
|
+
return t();
|
|
1060
1084
|
},
|
|
1061
|
-
set(
|
|
1062
|
-
|
|
1085
|
+
set(n) {
|
|
1086
|
+
x.setValue(t(), n, !0);
|
|
1063
1087
|
},
|
|
1064
|
-
merge(
|
|
1065
|
-
|
|
1088
|
+
merge(n) {
|
|
1089
|
+
x.setValue(t(), n, !1);
|
|
1066
1090
|
},
|
|
1067
1091
|
clear() {
|
|
1068
|
-
|
|
1092
|
+
x.delAllKey(t());
|
|
1069
1093
|
}
|
|
1070
1094
|
};
|
|
1071
|
-
}, me = (
|
|
1072
|
-
|
|
1095
|
+
}, me = (a) => {
|
|
1096
|
+
a.forEach((o) => {
|
|
1073
1097
|
console.error({
|
|
1074
|
-
field:
|
|
1075
|
-
error:
|
|
1098
|
+
field: o.field || "",
|
|
1099
|
+
error: o.error || ""
|
|
1076
1100
|
});
|
|
1077
1101
|
});
|
|
1078
|
-
},
|
|
1079
|
-
field:
|
|
1080
|
-
error:
|
|
1081
|
-
}))),
|
|
1082
|
-
const
|
|
1083
|
-
const
|
|
1084
|
-
if (!
|
|
1085
|
-
await
|
|
1086
|
-
const
|
|
1087
|
-
if (
|
|
1088
|
-
if (!await
|
|
1089
|
-
|
|
1102
|
+
}, Dt = (a) => a ? typeof a == "string" ? a : a instanceof Error ? a.message : a.message || String(a) : "", ve = (a) => !a || typeof a != "object" ? [] : Object.keys(a).flatMap((o) => (Array.isArray(a[o]) ? a[o] : [a[o]]).map((t) => ({
|
|
1103
|
+
field: t?.field || o,
|
|
1104
|
+
error: Dt(t)
|
|
1105
|
+
}))), be = z.EDialog, le = (a) => typeof a.type == "object" ? "component" : a.type || "input", Ut = (a, o, s) => {
|
|
1106
|
+
const t = we(() => o.form), n = (r) => De(r.update.formGrid || [], r.update.form, r.update.type, r.update.formMaxSpan).map((u) => u.item.key).filter(Boolean), e = async (r) => {
|
|
1107
|
+
const l = s.ruleFormRef.value;
|
|
1108
|
+
if (!l) return !0;
|
|
1109
|
+
await Ce();
|
|
1110
|
+
const u = n(r), f = Object.keys(r.update.rules || {}).filter((b) => !u.includes(b));
|
|
1111
|
+
if (f.length && l.clearValidate(f), !u.length) return !0;
|
|
1112
|
+
if (!await l.validateField(u, async (b, c) => {
|
|
1113
|
+
b || me(ve(c));
|
|
1090
1114
|
})) throw !1;
|
|
1091
1115
|
return !0;
|
|
1092
1116
|
};
|
|
@@ -1097,37 +1121,37 @@ const we = (e) => {
|
|
|
1097
1121
|
show: !1,
|
|
1098
1122
|
showContent: !1,
|
|
1099
1123
|
loading: !1,
|
|
1100
|
-
type:
|
|
1124
|
+
type: be.Update,
|
|
1101
1125
|
get form() {
|
|
1102
|
-
return
|
|
1126
|
+
return t.get();
|
|
1103
1127
|
},
|
|
1104
|
-
set form(
|
|
1105
|
-
|
|
1128
|
+
set form(r) {
|
|
1129
|
+
t.set(r);
|
|
1106
1130
|
},
|
|
1107
1131
|
formDefault: {},
|
|
1108
1132
|
formColumn: [],
|
|
1109
1133
|
formGrid: [],
|
|
1110
1134
|
formMaxSpan: 12,
|
|
1111
|
-
getDisabled: (
|
|
1112
|
-
const
|
|
1113
|
-
return
|
|
1135
|
+
getDisabled: (r, l = !1) => {
|
|
1136
|
+
const u = a();
|
|
1137
|
+
return o.option.table?.editMode && l ? r.disabled?.table === void 0 ? !1 : z.isFun(r.disabled?.table, u.update.form) : Qe(r, u.update.type, u.update.form);
|
|
1114
1138
|
},
|
|
1115
|
-
getBind: (
|
|
1116
|
-
const
|
|
1117
|
-
return
|
|
1139
|
+
getBind: (r) => {
|
|
1140
|
+
const l = a();
|
|
1141
|
+
return Xe(r, l.update.type);
|
|
1118
1142
|
},
|
|
1119
|
-
getOn: (
|
|
1120
|
-
const
|
|
1121
|
-
return
|
|
1143
|
+
getOn: (r, l) => {
|
|
1144
|
+
const u = a();
|
|
1145
|
+
return Ye(r, u.update.type, [l || u.update.form, r]);
|
|
1122
1146
|
},
|
|
1123
|
-
getOptions: (
|
|
1124
|
-
const
|
|
1147
|
+
getOptions: (r) => {
|
|
1148
|
+
const l = a();
|
|
1125
1149
|
try {
|
|
1126
|
-
const
|
|
1127
|
-
return
|
|
1128
|
-
options:
|
|
1150
|
+
const f = et(l.update.formGrid?.length ? l.update.formGrid : l.update.formColumn).find((d) => d.item.key === r)?.item;
|
|
1151
|
+
return f ? {
|
|
1152
|
+
options: f.options,
|
|
1129
1153
|
//@ts-ignore
|
|
1130
|
-
bind:
|
|
1154
|
+
bind: l.update.getBind(f)
|
|
1131
1155
|
} : { options: {}, bind: {} };
|
|
1132
1156
|
} catch {
|
|
1133
1157
|
return { options: {}, bind: {} };
|
|
@@ -1135,296 +1159,296 @@ const we = (e) => {
|
|
|
1135
1159
|
},
|
|
1136
1160
|
edit: {
|
|
1137
1161
|
data: {},
|
|
1138
|
-
getApiData: (
|
|
1139
|
-
const
|
|
1140
|
-
if (
|
|
1141
|
-
const
|
|
1142
|
-
[
|
|
1162
|
+
getApiData: (r) => {
|
|
1163
|
+
const l = a();
|
|
1164
|
+
if (o.option.form?.editAll) return r;
|
|
1165
|
+
const u = {
|
|
1166
|
+
[o.option.table?.rowKey]: l.update.edit.data[o.option.table?.rowKey]
|
|
1143
1167
|
};
|
|
1144
|
-
return Object.keys(
|
|
1145
|
-
|
|
1146
|
-
}),
|
|
1168
|
+
return Object.keys(l.update.edit.data).forEach((f) => {
|
|
1169
|
+
r[f] !== l.update.edit.data[f] && (u[f] = r[f]);
|
|
1170
|
+
}), u;
|
|
1147
1171
|
}
|
|
1148
1172
|
},
|
|
1149
1173
|
view: {},
|
|
1150
1174
|
openLoading: !1,
|
|
1151
|
-
open: async (
|
|
1152
|
-
const
|
|
1153
|
-
if (!(
|
|
1154
|
-
|
|
1175
|
+
open: async (r, l) => {
|
|
1176
|
+
const u = a();
|
|
1177
|
+
if (!(u.update.showContent || u.update.openLoading)) {
|
|
1178
|
+
z.loading(!0), u.update.openLoading = !0;
|
|
1155
1179
|
try {
|
|
1156
|
-
|
|
1157
|
-
const
|
|
1158
|
-
|
|
1159
|
-
const d =
|
|
1160
|
-
|
|
1161
|
-
} catch (
|
|
1162
|
-
console.error(
|
|
1180
|
+
u.update.type = r;
|
|
1181
|
+
const f = r === be.Add;
|
|
1182
|
+
u.update.edit.data = f ? void 0 : JSONUtil.cp(l), u.update.title = k.tCurd(f ? "add" : r === be.View ? "view" : "edit");
|
|
1183
|
+
const d = f ? ObjectUtil.deepMerge(JSONUtil.cp(u.update.formDefault), l ? JSONUtil.cp(l) : {}) : JSONUtil.cp(l);
|
|
1184
|
+
x.setValue(u.update.form, d, !0), await u.initApiData("update"), await o.option.form?.openBefore?.(u.update.form, u.update), (!o.option.table?.inlineEdit || f) && (u.update.show = !0, u.update.showContent = !0), o.option.form?.openAfter?.(u.update.form, u.update);
|
|
1185
|
+
} catch (f) {
|
|
1186
|
+
console.error(f);
|
|
1163
1187
|
} finally {
|
|
1164
|
-
|
|
1188
|
+
z.loading(!1), u.update.openLoading = !1;
|
|
1165
1189
|
}
|
|
1166
1190
|
}
|
|
1167
1191
|
},
|
|
1168
|
-
validate: async (
|
|
1169
|
-
const
|
|
1192
|
+
validate: async (r = !0) => {
|
|
1193
|
+
const l = a();
|
|
1170
1194
|
try {
|
|
1171
|
-
const
|
|
1195
|
+
const u = o.option.table?.editMode ? l.tableEditValidate.validate() : e(l);
|
|
1172
1196
|
return await Promise.all([
|
|
1173
|
-
|
|
1174
|
-
|
|
1197
|
+
u,
|
|
1198
|
+
l.formRef.validate()
|
|
1175
1199
|
]), !0;
|
|
1176
1200
|
} catch {
|
|
1177
|
-
return
|
|
1201
|
+
return r && z.fail(k.tCurd("checkFormData")), !1;
|
|
1178
1202
|
}
|
|
1179
1203
|
},
|
|
1180
1204
|
submit: async () => {
|
|
1181
|
-
const
|
|
1182
|
-
if (!await
|
|
1183
|
-
|
|
1184
|
-
const
|
|
1205
|
+
const r = a();
|
|
1206
|
+
if (!await r.update.validate() || r.update.loading) return;
|
|
1207
|
+
r.update.loading = !0;
|
|
1208
|
+
const u = r.update.type === be.Add ? o.option.api.create : o.option.api.update;
|
|
1185
1209
|
try {
|
|
1186
|
-
await
|
|
1210
|
+
await o.option.form?.submitBefore?.(r.update.form, r.update);
|
|
1187
1211
|
} catch {
|
|
1188
|
-
|
|
1212
|
+
r.update.loading = !1;
|
|
1189
1213
|
return;
|
|
1190
1214
|
}
|
|
1191
|
-
let
|
|
1192
|
-
delete
|
|
1193
|
-
const d = new Set(
|
|
1194
|
-
Object.keys(
|
|
1195
|
-
if (d.has(
|
|
1196
|
-
const
|
|
1197
|
-
isNaN(
|
|
1215
|
+
let f = ObjectUtil.deepMerge(r.update.form, {});
|
|
1216
|
+
delete f.children;
|
|
1217
|
+
const d = new Set(o.option.column.filter((b) => b.type === "datetime").map((b) => b.key));
|
|
1218
|
+
Object.keys(f).forEach((b) => {
|
|
1219
|
+
if (d.has(b) && f[b] != null) {
|
|
1220
|
+
const c = new Date(f[b]).getTime();
|
|
1221
|
+
isNaN(c) || (f[b] = c);
|
|
1198
1222
|
}
|
|
1199
1223
|
});
|
|
1200
1224
|
try {
|
|
1201
|
-
if (!
|
|
1202
|
-
await
|
|
1203
|
-
} catch (
|
|
1204
|
-
console.error(
|
|
1225
|
+
if (!u) return;
|
|
1226
|
+
await u({ ...f }), r.update.close(), await r.table.getList(), o.option.form?.submitAfter?.(f, r.update);
|
|
1227
|
+
} catch (b) {
|
|
1228
|
+
console.error(b);
|
|
1205
1229
|
} finally {
|
|
1206
|
-
|
|
1230
|
+
r.update.loading = !1;
|
|
1207
1231
|
}
|
|
1208
1232
|
},
|
|
1209
1233
|
close: () => {
|
|
1210
|
-
const
|
|
1211
|
-
|
|
1212
|
-
|
|
1234
|
+
const r = a();
|
|
1235
|
+
r.update.show = !1, r.update.edit.data = void 0, setTimeout(() => {
|
|
1236
|
+
r.update.showContent = !1, s.ruleFormRef.value?.resetFields?.(), t.clear();
|
|
1213
1237
|
}, 350);
|
|
1214
1238
|
}
|
|
1215
1239
|
}
|
|
1216
1240
|
};
|
|
1217
|
-
},
|
|
1218
|
-
|
|
1219
|
-
},
|
|
1220
|
-
const
|
|
1221
|
-
return
|
|
1222
|
-
},
|
|
1223
|
-
if (
|
|
1224
|
-
return
|
|
1225
|
-
const
|
|
1226
|
-
return
|
|
1227
|
-
},
|
|
1228
|
-
const
|
|
1229
|
-
return
|
|
1230
|
-
},
|
|
1231
|
-
const
|
|
1232
|
-
return Object.keys(
|
|
1233
|
-
const
|
|
1234
|
-
typeof
|
|
1235
|
-
return
|
|
1236
|
-
} : l
|
|
1237
|
-
}),
|
|
1238
|
-
},
|
|
1239
|
-
const
|
|
1240
|
-
if (!
|
|
1241
|
-
return
|
|
1242
|
-
const
|
|
1243
|
-
return
|
|
1244
|
-
},
|
|
1245
|
-
const
|
|
1246
|
-
const
|
|
1247
|
-
return
|
|
1241
|
+
}, W = 12, ke = (a, o) => {
|
|
1242
|
+
a.isForm = o, Array.isArray(a.children) && a.children.forEach((s) => ke(s, o));
|
|
1243
|
+
}, At = (a) => a.isForm === !1 ? !1 : typeof a.show?.form == "boolean" ? a.show.form : !0, qe = (a) => a > W ? Math.floor(a / 2) : a, Bt = (a, o, s) => (a.form = a.form || { span: o }, s === "column" ? a.form.span = a.form.span ?? 12 : a.form.span = a.form.span ?? o, a.form.span = qe(a.form.span), a.form.span), Je = (a) => {
|
|
1244
|
+
const o = a.form;
|
|
1245
|
+
return o?.row != null && o.row > 0 ? qe(o.row) : W;
|
|
1246
|
+
}, re = (a) => Math.floor((a.gridRow - 1) / W), Qe = (a, o, s) => {
|
|
1247
|
+
if (o === z.EDialog.View)
|
|
1248
|
+
return a.disabled?.view === void 0 ? !0 : z.isFun(a.disabled?.view, s);
|
|
1249
|
+
const t = a.disabled?.[o === z.EDialog.Add ? "create" : "update"];
|
|
1250
|
+
return z.isFun(t, s);
|
|
1251
|
+
}, Xe = (a, o) => {
|
|
1252
|
+
const s = le(a);
|
|
1253
|
+
return a.options?.[o === z.EDialog.Add ? "formAdd" : "formUpdate"]?.[s] || a.options?.[s] || {};
|
|
1254
|
+
}, Ye = (a, o, s = []) => {
|
|
1255
|
+
const t = le(a), e = a.options?.[o === z.EDialog.Add ? "formAdd" : "formUpdate"]?.[t]?.on || a.options?.[t]?.on || {}, r = {};
|
|
1256
|
+
return Object.keys(e).forEach((l) => {
|
|
1257
|
+
const u = e[l];
|
|
1258
|
+
typeof u == "function" ? r[l] = function(...f) {
|
|
1259
|
+
return u.apply(this, [...f, ...s]);
|
|
1260
|
+
} : r[l] = u;
|
|
1261
|
+
}), r;
|
|
1262
|
+
}, Ze = (a, o, s, t, n) => {
|
|
1263
|
+
const e = a, r = e.colSpan ?? a.span;
|
|
1264
|
+
if (!a.item.form?.spanCol)
|
|
1265
|
+
return r;
|
|
1266
|
+
const l = n?.maxSpan || 12, u = n?.defaultSpan || l / 2, f = e.gridBand, b = o.filter((c) => f != null ? c.gridBand === f && !z.isFun(c.item.show?.form, s, t) : c.gridRow === e.gridRow && !z.isFun(c.item.show?.form, s, t)).reduce((c, p) => c + (p.colSpan ?? p.span ?? u), 0);
|
|
1267
|
+
return r + b;
|
|
1268
|
+
}, Lt = (a, o) => {
|
|
1269
|
+
const s = (t, n) => {
|
|
1270
|
+
const e = t.gridRow, r = t.gridRow + t.rowSpan - 1, l = n.gridRow, u = n.gridRow + n.rowSpan - 1;
|
|
1271
|
+
return e <= u && l <= r;
|
|
1248
1272
|
};
|
|
1249
|
-
return
|
|
1250
|
-
...
|
|
1251
|
-
span:
|
|
1252
|
-
colSpan:
|
|
1273
|
+
return a.map((t) => a.filter((e) => s(t, e)).length !== 1 || t.colSpan >= o ? t : {
|
|
1274
|
+
...t,
|
|
1275
|
+
span: o,
|
|
1276
|
+
colSpan: o,
|
|
1253
1277
|
gridColumn: 1
|
|
1254
1278
|
});
|
|
1255
|
-
},
|
|
1256
|
-
const
|
|
1257
|
-
let
|
|
1258
|
-
const
|
|
1259
|
-
if (w +
|
|
1260
|
-
for (let
|
|
1261
|
-
for (let
|
|
1262
|
-
if (
|
|
1279
|
+
}, xe = (a, o, s = {}) => {
|
|
1280
|
+
const t = /* @__PURE__ */ new Set(), n = [];
|
|
1281
|
+
let e = 0, r = 0;
|
|
1282
|
+
const l = (p) => Math.floor(p / W) * W, u = (p, w) => `${p},${w}`, f = (p, w, F, B) => {
|
|
1283
|
+
if (w + F > o) return !1;
|
|
1284
|
+
for (let L = 0; L < B; L++)
|
|
1285
|
+
for (let j = 0; j < F; j++)
|
|
1286
|
+
if (t.has(u(p + L, w + j))) return !1;
|
|
1263
1287
|
return !0;
|
|
1264
|
-
}, d = (
|
|
1265
|
-
for (let
|
|
1266
|
-
for (let
|
|
1267
|
-
|
|
1268
|
-
},
|
|
1269
|
-
for (let
|
|
1270
|
-
const
|
|
1271
|
-
for (let _ =
|
|
1272
|
-
const
|
|
1273
|
-
for (let te =
|
|
1274
|
-
if (
|
|
1288
|
+
}, d = (p, w, F, B) => {
|
|
1289
|
+
for (let L = 0; L < B; L++)
|
|
1290
|
+
for (let j = 0; j < F; j++)
|
|
1291
|
+
t.add(u(p + L, w + j));
|
|
1292
|
+
}, b = (p, w, F, B) => {
|
|
1293
|
+
for (let j = l(p); j < 500 * W; j += W) {
|
|
1294
|
+
const Ve = j + W, Se = j === l(p) ? Math.max(j, p) : j;
|
|
1295
|
+
for (let _ = Se; _ < Ve; _++) {
|
|
1296
|
+
const Ee = _ === p ? w : 0;
|
|
1297
|
+
for (let te = Ee; te <= o - F; te++)
|
|
1298
|
+
if (f(_, te, F, B)) return { tr: _, tc: te };
|
|
1275
1299
|
}
|
|
1276
1300
|
}
|
|
1277
|
-
return { tr:
|
|
1278
|
-
},
|
|
1279
|
-
const
|
|
1280
|
-
if (
|
|
1281
|
-
|
|
1301
|
+
return { tr: p, tc: w };
|
|
1302
|
+
}, c = (p, w, F, B) => {
|
|
1303
|
+
const L = l(p);
|
|
1304
|
+
if (B < W && p + B < L + W) {
|
|
1305
|
+
e = p + B, r = w;
|
|
1282
1306
|
return;
|
|
1283
1307
|
}
|
|
1284
|
-
const
|
|
1285
|
-
if (
|
|
1286
|
-
|
|
1308
|
+
const j = w + F;
|
|
1309
|
+
if (j < o) {
|
|
1310
|
+
r = j, e = L;
|
|
1287
1311
|
return;
|
|
1288
1312
|
}
|
|
1289
|
-
|
|
1313
|
+
r = 0, e = L + W;
|
|
1290
1314
|
};
|
|
1291
|
-
return
|
|
1292
|
-
const w =
|
|
1293
|
-
|
|
1294
|
-
let { tr:
|
|
1295
|
-
|
|
1296
|
-
const
|
|
1297
|
-
|
|
1298
|
-
...
|
|
1315
|
+
return a.forEach((p) => {
|
|
1316
|
+
const w = p.colSpan ?? (p.span === 0 ? o : p.span), F = p.rowSpan ?? Je(p.item);
|
|
1317
|
+
p.item.form?.rowBreak && n.length && (r = 0, e = l(e) + W);
|
|
1318
|
+
let { tr: B, tc: L } = f(e, r, w, F) ? { tr: e, tc: r } : b(e, r, w, F);
|
|
1319
|
+
f(B, L, w, F) || ({ tr: B, tc: L } = b(0, 0, w, F)), d(B, L, w, F);
|
|
1320
|
+
const j = B + 1;
|
|
1321
|
+
n.push({
|
|
1322
|
+
...p,
|
|
1299
1323
|
span: w,
|
|
1300
1324
|
colSpan: w,
|
|
1301
|
-
rowSpan:
|
|
1302
|
-
gridRow:
|
|
1303
|
-
gridColumn:
|
|
1304
|
-
gridBand:
|
|
1305
|
-
}),
|
|
1306
|
-
}),
|
|
1307
|
-
},
|
|
1308
|
-
const
|
|
1309
|
-
|
|
1310
|
-
const
|
|
1311
|
-
|
|
1325
|
+
rowSpan: F,
|
|
1326
|
+
gridRow: j,
|
|
1327
|
+
gridColumn: L + 1,
|
|
1328
|
+
gridBand: re({ gridRow: j })
|
|
1329
|
+
}), c(B, L, w, F);
|
|
1330
|
+
}), s.fillSingleRows ? Lt(n, o) : n;
|
|
1331
|
+
}, De = (a, o, s, t = W) => {
|
|
1332
|
+
const n = a.filter((l) => z.isFun(l.item.show?.form, o, s)), e = /* @__PURE__ */ new Map();
|
|
1333
|
+
a.forEach((l) => {
|
|
1334
|
+
const f = `${l.gridBand ?? re(l)}:${l.gridColumn}:${l.colSpan}`;
|
|
1335
|
+
e.has(f) || e.set(f, []), e.get(f).push(l);
|
|
1312
1336
|
});
|
|
1313
|
-
const
|
|
1314
|
-
return
|
|
1315
|
-
const
|
|
1316
|
-
if (!(
|
|
1317
|
-
const d =
|
|
1337
|
+
const r = /* @__PURE__ */ new Map();
|
|
1338
|
+
return e.forEach((l) => {
|
|
1339
|
+
const u = l.reduce((c, p) => c + p.rowSpan, 0);
|
|
1340
|
+
if (!(l.length > 1 && u === W && l.every((c) => c.rowSpan < W))) return;
|
|
1341
|
+
const d = l.filter((c) => z.isFun(c.item.show?.form, o, s));
|
|
1318
1342
|
if (d.length !== 1) return;
|
|
1319
|
-
const
|
|
1320
|
-
|
|
1321
|
-
...
|
|
1322
|
-
rowSpan:
|
|
1343
|
+
const b = d[0];
|
|
1344
|
+
r.set(b.item.key, {
|
|
1345
|
+
...b,
|
|
1346
|
+
rowSpan: W
|
|
1323
1347
|
});
|
|
1324
|
-
}),
|
|
1348
|
+
}), xe(n.map((l) => r.get(l.item.key) || l), t, {
|
|
1325
1349
|
fillSingleRows: !0
|
|
1326
1350
|
});
|
|
1327
|
-
},
|
|
1328
|
-
const
|
|
1329
|
-
return
|
|
1330
|
-
const
|
|
1331
|
-
|
|
1332
|
-
}), Array.from(
|
|
1333
|
-
},
|
|
1334
|
-
if (!
|
|
1335
|
-
const
|
|
1336
|
-
return { item:
|
|
1337
|
-
},
|
|
1338
|
-
const
|
|
1339
|
-
if (
|
|
1340
|
-
|
|
1351
|
+
}, _e = (a) => {
|
|
1352
|
+
const o = /* @__PURE__ */ new Map();
|
|
1353
|
+
return a.forEach((s) => {
|
|
1354
|
+
const t = s.gridBand ?? re(s);
|
|
1355
|
+
o.has(t) || o.set(t, []), o.get(t).push(s);
|
|
1356
|
+
}), Array.from(o.keys()).sort((s, t) => s - t).map((s) => o.get(s));
|
|
1357
|
+
}, et = (a) => a?.length ? Array.isArray(a[0]) ? a.flat() : a : [], Tt = (a, o) => {
|
|
1358
|
+
if (!At(a) || !a.key) return null;
|
|
1359
|
+
const s = o.defaultSpan ?? (o.maxSpan || 12) / 2, t = Bt(a, s, o.layout);
|
|
1360
|
+
return { item: a, span: t };
|
|
1361
|
+
}, jt = (a, o = {}) => {
|
|
1362
|
+
const s = [], t = (n) => {
|
|
1363
|
+
if (n.children?.length) {
|
|
1364
|
+
n.children.forEach((r) => t(r));
|
|
1341
1365
|
return;
|
|
1342
1366
|
}
|
|
1343
|
-
const
|
|
1344
|
-
|
|
1367
|
+
const e = Tt(n, o);
|
|
1368
|
+
e && s.push(e);
|
|
1345
1369
|
};
|
|
1346
|
-
return
|
|
1347
|
-
},
|
|
1348
|
-
const
|
|
1349
|
-
if (
|
|
1350
|
-
const
|
|
1351
|
-
let
|
|
1352
|
-
return
|
|
1353
|
-
const d =
|
|
1354
|
-
|
|
1355
|
-
...
|
|
1356
|
-
span:
|
|
1357
|
-
colSpan:
|
|
1370
|
+
return a.forEach((n) => t(n)), s;
|
|
1371
|
+
}, tt = (a, o = {}) => {
|
|
1372
|
+
const s = o.maxSpan ?? 12, t = o.defaultSpan ?? s / 2, n = o.layout ?? "row", r = jt(a, { maxSpan: s, defaultSpan: t, layout: n });
|
|
1373
|
+
if (n === "column") {
|
|
1374
|
+
const l = [];
|
|
1375
|
+
let u = 1;
|
|
1376
|
+
return r.forEach((f) => {
|
|
1377
|
+
const d = Je(f.item), b = s;
|
|
1378
|
+
l.push({
|
|
1379
|
+
...f,
|
|
1380
|
+
span: b,
|
|
1381
|
+
colSpan: b,
|
|
1358
1382
|
rowSpan: d,
|
|
1359
|
-
gridRow:
|
|
1383
|
+
gridRow: u,
|
|
1360
1384
|
gridColumn: 1,
|
|
1361
|
-
gridBand:
|
|
1362
|
-
}),
|
|
1363
|
-
}), { cells:
|
|
1385
|
+
gridBand: re({ gridRow: u })
|
|
1386
|
+
}), u += d;
|
|
1387
|
+
}), { cells: l, maxSpan: s };
|
|
1364
1388
|
}
|
|
1365
|
-
return { cells:
|
|
1366
|
-
},
|
|
1367
|
-
if (!
|
|
1368
|
-
const
|
|
1389
|
+
return { cells: xe(r, s), maxSpan: s };
|
|
1390
|
+
}, Pt = (a) => a.map((o) => o.item?.show?.form), Kt = (a, o, s) => {
|
|
1391
|
+
if (!a.rules) return;
|
|
1392
|
+
const t = {
|
|
1369
1393
|
required: !0,
|
|
1370
|
-
message:
|
|
1394
|
+
message: o(a),
|
|
1371
1395
|
trigger: "blur"
|
|
1372
|
-
},
|
|
1373
|
-
(
|
|
1374
|
-
const
|
|
1375
|
-
return
|
|
1376
|
-
},
|
|
1377
|
-
const
|
|
1378
|
-
if (
|
|
1379
|
-
const
|
|
1380
|
-
return
|
|
1396
|
+
}, n = le(a), e = a.options?.datetime?.type, r = n === "datetime" && typeof e == "string" && e.includes("range"), l = n === "select" && !!a.options?.select?.multiple;
|
|
1397
|
+
(r || n === "checkbox" || l) && (t.type = "array", t.min = r ? 2 : 1);
|
|
1398
|
+
const u = typeof a.rules == "boolean" ? [t] : a.rules;
|
|
1399
|
+
return s ? u.map((f) => s(f)) : u;
|
|
1400
|
+
}, Le = (a) => typeof a == "function" ? a() : a, ot = (a) => (o, s) => Kt(o, a, (t) => {
|
|
1401
|
+
const n = (e, r) => {
|
|
1402
|
+
if (r && Object.prototype.hasOwnProperty.call(r, o.key) && r[o.key] !== void 0) return r[o.key];
|
|
1403
|
+
const l = Le(s);
|
|
1404
|
+
return l && Object.prototype.hasOwnProperty.call(l, o.key) ? l[o.key] : e;
|
|
1381
1405
|
};
|
|
1382
|
-
if (
|
|
1383
|
-
const
|
|
1406
|
+
if (t.validator) {
|
|
1407
|
+
const e = t.validator;
|
|
1384
1408
|
return {
|
|
1385
|
-
...
|
|
1386
|
-
validator: (
|
|
1387
|
-
const d =
|
|
1388
|
-
return
|
|
1409
|
+
...t,
|
|
1410
|
+
validator: (r, l, u, f) => {
|
|
1411
|
+
const d = Le(s);
|
|
1412
|
+
return e(r, n(l, f), u, d || f);
|
|
1389
1413
|
}
|
|
1390
1414
|
};
|
|
1391
1415
|
}
|
|
1392
|
-
return
|
|
1393
|
-
}),
|
|
1394
|
-
const
|
|
1395
|
-
input:
|
|
1396
|
-
select:
|
|
1397
|
-
},
|
|
1398
|
-
return (
|
|
1399
|
-
},
|
|
1400
|
-
const
|
|
1401
|
-
|
|
1402
|
-
const { cells:
|
|
1403
|
-
maxSpan:
|
|
1404
|
-
defaultSpan:
|
|
1405
|
-
layout:
|
|
1416
|
+
return t;
|
|
1417
|
+
}), at = (a, o) => {
|
|
1418
|
+
const s = {
|
|
1419
|
+
input: k.tCurd("placeholderInput"),
|
|
1420
|
+
select: k.tCurd("placeholderSelect")
|
|
1421
|
+
}, t = (s[le(a) || "input"] || s.input) + a.label;
|
|
1422
|
+
return (o || q.error.callback)?.(a.key, a) || t;
|
|
1423
|
+
}, nt = (a) => ot((o) => at(o, a?.error)), Ht = (a, o, s) => {
|
|
1424
|
+
const t = {}, n = {}, e = o?.maxSpan || 12, r = o?.defaultSpan || e / 2, l = nt(o);
|
|
1425
|
+
a.forEach((d) => ke(d, !0)), Re(a, t, n, (d) => l(d, s));
|
|
1426
|
+
const { cells: u, maxSpan: f } = tt(a, {
|
|
1427
|
+
maxSpan: e,
|
|
1428
|
+
defaultSpan: r,
|
|
1429
|
+
layout: o?.layout
|
|
1406
1430
|
});
|
|
1407
1431
|
return {
|
|
1408
|
-
formDefault:
|
|
1409
|
-
rules:
|
|
1410
|
-
formGrid:
|
|
1411
|
-
formMaxSpan:
|
|
1412
|
-
formColumn:
|
|
1432
|
+
formDefault: t,
|
|
1433
|
+
rules: n,
|
|
1434
|
+
formGrid: u,
|
|
1435
|
+
formMaxSpan: f,
|
|
1436
|
+
formColumn: _e(u)
|
|
1413
1437
|
};
|
|
1414
|
-
},
|
|
1415
|
-
const
|
|
1416
|
-
if (
|
|
1417
|
-
|
|
1438
|
+
}, Re = (a, o, s, t) => {
|
|
1439
|
+
const n = (e) => {
|
|
1440
|
+
if (e.children?.length) {
|
|
1441
|
+
e.children.forEach((r) => n(r));
|
|
1418
1442
|
return;
|
|
1419
1443
|
}
|
|
1420
|
-
if (
|
|
1421
|
-
|
|
1422
|
-
const
|
|
1423
|
-
|
|
1444
|
+
if (e.key) {
|
|
1445
|
+
o[e.key] = e.value;
|
|
1446
|
+
const r = t(e);
|
|
1447
|
+
r && (s[e.key] = r);
|
|
1424
1448
|
}
|
|
1425
1449
|
};
|
|
1426
|
-
|
|
1427
|
-
},
|
|
1450
|
+
a.forEach(n);
|
|
1451
|
+
}, Nt = { class: "curd-form-cell-inner" }, lt = /* @__PURE__ */ Q({
|
|
1428
1452
|
__name: "layout",
|
|
1429
1453
|
props: {
|
|
1430
1454
|
formGrid: {},
|
|
@@ -1438,78 +1462,78 @@ const we = (e) => {
|
|
|
1438
1462
|
getOn: { type: Function },
|
|
1439
1463
|
getDisabled: { type: Function }
|
|
1440
1464
|
},
|
|
1441
|
-
setup(
|
|
1442
|
-
const
|
|
1443
|
-
const
|
|
1465
|
+
setup(a) {
|
|
1466
|
+
const o = z.isFun, s = a, t = ae(() => De(s.formGrid, s.form, s.type, s.maxSpan)), n = ae(() => {
|
|
1467
|
+
const c = Array.from(
|
|
1444
1468
|
new Set(
|
|
1445
|
-
|
|
1469
|
+
t.value.map((p) => p.gridBand ?? re(p))
|
|
1446
1470
|
)
|
|
1447
|
-
).sort((
|
|
1448
|
-
return new Map(
|
|
1449
|
-
}),
|
|
1450
|
-
gridTemplateColumns: `repeat(${
|
|
1451
|
-
})),
|
|
1452
|
-
let
|
|
1453
|
-
return
|
|
1454
|
-
const w =
|
|
1455
|
-
w >
|
|
1456
|
-
}),
|
|
1457
|
-
}),
|
|
1458
|
-
const
|
|
1459
|
-
return
|
|
1460
|
-
}, d = (
|
|
1461
|
-
maxSpan:
|
|
1462
|
-
defaultSpan:
|
|
1463
|
-
}),
|
|
1464
|
-
const
|
|
1471
|
+
).sort((p, w) => p - w);
|
|
1472
|
+
return new Map(c.map((p, w) => [p, w]));
|
|
1473
|
+
}), e = ae(() => ({
|
|
1474
|
+
gridTemplateColumns: `repeat(${s.maxSpan}, minmax(0, 1fr))`
|
|
1475
|
+
})), r = ae(() => {
|
|
1476
|
+
let c = 0;
|
|
1477
|
+
return t.value.forEach((p) => {
|
|
1478
|
+
const w = p.gridRow + p.rowSpan - 1;
|
|
1479
|
+
w > c && (c = w);
|
|
1480
|
+
}), c;
|
|
1481
|
+
}), l = (c) => c.gridRow + c.rowSpan - 1 >= r.value, u = (c) => c.rowSpan >= W, f = (c) => {
|
|
1482
|
+
const p = c.gridBand ?? re(c);
|
|
1483
|
+
return n.value.get(p) ?? p;
|
|
1484
|
+
}, d = (c) => Ze(c, t.value, s.form, s.type, {
|
|
1485
|
+
maxSpan: s.maxSpan,
|
|
1486
|
+
defaultSpan: s.formOption?.defaultSpan
|
|
1487
|
+
}), b = (c) => {
|
|
1488
|
+
const p = d(c) || c.colSpan;
|
|
1465
1489
|
return {
|
|
1466
|
-
gridRow: `${
|
|
1467
|
-
gridColumn: `${
|
|
1490
|
+
gridRow: `${c.gridRow} / span ${c.rowSpan}`,
|
|
1491
|
+
gridColumn: `${c.gridColumn} / span ${p}`
|
|
1468
1492
|
};
|
|
1469
1493
|
};
|
|
1470
|
-
return (
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
class: J(["curd-form-grid", { stripe:
|
|
1474
|
-
style:
|
|
1494
|
+
return (c, p) => i(o)(i(Pt)(c.formGrid), c.form, c.type) ? (m(), C(A, { key: 0 }, [
|
|
1495
|
+
E(c.$slots, "form-start", { row: c.form }),
|
|
1496
|
+
D("div", {
|
|
1497
|
+
class: J(["curd-form-grid", { stripe: c.stripe !== !1 }]),
|
|
1498
|
+
style: ye(e.value)
|
|
1475
1499
|
}, [
|
|
1476
|
-
(
|
|
1500
|
+
(m(!0), C(A, null, G(t.value, (w) => (m(), C("div", {
|
|
1477
1501
|
key: w.item.key,
|
|
1478
1502
|
class: J(["curd-form-grid-cell", [
|
|
1479
|
-
|
|
1503
|
+
c.stripe !== !1 && f(w) % 2 === 0 ? "stripe-band-odd" : "",
|
|
1480
1504
|
w.gridColumn > 1 ? "has-col-border" : "",
|
|
1481
|
-
|
|
1482
|
-
|
|
1505
|
+
c.stripe !== !1 && l(w) ? "is-last-row" : "",
|
|
1506
|
+
u(w) ? "is-row-span" : "",
|
|
1483
1507
|
`form-item-col-${w.item.key}`
|
|
1484
1508
|
]]),
|
|
1485
|
-
style:
|
|
1509
|
+
style: ye(b(w))
|
|
1486
1510
|
}, [
|
|
1487
|
-
|
|
1488
|
-
|
|
1511
|
+
D("div", Nt, [
|
|
1512
|
+
i(o)(w.item.show?.form, c.form, c.type) ? (m(), y(Ft, {
|
|
1489
1513
|
key: 0,
|
|
1490
|
-
class: J({ "is-row-span-field":
|
|
1514
|
+
class: J({ "is-row-span-field": u(w) }),
|
|
1491
1515
|
item: w.item,
|
|
1492
|
-
form:
|
|
1493
|
-
type:
|
|
1494
|
-
"label-width":
|
|
1495
|
-
"get-bind":
|
|
1496
|
-
"get-on":
|
|
1497
|
-
"get-disabled":
|
|
1498
|
-
},
|
|
1499
|
-
|
|
1500
|
-
name:
|
|
1501
|
-
fn:
|
|
1502
|
-
|
|
1516
|
+
form: c.form,
|
|
1517
|
+
type: c.type,
|
|
1518
|
+
"label-width": c.labelWidth,
|
|
1519
|
+
"get-bind": c.getBind,
|
|
1520
|
+
"get-on": c.getOn,
|
|
1521
|
+
"get-disabled": c.getDisabled
|
|
1522
|
+
}, Z({ _: 2 }, [
|
|
1523
|
+
G(c.$slots, (F, B) => ({
|
|
1524
|
+
name: B,
|
|
1525
|
+
fn: h((L) => [
|
|
1526
|
+
E(c.$slots, B, S({ ref_for: !0 }, L || {}))
|
|
1503
1527
|
])
|
|
1504
1528
|
}))
|
|
1505
1529
|
]), 1032, ["class", "item", "form", "type", "label-width", "get-bind", "get-on", "get-disabled"])) : V("", !0)
|
|
1506
1530
|
])
|
|
1507
1531
|
], 6))), 128))
|
|
1508
1532
|
], 6),
|
|
1509
|
-
|
|
1533
|
+
E(c.$slots, "form-end", { row: c.form })
|
|
1510
1534
|
], 64)) : V("", !0);
|
|
1511
1535
|
}
|
|
1512
|
-
}),
|
|
1536
|
+
}), It = /* @__PURE__ */ Q({
|
|
1513
1537
|
__name: "column",
|
|
1514
1538
|
props: {
|
|
1515
1539
|
option: {
|
|
@@ -1525,79 +1549,79 @@ const we = (e) => {
|
|
|
1525
1549
|
default: void 0
|
|
1526
1550
|
}
|
|
1527
1551
|
},
|
|
1528
|
-
setup(
|
|
1529
|
-
const
|
|
1530
|
-
let
|
|
1531
|
-
const
|
|
1532
|
-
|
|
1533
|
-
|
|
1552
|
+
setup(a, { expose: o }) {
|
|
1553
|
+
const s = z.EDialog, t = Y(), n = a;
|
|
1554
|
+
let e = we(n.form);
|
|
1555
|
+
const r = Fe.getConf("curdConf"), l = "formRef-" + StrUtil.getId();
|
|
1556
|
+
Ie(() => {
|
|
1557
|
+
r?.formRef?.remove(l);
|
|
1534
1558
|
});
|
|
1535
|
-
const
|
|
1559
|
+
const u = ie({
|
|
1536
1560
|
rules: {},
|
|
1537
1561
|
show: !0,
|
|
1538
1562
|
formDefault: {},
|
|
1539
|
-
type:
|
|
1563
|
+
type: n.type || r?.update?.type || s.Add,
|
|
1540
1564
|
formColumn: [],
|
|
1541
1565
|
formGrid: [],
|
|
1542
1566
|
formMaxSpan: 12,
|
|
1543
1567
|
get form() {
|
|
1544
|
-
return
|
|
1568
|
+
return e.get();
|
|
1545
1569
|
},
|
|
1546
|
-
set form(
|
|
1547
|
-
|
|
1570
|
+
set form(f) {
|
|
1571
|
+
e.set(f);
|
|
1548
1572
|
},
|
|
1549
|
-
getDisabled: (
|
|
1550
|
-
getBind: (
|
|
1551
|
-
getOn: (
|
|
1573
|
+
getDisabled: (f) => Qe(f, u.type, u.form),
|
|
1574
|
+
getBind: (f) => Xe(f, u.type),
|
|
1575
|
+
getOn: (f) => Ye(f, u.type, [u.form, f]),
|
|
1552
1576
|
initColumnForm: () => {
|
|
1553
|
-
const
|
|
1554
|
-
|
|
1577
|
+
const f = e, d = Ht(n.option.column, n.option.form, () => f.get());
|
|
1578
|
+
u.formDefault = d.formDefault, u.rules = d.rules, u.formGrid = d.formGrid, u.formMaxSpan = d.formMaxSpan, u.formColumn = d.formColumn, u.type === s.Add ? f.isExternal() ? f.merge(JSONUtil.cp(u.formDefault)) : f.set(JSONUtil.cp(u.formDefault)) : !f.isExternal() && n.form && f.set(JSONUtil.cp(n.form));
|
|
1555
1579
|
}
|
|
1556
1580
|
});
|
|
1557
|
-
return
|
|
1558
|
-
validate: async (
|
|
1559
|
-
const d =
|
|
1581
|
+
return r?.formRef?.set(l, {
|
|
1582
|
+
validate: async (f) => {
|
|
1583
|
+
const d = t.value;
|
|
1560
1584
|
if (!d)
|
|
1561
|
-
return
|
|
1562
|
-
await
|
|
1563
|
-
const
|
|
1564
|
-
if (
|
|
1565
|
-
return
|
|
1566
|
-
const
|
|
1567
|
-
w || me(
|
|
1585
|
+
return f?.(!0), !0;
|
|
1586
|
+
await Ce();
|
|
1587
|
+
const b = De(u.formGrid || [], u.form, u.type, u.formMaxSpan).map((w) => w.item.key).filter(Boolean), c = Object.keys(u.rules || {}).filter((w) => !b.includes(w));
|
|
1588
|
+
if (c.length && d.clearValidate(c), !b.length)
|
|
1589
|
+
return f?.(!0), !0;
|
|
1590
|
+
const p = await d.validateField(b, async (w, F) => {
|
|
1591
|
+
w || me(ve(F));
|
|
1568
1592
|
});
|
|
1569
|
-
if (
|
|
1593
|
+
if (f?.(!!p), !p) throw !1;
|
|
1570
1594
|
return !0;
|
|
1571
1595
|
}
|
|
1572
|
-
}),
|
|
1573
|
-
() =>
|
|
1574
|
-
(
|
|
1575
|
-
|
|
1596
|
+
}), n.option.form?.initStart?.(u), u.initColumnForm(), n.option.form?.initEnd?.(u), Ne(
|
|
1597
|
+
() => n.form,
|
|
1598
|
+
(f) => {
|
|
1599
|
+
e = we(f), u.initColumnForm();
|
|
1576
1600
|
}
|
|
1577
|
-
),
|
|
1601
|
+
), o({ ref: t, conf: u }), (f, d) => (m(), y(i(oe), {
|
|
1578
1602
|
ref_key: "ruleFormRef",
|
|
1579
|
-
ref:
|
|
1580
|
-
model:
|
|
1581
|
-
rules:
|
|
1603
|
+
ref: t,
|
|
1604
|
+
model: u.form,
|
|
1605
|
+
rules: u.rules
|
|
1582
1606
|
}, {
|
|
1583
|
-
default:
|
|
1584
|
-
|
|
1607
|
+
default: h(() => [
|
|
1608
|
+
u.show ? (m(), y(lt, {
|
|
1585
1609
|
key: 0,
|
|
1586
|
-
"form-grid":
|
|
1587
|
-
"max-span":
|
|
1588
|
-
form:
|
|
1589
|
-
type:
|
|
1590
|
-
stripe:
|
|
1591
|
-
"label-width":
|
|
1592
|
-
"form-option":
|
|
1593
|
-
"get-bind":
|
|
1594
|
-
"get-on":
|
|
1595
|
-
"get-disabled":
|
|
1596
|
-
},
|
|
1597
|
-
|
|
1598
|
-
name:
|
|
1599
|
-
fn:
|
|
1600
|
-
|
|
1610
|
+
"form-grid": u.formGrid,
|
|
1611
|
+
"max-span": u.formMaxSpan,
|
|
1612
|
+
form: u.form,
|
|
1613
|
+
type: u.type,
|
|
1614
|
+
stripe: a.option.form?.stripe,
|
|
1615
|
+
"label-width": a.option.form?.labelWidth || "100px",
|
|
1616
|
+
"form-option": a.option.form,
|
|
1617
|
+
"get-bind": u.getBind,
|
|
1618
|
+
"get-on": u.getOn,
|
|
1619
|
+
"get-disabled": u.getDisabled
|
|
1620
|
+
}, Z({ _: 2 }, [
|
|
1621
|
+
G(f.$slots, (b, c) => ({
|
|
1622
|
+
name: c,
|
|
1623
|
+
fn: h((p) => [
|
|
1624
|
+
E(f.$slots, c, Oe(Me(p || {})))
|
|
1601
1625
|
])
|
|
1602
1626
|
}))
|
|
1603
1627
|
]), 1032, ["form-grid", "max-span", "form", "type", "stripe", "label-width", "form-option", "get-bind", "get-on", "get-disabled"])) : V("", !0)
|
|
@@ -1605,35 +1629,35 @@ const we = (e) => {
|
|
|
1605
1629
|
_: 3
|
|
1606
1630
|
}, 8, ["model", "rules"]));
|
|
1607
1631
|
}
|
|
1608
|
-
}),
|
|
1609
|
-
const
|
|
1610
|
-
return
|
|
1611
|
-
let
|
|
1612
|
-
const
|
|
1613
|
-
|
|
1632
|
+
}), Gt = (a) => a?.value || a, Wt = (a) => {
|
|
1633
|
+
const o = Gt(a);
|
|
1634
|
+
return o?.validate ? new Promise((s, t) => {
|
|
1635
|
+
let n = !1;
|
|
1636
|
+
const e = (r, l) => {
|
|
1637
|
+
n || (n = !0, r === !1 ? (me(ve(l)), t(!1)) : s(!0));
|
|
1614
1638
|
};
|
|
1615
1639
|
try {
|
|
1616
|
-
const
|
|
1617
|
-
|
|
1618
|
-
me(
|
|
1619
|
-
}) : (
|
|
1620
|
-
} catch (
|
|
1621
|
-
|
|
1640
|
+
const r = o.validate(e);
|
|
1641
|
+
r && typeof r.then == "function" ? r.then((l) => e(l)).catch((l) => {
|
|
1642
|
+
me(ve(l?.fields || l)), t(l);
|
|
1643
|
+
}) : (r !== void 0 || o.validate.length === 0) && e(r);
|
|
1644
|
+
} catch (r) {
|
|
1645
|
+
t(r);
|
|
1622
1646
|
}
|
|
1623
1647
|
}) : Promise.resolve(!0);
|
|
1624
|
-
},
|
|
1625
|
-
const
|
|
1648
|
+
}, qt = () => {
|
|
1649
|
+
const a = ie({
|
|
1626
1650
|
formRef: {
|
|
1627
1651
|
map: {},
|
|
1628
|
-
set(
|
|
1629
|
-
|
|
1652
|
+
set(o, s) {
|
|
1653
|
+
a.formRef.map[o] = s;
|
|
1630
1654
|
},
|
|
1631
|
-
remove(
|
|
1632
|
-
delete
|
|
1655
|
+
remove(o) {
|
|
1656
|
+
delete a.formRef.map[o];
|
|
1633
1657
|
},
|
|
1634
1658
|
validate() {
|
|
1635
|
-
const
|
|
1636
|
-
return Promise.all(
|
|
1659
|
+
const o = Object.keys(a.formRef.map).map((s) => a.formRef.map[s]);
|
|
1660
|
+
return Promise.all(o.map((s) => Wt(s))).then(() => !0);
|
|
1637
1661
|
}
|
|
1638
1662
|
},
|
|
1639
1663
|
/**
|
|
@@ -1652,330 +1676,472 @@ const we = (e) => {
|
|
|
1652
1676
|
* } }, 'formRef-1')
|
|
1653
1677
|
* @returns
|
|
1654
1678
|
*/
|
|
1655
|
-
regFormRef(
|
|
1656
|
-
|
|
1657
|
-
validate: async (
|
|
1679
|
+
regFormRef(o, s, t) {
|
|
1680
|
+
o ? t ? a.formRef.set(s, {
|
|
1681
|
+
validate: async (n) => {
|
|
1658
1682
|
try {
|
|
1659
|
-
|
|
1683
|
+
n(await t());
|
|
1660
1684
|
} catch {
|
|
1661
|
-
|
|
1685
|
+
n(!1);
|
|
1662
1686
|
}
|
|
1663
1687
|
}
|
|
1664
|
-
}) :
|
|
1688
|
+
}) : a.formRef.set(s, o) : a.formRef.remove(s);
|
|
1665
1689
|
}
|
|
1666
1690
|
});
|
|
1667
|
-
return
|
|
1668
|
-
},
|
|
1669
|
-
const
|
|
1691
|
+
return a;
|
|
1692
|
+
}, Jt = (a, o) => {
|
|
1693
|
+
const s = we(() => o.searchForm);
|
|
1670
1694
|
return {
|
|
1671
1695
|
search: {
|
|
1672
1696
|
column: {
|
|
1673
1697
|
list: []
|
|
1674
1698
|
},
|
|
1675
1699
|
get form() {
|
|
1676
|
-
return
|
|
1700
|
+
return s.get();
|
|
1677
1701
|
},
|
|
1678
|
-
set form(
|
|
1679
|
-
|
|
1702
|
+
set form(t) {
|
|
1703
|
+
s.set(t);
|
|
1680
1704
|
},
|
|
1681
1705
|
formDefault: {},
|
|
1682
|
-
getPlaceholder: (
|
|
1706
|
+
getPlaceholder: (t, n = k.tCurd("placeholderInput")) => t.text?.search?.placeholder === void 0 ? `${n}${t.label}` : t.text?.search?.placeholder,
|
|
1683
1707
|
getFormData: () => {
|
|
1684
|
-
const
|
|
1685
|
-
let
|
|
1686
|
-
|
|
1687
|
-
(typeof
|
|
1708
|
+
const t = a();
|
|
1709
|
+
let n = {};
|
|
1710
|
+
o.option.column.forEach((r) => {
|
|
1711
|
+
(typeof r.show?.search == "function" ? r.show?.search(t.search.form) : r.show?.search) && (n[r.key] = t.search.form[r.key]);
|
|
1688
1712
|
});
|
|
1689
|
-
const
|
|
1690
|
-
return
|
|
1713
|
+
const e = o.option.search?.before?.(n);
|
|
1714
|
+
return e && (n = e), n;
|
|
1691
1715
|
},
|
|
1692
1716
|
reset: () => {
|
|
1693
|
-
const
|
|
1694
|
-
Object.keys(
|
|
1695
|
-
|
|
1717
|
+
const t = a(), n = t.search.formDefault;
|
|
1718
|
+
Object.keys(n).forEach((r) => {
|
|
1719
|
+
o.option.search?.resetMode === "none" ? n[r] = void 0 : n[r] = t.search.formDefault[r];
|
|
1696
1720
|
});
|
|
1697
|
-
const
|
|
1698
|
-
|
|
1721
|
+
const e = ObjectUtil.deepMerge(n, {});
|
|
1722
|
+
x.setValue(t.search.form, e, !0), t.page.num = 1, o.option.init !== !1 && t.table.getList();
|
|
1699
1723
|
},
|
|
1700
1724
|
submit: () => {
|
|
1701
|
-
const
|
|
1702
|
-
|
|
1725
|
+
const t = a();
|
|
1726
|
+
t.page.num = 1, t.table.getList();
|
|
1703
1727
|
}
|
|
1704
1728
|
}
|
|
1705
1729
|
};
|
|
1706
|
-
},
|
|
1730
|
+
}, Qt = (a, o) => ({
|
|
1707
1731
|
page: {
|
|
1708
1732
|
num: 1,
|
|
1709
1733
|
total: 0,
|
|
1710
|
-
layout:
|
|
1711
|
-
showTools:
|
|
1712
|
-
size:
|
|
1713
|
-
sizeList:
|
|
1714
|
-
pagerCount:
|
|
1715
|
-
getQuery: (
|
|
1716
|
-
const
|
|
1734
|
+
layout: o.option.page?.layout || T.config.pagination.layout,
|
|
1735
|
+
showTools: o.option.page?.showTools || T.config.pagination.showTools,
|
|
1736
|
+
size: o.option.page?.size || T.config.pagination.size,
|
|
1737
|
+
sizeList: o.option.page?.sizeList || T.config.pagination.pageSizes,
|
|
1738
|
+
pagerCount: o.option.page?.pagerCount || T.config.pagination.pagerCount,
|
|
1739
|
+
getQuery: (s = {}) => {
|
|
1740
|
+
const t = a();
|
|
1717
1741
|
return {
|
|
1718
|
-
[
|
|
1719
|
-
[
|
|
1720
|
-
...
|
|
1742
|
+
[T.config.field.page.size]: s.size || t.page.size,
|
|
1743
|
+
[T.config.field.page.num]: s.num || t.page.num,
|
|
1744
|
+
...t.search.getFormData()
|
|
1721
1745
|
};
|
|
1722
1746
|
}
|
|
1723
1747
|
}
|
|
1724
|
-
}),
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
data: [],
|
|
1731
|
-
expand: {
|
|
1732
|
-
isExpand: !1,
|
|
1733
|
-
rowKeys: [],
|
|
1734
|
-
change: (a, s) => {
|
|
1748
|
+
}), Xt = (a, o, s) => {
|
|
1749
|
+
const t = a;
|
|
1750
|
+
return {
|
|
1751
|
+
table: {
|
|
1752
|
+
op: {
|
|
1753
|
+
width: (...n) => n.filter((r) => r).length * 30 + 60
|
|
1735
1754
|
},
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1755
|
+
loading: !1,
|
|
1756
|
+
data: [],
|
|
1757
|
+
expand: {
|
|
1758
|
+
isExpand: !1,
|
|
1759
|
+
rowKeys: [],
|
|
1760
|
+
change: (n, e) => {
|
|
1761
|
+
},
|
|
1762
|
+
all: () => {
|
|
1763
|
+
const n = t();
|
|
1764
|
+
if (n.table.expand.isExpand)
|
|
1765
|
+
n.table.expand.rowKeys = [];
|
|
1766
|
+
else {
|
|
1767
|
+
const e = (r) => {
|
|
1768
|
+
let l = [];
|
|
1769
|
+
return r.forEach((u) => {
|
|
1770
|
+
l.push(u[o.option.table.rowKey]), u.children?.length && (l = l.concat(e(u.children)));
|
|
1771
|
+
}), l;
|
|
1772
|
+
};
|
|
1773
|
+
n.table.expand.rowKeys = e(n.table.data);
|
|
1774
|
+
}
|
|
1775
|
+
n.table.expand.isExpand = !n.table.expand.isExpand;
|
|
1748
1776
|
}
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
listSource: [],
|
|
1756
|
-
list: []
|
|
1757
|
-
}
|
|
1758
|
-
},
|
|
1759
|
-
header: {
|
|
1760
|
-
group: {
|
|
1761
|
-
expand: !1,
|
|
1762
|
-
toggleExpandAll: () => {
|
|
1763
|
-
const a = e(), s = !a.table.header.group.expand;
|
|
1764
|
-
a.table.header.group.expand = s;
|
|
1765
|
-
const o = (l) => {
|
|
1766
|
-
l.forEach((i) => {
|
|
1767
|
-
i.table?.header?.group !== void 0 && (i.table.header.group = !s), i.table?.header?.groupKey !== void 0 && (i.table.header.show = s), Array.isArray(i.children) && i.children.length && o(i.children);
|
|
1768
|
-
});
|
|
1769
|
-
};
|
|
1770
|
-
o(a.table.column.list);
|
|
1777
|
+
},
|
|
1778
|
+
column: {
|
|
1779
|
+
list: [],
|
|
1780
|
+
show: {
|
|
1781
|
+
listSource: [],
|
|
1782
|
+
list: []
|
|
1771
1783
|
}
|
|
1772
|
-
}
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1784
|
+
},
|
|
1785
|
+
sortable: {
|
|
1786
|
+
mode: !1,
|
|
1787
|
+
actionLoading: !1,
|
|
1788
|
+
instance: void 0,
|
|
1789
|
+
modulePromise: void 0,
|
|
1790
|
+
getOption: () => o.option.table?.sortable || {},
|
|
1791
|
+
showTriggerButton: () => {
|
|
1792
|
+
const n = t();
|
|
1793
|
+
return o.option.table?.sortable?.button && !n.table.sortable.mode;
|
|
1794
|
+
},
|
|
1795
|
+
showActionButton: () => {
|
|
1796
|
+
const n = t();
|
|
1797
|
+
return o.option.table?.sortable?.button && n.table.sortable.mode;
|
|
1798
|
+
},
|
|
1799
|
+
showSaveButton: () => !o.option.table?.sortable?.button && o.option.table?.sortable?.show && o.option.table?.sortable?.saveButton,
|
|
1800
|
+
isActive: () => {
|
|
1801
|
+
const n = t(), e = n.table.sortable.getOption();
|
|
1802
|
+
return e.button ? n.table.sortable.mode : !!e.show;
|
|
1803
|
+
},
|
|
1804
|
+
showPagination: () => {
|
|
1805
|
+
const n = t();
|
|
1806
|
+
return !n.table.sortable.isActive() || n.table.sortable.getOption().page;
|
|
1807
|
+
},
|
|
1808
|
+
disableScroll: () => {
|
|
1809
|
+
const n = t(), e = n.table.sortable.getOption();
|
|
1810
|
+
return n.table.sortable.isActive() && !e.page && !e.scroll;
|
|
1811
|
+
},
|
|
1812
|
+
getTableBindOption: () => {
|
|
1813
|
+
const n = t();
|
|
1814
|
+
return {
|
|
1815
|
+
...o.option.table || {},
|
|
1816
|
+
...n.table.sortable.disableScroll() ? {
|
|
1817
|
+
height: void 0,
|
|
1818
|
+
maxHeight: void 0
|
|
1819
|
+
} : {}
|
|
1786
1820
|
};
|
|
1821
|
+
},
|
|
1822
|
+
getColumnBind: () => {
|
|
1823
|
+
const { show: n, button: e, page: r, scroll: l, field: u, rule: f, api: d, onEnd: b, ...c } = t().table.sortable.getOption();
|
|
1824
|
+
return c;
|
|
1825
|
+
},
|
|
1826
|
+
destroy: () => {
|
|
1827
|
+
const n = t();
|
|
1828
|
+
n.table.sortable.instance?.destroy(), n.table.sortable.instance = void 0;
|
|
1829
|
+
},
|
|
1830
|
+
getBody: () => s.tableRef.value?.$el?.querySelector(".el-table__body-wrapper tbody"),
|
|
1831
|
+
loadModule: async () => {
|
|
1832
|
+
const n = t();
|
|
1833
|
+
n.table.sortable.modulePromise ??= import("./sortable.esm-BNoi9mdn.js");
|
|
1834
|
+
const e = await n.table.sortable.modulePromise;
|
|
1835
|
+
return e.default || e;
|
|
1836
|
+
},
|
|
1837
|
+
applyRule: (n, e, r, l) => {
|
|
1838
|
+
if (r === "value") {
|
|
1839
|
+
n.forEach((u, f) => {
|
|
1840
|
+
u[e] = l[f];
|
|
1841
|
+
});
|
|
1842
|
+
return;
|
|
1843
|
+
}
|
|
1844
|
+
n.forEach((u, f) => {
|
|
1845
|
+
u[e] = f + 1;
|
|
1846
|
+
});
|
|
1847
|
+
},
|
|
1848
|
+
sync: async () => {
|
|
1849
|
+
const n = t();
|
|
1850
|
+
if (n.table.sortable.destroy(), !n.table.sortable.isActive() || n.table.loading) return;
|
|
1851
|
+
await Ce();
|
|
1852
|
+
const e = n.table.sortable.getBody();
|
|
1853
|
+
if (!e) return;
|
|
1854
|
+
const r = await n.table.sortable.loadModule(), l = n.table.sortable.getOption();
|
|
1855
|
+
n.table.sortable.instance = r.create(e, {
|
|
1856
|
+
animation: 150,
|
|
1857
|
+
handle: ".cc1-form-drag-handle",
|
|
1858
|
+
draggable: ".el-table__row",
|
|
1859
|
+
onEnd: ({ oldIndex: u, newIndex: f }) => {
|
|
1860
|
+
const d = (c, p, w) => {
|
|
1861
|
+
if (!Number.isInteger(p) || !Number.isInteger(w) || p === w || p < 0 || w < 0 || p >= c.length || w >= c.length) return;
|
|
1862
|
+
const F = c.splice(p, 1)[0];
|
|
1863
|
+
c.splice(w, 0, F);
|
|
1864
|
+
}, b = n.table.data.map((c) => c?.[l.field]);
|
|
1865
|
+
d(n.table.data, u, f), l.onEnd ? l.onEnd(n.table.data) : n.table.sortable.applyRule(n.table.data, l.field, l.rule, b);
|
|
1866
|
+
}
|
|
1867
|
+
});
|
|
1868
|
+
},
|
|
1869
|
+
refreshList: async () => {
|
|
1870
|
+
const n = t();
|
|
1871
|
+
await n.table.getList(n.table.sortable.isActive() ? "sortable" : void 0), n.table.sortable.sync();
|
|
1872
|
+
},
|
|
1873
|
+
/** 临时保存fitHeight,用于排序时临时关闭 */
|
|
1874
|
+
fitHeight: !1,
|
|
1875
|
+
start: async () => {
|
|
1876
|
+
const n = t(), e = n.table?.sortable.getOption();
|
|
1877
|
+
n.table.sortable.fitHeight = o.option.table.fitHeight, e.scroll || (o.option.table.fitHeight = !1), n.table.sortable.mode = !0, await n.table.sortable.refreshList();
|
|
1878
|
+
},
|
|
1879
|
+
exit: async () => {
|
|
1880
|
+
const n = t();
|
|
1881
|
+
o.option.table.fitHeight = n.table.sortable.fitHeight, await n.table.getList(), n.table.sortable.mode = !1, n.table.sortable.destroy();
|
|
1882
|
+
},
|
|
1883
|
+
save: async () => {
|
|
1884
|
+
const n = t(), r = n.table.sortable.getOption().api?.update || o.option.api.update;
|
|
1885
|
+
if (!r) {
|
|
1886
|
+
z.fail(k.tCurd("sortableUpdateApiRequired"));
|
|
1887
|
+
return;
|
|
1888
|
+
}
|
|
1889
|
+
n.table.sortable.actionLoading = !0, n.table.loading = !0;
|
|
1890
|
+
try {
|
|
1891
|
+
await r(n.table.data, "sortable"), z.success(k.tCurd("operationSuccess")), await n.table.sortable.exit();
|
|
1892
|
+
} catch (l) {
|
|
1893
|
+
console.error(l);
|
|
1894
|
+
} finally {
|
|
1895
|
+
n.table.sortable.actionLoading = !1, n.table.loading = !1;
|
|
1896
|
+
}
|
|
1897
|
+
},
|
|
1898
|
+
command: async (n) => {
|
|
1899
|
+
const e = t();
|
|
1900
|
+
if (n === "save") {
|
|
1901
|
+
await e.table.sortable.save();
|
|
1902
|
+
return;
|
|
1903
|
+
}
|
|
1904
|
+
await e.table.sortable.exit();
|
|
1787
1905
|
}
|
|
1788
|
-
const i = await s({
|
|
1789
|
-
...a.page.getQuery(),
|
|
1790
|
-
...l
|
|
1791
|
-
}), c = L.config.field.result, u = i.data || { [c.list]: i }, d = (Array.isArray(u[c.list]), u[c.list]), h = Ze(a.update.formGrid?.length ? a.update.formGrid : a.update.formColumn), m = ObjectUtil.deepMerge({ data: d }, {}).data.map((w) => (Object.keys(w).forEach((T) => {
|
|
1792
|
-
const O = h.find((A) => A.item.key === T);
|
|
1793
|
-
O && ["select", "radio"].includes(O.item.type) && (O.item.table.format || (O.item.table.format = (A) => O.item.options[O.item.type].data?.find((de) => de.value == A[T])?.label || A[T]));
|
|
1794
|
-
}), w));
|
|
1795
|
-
a.table.data = t.option.data ? await t.option.data(m, d) : m, a.tableEditValidate?.clear?.(), a.page.total = u[c.total] || 0, setTimeout(() => {
|
|
1796
|
-
a.table.selection.setList(o);
|
|
1797
|
-
}, 20);
|
|
1798
|
-
} catch (l) {
|
|
1799
|
-
console.error(l);
|
|
1800
|
-
} finally {
|
|
1801
|
-
a.table.loading = !1;
|
|
1802
|
-
}
|
|
1803
|
-
},
|
|
1804
|
-
selection: {
|
|
1805
|
-
list: [],
|
|
1806
|
-
change: (a) => {
|
|
1807
|
-
e().table.selection.list = a;
|
|
1808
1906
|
},
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1907
|
+
header: {
|
|
1908
|
+
group: {
|
|
1909
|
+
expand: !1,
|
|
1910
|
+
toggleExpandAll: () => {
|
|
1911
|
+
const n = t(), e = !n.table.header.group.expand;
|
|
1912
|
+
n.table.header.group.expand = e;
|
|
1913
|
+
const r = (l) => {
|
|
1914
|
+
l.forEach((u) => {
|
|
1915
|
+
u.table?.header?.group !== void 0 && (u.table.header.group = !e), u.table?.header?.groupKey !== void 0 && (u.table.header.show = e), Array.isArray(u.children) && u.children.length && r(u.children);
|
|
1916
|
+
});
|
|
1917
|
+
};
|
|
1918
|
+
r(n.table.column.list);
|
|
1919
|
+
}
|
|
1920
|
+
}
|
|
1921
|
+
},
|
|
1922
|
+
parseListResult: async (n) => {
|
|
1923
|
+
const e = t(), r = T.config.field.result, l = n?.data || { [r.list]: n }, u = (Array.isArray(l[r.list]), l[r.list]), f = et(e.update.formGrid?.length ? e.update.formGrid : e.update.formColumn), b = ObjectUtil.deepMerge({ data: u }, {}).data.map((c) => (Object.keys(c).forEach((w) => {
|
|
1924
|
+
const F = f.find((B) => B.item.key === w);
|
|
1925
|
+
F && ["select", "radio"].includes(F.item.type) && (F.item.table.format || (F.item.table.format = (B) => F.item.options[F.item.type].data?.find((L) => L.value == B[w])?.label || B[w]));
|
|
1926
|
+
}), c));
|
|
1927
|
+
return {
|
|
1928
|
+
data: o.option.data ? await o.option.data(b, u) : b,
|
|
1929
|
+
total: l[r.total] || 0
|
|
1930
|
+
};
|
|
1931
|
+
},
|
|
1932
|
+
applyListResult: async (n, e) => {
|
|
1933
|
+
const r = t(), l = await r.table.parseListResult(n);
|
|
1934
|
+
return r.table.data = l.data, r.page.total = e ?? l.total, r.tableEditValidate?.clear?.(), l;
|
|
1935
|
+
},
|
|
1936
|
+
getList: async (n) => {
|
|
1937
|
+
const e = t();
|
|
1938
|
+
e.table.loading = !0;
|
|
1939
|
+
const r = o.option.table?.sortable, l = n === "sortable" && r?.api?.list || o.option.api.list, u = JSONUtil.cp(e.table.selection.list);
|
|
1940
|
+
try {
|
|
1941
|
+
await e.initApiData("init");
|
|
1942
|
+
let f = {};
|
|
1943
|
+
if (e.table.sort.prop) {
|
|
1944
|
+
const { props: c, order: p } = T.config.table.sort;
|
|
1945
|
+
f = {
|
|
1946
|
+
[c.field]: e.table.sort.prop,
|
|
1947
|
+
[p.field]: e.table.sort.order
|
|
1948
|
+
};
|
|
1949
|
+
}
|
|
1950
|
+
const d = n === "sortable" && r?.page === !1 ? e.page.getQuery({
|
|
1951
|
+
num: 1,
|
|
1952
|
+
size: e.page.total || 999999
|
|
1953
|
+
}) : e.page.getQuery(), b = await l(
|
|
1954
|
+
{
|
|
1955
|
+
...d,
|
|
1956
|
+
...f
|
|
1957
|
+
},
|
|
1958
|
+
n
|
|
1959
|
+
);
|
|
1960
|
+
await e.table.applyListResult(b, n === "sortable" && r?.page === !1 ? e.page.total : void 0), setTimeout(() => {
|
|
1961
|
+
e.table.selection.setList(u), o.option.table?.sortable?.show && !o.option.table?.sortable?.button && e.table.sortable.sync();
|
|
1962
|
+
}, 20);
|
|
1963
|
+
} catch (f) {
|
|
1964
|
+
console.error(f);
|
|
1965
|
+
} finally {
|
|
1966
|
+
e.table.loading = !1;
|
|
1967
|
+
}
|
|
1968
|
+
},
|
|
1969
|
+
selection: {
|
|
1970
|
+
list: [],
|
|
1971
|
+
change: (n) => {
|
|
1972
|
+
t().table.selection.list = n;
|
|
1973
|
+
},
|
|
1974
|
+
setList: (n, e) => {
|
|
1975
|
+
const r = t();
|
|
1976
|
+
r.table.selection.list = [];
|
|
1977
|
+
const l = s.tableRef.value;
|
|
1978
|
+
if (l?.clearSelection(), !l || !n?.length) return;
|
|
1979
|
+
const u = o.option.table?.rowKey, f = (d) => {
|
|
1980
|
+
const b = (c) => {
|
|
1981
|
+
for (const p of c) {
|
|
1982
|
+
if (u != null && u !== "") {
|
|
1983
|
+
if (p[u] === d[u]) return p;
|
|
1984
|
+
} else if (p === d)
|
|
1985
|
+
return p;
|
|
1986
|
+
if (Array.isArray(p.children) && p.children.length) {
|
|
1987
|
+
const w = b(p.children);
|
|
1988
|
+
if (w !== void 0) return w;
|
|
1989
|
+
}
|
|
1824
1990
|
}
|
|
1825
|
-
}
|
|
1991
|
+
};
|
|
1992
|
+
return b(r.table.data);
|
|
1826
1993
|
};
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1994
|
+
n.forEach((d) => {
|
|
1995
|
+
const b = f(d);
|
|
1996
|
+
if (b)
|
|
1997
|
+
if (e) {
|
|
1998
|
+
const c = () => l.toggleRowSelection(b, !0, !1);
|
|
1999
|
+
e(d) !== !1 && c();
|
|
2000
|
+
} else
|
|
2001
|
+
l.toggleRowSelection(b, !0, !1);
|
|
2002
|
+
});
|
|
2003
|
+
}
|
|
2004
|
+
},
|
|
2005
|
+
sort: {
|
|
2006
|
+
prop: "",
|
|
2007
|
+
order: "",
|
|
2008
|
+
change: (n) => {
|
|
2009
|
+
const e = t();
|
|
2010
|
+
T.config.table.sort.resetPage && (e.page.num = 1);
|
|
2011
|
+
const r = T.config.table.sort;
|
|
2012
|
+
if (r.change) {
|
|
2013
|
+
r.change(n, e);
|
|
2014
|
+
return;
|
|
2015
|
+
}
|
|
2016
|
+
e.table.sort.prop = n.prop, n.order === null ? (e.table.sort.order = "", e.table.sort.prop = "") : e.table.sort.order = n.order === "ascending" ? r.order.asc : r.order.desc, e.table.getList();
|
|
1850
2017
|
}
|
|
1851
|
-
s.table.sort.prop = a.prop, a.order === null ? (s.table.sort.order = "", s.table.sort.prop = "") : s.table.sort.order = a.order === "ascending" ? o.order.asc : o.order.desc, s.table.getList();
|
|
1852
2018
|
}
|
|
1853
2019
|
}
|
|
1854
|
-
}
|
|
1855
|
-
}
|
|
1856
|
-
const
|
|
1857
|
-
let
|
|
1858
|
-
const
|
|
1859
|
-
let
|
|
1860
|
-
return
|
|
1861
|
-
},
|
|
1862
|
-
const
|
|
1863
|
-
return
|
|
1864
|
-
},
|
|
1865
|
-
Object.keys(
|
|
1866
|
-
delete
|
|
2020
|
+
};
|
|
2021
|
+
}, Yt = (a, o) => {
|
|
2022
|
+
const s = ie({}), t = /* @__PURE__ */ new WeakMap();
|
|
2023
|
+
let n = 0;
|
|
2024
|
+
const e = (g) => {
|
|
2025
|
+
let v = t.get(g);
|
|
2026
|
+
return v || (n += 1, v = `fallback-${n}`, t.set(g, v)), v;
|
|
2027
|
+
}, r = (g) => {
|
|
2028
|
+
const v = o.option.table?.rowKey, U = v ? g[v] : void 0;
|
|
2029
|
+
return U != null && U !== "" ? String(U) : e(g);
|
|
2030
|
+
}, l = (g, v) => `${r(g)}-${v.key}`, u = (g) => at(g, o.option.form?.error), f = ot(u), d = () => {
|
|
2031
|
+
Object.keys(s).forEach((g) => {
|
|
2032
|
+
delete s[g];
|
|
1867
2033
|
});
|
|
1868
|
-
},
|
|
1869
|
-
delete
|
|
1870
|
-
},
|
|
1871
|
-
if (typeof
|
|
1872
|
-
if (typeof
|
|
1873
|
-
},
|
|
1874
|
-
if (
|
|
1875
|
-
if (
|
|
1876
|
-
if (
|
|
1877
|
-
if (
|
|
1878
|
-
if (
|
|
1879
|
-
if (
|
|
1880
|
-
if (
|
|
1881
|
-
if (
|
|
1882
|
-
if (
|
|
2034
|
+
}, b = (g, v) => {
|
|
2035
|
+
delete s[l(g, v)];
|
|
2036
|
+
}, c = (g, v) => s[l(g, v)] || "", p = (g, v) => g.message || u(v), w = (g) => g == null || g === "" || Array.isArray(g) && g.length === 0, F = (g) => {
|
|
2037
|
+
if (typeof g == "number") return g;
|
|
2038
|
+
if (typeof g == "string" || Array.isArray(g)) return g.length;
|
|
2039
|
+
}, B = (g, v) => {
|
|
2040
|
+
if (g === "array") return Array.isArray(v);
|
|
2041
|
+
if (g === "integer") return typeof v == "number" && Number.isInteger(v);
|
|
2042
|
+
if (g === "float") return typeof v == "number" && !Number.isInteger(v);
|
|
2043
|
+
if (g === "number") return typeof v == "number" && !Number.isNaN(v);
|
|
2044
|
+
if (g === "boolean") return typeof v == "boolean";
|
|
2045
|
+
if (g === "object") return v !== null && typeof v == "object" && !Array.isArray(v);
|
|
2046
|
+
if (g === "date") return v instanceof Date || !Number.isNaN(new Date(v).getTime());
|
|
2047
|
+
if (g === "email") return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(v));
|
|
2048
|
+
if (g === "url")
|
|
1883
2049
|
try {
|
|
1884
|
-
return new URL(String(
|
|
2050
|
+
return new URL(String(v)), !0;
|
|
1885
2051
|
} catch {
|
|
1886
2052
|
return !1;
|
|
1887
2053
|
}
|
|
1888
|
-
return
|
|
1889
|
-
},
|
|
1890
|
-
let
|
|
1891
|
-
const
|
|
1892
|
-
if (!
|
|
1893
|
-
if (
|
|
1894
|
-
|
|
2054
|
+
return g === "string" ? typeof v == "string" : !0;
|
|
2055
|
+
}, L = (g, v, U) => typeof g.validator != "function" ? Promise.resolve(!0) : new Promise((H) => {
|
|
2056
|
+
let N = !1;
|
|
2057
|
+
const P = (I) => {
|
|
2058
|
+
if (!N) {
|
|
2059
|
+
if (N = !0, I == null) {
|
|
2060
|
+
H(!0);
|
|
1895
2061
|
return;
|
|
1896
2062
|
}
|
|
1897
2063
|
if (I instanceof Error) {
|
|
1898
|
-
|
|
2064
|
+
H(I.message || p(g, U));
|
|
1899
2065
|
return;
|
|
1900
2066
|
}
|
|
1901
2067
|
if (Array.isArray(I)) {
|
|
1902
|
-
const
|
|
1903
|
-
|
|
2068
|
+
const ze = I[0];
|
|
2069
|
+
H(ze instanceof Error ? ze.message : String(ze || p(g, U)));
|
|
1904
2070
|
return;
|
|
1905
2071
|
}
|
|
1906
|
-
|
|
2072
|
+
H(String(I));
|
|
1907
2073
|
}
|
|
1908
2074
|
};
|
|
1909
2075
|
try {
|
|
1910
|
-
const I =
|
|
1911
|
-
I && typeof I.then == "function" ? I.then(() =>
|
|
2076
|
+
const I = g.validator(g, v, P);
|
|
2077
|
+
I && typeof I.then == "function" ? I.then(() => P()).catch(P) : I === !1 ? P(p(g, U)) : typeof I == "string" || I instanceof Error ? P(I) : g.validator.length < 3 && P();
|
|
1912
2078
|
} catch (I) {
|
|
1913
|
-
|
|
2079
|
+
P(I);
|
|
1914
2080
|
}
|
|
1915
|
-
}),
|
|
1916
|
-
const
|
|
1917
|
-
if (
|
|
1918
|
-
if (
|
|
1919
|
-
if (
|
|
1920
|
-
const
|
|
1921
|
-
return
|
|
1922
|
-
},
|
|
1923
|
-
const
|
|
1924
|
-
return !
|
|
1925
|
-
},
|
|
1926
|
-
const
|
|
1927
|
-
|
|
1928
|
-
if (
|
|
1929
|
-
if (
|
|
1930
|
-
|
|
2081
|
+
}), j = async (g, v, U) => {
|
|
2082
|
+
const H = typeof g.transform == "function" ? g.transform(v) : v, N = w(H);
|
|
2083
|
+
if (g.required && N) return p(g, U);
|
|
2084
|
+
if (N && !g.required) return !0;
|
|
2085
|
+
if (g.whitespace && typeof H == "string" && H.trim() === "" || g.type && !B(g.type, H) || Array.isArray(g.enum) && !g.enum.includes(H) || g.pattern && !new RegExp(g.pattern).test(String(H))) return p(g, U);
|
|
2086
|
+
const P = F(H);
|
|
2087
|
+
return g.len !== void 0 && P !== void 0 && P !== g.len || g.min !== void 0 && P !== void 0 && P < g.min || g.max !== void 0 && P !== void 0 && P > g.max ? p(g, U) : L(g, H, U);
|
|
2088
|
+
}, Ve = (g) => {
|
|
2089
|
+
const v = a();
|
|
2090
|
+
return !g.key || !v.table.column.show.list.includes(g.key) || g.table?.header?.groupKey !== void 0 && !g.table.header.show ? !1 : g.show?.table !== void 0 ? z.isFun(g.show?.table, v.table.data) : !0;
|
|
2091
|
+
}, Se = (g, v) => g.show?.form !== void 0 ? z.isFun(g.show.form, v, z.EDialog.Update) : !0, _ = () => {
|
|
2092
|
+
const g = a(), v = [], U = (H) => {
|
|
2093
|
+
H.forEach((N) => {
|
|
2094
|
+
if (Ve(N)) {
|
|
2095
|
+
if (N.children?.length) {
|
|
2096
|
+
U(N.children);
|
|
1931
2097
|
return;
|
|
1932
2098
|
}
|
|
1933
|
-
|
|
2099
|
+
v.push(N);
|
|
1934
2100
|
}
|
|
1935
2101
|
});
|
|
1936
2102
|
};
|
|
1937
|
-
return
|
|
1938
|
-
},
|
|
1939
|
-
if (!
|
|
1940
|
-
return
|
|
1941
|
-
const
|
|
1942
|
-
if (!
|
|
1943
|
-
|
|
1944
|
-
const
|
|
1945
|
-
for (const
|
|
1946
|
-
const
|
|
1947
|
-
if (
|
|
1948
|
-
return
|
|
1949
|
-
field:
|
|
1950
|
-
error:
|
|
2103
|
+
return U(g.table.column.list), v;
|
|
2104
|
+
}, Ee = async (g, v) => {
|
|
2105
|
+
if (!Se(v, g))
|
|
2106
|
+
return b(g, v), !0;
|
|
2107
|
+
const U = f(v, g);
|
|
2108
|
+
if (!U) return !0;
|
|
2109
|
+
b(g, v);
|
|
2110
|
+
const H = Array.isArray(U) ? U : [U];
|
|
2111
|
+
for (const N of H) {
|
|
2112
|
+
const P = await j(N, g[v.key], v);
|
|
2113
|
+
if (P !== !0)
|
|
2114
|
+
return s[l(g, v)] = P, {
|
|
2115
|
+
field: v.key,
|
|
2116
|
+
error: P
|
|
1951
2117
|
};
|
|
1952
2118
|
}
|
|
1953
2119
|
return !0;
|
|
1954
|
-
}, te = (
|
|
1955
|
-
const
|
|
1956
|
-
|
|
1957
|
-
|
|
2120
|
+
}, te = (g) => {
|
|
2121
|
+
const v = [], U = (H) => {
|
|
2122
|
+
H.forEach((N) => {
|
|
2123
|
+
v.push(N), Array.isArray(N.children) && N.children.length && U(N.children);
|
|
1958
2124
|
});
|
|
1959
2125
|
};
|
|
1960
|
-
return
|
|
2126
|
+
return U(g), v;
|
|
1961
2127
|
};
|
|
1962
2128
|
return {
|
|
1963
2129
|
tableEditValidate: {
|
|
1964
|
-
errors:
|
|
2130
|
+
errors: s,
|
|
1965
2131
|
clear: d,
|
|
1966
|
-
clearField:
|
|
1967
|
-
getFieldError:
|
|
2132
|
+
clearField: b,
|
|
2133
|
+
getFieldError: c,
|
|
1968
2134
|
validate: async () => {
|
|
1969
|
-
if (d(), !
|
|
1970
|
-
const
|
|
1971
|
-
if (
|
|
1972
|
-
throw me(
|
|
2135
|
+
if (d(), !o.option.table?.editMode) return !0;
|
|
2136
|
+
const g = a(), v = _(), U = te(g.table.data || []), N = (await Promise.all(U.flatMap((P) => v.map((I) => Ee(P, I))))).filter((P) => P !== !0);
|
|
2137
|
+
if (N.length)
|
|
2138
|
+
throw me(N), !1;
|
|
1973
2139
|
return !0;
|
|
1974
2140
|
}
|
|
1975
2141
|
}
|
|
1976
2142
|
};
|
|
1977
2143
|
};
|
|
1978
|
-
class
|
|
2144
|
+
class Zt {
|
|
1979
2145
|
/**
|
|
1980
2146
|
* 导出数据为 Excel 文件(.xlsx),自动触发浏览器下载
|
|
1981
2147
|
*
|
|
@@ -1983,339 +2149,347 @@ class Qt {
|
|
|
1983
2149
|
* @param columns - 列配置数组,需包含 `key`(数据字段)和 `label`(Excel 表头)
|
|
1984
2150
|
* @param fileName - 文件名(不含扩展名),支持字符串或返回字符串的函数;默认生成「导出数据_日期_时间戳」
|
|
1985
2151
|
*/
|
|
1986
|
-
static exportToExcel = async (
|
|
1987
|
-
if (!
|
|
1988
|
-
const
|
|
1989
|
-
const
|
|
1990
|
-
return
|
|
1991
|
-
|
|
1992
|
-
}),
|
|
1993
|
-
}),
|
|
1994
|
-
|
|
2152
|
+
static exportToExcel = async (o, s, t) => {
|
|
2153
|
+
if (!o || o.length === 0) return;
|
|
2154
|
+
const n = await z.loadModule("xlsx"), e = o.map((u) => {
|
|
2155
|
+
const f = {};
|
|
2156
|
+
return s.forEach((d) => {
|
|
2157
|
+
f[d.label] = u[d.key];
|
|
2158
|
+
}), f;
|
|
2159
|
+
}), r = n.utils.json_to_sheet(e), l = n.utils.book_new();
|
|
2160
|
+
n.utils.book_append_sheet(l, r, "Sheet1"), t ? typeof t == "function" && (t = t()) : t = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, n.writeFile(l, `${t}.xlsx`);
|
|
1995
2161
|
};
|
|
1996
2162
|
}
|
|
1997
|
-
const
|
|
2163
|
+
const xt = (a, o) => ({
|
|
1998
2164
|
export: {
|
|
1999
2165
|
run: {
|
|
2000
|
-
start: async (
|
|
2001
|
-
let
|
|
2002
|
-
const
|
|
2003
|
-
|
|
2166
|
+
start: async (s) => {
|
|
2167
|
+
let n = await a().export.run[s]();
|
|
2168
|
+
const e = o.option.column, r = ObjectUtil.deepMerge({ data: n, columns: e }, {}), l = o.option.tools?.export || {};
|
|
2169
|
+
l.before?.(r), Zt.exportToExcel(r.data, r.columns, l.fileName);
|
|
2004
2170
|
},
|
|
2005
2171
|
select: async () => {
|
|
2006
|
-
const
|
|
2007
|
-
|
|
2172
|
+
const s = a();
|
|
2173
|
+
s.export.loading = !0;
|
|
2008
2174
|
try {
|
|
2009
|
-
if (
|
|
2010
|
-
await
|
|
2011
|
-
...
|
|
2012
|
-
items:
|
|
2175
|
+
if (o.option.tools?.export?.select) {
|
|
2176
|
+
await o.option.tools.export.select({
|
|
2177
|
+
...s.page.getQuery(),
|
|
2178
|
+
items: s.table.selection.list
|
|
2013
2179
|
});
|
|
2014
2180
|
return;
|
|
2015
2181
|
}
|
|
2016
|
-
if (
|
|
2017
|
-
throw
|
|
2018
|
-
return
|
|
2019
|
-
} catch (
|
|
2020
|
-
console.error(
|
|
2182
|
+
if (s.table.selection.list.length === 0)
|
|
2183
|
+
throw z.fail(k.tCurd("selectDataToExport")), new Error(k.tCurd("selectDataToExport"));
|
|
2184
|
+
return s.table.selection.list;
|
|
2185
|
+
} catch (t) {
|
|
2186
|
+
console.error(t);
|
|
2021
2187
|
} finally {
|
|
2022
|
-
|
|
2188
|
+
s.export.loading = !1;
|
|
2023
2189
|
}
|
|
2024
2190
|
},
|
|
2025
2191
|
page: async () => {
|
|
2026
|
-
const
|
|
2027
|
-
|
|
2192
|
+
const s = a();
|
|
2193
|
+
s.export.loading = !0;
|
|
2028
2194
|
try {
|
|
2029
|
-
if (
|
|
2030
|
-
await
|
|
2031
|
-
...
|
|
2195
|
+
if (o.option.tools?.export?.page) {
|
|
2196
|
+
await o.option.tools.export.page({
|
|
2197
|
+
...s.page.getQuery()
|
|
2032
2198
|
});
|
|
2033
2199
|
return;
|
|
2034
2200
|
}
|
|
2035
|
-
if (
|
|
2036
|
-
throw
|
|
2037
|
-
return
|
|
2038
|
-
} catch (
|
|
2039
|
-
console.error(
|
|
2201
|
+
if (s.table.data.length === 0)
|
|
2202
|
+
throw z.fail(k.tCurd("noData")), new Error(k.tCurd("noData"));
|
|
2203
|
+
return s.table.data;
|
|
2204
|
+
} catch (t) {
|
|
2205
|
+
console.error(t);
|
|
2040
2206
|
} finally {
|
|
2041
|
-
|
|
2207
|
+
s.export.loading = !1;
|
|
2042
2208
|
}
|
|
2043
2209
|
},
|
|
2044
2210
|
all: async () => {
|
|
2045
|
-
const
|
|
2046
|
-
|
|
2211
|
+
const s = a();
|
|
2212
|
+
s.export.loading = !0;
|
|
2047
2213
|
try {
|
|
2048
|
-
if (
|
|
2049
|
-
await
|
|
2050
|
-
...
|
|
2214
|
+
if (o.option.tools?.export?.all) {
|
|
2215
|
+
await o.option.tools.export.all({
|
|
2216
|
+
...s.page.getQuery()
|
|
2051
2217
|
});
|
|
2052
2218
|
return;
|
|
2053
2219
|
}
|
|
2054
|
-
const
|
|
2055
|
-
...
|
|
2220
|
+
const t = o.option.api.list, n = await t({
|
|
2221
|
+
...s.page.getQuery({ size: 999999, num: 1 })
|
|
2056
2222
|
});
|
|
2057
|
-
return (
|
|
2058
|
-
} catch (
|
|
2059
|
-
console.error(
|
|
2223
|
+
return (n.data || { [T.config.field.result.list]: n })[T.config.field.result.list];
|
|
2224
|
+
} catch (t) {
|
|
2225
|
+
console.error(t);
|
|
2060
2226
|
} finally {
|
|
2061
|
-
|
|
2227
|
+
s.export.loading = !1;
|
|
2062
2228
|
}
|
|
2063
2229
|
}
|
|
2064
2230
|
},
|
|
2065
2231
|
loading: !1,
|
|
2066
|
-
click: (
|
|
2067
|
-
const
|
|
2068
|
-
|
|
2232
|
+
click: (s) => {
|
|
2233
|
+
const t = a();
|
|
2234
|
+
t.export.loading || t.export.run.start(s);
|
|
2069
2235
|
}
|
|
2070
2236
|
}
|
|
2071
|
-
}),
|
|
2237
|
+
}), _t = (a, o) => ({
|
|
2072
2238
|
remove: {
|
|
2073
|
-
title:
|
|
2239
|
+
title: k.tCurd("deleteTitle"),
|
|
2074
2240
|
show: !1,
|
|
2075
2241
|
items: [],
|
|
2076
2242
|
loading: !1,
|
|
2077
2243
|
close: () => {
|
|
2078
|
-
|
|
2244
|
+
a().remove.show = !1;
|
|
2079
2245
|
},
|
|
2080
|
-
open: (
|
|
2081
|
-
if (
|
|
2082
|
-
|
|
2246
|
+
open: (s) => {
|
|
2247
|
+
if (s.length === 0) {
|
|
2248
|
+
z.fail(k.tCurd("selectDataToDelete"));
|
|
2083
2249
|
return;
|
|
2084
2250
|
}
|
|
2085
|
-
const
|
|
2086
|
-
|
|
2251
|
+
const t = a();
|
|
2252
|
+
t.remove.items = s, t.remove.show = !0;
|
|
2087
2253
|
},
|
|
2088
2254
|
submit: () => {
|
|
2089
2255
|
FunUtil.throttle(async () => {
|
|
2090
|
-
const
|
|
2091
|
-
|
|
2092
|
-
const
|
|
2256
|
+
const s = a();
|
|
2257
|
+
s.remove.loading = !0;
|
|
2258
|
+
const t = o.option.api.delete;
|
|
2093
2259
|
try {
|
|
2094
|
-
if (!
|
|
2095
|
-
await
|
|
2096
|
-
[
|
|
2097
|
-
items:
|
|
2098
|
-
}),
|
|
2099
|
-
} catch (
|
|
2100
|
-
console.error(
|
|
2260
|
+
if (!t) return;
|
|
2261
|
+
await t({
|
|
2262
|
+
[o.option.table?.rowKey]: s.remove.items.map((n) => n[o.option.table?.rowKey]),
|
|
2263
|
+
items: s.remove.items
|
|
2264
|
+
}), z.success(k.tCurd("operationSuccess")), s.table.data.length <= 1 && s.page.num > 1 && (s.page.num -= 1), s.remove.close(), await s.table.getList();
|
|
2265
|
+
} catch (n) {
|
|
2266
|
+
console.error(n);
|
|
2101
2267
|
} finally {
|
|
2102
|
-
|
|
2268
|
+
s.remove.loading = !1;
|
|
2103
2269
|
}
|
|
2104
2270
|
});
|
|
2105
2271
|
}
|
|
2106
2272
|
}
|
|
2107
|
-
}),
|
|
2273
|
+
}), eo = (a, o, s) => ({
|
|
2108
2274
|
apiDataMap: {},
|
|
2109
|
-
getColumnSpan: (
|
|
2110
|
-
const
|
|
2111
|
-
return
|
|
2112
|
-
maxSpan:
|
|
2113
|
-
defaultSpan:
|
|
2275
|
+
getColumnSpan: (t, n) => {
|
|
2276
|
+
const e = a(), r = e.update.formGrid?.length ? e.update.formGrid : n || [];
|
|
2277
|
+
return Ze(t, r, e.update.form, e.update.type, {
|
|
2278
|
+
maxSpan: e.update.formMaxSpan || o.option.form?.maxSpan,
|
|
2279
|
+
defaultSpan: o.option.form?.defaultSpan || T.config.form.defaultSpan
|
|
2114
2280
|
});
|
|
2115
2281
|
},
|
|
2116
2282
|
init: () => {
|
|
2117
|
-
const
|
|
2118
|
-
|
|
2283
|
+
const t = a();
|
|
2284
|
+
t.initCurdConfig(), t.initColumnOptions(), t.initColumnForm();
|
|
2119
2285
|
},
|
|
2120
|
-
initApiData: async (
|
|
2121
|
-
const
|
|
2122
|
-
if (
|
|
2123
|
-
|
|
2286
|
+
initApiData: async (t) => {
|
|
2287
|
+
const n = a(), e = [], r = (l) => {
|
|
2288
|
+
if (l.children?.length) {
|
|
2289
|
+
l.children.forEach((f) => r(f));
|
|
2124
2290
|
return;
|
|
2125
2291
|
}
|
|
2126
|
-
const
|
|
2127
|
-
if (
|
|
2128
|
-
if (
|
|
2129
|
-
const
|
|
2292
|
+
const u = le(l);
|
|
2293
|
+
if (l.options?.[u]?.dataApi && l.options?.[u]?.dataApiConfig?.[t]) {
|
|
2294
|
+
if (n.apiDataMap[l.key] && l.options?.[u]?.dataApiConfig?.once) return;
|
|
2295
|
+
const f = (async () => {
|
|
2130
2296
|
try {
|
|
2131
|
-
let d = await
|
|
2297
|
+
let d = await l.options?.[u]?.dataApi?.(n.update.form, n.update.type);
|
|
2132
2298
|
if (d) {
|
|
2133
|
-
const
|
|
2134
|
-
!Array.isArray(d) &&
|
|
2299
|
+
const b = l.options?.[u]?.dataPath;
|
|
2300
|
+
!Array.isArray(d) && b && (d = ObjectUtil.getPathValue(d, b)), l.options[u].data = d, l.options.search[u].data = d, l.options.search[l.options.search.type ?? u] || (l.options.search[l.options.search.type ?? u] = {}), l.options.search[l.options.search.type ?? u].data = d, l.options.formAdd[u].data = d, l.options.formUpdate[u].data = d, n.apiDataMap[l.key] = d;
|
|
2135
2301
|
}
|
|
2136
2302
|
} catch {
|
|
2137
2303
|
}
|
|
2138
2304
|
})();
|
|
2139
|
-
|
|
2305
|
+
e.push(f);
|
|
2140
2306
|
}
|
|
2141
2307
|
};
|
|
2142
|
-
return
|
|
2308
|
+
return o.option.column.forEach((l) => r(l)), await Promise.all(e), !0;
|
|
2143
2309
|
},
|
|
2144
2310
|
initCurdConfig: () => {
|
|
2145
|
-
const
|
|
2146
|
-
|
|
2147
|
-
const
|
|
2148
|
-
Object.keys(
|
|
2149
|
-
|
|
2311
|
+
const t = ObjectUtil.deepMerge(T.config, {});
|
|
2312
|
+
t.table.emptyText = k.tCurd("noData"), o.option.size = o.option.size || {}, t.table.size = o.option.size.table || t.size.table, t.form.size = o.option.size.form || t.size.form, t.size.search = o.option.size.search || t.size.search;
|
|
2313
|
+
const n = ObjectUtil.deepMerge(t, o.option || {});
|
|
2314
|
+
Object.keys(n).forEach((e) => {
|
|
2315
|
+
o.option[e] = n[e];
|
|
2150
2316
|
});
|
|
2151
2317
|
},
|
|
2152
2318
|
initColumnOptions: () => {
|
|
2153
|
-
const
|
|
2154
|
-
let
|
|
2155
|
-
|
|
2319
|
+
const t = a();
|
|
2320
|
+
let n = JSONUtil.cp(T.config.columnConfig);
|
|
2321
|
+
n.options = ObjectUtil.deepMerge(
|
|
2156
2322
|
{
|
|
2157
2323
|
switch: {
|
|
2158
|
-
activeText:
|
|
2159
|
-
inactiveText:
|
|
2324
|
+
activeText: k.tCurd("switchOn"),
|
|
2325
|
+
inactiveText: k.tCurd("switchOff")
|
|
2160
2326
|
}
|
|
2161
2327
|
},
|
|
2162
|
-
|
|
2328
|
+
n.options
|
|
2163
2329
|
);
|
|
2164
|
-
const
|
|
2165
|
-
const
|
|
2166
|
-
for (const
|
|
2167
|
-
if (
|
|
2168
|
-
if (
|
|
2169
|
-
|
|
2330
|
+
const e = (r) => {
|
|
2331
|
+
const l = le(r);
|
|
2332
|
+
for (const f in n) {
|
|
2333
|
+
if (f === "table") {
|
|
2334
|
+
if (r.table = ObjectUtil.deepMerge(n.table, r.table || {}), r.children) {
|
|
2335
|
+
r.children.forEach((d) => e(d));
|
|
2170
2336
|
return;
|
|
2171
2337
|
}
|
|
2172
|
-
} else
|
|
2173
|
-
|
|
2338
|
+
} else f === "type" ? r.type = r.type || n.type : r[f] = ObjectUtil.deepMerge(n[f], r[f] || {});
|
|
2339
|
+
r.options = r.options || {}, r.options[l] = r.options[l] || {}, r.options[l].size = o.option.size.form;
|
|
2174
2340
|
}
|
|
2175
|
-
["search", "formAdd", "formUpdate"].forEach((
|
|
2176
|
-
|
|
2177
|
-
}),
|
|
2178
|
-
const
|
|
2341
|
+
["search", "formAdd", "formUpdate"].forEach((f) => {
|
|
2342
|
+
r.options[f] = ObjectUtil.deepMerge(r.options, r.options[f] || {}), f === "search" ? o.option.size.search && (r.options[f][l].size = o.option.size.search) : o.option.size.form && (r.options[f][l].size = o.option.size.form);
|
|
2343
|
+
}), r.table = ObjectUtil.deepMerge(r.table, r.options[l].table || {}), l === "switch" && (r.options.switch.tableBeforeChange = async (f, d) => {
|
|
2344
|
+
const b = r.options?.switch;
|
|
2179
2345
|
try {
|
|
2180
|
-
|
|
2181
|
-
title:
|
|
2182
|
-
content:
|
|
2346
|
+
b.tableConfig?.confirm && await s.switchConfirmRef.value?.open({
|
|
2347
|
+
title: k.tCurd("confirmModify"),
|
|
2348
|
+
content: k.tCurd("confirmSwitchMessage")
|
|
2183
2349
|
});
|
|
2184
2350
|
try {
|
|
2185
|
-
if (!
|
|
2186
|
-
const
|
|
2187
|
-
|
|
2188
|
-
const
|
|
2351
|
+
if (!o.option.api.update && !b.tableConfig?.api) return;
|
|
2352
|
+
const c = d[o.option.table?.rowKey];
|
|
2353
|
+
b.loadingMap || (b.loadingMap = {}), b.loadingMap[c] || (b.loadingMap[c] = { loading: !1 }), b.loadingMap[c].loading = !0;
|
|
2354
|
+
const p = d[f] === b.activeValue ? b.inactiveValue : b.activeValue, w = b.tableConfig?.api ? b.tableConfig.api : o.option.api.update;
|
|
2189
2355
|
if (!w) return;
|
|
2190
2356
|
try {
|
|
2191
|
-
await w({ ...d, [
|
|
2357
|
+
await w({ ...d, [f]: p }, "switch");
|
|
2192
2358
|
} catch {
|
|
2193
2359
|
return !1;
|
|
2194
2360
|
} finally {
|
|
2195
|
-
|
|
2361
|
+
b.loadingMap[c].loading = !1;
|
|
2196
2362
|
}
|
|
2197
|
-
return
|
|
2198
|
-
} catch (
|
|
2199
|
-
return console.error(
|
|
2363
|
+
return z.success(k.tCurd("operationSuccess")), b.tableConfig?.loadList && (t.table.loading = !0, t.table.getList(), t.table.loading = !1), !0;
|
|
2364
|
+
} catch (c) {
|
|
2365
|
+
return console.error(c), !1;
|
|
2200
2366
|
} finally {
|
|
2201
|
-
|
|
2367
|
+
t.table.loading = !1;
|
|
2202
2368
|
}
|
|
2203
2369
|
} catch {
|
|
2204
2370
|
return !1;
|
|
2205
2371
|
}
|
|
2206
|
-
}),
|
|
2372
|
+
}), l === "treeSelect" && (r.options.treeSelect.rowKey = o.option.table?.rowKey, r.options.treeSelect.nodeKey = o.option.table?.rowKey);
|
|
2207
2373
|
};
|
|
2208
|
-
|
|
2374
|
+
o.option.column.forEach(e), o.option.table?.column?.forEach(e);
|
|
2209
2375
|
},
|
|
2210
2376
|
initColumnForm: () => {
|
|
2211
|
-
const
|
|
2212
|
-
|
|
2213
|
-
const
|
|
2214
|
-
if (
|
|
2215
|
-
|
|
2377
|
+
const t = a(), n = o.option;
|
|
2378
|
+
t.update.formColumn = [], t.update.formGrid = [], t.update.formMaxSpan = 12, t.table.column.show = { list: [], listSource: [] };
|
|
2379
|
+
const e = o.option.form?.maxSpan || 12, r = o.option.form?.defaultSpan || e / 2, l = nt(o.option.form), u = (c) => {
|
|
2380
|
+
if (c.children) {
|
|
2381
|
+
t.table.column.show.list.push(c.key), c.children.forEach((p) => u(p));
|
|
2216
2382
|
return;
|
|
2217
2383
|
}
|
|
2218
|
-
|
|
2384
|
+
t.update.formDefault[c.key] = c.value, c.table?.table && (c.show?.table && t.table.column.show.list.push(c.key), t.table.column.show.listSource.push(c.key));
|
|
2219
2385
|
};
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
}),
|
|
2223
|
-
|
|
2224
|
-
}),
|
|
2225
|
-
const
|
|
2226
|
-
maxSpan:
|
|
2227
|
-
defaultSpan:
|
|
2228
|
-
layout:
|
|
2386
|
+
n.column.forEach((c) => {
|
|
2387
|
+
ke(c, !0), u(c);
|
|
2388
|
+
}), o.option.table?.column?.forEach((c) => {
|
|
2389
|
+
ke(c, !1), u(c);
|
|
2390
|
+
}), t.search.column.list = n.column.concat(n.table?.column || []), t.table.column.list = t.search.column.list.filter((c) => c.table?.table), t.search.column.list.sort((c, p) => c.sort?.search - p.sort?.search), t.table.column.list.sort((c, p) => c.sort?.table - p.sort?.table), t.update.rules = {}, Re(n.column, t.update.formDefault, t.update.rules, (c) => l(c, () => t.update.form)), n.table?.editMode && Re(n.table?.column || [], t.update.formDefault, t.update.rules, (c) => l(c, () => t.update.form));
|
|
2391
|
+
const f = tt(n.column, {
|
|
2392
|
+
maxSpan: e,
|
|
2393
|
+
defaultSpan: r,
|
|
2394
|
+
layout: o.option.form?.layout
|
|
2229
2395
|
});
|
|
2230
|
-
|
|
2231
|
-
const d =
|
|
2232
|
-
d && Object.keys(d).forEach((
|
|
2233
|
-
|
|
2234
|
-
}),
|
|
2235
|
-
|
|
2396
|
+
t.update.formGrid = f.cells, t.update.formMaxSpan = f.maxSpan, t.update.formColumn = _e(f.cells);
|
|
2397
|
+
const d = o.option.search?.formDefault;
|
|
2398
|
+
d && Object.keys(d).forEach((c) => {
|
|
2399
|
+
t.search.formDefault[c] = d[c];
|
|
2400
|
+
}), n.column.forEach((c) => {
|
|
2401
|
+
c.show?.search || (t.search.formDefault[c.key] = void 0);
|
|
2236
2402
|
});
|
|
2237
|
-
const
|
|
2238
|
-
|
|
2403
|
+
const b = ObjectUtil.deepMerge(t.search.formDefault, {});
|
|
2404
|
+
x.setValue(t.search.form, b, !0);
|
|
2239
2405
|
}
|
|
2240
|
-
}),
|
|
2241
|
-
const
|
|
2242
|
-
|
|
2243
|
-
let
|
|
2244
|
-
for (;
|
|
2245
|
-
|
|
2246
|
-
return
|
|
2247
|
-
},
|
|
2248
|
-
let
|
|
2249
|
-
parentCurdConf:
|
|
2250
|
-
getCurdConf:
|
|
2251
|
-
getRootCurdConf:
|
|
2252
|
-
...
|
|
2253
|
-
option:
|
|
2254
|
-
...
|
|
2255
|
-
...
|
|
2256
|
-
...
|
|
2257
|
-
...
|
|
2258
|
-
...
|
|
2259
|
-
...
|
|
2260
|
-
...
|
|
2261
|
-
...
|
|
2406
|
+
}), to = (a) => {
|
|
2407
|
+
const o = Y(), s = Y(), t = Y(), n = { switchConfirmRef: o, ruleFormRef: s, tableRef: t }, e = Ge(), r = Fe.getConf("curdConf"), l = (b) => {
|
|
2408
|
+
b = b || f;
|
|
2409
|
+
let c = b, p = b;
|
|
2410
|
+
for (; c?.parentCurdConf; )
|
|
2411
|
+
p = c.parentCurdConf, c = c.parentCurdConf;
|
|
2412
|
+
return p;
|
|
2413
|
+
}, u = () => f;
|
|
2414
|
+
let f = ie({
|
|
2415
|
+
parentCurdConf: r,
|
|
2416
|
+
getCurdConf: l,
|
|
2417
|
+
getRootCurdConf: l,
|
|
2418
|
+
...qt(),
|
|
2419
|
+
option: a.option,
|
|
2420
|
+
...Jt(u, a),
|
|
2421
|
+
...Qt(u, a),
|
|
2422
|
+
...Xt(u, a, n),
|
|
2423
|
+
...Yt(u, a),
|
|
2424
|
+
...xt(u, a),
|
|
2425
|
+
...Ut(u, a, n),
|
|
2426
|
+
..._t(u, a),
|
|
2427
|
+
...eo(u, a, n)
|
|
2262
2428
|
});
|
|
2263
|
-
|
|
2264
|
-
const d =
|
|
2265
|
-
return
|
|
2266
|
-
validate: async (
|
|
2267
|
-
const
|
|
2268
|
-
if (
|
|
2429
|
+
f.init();
|
|
2430
|
+
const d = e ? `curdRef-${e.uid}` : "";
|
|
2431
|
+
return r?.formRef && d && (r.formRef.set(d, {
|
|
2432
|
+
validate: async (b) => {
|
|
2433
|
+
const c = await f.update.validate(!1);
|
|
2434
|
+
if (b?.(!!c), !c) throw !1;
|
|
2269
2435
|
return !0;
|
|
2270
2436
|
}
|
|
2271
|
-
}),
|
|
2272
|
-
|
|
2273
|
-
})),
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2437
|
+
}), Ie(() => {
|
|
2438
|
+
r.formRef.remove(d);
|
|
2439
|
+
})), He(() => {
|
|
2440
|
+
if (a.option.init !== !1) {
|
|
2441
|
+
if (a.option.table?.sortable?.show && !a.option.table?.sortable?.button) {
|
|
2442
|
+
(f.table?.sortable.getOption()).scroll || (a.option.table.fitHeight = !1), f.table.sortable.refreshList();
|
|
2443
|
+
return;
|
|
2444
|
+
}
|
|
2445
|
+
f.table.getList();
|
|
2446
|
+
}
|
|
2447
|
+
}), yt(() => {
|
|
2448
|
+
f.table.sortable.destroy();
|
|
2449
|
+
}), Fe.setConf("curdConf", f), { conf: f, switchConfirmRef: o, ruleFormRef: s, tableRef: t };
|
|
2450
|
+
}, oo = { class: "dialog-footer" }, ao = /* @__PURE__ */ Q({
|
|
2277
2451
|
__name: "switchConfirm",
|
|
2278
2452
|
props: {
|
|
2279
2453
|
size: {}
|
|
2280
2454
|
},
|
|
2281
|
-
setup(
|
|
2282
|
-
const
|
|
2283
|
-
let
|
|
2284
|
-
const
|
|
2285
|
-
|
|
2286
|
-
})),
|
|
2287
|
-
|
|
2288
|
-
},
|
|
2289
|
-
|
|
2455
|
+
setup(a, { expose: o }) {
|
|
2456
|
+
const s = Y(!1), t = Y("确认修改"), n = Y("确认要修改状态吗?");
|
|
2457
|
+
let e = null, r = null;
|
|
2458
|
+
const l = (d) => (d?.title && (t.value = d.title), d?.content && (n.value = d.content), s.value = !0, new Promise((b, c) => {
|
|
2459
|
+
e = b, r = c;
|
|
2460
|
+
})), u = () => {
|
|
2461
|
+
s.value = !1, e?.(!0), e = null, r = null;
|
|
2462
|
+
}, f = () => {
|
|
2463
|
+
s.value = !1, r?.(new Error("用户取消操作")), e = null, r = null;
|
|
2290
2464
|
};
|
|
2291
|
-
return
|
|
2292
|
-
open:
|
|
2293
|
-
}), (d,
|
|
2294
|
-
const
|
|
2295
|
-
return
|
|
2296
|
-
modelValue:
|
|
2297
|
-
"onUpdate:modelValue":
|
|
2298
|
-
title:
|
|
2465
|
+
return o({
|
|
2466
|
+
open: l
|
|
2467
|
+
}), (d, b) => {
|
|
2468
|
+
const c = pe("el-form");
|
|
2469
|
+
return m(), y(i($e), {
|
|
2470
|
+
modelValue: s.value,
|
|
2471
|
+
"onUpdate:modelValue": b[0] || (b[0] = (p) => s.value = p),
|
|
2472
|
+
title: t.value,
|
|
2299
2473
|
"close-on-click-modal": !1,
|
|
2300
2474
|
width: "400px"
|
|
2301
2475
|
}, {
|
|
2302
|
-
footer:
|
|
2303
|
-
|
|
2304
|
-
default:
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
default:
|
|
2308
|
-
M("取消"
|
|
2309
|
-
])
|
|
2476
|
+
footer: h(() => [
|
|
2477
|
+
O(c, { size: d.size }, {
|
|
2478
|
+
default: h(() => [
|
|
2479
|
+
D("span", oo, [
|
|
2480
|
+
O(i(K), { onClick: f }, {
|
|
2481
|
+
default: h(() => b[1] || (b[1] = [
|
|
2482
|
+
M("取消")
|
|
2483
|
+
])),
|
|
2310
2484
|
_: 1
|
|
2311
2485
|
}),
|
|
2312
|
-
|
|
2486
|
+
O(i(K), {
|
|
2313
2487
|
type: "primary",
|
|
2314
|
-
onClick:
|
|
2488
|
+
onClick: u
|
|
2315
2489
|
}, {
|
|
2316
|
-
default:
|
|
2317
|
-
M("确认"
|
|
2318
|
-
])
|
|
2490
|
+
default: h(() => b[2] || (b[2] = [
|
|
2491
|
+
M("确认")
|
|
2492
|
+
])),
|
|
2319
2493
|
_: 1
|
|
2320
2494
|
})
|
|
2321
2495
|
])
|
|
@@ -2323,403 +2497,412 @@ const Xt = (e, t) => ({
|
|
|
2323
2497
|
_: 1
|
|
2324
2498
|
}, 8, ["size"])
|
|
2325
2499
|
]),
|
|
2326
|
-
default:
|
|
2327
|
-
|
|
2500
|
+
default: h(() => [
|
|
2501
|
+
D("div", null, R(n.value), 1)
|
|
2328
2502
|
]),
|
|
2329
2503
|
_: 1
|
|
2330
2504
|
}, 8, ["modelValue", "title"]);
|
|
2331
2505
|
};
|
|
2332
2506
|
}
|
|
2333
|
-
}),
|
|
2507
|
+
}), no = ["innerHTML"], lo = /* @__PURE__ */ Q({
|
|
2334
2508
|
__name: "text",
|
|
2335
2509
|
props: {
|
|
2336
2510
|
content: {},
|
|
2337
2511
|
value: {}
|
|
2338
2512
|
},
|
|
2339
|
-
setup(
|
|
2340
|
-
const
|
|
2341
|
-
return (
|
|
2513
|
+
setup(a) {
|
|
2514
|
+
const o = a, s = ae(() => typeof o.content == "function" ? o.content(o.value) : o.content);
|
|
2515
|
+
return (t, n) => typeof s.value == "object" ? (m(), y(ee(s.value), { key: 0 })) : (m(), C("div", {
|
|
2342
2516
|
key: 1,
|
|
2343
|
-
innerHTML:
|
|
2344
|
-
}, null, 8,
|
|
2517
|
+
innerHTML: s.value
|
|
2518
|
+
}, null, 8, no));
|
|
2345
2519
|
}
|
|
2346
|
-
}),
|
|
2520
|
+
}), Te = /* @__PURE__ */ Q({
|
|
2347
2521
|
__name: "searchField",
|
|
2348
2522
|
props: {
|
|
2349
2523
|
item: {},
|
|
2350
2524
|
conf: {},
|
|
2351
2525
|
type: {}
|
|
2352
2526
|
},
|
|
2353
|
-
setup(
|
|
2354
|
-
const
|
|
2355
|
-
get: () =>
|
|
2356
|
-
set: (
|
|
2357
|
-
|
|
2527
|
+
setup(a) {
|
|
2528
|
+
const o = a, s = ae({
|
|
2529
|
+
get: () => o.conf.search.form?.[o.item?.key],
|
|
2530
|
+
set: (t) => {
|
|
2531
|
+
o.item?.key !== void 0 && (o.conf.search.form[o.item.key] = t);
|
|
2358
2532
|
}
|
|
2359
2533
|
});
|
|
2360
|
-
return (
|
|
2534
|
+
return (t, n) => i(q).customComponent[t.type ?? ""]?.search ? (m(), y(ee(i(q).customComponent[t.type ?? ""]?.search), S({
|
|
2361
2535
|
key: 0,
|
|
2362
|
-
modelValue:
|
|
2363
|
-
"onUpdate:modelValue":
|
|
2364
|
-
},
|
|
2536
|
+
modelValue: s.value,
|
|
2537
|
+
"onUpdate:modelValue": n[0] || (n[0] = (e) => s.value = e)
|
|
2538
|
+
}, t.item.options?.search?.[t.type ?? ""], $(t.item.options?.search?.[t.type ?? ""]?.on || {})), null, 16, ["modelValue"])) : t.type === "input" ? (m(), y(i(fe), S({
|
|
2365
2539
|
key: 1,
|
|
2366
|
-
modelValue:
|
|
2367
|
-
"onUpdate:modelValue":
|
|
2368
|
-
placeholder:
|
|
2540
|
+
modelValue: s.value,
|
|
2541
|
+
"onUpdate:modelValue": n[1] || (n[1] = (e) => s.value = e),
|
|
2542
|
+
placeholder: t.conf.search.getPlaceholder(t.item),
|
|
2369
2543
|
clearable: "",
|
|
2370
|
-
disabled:
|
|
2371
|
-
},
|
|
2544
|
+
disabled: t.item.disabled?.search
|
|
2545
|
+
}, t.item.options?.search?.input || t.item.options?.input, $(t.item.options?.search?.input?.on || t.item.options?.input?.on || {})), null, 16, ["modelValue", "placeholder", "disabled"])) : t.type === "switch" ? (m(), y(i(ce), S({
|
|
2372
2546
|
key: 2,
|
|
2373
|
-
modelValue:
|
|
2374
|
-
"onUpdate:modelValue":
|
|
2375
|
-
placeholder:
|
|
2547
|
+
modelValue: s.value,
|
|
2548
|
+
"onUpdate:modelValue": n[2] || (n[2] = (e) => s.value = e),
|
|
2549
|
+
placeholder: t.conf.search.getPlaceholder(t.item, i(k).tCurd("placeholderSelect")),
|
|
2376
2550
|
clearable: "",
|
|
2377
|
-
disabled:
|
|
2378
|
-
},
|
|
2379
|
-
default:
|
|
2380
|
-
(
|
|
2381
|
-
key:
|
|
2382
|
-
label:
|
|
2383
|
-
value:
|
|
2551
|
+
disabled: t.item.disabled?.search
|
|
2552
|
+
}, t.item.options?.search?.switch || t.item.options?.switch, $(t.item.options?.search?.switch?.on || t.item.options?.switch?.on || {})), {
|
|
2553
|
+
default: h(() => [
|
|
2554
|
+
(m(), y(i(ne), {
|
|
2555
|
+
key: t.item.options?.switch?.activeValue,
|
|
2556
|
+
label: t.item.options?.switch?.activeText,
|
|
2557
|
+
value: t.item.options?.switch?.activeValue
|
|
2384
2558
|
}, null, 8, ["label", "value"])),
|
|
2385
|
-
(
|
|
2386
|
-
key:
|
|
2387
|
-
label:
|
|
2388
|
-
value:
|
|
2559
|
+
(m(), y(i(ne), {
|
|
2560
|
+
key: t.item.options?.switch?.inactiveValue,
|
|
2561
|
+
label: t.item.options?.switch?.inactiveText,
|
|
2562
|
+
value: t.item.options?.switch?.inactiveValue
|
|
2389
2563
|
}, null, 8, ["label", "value"]))
|
|
2390
2564
|
]),
|
|
2391
2565
|
_: 1
|
|
2392
|
-
}, 16, ["modelValue", "placeholder", "disabled"])) :
|
|
2566
|
+
}, 16, ["modelValue", "placeholder", "disabled"])) : t.type === "select" ? (m(), y(i(ce), S({
|
|
2393
2567
|
key: 3,
|
|
2394
|
-
modelValue:
|
|
2395
|
-
"onUpdate:modelValue":
|
|
2396
|
-
placeholder:
|
|
2568
|
+
modelValue: s.value,
|
|
2569
|
+
"onUpdate:modelValue": n[3] || (n[3] = (e) => s.value = e),
|
|
2570
|
+
placeholder: t.conf.search.getPlaceholder(t.item, i(k).tCurd("placeholderSelect")),
|
|
2397
2571
|
clearable: "",
|
|
2398
|
-
disabled:
|
|
2399
|
-
},
|
|
2400
|
-
default:
|
|
2401
|
-
(
|
|
2402
|
-
key:
|
|
2403
|
-
label:
|
|
2404
|
-
value:
|
|
2572
|
+
disabled: t.item.disabled?.search
|
|
2573
|
+
}, t.item.options?.search?.select || t.item.options?.select, $(t.item.options?.search?.select?.on || t.item.options?.select?.on || {})), {
|
|
2574
|
+
default: h(() => [
|
|
2575
|
+
(m(!0), C(A, null, G(t.item.options?.search?.select?.data || t.item.options?.select?.data || [], (e) => (m(), y(i(ne), {
|
|
2576
|
+
key: e.value,
|
|
2577
|
+
label: e.label,
|
|
2578
|
+
value: e.value
|
|
2405
2579
|
}, null, 8, ["label", "value"]))), 128))
|
|
2406
2580
|
]),
|
|
2407
2581
|
_: 1
|
|
2408
|
-
}, 16, ["modelValue", "placeholder", "disabled"])) :
|
|
2582
|
+
}, 16, ["modelValue", "placeholder", "disabled"])) : t.type === "radio" ? (m(), y(i(je), S({
|
|
2409
2583
|
key: 4,
|
|
2410
|
-
modelValue:
|
|
2411
|
-
"onUpdate:modelValue":
|
|
2412
|
-
disabled:
|
|
2413
|
-
},
|
|
2414
|
-
default:
|
|
2415
|
-
(
|
|
2416
|
-
key:
|
|
2417
|
-
label:
|
|
2418
|
-
value:
|
|
2584
|
+
modelValue: s.value,
|
|
2585
|
+
"onUpdate:modelValue": n[4] || (n[4] = (e) => s.value = e),
|
|
2586
|
+
disabled: t.item.disabled?.search
|
|
2587
|
+
}, t.item.options?.search?.radio || t.item.options?.radio, $(t.item.options?.search?.radio?.on || t.item.options?.radio?.on || {})), {
|
|
2588
|
+
default: h(() => [
|
|
2589
|
+
(m(!0), C(A, null, G(t.item.options?.radio?.data, (e) => (m(), y(i(Pe), {
|
|
2590
|
+
key: e.value,
|
|
2591
|
+
label: e.label,
|
|
2592
|
+
value: e.value
|
|
2419
2593
|
}, null, 8, ["label", "value"]))), 128))
|
|
2420
2594
|
]),
|
|
2421
2595
|
_: 1
|
|
2422
|
-
}, 16, ["modelValue", "disabled"])) :
|
|
2596
|
+
}, 16, ["modelValue", "disabled"])) : t.type === "datetime" ? (m(), y(i(Ke), S({
|
|
2423
2597
|
key: 5,
|
|
2424
|
-
modelValue:
|
|
2425
|
-
"onUpdate:modelValue":
|
|
2426
|
-
disabled:
|
|
2427
|
-
},
|
|
2598
|
+
modelValue: s.value,
|
|
2599
|
+
"onUpdate:modelValue": n[5] || (n[5] = (e) => s.value = e),
|
|
2600
|
+
disabled: t.item.disabled?.search
|
|
2601
|
+
}, t.item.options?.search?.datetime || t.item.options?.datetime, $(t.item.options?.search?.datetime?.on || t.item.options?.datetime?.on || {})), null, 16, ["modelValue", "disabled"])) : t.type && i(q).customComponent[t.type] ? (m(), y(ee(i(q).customComponent[t.type]), S({
|
|
2428
2602
|
key: 6,
|
|
2429
|
-
modelValue:
|
|
2430
|
-
"onUpdate:modelValue":
|
|
2431
|
-
},
|
|
2432
|
-
disabled:
|
|
2603
|
+
modelValue: s.value,
|
|
2604
|
+
"onUpdate:modelValue": n[6] || (n[6] = (e) => s.value = e)
|
|
2605
|
+
}, t.item.options?.search?.[t.type] || t.item.options?.[t.type], $(t.item.options?.search?.[t.type]?.on || t.item.options?.[t.type]?.on || {}), {
|
|
2606
|
+
disabled: t.item.disabled?.search
|
|
2433
2607
|
}), null, 16, ["modelValue", "disabled"])) : V("", !0);
|
|
2434
2608
|
}
|
|
2435
|
-
}), se = (
|
|
2436
|
-
const
|
|
2437
|
-
for (const [
|
|
2438
|
-
|
|
2439
|
-
return
|
|
2440
|
-
},
|
|
2609
|
+
}), se = (a, o) => {
|
|
2610
|
+
const s = a.__vccOpts || a;
|
|
2611
|
+
for (const [t, n] of o)
|
|
2612
|
+
s[t] = n;
|
|
2613
|
+
return s;
|
|
2614
|
+
}, ro = {}, io = {
|
|
2441
2615
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2442
2616
|
viewBox: "64 64 896 896"
|
|
2443
2617
|
};
|
|
2444
|
-
function
|
|
2445
|
-
return
|
|
2446
|
-
|
|
2618
|
+
function so(a, o) {
|
|
2619
|
+
return m(), C("svg", io, o[0] || (o[0] = [
|
|
2620
|
+
D("path", {
|
|
2447
2621
|
fill: "currentColor",
|
|
2448
2622
|
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"
|
|
2449
2623
|
}, null, -1)
|
|
2450
|
-
])
|
|
2624
|
+
]));
|
|
2451
2625
|
}
|
|
2452
|
-
const
|
|
2626
|
+
const uo = /* @__PURE__ */ se(ro, [["render", so]]), fo = {}, co = {
|
|
2453
2627
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2454
2628
|
viewBox: "64 64 896 896"
|
|
2455
2629
|
};
|
|
2456
|
-
function
|
|
2457
|
-
return
|
|
2458
|
-
|
|
2630
|
+
function po(a, o) {
|
|
2631
|
+
return m(), C("svg", co, o[0] || (o[0] = [
|
|
2632
|
+
D("path", {
|
|
2459
2633
|
fill: "currentColor",
|
|
2460
2634
|
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"
|
|
2461
2635
|
}, null, -1)
|
|
2462
|
-
])
|
|
2636
|
+
]));
|
|
2463
2637
|
}
|
|
2464
|
-
const
|
|
2638
|
+
const mo = /* @__PURE__ */ se(fo, [["render", po]]), bo = {}, go = {
|
|
2465
2639
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2466
2640
|
viewBox: "0 0 1024 1024"
|
|
2467
2641
|
};
|
|
2468
|
-
function ho(
|
|
2469
|
-
return
|
|
2470
|
-
|
|
2642
|
+
function ho(a, o) {
|
|
2643
|
+
return m(), C("svg", go, o[0] || (o[0] = [
|
|
2644
|
+
D("path", {
|
|
2471
2645
|
fill: "currentColor",
|
|
2472
2646
|
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"
|
|
2473
2647
|
}, null, -1)
|
|
2474
|
-
])
|
|
2648
|
+
]));
|
|
2475
2649
|
}
|
|
2476
|
-
const yo = /* @__PURE__ */ se(
|
|
2650
|
+
const yo = /* @__PURE__ */ se(bo, [["render", ho]]), wo = {}, vo = {
|
|
2477
2651
|
"data-v-58697b5c": "",
|
|
2478
2652
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2479
2653
|
viewBox: "0 0 1024 1024"
|
|
2480
2654
|
};
|
|
2481
|
-
function
|
|
2482
|
-
return
|
|
2483
|
-
|
|
2655
|
+
function ko(a, o) {
|
|
2656
|
+
return m(), C("svg", vo, o[0] || (o[0] = [
|
|
2657
|
+
D("path", {
|
|
2484
2658
|
fill: "currentColor",
|
|
2485
2659
|
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"
|
|
2486
2660
|
}, null, -1)
|
|
2487
|
-
])
|
|
2661
|
+
]));
|
|
2488
2662
|
}
|
|
2489
|
-
const
|
|
2663
|
+
const rt = /* @__PURE__ */ se(wo, [["render", ko]]), Co = {}, Vo = {
|
|
2490
2664
|
"data-v-58697b5c": "",
|
|
2491
2665
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2492
2666
|
viewBox: "0 0 1024 1024"
|
|
2493
2667
|
};
|
|
2494
|
-
function
|
|
2495
|
-
return
|
|
2496
|
-
|
|
2668
|
+
function So(a, o) {
|
|
2669
|
+
return m(), C("svg", Vo, o[0] || (o[0] = [
|
|
2670
|
+
D("path", {
|
|
2497
2671
|
fill: "currentColor",
|
|
2498
2672
|
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"
|
|
2499
2673
|
}, null, -1)
|
|
2500
|
-
])
|
|
2674
|
+
]));
|
|
2501
2675
|
}
|
|
2502
|
-
const
|
|
2676
|
+
const Eo = /* @__PURE__ */ se(Co, [["render", So]]), zo = {}, $o = {
|
|
2503
2677
|
"data-v-58697b5c": "",
|
|
2504
2678
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2505
2679
|
viewBox: "0 0 1024 1024"
|
|
2506
2680
|
};
|
|
2507
|
-
function
|
|
2508
|
-
return
|
|
2509
|
-
|
|
2681
|
+
function Oo(a, o) {
|
|
2682
|
+
return m(), C("svg", $o, o[0] || (o[0] = [
|
|
2683
|
+
D("path", {
|
|
2510
2684
|
fill: "currentColor",
|
|
2511
2685
|
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"
|
|
2512
2686
|
}, null, -1)
|
|
2513
|
-
])
|
|
2687
|
+
]));
|
|
2514
2688
|
}
|
|
2515
|
-
const
|
|
2689
|
+
const Mo = /* @__PURE__ */ se(zo, [["render", Oo]]), Fo = { class: "row flex-center table-header-label inline" }, Ro = { class: "table-header-tooltip" }, Do = ["innerHTML"], Uo = {
|
|
2516
2690
|
key: 1,
|
|
2517
2691
|
class: "table-header-required"
|
|
2518
|
-
},
|
|
2692
|
+
}, Ao = ["onClick"], Bo = {
|
|
2519
2693
|
key: 0,
|
|
2520
2694
|
class: "table-edit-form"
|
|
2521
|
-
},
|
|
2695
|
+
}, Lo = { key: 1 }, To = ["onClick", "innerHTML"], jo = /* @__PURE__ */ Q({
|
|
2522
2696
|
__name: "tableColumn",
|
|
2523
2697
|
props: {
|
|
2524
2698
|
conf: {},
|
|
2525
2699
|
columnList: {},
|
|
2526
2700
|
option: {}
|
|
2527
2701
|
},
|
|
2528
|
-
setup(
|
|
2529
|
-
const
|
|
2530
|
-
return (
|
|
2531
|
-
const
|
|
2532
|
-
return
|
|
2702
|
+
setup(a) {
|
|
2703
|
+
const o = z.isFun, s = a, n = Ge().type, e = (l) => l === !0 ? !0 : (Array.isArray(l) ? l : l ? [l] : []).some((f) => f?.required === !0), r = (l) => s.option.table?.editMode ? e(l.rules) || e(s.conf.update.rules?.[l.key]) : !1;
|
|
2704
|
+
return (l, u) => {
|
|
2705
|
+
const f = pe("el-tooltip");
|
|
2706
|
+
return m(!0), C(A, null, G(l.columnList, (d) => (m(), C(A, {
|
|
2533
2707
|
key: d.key
|
|
2534
2708
|
}, [
|
|
2535
|
-
|
|
2536
|
-
d.table?.header?.groupKey === void 0 || d.table.header.show ? (
|
|
2709
|
+
l.conf.table.column.show.list.includes(d.key) && (d.show?.table === void 0 || i(o)(d.show?.table, l.conf.table.data)) ? (m(), C(A, { key: 0 }, [
|
|
2710
|
+
d.table?.header?.groupKey === void 0 || d.table.header.show ? (m(), y(i(ue), S({
|
|
2537
2711
|
key: 0,
|
|
2538
2712
|
prop: d.key,
|
|
2539
|
-
label: d.label
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2713
|
+
label: d.label,
|
|
2714
|
+
ref_for: !0
|
|
2715
|
+
}, d.table), {
|
|
2716
|
+
header: h(() => [
|
|
2717
|
+
E(l.$slots, "table-header-" + d.key, { item: d }, () => [
|
|
2718
|
+
D("div", Fo, [
|
|
2719
|
+
d.table?.header?.tooltip ? (m(), y(f, {
|
|
2545
2720
|
key: 0,
|
|
2546
2721
|
effect: "dark",
|
|
2547
2722
|
placement: "top"
|
|
2548
2723
|
}, {
|
|
2549
|
-
content:
|
|
2550
|
-
|
|
2724
|
+
content: h(() => [
|
|
2725
|
+
D("div", {
|
|
2551
2726
|
innerHTML: d.table?.header?.tooltip
|
|
2552
2727
|
}, null, 8, Do)
|
|
2553
2728
|
]),
|
|
2554
|
-
default:
|
|
2555
|
-
|
|
2556
|
-
|
|
2729
|
+
default: h(() => [
|
|
2730
|
+
D("span", Ro, [
|
|
2731
|
+
O(rt)
|
|
2557
2732
|
])
|
|
2558
2733
|
]),
|
|
2559
2734
|
_: 2
|
|
2560
2735
|
}, 1024)) : V("", !0),
|
|
2561
|
-
|
|
2562
|
-
M(" " +
|
|
2563
|
-
d.table?.header?.group !== void 0 ? (
|
|
2736
|
+
r(d) ? (m(), C("span", Uo, "*")) : V("", !0),
|
|
2737
|
+
M(" " + R(d.label) + " ", 1),
|
|
2738
|
+
d.table?.header?.group !== void 0 ? (m(), C("span", {
|
|
2564
2739
|
key: 2,
|
|
2565
2740
|
class: "table-header-plus",
|
|
2566
|
-
onClick:
|
|
2741
|
+
onClick: wt(
|
|
2567
2742
|
() => {
|
|
2568
|
-
d.table.header.group = !d.table.header.group,
|
|
2569
|
-
|
|
2743
|
+
d.table.header.group = !d.table.header.group, l.columnList.forEach((b) => {
|
|
2744
|
+
b.table?.header?.groupKey === d.key && (b.table.header.show = !d.table.header.group);
|
|
2570
2745
|
});
|
|
2571
2746
|
},
|
|
2572
2747
|
["stop"]
|
|
2573
2748
|
)
|
|
2574
2749
|
}, [
|
|
2575
|
-
d.table.header.group ? (
|
|
2576
|
-
], 8,
|
|
2750
|
+
d.table.header.group ? (m(), y(Eo, { key: 0 })) : (m(), y(Mo, { key: 1 }))
|
|
2751
|
+
], 8, Ao)) : V("", !0)
|
|
2577
2752
|
])
|
|
2578
2753
|
])
|
|
2579
2754
|
]),
|
|
2580
|
-
default:
|
|
2581
|
-
d.children ? (
|
|
2582
|
-
|
|
2583
|
-
(
|
|
2584
|
-
conf:
|
|
2755
|
+
default: h(({ row: b }) => [
|
|
2756
|
+
d.children ? (m(), C(A, { key: 0 }, [
|
|
2757
|
+
u[0] || (u[0] = M(" ")),
|
|
2758
|
+
(m(), y(ee(i(n)), {
|
|
2759
|
+
conf: l.conf,
|
|
2585
2760
|
columnList: d.children,
|
|
2586
|
-
option:
|
|
2587
|
-
},
|
|
2588
|
-
|
|
2589
|
-
name:
|
|
2590
|
-
fn:
|
|
2591
|
-
|
|
2761
|
+
option: l.option
|
|
2762
|
+
}, Z({ _: 2 }, [
|
|
2763
|
+
G(l.$slots, (c, p) => ({
|
|
2764
|
+
name: p,
|
|
2765
|
+
fn: h((w) => [
|
|
2766
|
+
E(l.$slots, p, S({ ref_for: !0 }, w || {}))
|
|
2592
2767
|
])
|
|
2593
2768
|
}))
|
|
2594
2769
|
]), 1032, ["conf", "columnList", "option"]))
|
|
2595
|
-
], 64)) : (
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
size:
|
|
2599
|
-
error:
|
|
2770
|
+
], 64)) : (m(), C(A, { key: 1 }, [
|
|
2771
|
+
l.option.table?.editMode ? (m(), C("div", Bo, [
|
|
2772
|
+
O(i(he), {
|
|
2773
|
+
size: l.option.size?.table,
|
|
2774
|
+
error: l.conf.tableEditValidate.getFieldError(b, d),
|
|
2600
2775
|
class: "table-edit-form-item"
|
|
2601
2776
|
}, {
|
|
2602
|
-
default:
|
|
2603
|
-
|
|
2777
|
+
default: h(() => [
|
|
2778
|
+
D("div", {
|
|
2604
2779
|
class: J(["row", ["table-edit-" + d.key]]),
|
|
2605
2780
|
style: { width: "100%" }
|
|
2606
2781
|
}, [
|
|
2607
|
-
|
|
2608
|
-
row:
|
|
2782
|
+
E(l.$slots, "table-edit-left-" + d.key, {
|
|
2783
|
+
row: b,
|
|
2609
2784
|
item: d
|
|
2610
2785
|
}),
|
|
2611
|
-
d.type === "input" ? (
|
|
2786
|
+
d.type === "input" ? (m(), y(i(fe), S({
|
|
2612
2787
|
key: 0,
|
|
2613
|
-
modelValue:
|
|
2614
|
-
"onUpdate:modelValue": (
|
|
2615
|
-
disabled:
|
|
2616
|
-
class: "col"
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2788
|
+
modelValue: b[d.key],
|
|
2789
|
+
"onUpdate:modelValue": (c) => b[d.key] = c,
|
|
2790
|
+
disabled: l.conf.update.getDisabled(d, !0),
|
|
2791
|
+
class: "col",
|
|
2792
|
+
ref_for: !0
|
|
2793
|
+
}, l.conf.update.getBind(d), $(l.conf.update.getOn(d, b)), {
|
|
2794
|
+
"onUpdate:modelValue": (c) => l.conf.tableEditValidate.clearField(b, d)
|
|
2795
|
+
}), Z({ _: 2 }, [
|
|
2620
2796
|
d.options?.input?.prepend ? {
|
|
2621
2797
|
name: "prepend",
|
|
2622
|
-
fn:
|
|
2623
|
-
M(
|
|
2798
|
+
fn: h(() => [
|
|
2799
|
+
M(R(typeof d.options?.input?.prepend == "function" ? d.options?.input?.prepend(b) : d.options?.input?.prepend), 1)
|
|
2624
2800
|
]),
|
|
2625
2801
|
key: "0"
|
|
2626
2802
|
} : void 0
|
|
2627
|
-
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : d.type === "select" ? (
|
|
2803
|
+
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : d.type === "select" ? (m(), y(i(ce), S({
|
|
2628
2804
|
key: 1,
|
|
2629
|
-
modelValue:
|
|
2630
|
-
"onUpdate:modelValue": (
|
|
2631
|
-
disabled:
|
|
2632
|
-
class: "col"
|
|
2633
|
-
|
|
2634
|
-
|
|
2805
|
+
modelValue: b[d.key],
|
|
2806
|
+
"onUpdate:modelValue": (c) => b[d.key] = c,
|
|
2807
|
+
disabled: l.conf.update.getDisabled(d, !0),
|
|
2808
|
+
class: "col",
|
|
2809
|
+
ref_for: !0
|
|
2810
|
+
}, l.conf.update.getBind(d), $(l.conf.update.getOn(d, b)), {
|
|
2811
|
+
"onUpdate:modelValue": (c) => l.conf.tableEditValidate.clearField(b, d)
|
|
2635
2812
|
}), {
|
|
2636
|
-
default:
|
|
2637
|
-
(
|
|
2638
|
-
key:
|
|
2639
|
-
label:
|
|
2640
|
-
value:
|
|
2813
|
+
default: h(() => [
|
|
2814
|
+
(m(!0), C(A, null, G(d.options?.search?.select?.data || d.options?.select?.data, (c) => (m(), y(i(ne), {
|
|
2815
|
+
key: c.value,
|
|
2816
|
+
label: c.label,
|
|
2817
|
+
value: c.value
|
|
2641
2818
|
}, null, 8, ["label", "value"]))), 128))
|
|
2642
2819
|
]),
|
|
2643
2820
|
_: 2
|
|
2644
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : d.type === "switch" ? (
|
|
2821
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : d.type === "switch" ? (m(), y(i(ge), S({
|
|
2645
2822
|
key: 2,
|
|
2646
|
-
modelValue:
|
|
2647
|
-
"onUpdate:modelValue": (
|
|
2648
|
-
disabled:
|
|
2649
|
-
class: "col"
|
|
2650
|
-
|
|
2651
|
-
|
|
2823
|
+
modelValue: b[d.key],
|
|
2824
|
+
"onUpdate:modelValue": (c) => b[d.key] = c,
|
|
2825
|
+
disabled: l.conf.update.getDisabled(d, !0),
|
|
2826
|
+
class: "col",
|
|
2827
|
+
ref_for: !0
|
|
2828
|
+
}, l.conf.update.getBind(d), $(l.conf.update.getOn(d, b)), {
|
|
2829
|
+
"onUpdate:modelValue": (c) => l.conf.tableEditValidate.clearField(b, d)
|
|
2652
2830
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : V("", !0),
|
|
2653
|
-
|
|
2654
|
-
row:
|
|
2831
|
+
E(l.$slots, "table-edit-right-" + d.key, {
|
|
2832
|
+
row: b,
|
|
2655
2833
|
item: d
|
|
2656
2834
|
})
|
|
2657
2835
|
], 2)
|
|
2658
2836
|
]),
|
|
2659
2837
|
_: 2
|
|
2660
2838
|
}, 1032, ["size", "error"])
|
|
2661
|
-
])) : (
|
|
2662
|
-
|
|
2663
|
-
d.type === "input" ? (
|
|
2839
|
+
])) : (m(), C(A, { key: 1 }, [
|
|
2840
|
+
l.conf.update.type === i(z).EDialog.Update && i(o)(d.show?.form, l.conf.update.form, i(z).EDialog.Update) && l.option.table?.inlineEdit && l.conf.update.form[l.option.table?.rowKey] === b[l.option.table?.rowKey] && (d.type === "input" || d.type === "select") ? (m(), C(A, { key: 0 }, [
|
|
2841
|
+
d.type === "input" ? (m(), y(i(fe), S({
|
|
2664
2842
|
key: 0,
|
|
2665
|
-
modelValue:
|
|
2666
|
-
"onUpdate:modelValue": (
|
|
2667
|
-
disabled:
|
|
2668
|
-
|
|
2843
|
+
modelValue: l.conf.update.form[d.key],
|
|
2844
|
+
"onUpdate:modelValue": (c) => l.conf.update.form[d.key] = c,
|
|
2845
|
+
disabled: l.conf.update.getDisabled(d, !0),
|
|
2846
|
+
ref_for: !0
|
|
2847
|
+
}, l.conf.update.getBind(d), $(l.conf.update.getOn(d, b)), { style: { width: "100%" } }), Z({ _: 2 }, [
|
|
2669
2848
|
d.options?.input?.prepend ? {
|
|
2670
2849
|
name: "prepend",
|
|
2671
|
-
fn:
|
|
2672
|
-
M(
|
|
2850
|
+
fn: h(() => [
|
|
2851
|
+
M(R(typeof d.options?.input?.prepend == "function" ? d.options?.input?.prepend(b) : d.options?.input?.prepend), 1)
|
|
2673
2852
|
]),
|
|
2674
2853
|
key: "0"
|
|
2675
2854
|
} : void 0
|
|
2676
|
-
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : d.type === "select" ? (
|
|
2855
|
+
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : d.type === "select" ? (m(), y(i(ce), S({
|
|
2677
2856
|
key: 1,
|
|
2678
|
-
modelValue:
|
|
2679
|
-
"onUpdate:modelValue": (
|
|
2680
|
-
disabled:
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2857
|
+
modelValue: l.conf.update.form[d.key],
|
|
2858
|
+
"onUpdate:modelValue": (c) => l.conf.update.form[d.key] = c,
|
|
2859
|
+
disabled: l.conf.update.getDisabled(d, !0),
|
|
2860
|
+
ref_for: !0
|
|
2861
|
+
}, l.conf.update.getBind(d), $(l.conf.update.getOn(d, b)), { style: { width: "100%" } }), {
|
|
2862
|
+
default: h(() => [
|
|
2863
|
+
(m(!0), C(A, null, G(d.options?.search?.select?.data || d.options?.select?.data, (c) => (m(), y(i(ne), {
|
|
2864
|
+
key: c.value,
|
|
2865
|
+
label: c.label,
|
|
2866
|
+
value: c.value
|
|
2687
2867
|
}, null, 8, ["label", "value"]))), 128))
|
|
2688
2868
|
]),
|
|
2689
2869
|
_: 2
|
|
2690
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : d.type === "switch" ? (
|
|
2870
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : d.type === "switch" ? (m(), y(i(ge), S({
|
|
2691
2871
|
key: 2,
|
|
2692
|
-
modelValue:
|
|
2693
|
-
"onUpdate:modelValue": (
|
|
2694
|
-
|
|
2695
|
-
|
|
2872
|
+
modelValue: l.conf.update.form[d.key],
|
|
2873
|
+
"onUpdate:modelValue": (c) => l.conf.update.form[d.key] = c,
|
|
2874
|
+
ref_for: !0
|
|
2875
|
+
}, l.conf.update.getBind(d), $(l.conf.update.getOn(d, b)), {
|
|
2876
|
+
disabled: l.conf.update.getDisabled(d, !0)
|
|
2696
2877
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : V("", !0)
|
|
2697
|
-
], 64)) :
|
|
2878
|
+
], 64)) : E(l.$slots, "table-" + d.key, {
|
|
2698
2879
|
key: 1,
|
|
2699
|
-
row:
|
|
2880
|
+
row: b,
|
|
2700
2881
|
item: d
|
|
2701
2882
|
}, () => [
|
|
2702
|
-
|
|
2883
|
+
i(q).customComponent[d.type ?? ""]?.table ? (m(), y(ee(i(q).customComponent[d.type ?? ""]?.table), S({
|
|
2703
2884
|
key: 0,
|
|
2704
|
-
modelValue:
|
|
2705
|
-
"onUpdate:modelValue": (
|
|
2706
|
-
|
|
2707
|
-
|
|
2885
|
+
modelValue: b[d.key],
|
|
2886
|
+
"onUpdate:modelValue": (c) => b[d.key] = c,
|
|
2887
|
+
ref_for: !0
|
|
2888
|
+
}, d.options?.[d.type ?? ""], $(d.options?.[d.type ?? ""]?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue"])) : d.type === "switch" ? (m(), C(A, { key: 1 }, [
|
|
2889
|
+
d.options?.switch?.tableConfig?.change ? (m(), y(i(ge), S({
|
|
2708
2890
|
key: 0,
|
|
2709
|
-
modelValue:
|
|
2710
|
-
"onUpdate:modelValue": (
|
|
2711
|
-
loading: d.options?.switch?.loadingMap?.[
|
|
2712
|
-
"before-change": () => d.options?.switch?.tableBeforeChange?.(d.key,
|
|
2713
|
-
|
|
2714
|
-
|
|
2891
|
+
modelValue: b[d.key],
|
|
2892
|
+
"onUpdate:modelValue": (c) => b[d.key] = c,
|
|
2893
|
+
loading: d.options?.switch?.loadingMap?.[b[l.option.table?.rowKey]]?.loading,
|
|
2894
|
+
"before-change": () => d.options?.switch?.tableBeforeChange?.(d.key, b),
|
|
2895
|
+
ref_for: !0
|
|
2896
|
+
}, d.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "loading", "before-change"])) : (m(), C("span", Lo, R(b[d.key] === d.options?.switch?.activeValue ? d.options?.switch?.activeText : d.options?.switch?.inactiveText), 1))
|
|
2897
|
+
], 64)) : (m(), C("span", {
|
|
2715
2898
|
key: 2,
|
|
2716
|
-
style:
|
|
2899
|
+
style: ye({
|
|
2717
2900
|
"--table-text-click-color": d.table?.click?.color
|
|
2718
2901
|
}),
|
|
2719
2902
|
class: J({ "table-text-click": d.table?.click?.callback }),
|
|
2720
|
-
onClick: (
|
|
2721
|
-
innerHTML: d.table?.format ? d.table?.format(
|
|
2722
|
-
}, null, 14,
|
|
2903
|
+
onClick: (c) => d.table?.click?.callback?.(b),
|
|
2904
|
+
innerHTML: d.table?.format ? d.table?.format(b) : b[d.key]
|
|
2905
|
+
}, null, 14, To))
|
|
2723
2906
|
])
|
|
2724
2907
|
], 64))
|
|
2725
2908
|
], 64))
|
|
@@ -2730,19 +2913,19 @@ const zo = /* @__PURE__ */ se(So, [["render", $o]]), Mo = { class: "row flex-cen
|
|
|
2730
2913
|
], 64))), 128);
|
|
2731
2914
|
};
|
|
2732
2915
|
}
|
|
2733
|
-
}),
|
|
2916
|
+
}), Po = {
|
|
2734
2917
|
key: 0,
|
|
2735
2918
|
class: "relative curd-search fit-width"
|
|
2736
|
-
},
|
|
2919
|
+
}, Ko = { class: "mb-10 flex justify-between items-center fit-width" }, Ho = {
|
|
2737
2920
|
class: "flex items-center",
|
|
2738
2921
|
style: { gap: "10px" }
|
|
2739
|
-
},
|
|
2922
|
+
}, No = { key: 0 }, Io = { key: 1 }, Go = { key: 2 }, Wo = { class: "export-btn" }, qo = {
|
|
2740
2923
|
key: 1,
|
|
2741
2924
|
class: "export-btn"
|
|
2742
|
-
},
|
|
2925
|
+
}, Jo = {
|
|
2743
2926
|
class: "flex items-center table-tools-right",
|
|
2744
2927
|
style: { gap: "10px" }
|
|
2745
|
-
},
|
|
2928
|
+
}, Qo = { class: "table-sortable-tooltip" }, Xo = ["innerHTML"], Yo = { class: "row justify-end mt-10 mb-10 table-bottom-pagination" }, Zo = { class: "dialog-footer" }, xo = { key: 0 }, _o = { key: 1 }, ea = { class: "dialog-footer" }, ta = /* @__PURE__ */ Q({
|
|
2746
2929
|
__name: "index",
|
|
2747
2930
|
props: {
|
|
2748
2931
|
/**
|
|
@@ -2764,178 +2947,178 @@ const zo = /* @__PURE__ */ se(So, [["render", $o]]), Mo = { class: "row flex-cen
|
|
|
2764
2947
|
default: void 0
|
|
2765
2948
|
}
|
|
2766
2949
|
},
|
|
2767
|
-
setup(
|
|
2768
|
-
const
|
|
2769
|
-
return
|
|
2770
|
-
conf:
|
|
2771
|
-
}), (
|
|
2772
|
-
const
|
|
2773
|
-
return
|
|
2774
|
-
class: J(["relative cc1-form-box", [
|
|
2950
|
+
setup(a, { expose: o }) {
|
|
2951
|
+
const s = z.EDialog, t = a, n = z.isFun, { conf: e, switchConfirmRef: r, ruleFormRef: l, tableRef: u } = to(t);
|
|
2952
|
+
return o({
|
|
2953
|
+
conf: e
|
|
2954
|
+
}), (f, d) => {
|
|
2955
|
+
const b = pe("el-tooltip"), c = vt("loading");
|
|
2956
|
+
return m(), C("div", {
|
|
2957
|
+
class: J(["relative cc1-form-box", [a.option.table?.fitHeight ? "col" : "no-min-height"]])
|
|
2775
2958
|
}, [
|
|
2776
|
-
|
|
2777
|
-
class: J(["row", [
|
|
2959
|
+
D("div", {
|
|
2960
|
+
class: J(["row", [a.option.table?.fitHeight ? "absolute fit" : ""]]),
|
|
2778
2961
|
style: { overflow: "hidden" }
|
|
2779
2962
|
}, [
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
class: J(["column fit-width no-wrap", [
|
|
2963
|
+
E(f.$slots, "box-left"),
|
|
2964
|
+
D("div", {
|
|
2965
|
+
class: J(["column fit-width no-wrap", [a.option.table?.fitHeight ? "col" : ""]])
|
|
2783
2966
|
}, [
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
model:
|
|
2967
|
+
a.option.search?.show !== !1 ? (m(), C("div", Po, [
|
|
2968
|
+
O(i(oe), {
|
|
2969
|
+
model: i(e).search.form,
|
|
2787
2970
|
inline: "",
|
|
2788
|
-
size:
|
|
2971
|
+
size: a.option.size?.search
|
|
2789
2972
|
}, {
|
|
2790
|
-
default:
|
|
2791
|
-
|
|
2792
|
-
row:
|
|
2973
|
+
default: h(() => [
|
|
2974
|
+
E(f.$slots, "search-start", {
|
|
2975
|
+
row: i(e).search.form
|
|
2793
2976
|
}),
|
|
2794
|
-
(
|
|
2795
|
-
key:
|
|
2977
|
+
(m(!0), C(A, null, G(i(e).search.column.list, (p) => (m(), C(A, {
|
|
2978
|
+
key: p.key
|
|
2796
2979
|
}, [
|
|
2797
|
-
|
|
2798
|
-
row:
|
|
2980
|
+
E(f.$slots, "search-" + p.key + "-start", {
|
|
2981
|
+
row: i(e).search.form
|
|
2799
2982
|
}),
|
|
2800
|
-
(typeof
|
|
2983
|
+
(typeof p.show?.search == "function" ? p.show?.search(i(e).search.form) : p.show?.search) ? (m(), y(i(he), {
|
|
2801
2984
|
key: 0,
|
|
2802
|
-
label:
|
|
2985
|
+
label: p.text?.search?.label ?? p.label
|
|
2803
2986
|
}, {
|
|
2804
|
-
default:
|
|
2805
|
-
|
|
2806
|
-
row:
|
|
2987
|
+
default: h(() => [
|
|
2988
|
+
E(f.$slots, "search-" + p.key + "-left", {
|
|
2989
|
+
row: i(e).search.form
|
|
2807
2990
|
}),
|
|
2808
|
-
|
|
2809
|
-
row:
|
|
2991
|
+
E(f.$slots, "search-" + p.key, {
|
|
2992
|
+
row: i(e).search.form
|
|
2810
2993
|
}, () => [
|
|
2811
|
-
|
|
2994
|
+
p.options?.search?.type ? (m(), y(Te, {
|
|
2812
2995
|
key: 0,
|
|
2813
|
-
item:
|
|
2814
|
-
conf:
|
|
2815
|
-
type:
|
|
2816
|
-
}, null, 8, ["item", "conf", "type"])) : (
|
|
2996
|
+
item: p,
|
|
2997
|
+
conf: i(e),
|
|
2998
|
+
type: p.options.search.type
|
|
2999
|
+
}, null, 8, ["item", "conf", "type"])) : (m(), y(Te, {
|
|
2817
3000
|
key: 1,
|
|
2818
|
-
item:
|
|
2819
|
-
conf:
|
|
2820
|
-
type:
|
|
3001
|
+
item: p,
|
|
3002
|
+
conf: i(e),
|
|
3003
|
+
type: p.type
|
|
2821
3004
|
}, null, 8, ["item", "conf", "type"]))
|
|
2822
3005
|
]),
|
|
2823
|
-
|
|
2824
|
-
row:
|
|
3006
|
+
E(f.$slots, "search-" + p.key + "-right", {
|
|
3007
|
+
row: i(e).search.form
|
|
2825
3008
|
})
|
|
2826
3009
|
]),
|
|
2827
3010
|
_: 2
|
|
2828
3011
|
}, 1032, ["label"])) : V("", !0),
|
|
2829
|
-
|
|
2830
|
-
row:
|
|
3012
|
+
E(f.$slots, "search-" + p.key + "-end", {
|
|
3013
|
+
row: i(e).search.form
|
|
2831
3014
|
})
|
|
2832
3015
|
], 64))), 128)),
|
|
2833
|
-
|
|
2834
|
-
row:
|
|
3016
|
+
E(f.$slots, "search-center", {
|
|
3017
|
+
row: i(e).search.form
|
|
2835
3018
|
}),
|
|
2836
|
-
|
|
2837
|
-
default:
|
|
2838
|
-
|
|
3019
|
+
a.option.tools?.search || a.option.tools?.reset ? (m(), y(i(he), { key: 0 }, {
|
|
3020
|
+
default: h(() => [
|
|
3021
|
+
a.option.tools?.search ? (m(), y(i(K), {
|
|
2839
3022
|
key: 0,
|
|
2840
3023
|
type: "primary",
|
|
2841
|
-
onClick:
|
|
3024
|
+
onClick: i(e).search.submit
|
|
2842
3025
|
}, {
|
|
2843
|
-
default:
|
|
2844
|
-
M(
|
|
3026
|
+
default: h(() => [
|
|
3027
|
+
M(R(i(k).tCurd("search")), 1)
|
|
2845
3028
|
]),
|
|
2846
3029
|
_: 1
|
|
2847
3030
|
}, 8, ["onClick"])) : V("", !0),
|
|
2848
|
-
|
|
3031
|
+
a.option.tools?.reset ? (m(), y(i(K), {
|
|
2849
3032
|
key: 1,
|
|
2850
|
-
onClick:
|
|
3033
|
+
onClick: i(e).search.reset
|
|
2851
3034
|
}, {
|
|
2852
|
-
default:
|
|
2853
|
-
M(
|
|
3035
|
+
default: h(() => [
|
|
3036
|
+
M(R(i(k).tCurd("reset")), 1)
|
|
2854
3037
|
]),
|
|
2855
3038
|
_: 1
|
|
2856
3039
|
}, 8, ["onClick"])) : V("", !0)
|
|
2857
3040
|
]),
|
|
2858
3041
|
_: 1
|
|
2859
3042
|
})) : V("", !0),
|
|
2860
|
-
|
|
2861
|
-
row:
|
|
3043
|
+
E(f.$slots, "search-end", {
|
|
3044
|
+
row: i(e).search.form
|
|
2862
3045
|
})
|
|
2863
3046
|
]),
|
|
2864
3047
|
_: 3
|
|
2865
3048
|
}, 8, ["model", "size"])
|
|
2866
3049
|
])) : V("", !0),
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
3050
|
+
D("div", Ko, [
|
|
3051
|
+
D("div", Ho, [
|
|
3052
|
+
i(n)(a.option.tools?.add) ? (m(), C("div", No, [
|
|
3053
|
+
O(i(K), {
|
|
2871
3054
|
type: "primary",
|
|
2872
|
-
onClick: d[0] || (d[0] = (
|
|
2873
|
-
size:
|
|
3055
|
+
onClick: d[0] || (d[0] = (p) => i(e).update.open(i(s).Add)),
|
|
3056
|
+
size: a.option.size?.search
|
|
2874
3057
|
}, {
|
|
2875
|
-
default:
|
|
2876
|
-
M(
|
|
3058
|
+
default: h(() => [
|
|
3059
|
+
M(R(i(k).tCurd("add")), 1)
|
|
2877
3060
|
]),
|
|
2878
3061
|
_: 1
|
|
2879
3062
|
}, 8, ["size"])
|
|
2880
3063
|
])) : V("", !0),
|
|
2881
|
-
|
|
2882
|
-
|
|
3064
|
+
a.option.table?.selectable && i(n)(a.option.tools?.delete) ? (m(), C("div", Io, [
|
|
3065
|
+
O(i(K), {
|
|
2883
3066
|
type: "danger",
|
|
2884
|
-
onClick: d[1] || (d[1] = (
|
|
2885
|
-
size:
|
|
3067
|
+
onClick: d[1] || (d[1] = (p) => i(e).remove.open(i(e).table.selection.list)),
|
|
3068
|
+
size: a.option.size?.search
|
|
2886
3069
|
}, {
|
|
2887
|
-
default:
|
|
2888
|
-
M(
|
|
3070
|
+
default: h(() => [
|
|
3071
|
+
M(R(i(k).tCurd("delete")), 1)
|
|
2889
3072
|
]),
|
|
2890
3073
|
_: 1
|
|
2891
3074
|
}, 8, ["size"])
|
|
2892
3075
|
])) : V("", !0),
|
|
2893
|
-
|
|
2894
|
-
|
|
3076
|
+
a.option.tools?.expand ? (m(), C("div", Go, [
|
|
3077
|
+
O(i(K), {
|
|
2895
3078
|
type: "warning",
|
|
2896
|
-
onClick: d[2] || (d[2] = (
|
|
2897
|
-
size:
|
|
3079
|
+
onClick: d[2] || (d[2] = (p) => i(e).table.expand.all()),
|
|
3080
|
+
size: a.option.size?.search
|
|
2898
3081
|
}, {
|
|
2899
|
-
default:
|
|
2900
|
-
M(
|
|
3082
|
+
default: h(() => [
|
|
3083
|
+
M(R(i(k).tCurd("expandCollapse")), 1)
|
|
2901
3084
|
]),
|
|
2902
3085
|
_: 1
|
|
2903
3086
|
}, 8, ["size"])
|
|
2904
3087
|
])) : V("", !0),
|
|
2905
|
-
|
|
2906
|
-
|
|
3088
|
+
a.option.tools?.export?.show ? (m(), C(A, { key: 3 }, [
|
|
3089
|
+
a.option.tools?.export?.dropdown?.show ? (m(), y(i(Ue), {
|
|
2907
3090
|
key: 0,
|
|
2908
|
-
onCommand:
|
|
3091
|
+
onCommand: i(e).export.click
|
|
2909
3092
|
}, {
|
|
2910
|
-
dropdown:
|
|
2911
|
-
|
|
2912
|
-
size:
|
|
3093
|
+
dropdown: h(() => [
|
|
3094
|
+
O(i(Ae), {
|
|
3095
|
+
size: a.option.size?.search
|
|
2913
3096
|
}, {
|
|
2914
|
-
default:
|
|
2915
|
-
|
|
3097
|
+
default: h(() => [
|
|
3098
|
+
a.option.tools?.export?.dropdown?.select && (a.option.table?.selectable || i(n)(a.option.tools?.delete)) ? (m(), y(i(de), {
|
|
2916
3099
|
key: 0,
|
|
2917
3100
|
command: "select"
|
|
2918
3101
|
}, {
|
|
2919
|
-
default:
|
|
2920
|
-
M(
|
|
3102
|
+
default: h(() => [
|
|
3103
|
+
M(R(i(k).tCurd("exportSelect")), 1)
|
|
2921
3104
|
]),
|
|
2922
3105
|
_: 1
|
|
2923
3106
|
})) : V("", !0),
|
|
2924
|
-
|
|
3107
|
+
a.option.tools?.export?.dropdown?.page ? (m(), y(i(de), {
|
|
2925
3108
|
key: 1,
|
|
2926
3109
|
command: "page"
|
|
2927
3110
|
}, {
|
|
2928
|
-
default:
|
|
2929
|
-
M(
|
|
3111
|
+
default: h(() => [
|
|
3112
|
+
M(R(i(k).tCurd("exportPage")), 1)
|
|
2930
3113
|
]),
|
|
2931
3114
|
_: 1
|
|
2932
3115
|
})) : V("", !0),
|
|
2933
|
-
|
|
3116
|
+
a.option.tools?.export?.dropdown?.all ? (m(), y(i(de), {
|
|
2934
3117
|
key: 2,
|
|
2935
3118
|
command: "all"
|
|
2936
3119
|
}, {
|
|
2937
|
-
default:
|
|
2938
|
-
M(
|
|
3120
|
+
default: h(() => [
|
|
3121
|
+
M(R(i(k).tCurd("exportAll")), 1)
|
|
2939
3122
|
]),
|
|
2940
3123
|
_: 1
|
|
2941
3124
|
})) : V("", !0)
|
|
@@ -2943,99 +3126,163 @@ const zo = /* @__PURE__ */ se(So, [["render", $o]]), Mo = { class: "row flex-cen
|
|
|
2943
3126
|
_: 1
|
|
2944
3127
|
}, 8, ["size"])
|
|
2945
3128
|
]),
|
|
2946
|
-
default:
|
|
2947
|
-
|
|
2948
|
-
|
|
3129
|
+
default: h(() => [
|
|
3130
|
+
D("div", Wo, [
|
|
3131
|
+
O(i(K), {
|
|
2949
3132
|
type: "warning",
|
|
2950
|
-
loading:
|
|
2951
|
-
size:
|
|
3133
|
+
loading: i(e).export.loading,
|
|
3134
|
+
size: a.option.size?.search
|
|
2952
3135
|
}, {
|
|
2953
|
-
default:
|
|
2954
|
-
M(
|
|
3136
|
+
default: h(() => [
|
|
3137
|
+
M(R(i(k).tCurd("export")), 1)
|
|
2955
3138
|
]),
|
|
2956
3139
|
_: 1
|
|
2957
3140
|
}, 8, ["loading", "size"])
|
|
2958
3141
|
])
|
|
2959
3142
|
]),
|
|
2960
3143
|
_: 1
|
|
2961
|
-
}, 8, ["onCommand"])) : (
|
|
2962
|
-
|
|
3144
|
+
}, 8, ["onCommand"])) : (m(), C("div", qo, [
|
|
3145
|
+
O(i(K), {
|
|
2963
3146
|
type: "warning",
|
|
2964
|
-
loading:
|
|
2965
|
-
size:
|
|
2966
|
-
onClick: d[3] || (d[3] = (
|
|
3147
|
+
loading: i(e).export.loading,
|
|
3148
|
+
size: a.option.size?.search,
|
|
3149
|
+
onClick: d[3] || (d[3] = (p) => i(e).export.run.start("all"))
|
|
2967
3150
|
}, {
|
|
2968
|
-
default:
|
|
2969
|
-
M(
|
|
3151
|
+
default: h(() => [
|
|
3152
|
+
M(R(i(k).tCurd("export")), 1)
|
|
2970
3153
|
]),
|
|
2971
3154
|
_: 1
|
|
2972
3155
|
}, 8, ["loading", "size"])
|
|
2973
3156
|
]))
|
|
2974
3157
|
], 64)) : V("", !0),
|
|
2975
|
-
|
|
3158
|
+
E(f.$slots, "tools-left")
|
|
2976
3159
|
]),
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
3160
|
+
D("div", Jo, [
|
|
3161
|
+
E(f.$slots, "tools-right"),
|
|
3162
|
+
i(e).page.showTools && i(e).table.sortable.showPagination() ? (m(), y(i(Be), S({
|
|
2980
3163
|
key: 0,
|
|
2981
|
-
"current-page":
|
|
2982
|
-
"onUpdate:currentPage": d[4] || (d[4] = (
|
|
2983
|
-
"page-size":
|
|
2984
|
-
"onUpdate:pageSize": d[5] || (d[5] = (
|
|
3164
|
+
"current-page": i(e).page.num,
|
|
3165
|
+
"onUpdate:currentPage": d[4] || (d[4] = (p) => i(e).page.num = p),
|
|
3166
|
+
"page-size": i(e).page.size,
|
|
3167
|
+
"onUpdate:pageSize": d[5] || (d[5] = (p) => i(e).page.size = p),
|
|
2985
3168
|
background: "",
|
|
2986
|
-
"page-sizes":
|
|
2987
|
-
"pager-count":
|
|
2988
|
-
layout:
|
|
2989
|
-
total:
|
|
2990
|
-
size:
|
|
2991
|
-
onSizeChange:
|
|
2992
|
-
onCurrentChange:
|
|
2993
|
-
},
|
|
2994
|
-
e.
|
|
3169
|
+
"page-sizes": i(e).page.sizeList,
|
|
3170
|
+
"pager-count": i(e).page.pagerCount,
|
|
3171
|
+
layout: i(e).page.layout,
|
|
3172
|
+
total: i(e).page.total,
|
|
3173
|
+
size: a.option.size?.table,
|
|
3174
|
+
onSizeChange: i(e).table.sortable.refreshList,
|
|
3175
|
+
onCurrentChange: i(e).table.sortable.refreshList
|
|
3176
|
+
}, a.option.page?.pagination || {}, $(a.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : V("", !0),
|
|
3177
|
+
i(e).table.sortable.showTriggerButton() ? (m(), y(i(K), {
|
|
2995
3178
|
key: 1,
|
|
3179
|
+
type: "warning",
|
|
3180
|
+
onClick: i(e).table.sortable.start,
|
|
3181
|
+
size: a.option.size?.search,
|
|
3182
|
+
loading: i(e).table.sortable.actionLoading
|
|
3183
|
+
}, {
|
|
3184
|
+
default: h(() => [
|
|
3185
|
+
M(R(i(k).tCurd("sortableStart")), 1)
|
|
3186
|
+
]),
|
|
3187
|
+
_: 1
|
|
3188
|
+
}, 8, ["onClick", "size", "loading"])) : V("", !0),
|
|
3189
|
+
i(e).table.sortable.showActionButton() ? (m(), y(i(Ue), {
|
|
3190
|
+
key: 2,
|
|
3191
|
+
onCommand: i(e).table.sortable.command
|
|
3192
|
+
}, {
|
|
3193
|
+
dropdown: h(() => [
|
|
3194
|
+
O(i(Ae), {
|
|
3195
|
+
size: a.option.size?.search
|
|
3196
|
+
}, {
|
|
3197
|
+
default: h(() => [
|
|
3198
|
+
O(i(de), { command: "save" }, {
|
|
3199
|
+
default: h(() => [
|
|
3200
|
+
M(R(i(k).tCurd("sortableSave")), 1)
|
|
3201
|
+
]),
|
|
3202
|
+
_: 1
|
|
3203
|
+
}),
|
|
3204
|
+
O(i(de), { command: "exit" }, {
|
|
3205
|
+
default: h(() => [
|
|
3206
|
+
M(R(i(k).tCurd("sortableExit")), 1)
|
|
3207
|
+
]),
|
|
3208
|
+
_: 1
|
|
3209
|
+
})
|
|
3210
|
+
]),
|
|
3211
|
+
_: 1
|
|
3212
|
+
}, 8, ["size"])
|
|
3213
|
+
]),
|
|
3214
|
+
default: h(() => [
|
|
3215
|
+
O(i(K), {
|
|
3216
|
+
type: "warning",
|
|
3217
|
+
size: a.option.size?.search,
|
|
3218
|
+
loading: i(e).table.sortable.actionLoading
|
|
3219
|
+
}, {
|
|
3220
|
+
default: h(() => [
|
|
3221
|
+
M(R(i(k).tCurd("sortableAction")), 1)
|
|
3222
|
+
]),
|
|
3223
|
+
_: 1
|
|
3224
|
+
}, 8, ["size", "loading"])
|
|
3225
|
+
]),
|
|
3226
|
+
_: 1
|
|
3227
|
+
}, 8, ["onCommand"])) : V("", !0),
|
|
3228
|
+
i(e).table.sortable.showSaveButton() ? (m(), y(i(K), {
|
|
3229
|
+
key: 3,
|
|
3230
|
+
type: "warning",
|
|
3231
|
+
onClick: i(e).table.sortable.save,
|
|
3232
|
+
size: a.option.size?.search,
|
|
3233
|
+
loading: i(e).table.sortable.actionLoading
|
|
3234
|
+
}, {
|
|
3235
|
+
default: h(() => [
|
|
3236
|
+
M(R(i(k).tCurd("sortableSave")), 1)
|
|
3237
|
+
]),
|
|
3238
|
+
_: 1
|
|
3239
|
+
}, 8, ["onClick", "size", "loading"])) : V("", !0),
|
|
3240
|
+
a.option.tools?.expandColumn === void 0 || a.option.tools?.expandColumn ? (m(), y(b, {
|
|
3241
|
+
key: 4,
|
|
2996
3242
|
effect: "dark",
|
|
2997
|
-
content:
|
|
3243
|
+
content: i(e).table.header.group.expand ? i(k).tCurd("mergeColumn") : i(k).tCurd("expandColumn"),
|
|
2998
3244
|
placement: "top"
|
|
2999
3245
|
}, {
|
|
3000
|
-
default:
|
|
3001
|
-
|
|
3002
|
-
class: J(["refresh-btn", [
|
|
3246
|
+
default: h(() => [
|
|
3247
|
+
D("div", {
|
|
3248
|
+
class: J(["refresh-btn", [a.option.size?.search]]),
|
|
3003
3249
|
onClick: d[6] || (d[6] = //@ts-ignore
|
|
3004
|
-
(...
|
|
3250
|
+
(...p) => i(e).table.header.group.toggleExpandAll && i(e).table.header.group.toggleExpandAll(...p))
|
|
3005
3251
|
}, [
|
|
3006
|
-
|
|
3252
|
+
i(e).table.header.group.expand ? (m(), y(uo, { key: 0 })) : (m(), y(mo, { key: 1 }))
|
|
3007
3253
|
], 2)
|
|
3008
3254
|
]),
|
|
3009
3255
|
_: 1
|
|
3010
3256
|
}, 8, ["content"])) : V("", !0),
|
|
3011
|
-
|
|
3012
|
-
key:
|
|
3013
|
-
class: J(["refresh-btn", [
|
|
3257
|
+
a.option.tools?.refresh === void 0 || a.option.tools?.refresh ? (m(), C("div", {
|
|
3258
|
+
key: 5,
|
|
3259
|
+
class: J(["refresh-btn", [a.option.size?.search]]),
|
|
3014
3260
|
onClick: d[7] || (d[7] = //@ts-ignore
|
|
3015
|
-
(...
|
|
3261
|
+
(...p) => i(e).table.sortable.refreshList && i(e).table.sortable.refreshList(...p))
|
|
3016
3262
|
}, [
|
|
3017
|
-
|
|
3263
|
+
O(yo)
|
|
3018
3264
|
], 2)) : V("", !0)
|
|
3019
3265
|
])
|
|
3020
3266
|
]),
|
|
3021
|
-
|
|
3022
|
-
class: J(["fit-width relative form-box", [
|
|
3267
|
+
D("div", {
|
|
3268
|
+
class: J(["fit-width relative form-box", [a.option.table?.fitHeight ? "col " : "", a.option.table?.editMode ? "edit-mode" : ""]])
|
|
3023
3269
|
}, [
|
|
3024
|
-
|
|
3025
|
-
class: J(["column form-box-content", [
|
|
3270
|
+
D("div", {
|
|
3271
|
+
class: J(["column form-box-content", [a.option.table?.fitHeight ? "absolute fit" : ""]])
|
|
3026
3272
|
}, [
|
|
3027
|
-
|
|
3273
|
+
kt((m(), y(i(ht), S({
|
|
3028
3274
|
ref_key: "tableRef",
|
|
3029
|
-
ref:
|
|
3030
|
-
data:
|
|
3031
|
-
border:
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3275
|
+
ref: u,
|
|
3276
|
+
data: i(e).table.data,
|
|
3277
|
+
border: a.option.table?.border === void 0 ? !0 : a.option.table?.border,
|
|
3278
|
+
class: { "cc1-form-sortable-no-scroll": i(e).table.sortable.disableScroll() },
|
|
3279
|
+
onSelectionChange: i(e).table.selection.change,
|
|
3280
|
+
onSortChange: i(e).table.sort.change,
|
|
3281
|
+
"expand-row-keys": i(e).table.expand.rowKeys,
|
|
3282
|
+
onExpandChange: i(e).table.expand.change
|
|
3283
|
+
}, i(e).table.sortable.getTableBindOption(), $(a.option.table?.on || {})), {
|
|
3284
|
+
default: h(() => [
|
|
3285
|
+
(typeof a.option.table?.selectable == "object" ? a.option.table?.selectable?.show : a.option.table?.selectable) || i(n)(a.option.tools?.delete) || a.option.tools?.export?.show && a.option.tools?.export?.select ? (m(), y(i(ue), S({
|
|
3039
3286
|
key: 0,
|
|
3040
3287
|
type: "selection",
|
|
3041
3288
|
width: "40",
|
|
@@ -3043,8 +3290,8 @@ const zo = /* @__PURE__ */ se(So, [["render", $o]]), Mo = { class: "row flex-cen
|
|
|
3043
3290
|
fixed: "left",
|
|
3044
3291
|
"show-overflow-tooltip": !1,
|
|
3045
3292
|
className: "cc1-form-selectable-column"
|
|
3046
|
-
}, typeof
|
|
3047
|
-
(typeof
|
|
3293
|
+
}, typeof a.option.table?.selectable == "object" ? a.option.table?.selectable : {}, $(typeof a.option.table?.selectable == "object" ? a.option.table?.selectable?.on || {} : {})), null, 16)) : V("", !0),
|
|
3294
|
+
(typeof a.option.table?.index == "object" ? a.option.table?.index?.show : a.option.table?.index) ? (m(), y(i(ue), S({
|
|
3048
3295
|
key: 1,
|
|
3049
3296
|
type: "index",
|
|
3050
3297
|
fixed: "left",
|
|
@@ -3053,107 +3300,138 @@ const zo = /* @__PURE__ */ se(So, [["render", $o]]), Mo = { class: "row flex-cen
|
|
|
3053
3300
|
label: "#",
|
|
3054
3301
|
"show-overflow-tooltip": !1,
|
|
3055
3302
|
className: "cc1-form-index-column"
|
|
3056
|
-
}, typeof
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3303
|
+
}, typeof a.option.table?.index == "object" ? a.option.table?.index : {}, $(typeof a.option.table?.index == "object" ? a.option.table?.index?.on || {} : {})), null, 16)) : V("", !0),
|
|
3304
|
+
i(e).table.sortable.isActive() ? (m(), y(i(ue), S({
|
|
3305
|
+
key: 2,
|
|
3306
|
+
align: "center",
|
|
3307
|
+
"show-overflow-tooltip": !1,
|
|
3308
|
+
className: "cc1-form-drag-column"
|
|
3309
|
+
}, i(e).table.sortable.getColumnBind(), $(i(e).table.sortable.getColumnBind().on || {})), {
|
|
3310
|
+
header: h(() => [
|
|
3311
|
+
E(f.$slots, "table-header-sortable", {}, () => [
|
|
3312
|
+
O(b, {
|
|
3313
|
+
effect: "dark",
|
|
3314
|
+
placement: "top"
|
|
3315
|
+
}, {
|
|
3316
|
+
content: h(() => [
|
|
3317
|
+
D("div", {
|
|
3318
|
+
innerHTML: i(k).tCurd("sortable")
|
|
3319
|
+
}, null, 8, Xo)
|
|
3320
|
+
]),
|
|
3321
|
+
default: h(() => [
|
|
3322
|
+
D("span", Qo, [
|
|
3323
|
+
O(rt)
|
|
3324
|
+
])
|
|
3325
|
+
]),
|
|
3326
|
+
_: 1
|
|
3327
|
+
})
|
|
3328
|
+
])
|
|
3329
|
+
]),
|
|
3330
|
+
default: h(() => d[12] || (d[12] = [
|
|
3331
|
+
D("span", { class: "cc1-form-drag-handle" }, "::", -1)
|
|
3332
|
+
])),
|
|
3333
|
+
_: 3
|
|
3334
|
+
}, 16)) : V("", !0),
|
|
3335
|
+
O(jo, {
|
|
3336
|
+
conf: i(e),
|
|
3337
|
+
columnList: i(e).table.column.list,
|
|
3338
|
+
option: a.option
|
|
3339
|
+
}, Z({ _: 2 }, [
|
|
3340
|
+
G(f.$slots, (p, w) => ({
|
|
3063
3341
|
name: w,
|
|
3064
|
-
fn:
|
|
3065
|
-
|
|
3342
|
+
fn: h((F) => [
|
|
3343
|
+
E(f.$slots, w, Oe(Me(F || {})))
|
|
3066
3344
|
])
|
|
3067
3345
|
}))
|
|
3068
3346
|
]), 1032, ["conf", "columnList", "option"]),
|
|
3069
|
-
|
|
3070
|
-
key:
|
|
3347
|
+
i(n)(a.option.table?.add) || i(n)(a.option.table?.update) || i(n)(a.option.table?.delete) || i(n)(a.option.table?.view) || f.$slots["table-op-left"] || f.$slots["table-op-right"] ? (m(), y(i(ue), S({
|
|
3348
|
+
key: 3,
|
|
3071
3349
|
align: "center",
|
|
3072
3350
|
fixed: "right"
|
|
3073
|
-
},
|
|
3074
|
-
width:
|
|
3351
|
+
}, a.option.table?.operate, {
|
|
3352
|
+
width: a.option.table?.operate?.width || 120,
|
|
3075
3353
|
"show-overflow-tooltip": !1
|
|
3076
3354
|
}), {
|
|
3077
|
-
header:
|
|
3078
|
-
|
|
3079
|
-
M(
|
|
3355
|
+
header: h(() => [
|
|
3356
|
+
E(f.$slots, "table-header-op", {}, () => [
|
|
3357
|
+
M(R(i(k).tCurd("operation")), 1)
|
|
3080
3358
|
])
|
|
3081
3359
|
]),
|
|
3082
|
-
default:
|
|
3083
|
-
|
|
3084
|
-
size:
|
|
3360
|
+
default: h(({ row: p }) => [
|
|
3361
|
+
O(i(oe), {
|
|
3362
|
+
size: a.option.size?.table
|
|
3085
3363
|
}, {
|
|
3086
|
-
default:
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3364
|
+
default: h(() => [
|
|
3365
|
+
E(f.$slots, "table-op-left", { row: p }),
|
|
3366
|
+
i(e).update.type === i(s).Update && a.option.table?.inlineEdit && i(e).update.form[t.option.table?.rowKey] === p[t.option.table?.rowKey] ? (m(), C(A, { key: 0 }, [
|
|
3367
|
+
O(i(K), {
|
|
3090
3368
|
link: "",
|
|
3091
3369
|
type: "info",
|
|
3092
|
-
onClick:
|
|
3370
|
+
onClick: i(e).update.close
|
|
3093
3371
|
}, {
|
|
3094
|
-
default:
|
|
3095
|
-
M(
|
|
3372
|
+
default: h(() => [
|
|
3373
|
+
M(R(i(k).tCurd("cancel")), 1)
|
|
3096
3374
|
]),
|
|
3097
3375
|
_: 1
|
|
3098
3376
|
}, 8, ["onClick"]),
|
|
3099
|
-
|
|
3377
|
+
O(i(K), {
|
|
3100
3378
|
link: "",
|
|
3101
3379
|
type: "primary",
|
|
3102
|
-
onClick:
|
|
3103
|
-
loading:
|
|
3380
|
+
onClick: i(e).update.submit,
|
|
3381
|
+
loading: i(e).update.loading
|
|
3104
3382
|
}, {
|
|
3105
|
-
default:
|
|
3106
|
-
M(
|
|
3383
|
+
default: h(() => [
|
|
3384
|
+
M(R(i(k).tCurd("confirm")), 1)
|
|
3107
3385
|
]),
|
|
3108
3386
|
_: 1
|
|
3109
3387
|
}, 8, ["onClick", "loading"]),
|
|
3110
|
-
|
|
3111
|
-
], 64)) : (
|
|
3112
|
-
|
|
3388
|
+
E(f.$slots, "table-op-edit-right", { row: p })
|
|
3389
|
+
], 64)) : (m(), C(A, { key: 1 }, [
|
|
3390
|
+
i(n)(a.option.table?.add, p) ? (m(), y(i(K), {
|
|
3113
3391
|
key: 0,
|
|
3114
3392
|
link: "",
|
|
3115
3393
|
type: "primary",
|
|
3116
|
-
onClick: (w) =>
|
|
3394
|
+
onClick: (w) => i(e).update.open(i(s).Add, p)
|
|
3117
3395
|
}, {
|
|
3118
|
-
default:
|
|
3119
|
-
M(
|
|
3396
|
+
default: h(() => [
|
|
3397
|
+
M(R(i(k).tCurd("add")), 1)
|
|
3120
3398
|
]),
|
|
3121
|
-
_:
|
|
3122
|
-
},
|
|
3123
|
-
|
|
3399
|
+
_: 2
|
|
3400
|
+
}, 1032, ["onClick"])) : V("", !0),
|
|
3401
|
+
i(n)(a.option.table?.view, p) ? (m(), y(i(K), {
|
|
3124
3402
|
key: 1,
|
|
3125
3403
|
link: "",
|
|
3126
3404
|
type: "primary",
|
|
3127
|
-
onClick: (w) =>
|
|
3405
|
+
onClick: (w) => i(e).update.open(i(s).View, p)
|
|
3128
3406
|
}, {
|
|
3129
|
-
default:
|
|
3130
|
-
M(
|
|
3407
|
+
default: h(() => [
|
|
3408
|
+
M(R(i(k).tCurd("view")), 1)
|
|
3131
3409
|
]),
|
|
3132
|
-
_:
|
|
3133
|
-
},
|
|
3134
|
-
|
|
3410
|
+
_: 2
|
|
3411
|
+
}, 1032, ["onClick"])) : V("", !0),
|
|
3412
|
+
i(n)(a.option.table?.update, p) ? (m(), y(i(K), {
|
|
3135
3413
|
key: 2,
|
|
3136
3414
|
link: "",
|
|
3137
3415
|
type: "warning",
|
|
3138
|
-
onClick: (w) =>
|
|
3416
|
+
onClick: (w) => i(e).update.open(i(s).Update, p)
|
|
3139
3417
|
}, {
|
|
3140
|
-
default:
|
|
3141
|
-
M(
|
|
3418
|
+
default: h(() => [
|
|
3419
|
+
M(R(i(k).tCurd("edit")), 1)
|
|
3142
3420
|
]),
|
|
3143
|
-
_:
|
|
3144
|
-
},
|
|
3145
|
-
|
|
3421
|
+
_: 2
|
|
3422
|
+
}, 1032, ["onClick"])) : V("", !0),
|
|
3423
|
+
i(n)(a.option.table?.delete, p) ? (m(), y(i(K), {
|
|
3146
3424
|
key: 3,
|
|
3147
3425
|
link: "",
|
|
3148
3426
|
type: "danger",
|
|
3149
|
-
onClick: (w) =>
|
|
3427
|
+
onClick: (w) => i(e).remove.open([p])
|
|
3150
3428
|
}, {
|
|
3151
|
-
default:
|
|
3152
|
-
M(
|
|
3429
|
+
default: h(() => [
|
|
3430
|
+
M(R(i(k).tCurd("delete")), 1)
|
|
3153
3431
|
]),
|
|
3154
|
-
_:
|
|
3155
|
-
},
|
|
3156
|
-
|
|
3432
|
+
_: 2
|
|
3433
|
+
}, 1032, ["onClick"])) : V("", !0),
|
|
3434
|
+
E(f.$slots, "table-op-right", { row: p })
|
|
3157
3435
|
], 64))
|
|
3158
3436
|
]),
|
|
3159
3437
|
_: 2
|
|
@@ -3163,62 +3441,62 @@ const zo = /* @__PURE__ */ se(So, [["render", $o]]), Mo = { class: "row flex-cen
|
|
|
3163
3441
|
}, 16, ["width"])) : V("", !0)
|
|
3164
3442
|
]),
|
|
3165
3443
|
_: 3
|
|
3166
|
-
}, 16, ["data", "border", "onSelectionChange", "onSortChange", "expand-row-keys", "onExpandChange"])), [
|
|
3167
|
-
[
|
|
3444
|
+
}, 16, ["data", "border", "class", "onSelectionChange", "onSortChange", "expand-row-keys", "onExpandChange"])), [
|
|
3445
|
+
[c, i(e).table.loading]
|
|
3168
3446
|
])
|
|
3169
3447
|
], 2)
|
|
3170
3448
|
], 2),
|
|
3171
|
-
|
|
3172
|
-
(
|
|
3449
|
+
D("div", Yo, [
|
|
3450
|
+
(a.option.page?.show === void 0 || a.option.page?.show) && !i(e).page.showTools && i(e).table.sortable.showPagination() ? (m(), y(i(Be), S({
|
|
3173
3451
|
key: 0,
|
|
3174
|
-
"current-page":
|
|
3175
|
-
"onUpdate:currentPage": d[8] || (d[8] = (
|
|
3176
|
-
"page-size":
|
|
3177
|
-
"onUpdate:pageSize": d[9] || (d[9] = (
|
|
3452
|
+
"current-page": i(e).page.num,
|
|
3453
|
+
"onUpdate:currentPage": d[8] || (d[8] = (p) => i(e).page.num = p),
|
|
3454
|
+
"page-size": i(e).page.size,
|
|
3455
|
+
"onUpdate:pageSize": d[9] || (d[9] = (p) => i(e).page.size = p),
|
|
3178
3456
|
background: "",
|
|
3179
|
-
"page-sizes":
|
|
3180
|
-
"pager-count":
|
|
3181
|
-
layout:
|
|
3182
|
-
total:
|
|
3183
|
-
size:
|
|
3184
|
-
onSizeChange:
|
|
3185
|
-
onCurrentChange:
|
|
3186
|
-
},
|
|
3457
|
+
"page-sizes": i(e).page.sizeList,
|
|
3458
|
+
"pager-count": i(e).page.pagerCount,
|
|
3459
|
+
layout: i(e).page.layout,
|
|
3460
|
+
total: i(e).page.total,
|
|
3461
|
+
size: a.option.size?.table,
|
|
3462
|
+
onSizeChange: i(e).table.sortable.refreshList,
|
|
3463
|
+
onCurrentChange: i(e).table.sortable.refreshList
|
|
3464
|
+
}, a.option.page?.pagination || {}, $(a.option.page?.pagination?.on || {})), null, 16, ["current-page", "page-size", "page-sizes", "pager-count", "layout", "total", "size", "onSizeChange", "onCurrentChange"])) : V("", !0)
|
|
3187
3465
|
])
|
|
3188
3466
|
], 2),
|
|
3189
|
-
|
|
3467
|
+
E(f.$slots, "box-right")
|
|
3190
3468
|
], 2),
|
|
3191
|
-
|
|
3192
|
-
modelValue:
|
|
3193
|
-
"onUpdate:modelValue": d[10] || (d[10] = (
|
|
3194
|
-
title:
|
|
3195
|
-
"before-close":
|
|
3196
|
-
},
|
|
3197
|
-
footer:
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
size:
|
|
3469
|
+
O(i($e), S({
|
|
3470
|
+
modelValue: i(e).update.show,
|
|
3471
|
+
"onUpdate:modelValue": d[10] || (d[10] = (p) => i(e).update.show = p),
|
|
3472
|
+
title: i(e).update.title,
|
|
3473
|
+
"before-close": i(e).update.close
|
|
3474
|
+
}, a.option.dialog), {
|
|
3475
|
+
footer: h(() => [
|
|
3476
|
+
D("span", Zo, [
|
|
3477
|
+
O(i(oe), {
|
|
3478
|
+
size: a.option.size?.form
|
|
3201
3479
|
}, {
|
|
3202
|
-
default:
|
|
3203
|
-
|
|
3204
|
-
row:
|
|
3480
|
+
default: h(() => [
|
|
3481
|
+
E(f.$slots, "dialog-footer", {
|
|
3482
|
+
row: i(e).update
|
|
3205
3483
|
}, () => [
|
|
3206
|
-
|
|
3207
|
-
onClick:
|
|
3484
|
+
O(i(K), {
|
|
3485
|
+
onClick: i(e).update.close
|
|
3208
3486
|
}, {
|
|
3209
|
-
default:
|
|
3210
|
-
M(
|
|
3487
|
+
default: h(() => [
|
|
3488
|
+
M(R(i(k).tCurd("close")), 1)
|
|
3211
3489
|
]),
|
|
3212
3490
|
_: 1
|
|
3213
3491
|
}, 8, ["onClick"]),
|
|
3214
|
-
|
|
3492
|
+
i(e).update.type !== i(s).View ? (m(), y(i(K), {
|
|
3215
3493
|
key: 0,
|
|
3216
3494
|
type: "primary",
|
|
3217
|
-
onClick:
|
|
3218
|
-
loading:
|
|
3495
|
+
onClick: i(e).update.submit,
|
|
3496
|
+
loading: i(e).update.loading
|
|
3219
3497
|
}, {
|
|
3220
|
-
default:
|
|
3221
|
-
M(
|
|
3498
|
+
default: h(() => [
|
|
3499
|
+
M(R(i(k).tCurd("submit")), 1)
|
|
3222
3500
|
]),
|
|
3223
3501
|
_: 1
|
|
3224
3502
|
}, 8, ["onClick", "loading"])) : V("", !0)
|
|
@@ -3228,75 +3506,75 @@ const zo = /* @__PURE__ */ se(So, [["render", $o]]), Mo = { class: "row flex-cen
|
|
|
3228
3506
|
}, 8, ["size"])
|
|
3229
3507
|
])
|
|
3230
3508
|
]),
|
|
3231
|
-
default:
|
|
3232
|
-
|
|
3233
|
-
row:
|
|
3509
|
+
default: h(() => [
|
|
3510
|
+
E(f.$slots, "dialog-start", {
|
|
3511
|
+
row: i(e).update
|
|
3234
3512
|
}),
|
|
3235
|
-
|
|
3513
|
+
O(i(oe), {
|
|
3236
3514
|
ref_key: "ruleFormRef",
|
|
3237
|
-
ref:
|
|
3238
|
-
model:
|
|
3239
|
-
rules:
|
|
3240
|
-
size:
|
|
3515
|
+
ref: l,
|
|
3516
|
+
model: i(e).update.form,
|
|
3517
|
+
rules: i(e).update.rules,
|
|
3518
|
+
size: a.option.size?.form,
|
|
3241
3519
|
class: "update-dialog-form"
|
|
3242
3520
|
}, {
|
|
3243
|
-
default:
|
|
3244
|
-
|
|
3521
|
+
default: h(() => [
|
|
3522
|
+
i(e).update.showContent ? (m(), y(lt, {
|
|
3245
3523
|
key: 0,
|
|
3246
|
-
"form-grid":
|
|
3247
|
-
"max-span":
|
|
3248
|
-
form:
|
|
3249
|
-
type:
|
|
3250
|
-
stripe:
|
|
3251
|
-
"label-width":
|
|
3252
|
-
"form-option":
|
|
3253
|
-
"get-bind":
|
|
3254
|
-
"get-on":
|
|
3255
|
-
"get-disabled":
|
|
3256
|
-
},
|
|
3257
|
-
|
|
3524
|
+
"form-grid": i(e).update.formGrid,
|
|
3525
|
+
"max-span": i(e).update.formMaxSpan,
|
|
3526
|
+
form: i(e).update.form,
|
|
3527
|
+
type: i(e).update.type,
|
|
3528
|
+
stripe: a.option.form?.stripe,
|
|
3529
|
+
"label-width": a.option.form?.labelWidth,
|
|
3530
|
+
"form-option": a.option.form,
|
|
3531
|
+
"get-bind": i(e).update.getBind,
|
|
3532
|
+
"get-on": i(e).update.getOn,
|
|
3533
|
+
"get-disabled": i(e).update.getDisabled
|
|
3534
|
+
}, Z({ _: 2 }, [
|
|
3535
|
+
G(f.$slots, (p, w) => ({
|
|
3258
3536
|
name: w,
|
|
3259
|
-
fn:
|
|
3260
|
-
|
|
3537
|
+
fn: h((F) => [
|
|
3538
|
+
E(f.$slots, w, Oe(Me(F || {})))
|
|
3261
3539
|
])
|
|
3262
3540
|
}))
|
|
3263
3541
|
]), 1032, ["form-grid", "max-span", "form", "type", "stripe", "label-width", "form-option", "get-bind", "get-on", "get-disabled"])) : V("", !0)
|
|
3264
3542
|
]),
|
|
3265
3543
|
_: 3
|
|
3266
3544
|
}, 8, ["model", "rules", "size"]),
|
|
3267
|
-
|
|
3268
|
-
row:
|
|
3545
|
+
E(f.$slots, "dialog-end", {
|
|
3546
|
+
row: i(e).update
|
|
3269
3547
|
})
|
|
3270
3548
|
]),
|
|
3271
3549
|
_: 3
|
|
3272
3550
|
}, 16, ["modelValue", "title", "before-close"]),
|
|
3273
|
-
|
|
3274
|
-
modelValue:
|
|
3275
|
-
"onUpdate:modelValue": d[11] || (d[11] = (
|
|
3276
|
-
title:
|
|
3551
|
+
O(i($e), {
|
|
3552
|
+
modelValue: i(e).remove.show,
|
|
3553
|
+
"onUpdate:modelValue": d[11] || (d[11] = (p) => i(e).remove.show = p),
|
|
3554
|
+
title: i(e).remove.title,
|
|
3277
3555
|
"close-on-click-modal": !1
|
|
3278
3556
|
}, {
|
|
3279
|
-
footer:
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
size:
|
|
3557
|
+
footer: h(() => [
|
|
3558
|
+
D("span", ea, [
|
|
3559
|
+
O(i(oe), {
|
|
3560
|
+
size: a.option.size?.form
|
|
3283
3561
|
}, {
|
|
3284
|
-
default:
|
|
3285
|
-
|
|
3286
|
-
onClick:
|
|
3562
|
+
default: h(() => [
|
|
3563
|
+
O(i(K), {
|
|
3564
|
+
onClick: i(e).remove.close
|
|
3287
3565
|
}, {
|
|
3288
|
-
default:
|
|
3289
|
-
M(
|
|
3566
|
+
default: h(() => [
|
|
3567
|
+
M(R(i(k).tCurd("close")), 1)
|
|
3290
3568
|
]),
|
|
3291
3569
|
_: 1
|
|
3292
3570
|
}, 8, ["onClick"]),
|
|
3293
|
-
|
|
3571
|
+
O(i(K), {
|
|
3294
3572
|
type: "danger",
|
|
3295
|
-
onClick:
|
|
3296
|
-
loading:
|
|
3573
|
+
onClick: i(e).remove.submit,
|
|
3574
|
+
loading: i(e).remove.loading
|
|
3297
3575
|
}, {
|
|
3298
|
-
default:
|
|
3299
|
-
M(
|
|
3576
|
+
default: h(() => [
|
|
3577
|
+
M(R(i(k).tCurd("confirmDelete")), 1)
|
|
3300
3578
|
]),
|
|
3301
3579
|
_: 1
|
|
3302
3580
|
}, 8, ["onClick", "loading"])
|
|
@@ -3305,90 +3583,90 @@ const zo = /* @__PURE__ */ se(So, [["render", $o]]), Mo = { class: "row flex-cen
|
|
|
3305
3583
|
}, 8, ["size"])
|
|
3306
3584
|
])
|
|
3307
3585
|
]),
|
|
3308
|
-
default:
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
content:
|
|
3312
|
-
value:
|
|
3586
|
+
default: h(() => [
|
|
3587
|
+
a.option.dialog?.delete?.content ? (m(), C("div", xo, [
|
|
3588
|
+
O(lo, {
|
|
3589
|
+
content: a.option.dialog?.delete?.content,
|
|
3590
|
+
value: i(e).remove.items
|
|
3313
3591
|
}, null, 8, ["content", "value"])
|
|
3314
|
-
])) : (
|
|
3592
|
+
])) : (m(), C("div", _o, R(i(k).tCurd("confirmDeleteMessage", i(e).remove.items.length)), 1))
|
|
3315
3593
|
]),
|
|
3316
3594
|
_: 1
|
|
3317
3595
|
}, 8, ["modelValue", "title"]),
|
|
3318
|
-
|
|
3596
|
+
O(ao, {
|
|
3319
3597
|
ref_key: "switchConfirmRef",
|
|
3320
|
-
ref:
|
|
3321
|
-
size:
|
|
3598
|
+
ref: r,
|
|
3599
|
+
size: a.option.size?.form
|
|
3322
3600
|
}, null, 8, ["size"])
|
|
3323
3601
|
], 2);
|
|
3324
3602
|
};
|
|
3325
3603
|
}
|
|
3326
3604
|
});
|
|
3327
|
-
class
|
|
3605
|
+
class ia {
|
|
3328
3606
|
/**
|
|
3329
3607
|
* 通过远程 URL 下载文件,自动创建临时 `<a>` 标签触发浏览器下载
|
|
3330
3608
|
*
|
|
3331
3609
|
* @param href - 文件的远程地址
|
|
3332
3610
|
* @param name - 下载后的文件名,默认 `'download.png'`
|
|
3333
3611
|
*/
|
|
3334
|
-
static async download(
|
|
3335
|
-
const
|
|
3336
|
-
|
|
3612
|
+
static async download(o, s = "download.png") {
|
|
3613
|
+
const t = document.createElement("a");
|
|
3614
|
+
t.style.display = "none", t.href = o, t.setAttribute("download", s), typeof t.download > "u" && t.setAttribute("target", "_blank"), document.body.appendChild(t), t.click(), document.body.removeChild(t), window.URL.revokeObjectURL(o);
|
|
3337
3615
|
}
|
|
3338
3616
|
/**
|
|
3339
3617
|
* 将json对象或者json数组导出为json文件保存
|
|
3340
3618
|
* @param data
|
|
3341
3619
|
* @param name
|
|
3342
3620
|
*/
|
|
3343
|
-
static exportJSONFile = (
|
|
3344
|
-
const
|
|
3345
|
-
|
|
3621
|
+
static exportJSONFile = (o, s) => {
|
|
3622
|
+
const t = new Blob([JSON.stringify(o)], { type: "application/json" }), n = URL.createObjectURL(t), e = document.createElement("a");
|
|
3623
|
+
e.href = n, e.download = `${s || "config"}.json`, e.click();
|
|
3346
3624
|
};
|
|
3347
3625
|
/**
|
|
3348
3626
|
* 导入文件内容,默认为json
|
|
3349
3627
|
* @param param
|
|
3350
3628
|
* @returns
|
|
3351
3629
|
*/
|
|
3352
|
-
static importFile = async (
|
|
3353
|
-
const
|
|
3354
|
-
|
|
3355
|
-
const
|
|
3356
|
-
|
|
3357
|
-
const
|
|
3358
|
-
if (!
|
|
3359
|
-
|
|
3630
|
+
static importFile = async (o) => new Promise((s, t) => {
|
|
3631
|
+
const n = document.createElement("input");
|
|
3632
|
+
n.type = "file";
|
|
3633
|
+
const e = o?.accept || ".json";
|
|
3634
|
+
n.accept = e, n.style.display = "none", n.onchange = (r) => {
|
|
3635
|
+
const l = r.target.files[0];
|
|
3636
|
+
if (!l) {
|
|
3637
|
+
z.fail("未选择文件"), t("未选择文件");
|
|
3360
3638
|
return;
|
|
3361
3639
|
}
|
|
3362
|
-
const
|
|
3363
|
-
|
|
3364
|
-
const d =
|
|
3365
|
-
|
|
3366
|
-
},
|
|
3367
|
-
|
|
3368
|
-
},
|
|
3369
|
-
}, document.body.appendChild(
|
|
3640
|
+
const u = new FileReader();
|
|
3641
|
+
u.onload = async (f) => {
|
|
3642
|
+
const d = e == ".json" ? JSON.parse(f.target.result) : f.target.result;
|
|
3643
|
+
s(d);
|
|
3644
|
+
}, u.onerror = () => {
|
|
3645
|
+
z.fail("文件读取失败"), t("文件读取失败");
|
|
3646
|
+
}, u.readAsText(l), document.body.removeChild(n);
|
|
3647
|
+
}, document.body.appendChild(n), n.click();
|
|
3370
3648
|
});
|
|
3371
3649
|
}
|
|
3372
|
-
const
|
|
3373
|
-
if (
|
|
3374
|
-
|
|
3375
|
-
for (const
|
|
3376
|
-
|
|
3650
|
+
const oa = (a, o) => {
|
|
3651
|
+
if (a.component("TCurd", ta), a.component("TFormList", We), a.component("TColumn", It), o?.customComponent) {
|
|
3652
|
+
q.customComponent = o.customComponent;
|
|
3653
|
+
for (const s in o.customComponent)
|
|
3654
|
+
a.component(s, o.customComponent[s]);
|
|
3377
3655
|
}
|
|
3378
|
-
},
|
|
3379
|
-
install:
|
|
3656
|
+
}, sa = {
|
|
3657
|
+
install: oa
|
|
3380
3658
|
};
|
|
3381
3659
|
export {
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3660
|
+
X as ArrUtil,
|
|
3661
|
+
Zt as ExcelUtil,
|
|
3662
|
+
It as TColumn,
|
|
3663
|
+
ta as TCurd,
|
|
3664
|
+
ia as TFile,
|
|
3665
|
+
q as TForm,
|
|
3666
|
+
T as TFormConfig,
|
|
3667
|
+
k as TFormI18n,
|
|
3668
|
+
We as TFormList,
|
|
3669
|
+
z as TSys,
|
|
3670
|
+
sa as default,
|
|
3671
|
+
oa as install
|
|
3394
3672
|
};
|