@dazhicheng/ui 1.5.82 → 1.5.83
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/components/tt-form/src/group-form/groupFormApi.d.ts +14 -0
- package/dist/index.js +696 -670
- package/dist/plugins.js +85 -69
- package/package.json +1 -1
package/dist/plugins.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ElSwitch as
|
|
2
|
-
import { omit as
|
|
3
|
-
import { h as s, defineComponent as
|
|
1
|
+
import { ElSwitch as x, ElMessageBox as U, ElMessage as y } from "element-plus";
|
|
2
|
+
import { omit as _, cloneDeep as F } from "lodash-es";
|
|
3
|
+
import { h as s, defineComponent as B, ref as D, shallowRef as O, onMounted as I } from "vue";
|
|
4
4
|
import "axios";
|
|
5
|
-
import { b as
|
|
5
|
+
import { b as d } from "./index.modern-xkd4Z3Qx.js";
|
|
6
6
|
import "xe-utils";
|
|
7
|
-
function
|
|
8
|
-
return
|
|
7
|
+
function M(l) {
|
|
8
|
+
return l.split("-").filter(Boolean).map((r, u) => u === 0 ? r : r.charAt(0).toUpperCase() + r.slice(1)).join("");
|
|
9
9
|
}
|
|
10
|
-
const
|
|
10
|
+
const $ = [
|
|
11
11
|
"modelValue",
|
|
12
12
|
"onUpdate:modelValue",
|
|
13
13
|
"loading",
|
|
@@ -16,54 +16,70 @@ const O = [
|
|
|
16
16
|
"afterFetch",
|
|
17
17
|
"beforeChange"
|
|
18
18
|
];
|
|
19
|
-
function
|
|
20
|
-
return Object.fromEntries(Object.entries(
|
|
19
|
+
function A(l) {
|
|
20
|
+
return Object.fromEntries(Object.entries(l).map(([r, u]) => [M(r), u]));
|
|
21
21
|
}
|
|
22
|
-
const
|
|
23
|
-
function
|
|
24
|
-
const r =
|
|
22
|
+
const j = "1", K = "0";
|
|
23
|
+
function Y(l) {
|
|
24
|
+
const r = A(l);
|
|
25
25
|
return {
|
|
26
|
-
active: r.activeValue ??
|
|
27
|
-
inactive: r.inactiveValue ??
|
|
26
|
+
active: r.activeValue ?? j,
|
|
27
|
+
inactive: r.inactiveValue ?? K
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function G() {
|
|
31
31
|
return {
|
|
32
|
-
install(
|
|
33
|
-
|
|
32
|
+
install(l) {
|
|
33
|
+
l.renderer.add("switchStatus", {
|
|
34
34
|
renderTableDefault(r, u) {
|
|
35
|
-
const { row: i, column:
|
|
35
|
+
const { row: i, column: a } = u, e = r.props ?? {}, t = _(e, [...$]), m = A(t);
|
|
36
36
|
return s(
|
|
37
|
-
|
|
37
|
+
B({
|
|
38
38
|
name: "TtVxeSwitchCell",
|
|
39
39
|
setup: () => {
|
|
40
|
-
const
|
|
41
|
-
return () => s(
|
|
42
|
-
activeValue:
|
|
40
|
+
const h = D(!1), { active: n, inactive: c } = Y(e);
|
|
41
|
+
return () => s(x, {
|
|
42
|
+
activeValue: n,
|
|
43
43
|
inactiveValue: c,
|
|
44
|
-
...
|
|
45
|
-
modelValue: i[
|
|
46
|
-
loading:
|
|
47
|
-
"onUpdate:modelValue": (
|
|
48
|
-
i[
|
|
44
|
+
...m,
|
|
45
|
+
modelValue: i[a.field],
|
|
46
|
+
loading: h.value,
|
|
47
|
+
"onUpdate:modelValue": (o) => {
|
|
48
|
+
i[a.field] = o;
|
|
49
49
|
},
|
|
50
50
|
beforeChange: async () => {
|
|
51
|
-
var p
|
|
52
|
-
const
|
|
53
|
-
if ((
|
|
54
|
-
const f =
|
|
55
|
-
let
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
51
|
+
var p;
|
|
52
|
+
const o = i[a.field];
|
|
53
|
+
if ((d(e.beforeChange) ? await ((p = e.beforeChange) == null ? void 0 : p.call(e, o)) : !0) === !1 || !d(e.api)) return !1;
|
|
54
|
+
const f = o === n ? c : n, w = `是否确认${o === n ? "关闭" : "开启"}`;
|
|
55
|
+
let C = !1;
|
|
56
|
+
return await U({
|
|
57
|
+
title: "Warning",
|
|
58
|
+
message: w,
|
|
59
|
+
confirmButtonText: "确认",
|
|
60
|
+
cancelButtonText: "取消",
|
|
61
|
+
showCancelButton: !0,
|
|
62
|
+
type: "warning",
|
|
63
|
+
beforeClose: async (L, V, b) => {
|
|
64
|
+
var E, T;
|
|
65
|
+
if (L === "confirm") {
|
|
66
|
+
V.confirmButtonLoading = !0;
|
|
67
|
+
let v = { [a.field]: f, id: i.id };
|
|
68
|
+
if (h.value = !0, d(e.beforeFetch)) {
|
|
69
|
+
const S = await ((E = e.beforeFetch) == null ? void 0 : E.call(e, v, i, a));
|
|
70
|
+
v = {
|
|
71
|
+
...v,
|
|
72
|
+
...S
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
const R = await e.api(v).finally(() => {
|
|
76
|
+
h.value = !1, V.confirmButtonLoading = !1;
|
|
77
|
+
});
|
|
78
|
+
(T = e.afterFetch) == null || T.call(e, R), y.success(o === n ? "禁用成功" : "启用成功"), V.confirmButtonLoading = !1, b(), C = !0;
|
|
79
|
+
} else
|
|
80
|
+
b();
|
|
81
|
+
}
|
|
82
|
+
}), C;
|
|
67
83
|
}
|
|
68
84
|
});
|
|
69
85
|
}
|
|
@@ -74,59 +90,59 @@ function k() {
|
|
|
74
90
|
}
|
|
75
91
|
};
|
|
76
92
|
}
|
|
77
|
-
function
|
|
93
|
+
function J() {
|
|
78
94
|
return {
|
|
79
|
-
install(
|
|
80
|
-
|
|
95
|
+
install(l) {
|
|
96
|
+
l.renderer.add("renderCellContent", {
|
|
81
97
|
renderTableDefault(r, u) {
|
|
82
|
-
const { row: i, column:
|
|
83
|
-
if (e[
|
|
84
|
-
const
|
|
85
|
-
if (
|
|
98
|
+
const { row: i, column: a, $table: e } = u, t = r.props ?? {}, m = `${a.field}Option`;
|
|
99
|
+
if (e[m]) {
|
|
100
|
+
const n = e[m];
|
|
101
|
+
if (d(t.customRender))
|
|
86
102
|
return s(
|
|
87
103
|
t.customRender({
|
|
88
|
-
result: F(
|
|
104
|
+
result: F(n),
|
|
89
105
|
row: i,
|
|
90
|
-
column:
|
|
106
|
+
column: a,
|
|
91
107
|
$table: e
|
|
92
108
|
})
|
|
93
109
|
);
|
|
94
|
-
const c =
|
|
110
|
+
const c = n.find((o) => o[t.valueField] === a.field);
|
|
95
111
|
return s("div", null, (c == null ? void 0 : c[t.labelField]) ?? "");
|
|
96
112
|
}
|
|
97
|
-
const
|
|
113
|
+
const h = B({
|
|
98
114
|
name: "RenderCellContent",
|
|
99
115
|
setup() {
|
|
100
|
-
var
|
|
101
|
-
const
|
|
116
|
+
var g;
|
|
117
|
+
const n = O([]);
|
|
102
118
|
async function c() {
|
|
103
|
-
var
|
|
104
|
-
if (e[
|
|
119
|
+
var C, p;
|
|
120
|
+
if (e[m]) return;
|
|
105
121
|
let f = {};
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
|
|
122
|
+
d(t.beforeFetch) && (f = await ((C = t.beforeFetch) == null ? void 0 : C.call(t, i, a)));
|
|
123
|
+
const w = await ((p = t.api) == null ? void 0 : p.call(t, f));
|
|
124
|
+
n.value = w, d(t.afterFetch) && (n.value = await t.afterFetch(n.value, i, a)), e[`${a.field}Option`] = F(n.value);
|
|
109
125
|
}
|
|
110
|
-
if (
|
|
126
|
+
if (I(c), t.customRender)
|
|
111
127
|
return () => s(
|
|
112
128
|
t.customRender({
|
|
113
|
-
result: F(
|
|
129
|
+
result: F(n.value),
|
|
114
130
|
row: i,
|
|
115
|
-
column:
|
|
131
|
+
column: a,
|
|
116
132
|
$table: e
|
|
117
133
|
})
|
|
118
134
|
);
|
|
119
|
-
const
|
|
120
|
-
return () => s("div", null, (
|
|
135
|
+
const o = (g = n.value) == null ? void 0 : g.find((f) => f[t.valueField] === a.field);
|
|
136
|
+
return () => s("div", null, (o == null ? void 0 : o[t.labelField]) ?? "");
|
|
121
137
|
}
|
|
122
138
|
});
|
|
123
|
-
return s(
|
|
139
|
+
return s(h);
|
|
124
140
|
}
|
|
125
141
|
});
|
|
126
142
|
}
|
|
127
143
|
};
|
|
128
144
|
}
|
|
129
145
|
export {
|
|
130
|
-
|
|
131
|
-
|
|
146
|
+
J as createVxePluginRenderCellContent,
|
|
147
|
+
G as createVxePluginSwitchStatus
|
|
132
148
|
};
|