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