@kp-ui/lowcode 2.14.0-beta.5 → 2.14.0-beta.6
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/useFormRender.js +17 -0
- package/src/components/form-designer/form-widget/container-widget/data-table-widget.vue.js +12 -12
- package/src/components/form-designer/form-widget/container-widget/data-table-widget.vue2.js +18 -20
- package/src/components/form-designer/form-widget/container-widget/vf-box-item.vue.js +9 -9
- package/src/components/form-designer/form-widget/field-widget/fieldMixin.js +4 -1
- package/src/components/form-designer/setting-panel/form-setting.vue.js +2 -2
- package/src/components/form-designer/setting-panel/form-setting.vue2.js +81 -94
- package/src/components/form-designer/setting-panel/index.vue.js +2 -2
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue.js +3 -3
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue2.js +7 -7
- package/src/components/form-render/RenderWigetList.vue.js +60 -0
- package/src/components/form-render/RenderWigetList.vue2.js +4 -0
- package/src/components/form-render/SubmitButtonRender.vue.js +33 -29
- package/src/components/form-render/container-item/container-item-wrapper.vue.js +2 -23
- package/src/components/form-render/container-item/container-item-wrapper.vue2.js +20 -0
- package/src/components/form-render/container-item/data-table-item.vue.js +22 -36
- package/src/components/form-render/container-item/grid-item.vue.js +7 -7
- package/src/components/form-render/container-item/grid-sub-form-item.vue.js +1 -1
- package/src/components/form-render/container-item/sub-form-item.vue.js +1 -1
- package/src/components/form-render/container-item/tab-item.vue.js +19 -19
- package/src/components/form-render/container-item/table-item.vue.js +7 -7
- package/src/components/form-render/container-item/vf-collapse-item.vue.js +27 -27
- package/src/components/form-render/dynamic-dialog.vue.js +70 -85
- package/src/components/form-render/index.vue.js +69 -98
- package/src/hooks/useLowcode.js +40 -39
- package/src/lang/en-US.js +3 -0
- package/src/lang/zh-CN.js +3 -0
- package/src/mixins/useDataTableMixin.js +18 -23
- package/stats.html +1 -1
- package/styles/style.css +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import L from "./container-item-wrapper.
|
|
1
|
+
import L from "./container-item-wrapper.vue2.js";
|
|
2
2
|
import I from "../../../utils/emitter.js";
|
|
3
|
-
import { defineAsyncComponent as j, resolveComponent as f, withDirectives as F, createBlock as s, openBlock as
|
|
3
|
+
import { defineAsyncComponent as j, resolveComponent as f, withDirectives as F, createBlock as s, openBlock as o, withCtx as d, createElementVNode as C, createVNode as c, createElementBlock as m, createCommentVNode as _, normalizeClass as S, Fragment as u, renderList as l, resolveDynamicComponent as g, createSlots as p, renderSlot as w, mergeProps as h, Transition as D, normalizeStyle as N, vShow as O } from "vue";
|
|
4
4
|
import M from "../../../utils/i18n.js";
|
|
5
5
|
import T from "../../form-designer/form-widget/field-widget/index.js";
|
|
6
6
|
import B from "../refMixin.js";
|
|
@@ -106,10 +106,10 @@ const E = {
|
|
|
106
106
|
},
|
|
107
107
|
async loadFormCode(t) {
|
|
108
108
|
if (t) {
|
|
109
|
-
const
|
|
109
|
+
const y = await this.$http.get("/api/tmgc2-query/dataQuery/detail/FormDefinitionManagement", {
|
|
110
110
|
params: { code: t }
|
|
111
111
|
}).then((e) => e.data.object.frontendDefinition || "{}");
|
|
112
|
-
this.$refs.dFormRef.setFormJson(JSON.parse(
|
|
112
|
+
this.$refs.dFormRef.setFormJson(JSON.parse(y));
|
|
113
113
|
}
|
|
114
114
|
},
|
|
115
115
|
handleOnCreated() {
|
|
@@ -123,9 +123,9 @@ const E = {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
}, P = { class: "tpf-collapse" }, q = { class: "tpf-collapse-header" };
|
|
126
|
-
function G(t,
|
|
126
|
+
function G(t, y, e, Q, U, b) {
|
|
127
127
|
const R = f("TpfCollapseTitle"), v = f("SvgIcon"), k = f("a-space"), x = f("container-item-wrapper");
|
|
128
|
-
return F((
|
|
128
|
+
return F((o(), s(x, { widget: e.widget }, {
|
|
129
129
|
default: d(() => [
|
|
130
130
|
C("div", P, [
|
|
131
131
|
C("div", q, [
|
|
@@ -144,12 +144,12 @@ function G(t, _, e, Q, U, b) {
|
|
|
144
144
|
]),
|
|
145
145
|
_: 1
|
|
146
146
|
}),
|
|
147
|
-
e.widget.options.isCollapse ?
|
|
147
|
+
e.widget.options.isCollapse ? _("", !0) : (o(), m("div", {
|
|
148
148
|
key: 0,
|
|
149
149
|
class: S(["header-right", b.rightSlotCss])
|
|
150
150
|
}, [
|
|
151
|
-
e.widget.headerRightSlotList && e.widget.headerRightSlotList.length > 0 ? (
|
|
152
|
-
n.category === "container" ? (
|
|
151
|
+
e.widget.headerRightSlotList && e.widget.headerRightSlotList.length > 0 ? (o(!0), m(u, { key: 0 }, l(e.widget.headerRightSlotList, (n, a) => (o(), m(u, null, [
|
|
152
|
+
n.category === "container" ? (o(), s(g(t.getComponentByContainer(n)), {
|
|
153
153
|
widget: n,
|
|
154
154
|
key: a,
|
|
155
155
|
"parent-list": e.widget.headerRightSlotList,
|
|
@@ -160,13 +160,13 @@ function G(t, _, e, Q, U, b) {
|
|
|
160
160
|
"sub-form-col-index": e.subFormColIndex,
|
|
161
161
|
data: e.model[e.widget.options.name]
|
|
162
162
|
}, p({ _: 2 }, [
|
|
163
|
-
l(Object.keys(t.$slots), (
|
|
164
|
-
name:
|
|
163
|
+
l(Object.keys(t.$slots), (i) => ({
|
|
164
|
+
name: i,
|
|
165
165
|
fn: d((r) => [
|
|
166
|
-
w(t.$slots,
|
|
166
|
+
w(t.$slots, i, h({ ref_for: !0 }, r), void 0, !0)
|
|
167
167
|
])
|
|
168
168
|
}))
|
|
169
|
-
]), 1032, ["widget", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index", "data"])) : (
|
|
169
|
+
]), 1032, ["widget", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index", "data"])) : (o(), s(g(n.type + "-widget"), {
|
|
170
170
|
field: n,
|
|
171
171
|
designer: null,
|
|
172
172
|
key: a,
|
|
@@ -174,14 +174,14 @@ function G(t, _, e, Q, U, b) {
|
|
|
174
174
|
"index-of-parent-list": a,
|
|
175
175
|
"parent-widget": e.widget
|
|
176
176
|
}, p({ _: 2 }, [
|
|
177
|
-
l(Object.keys(t.$slots), (
|
|
178
|
-
name:
|
|
177
|
+
l(Object.keys(t.$slots), (i) => ({
|
|
178
|
+
name: i,
|
|
179
179
|
fn: d((r) => [
|
|
180
|
-
w(t.$slots,
|
|
180
|
+
w(t.$slots, i, h({ ref_for: !0 }, r), void 0, !0)
|
|
181
181
|
])
|
|
182
182
|
}))
|
|
183
183
|
]), 1032, ["field", "parent-list", "index-of-parent-list", "parent-widget"]))
|
|
184
|
-
], 64))), 256)) :
|
|
184
|
+
], 64))), 256)) : _("", !0)
|
|
185
185
|
], 2))
|
|
186
186
|
]),
|
|
187
187
|
c(D, {
|
|
@@ -198,8 +198,8 @@ function G(t, _, e, Q, U, b) {
|
|
|
198
198
|
...JSON.parse(e.widget.options.bodyStyle || "{}")
|
|
199
199
|
})
|
|
200
200
|
}, [
|
|
201
|
-
e.widget.defaultSlotsList && e.widget.defaultSlotsList.length > 0 ? (
|
|
202
|
-
n.category === "container" ? (
|
|
201
|
+
e.widget.defaultSlotsList && e.widget.defaultSlotsList.length > 0 ? (o(!0), m(u, { key: 0 }, l(e.widget.defaultSlotsList, (n, a) => (o(), m(u, null, [
|
|
202
|
+
n.category === "container" ? (o(), s(g(t.getComponentByContainer(n)), {
|
|
203
203
|
widget: n,
|
|
204
204
|
key: a,
|
|
205
205
|
"parent-list": e.widget.defaultSlotsList,
|
|
@@ -211,13 +211,13 @@ function G(t, _, e, Q, U, b) {
|
|
|
211
211
|
data: e.model[n.options.name],
|
|
212
212
|
model: e.model
|
|
213
213
|
}, p({ _: 2 }, [
|
|
214
|
-
l(Object.keys(t.$slots), (
|
|
215
|
-
name:
|
|
214
|
+
l(Object.keys(t.$slots), (i) => ({
|
|
215
|
+
name: i,
|
|
216
216
|
fn: d((r) => [
|
|
217
|
-
w(t.$slots,
|
|
217
|
+
w(t.$slots, i, h({ ref_for: !0 }, r), void 0, !0)
|
|
218
218
|
])
|
|
219
219
|
}))
|
|
220
|
-
]), 1032, ["widget", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index", "data", "model"])) : (
|
|
220
|
+
]), 1032, ["widget", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index", "data", "model"])) : (o(), s(g(n.type + "-widget"), {
|
|
221
221
|
field: n,
|
|
222
222
|
designer: null,
|
|
223
223
|
key: a,
|
|
@@ -225,14 +225,14 @@ function G(t, _, e, Q, U, b) {
|
|
|
225
225
|
"index-of-parent-list": a,
|
|
226
226
|
"parent-widget": e.widget
|
|
227
227
|
}, p({ _: 2 }, [
|
|
228
|
-
l(Object.keys(t.$slots), (
|
|
229
|
-
name:
|
|
228
|
+
l(Object.keys(t.$slots), (i) => ({
|
|
229
|
+
name: i,
|
|
230
230
|
fn: d((r) => [
|
|
231
|
-
w(t.$slots,
|
|
231
|
+
w(t.$slots, i, h({ ref_for: !0 }, r), void 0, !0)
|
|
232
232
|
])
|
|
233
233
|
}))
|
|
234
234
|
]), 1032, ["field", "parent-list", "index-of-parent-list", "parent-widget"]))
|
|
235
|
-
], 64))), 256)) :
|
|
235
|
+
], 64))), 256)) : _("", !0)
|
|
236
236
|
], 4), [
|
|
237
237
|
[O, !e.widget.options.isCollapse]
|
|
238
238
|
])
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { defineComponent as T, defineAsyncComponent as E, ref as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { defineComponent as T, defineAsyncComponent as E, ref as g, getCurrentInstance as M, computed as v, onBeforeUnmount as S, resolveDirective as L, createBlock as V, openBlock as b, unref as c, mergeProps as I, withCtx as C, withDirectives as J, createElementBlock as P, createVNode as y, nextTick as U } from "vue";
|
|
2
|
+
import { TpfModal as W } from "tmgc2-share";
|
|
3
|
+
import A from "./SubmitButtonRender.vue.js";
|
|
4
|
+
import { useLowcode as H } from "../../hooks/useLowcode.js";
|
|
5
|
+
const N = { class: "dialog-content" }, ee = /* @__PURE__ */ T({
|
|
5
6
|
name: "dynamic-dialog",
|
|
6
7
|
__name: "dynamic-dialog",
|
|
7
8
|
props: {
|
|
@@ -43,71 +44,60 @@ const $ = { class: "dialog-content" }, ee = /* @__PURE__ */ T({
|
|
|
43
44
|
default: null
|
|
44
45
|
}
|
|
45
46
|
},
|
|
46
|
-
setup(n, { expose:
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
47
|
+
setup(n, { expose: F }) {
|
|
48
|
+
const R = E(() => import("./index.vue.js")), e = n, f = g(!1), a = g(!1), i = M(), { vfdRef: l, formConfig: $, getComponentJson: x, goBack: q } = H({
|
|
49
|
+
formCode: e.options.formCode,
|
|
50
|
+
...e.vfCtx
|
|
51
|
+
}), D = v(() => ({
|
|
52
|
+
...e.parentFormRef,
|
|
53
|
+
parentDom: i,
|
|
54
|
+
getParentFormRef: m
|
|
55
|
+
})), O = v(() => e.options.cancelButtonHidden && e.options.okButtonHidden ? { footer: null } : {});
|
|
56
|
+
S(() => {
|
|
57
|
+
var t, o;
|
|
58
|
+
console.log(e.parentFormRef), (o = (t = e.parentFormRef) == null ? void 0 : t.setChildFormRef) == null || o.call(t, null);
|
|
55
59
|
});
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
i.value = !1;
|
|
68
|
-
}
|
|
69
|
-
}, O = (e) => {
|
|
70
|
-
console.log("setLoading", e), i.value = e;
|
|
71
|
-
}, w = (e) => {
|
|
72
|
-
a.value.setFormJson(e);
|
|
73
|
-
}, k = (e) => {
|
|
74
|
-
o.options.title = e;
|
|
75
|
-
}, j = () => {
|
|
76
|
-
l.value = !0;
|
|
77
|
-
}, B = () => {
|
|
78
|
-
l.value = !0, W(() => {
|
|
79
|
-
var e;
|
|
80
|
-
o.options.readMode && a.value.setReadMode(!0), m(), console.log(a.value), (e = a.value) == null || e.setDialogOrDrawerRef(d), o.parentFormRef && o.parentFormRef.setChildFormRef(a.value), g();
|
|
60
|
+
const h = (t) => {
|
|
61
|
+
console.log("setLoading", t), f.value = t;
|
|
62
|
+
}, w = (t) => {
|
|
63
|
+
e.options.title = t;
|
|
64
|
+
}, k = () => {
|
|
65
|
+
a.value = !0;
|
|
66
|
+
}, B = async () => {
|
|
67
|
+
a.value = !0, U(async () => {
|
|
68
|
+
var t, o;
|
|
69
|
+
e.options.readMode && ((t = l.value) == null || t.setReadMode(!0)), await x([], e.options.formCode), (o = l.value) == null || o.setDialogOrDrawerRef(i), e.parentFormRef && e.parentFormRef.setChildFormRef(l.value), p();
|
|
81
70
|
});
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
},
|
|
89
|
-
return
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
setTitle: k,
|
|
94
|
-
beforeOpen: j,
|
|
71
|
+
}, j = () => {
|
|
72
|
+
e.options.onDialogBeforeClose && new Function("done", e.options.onDialogBeforeClose).call(i) === !1 || (a.value = !1);
|
|
73
|
+
}, r = () => e.options.onDialogBeforeClose ? new Function(e.options.onDialogBeforeClose).call(i) : !0, u = () => {
|
|
74
|
+
r() && (a.value = !1);
|
|
75
|
+
}, p = () => {
|
|
76
|
+
e.options.onDialogOpened && new Function(e.options.onDialogOpened).call(i);
|
|
77
|
+
}, m = () => e.parentFormRef;
|
|
78
|
+
return F({
|
|
79
|
+
setLoading: h,
|
|
80
|
+
setTitle: w,
|
|
81
|
+
beforeOpen: k,
|
|
95
82
|
show: B,
|
|
96
|
-
close:
|
|
97
|
-
handleBeforeClose:
|
|
98
|
-
handleCloseEvent:
|
|
99
|
-
handleOpenedEvent:
|
|
100
|
-
getParentFormRef:
|
|
101
|
-
getFormRef: () => (console.log("getFormRef"),
|
|
102
|
-
getWidgetRef: (
|
|
83
|
+
close: j,
|
|
84
|
+
handleBeforeClose: r,
|
|
85
|
+
handleCloseEvent: u,
|
|
86
|
+
handleOpenedEvent: p,
|
|
87
|
+
getParentFormRef: m,
|
|
88
|
+
getFormRef: () => (console.log("getFormRef"), l.value),
|
|
89
|
+
getWidgetRef: (t, o = !1) => {
|
|
90
|
+
var s;
|
|
91
|
+
return (s = l.value) == null ? void 0 : s.getWidgetRef(t, o);
|
|
92
|
+
},
|
|
103
93
|
updateTable: () => {
|
|
104
|
-
var
|
|
105
|
-
(s = (
|
|
94
|
+
var t, o, s;
|
|
95
|
+
(s = (o = (t = e.vfCtx) == null ? void 0 : t.parent) == null ? void 0 : o.exposed) != null && s.updateTable && e.vfCtx.parent.exposed.updateTable();
|
|
106
96
|
},
|
|
107
|
-
getExtraData: () =>
|
|
108
|
-
}), (
|
|
109
|
-
const s =
|
|
110
|
-
return
|
|
97
|
+
getExtraData: () => e.extraData
|
|
98
|
+
}), (t, o) => {
|
|
99
|
+
const s = L("loading");
|
|
100
|
+
return b(), V(c(W), I({
|
|
111
101
|
class: "tpf-model design-model",
|
|
112
102
|
destroyOnClose: !0,
|
|
113
103
|
title: n.options.title,
|
|
@@ -117,40 +107,35 @@ const $ = { class: "dialog-content" }, ee = /* @__PURE__ */ T({
|
|
|
117
107
|
...JSON.parse(n.options.bodyStyle || "{}")
|
|
118
108
|
},
|
|
119
109
|
centered: !0,
|
|
120
|
-
visible:
|
|
121
|
-
"onUpdate:visible":
|
|
110
|
+
visible: a.value,
|
|
111
|
+
"onUpdate:visible": o[1] || (o[1] = (d) => a.value = d),
|
|
122
112
|
width: n.options.width,
|
|
123
113
|
mask: n.options.showModal,
|
|
124
114
|
maskClosable: n.options.closeOnClickModal,
|
|
125
115
|
keyboard: n.options.closeOnPressEscape,
|
|
126
|
-
onCancel:
|
|
127
|
-
},
|
|
116
|
+
onCancel: u
|
|
117
|
+
}, O.value), {
|
|
128
118
|
footerRight: C(() => [
|
|
129
|
-
|
|
130
|
-
"dialog-visible":
|
|
131
|
-
"onUpdate:dialogVisible":
|
|
132
|
-
handleBeforeClose:
|
|
119
|
+
y(A, {
|
|
120
|
+
"dialog-visible": a.value,
|
|
121
|
+
"onUpdate:dialogVisible": o[0] || (o[0] = (d) => a.value = d),
|
|
122
|
+
handleBeforeClose: r,
|
|
133
123
|
options: n.options,
|
|
134
|
-
ctx:
|
|
124
|
+
ctx: c(l)
|
|
135
125
|
}, null, 8, ["dialog-visible", "options", "ctx"])
|
|
136
126
|
]),
|
|
137
127
|
default: C(() => [
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
ref: a,
|
|
143
|
-
"form-json": n.formJson,
|
|
144
|
-
"form-data": n.formData,
|
|
128
|
+
J((b(), P("div", N, [
|
|
129
|
+
y(c(R), {
|
|
130
|
+
ref_key: "vfdRef",
|
|
131
|
+
ref: l,
|
|
145
132
|
vfCtx: n.vfCtx,
|
|
146
|
-
"
|
|
147
|
-
"global-dsv": n.globalDsv,
|
|
148
|
-
"parent-form": h.value,
|
|
133
|
+
"parent-form": D.value,
|
|
149
134
|
"disabled-mode": n.options.disabledMode,
|
|
150
135
|
"dynamic-creation": !0
|
|
151
|
-
}, null, 8, ["
|
|
136
|
+
}, null, 8, ["vfCtx", "parent-form", "disabled-mode"])
|
|
152
137
|
])), [
|
|
153
|
-
[s,
|
|
138
|
+
[s, f.value]
|
|
154
139
|
])
|
|
155
140
|
]),
|
|
156
141
|
_: 1
|