@kp-ui/lowcode 2.14.0-beta.22 → 2.14.0-beta.23
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/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as L, ref as p, computed as a, resolveComponent as B, createBlock as u, openBlock as r, withCtx as s, createCommentVNode as m, createTextVNode as k, toDisplayString as v } from "vue";
|
|
2
2
|
import { asyncExecuteFunction as y } from "../../utils/asyncExecuteFunction.js";
|
|
3
|
-
import { executeFunction as
|
|
4
|
-
import { useI18n as
|
|
5
|
-
const E = /* @__PURE__ */
|
|
3
|
+
import { executeFunction as b } from "../../utils/executeFunction.js";
|
|
4
|
+
import { useI18n as V } from "../../utils/i18n.js";
|
|
5
|
+
const E = /* @__PURE__ */ L({
|
|
6
6
|
__name: "SubmitButtonRender",
|
|
7
7
|
props: {
|
|
8
|
+
disabled: { type: Boolean },
|
|
8
9
|
goBack: { type: Function },
|
|
9
10
|
deleteWrapperNode: { type: Function },
|
|
10
11
|
handleBeforeClose: { type: Function },
|
|
@@ -12,8 +13,8 @@ const E = /* @__PURE__ */ D({
|
|
|
12
13
|
ctx: {}
|
|
13
14
|
},
|
|
14
15
|
emits: ["update:dialogVisible"],
|
|
15
|
-
setup(
|
|
16
|
-
const e =
|
|
16
|
+
setup(C, { emit: g }) {
|
|
17
|
+
const e = C, h = g, l = p(!1), i = p(!1), { i18nt: d } = V(), c = a(() => (e == null ? void 0 : e.options) ?? {}), _ = a(() => c.value.cancelButtonHidden != null ? c.value.cancelButtonHidden === 0 : 1), x = a(() => c.value.okButtonHidden != null ? c.value.okButtonHidden === 0 : 1), w = a(
|
|
17
18
|
() => {
|
|
18
19
|
var t;
|
|
19
20
|
return ((t = e.options) == null ? void 0 : t.cancelButtonLabel) || d("designer.hint.cancel");
|
|
@@ -31,7 +32,7 @@ const E = /* @__PURE__ */ D({
|
|
|
31
32
|
try {
|
|
32
33
|
if (i.value = !0, e.handleBeforeClose && !((t = e == null ? void 0 : e.handleBeforeClose) != null && t.call(e)))
|
|
33
34
|
return;
|
|
34
|
-
const o = await
|
|
35
|
+
const o = await b({
|
|
35
36
|
context: e.ctx,
|
|
36
37
|
functionBody: ((n = e.options) == null ? void 0 : n.onCancelButtonClick) || ""
|
|
37
38
|
});
|
|
@@ -47,7 +48,7 @@ const E = /* @__PURE__ */ D({
|
|
|
47
48
|
if (!l.value)
|
|
48
49
|
try {
|
|
49
50
|
l.value = !0;
|
|
50
|
-
const n =
|
|
51
|
+
const n = b({
|
|
51
52
|
context: e.ctx,
|
|
52
53
|
functionBody: ((t = e.options) == null ? void 0 : t.onOkButtonClick) || ""
|
|
53
54
|
});
|
|
@@ -60,32 +61,32 @@ const E = /* @__PURE__ */ D({
|
|
|
60
61
|
}
|
|
61
62
|
};
|
|
62
63
|
return (t, n) => {
|
|
63
|
-
const o =
|
|
64
|
+
const o = B("a-button"), S = B("a-space");
|
|
64
65
|
return r(), u(S, { x: 8 }, {
|
|
65
66
|
default: s(() => [
|
|
66
67
|
_.value ? (r(), u(o, {
|
|
67
68
|
key: "cancelButtonHidden",
|
|
68
69
|
loading: i.value,
|
|
69
70
|
onClick: F,
|
|
70
|
-
disabled: t.
|
|
71
|
+
disabled: t.disabled
|
|
71
72
|
}, {
|
|
72
73
|
default: s(() => [
|
|
73
74
|
k(v(w.value), 1)
|
|
74
75
|
]),
|
|
75
76
|
_: 1
|
|
76
|
-
}, 8, ["loading", "disabled"])) :
|
|
77
|
+
}, 8, ["loading", "disabled"])) : m("", !0),
|
|
77
78
|
x.value ? (r(), u(o, {
|
|
78
79
|
type: "primary",
|
|
79
80
|
key: "okButtonHidden",
|
|
80
81
|
loading: l.value,
|
|
81
82
|
onClick: N,
|
|
82
|
-
disabled: t.
|
|
83
|
+
disabled: t.disabled
|
|
83
84
|
}, {
|
|
84
85
|
default: s(() => [
|
|
85
86
|
k(v(H.value), 1)
|
|
86
87
|
]),
|
|
87
88
|
_: 1
|
|
88
|
-
}, 8, ["loading", "disabled"])) :
|
|
89
|
+
}, 8, ["loading", "disabled"])) : m("", !0)
|
|
89
90
|
]),
|
|
90
91
|
_: 1
|
|
91
92
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { TpfModal as
|
|
3
|
-
import
|
|
4
|
-
import { useLowcode as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as S, defineAsyncComponent as L, computed as u, ref as r, getCurrentInstance as V, onBeforeUnmount as H, resolveDirective as I, createBlock as J, openBlock as y, unref as d, mergeProps as N, withCtx as x, withDirectives as P, createElementBlock as U, createVNode as R, nextTick as W } from "vue";
|
|
2
|
+
import { TpfModal as A } from "tmgc2-share";
|
|
3
|
+
import $ from "./SubmitButtonRender.vue.js";
|
|
4
|
+
import { useLowcode as q } from "../../hooks/useLowcode.js";
|
|
5
|
+
const z = { class: "dialog-content" }, ae = /* @__PURE__ */ S({
|
|
6
6
|
name: "dynamic-dialog",
|
|
7
7
|
__name: "dynamic-dialog",
|
|
8
8
|
props: {
|
|
@@ -44,34 +44,34 @@ const q = { class: "dialog-content" }, ne = /* @__PURE__ */ M({
|
|
|
44
44
|
default: null
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
|
-
setup(n, { expose:
|
|
48
|
-
const
|
|
47
|
+
setup(n, { expose: F }) {
|
|
48
|
+
const D = L(() => import("./index.vue.js")), t = n, h = u(() => t.options.height || "500px"), p = r(null), m = r(!1), g = r(!1), l = r(!1), a = V(), { vfdRef: s, formConfig: G, getComponentJson: O, goBack: K } = q({
|
|
49
49
|
formCode: t.options.formCode,
|
|
50
50
|
...t.vfCtx
|
|
51
|
-
}),
|
|
51
|
+
}), w = u(() => ({
|
|
52
52
|
...t.parentFormRef,
|
|
53
53
|
parentDom: a,
|
|
54
|
-
getParentFormRef:
|
|
55
|
-
})),
|
|
56
|
-
|
|
54
|
+
getParentFormRef: C
|
|
55
|
+
})), k = u(() => t.options.cancelButtonHidden && t.options.okButtonHidden ? { footer: null } : {});
|
|
56
|
+
H(() => {
|
|
57
57
|
var e, o;
|
|
58
58
|
console.log(t.parentFormRef), (o = (e = t.parentFormRef) == null ? void 0 : e.setChildFormRef) == null || o.call(e, null);
|
|
59
59
|
});
|
|
60
|
-
const
|
|
61
|
-
console.log("setLoading", e),
|
|
62
|
-
},
|
|
60
|
+
const B = (e) => {
|
|
61
|
+
console.log("setLoading", e), g.value = e;
|
|
62
|
+
}, T = (e) => {
|
|
63
63
|
t.options.title = e;
|
|
64
|
-
},
|
|
64
|
+
}, j = () => {
|
|
65
65
|
l.value = !0;
|
|
66
|
-
},
|
|
67
|
-
console.log(32132312132), l.value = !0,
|
|
66
|
+
}, E = async () => {
|
|
67
|
+
console.log(32132312132), l.value = !0, W(async () => {
|
|
68
68
|
var e, o;
|
|
69
69
|
t.options.readMode && ((e = s.value) == null || e.setReadMode(!0)), console.log({
|
|
70
70
|
...t.vfCtx,
|
|
71
71
|
instance: a
|
|
72
|
-
}), await
|
|
72
|
+
}), await O([], t.options.formCode), (o = s.value) == null || o.setDialogOrDrawerRef(a), t.parentFormRef && t.parentFormRef.setChildFormRef(s.value), b();
|
|
73
73
|
});
|
|
74
|
-
},
|
|
74
|
+
}, M = () => {
|
|
75
75
|
t.options.onDialogBeforeClose && new Function("done", t.options.onDialogBeforeClose).call(a) === !1 || (l.value = !1);
|
|
76
76
|
}, c = () => {
|
|
77
77
|
if (t.options.onDialogBeforeClose) {
|
|
@@ -79,24 +79,27 @@ const q = { class: "dialog-content" }, ne = /* @__PURE__ */ M({
|
|
|
79
79
|
return console.log(e), e.call(a);
|
|
80
80
|
}
|
|
81
81
|
return !0;
|
|
82
|
-
}, g = () => {
|
|
83
|
-
c() && (l.value = !1);
|
|
84
82
|
}, v = () => {
|
|
83
|
+
c() && (l.value = !1);
|
|
84
|
+
}, b = () => {
|
|
85
85
|
t.options.onDialogOpened && new Function(t.options.onDialogOpened).call(a);
|
|
86
|
-
},
|
|
87
|
-
return
|
|
86
|
+
}, C = () => t.parentFormRef;
|
|
87
|
+
return F({
|
|
88
|
+
setDisabled: (e) => {
|
|
89
|
+
m.value = e;
|
|
90
|
+
},
|
|
88
91
|
setleftText: (e) => {
|
|
89
92
|
p.value = e;
|
|
90
93
|
},
|
|
91
|
-
setLoading:
|
|
92
|
-
setTitle:
|
|
93
|
-
beforeOpen:
|
|
94
|
-
show:
|
|
95
|
-
close:
|
|
94
|
+
setLoading: B,
|
|
95
|
+
setTitle: T,
|
|
96
|
+
beforeOpen: j,
|
|
97
|
+
show: E,
|
|
98
|
+
close: M,
|
|
96
99
|
handleBeforeClose: c,
|
|
97
|
-
handleCloseEvent:
|
|
98
|
-
handleOpenedEvent:
|
|
99
|
-
getParentFormRef:
|
|
100
|
+
handleCloseEvent: v,
|
|
101
|
+
handleOpenedEvent: b,
|
|
102
|
+
getParentFormRef: C,
|
|
100
103
|
getFormRef: () => (console.log("getFormRef"), s.value),
|
|
101
104
|
getWidgetRef: (e, o = !1) => {
|
|
102
105
|
var i;
|
|
@@ -108,50 +111,51 @@ const q = { class: "dialog-content" }, ne = /* @__PURE__ */ M({
|
|
|
108
111
|
},
|
|
109
112
|
getExtraData: () => t.extraData
|
|
110
113
|
}), (e, o) => {
|
|
111
|
-
const i =
|
|
112
|
-
return
|
|
114
|
+
const i = I("loading");
|
|
115
|
+
return y(), J(d(A), N({
|
|
113
116
|
class: "tpf-model design-model",
|
|
114
117
|
destroyOnClose: !0,
|
|
115
118
|
title: n.options.title,
|
|
116
119
|
bodyStyle: {
|
|
117
|
-
height:
|
|
120
|
+
height: h.value,
|
|
118
121
|
overflow: "auto",
|
|
119
122
|
...JSON.parse(n.options.bodyStyle || "{}")
|
|
120
123
|
},
|
|
121
124
|
centered: !0,
|
|
122
125
|
visible: l.value,
|
|
123
|
-
"onUpdate:visible": o[1] || (o[1] = (
|
|
126
|
+
"onUpdate:visible": o[1] || (o[1] = (f) => l.value = f),
|
|
124
127
|
width: n.options.width,
|
|
125
128
|
mask: n.options.showModal,
|
|
126
129
|
maskClosable: n.options.closeOnClickModal,
|
|
127
130
|
keyboard: n.options.closeOnPressEscape,
|
|
128
|
-
onCancel:
|
|
131
|
+
onCancel: v,
|
|
129
132
|
"left-num": p.value
|
|
130
|
-
},
|
|
131
|
-
footerRight:
|
|
132
|
-
|
|
133
|
+
}, k.value), {
|
|
134
|
+
footerRight: x(() => [
|
|
135
|
+
R($, {
|
|
136
|
+
disabled: m.value,
|
|
133
137
|
"dialog-visible": l.value,
|
|
134
|
-
"onUpdate:dialogVisible": o[0] || (o[0] = (
|
|
138
|
+
"onUpdate:dialogVisible": o[0] || (o[0] = (f) => l.value = f),
|
|
135
139
|
handleBeforeClose: c,
|
|
136
140
|
options: n.options,
|
|
137
|
-
ctx:
|
|
138
|
-
}, null, 8, ["dialog-visible", "options", "ctx"])
|
|
141
|
+
ctx: d(s)
|
|
142
|
+
}, null, 8, ["disabled", "dialog-visible", "options", "ctx"])
|
|
139
143
|
]),
|
|
140
|
-
default:
|
|
141
|
-
|
|
142
|
-
|
|
144
|
+
default: x(() => [
|
|
145
|
+
P((y(), U("div", z, [
|
|
146
|
+
R(d(D), {
|
|
143
147
|
ref_key: "vfdRef",
|
|
144
148
|
ref: s,
|
|
145
149
|
vfCtx: {
|
|
146
150
|
...n.vfCtx,
|
|
147
|
-
instance:
|
|
151
|
+
instance: d(a)
|
|
148
152
|
},
|
|
149
|
-
"parent-form":
|
|
153
|
+
"parent-form": w.value,
|
|
150
154
|
"disabled-mode": n.options.disabledMode,
|
|
151
155
|
"dynamic-creation": !0
|
|
152
156
|
}, null, 8, ["vfCtx", "parent-form", "disabled-mode"])
|
|
153
157
|
])), [
|
|
154
|
-
[i,
|
|
158
|
+
[i, g.value]
|
|
155
159
|
])
|
|
156
160
|
]),
|
|
157
161
|
_: 1
|
|
@@ -160,5 +164,5 @@ const q = { class: "dialog-content" }, ne = /* @__PURE__ */ M({
|
|
|
160
164
|
}
|
|
161
165
|
});
|
|
162
166
|
export {
|
|
163
|
-
|
|
167
|
+
ae as default
|
|
164
168
|
};
|
|
@@ -1,70 +1,74 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useLowcode as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { TpfConfigProvider as
|
|
6
|
-
import { Skeleton as
|
|
1
|
+
import { defineComponent as N, getCurrentInstance as R, useAttrs as T, ref as f, computed as c, onMounted as $, createBlock as M, openBlock as B, unref as r, withCtx as n, createVNode as s, mergeProps as D, nextTick as L } from "vue";
|
|
2
|
+
import { useLowcode as P } from "../../../hooks/useLowcode.js";
|
|
3
|
+
import U from "../../form-render/SubmitButtonRender.vue.js";
|
|
4
|
+
import A from "../../form-render/index.vue.js";
|
|
5
|
+
import { TpfConfigProvider as F, TpfModal as I } from "tmgc2-share";
|
|
6
|
+
import { Skeleton as J } from "ant-design-vue";
|
|
7
7
|
import "../../../utils/i18n.js";
|
|
8
|
-
const
|
|
8
|
+
const H = /* @__PURE__ */ N({
|
|
9
9
|
__name: "CustomerModal",
|
|
10
10
|
props: {
|
|
11
11
|
title: {},
|
|
12
12
|
type: {},
|
|
13
13
|
formCode: {}
|
|
14
14
|
},
|
|
15
|
-
setup(
|
|
16
|
-
expose:
|
|
15
|
+
setup(v, {
|
|
16
|
+
expose: g
|
|
17
17
|
}) {
|
|
18
|
-
const u =
|
|
19
|
-
var
|
|
18
|
+
const u = R(), i = T() || {}, l = f(!1), e = v, C = c(() => {
|
|
19
|
+
var t, o;
|
|
20
20
|
return {
|
|
21
21
|
$router: u.proxy.$router,
|
|
22
|
-
_id: ((
|
|
22
|
+
_id: ((o = (t = i == null ? void 0 : i.row) == null ? void 0 : t.record) == null ? void 0 : o._id) || null,
|
|
23
23
|
type: e.type,
|
|
24
24
|
instance: u,
|
|
25
25
|
...i
|
|
26
26
|
};
|
|
27
|
-
}), {
|
|
28
|
-
vfdRef:
|
|
29
|
-
formConfig:
|
|
27
|
+
}), d = f(!1), {
|
|
28
|
+
vfdRef: p,
|
|
29
|
+
formConfig: b,
|
|
30
30
|
getComponentJson: x,
|
|
31
31
|
isLoading: y
|
|
32
|
-
} =
|
|
32
|
+
} = P({
|
|
33
33
|
formCode: e.formCode,
|
|
34
34
|
type: e.type
|
|
35
|
-
}),
|
|
35
|
+
}), m = f(null), _ = c(() => (console.log({
|
|
36
36
|
props: e
|
|
37
|
-
}), e.title ? e.title : e.type === "add" ? "新增" : e.type === "edit" ? "编辑" : e.type === "view" ? "查看" : "新增")),
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
|
|
37
|
+
}), e.title ? e.title : e.type === "add" ? "新增" : e.type === "edit" ? "编辑" : e.type === "view" ? "查看" : "新增")), w = async () => {
|
|
38
|
+
l.value = !0, await L(), await x([]), console.log("attrs", i);
|
|
39
|
+
}, k = (t) => {
|
|
40
|
+
m.value = t;
|
|
41
|
+
}, V = (t) => {
|
|
42
|
+
d.value = t;
|
|
41
43
|
};
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
-
}),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
return $(() => {
|
|
45
|
+
w();
|
|
46
|
+
}), g({
|
|
47
|
+
setDisabled: V,
|
|
48
|
+
setleftText: k
|
|
49
|
+
}), (t, o) => (B(), M(r(F), null, {
|
|
50
|
+
default: n(() => [s(r(I), D({
|
|
51
|
+
visible: l.value,
|
|
52
|
+
"onUpdate:visible": o[1] || (o[1] = (a) => l.value = a)
|
|
53
|
+
}, t.$attrs, {
|
|
51
54
|
title: _.value,
|
|
52
|
-
leftNum:
|
|
55
|
+
leftNum: m.value
|
|
53
56
|
}), {
|
|
54
|
-
footerRight:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
footerRight: n(() => [s(U, {
|
|
58
|
+
disabled: d.value,
|
|
59
|
+
dialogVisible: l.value,
|
|
60
|
+
"onUpdate:dialogVisible": o[0] || (o[0] = (a) => l.value = a),
|
|
61
|
+
options: r(b),
|
|
62
|
+
ctx: r(p)
|
|
63
|
+
}, null, 8, ["disabled", "dialogVisible", "options", "ctx"])]),
|
|
64
|
+
default: n(() => [s(r(J), {
|
|
61
65
|
active: "",
|
|
62
66
|
loading: r(y)
|
|
63
67
|
}, {
|
|
64
|
-
default:
|
|
65
|
-
vfCtx:
|
|
68
|
+
default: n(() => [s(A, {
|
|
69
|
+
vfCtx: C.value,
|
|
66
70
|
ref_key: "vfdRef",
|
|
67
|
-
ref:
|
|
71
|
+
ref: p
|
|
68
72
|
}, null, 8, ["vfCtx"])]),
|
|
69
73
|
_: 1
|
|
70
74
|
}, 8, ["loading"])]),
|
|
@@ -75,5 +79,5 @@ const E = /* @__PURE__ */ k({
|
|
|
75
79
|
}
|
|
76
80
|
});
|
|
77
81
|
export {
|
|
78
|
-
|
|
82
|
+
H as default
|
|
79
83
|
};
|