@dazhicheng/ui 1.6.44 → 1.6.46
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-keep-alive/index.js +54 -54
- package/dist/components/tt-modal/src/RenderModal.vue.js +211 -204
- package/dist/components/tt-modal/src/hooks/useModalRender.js +85 -84
- package/dist/components/tt-modal/src/index.js +26 -13
- package/dist/components/tt-modal/src/utils/modal-scope.d.ts +5 -4
- package/dist/components/tt-modal/src/utils/modal-scope.js +13 -10
- package/dist/components/tt-modal-form/index.vue.js +54 -44
- package/dist/components/tt-modal-form/props.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
import { useStore as
|
|
2
|
-
import { reactive as
|
|
3
|
-
import { RouterView as
|
|
4
|
-
import
|
|
1
|
+
import { useStore as y } from "@tanstack/vue-store";
|
|
2
|
+
import { reactive as w, ref as E, defineComponent as A, provide as O, nextTick as T, h as f, inject as b, getCurrentScope as x, effectScope as g, onScopeDispose as R, render as v, onMounted as k } from "vue";
|
|
3
|
+
import { RouterView as L } from "vue-router";
|
|
4
|
+
import h from "../RenderModal.vue.js";
|
|
5
5
|
/* empty css */
|
|
6
|
-
import { ModalApi as
|
|
7
|
-
import { onModalCloseTransitionEnd as
|
|
8
|
-
import { resolveModalTarget as
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
import { ModalApi as S } from "../utils/modal-api.js";
|
|
7
|
+
import { onModalCloseTransitionEnd as P } from "../utils/modal-close-transition.js";
|
|
8
|
+
import { resolveModalTarget as V } from "../utils/resolve-modal-target.js";
|
|
9
|
+
import { modalOwnerActive as N, MODAL_OWNER_ACTIVE_KEY as D } from "../utils/modal-scope.js";
|
|
10
|
+
const I = Symbol("Tt_MODAL_INJECT"), j = {};
|
|
11
|
+
function H(t = {}, l = I) {
|
|
12
|
+
var p;
|
|
13
|
+
const { connectedComponent: n } = t;
|
|
14
|
+
if (n) {
|
|
15
|
+
const e = w({}), s = E(!0);
|
|
16
|
+
return [A(
|
|
17
|
+
(m, { attrs: u, slots: M }) => (O(l, {
|
|
18
|
+
extendApi(_) {
|
|
19
|
+
Object.setPrototypeOf(e, _);
|
|
19
20
|
},
|
|
20
|
-
options:
|
|
21
|
+
options: t,
|
|
21
22
|
async reCreateModal() {
|
|
22
|
-
|
|
23
|
+
s.value = !1, await T(), s.value = !0;
|
|
23
24
|
}
|
|
24
|
-
}),
|
|
25
|
+
}), J(e, {
|
|
26
|
+
...m,
|
|
25
27
|
...u,
|
|
26
|
-
...
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
d.value ? r : "div",
|
|
28
|
+
...M
|
|
29
|
+
}), () => f(
|
|
30
|
+
s.value ? n : "div",
|
|
30
31
|
{
|
|
31
|
-
...
|
|
32
|
-
...
|
|
32
|
+
...m,
|
|
33
|
+
...u
|
|
33
34
|
},
|
|
34
|
-
|
|
35
|
+
M
|
|
35
36
|
)),
|
|
36
37
|
{
|
|
37
38
|
name: "TtModal",
|
|
@@ -39,93 +40,93 @@ function K(n = {}, c = R) {
|
|
|
39
40
|
}
|
|
40
41
|
), e];
|
|
41
42
|
}
|
|
42
|
-
const o =
|
|
43
|
-
...
|
|
43
|
+
const o = b(l, {}), r = {
|
|
44
|
+
...j,
|
|
44
45
|
...o.options,
|
|
45
|
-
...
|
|
46
|
+
...t
|
|
46
47
|
};
|
|
47
|
-
|
|
48
|
-
var
|
|
49
|
-
(
|
|
48
|
+
r.onVisibleChange = (e) => {
|
|
49
|
+
var s, i, m;
|
|
50
|
+
(s = t.onVisibleChange) == null || s.call(t, e), (m = (i = o.options) == null ? void 0 : i.onVisibleChange) == null || m.call(i, e);
|
|
50
51
|
};
|
|
51
|
-
const
|
|
52
|
-
|
|
52
|
+
const c = r.onClosed;
|
|
53
|
+
r.onClosed = () => {
|
|
53
54
|
var e;
|
|
54
|
-
|
|
55
|
+
c == null || c(), r.destroyOnClose && ((e = o.reCreateDrawer) == null || e.call(o));
|
|
55
56
|
};
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
(e, { attrs:
|
|
60
|
-
|
|
57
|
+
const d = new S(r), a = d;
|
|
58
|
+
a.useStore = (e) => y(d.store, e);
|
|
59
|
+
const C = A(
|
|
60
|
+
(e, { attrs: s, slots: i }) => () => f(
|
|
61
|
+
h,
|
|
61
62
|
{
|
|
62
63
|
...e,
|
|
63
|
-
...
|
|
64
|
-
modalApi:
|
|
64
|
+
...s,
|
|
65
|
+
modalApi: a
|
|
65
66
|
},
|
|
66
|
-
|
|
67
|
+
i
|
|
67
68
|
),
|
|
68
69
|
{
|
|
69
70
|
name: "TtModal",
|
|
70
71
|
inheritAttrs: !1
|
|
71
72
|
}
|
|
72
73
|
);
|
|
73
|
-
return (
|
|
74
|
+
return (p = o.extendApi) == null || p.call(o, a), [C, a];
|
|
74
75
|
}
|
|
75
|
-
function
|
|
76
|
-
const o = new
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
(
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
76
|
+
function Q(t, l, n) {
|
|
77
|
+
const o = x(), r = o ? N.get(o) : void 0, c = new S(n), d = c;
|
|
78
|
+
d.useStore = (u) => y(c.store, u);
|
|
79
|
+
const a = document.createElement("div");
|
|
80
|
+
(n.appendToBody ? document.body : V() ?? document.body).appendChild(a);
|
|
81
|
+
const p = g(), e = P(d, () => p.stop());
|
|
82
|
+
p.run(() => {
|
|
83
|
+
R(() => {
|
|
84
|
+
e(), v(null, a), a.remove();
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
const s = A(
|
|
88
|
+
(u, { slots: M }) => (r && O(D, r), k(() => {
|
|
89
|
+
n && d.setModalProps(n), d.openModal();
|
|
90
|
+
}), () => f(
|
|
91
|
+
h,
|
|
92
|
+
{
|
|
93
|
+
...u,
|
|
94
|
+
modalApi: d
|
|
95
|
+
},
|
|
96
|
+
M
|
|
97
|
+
)),
|
|
97
98
|
{
|
|
98
99
|
name: "TtModal",
|
|
99
100
|
inheritAttrs: !1
|
|
100
101
|
}
|
|
101
|
-
),
|
|
102
|
-
|
|
102
|
+
), i = f(l, {}), m = f(
|
|
103
|
+
L,
|
|
103
104
|
{},
|
|
104
|
-
() =>
|
|
105
|
-
|
|
105
|
+
() => f(
|
|
106
|
+
s,
|
|
106
107
|
{
|
|
107
|
-
...
|
|
108
|
+
...n
|
|
108
109
|
},
|
|
109
110
|
{
|
|
110
|
-
default: () =>
|
|
111
|
+
default: () => i
|
|
111
112
|
}
|
|
112
113
|
)
|
|
113
114
|
);
|
|
114
|
-
return m.appContext =
|
|
115
|
+
return m.appContext = t._context, v(m, a), d;
|
|
115
116
|
}
|
|
116
|
-
async function
|
|
117
|
-
var
|
|
118
|
-
if (!
|
|
117
|
+
async function J(t, l) {
|
|
118
|
+
var r;
|
|
119
|
+
if (!l || Object.keys(l).length === 0)
|
|
119
120
|
return;
|
|
120
121
|
await T();
|
|
121
|
-
const
|
|
122
|
-
if (!
|
|
122
|
+
const n = (r = t == null ? void 0 : t.store) == null ? void 0 : r.state;
|
|
123
|
+
if (!n)
|
|
123
124
|
return;
|
|
124
|
-
const o = new Set(Object.keys(
|
|
125
|
-
for (const
|
|
126
|
-
o.has(
|
|
125
|
+
const o = new Set(Object.keys(n));
|
|
126
|
+
for (const c of Object.keys(l))
|
|
127
|
+
o.has(c) && ["class"].includes(c);
|
|
127
128
|
}
|
|
128
129
|
export {
|
|
129
|
-
|
|
130
|
-
|
|
130
|
+
Q as showTtModal,
|
|
131
|
+
H as useModalRender
|
|
131
132
|
};
|
|
@@ -1,19 +1,32 @@
|
|
|
1
|
-
import { inject as
|
|
1
|
+
import { inject as n, getCurrentScope as u, shallowRef as c, computed as d, onActivated as i, onDeactivated as f } from "vue";
|
|
2
2
|
import { showTtModal as M } from "./hooks/useModalRender.js";
|
|
3
|
-
import { setModalHostApp as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
o
|
|
3
|
+
import { setModalHostApp as w } from "./utils/modal-host-app.js";
|
|
4
|
+
import { MODAL_OWNER_ACTIVE_KEY as m, modalOwnerActive as v } from "./utils/modal-scope.js";
|
|
5
|
+
const s = Symbol("SHOW_MODAL");
|
|
6
|
+
function A(t) {
|
|
7
|
+
w(t);
|
|
8
|
+
const o = (e, r) => M(t, e, r);
|
|
9
|
+
t.provide(s, o);
|
|
9
10
|
}
|
|
10
|
-
function
|
|
11
|
-
const
|
|
12
|
-
if (!
|
|
11
|
+
function E() {
|
|
12
|
+
const t = n(s);
|
|
13
|
+
if (!t)
|
|
13
14
|
throw new Error("[TtModal]: useShowModal() 需要先调用 setupModal(app) 进行注册");
|
|
14
|
-
|
|
15
|
+
const o = u(), e = c(!0), r = n(m, void 0);
|
|
16
|
+
return o && v.set(
|
|
17
|
+
o,
|
|
18
|
+
d(() => e.value && (r == null ? void 0 : r.value) !== !1)
|
|
19
|
+
), i(() => {
|
|
20
|
+
e.value = !0;
|
|
21
|
+
}), f(() => {
|
|
22
|
+
e.value = !1;
|
|
23
|
+
}), (a, l) => {
|
|
24
|
+
if (o && !o.active)
|
|
25
|
+
throw new Error("[TtModal]: 页面已销毁,不能再打开弹窗");
|
|
26
|
+
return o ? o.run(() => t(a, l)) : t(a, l);
|
|
27
|
+
};
|
|
15
28
|
}
|
|
16
29
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
30
|
+
A as setupModal,
|
|
31
|
+
E as useShowModal
|
|
19
32
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
1
|
+
import { EffectScope, InjectionKey, Ref } from 'vue';
|
|
2
|
+
/** 命令式弹窗从调用方作用域继承激活状态,WeakMap 不延长页面寿命。 */
|
|
3
|
+
export declare const modalOwnerActive: WeakMap<EffectScope, Readonly<Ref<boolean, boolean>>>;
|
|
4
|
+
/** 独立挂载的弹窗向内容组件传递所属页面状态,支持嵌套弹窗。 */
|
|
5
|
+
export declare const MODAL_OWNER_ACTIVE_KEY: InjectionKey<Readonly<Ref<boolean>>>;
|
|
5
6
|
/** 当前作用域标识:子应用用 micro-app name,宿主页面用 host */
|
|
6
7
|
export declare function getModalScopeKey(): string;
|
|
7
8
|
/**
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
const c = /* @__PURE__ */ new WeakMap(), i = Symbol("TtModalOwnerActive");
|
|
2
|
+
function r() {
|
|
2
3
|
return typeof window > "u" ? "host" : window.__MICRO_APP_NAME__ || "host";
|
|
3
4
|
}
|
|
4
|
-
function u(
|
|
5
|
+
function u(e) {
|
|
5
6
|
var n;
|
|
6
|
-
const o =
|
|
7
|
-
return
|
|
7
|
+
const o = e.body ?? e.documentElement, t = (n = o == null ? void 0 : o.getRootNode) == null ? void 0 : n.call(o);
|
|
8
|
+
return t instanceof Document ? t : e;
|
|
8
9
|
}
|
|
9
|
-
function
|
|
10
|
+
function s() {
|
|
10
11
|
return typeof document > "u" ? void 0 : document;
|
|
11
12
|
}
|
|
12
|
-
function
|
|
13
|
-
return
|
|
13
|
+
function d(e, o) {
|
|
14
|
+
return e.closest("micro-app-body") === o.closest("micro-app-body");
|
|
14
15
|
}
|
|
15
16
|
export {
|
|
16
|
-
i as
|
|
17
|
-
|
|
18
|
-
r as
|
|
17
|
+
i as MODAL_OWNER_ACTIVE_KEY,
|
|
18
|
+
s as getClientDocument,
|
|
19
|
+
r as getModalScopeKey,
|
|
20
|
+
d as isSameMicroAppScope,
|
|
21
|
+
c as modalOwnerActive,
|
|
19
22
|
u as resolveScanDocument
|
|
20
23
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as H, useSlots as J, ref as
|
|
1
|
+
import { defineComponent as H, useSlots as J, ref as F, computed as K, toValue as Q, nextTick as y, watch as W, createBlock as C, openBlock as B, unref as d, createSlots as P, withCtx as A, renderSlot as g, createVNode as X, renderList as S, normalizeProps as b, guardReactiveProps as V, createCommentVNode as Y } from "vue";
|
|
2
2
|
import "axios";
|
|
3
3
|
import { ElCheckbox as Z, ElMessage as O } from "element-plus";
|
|
4
|
-
import { isFunction as
|
|
4
|
+
import { isFunction as n } from "../../packages/utils/src/is.js";
|
|
5
5
|
import "dayjs";
|
|
6
6
|
import "numeral";
|
|
7
7
|
import "xe-utils";
|
|
@@ -31,7 +31,7 @@ import "../tt-form/src/shared/zod-defaults.js";
|
|
|
31
31
|
import { useGroupForm as te } from "../tt-form/src/group-form/useGroupForm.js";
|
|
32
32
|
import "../tt-modal/index.js";
|
|
33
33
|
import { useModalFormSlot as ie } from "./hooks/useModalFormSlot.js";
|
|
34
|
-
import { useModalRender as
|
|
34
|
+
import { useModalRender as se } from "../tt-modal/src/hooks/useModalRender.js";
|
|
35
35
|
const xe = /* @__PURE__ */ H({
|
|
36
36
|
name: "TtModalForm",
|
|
37
37
|
__name: "index",
|
|
@@ -40,6 +40,7 @@ const xe = /* @__PURE__ */ H({
|
|
|
40
40
|
model: {},
|
|
41
41
|
addApi: {},
|
|
42
42
|
editApi: {},
|
|
43
|
+
successMessage: {},
|
|
43
44
|
infoApi: {},
|
|
44
45
|
infoApiBefore: {},
|
|
45
46
|
infoApiAfter: {},
|
|
@@ -58,21 +59,21 @@ const xe = /* @__PURE__ */ H({
|
|
|
58
59
|
},
|
|
59
60
|
emits: ["submit", "fetch", "getinfo"],
|
|
60
61
|
setup(I, { emit: D }) {
|
|
61
|
-
var
|
|
62
|
-
const o = I,
|
|
62
|
+
var M, w;
|
|
63
|
+
const o = I, m = D, L = J(), c = F(), r = F(!1), { getFormSlotKeys: T, getModalSlotKeys: E, replaceFormSlotKey: R, replaceModalSlotKey: _ } = ie(L), x = K(() => E.value.filter(Boolean)), $ = K(() => T.value.filter(Boolean)), h = {
|
|
63
64
|
showDefaultActions: !1,
|
|
64
65
|
...Q(o.formProps)
|
|
65
|
-
}, [z,
|
|
66
|
+
}, [z, l] = o.renderType === "groupForm" ? te(h) : oe(h), [N, a] = se({
|
|
66
67
|
...o.modalProps,
|
|
67
68
|
onReceiveSharedData: async (e) => {
|
|
68
69
|
if (!e) {
|
|
69
|
-
|
|
70
|
+
c.value = void 0;
|
|
70
71
|
return;
|
|
71
72
|
}
|
|
72
|
-
if (e.schemas &&
|
|
73
|
+
if (e.schemas && l.setState({ schema: e.schemas }), e != null && e.title && a.setModalProps({ title: e.title }), c.value = e[o.infoApiIdKey], e != null && e[o.infoApiIdKey]) {
|
|
73
74
|
const i = o.infoApi;
|
|
74
|
-
if (!
|
|
75
|
-
|
|
75
|
+
if (!n(i)) {
|
|
76
|
+
v(e);
|
|
76
77
|
return;
|
|
77
78
|
}
|
|
78
79
|
a.changeLoading(!0);
|
|
@@ -80,83 +81,92 @@ const xe = /* @__PURE__ */ H({
|
|
|
80
81
|
const t = {
|
|
81
82
|
...o.infoApiParams,
|
|
82
83
|
[o.infoApiIdKey]: e[o.infoApiIdKey]
|
|
83
|
-
},
|
|
84
|
-
k(
|
|
84
|
+
}, s = n(o.infoApiBefore) ? await o.infoApiBefore(t) : t, u = await i(s), p = o.dataField ? ee(u, o.dataField) : u, f = n(o.infoApiAfter) ? await o.infoApiAfter(p) : p;
|
|
85
|
+
k(f), m("getinfo", f), await y(), await l.resetForm({ values: f });
|
|
85
86
|
} finally {
|
|
86
87
|
a.changeLoading(!1);
|
|
87
88
|
}
|
|
88
89
|
} else
|
|
89
|
-
|
|
90
|
+
v(e);
|
|
90
91
|
},
|
|
91
92
|
async onOk() {
|
|
92
93
|
await q();
|
|
93
94
|
}
|
|
94
95
|
});
|
|
95
|
-
function
|
|
96
|
+
function v(e) {
|
|
96
97
|
const i = e[o.infoDataKey || ""] || {};
|
|
97
98
|
k(i), y(() => {
|
|
98
|
-
|
|
99
|
+
l.resetForm({ values: i });
|
|
99
100
|
});
|
|
100
101
|
}
|
|
101
102
|
function k(e) {
|
|
102
103
|
const i = Object.keys(o.checkedOptions || {});
|
|
103
104
|
i.length && i.forEach((t) => {
|
|
104
|
-
var
|
|
105
|
-
const
|
|
106
|
-
if (!Array.isArray(
|
|
105
|
+
var f;
|
|
106
|
+
const s = (f = o.checkedOptions) == null ? void 0 : f[t];
|
|
107
|
+
if (!Array.isArray(s) || s.length === 0)
|
|
107
108
|
return;
|
|
108
|
-
const [
|
|
109
|
-
!
|
|
110
|
-
label: e[
|
|
111
|
-
value: e[
|
|
109
|
+
const [u, p] = s.length === 1 ? [s[0], s[0]] : s;
|
|
110
|
+
!u || !p || (e[t] = {
|
|
111
|
+
label: e[u],
|
|
112
|
+
value: e[p]
|
|
112
113
|
});
|
|
113
114
|
});
|
|
114
115
|
}
|
|
115
116
|
async function j() {
|
|
116
|
-
const e = await
|
|
117
|
+
const e = await l.getValues(), { apiParams: i } = o;
|
|
117
118
|
let t = {
|
|
118
119
|
...e,
|
|
119
120
|
...i
|
|
120
121
|
};
|
|
121
|
-
return t =
|
|
122
|
+
return t = n(o.saveApiBefore) ? await o.saveApiBefore(t) : t, { reqParams: t, formValue: e };
|
|
122
123
|
}
|
|
123
124
|
async function G(e, i) {
|
|
124
125
|
const { editApi: t } = o;
|
|
125
|
-
!t || !
|
|
126
|
+
if (!t || !n(t)) return;
|
|
127
|
+
e[o.infoApiIdKey] = c.value;
|
|
128
|
+
const s = await t(e, i.files);
|
|
129
|
+
O.success(
|
|
130
|
+
n(o.successMessage) ? o.successMessage(s, "edit") : o.successMessage ?? "修改成功"
|
|
131
|
+
), m("submit", {
|
|
126
132
|
...e,
|
|
127
133
|
continuousChecked: r.value
|
|
128
|
-
}), a.closeModal()
|
|
134
|
+
}), a.closeModal();
|
|
129
135
|
}
|
|
130
136
|
async function U(e, i) {
|
|
131
137
|
const { addApi: t } = o;
|
|
132
|
-
!t || !
|
|
138
|
+
if (!t || !n(t)) return;
|
|
139
|
+
const s = await t(e, i.files);
|
|
140
|
+
O.success(
|
|
141
|
+
n(o.successMessage) ? o.successMessage(s, "add") : o.successMessage ?? "新增成功"
|
|
142
|
+
), m("submit", {
|
|
133
143
|
...e,
|
|
134
144
|
continuousChecked: r.value
|
|
135
|
-
}), (!r.value || !o.isContinuousChecked) && a.closeModal()
|
|
145
|
+
}), (!r.value || !o.isContinuousChecked) && a.closeModal();
|
|
136
146
|
}
|
|
137
147
|
async function q() {
|
|
138
148
|
a.changeOkLoading(!0);
|
|
139
149
|
try {
|
|
140
|
-
const { valid: e } = await
|
|
150
|
+
const { valid: e } = await l.validate();
|
|
141
151
|
if (!e) return;
|
|
142
152
|
const { reqParams: i, formValue: t } = await j();
|
|
143
153
|
if (!i)
|
|
144
154
|
return;
|
|
145
|
-
const { addApi:
|
|
146
|
-
if (!
|
|
147
|
-
|
|
155
|
+
const { addApi: s, editApi: u } = o;
|
|
156
|
+
if (!s && !u) {
|
|
157
|
+
m("submit", {
|
|
148
158
|
...i,
|
|
149
|
-
[o.infoApiIdKey]:
|
|
159
|
+
[o.infoApiIdKey]: c.value,
|
|
150
160
|
continuousChecked: r.value
|
|
151
161
|
});
|
|
152
162
|
return;
|
|
153
163
|
}
|
|
154
|
-
|
|
164
|
+
c.value ? await G(i, t) : await U(i, t);
|
|
155
165
|
} finally {
|
|
156
166
|
a.changeOkLoading(!1);
|
|
157
167
|
}
|
|
158
168
|
}
|
|
159
|
-
return (
|
|
169
|
+
return (M = o.getFormApi) == null || M.call(o, l), (w = o.getModalApi) == null || w.call(o, a), W(
|
|
160
170
|
() => {
|
|
161
171
|
var e;
|
|
162
172
|
return (e = a.getVisible) == null ? void 0 : e.value;
|
|
@@ -164,14 +174,14 @@ const xe = /* @__PURE__ */ H({
|
|
|
164
174
|
async (e) => {
|
|
165
175
|
if (e) {
|
|
166
176
|
await y();
|
|
167
|
-
const i = await
|
|
168
|
-
|
|
177
|
+
const i = await l.getValues();
|
|
178
|
+
m("fetch", i);
|
|
169
179
|
} else
|
|
170
180
|
r.value = !1;
|
|
171
181
|
}
|
|
172
|
-
), (e, i) => (B(),
|
|
182
|
+
), (e, i) => (B(), C(d(N), null, P({
|
|
173
183
|
insertFooter: A(() => [
|
|
174
|
-
o.isContinuousChecked && !
|
|
184
|
+
o.isContinuousChecked && !c.value ? (B(), C(d(Z), {
|
|
175
185
|
key: 0,
|
|
176
186
|
modelValue: r.value,
|
|
177
187
|
"onUpdate:modelValue": i[0] || (i[0] = (t) => r.value = t),
|
|
@@ -180,12 +190,12 @@ const xe = /* @__PURE__ */ H({
|
|
|
180
190
|
}, null, 8, ["modelValue"])) : Y("", !0)
|
|
181
191
|
]),
|
|
182
192
|
default: A(() => [
|
|
183
|
-
|
|
193
|
+
g(e.$slots, "BasicMsgTop"),
|
|
184
194
|
X(d(z), null, P({ _: 2 }, [
|
|
185
195
|
S($.value, (t) => ({
|
|
186
196
|
name: d(R)(t),
|
|
187
|
-
fn: A((
|
|
188
|
-
|
|
197
|
+
fn: A((s) => [
|
|
198
|
+
g(e.$slots, t, b(V(s)))
|
|
189
199
|
])
|
|
190
200
|
}))
|
|
191
201
|
]), 1024)
|
|
@@ -194,8 +204,8 @@ const xe = /* @__PURE__ */ H({
|
|
|
194
204
|
}, [
|
|
195
205
|
S(x.value, (t) => ({
|
|
196
206
|
name: d(_)(t),
|
|
197
|
-
fn: A((
|
|
198
|
-
|
|
207
|
+
fn: A((s) => [
|
|
208
|
+
g(e.$slots, t, b(V(s)))
|
|
199
209
|
])
|
|
200
210
|
}))
|
|
201
211
|
]), 1024));
|
|
@@ -20,6 +20,8 @@ export type TtModalFormProps<TType extends ModalFormType = "form", TValues exten
|
|
|
20
20
|
addApi?: (...arg: any[]) => Promise<any>;
|
|
21
21
|
/** 编辑保存接口 */
|
|
22
22
|
editApi?: (...arg: any[]) => Promise<any>;
|
|
23
|
+
/** 保存成功提示;函数接收保存接口返回值及操作类型,不传时使用新增/修改默认文案。 */
|
|
24
|
+
successMessage?: string | ((result: unknown, type: "add" | "edit") => string);
|
|
23
25
|
/** 详情接口 */
|
|
24
26
|
infoApi?: (...arg: any[]) => Promise<any>;
|
|
25
27
|
/** 详情接口前置钩子 */
|