@kp-ui/lowcode 2.14.0-beta.15 → 2.14.0-beta.17
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/form-designer/form-widget/field-widget/diy-compontent-widget.vue.js +4 -4
- package/src/components/form-designer/widget-panel/PanelItemDrag.vue.js +10 -10
- package/src/components/form-render/SubmitButtonRender.vue.js +25 -19
- package/src/components/form-render/dynamic-dialog.vue.js +28 -22
- package/src/components/public/CustomerModal/CustomerModal.vue2.js +29 -28
- package/src/utils/asyncExecuteFunction.js +4 -0
- package/stats.html +1 -1
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import m from "../../../../utils/emitter.js";
|
|
|
3
3
|
import s from "../../../../utils/i18n.js";
|
|
4
4
|
import a from "./fieldMixin.js";
|
|
5
5
|
import { executeFunction as f } from "../../../../utils/executeFunction.js";
|
|
6
|
-
import { resolveComponent as l, createBlock as t, openBlock as n, withCtx as
|
|
6
|
+
import { resolveComponent as l, createBlock as t, openBlock as n, withCtx as u, createElementVNode as c, resolveDynamicComponent as p } from "vue";
|
|
7
7
|
import b from "../../../../../_virtual/_plugin-vue_export-helper.js";
|
|
8
8
|
const x = {
|
|
9
9
|
name: "diy-compontent-widget",
|
|
@@ -80,9 +80,9 @@ function w(o, _, e, h, y, r) {
|
|
|
80
80
|
"sub-form-col-index": e.subFormColIndex,
|
|
81
81
|
"sub-form-row-id": e.subFormRowId
|
|
82
82
|
}, {
|
|
83
|
-
default:
|
|
84
|
-
|
|
85
|
-
(n(), t(p(r.renderCompont)))
|
|
83
|
+
default: u(() => [
|
|
84
|
+
c("div", g, [
|
|
85
|
+
(n(), t(p(r.renderCompont), { ref: "fieldEditor" }, null, 512))
|
|
86
86
|
])
|
|
87
87
|
]),
|
|
88
88
|
_: 1
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { defineComponent as d, createBlock as g, openBlock as m, unref as o, withCtx as p, createElementVNode as i, createVNode as u, createTextVNode as f, toDisplayString as h } from "vue";
|
|
2
|
-
import { SvgIcon as
|
|
3
|
-
import { useI18n as
|
|
2
|
+
import { SvgIcon as y } from "tmgc2-share";
|
|
3
|
+
import { useI18n as k } from "../../../utils/i18n.js";
|
|
4
4
|
import _ from "../../../lib/vuedraggable/src/vuedraggable.js";
|
|
5
|
-
const
|
|
5
|
+
const C = ["title", "onDblclick"], x = /* @__PURE__ */ d({
|
|
6
6
|
name: "PanelItemDrag",
|
|
7
7
|
__name: "PanelItemDrag",
|
|
8
8
|
props: {
|
|
9
9
|
designer: {},
|
|
10
10
|
items: {}
|
|
11
11
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const { i18n2t:
|
|
12
|
+
setup(r) {
|
|
13
|
+
const { i18n2t: s } = k(), n = r, l = (e) => e.category === "container" ? n.designer.copyNewContainerWidget(e) : n.designer.copyNewFieldWidget(e), a = (e) => n.designer.checkWidgetMove(e), c = (e) => {
|
|
14
14
|
n.designer.addWidget(e);
|
|
15
15
|
};
|
|
16
16
|
return (e, v) => (m(), g(o(_), {
|
|
@@ -18,7 +18,7 @@ const y = ["title", "onDblclick"], x = /* @__PURE__ */ d({
|
|
|
18
18
|
list: e.items,
|
|
19
19
|
"item-key": "key",
|
|
20
20
|
group: { name: "dragGroup", pull: "clone", put: !1 },
|
|
21
|
-
clone:
|
|
21
|
+
clone: l,
|
|
22
22
|
"ghost-class": "ghost",
|
|
23
23
|
sort: !1,
|
|
24
24
|
move: a
|
|
@@ -27,19 +27,19 @@ const y = ["title", "onDblclick"], x = /* @__PURE__ */ d({
|
|
|
27
27
|
i("li", {
|
|
28
28
|
class: "container-widget-item",
|
|
29
29
|
title: t.displayName,
|
|
30
|
-
onDblclick: (
|
|
30
|
+
onDblclick: (w) => c(t)
|
|
31
31
|
}, [
|
|
32
32
|
i("span", null, [
|
|
33
|
-
u(o(
|
|
33
|
+
u(o(y), {
|
|
34
34
|
"icon-class": "icon-" + t.icon,
|
|
35
35
|
class: "color-svg-icon"
|
|
36
36
|
}, null, 8, ["icon-class"]),
|
|
37
|
-
f(" " + h(o(
|
|
37
|
+
f(" " + h(o(s)(
|
|
38
38
|
`designer.widgetLabel.${t.type}`,
|
|
39
39
|
`extension.widgetLabel.${t.type}`
|
|
40
40
|
)), 1)
|
|
41
41
|
])
|
|
42
|
-
], 40,
|
|
42
|
+
], 40, C)
|
|
43
43
|
]),
|
|
44
44
|
_: 1
|
|
45
45
|
}, 8, ["list"]));
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as L, 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
|
+
import { asyncExecuteFunction as y } from "../../utils/asyncExecuteFunction.js";
|
|
2
3
|
import { executeFunction as C } from "../../utils/executeFunction.js";
|
|
3
|
-
import { useI18n as
|
|
4
|
-
const
|
|
4
|
+
import { useI18n as V } from "../../utils/i18n.js";
|
|
5
|
+
const E = /* @__PURE__ */ L({
|
|
5
6
|
__name: "SubmitButtonRender",
|
|
6
7
|
props: {
|
|
7
8
|
goBack: { type: Function },
|
|
@@ -11,8 +12,8 @@ const D = /* @__PURE__ */ F({
|
|
|
11
12
|
ctx: {}
|
|
12
13
|
},
|
|
13
14
|
emits: ["update:dialogVisible"],
|
|
14
|
-
setup(
|
|
15
|
-
const e =
|
|
15
|
+
setup(g, { emit: _ }) {
|
|
16
|
+
const e = g, h = _, l = p(!1), i = p(!1), { i18nt: d } = V(), c = a(() => (e == null ? void 0 : e.options) ?? {}), x = a(() => c.value.cancelButtonHidden != null ? c.value.cancelButtonHidden === 0 : 1), b = a(() => c.value.okButtonHidden != null ? c.value.okButtonHidden === 0 : 1), w = a(
|
|
16
17
|
() => {
|
|
17
18
|
var t;
|
|
18
19
|
return ((t = e.options) == null ? void 0 : t.cancelButtonLabel) || d("designer.hint.cancel");
|
|
@@ -23,15 +24,18 @@ const D = /* @__PURE__ */ F({
|
|
|
23
24
|
return ((t = e.options) == null ? void 0 : t.okButtonLabel) || d("designer.hint.confirm");
|
|
24
25
|
}
|
|
25
26
|
), f = () => {
|
|
26
|
-
|
|
27
|
-
},
|
|
27
|
+
h("update:dialogVisible", !1), e.deleteWrapperNode && setTimeout(e.deleteWrapperNode, 150);
|
|
28
|
+
}, F = async () => {
|
|
28
29
|
var t, n;
|
|
29
30
|
if (!i.value)
|
|
30
31
|
try {
|
|
31
|
-
if (i.value = !0, e.handleBeforeClose && !((t = e == null ? void 0 : e.handleBeforeClose) != null && t.call(e))
|
|
32
|
+
if (i.value = !0, e.handleBeforeClose && !((t = e == null ? void 0 : e.handleBeforeClose) != null && t.call(e)))
|
|
33
|
+
return;
|
|
34
|
+
const o = await C({
|
|
32
35
|
context: e.ctx,
|
|
33
36
|
functionBody: ((n = e.options) == null ? void 0 : n.onCancelButtonClick) || ""
|
|
34
|
-
})
|
|
37
|
+
});
|
|
38
|
+
if (await y(o) === !1) return;
|
|
35
39
|
e.goBack ? e.goBack() : f();
|
|
36
40
|
} catch (o) {
|
|
37
41
|
console.error("取消操作失败:", o);
|
|
@@ -42,10 +46,12 @@ const D = /* @__PURE__ */ F({
|
|
|
42
46
|
var t;
|
|
43
47
|
if (!l.value)
|
|
44
48
|
try {
|
|
45
|
-
|
|
49
|
+
l.value = !0;
|
|
50
|
+
const n = C({
|
|
46
51
|
context: e.ctx,
|
|
47
52
|
functionBody: ((t = e.options) == null ? void 0 : t.onOkButtonClick) || ""
|
|
48
|
-
})
|
|
53
|
+
});
|
|
54
|
+
if (await y(n) === !1) return;
|
|
49
55
|
f();
|
|
50
56
|
} catch (n) {
|
|
51
57
|
console.error("提交操作失败:", n);
|
|
@@ -54,20 +60,20 @@ const D = /* @__PURE__ */ F({
|
|
|
54
60
|
}
|
|
55
61
|
};
|
|
56
62
|
return (t, n) => {
|
|
57
|
-
const o =
|
|
63
|
+
const o = m("a-button"), S = m("a-space");
|
|
58
64
|
return r(), u(S, { x: 8 }, {
|
|
59
65
|
default: s(() => [
|
|
60
|
-
|
|
66
|
+
x.value ? (r(), u(o, {
|
|
61
67
|
key: "cancelButtonHidden",
|
|
62
68
|
loading: i.value,
|
|
63
|
-
onClick:
|
|
69
|
+
onClick: F
|
|
64
70
|
}, {
|
|
65
71
|
default: s(() => [
|
|
66
|
-
k(v(
|
|
72
|
+
k(v(w.value), 1)
|
|
67
73
|
]),
|
|
68
74
|
_: 1
|
|
69
|
-
}, 8, ["loading"])) :
|
|
70
|
-
|
|
75
|
+
}, 8, ["loading"])) : B("", !0),
|
|
76
|
+
b.value ? (r(), u(o, {
|
|
71
77
|
type: "primary",
|
|
72
78
|
key: "okButtonHidden",
|
|
73
79
|
loading: l.value,
|
|
@@ -77,7 +83,7 @@ const D = /* @__PURE__ */ F({
|
|
|
77
83
|
k(v(H.value), 1)
|
|
78
84
|
]),
|
|
79
85
|
_: 1
|
|
80
|
-
}, 8, ["loading"])) :
|
|
86
|
+
}, 8, ["loading"])) : B("", !0)
|
|
81
87
|
]),
|
|
82
88
|
_: 1
|
|
83
89
|
});
|
|
@@ -85,5 +91,5 @@ const D = /* @__PURE__ */ F({
|
|
|
85
91
|
}
|
|
86
92
|
});
|
|
87
93
|
export {
|
|
88
|
-
|
|
94
|
+
E as default
|
|
89
95
|
};
|
|
@@ -2,7 +2,7 @@ import { defineComponent as E, defineAsyncComponent as M, computed as c, ref as
|
|
|
2
2
|
import { TpfModal as W } from "tmgc2-share";
|
|
3
3
|
import A from "./SubmitButtonRender.vue.js";
|
|
4
4
|
import { useLowcode as N } from "../../hooks/useLowcode.js";
|
|
5
|
-
const $ = { class: "dialog-content" },
|
|
5
|
+
const $ = { class: "dialog-content" }, oe = /* @__PURE__ */ E({
|
|
6
6
|
name: "dynamic-dialog",
|
|
7
7
|
__name: "dynamic-dialog",
|
|
8
8
|
props: {
|
|
@@ -44,8 +44,8 @@ const $ = { class: "dialog-content" }, te = /* @__PURE__ */ E({
|
|
|
44
44
|
default: null
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
|
-
setup(n, { expose:
|
|
48
|
-
const
|
|
47
|
+
setup(n, { expose: R }) {
|
|
48
|
+
const F = M(() => import("./index.vue.js")), e = n, x = c(() => e.options.height || "500px"), u = v(!1), a = v(!1), i = S(), { vfdRef: l, formConfig: q, getComponentJson: D, goBack: z } = N({
|
|
49
49
|
formCode: e.options.formCode,
|
|
50
50
|
...e.vfCtx
|
|
51
51
|
}), h = c(() => ({
|
|
@@ -54,28 +54,34 @@ const $ = { class: "dialog-content" }, te = /* @__PURE__ */ E({
|
|
|
54
54
|
getParentFormRef: g
|
|
55
55
|
})), O = c(() => e.options.cancelButtonHidden && e.options.okButtonHidden ? { footer: null } : {});
|
|
56
56
|
L(() => {
|
|
57
|
-
var
|
|
58
|
-
console.log(e.parentFormRef), (
|
|
57
|
+
var o, t;
|
|
58
|
+
console.log(e.parentFormRef), (t = (o = e.parentFormRef) == null ? void 0 : o.setChildFormRef) == null || t.call(o, null);
|
|
59
59
|
});
|
|
60
|
-
const w = (
|
|
61
|
-
console.log("setLoading",
|
|
62
|
-
}, k = (
|
|
63
|
-
e.options.title =
|
|
60
|
+
const w = (o) => {
|
|
61
|
+
console.log("setLoading", o), u.value = o;
|
|
62
|
+
}, k = (o) => {
|
|
63
|
+
e.options.title = o;
|
|
64
64
|
}, B = () => {
|
|
65
65
|
a.value = !0;
|
|
66
66
|
}, j = async () => {
|
|
67
67
|
a.value = !0, U(async () => {
|
|
68
|
-
var
|
|
69
|
-
e.options.readMode && ((
|
|
68
|
+
var o, t;
|
|
69
|
+
e.options.readMode && ((o = l.value) == null || o.setReadMode(!0)), await D([], e.options.formCode), (t = l.value) == null || t.setDialogOrDrawerRef(i), e.parentFormRef && e.parentFormRef.setChildFormRef(l.value), m();
|
|
70
70
|
});
|
|
71
71
|
}, T = () => {
|
|
72
72
|
e.options.onDialogBeforeClose && new Function("done", e.options.onDialogBeforeClose).call(i) === !1 || (a.value = !1);
|
|
73
|
-
}, r = () =>
|
|
73
|
+
}, r = () => {
|
|
74
|
+
if (e.options.onDialogBeforeClose) {
|
|
75
|
+
const o = new Function(e.options.onDialogBeforeClose);
|
|
76
|
+
return console.log(o), o.call(i);
|
|
77
|
+
}
|
|
78
|
+
return !0;
|
|
79
|
+
}, p = () => {
|
|
74
80
|
r() && (a.value = !1);
|
|
75
81
|
}, m = () => {
|
|
76
82
|
e.options.onDialogOpened && new Function(e.options.onDialogOpened).call(i);
|
|
77
83
|
}, g = () => e.parentFormRef;
|
|
78
|
-
return
|
|
84
|
+
return R({
|
|
79
85
|
setLoading: w,
|
|
80
86
|
setTitle: k,
|
|
81
87
|
beforeOpen: B,
|
|
@@ -86,16 +92,16 @@ const $ = { class: "dialog-content" }, te = /* @__PURE__ */ E({
|
|
|
86
92
|
handleOpenedEvent: m,
|
|
87
93
|
getParentFormRef: g,
|
|
88
94
|
getFormRef: () => (console.log("getFormRef"), l.value),
|
|
89
|
-
getWidgetRef: (
|
|
95
|
+
getWidgetRef: (o, t = !1) => {
|
|
90
96
|
var s;
|
|
91
|
-
return (s = l.value) == null ? void 0 : s.getWidgetRef(
|
|
97
|
+
return (s = l.value) == null ? void 0 : s.getWidgetRef(o, t);
|
|
92
98
|
},
|
|
93
99
|
updateTable: () => {
|
|
94
|
-
var
|
|
95
|
-
(s = (
|
|
100
|
+
var o, t, s;
|
|
101
|
+
(s = (t = (o = e.vfCtx) == null ? void 0 : o.parent) == null ? void 0 : t.exposed) != null && s.updateTable && e.vfCtx.parent.exposed.updateTable();
|
|
96
102
|
},
|
|
97
103
|
getExtraData: () => e.extraData
|
|
98
|
-
}), (
|
|
104
|
+
}), (o, t) => {
|
|
99
105
|
const s = V("loading");
|
|
100
106
|
return b(), H(f(W), I({
|
|
101
107
|
class: "tpf-model design-model",
|
|
@@ -108,7 +114,7 @@ const $ = { class: "dialog-content" }, te = /* @__PURE__ */ E({
|
|
|
108
114
|
},
|
|
109
115
|
centered: !0,
|
|
110
116
|
visible: a.value,
|
|
111
|
-
"onUpdate:visible":
|
|
117
|
+
"onUpdate:visible": t[1] || (t[1] = (d) => a.value = d),
|
|
112
118
|
width: n.options.width,
|
|
113
119
|
mask: n.options.showModal,
|
|
114
120
|
maskClosable: n.options.closeOnClickModal,
|
|
@@ -118,7 +124,7 @@ const $ = { class: "dialog-content" }, te = /* @__PURE__ */ E({
|
|
|
118
124
|
footerRight: C(() => [
|
|
119
125
|
y(A, {
|
|
120
126
|
"dialog-visible": a.value,
|
|
121
|
-
"onUpdate:dialogVisible":
|
|
127
|
+
"onUpdate:dialogVisible": t[0] || (t[0] = (d) => a.value = d),
|
|
122
128
|
handleBeforeClose: r,
|
|
123
129
|
options: n.options,
|
|
124
130
|
ctx: f(l)
|
|
@@ -126,7 +132,7 @@ const $ = { class: "dialog-content" }, te = /* @__PURE__ */ E({
|
|
|
126
132
|
]),
|
|
127
133
|
default: C(() => [
|
|
128
134
|
J((b(), P("div", $, [
|
|
129
|
-
y(f(
|
|
135
|
+
y(f(F), {
|
|
130
136
|
ref_key: "vfdRef",
|
|
131
137
|
ref: l,
|
|
132
138
|
vfCtx: n.vfCtx,
|
|
@@ -144,5 +150,5 @@ const $ = { class: "dialog-content" }, te = /* @__PURE__ */ E({
|
|
|
144
150
|
}
|
|
145
151
|
});
|
|
146
152
|
export {
|
|
147
|
-
|
|
153
|
+
oe as default
|
|
148
154
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as x, getCurrentInstance as _, useAttrs as b, ref as w, computed as
|
|
2
|
-
import { useLowcode as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { TpfConfigProvider as
|
|
6
|
-
import { Skeleton as
|
|
1
|
+
import { defineComponent as x, getCurrentInstance as _, useAttrs as b, ref as w, computed as u, onMounted as k, createBlock as B, openBlock as V, unref as t, withCtx as l, createVNode as s, mergeProps as R, nextTick as $ } from "vue";
|
|
2
|
+
import { useLowcode as h } from "../../../hooks/useLowcode.js";
|
|
3
|
+
import M from "../../form-render/SubmitButtonRender.vue.js";
|
|
4
|
+
import T from "../../form-render/index.vue.js";
|
|
5
|
+
import { TpfConfigProvider as L, TpfModal as P } from "tmgc2-share";
|
|
6
|
+
import { Skeleton as U } from "ant-design-vue";
|
|
7
7
|
import "../../../utils/i18n.js";
|
|
8
8
|
const q = /* @__PURE__ */ x({
|
|
9
9
|
__name: "CustomerModal",
|
|
@@ -12,52 +12,53 @@ const q = /* @__PURE__ */ x({
|
|
|
12
12
|
type: {},
|
|
13
13
|
formCode: {}
|
|
14
14
|
},
|
|
15
|
-
setup(
|
|
16
|
-
const a = _(), r = b() || {}, i = w(!1), e =
|
|
17
|
-
var n,
|
|
15
|
+
setup(p) {
|
|
16
|
+
const a = _(), r = b() || {}, i = w(!1), e = p, m = u(() => {
|
|
17
|
+
var n, o;
|
|
18
18
|
return {
|
|
19
19
|
$router: a.proxy.$router,
|
|
20
|
-
_id: ((
|
|
20
|
+
_id: ((o = (n = r == null ? void 0 : r.row) == null ? void 0 : n.record) == null ? void 0 : o._id) || null,
|
|
21
21
|
type: e.type,
|
|
22
22
|
instance: a,
|
|
23
23
|
...r
|
|
24
24
|
};
|
|
25
25
|
}), {
|
|
26
|
-
vfdRef:
|
|
26
|
+
vfdRef: d,
|
|
27
27
|
formConfig: c,
|
|
28
28
|
getComponentJson: v,
|
|
29
|
-
isLoading:
|
|
30
|
-
} =
|
|
29
|
+
isLoading: C
|
|
30
|
+
} = h({
|
|
31
31
|
formCode: e.formCode,
|
|
32
32
|
type: e.type
|
|
33
|
-
}),
|
|
33
|
+
}), g = u(() => (console.log({
|
|
34
34
|
props: e
|
|
35
35
|
}), e.title ? e.title : e.type === "add" ? "新增" : e.type === "edit" ? "编辑" : e.type === "view" ? "查看" : "新增")), y = async () => {
|
|
36
|
-
i.value = !0, await
|
|
36
|
+
i.value = !0, await $(), await v([]), console.log("attrs", r);
|
|
37
37
|
};
|
|
38
38
|
return k(() => {
|
|
39
39
|
y();
|
|
40
|
-
}), (n,
|
|
41
|
-
default: l(() => [s(
|
|
40
|
+
}), (n, o) => (V(), B(t(L), null, {
|
|
41
|
+
default: l(() => [s(t(P), R({
|
|
42
42
|
visible: i.value,
|
|
43
|
-
"onUpdate:visible":
|
|
43
|
+
"onUpdate:visible": o[1] || (o[1] = (f) => i.value = f)
|
|
44
44
|
}, n.$attrs, {
|
|
45
|
-
title:
|
|
45
|
+
title: g.value
|
|
46
46
|
}), {
|
|
47
|
-
footerRight: l(() => [s(
|
|
47
|
+
footerRight: l(() => [s(M, {
|
|
48
48
|
dialogVisible: i.value,
|
|
49
|
-
"onUpdate:dialogVisible":
|
|
50
|
-
options:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
"onUpdate:dialogVisible": o[0] || (o[0] = (f) => i.value = f),
|
|
50
|
+
options: t(c),
|
|
51
|
+
handleBeforeClose: n.handleBeforeClose,
|
|
52
|
+
ctx: t(d)
|
|
53
|
+
}, null, 8, ["dialogVisible", "options", "handleBeforeClose", "ctx"])]),
|
|
54
|
+
default: l(() => [s(t(U), {
|
|
54
55
|
active: "",
|
|
55
|
-
loading:
|
|
56
|
+
loading: t(C)
|
|
56
57
|
}, {
|
|
57
|
-
default: l(() => [s(
|
|
58
|
+
default: l(() => [s(T, {
|
|
58
59
|
vfCtx: m.value,
|
|
59
60
|
ref_key: "vfdRef",
|
|
60
|
-
ref:
|
|
61
|
+
ref: d
|
|
61
62
|
}, null, 8, ["vfCtx"])]),
|
|
62
63
|
_: 1
|
|
63
64
|
}, 8, ["loading"])]),
|