@kp-ui/lowcode 2.15.0-alpha.17 → 2.15.0-alpha.18
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 +1 -1
- package/src/components/FormRender/index.vue.js +2 -2
- package/src/components/FormRender/index.vue2.js +30 -34
- package/src/components/FormRender/useFormContext.js +106 -105
- package/src/components/form-designer/form-widget/container-widget/useTableWidget.js +38 -37
- package/src/components/form-designer/form-widget/field-widget/hooks/useSelect.js +72 -71
- package/src/components/form-designer/useAppRef.js +29 -27
- package/src/components/form-render/SubmitButtonRender.vue.js +15 -17
- package/src/components/form-render/container-items/data-table-widget.vue.js +1 -1
- package/src/components/form-render/container-items/data-table-widget.vue2.js +56 -53
- package/src/components/form-render/container-items/grid-col-widget.vue.js +1 -1
- package/src/components/form-render/container-items/grid-col-widget.vue2.js +19 -17
- package/src/components/form-render/container-items/grid-widget.vue.js +1 -1
- package/src/components/form-render/container-items/grid-widget.vue2.js +18 -16
- package/src/components/form-render/dynamic-dialog.vue.js +56 -52
- package/src/components/public/CustomerModal/CustomerModal.vue2.js +29 -26
- package/stats.html +1 -1
- package/styles/style.css +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as u, resolveComponent as c, createBlock as n, openBlock as t, normalizeProps as f, guardReactiveProps as w, withCtx as i, createElementBlock as d, createCommentVNode as h, unref as C, createVNode as _, Fragment as k, renderList as x } from "vue";
|
|
2
|
+
import E from "./container-wrapper.vue.js";
|
|
3
3
|
import F from "./grid-col-widget.vue.js";
|
|
4
4
|
import { ComponentNameEnum as N, ContainerTypeEnum as v } from "../../../constants/WidgetTypeEnum.js";
|
|
5
5
|
import { useField as y } from "../../form-designer/form-widget/field-widget/useField.js";
|
|
6
6
|
const B = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "grid-container"
|
|
9
|
-
},
|
|
9
|
+
}, V = /* @__PURE__ */ u({
|
|
10
10
|
name: v.grid,
|
|
11
11
|
componentName: N.ContainerWidget,
|
|
12
12
|
__name: "grid-widget",
|
|
@@ -20,23 +20,25 @@ const B = {
|
|
|
20
20
|
subFormRowId: {},
|
|
21
21
|
designer: {}
|
|
22
22
|
},
|
|
23
|
-
setup(a) {
|
|
24
|
-
const
|
|
25
|
-
return (
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
setup(a, { expose: p }) {
|
|
24
|
+
const r = a, { handleHidden: s, defineExposed: m } = y(r);
|
|
25
|
+
return p({
|
|
26
|
+
...m
|
|
27
|
+
}), (e, L) => {
|
|
28
|
+
const l = c("a-row");
|
|
29
|
+
return t(), n(E, f(w(r)), {
|
|
28
30
|
default: i(() => [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
C(s) ? h("", !0) : (t(), d("div", B, [
|
|
32
|
+
_(l, {
|
|
31
33
|
gutter: e.widget.options.gutter
|
|
32
34
|
}, {
|
|
33
35
|
default: i(() => [
|
|
34
|
-
(t(!0), d(
|
|
35
|
-
key:
|
|
36
|
-
field:
|
|
37
|
-
widget:
|
|
36
|
+
(t(!0), d(k, null, x(e.widget.cols, (o, g) => (t(), n(F, {
|
|
37
|
+
key: o.id,
|
|
38
|
+
field: o,
|
|
39
|
+
widget: o,
|
|
38
40
|
"parent-list": e.widget.cols || [],
|
|
39
|
-
"index-of-parent-list":
|
|
41
|
+
"index-of-parent-list": g,
|
|
40
42
|
"parent-widget": e.widget,
|
|
41
43
|
"col-height": e.widget.options.colHeight
|
|
42
44
|
}, null, 8, ["field", "widget", "parent-list", "index-of-parent-list", "parent-widget", "col-height"]))), 128))
|
|
@@ -51,5 +53,5 @@ const B = {
|
|
|
51
53
|
}
|
|
52
54
|
});
|
|
53
55
|
export {
|
|
54
|
-
|
|
56
|
+
V as default
|
|
55
57
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useExecFunction as
|
|
3
|
-
import
|
|
4
|
-
import { useLowcode as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as L, computed as d, ref as u, onBeforeUnmount as P, createBlock as U, openBlock as A, unref as f, mergeProps as I, withCtx as x, createElementVNode as $, createVNode as C, nextTick as q } from "vue";
|
|
2
|
+
import { useExecFunction as z, TpfModal as G } from "tmgc2-share";
|
|
3
|
+
import K from "./SubmitButtonRender.vue.js";
|
|
4
|
+
import { useLowcode as Q } from "../../hooks/useLowcode.js";
|
|
5
|
+
import W from "../FormRender/index.vue.js";
|
|
6
|
+
const X = { class: "dialog-content" }, oe = /* @__PURE__ */ L({
|
|
7
7
|
name: "dynamic-dialog",
|
|
8
8
|
__name: "dynamic-dialog",
|
|
9
9
|
props: {
|
|
@@ -45,16 +45,16 @@ const q = { class: "dialog-content" }, ne = /* @__PURE__ */ M({
|
|
|
45
45
|
default: null
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
-
setup(n, { expose:
|
|
49
|
-
const e = n,
|
|
48
|
+
setup(n, { expose: D }) {
|
|
49
|
+
const e = n, F = d(() => e.options.height || "500px"), c = u(null), p = u(!1), l = u(!1), { context: i, asyncExecuteFunction: m, executeFunction: O } = z(), { vfdRef: s, isLoading: v, getComponentJson: R } = Q({
|
|
50
50
|
formCode: e.options.formCode,
|
|
51
51
|
...e.vfCtx
|
|
52
|
-
}),
|
|
52
|
+
}), h = d(() => ({
|
|
53
53
|
...e.parentFormRef,
|
|
54
|
-
parentDom:
|
|
55
|
-
getParentFormRef:
|
|
56
|
-
})),
|
|
57
|
-
|
|
54
|
+
parentDom: i.value,
|
|
55
|
+
getParentFormRef: y
|
|
56
|
+
})), w = d(() => e.options.cancelButtonHidden && e.options.okButtonHidden ? { footer: null } : {});
|
|
57
|
+
P(() => {
|
|
58
58
|
var t, o;
|
|
59
59
|
console.log(e.parentFormRef), (o = (t = e.parentFormRef) == null ? void 0 : t.setChildFormRef) == null || o.call(t, null);
|
|
60
60
|
});
|
|
@@ -62,56 +62,60 @@ const q = { class: "dialog-content" }, ne = /* @__PURE__ */ M({
|
|
|
62
62
|
v.value = t;
|
|
63
63
|
}, k = (t) => {
|
|
64
64
|
e.options.title = t;
|
|
65
|
-
},
|
|
65
|
+
}, j = () => {
|
|
66
66
|
l.value = !0;
|
|
67
|
-
},
|
|
68
|
-
l.value = !0,
|
|
67
|
+
}, E = () => {
|
|
68
|
+
l.value = !0, q(async () => {
|
|
69
69
|
var t, o, a;
|
|
70
|
-
(t = e.options) != null && t.readMode && ((o = s.value) == null || o.setReadMode(!0)), await
|
|
70
|
+
(t = e.options) != null && t.readMode && ((o = s.value) == null || o.setReadMode(!0)), await R([], e.options.formCode), (a = s.value) == null || a.setDialogOrDrawerRef(i.value), e.parentFormRef && e.parentFormRef.setChildFormRef(s.value), g();
|
|
71
71
|
});
|
|
72
|
-
},
|
|
72
|
+
}, T = async () => {
|
|
73
73
|
if (e.options.onDialogBeforeClose)
|
|
74
74
|
return await m({
|
|
75
75
|
functionBody: e.options.onDialogBeforeClose
|
|
76
76
|
});
|
|
77
77
|
l.value = !1;
|
|
78
78
|
}, b = () => {
|
|
79
|
-
|
|
80
|
-
},
|
|
79
|
+
r() && (l.value = !1);
|
|
80
|
+
}, r = async () => e.options.onDialogBeforeClose ? O({
|
|
81
81
|
functionBody: e.options.onDialogBeforeClose
|
|
82
82
|
}) : !0, g = async () => {
|
|
83
83
|
if (e.options.onDialogOpened)
|
|
84
84
|
return await m({
|
|
85
85
|
functionBody: e.options.onDialogOpened
|
|
86
86
|
});
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
87
|
+
}, y = () => e.parentFormRef, M = () => {
|
|
88
|
+
var t, o, a;
|
|
89
|
+
(a = (o = (t = e.vfCtx) == null ? void 0 : t.parent) == null ? void 0 : o.exposed) != null && a.updateTable && e.vfCtx.parent.exposed.updateTable();
|
|
90
|
+
}, S = () => e.extraData, V = (t) => {
|
|
91
|
+
c.value = t;
|
|
92
|
+
}, N = (t) => {
|
|
93
|
+
p.value = t;
|
|
94
|
+
}, H = () => s.value, J = () => {
|
|
95
|
+
var t;
|
|
96
|
+
return (t = s.value) == null ? void 0 : t.context;
|
|
97
|
+
};
|
|
98
|
+
return D({
|
|
99
|
+
getParentFormRef: y,
|
|
100
|
+
getFormRef: H,
|
|
101
|
+
setDisabled: N,
|
|
102
|
+
setleftText: V,
|
|
96
103
|
setLoading: B,
|
|
97
104
|
setTitle: k,
|
|
98
|
-
beforeOpen:
|
|
99
|
-
show:
|
|
100
|
-
close:
|
|
101
|
-
handleBeforeClose:
|
|
105
|
+
beforeOpen: j,
|
|
106
|
+
show: E,
|
|
107
|
+
close: T,
|
|
108
|
+
handleBeforeClose: r,
|
|
102
109
|
handleCloseEvent: b,
|
|
103
110
|
handleOpenedEvent: g,
|
|
104
|
-
updateTable:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
},
|
|
108
|
-
getExtraData: () => e.extraData
|
|
109
|
-
}), (t, o) => (N(), V(i(U), H({
|
|
111
|
+
updateTable: M,
|
|
112
|
+
getExtraData: S
|
|
113
|
+
}), (t, o) => (A(), U(f(G), I({
|
|
110
114
|
class: "tpf-model design-model",
|
|
111
115
|
destroyOnClose: !0,
|
|
112
116
|
title: n.options.title,
|
|
113
117
|
bodyStyle: {
|
|
114
|
-
height:
|
|
118
|
+
height: F.value,
|
|
115
119
|
overflow: "auto",
|
|
116
120
|
...JSON.parse(n.options.bodyStyle || "{}")
|
|
117
121
|
},
|
|
@@ -124,28 +128,28 @@ const q = { class: "dialog-content" }, ne = /* @__PURE__ */ M({
|
|
|
124
128
|
keyboard: n.options.closeOnPressEscape,
|
|
125
129
|
onCancel: b,
|
|
126
130
|
"left-num": c.value
|
|
127
|
-
},
|
|
128
|
-
footerRight:
|
|
129
|
-
|
|
131
|
+
}, w.value), {
|
|
132
|
+
footerRight: x(() => [
|
|
133
|
+
C(K, {
|
|
130
134
|
disabled: p.value,
|
|
131
135
|
"dialog-visible": l.value,
|
|
132
136
|
"onUpdate:dialogVisible": o[0] || (o[0] = (a) => l.value = a),
|
|
133
|
-
handleBeforeClose:
|
|
137
|
+
handleBeforeClose: r,
|
|
134
138
|
options: n.options,
|
|
135
|
-
ctx:
|
|
139
|
+
ctx: J()
|
|
136
140
|
}, null, 8, ["disabled", "dialog-visible", "options", "ctx"])
|
|
137
141
|
]),
|
|
138
|
-
default:
|
|
139
|
-
|
|
140
|
-
|
|
142
|
+
default: x(() => [
|
|
143
|
+
$("div", X, [
|
|
144
|
+
C(W, {
|
|
141
145
|
ref_key: "vfdRef",
|
|
142
146
|
ref: s,
|
|
143
|
-
loading:
|
|
147
|
+
loading: f(v),
|
|
144
148
|
vfCtx: {
|
|
145
149
|
...n.vfCtx,
|
|
146
|
-
instance: i
|
|
150
|
+
instance: f(i)
|
|
147
151
|
},
|
|
148
|
-
"parent-form":
|
|
152
|
+
"parent-form": h.value,
|
|
149
153
|
"disabled-mode": n.options.disabledMode,
|
|
150
154
|
"dynamic-creation": !0
|
|
151
155
|
}, null, 8, ["loading", "vfCtx", "parent-form", "disabled-mode"])
|
|
@@ -156,5 +160,5 @@ const q = { class: "dialog-content" }, ne = /* @__PURE__ */ M({
|
|
|
156
160
|
}
|
|
157
161
|
});
|
|
158
162
|
export {
|
|
159
|
-
|
|
163
|
+
oe as default
|
|
160
164
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useLowcode as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { TpfConfigProvider as
|
|
6
|
-
import { Skeleton as
|
|
1
|
+
import { defineComponent as R, getCurrentInstance as T, useAttrs as $, ref as f, computed as c, onMounted as M, createBlock as B, openBlock as D, unref as r, withCtx as s, createVNode as a, mergeProps as L, nextTick as P } from "vue";
|
|
2
|
+
import { useLowcode as U } from "../../../hooks/useLowcode.js";
|
|
3
|
+
import A from "../../form-render/SubmitButtonRender.vue.js";
|
|
4
|
+
import F from "../../FormRender/index.vue.js";
|
|
5
|
+
import { TpfConfigProvider as I, TpfModal as J } from "tmgc2-share";
|
|
6
|
+
import { Skeleton as S } from "ant-design-vue";
|
|
7
7
|
import "../../../utils/i18n.js";
|
|
8
|
-
const
|
|
8
|
+
const K = /* @__PURE__ */ R({
|
|
9
9
|
__name: "CustomerModal",
|
|
10
10
|
props: {
|
|
11
11
|
title: {},
|
|
@@ -15,7 +15,7 @@ const H = /* @__PURE__ */ N({
|
|
|
15
15
|
setup(v, {
|
|
16
16
|
expose: g
|
|
17
17
|
}) {
|
|
18
|
-
const u =
|
|
18
|
+
const u = T(), i = $() || {}, l = f(!1), e = v, C = c(() => {
|
|
19
19
|
var t, o;
|
|
20
20
|
return {
|
|
21
21
|
$router: u.proxy.$router,
|
|
@@ -26,44 +26,47 @@ const H = /* @__PURE__ */ N({
|
|
|
26
26
|
};
|
|
27
27
|
}), d = f(!1), {
|
|
28
28
|
vfdRef: p,
|
|
29
|
-
formConfig:
|
|
30
|
-
getComponentJson:
|
|
29
|
+
formConfig: x,
|
|
30
|
+
getComponentJson: b,
|
|
31
31
|
isLoading: y
|
|
32
|
-
} =
|
|
32
|
+
} = U({
|
|
33
33
|
formCode: e.formCode,
|
|
34
34
|
type: e.type
|
|
35
35
|
}), m = f(null), _ = c(() => e.title ? e.title : e.type === "add" ? "新增" : e.type === "edit" ? "编辑" : e.type === "view" ? "查看" : "新增"), w = async () => {
|
|
36
|
-
l.value = !0, await
|
|
36
|
+
l.value = !0, await P(), await b([]), console.log("attrs", i);
|
|
37
37
|
}, k = (t) => {
|
|
38
38
|
m.value = t;
|
|
39
39
|
}, V = (t) => {
|
|
40
40
|
d.value = t;
|
|
41
41
|
};
|
|
42
|
-
return
|
|
42
|
+
return M(() => {
|
|
43
43
|
w();
|
|
44
44
|
}), g({
|
|
45
45
|
setDisabled: V,
|
|
46
46
|
setleftText: k
|
|
47
|
-
}), (t, o) => (
|
|
48
|
-
default:
|
|
47
|
+
}), (t, o) => (D(), B(r(I), null, {
|
|
48
|
+
default: s(() => [a(r(J), L({
|
|
49
49
|
visible: l.value,
|
|
50
|
-
"onUpdate:visible": o[1] || (o[1] = (
|
|
50
|
+
"onUpdate:visible": o[1] || (o[1] = (n) => l.value = n)
|
|
51
51
|
}, t.$attrs, {
|
|
52
52
|
title: _.value,
|
|
53
53
|
leftNum: m.value
|
|
54
54
|
}), {
|
|
55
|
-
footerRight:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
footerRight: s(() => {
|
|
56
|
+
var n;
|
|
57
|
+
return [a(A, {
|
|
58
|
+
disabled: d.value,
|
|
59
|
+
dialogVisible: l.value,
|
|
60
|
+
"onUpdate:dialogVisible": o[0] || (o[0] = (N) => l.value = N),
|
|
61
|
+
options: r(x),
|
|
62
|
+
ctx: (n = r(p)) == null ? void 0 : n.context
|
|
63
|
+
}, null, 8, ["disabled", "dialogVisible", "options", "ctx"])];
|
|
64
|
+
}),
|
|
65
|
+
default: s(() => [a(r(S), {
|
|
63
66
|
active: "",
|
|
64
67
|
loading: r(y)
|
|
65
68
|
}, {
|
|
66
|
-
default:
|
|
69
|
+
default: s(() => [a(F, {
|
|
67
70
|
vfCtx: C.value,
|
|
68
71
|
ref_key: "vfdRef",
|
|
69
72
|
ref: p
|
|
@@ -77,5 +80,5 @@ const H = /* @__PURE__ */ N({
|
|
|
77
80
|
}
|
|
78
81
|
});
|
|
79
82
|
export {
|
|
80
|
-
|
|
83
|
+
K as default
|
|
81
84
|
};
|