@kp-ui/lowcode 2.14.0-beta.6 → 2.14.0-beta.9
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 +9 -8
- package/src/components/form-designer/form-widget/container-widget/index.js +6 -6
- package/src/components/form-designer/form-widget/field-widget/cascader-widget.vue.js +32 -39
- package/src/components/form-designer/form-widget/field-widget/date-range-widget.vue.js +24 -31
- package/src/components/form-designer/form-widget/field-widget/date-widget.vue.js +26 -33
- package/src/components/form-designer/form-widget/field-widget/form-item-wrapper.vue.js +84 -152
- package/src/components/form-designer/form-widget/field-widget/input-widget.vue.js +31 -38
- package/src/components/form-designer/form-widget/field-widget/number-widget.vue.js +23 -30
- package/src/components/form-designer/form-widget/field-widget/select-widget.vue.js +56 -63
- package/src/components/form-designer/form-widget/field-widget/switch-widget.vue.js +1 -1
- package/src/components/form-designer/form-widget/field-widget/textarea-widget.vue.js +23 -32
- package/src/components/form-designer/form-widget/field-widget/treeSelect-widget.vue.js +26 -33
- package/src/components/form-designer/setting-panel/property-editor/index.js +41 -42
- package/src/components/form-designer/setting-panel/propertyRegister.js +0 -1
- package/src/components/form-designer/widget-panel/advanced/cascader.js +0 -1
- package/src/components/form-designer/widget-panel/advanced/file-upload.js +0 -1
- package/src/components/form-designer/widget-panel/advanced/rich-editor.js +4 -5
- package/src/components/form-designer/widget-panel/advanced/tree-select.js +0 -1
- package/src/components/form-designer/widget-panel/basicFields/checkbox.js +2 -3
- package/src/components/form-designer/widget-panel/basicFields/color.js +0 -1
- package/src/components/form-designer/widget-panel/basicFields/date.js +0 -1
- package/src/components/form-designer/widget-panel/basicFields/dateRange.js +0 -1
- package/src/components/form-designer/widget-panel/basicFields/input.js +0 -1
- package/src/components/form-designer/widget-panel/basicFields/number.js +0 -1
- package/src/components/form-designer/widget-panel/basicFields/radio.js +0 -1
- package/src/components/form-designer/widget-panel/basicFields/rate.js +5 -6
- package/src/components/form-designer/widget-panel/basicFields/select.js +2 -3
- package/src/components/form-designer/widget-panel/basicFields/slider.js +0 -1
- package/src/components/form-designer/widget-panel/basicFields/switch.js +0 -1
- package/src/components/form-designer/widget-panel/basicFields/textarea.js +0 -1
- package/src/components/form-designer/widget-panel/basicFields/time.js +0 -1
- package/src/components/form-designer/widget-panel/basicFields/timeRange.js +0 -1
- package/src/components/form-designer/widget-panel/business/department-select.js +0 -1
- package/src/components/form-designer/widget-panel/business/material-select.js +0 -1
- package/src/components/form-designer/widget-panel/business/operation-select.js +2 -3
- package/src/components/form-designer/widget-panel/business/post-select.js +0 -1
- package/src/components/form-designer/widget-panel/business/project-group-select.js +2 -3
- package/src/components/form-designer/widget-panel/business/project-select.js +2 -3
- package/src/components/form-designer/widget-panel/business/user-select.js +0 -1
- package/src/components/form-render/RenderWigetList.vue.js +2 -1
- package/src/components/form-render/container-item/index.js +11 -11
- package/src/components/form-render/container-item/sub-form-item.vue.js +115 -146
- package/src/components/form-render/index.vue.js +47 -37
- package/src/lang/en-US.js +0 -1
- package/src/lang/zh-CN.js +0 -1
- package/stats.html +1 -1
- package/styles/style.css +1 -1
- package/src/components/form-designer/setting-panel/property-editor/labelTooltip-editor.vue.js +0 -31
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import M from "../../../utils/emitter.js";
|
|
2
|
-
import
|
|
3
|
-
import { deepClone as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { SvgIcon as
|
|
9
|
-
import { TpfConfirm as
|
|
10
|
-
import { resolveComponent as
|
|
2
|
+
import T from "../../../utils/i18n.js";
|
|
3
|
+
import { deepClone as I, generateId as _ } from "../../../utils/util.js";
|
|
4
|
+
import N from "../refMixin.js";
|
|
5
|
+
import E from "./container-item-wrapper.vue2.js";
|
|
6
|
+
import V from "./containerItemMixin.js";
|
|
7
|
+
import z from "../../form-designer/form-widget/field-widget/index.js";
|
|
8
|
+
import { SvgIcon as B } from "tmgc2-share";
|
|
9
|
+
import { TpfConfirm as H } from "../../../hooks/TpfConfirm.js";
|
|
10
|
+
import { resolveComponent as C, createBlock as D, openBlock as o, withCtx as r, withDirectives as g, createElementBlock as a, createVNode as d, createElementVNode as c, createCommentVNode as w, toDisplayString as h, createTextVNode as k, Fragment as f, renderList as y, normalizeStyle as A, normalizeClass as j, vShow as S, resolveDynamicComponent as q } from "vue";
|
|
11
11
|
/* empty css */
|
|
12
|
-
import
|
|
13
|
-
const
|
|
12
|
+
import O from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
13
|
+
const P = {
|
|
14
14
|
name: "sub-form-item",
|
|
15
15
|
componentName: "ContainerItem",
|
|
16
|
-
mixins: [M,
|
|
16
|
+
mixins: [M, T, N, V],
|
|
17
17
|
components: {
|
|
18
|
-
ContainerItemWrapper:
|
|
19
|
-
...
|
|
20
|
-
SvgIcon:
|
|
18
|
+
ContainerItemWrapper: E,
|
|
19
|
+
...z,
|
|
20
|
+
SvgIcon: B
|
|
21
21
|
},
|
|
22
22
|
props: {
|
|
23
23
|
widget: Object
|
|
@@ -66,17 +66,17 @@ const U = {
|
|
|
66
66
|
this.rowIdData.splice(0, this.rowIdData.length);
|
|
67
67
|
const t = this.formModel[this.widget.options.name];
|
|
68
68
|
t && t.length > 0 && (t.forEach(() => {
|
|
69
|
-
this.rowIdData.push("id" +
|
|
69
|
+
this.rowIdData.push("id" + _());
|
|
70
70
|
}), e && setTimeout(() => {
|
|
71
71
|
this.handleSubFormRowChange(t);
|
|
72
72
|
}, 800));
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
addToRowIdData() {
|
|
76
|
-
this.rowIdData.push("id" +
|
|
76
|
+
this.rowIdData.push("id" + _());
|
|
77
77
|
},
|
|
78
78
|
insertToRowIdData(e) {
|
|
79
|
-
this.rowIdData.splice(e, 0, "id" +
|
|
79
|
+
this.rowIdData.splice(e, 0, "id" + _());
|
|
80
80
|
},
|
|
81
81
|
deleteFromRowIdData(e) {
|
|
82
82
|
this.rowIdData.splice(e, 1);
|
|
@@ -95,8 +95,8 @@ const U = {
|
|
|
95
95
|
if (this.fieldSchemaData.splice(0, this.fieldSchemaData.length), e > 0)
|
|
96
96
|
for (let t = 0; t < e; t++) {
|
|
97
97
|
const i = [];
|
|
98
|
-
this.widget.widgetList.forEach((
|
|
99
|
-
i.push(this.cloneFieldSchema(
|
|
98
|
+
this.widget.widgetList.forEach((p) => {
|
|
99
|
+
i.push(this.cloneFieldSchema(p));
|
|
100
100
|
}), this.fieldSchemaData.push(i);
|
|
101
101
|
}
|
|
102
102
|
},
|
|
@@ -110,8 +110,8 @@ const U = {
|
|
|
110
110
|
this.fieldSchemaData.splice(e, 1);
|
|
111
111
|
},
|
|
112
112
|
cloneFieldSchema(e) {
|
|
113
|
-
const t =
|
|
114
|
-
return t.id = e.type +
|
|
113
|
+
const t = I(e);
|
|
114
|
+
return t.id = e.type + _(), t;
|
|
115
115
|
},
|
|
116
116
|
initEventHandler() {
|
|
117
117
|
this.widget.type === "sub-form" && this.on$("setFormData", (e) => {
|
|
@@ -138,21 +138,21 @@ const U = {
|
|
|
138
138
|
},
|
|
139
139
|
insertSubFormRow(e) {
|
|
140
140
|
const t = {};
|
|
141
|
-
this.widget.widgetList.forEach((
|
|
142
|
-
|
|
141
|
+
this.widget.widgetList.forEach((p) => {
|
|
142
|
+
p.formItemFlag && (t[p.options.name] = p.options.defaultValue);
|
|
143
143
|
});
|
|
144
144
|
const i = this.formModel[this.widget.options.name] || [];
|
|
145
145
|
i.splice(e, 0, t), this.insertToRowIdData(e), this.addToFieldSchemaData(e), this.handleSubFormRowInsert(i, this.rowIdData[e]), this.handleSubFormRowChange(i);
|
|
146
146
|
},
|
|
147
147
|
deleteSubFormRow(e) {
|
|
148
|
-
|
|
148
|
+
H({
|
|
149
149
|
type: "confirm",
|
|
150
150
|
content: this.i18nt("render.hint.deleteSubFormRow") + "?",
|
|
151
151
|
title: this.i18nt("render.hint.prompt"),
|
|
152
152
|
okText: this.i18nt("render.hint.confirm"),
|
|
153
153
|
cancelText: this.i18nt("render.hint.cancel")
|
|
154
154
|
}).then(() => {
|
|
155
|
-
const t = this.formModel[this.widget.options.name] || [], i =
|
|
155
|
+
const t = this.formModel[this.widget.options.name] || [], i = I(t[e]);
|
|
156
156
|
t.splice(e, 1), this.deleteFromRowIdData(e), this.deleteFromFieldSchemaData(e), this.handleSubFormRowDelete(t, i), this.handleSubFormRowChange(t);
|
|
157
157
|
}).catch(() => {
|
|
158
158
|
});
|
|
@@ -202,123 +202,92 @@ const U = {
|
|
|
202
202
|
this.deleteDisabled = e;
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
-
},
|
|
205
|
+
}, U = { class: "action-header-column" }, G = { class: "action-label" }, J = {
|
|
206
206
|
key: 0,
|
|
207
207
|
class: "row-no-header-column"
|
|
208
|
-
},
|
|
208
|
+
}, K = {
|
|
209
209
|
key: 0,
|
|
210
210
|
class: "custom-label"
|
|
211
|
-
},
|
|
211
|
+
}, Q = { key: 1 }, X = { class: "action-header-column" }, Y = { class: "action-label" }, Z = { class: "sub-form-action-column hide-label" }, W = { class: "action-button-column" }, x = {
|
|
212
212
|
key: 0,
|
|
213
213
|
class: "row-no-column"
|
|
214
|
-
},
|
|
214
|
+
}, $ = {
|
|
215
215
|
key: 0,
|
|
216
216
|
class: "row-number-span"
|
|
217
|
-
},
|
|
218
|
-
function
|
|
219
|
-
const m =
|
|
220
|
-
return
|
|
217
|
+
}, ee = { class: "sub-form-action-column hide-label" }, te = { class: "action-button-column" };
|
|
218
|
+
function ie(e, t, i, p, s, l) {
|
|
219
|
+
const m = C("svg-icon"), F = C("a-button"), v = C("a-row"), L = C("container-item-wrapper");
|
|
220
|
+
return o(), D(L, { widget: i.widget }, {
|
|
221
221
|
default: r(() => [
|
|
222
|
-
|
|
222
|
+
g((o(), a("div", {
|
|
223
223
|
key: i.widget.id,
|
|
224
224
|
class: "sub-form-container"
|
|
225
225
|
}, [
|
|
226
|
-
|
|
226
|
+
d(v, { class: "header-row" }, {
|
|
227
227
|
default: r(() => [
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
228
|
+
c("div", U, [
|
|
229
|
+
c("span", G, h(e.i18nt("render.hint.subFormAction")), 1),
|
|
230
|
+
l.isReadMode ? w("", !0) : (o(), D(F, {
|
|
231
231
|
key: 0,
|
|
232
|
-
disabled:
|
|
232
|
+
disabled: s.actionDisabled || s.insertDisabled,
|
|
233
233
|
shape: "round",
|
|
234
234
|
type: "primary",
|
|
235
235
|
size: "small",
|
|
236
236
|
class: "action-button",
|
|
237
|
-
onClick:
|
|
237
|
+
onClick: l.addSubFormRow,
|
|
238
238
|
title: e.i18nt("render.hint.subFormAddActionHint")
|
|
239
239
|
}, {
|
|
240
240
|
default: r(() => [
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
k(h(e.i18nt("render.hint.subFormAddAction")) + " ", 1),
|
|
242
|
+
d(m, { "icon-class": "icon-el-plus" })
|
|
243
243
|
]),
|
|
244
244
|
_: 1
|
|
245
245
|
}, 8, ["disabled", "onClick", "title"]))
|
|
246
246
|
]),
|
|
247
|
-
i.widget.options.showRowNumber ? (
|
|
248
|
-
|
|
249
|
-
])) :
|
|
250
|
-
(
|
|
251
|
-
key:
|
|
247
|
+
i.widget.options.showRowNumber ? (o(), a("div", J, [
|
|
248
|
+
c("span", null, h(e.i18nt("render.hint.subFormRowNo")), 1)
|
|
249
|
+
])) : w("", !0),
|
|
250
|
+
(o(!0), a(f, null, y(i.widget.widgetList, (n) => (o(), a(f, {
|
|
251
|
+
key: n.id + "thc"
|
|
252
252
|
}, [
|
|
253
|
-
|
|
253
|
+
n.options.hidden ? w("", !0) : (o(), a("div", {
|
|
254
254
|
key: 0,
|
|
255
|
-
class:
|
|
256
|
-
|
|
257
|
-
|
|
255
|
+
class: j(["field-header-column", [
|
|
256
|
+
l.getLabelAlign(i.widget, n),
|
|
257
|
+
n.options.required ? "is-required" : ""
|
|
258
258
|
]]),
|
|
259
|
-
style:
|
|
259
|
+
style: A({ width: n.options.columnWidth })
|
|
260
260
|
}, [
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
D(" " + c(o.options.label), 1)
|
|
275
|
-
], 64)) : (n(), s(h, { key: 1 }, [
|
|
276
|
-
a(m, {
|
|
277
|
-
"icon-class": o.options.labelIconClass
|
|
278
|
-
}, null, 8, ["icon-class"]),
|
|
279
|
-
D(" " + c(o.options.label), 1)
|
|
280
|
-
], 64))
|
|
281
|
-
], 64)) : o.options.labelIconPosition === "rear" ? (n(), s(h, { key: 1 }, [
|
|
282
|
-
o.options.labelTooltip ? (n(), s(h, { key: 0 }, [
|
|
283
|
-
D(c(o.options.label) + " ", 1),
|
|
284
|
-
a(v, {
|
|
285
|
-
title: o.options.labelTooltip
|
|
286
|
-
}, {
|
|
287
|
-
default: r(() => [
|
|
288
|
-
a(m, {
|
|
289
|
-
"icon-class": o.options.labelIconClass
|
|
290
|
-
}, null, 8, ["icon-class"])
|
|
291
|
-
]),
|
|
292
|
-
_: 2
|
|
293
|
-
}, 1032, ["title"])
|
|
294
|
-
], 64)) : (n(), s(h, { key: 1 }, [
|
|
295
|
-
D(c(o.options.label) + " ", 1),
|
|
296
|
-
a(m, {
|
|
297
|
-
"icon-class": o.options.labelIconClass
|
|
298
|
-
}, null, 8, ["icon-class"])
|
|
299
|
-
], 64))
|
|
300
|
-
], 64)) : b("", !0)
|
|
301
|
-
])) : (n(), s("span", {
|
|
302
|
-
key: 1,
|
|
303
|
-
title: o.options.labelTooltip
|
|
304
|
-
}, c(o.options.label), 9, X))
|
|
261
|
+
n.options.labelIconClass ? (o(), a("span", K, [
|
|
262
|
+
n.options.labelIconPosition === "front" ? (o(), a(f, { key: 0 }, [
|
|
263
|
+
d(m, {
|
|
264
|
+
"icon-class": n.options.labelIconClass
|
|
265
|
+
}, null, 8, ["icon-class"]),
|
|
266
|
+
k(" " + h(n.options.label), 1)
|
|
267
|
+
], 64)) : n.options.labelIconPosition === "rear" ? (o(), a(f, { key: 1 }, [
|
|
268
|
+
k(h(n.options.label) + " ", 1),
|
|
269
|
+
d(m, {
|
|
270
|
+
"icon-class": n.options.labelIconClass
|
|
271
|
+
}, null, 8, ["icon-class"])
|
|
272
|
+
], 64)) : w("", !0)
|
|
273
|
+
])) : (o(), a("span", Q, h(n.options.label), 1))
|
|
305
274
|
], 6))
|
|
306
275
|
], 64))), 128)),
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
276
|
+
c("div", X, [
|
|
277
|
+
c("span", Y, h(e.i18nt("render.hint.subFormAction")), 1),
|
|
278
|
+
l.isReadMode ? w("", !0) : (o(), D(F, {
|
|
310
279
|
key: 0,
|
|
311
|
-
disabled:
|
|
280
|
+
disabled: s.actionDisabled || s.insertDisabled,
|
|
312
281
|
shape: "round",
|
|
313
282
|
type: "primary",
|
|
314
283
|
size: "small",
|
|
315
284
|
class: "action-button",
|
|
316
|
-
onClick:
|
|
285
|
+
onClick: l.addSubFormRow,
|
|
317
286
|
title: e.i18nt("render.hint.subFormAddActionHint")
|
|
318
287
|
}, {
|
|
319
288
|
default: r(() => [
|
|
320
|
-
|
|
321
|
-
|
|
289
|
+
k(h(e.i18nt("render.hint.subFormAddAction")) + " ", 1),
|
|
290
|
+
d(m, { "icon-class": "icon-el-plus" })
|
|
322
291
|
]),
|
|
323
292
|
_: 1
|
|
324
293
|
}, 8, ["disabled", "onClick", "title"]))
|
|
@@ -326,90 +295,90 @@ function oe(e, t, i, f, l, d) {
|
|
|
326
295
|
]),
|
|
327
296
|
_: 1
|
|
328
297
|
}),
|
|
329
|
-
(
|
|
298
|
+
(o(!0), a(f, null, y(s.rowIdData, (n, u) => (o(), D(v, {
|
|
330
299
|
class: "sub-form-row",
|
|
331
|
-
key:
|
|
300
|
+
key: n
|
|
332
301
|
}, {
|
|
333
302
|
default: r(() => [
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
disabled:
|
|
303
|
+
c("div", Z, [
|
|
304
|
+
c("div", W, [
|
|
305
|
+
g(d(F, {
|
|
306
|
+
disabled: s.actionDisabled || s.insertDisabled,
|
|
338
307
|
shape: "circle",
|
|
339
|
-
onClick: (
|
|
308
|
+
onClick: (b) => l.insertSubFormRow(u),
|
|
340
309
|
title: e.i18nt("render.hint.insertSubFormRow")
|
|
341
310
|
}, {
|
|
342
311
|
default: r(() => [
|
|
343
|
-
|
|
312
|
+
d(m, { "icon-class": "icon-el-plus" })
|
|
344
313
|
]),
|
|
345
314
|
_: 2
|
|
346
315
|
}, 1032, ["disabled", "onClick", "title"]), [
|
|
347
|
-
[
|
|
316
|
+
[S, !l.isReadMode]
|
|
348
317
|
]),
|
|
349
|
-
|
|
350
|
-
disabled:
|
|
318
|
+
g(d(F, {
|
|
319
|
+
disabled: s.actionDisabled || s.deleteDisabled,
|
|
351
320
|
shape: "circle",
|
|
352
|
-
onClick: (
|
|
321
|
+
onClick: (b) => l.deleteSubFormRow(u),
|
|
353
322
|
title: e.i18nt("render.hint.deleteSubFormRow")
|
|
354
323
|
}, {
|
|
355
324
|
default: r(() => [
|
|
356
|
-
|
|
325
|
+
d(m, { "icon-class": "icon-el-delete" })
|
|
357
326
|
]),
|
|
358
327
|
_: 2
|
|
359
328
|
}, 1032, ["disabled", "onClick", "title"]), [
|
|
360
|
-
[
|
|
329
|
+
[S, !l.isReadMode]
|
|
361
330
|
])
|
|
362
331
|
])
|
|
363
332
|
]),
|
|
364
|
-
i.widget.options.showRowNumber ? (
|
|
365
|
-
i.widget.options.showRowNumber ? (
|
|
366
|
-
])) :
|
|
367
|
-
(
|
|
368
|
-
key:
|
|
333
|
+
i.widget.options.showRowNumber ? (o(), a("div", x, [
|
|
334
|
+
i.widget.options.showRowNumber ? (o(), a("span", $, "#" + h(u + 1), 1)) : w("", !0)
|
|
335
|
+
])) : w("", !0),
|
|
336
|
+
(o(!0), a(f, null, y(i.widget.widgetList, (b, R) => (o(), a(f, {
|
|
337
|
+
key: s.fieldSchemaData[u][R].id
|
|
369
338
|
}, [
|
|
370
|
-
|
|
339
|
+
b.options.hidden ? w("", !0) : (o(), a("div", {
|
|
371
340
|
key: 0,
|
|
372
341
|
class: "sub-form-table-column hide-label",
|
|
373
|
-
style:
|
|
342
|
+
style: A({ width: b.options.columnWidth })
|
|
374
343
|
}, [
|
|
375
|
-
(
|
|
376
|
-
field:
|
|
344
|
+
(o(), D(q(b.type + "-widget"), {
|
|
345
|
+
field: s.fieldSchemaData[u][R],
|
|
377
346
|
"parent-list": i.widget.widgetList,
|
|
378
|
-
"index-of-parent-list":
|
|
347
|
+
"index-of-parent-list": R,
|
|
379
348
|
"parent-widget": i.widget,
|
|
380
|
-
"sub-form-row-id":
|
|
381
|
-
"sub-form-row-index":
|
|
382
|
-
"sub-form-col-index":
|
|
349
|
+
"sub-form-row-id": n,
|
|
350
|
+
"sub-form-row-index": u,
|
|
351
|
+
"sub-form-col-index": R
|
|
383
352
|
}, null, 8, ["field", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index"]))
|
|
384
353
|
], 4))
|
|
385
354
|
], 64))), 128)),
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
disabled:
|
|
355
|
+
c("div", ee, [
|
|
356
|
+
c("div", te, [
|
|
357
|
+
g(d(F, {
|
|
358
|
+
disabled: s.actionDisabled || s.insertDisabled,
|
|
390
359
|
shape: "circle",
|
|
391
|
-
onClick: (
|
|
360
|
+
onClick: (b) => l.insertSubFormRow(u),
|
|
392
361
|
title: e.i18nt("render.hint.insertSubFormRow")
|
|
393
362
|
}, {
|
|
394
363
|
default: r(() => [
|
|
395
|
-
|
|
364
|
+
d(m, { "icon-class": "icon-el-plus" })
|
|
396
365
|
]),
|
|
397
366
|
_: 2
|
|
398
367
|
}, 1032, ["disabled", "onClick", "title"]), [
|
|
399
|
-
[
|
|
368
|
+
[S, !l.isReadMode]
|
|
400
369
|
]),
|
|
401
|
-
|
|
402
|
-
disabled:
|
|
370
|
+
g(d(F, {
|
|
371
|
+
disabled: s.actionDisabled || s.deleteDisabled,
|
|
403
372
|
shape: "circle",
|
|
404
|
-
onClick: (
|
|
373
|
+
onClick: (b) => l.deleteSubFormRow(u),
|
|
405
374
|
title: e.i18nt("render.hint.deleteSubFormRow")
|
|
406
375
|
}, {
|
|
407
376
|
default: r(() => [
|
|
408
|
-
|
|
377
|
+
d(m, { "icon-class": "icon-el-delete" })
|
|
409
378
|
]),
|
|
410
379
|
_: 2
|
|
411
380
|
}, 1032, ["disabled", "onClick", "title"]), [
|
|
412
|
-
[
|
|
381
|
+
[S, !l.isReadMode]
|
|
413
382
|
])
|
|
414
383
|
])
|
|
415
384
|
])
|
|
@@ -417,13 +386,13 @@ function oe(e, t, i, f, l, d) {
|
|
|
417
386
|
_: 2
|
|
418
387
|
}, 1024))), 128))
|
|
419
388
|
])), [
|
|
420
|
-
[
|
|
389
|
+
[S, !i.widget.options.hidden]
|
|
421
390
|
])
|
|
422
391
|
]),
|
|
423
392
|
_: 1
|
|
424
393
|
}, 8, ["widget"]);
|
|
425
394
|
}
|
|
426
|
-
const
|
|
395
|
+
const be = /* @__PURE__ */ O(P, [["render", ie], ["__scopeId", "data-v-18c22eeb"]]);
|
|
427
396
|
export {
|
|
428
|
-
|
|
397
|
+
be as default
|
|
429
398
|
};
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { resolveComponent as h, createElementBlock as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { useI18n as
|
|
5
|
-
import
|
|
6
|
-
import { buildDefaultFormJson as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
1
|
+
import { resolveComponent as h, createElementBlock as W, openBlock as S, Fragment as v, createVNode as d, withCtx as u, createElementVNode as O, normalizeStyle as M, withKeys as w, normalizeClass as E, mergeProps as V, render as j } from "vue";
|
|
2
|
+
import x from "../../utils/emitter.js";
|
|
3
|
+
import A from "../form-designer/form-widget/field-widget/index.js";
|
|
4
|
+
import { useI18n as k } from "@kp-ui/i18n";
|
|
5
|
+
import _ from "./RenderWigetList.vue.js";
|
|
6
|
+
import { buildDefaultFormJson as $, getContainerWidgetByName as g, cloneFormConfigWithoutEventHandler as p, deepClone as f, getDSByName as F, overwriteObj as m, runDataSourceRequest as b, getAllContainerWidgets as B, getAllFieldWidgets as J, getDefaultFormConfig as P, traverseFieldWidgets as H, getFieldWidgetByName as D, traverseFieldWidgetsOfContainer as T, insertCustomCssToHead as z, insertGlobalFunctionsToHtml as K, generateId as c } from "../../utils/util.js";
|
|
7
|
+
import G, { setLangMessages as q } from "../../utils/i18n.js";
|
|
8
|
+
import U from "./dynamic-dialog.vue.js";
|
|
9
9
|
/* empty css */
|
|
10
|
-
import
|
|
10
|
+
import N from "./dynamic-drawer.vue.js";
|
|
11
11
|
import { fmtHttpParams as C } from "../../utils/request/fmtHttpParams.js";
|
|
12
|
+
import { executeFunction as y } from "../../utils/executeFunction.js";
|
|
12
13
|
/* empty css */
|
|
13
|
-
import
|
|
14
|
-
const
|
|
14
|
+
import Q from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
15
|
+
const X = {
|
|
15
16
|
name: "VFormRender",
|
|
16
17
|
componentName: "VFormRender",
|
|
17
18
|
inheritAttrs: !1,
|
|
18
|
-
mixins: [
|
|
19
|
+
mixins: [x, G],
|
|
19
20
|
components: {
|
|
20
|
-
RenderWigetList:
|
|
21
|
-
DynamicDialog:
|
|
22
|
-
...
|
|
21
|
+
RenderWigetList: _,
|
|
22
|
+
DynamicDialog: U,
|
|
23
|
+
...A
|
|
23
24
|
},
|
|
24
25
|
props: {
|
|
25
26
|
vfCtx: {
|
|
@@ -29,7 +30,7 @@ const Q = {
|
|
|
29
30
|
formJson: {
|
|
30
31
|
//prop传入的表单JSON配置
|
|
31
32
|
type: Object,
|
|
32
|
-
default: () =>
|
|
33
|
+
default: () => $()
|
|
33
34
|
},
|
|
34
35
|
formData: {
|
|
35
36
|
//prop传入的表单数据
|
|
@@ -209,14 +210,14 @@ const Q = {
|
|
|
209
210
|
return t.type + "-widget";
|
|
210
211
|
},
|
|
211
212
|
initLocale() {
|
|
212
|
-
const { t, messages: e } =
|
|
213
|
-
i &&
|
|
213
|
+
const { t, messages: e } = k(), i = e.value[this.getLocale];
|
|
214
|
+
i && q(this.getLocale, i.lang), this.changeLanguage(this.getLocale);
|
|
214
215
|
},
|
|
215
216
|
insertCustomStyleAndScriptNode() {
|
|
216
|
-
this.formConfig && this.formConfig.cssCode &&
|
|
217
|
+
this.formConfig && this.formConfig.cssCode && z(
|
|
217
218
|
this.formConfig.cssCode,
|
|
218
219
|
this.previewState ? "" : this.formId
|
|
219
|
-
), this.formConfig && this.formConfig.functions &&
|
|
220
|
+
), this.formConfig && this.formConfig.functions && K(
|
|
220
221
|
this.formConfig.functions,
|
|
221
222
|
this.previewState ? "" : this.formId
|
|
222
223
|
);
|
|
@@ -267,7 +268,7 @@ const Q = {
|
|
|
267
268
|
this.formDataModel[e] = f(i);
|
|
268
269
|
} else {
|
|
269
270
|
const i = [];
|
|
270
|
-
|
|
271
|
+
T(t, (r) => {
|
|
271
272
|
i.push(r);
|
|
272
273
|
});
|
|
273
274
|
const s = {};
|
|
@@ -341,7 +342,16 @@ const Q = {
|
|
|
341
342
|
this.formConfig && this.formConfig.onFormCreated && new Function(this.formConfig.onFormCreated).call(this);
|
|
342
343
|
},
|
|
343
344
|
onFormEnterKey() {
|
|
344
|
-
|
|
345
|
+
if (this.formConfig && this.formConfig.onFormEnterKey) {
|
|
346
|
+
const t = y({
|
|
347
|
+
functionBody: this.formConfig.onFormEnterKey,
|
|
348
|
+
context: this
|
|
349
|
+
});
|
|
350
|
+
t && y({
|
|
351
|
+
functionBody: t,
|
|
352
|
+
context: this
|
|
353
|
+
});
|
|
354
|
+
}
|
|
345
355
|
},
|
|
346
356
|
handleOnMounted() {
|
|
347
357
|
this.formConfig && this.formConfig.onFormMounted && new Function(this.formConfig.onFormMounted).call(this);
|
|
@@ -382,7 +392,7 @@ const Q = {
|
|
|
382
392
|
const o = (s, r) => {
|
|
383
393
|
s.options && s.options.name === t && (i = r.options.name);
|
|
384
394
|
};
|
|
385
|
-
if (
|
|
395
|
+
if (H(this.widgetList, o), i) {
|
|
386
396
|
const s = this.getWidgetRef(i);
|
|
387
397
|
if (s) {
|
|
388
398
|
const r = s.getRowIdData();
|
|
@@ -600,7 +610,7 @@ const Q = {
|
|
|
600
610
|
* @returns {*[]}
|
|
601
611
|
*/
|
|
602
612
|
getContainerWidgets() {
|
|
603
|
-
return
|
|
613
|
+
return B(this.formJsonObj.widgetList);
|
|
604
614
|
},
|
|
605
615
|
/**
|
|
606
616
|
* 增加外部组件引用,可通过getEC()方法获取外部组件,以便在VForm内部调用外部组件方法
|
|
@@ -735,7 +745,7 @@ const Q = {
|
|
|
735
745
|
const r = {
|
|
736
746
|
widgetList: f(s.widgetList),
|
|
737
747
|
formConfig: p(o.formConfig)
|
|
738
|
-
}, n = c() + "", a = d(
|
|
748
|
+
}, n = c() + "", a = d(N, {
|
|
739
749
|
options: s.options,
|
|
740
750
|
formJson: r,
|
|
741
751
|
formData: e || {},
|
|
@@ -747,7 +757,7 @@ const Q = {
|
|
|
747
757
|
});
|
|
748
758
|
a.appContext = this.$root.$.appContext;
|
|
749
759
|
const l = document.createElement("div");
|
|
750
|
-
l.id = "vf-dynamic-drawer-wrapper" + n, document.body.appendChild(l),
|
|
760
|
+
l.id = "vf-dynamic-drawer-wrapper" + n, document.body.appendChild(l), j(a, l), document.body.appendChild(a.el), a.component.ctx.show();
|
|
751
761
|
},
|
|
752
762
|
/**
|
|
753
763
|
* 判断表单是否处于设计器预览状态
|
|
@@ -762,29 +772,29 @@ const Q = {
|
|
|
762
772
|
//--------------------- 以上为组件支持外部调用的API方法 end ------------------//
|
|
763
773
|
}
|
|
764
774
|
};
|
|
765
|
-
function
|
|
766
|
-
const n = h("RenderWigetList"), a = h("a-form"), l = h("a-spin"),
|
|
767
|
-
return
|
|
775
|
+
function Y(t, e, i, o, s, r) {
|
|
776
|
+
const n = h("RenderWigetList"), a = h("a-form"), l = h("a-spin"), R = h("DynamicDialog");
|
|
777
|
+
return S(), W(v, null, [
|
|
768
778
|
d(l, { spinning: s.isLoading }, {
|
|
769
779
|
default: u(() => [
|
|
770
|
-
|
|
771
|
-
style:
|
|
780
|
+
O("div", {
|
|
781
|
+
style: M(s.isLoading ? "min-height: 260px" : "")
|
|
772
782
|
}, [
|
|
773
783
|
d(a, {
|
|
774
784
|
layout: r.labelPosition,
|
|
775
|
-
class:
|
|
785
|
+
class: E([[r.customClass, s.readModeFlag ? "readonly-mode-form" : ""], "render-form tpf-form"]),
|
|
776
786
|
"label-width": r.labelWidth,
|
|
777
787
|
"validate-on-rule-change": !1,
|
|
778
788
|
model: s.formDataModel,
|
|
779
789
|
ref: "renderForm",
|
|
780
|
-
onKeydown:
|
|
790
|
+
onKeydown: w(r.onFormEnterKey, ["enter"])
|
|
781
791
|
}, {
|
|
782
792
|
default: u(() => [
|
|
783
793
|
d(n, {
|
|
784
794
|
"parent-widget": null,
|
|
785
795
|
"widget-list": r.widgetList,
|
|
786
796
|
formDataModel: s.formDataModel,
|
|
787
|
-
"onUpdate:formDataModel": e[0] || (e[0] = (
|
|
797
|
+
"onUpdate:formDataModel": e[0] || (e[0] = (L) => s.formDataModel = L)
|
|
788
798
|
}, null, 8, ["widget-list", "formDataModel"])
|
|
789
799
|
]),
|
|
790
800
|
_: 1
|
|
@@ -793,10 +803,10 @@ function X(t, e, i, o, s, r) {
|
|
|
793
803
|
]),
|
|
794
804
|
_: 1
|
|
795
805
|
}, 8, ["spinning"]),
|
|
796
|
-
d(
|
|
806
|
+
d(R, V(s.dialogProps, { ref: "dynamicDialgRef" }), null, 16)
|
|
797
807
|
], 64);
|
|
798
808
|
}
|
|
799
|
-
const
|
|
809
|
+
const mt = /* @__PURE__ */ Q(X, [["render", Y], ["__scopeId", "data-v-00d8154a"]]);
|
|
800
810
|
export {
|
|
801
|
-
|
|
811
|
+
mt as default
|
|
802
812
|
};
|
package/src/lang/en-US.js
CHANGED