@kp-ui/lowcode 2.14.0-beta → 2.14.0-beta.10
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/install.js +26 -25
- package/package.json +2 -2
- package/src/components/FormRender/useFormRender.js +18 -0
- package/src/components/form-designer/form-widget/container-widget/data-table-widget.vue.js +18 -18
- 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/index.js +6 -6
- package/src/components/form-designer/form-widget/container-widget/vf-box-item.vue.js +9 -9
- package/src/components/form-designer/form-widget/container-widget/vf-dialog-widget.vue.js +20 -19
- 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/diy-compontent-widget.vue.js +1 -1
- package/src/components/form-designer/form-widget/field-widget/fieldMixin.js +4 -1
- 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/index.vue.js +55 -54
- package/src/components/form-designer/setting-panel/form-crud-setting.vue.js +62 -23
- 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 +4 -386
- package/src/components/form-designer/setting-panel/index.vue2.js +273 -0
- package/src/components/form-designer/setting-panel/property-editor/button-list-editor.vue2.js +5 -4
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/customRowEvent/data-table-customRow-editor.vue.js +1 -0
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-colorRow-editor.vue2.js +8 -7
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-dsEnabled-editor.vue.js +26 -24
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-pagination-editor.vue.js +1 -0
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-selections-editor.vue2.js +24 -24
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-showButtonsColumn-editor.vue.js +9 -8
- 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 +13 -12
- package/src/components/form-designer/setting-panel/property-editor/container-vf-dialog/bodyStyle-editor.vue2.js +7 -6
- package/src/components/form-designer/setting-panel/property-editor/container-vf-dialog/line-height-editor.vue2.js +7 -6
- package/src/components/form-designer/setting-panel/property-editor/customRender-editor.vue.js +2 -40
- package/src/components/form-designer/setting-panel/property-editor/customRender-editor.vue2.js +41 -0
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onClickIcon-editor.vue.js +2 -47
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onClickIcon-editor.vue2.js +44 -0
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onCreated-editor.vue.js +2 -47
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onCreated-editor.vue2.js +43 -0
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onOkButtonClick-editor.vue.js +2 -46
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onOkButtonClick-editor.vue2.js +43 -0
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onValidate-editor.vue.js +2 -47
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onValidate-editor.vue2.js +44 -0
- package/src/components/form-designer/setting-panel/property-editor/field-dropdown/dropdown-menuList-editor.vue.js +2 -66
- package/src/components/form-designer/setting-panel/property-editor/field-dropdown/dropdown-menuList-editor.vue2.js +42 -0
- package/src/components/form-designer/setting-panel/property-editor/field-html-text/htmlContent-editor.vue.js +5 -4
- package/src/components/form-designer/setting-panel/property-editor/hidden-editor.vue.js +6 -5
- package/src/components/form-designer/setting-panel/property-editor/index.js +146 -153
- package/src/components/form-designer/setting-panel/property-editor/labelIconClass-editor.vue.js +8 -7
- package/src/components/form-designer/setting-panel/property-editor/optionItems-editor.vue.js +38 -35
- package/src/components/form-designer/setting-panel/propertyRegister.js +3 -18
- package/src/components/form-designer/widget-panel/advanced/cascader.js +0 -1
- package/src/components/form-designer/widget-panel/advanced/data-table.js +1 -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 +61 -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 +135 -0
- package/src/components/form-render/container-item/grid-col-item.vue.js +149 -0
- package/src/components/form-render/container-item/grid-item.vue.js +92 -0
- package/src/components/form-render/container-item/grid-sub-form-item.vue.js +319 -0
- package/src/components/form-render/container-item/index.js +24 -0
- package/src/components/form-render/container-item/sub-form-item.vue.js +398 -0
- package/src/components/form-render/container-item/tab-item.vue.js +160 -0
- package/src/components/form-render/container-item/table-cell-item.vue.js +95 -0
- package/src/components/form-render/container-item/table-item.vue.js +96 -0
- package/src/components/form-render/container-item/vf-collapse-item.vue.js +252 -0
- package/src/components/form-render/container-item/vf-dialog-item.vue.js +12 -0
- package/src/components/form-render/container-item/vf-drawer-item.vue.js +12 -0
- package/src/components/form-render/dynamic-dialog.vue.js +66 -81
- package/src/components/form-render/index.vue.js +96 -114
- package/src/components/http-editor/index.vue.js +10 -10
- package/src/components/public/ActionButtonListRender.vue.js +19 -24
- package/src/hooks/useLowcode.js +40 -39
- package/src/lang/en-US.js +4 -4
- package/src/lang/zh-CN.js +3 -4
- package/src/mixins/useDataTableMixin.js +18 -23
- package/src/utils/useEmitter.js +57 -0
- package/src/utils/util.js +50 -49
- package/stats.html +1 -1
- package/styles/style.css +1 -1
- package/src/components/form-designer/setting-panel/property-editor/displayStyle-editor.vue.js +0 -46
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onVformAdd-editor.vue.js +0 -49
- package/src/components/form-designer/setting-panel/property-editor/labelTooltip-editor.vue.js +0 -31
- package/src/components/form-designer/setting-panel/property-editor/multipleSelect-editor.vue.js +0 -30
- package/src/components/form-designer/setting-panel/property-editor/uploadTip-editor.vue.js +0 -31
- package/src/components/form-designer/setting-panel/property-editor/uploadURL-editor.vue.js +0 -44
- package/src/components/form-designer/setting-panel/property-editor/withCredentials-editor.vue.js +0 -30
|
@@ -1,22 +1,27 @@
|
|
|
1
|
-
import { resolveComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import { resolveComponent as d, createElementBlock as S, openBlock as u, Fragment as W, createElementVNode as v, createVNode as m, normalizeStyle as O, createBlock as M, createCommentVNode as w, withKeys as E, normalizeClass as V, withCtx as j, mergeProps as k, render as x } from "vue";
|
|
2
|
+
import A from "../../utils/emitter.js";
|
|
3
|
+
import { useI18n as _ } from "@kp-ui/i18n";
|
|
4
|
+
import B from "./RenderWigetList.vue.js";
|
|
5
|
+
import { Skeleton as $ } from "ant-design-vue";
|
|
6
|
+
import { buildDefaultFormJson as J, getContainerWidgetByName as g, cloneFormConfigWithoutEventHandler as p, deepClone as f, getDSByName as F, overwriteObj as h, runDataSourceRequest as b, getAllContainerWidgets as P, getAllFieldWidgets as H, getDefaultFormConfig as T, traverseFieldWidgets as z, getFieldWidgetByName as D, traverseFieldWidgetsOfContainer as K, insertCustomCssToHead as G, insertGlobalFunctionsToHtml as q, generateId as c } from "../../utils/util.js";
|
|
7
|
+
import U, { setLangMessages as N } from "../../utils/i18n.js";
|
|
8
|
+
import Q from "./dynamic-dialog.vue.js";
|
|
8
9
|
/* empty css */
|
|
9
|
-
import
|
|
10
|
-
import { fmtHttpParams as
|
|
10
|
+
import X from "./dynamic-drawer.vue.js";
|
|
11
|
+
import { fmtHttpParams as C } from "../../utils/request/fmtHttpParams.js";
|
|
12
|
+
import { executeFunction as y } from "../../utils/executeFunction.js";
|
|
11
13
|
/* empty css */
|
|
12
|
-
import
|
|
13
|
-
const
|
|
14
|
+
import Y from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
15
|
+
const Z = {
|
|
14
16
|
name: "VFormRender",
|
|
15
17
|
componentName: "VFormRender",
|
|
16
|
-
|
|
18
|
+
inheritAttrs: !1,
|
|
19
|
+
mixins: [A, U],
|
|
17
20
|
components: {
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
Skeleton: $,
|
|
22
|
+
RenderWigetList: B,
|
|
23
|
+
DynamicDialog: Q
|
|
24
|
+
// ...FieldComponents
|
|
20
25
|
},
|
|
21
26
|
props: {
|
|
22
27
|
vfCtx: {
|
|
@@ -26,7 +31,7 @@ const et = {
|
|
|
26
31
|
formJson: {
|
|
27
32
|
//prop传入的表单JSON配置
|
|
28
33
|
type: Object,
|
|
29
|
-
default: () =>
|
|
34
|
+
default: () => J()
|
|
30
35
|
},
|
|
31
36
|
formData: {
|
|
32
37
|
//prop传入的表单数据
|
|
@@ -138,11 +143,8 @@ const et = {
|
|
|
138
143
|
return this.formConfig && this.formConfig.customClass ? this.formConfig.customClass : "";
|
|
139
144
|
}
|
|
140
145
|
},
|
|
141
|
-
watch: {
|
|
142
|
-
//
|
|
143
|
-
},
|
|
144
146
|
created() {
|
|
145
|
-
this.isLoading = !1, this.buildFormModel(this.formJsonObj ? this.formJsonObj.widgetList : null), this.initFormObject()
|
|
147
|
+
this.isLoading = !1, this.buildFormModel(this.formJsonObj ? this.formJsonObj.widgetList : null), this.initFormObject();
|
|
146
148
|
},
|
|
147
149
|
mounted() {
|
|
148
150
|
this.initLocale(), this.initDataSetRequest();
|
|
@@ -152,10 +154,6 @@ const et = {
|
|
|
152
154
|
this.isLoading = t;
|
|
153
155
|
},
|
|
154
156
|
// 处理回车键事件
|
|
155
|
-
handleEnterKey() {
|
|
156
|
-
var t;
|
|
157
|
-
((t = this.formConfig) == null ? void 0 : t.isEnterSubmit) === 1 && this.handleOnSubmit();
|
|
158
|
-
},
|
|
159
157
|
handleCancelClick() {
|
|
160
158
|
if (!this.isClosing && this.handleBeforeClose())
|
|
161
159
|
try {
|
|
@@ -184,7 +182,7 @@ const et = {
|
|
|
184
182
|
var e;
|
|
185
183
|
const t = this.formConfig.serveList;
|
|
186
184
|
if ((e = t.vformDetail.http) != null && e.url) {
|
|
187
|
-
const i = await
|
|
185
|
+
const i = await C.call(this, t.vformDetail, {
|
|
188
186
|
vfCtx: this.vfCtx
|
|
189
187
|
});
|
|
190
188
|
return console.log("res: ", i), i;
|
|
@@ -194,7 +192,7 @@ const et = {
|
|
|
194
192
|
var i;
|
|
195
193
|
const t = await this.getFormData(), e = this.formConfig.serveList;
|
|
196
194
|
if ((i = e.vformDetail.http) != null && i.url) {
|
|
197
|
-
const o = await
|
|
195
|
+
const o = await C.call(this, e.vformUpdate, {
|
|
198
196
|
data: t,
|
|
199
197
|
vfCtx: this.vfCtx
|
|
200
198
|
});
|
|
@@ -202,7 +200,7 @@ const et = {
|
|
|
202
200
|
}
|
|
203
201
|
},
|
|
204
202
|
initFormObject(t = !0) {
|
|
205
|
-
this.formId = "vfRender" +
|
|
203
|
+
this.formId = "vfRender" + c(), t && !this.dynamicCreation && this.insertCustomStyleAndScriptNode(), this.addFieldChangeEventHandler(), this.addFieldValidateEventHandler(), this.registerFormToRefList(), this.handleOnCreated(), this.disabledMode && this.$nextTick(() => {
|
|
206
204
|
this.disableForm();
|
|
207
205
|
});
|
|
208
206
|
},
|
|
@@ -213,14 +211,14 @@ const et = {
|
|
|
213
211
|
return t.type + "-widget";
|
|
214
212
|
},
|
|
215
213
|
initLocale() {
|
|
216
|
-
const { t, messages: e } =
|
|
217
|
-
i &&
|
|
214
|
+
const { t, messages: e } = _(), i = e.value[this.getLocale];
|
|
215
|
+
i && N(this.getLocale, i.lang), this.changeLanguage(this.getLocale);
|
|
218
216
|
},
|
|
219
217
|
insertCustomStyleAndScriptNode() {
|
|
220
|
-
this.formConfig && this.formConfig.cssCode &&
|
|
218
|
+
this.formConfig && this.formConfig.cssCode && G(
|
|
221
219
|
this.formConfig.cssCode,
|
|
222
220
|
this.previewState ? "" : this.formId
|
|
223
|
-
), this.formConfig && this.formConfig.functions &&
|
|
221
|
+
), this.formConfig && this.formConfig.functions && q(
|
|
224
222
|
this.formConfig.functions,
|
|
225
223
|
this.previewState ? "" : this.formId
|
|
226
224
|
);
|
|
@@ -271,7 +269,7 @@ const et = {
|
|
|
271
269
|
this.formDataModel[e] = f(i);
|
|
272
270
|
} else {
|
|
273
271
|
const i = [];
|
|
274
|
-
|
|
272
|
+
K(t, (r) => {
|
|
275
273
|
i.push(r);
|
|
276
274
|
});
|
|
277
275
|
const s = {};
|
|
@@ -344,8 +342,17 @@ const et = {
|
|
|
344
342
|
handleOnCreated() {
|
|
345
343
|
this.formConfig && this.formConfig.onFormCreated && new Function(this.formConfig.onFormCreated).call(this);
|
|
346
344
|
},
|
|
347
|
-
|
|
348
|
-
|
|
345
|
+
onFormEnterKey() {
|
|
346
|
+
if (this.formConfig && this.formConfig.onFormEnterKey) {
|
|
347
|
+
const t = y({
|
|
348
|
+
functionBody: this.formConfig.onFormEnterKey,
|
|
349
|
+
context: this
|
|
350
|
+
});
|
|
351
|
+
t && y({
|
|
352
|
+
functionBody: t,
|
|
353
|
+
context: this
|
|
354
|
+
});
|
|
355
|
+
}
|
|
349
356
|
},
|
|
350
357
|
handleOnMounted() {
|
|
351
358
|
this.formConfig && this.formConfig.onFormMounted && new Function(this.formConfig.onFormMounted).call(this);
|
|
@@ -355,7 +362,7 @@ const et = {
|
|
|
355
362
|
i && i.setDisabled ? i.setDisabled(e) : this.findWidgetOfSubFormAndSetDisabled(t, e);
|
|
356
363
|
},
|
|
357
364
|
findWidgetOfSubFormAndSetDisabled(t, e) {
|
|
358
|
-
const i =
|
|
365
|
+
const i = D(
|
|
359
366
|
this.formJsonObj.widgetList,
|
|
360
367
|
t,
|
|
361
368
|
!0
|
|
@@ -370,7 +377,7 @@ const et = {
|
|
|
370
377
|
i && i.setDisabled ? i.setHidden(e) : this.findWidgetOfSubFormAndSetHidden(t, e);
|
|
371
378
|
},
|
|
372
379
|
findWidgetOfSubFormAndSetHidden(t, e) {
|
|
373
|
-
const i =
|
|
380
|
+
const i = D(
|
|
374
381
|
this.formJsonObj.widgetList,
|
|
375
382
|
t,
|
|
376
383
|
!0
|
|
@@ -386,7 +393,7 @@ const et = {
|
|
|
386
393
|
const o = (s, r) => {
|
|
387
394
|
s.options && s.options.name === t && (i = r.options.name);
|
|
388
395
|
};
|
|
389
|
-
if (
|
|
396
|
+
if (z(this.widgetList, o), i) {
|
|
390
397
|
const s = this.getWidgetRef(i);
|
|
391
398
|
if (s) {
|
|
392
399
|
const r = s.getRowIdData();
|
|
@@ -402,13 +409,13 @@ const et = {
|
|
|
402
409
|
this.getFieldWidgets().forEach((e) => {
|
|
403
410
|
e.field.options.dsEnabled && e.field.options.dsName && e.field.options.dataSetName && t.add(e.field.options.dsName);
|
|
404
411
|
}), t.size > 0 && t.forEach(async (e) => {
|
|
405
|
-
const i =
|
|
412
|
+
const i = F(this.formConfig, e);
|
|
406
413
|
if (i) {
|
|
407
414
|
const o = new Object({});
|
|
408
|
-
|
|
415
|
+
h(o, this.globalDsv || {});
|
|
409
416
|
let s = null;
|
|
410
417
|
try {
|
|
411
|
-
s = await
|
|
418
|
+
s = await b(
|
|
412
419
|
i,
|
|
413
420
|
o,
|
|
414
421
|
this,
|
|
@@ -456,8 +463,8 @@ const et = {
|
|
|
456
463
|
return;
|
|
457
464
|
}
|
|
458
465
|
this.clearFormDataModel(), this.buildFormModel(e.widgetList);
|
|
459
|
-
const i = f(
|
|
460
|
-
|
|
466
|
+
const i = f(T());
|
|
467
|
+
h(i, e.formConfig), this.formJsonObj.formConfig = i, this.formJsonObj.widgetList = e.widgetList, this.insertCustomStyleAndScriptNode(), this.$nextTick(() => {
|
|
461
468
|
this.initFormObject(!1), this.initDataSetRequest(), this.handleOnMounted();
|
|
462
469
|
});
|
|
463
470
|
} else
|
|
@@ -597,14 +604,14 @@ const et = {
|
|
|
597
604
|
* @returns {*[]}
|
|
598
605
|
*/
|
|
599
606
|
getFieldWidgets(t = !1) {
|
|
600
|
-
return
|
|
607
|
+
return H(this.formJsonObj.widgetList, t);
|
|
601
608
|
},
|
|
602
609
|
/**
|
|
603
610
|
* 获取所有容器组件
|
|
604
611
|
* @returns {*[]}
|
|
605
612
|
*/
|
|
606
613
|
getContainerWidgets() {
|
|
607
|
-
return
|
|
614
|
+
return P(this.formJsonObj.widgetList);
|
|
608
615
|
},
|
|
609
616
|
/**
|
|
610
617
|
* 增加外部组件引用,可通过getEC()方法获取外部组件,以便在VForm内部调用外部组件方法
|
|
@@ -657,8 +664,8 @@ const et = {
|
|
|
657
664
|
* @param localDsv
|
|
658
665
|
*/
|
|
659
666
|
async executeDataSource(t, e) {
|
|
660
|
-
const i =
|
|
661
|
-
return
|
|
667
|
+
const i = F(this.formJsonObj.formConfig, t), o = new Object({});
|
|
668
|
+
return h(o, this.globalDsv), h(o, e), await b(i, o, this, !1, this.$message);
|
|
662
669
|
},
|
|
663
670
|
/**
|
|
664
671
|
* 获取父级VFormRender组件实例
|
|
@@ -709,15 +716,15 @@ const et = {
|
|
|
709
716
|
* @param extraData
|
|
710
717
|
*/
|
|
711
718
|
showDialog(t, e = {}, i = {}) {
|
|
712
|
-
const o = this.getTopFormRef(), s = this.getFormRef(), r =
|
|
719
|
+
const o = this.getTopFormRef(), s = this.getFormRef(), r = g(o.widgetList, t) || g(s.widgetList, t);
|
|
713
720
|
if (!t || r.type !== "vf-dialog") {
|
|
714
721
|
this.$message.error(this.i18nt("render.hint.refNotFound") + t);
|
|
715
722
|
return;
|
|
716
723
|
}
|
|
717
724
|
const n = {
|
|
718
725
|
widgetList: f(r.widgetList),
|
|
719
|
-
formConfig:
|
|
720
|
-
}, a =
|
|
726
|
+
formConfig: p(o.formConfig)
|
|
727
|
+
}, a = c() + "";
|
|
721
728
|
this.dialogProps = {
|
|
722
729
|
options: r.options,
|
|
723
730
|
formJson: n,
|
|
@@ -731,15 +738,15 @@ const et = {
|
|
|
731
738
|
}, this.$refs.dynamicDialgRef.appContext = this.$root.$.appContext, this.$refs.dynamicDialgRef.show();
|
|
732
739
|
},
|
|
733
740
|
showDrawer(t, e = {}, i = {}) {
|
|
734
|
-
const o = this.getTopFormRef(), s =
|
|
741
|
+
const o = this.getTopFormRef(), s = g(o.widgetList, t);
|
|
735
742
|
if (!s || s.type !== "vf-drawer") {
|
|
736
743
|
this.$message.error(this.i18nt("render.hint.refNotFound") + t);
|
|
737
744
|
return;
|
|
738
745
|
}
|
|
739
746
|
const r = {
|
|
740
747
|
widgetList: f(s.widgetList),
|
|
741
|
-
formConfig:
|
|
742
|
-
}, n =
|
|
748
|
+
formConfig: p(o.formConfig)
|
|
749
|
+
}, n = c() + "", a = m(X, {
|
|
743
750
|
options: s.options,
|
|
744
751
|
formJson: r,
|
|
745
752
|
formData: e || {},
|
|
@@ -750,8 +757,8 @@ const et = {
|
|
|
750
757
|
wrapperId: n
|
|
751
758
|
});
|
|
752
759
|
a.appContext = this.$root.$.appContext;
|
|
753
|
-
const
|
|
754
|
-
|
|
760
|
+
const l = document.createElement("div");
|
|
761
|
+
l.id = "vf-dynamic-drawer-wrapper" + n, document.body.appendChild(l), x(a, l), document.body.appendChild(a.el), a.component.ctx.show();
|
|
755
762
|
},
|
|
756
763
|
/**
|
|
757
764
|
* 判断表单是否处于设计器预览状态
|
|
@@ -766,68 +773,43 @@ const et = {
|
|
|
766
773
|
//--------------------- 以上为组件支持外部调用的API方法 end ------------------//
|
|
767
774
|
}
|
|
768
775
|
};
|
|
769
|
-
function
|
|
770
|
-
const n =
|
|
771
|
-
return
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
]), 1032, ["widget", "data", "parent-list", "index-of-parent-list", "model"])) : (m(), W(O(r.getWidgetName(l)), {
|
|
804
|
-
field: l,
|
|
805
|
-
"form-model": s.formDataModel,
|
|
806
|
-
designer: null,
|
|
807
|
-
key: l.id,
|
|
808
|
-
"parent-list": r.widgetList,
|
|
809
|
-
"index-of-parent-list": S,
|
|
810
|
-
"parent-widget": null
|
|
811
|
-
}, v({ _: 2 }, [
|
|
812
|
-
C(Object.keys(t.$slots), (h) => ({
|
|
813
|
-
name: h,
|
|
814
|
-
fn: c((p) => [
|
|
815
|
-
M(t.$slots, h, y({ ref_for: !0 }, p), void 0, !0)
|
|
816
|
-
])
|
|
817
|
-
}))
|
|
818
|
-
]), 1032, ["field", "form-model", "parent-list", "index-of-parent-list"]))
|
|
819
|
-
], 64))), 256))
|
|
820
|
-
]),
|
|
821
|
-
_: 3
|
|
822
|
-
}, 8, ["layout", "class", "label-width", "model", "onKeydown"])
|
|
823
|
-
], 4)
|
|
824
|
-
]),
|
|
825
|
-
_: 3
|
|
826
|
-
}, 8, ["spinning"]),
|
|
827
|
-
u(d, y(s.dialogProps, { ref: "dynamicDialgRef" }), null, 16)
|
|
776
|
+
function I(t, e, i, o, s, r) {
|
|
777
|
+
const n = d("Skeleton"), a = d("RenderWigetList"), l = d("a-form"), R = d("DynamicDialog");
|
|
778
|
+
return u(), S(W, null, [
|
|
779
|
+
v("div", {
|
|
780
|
+
class: "form-render-container",
|
|
781
|
+
style: O(s.isLoading ? "min-height: 260px" : "")
|
|
782
|
+
}, [
|
|
783
|
+
s.isLoading ? (u(), M(n, {
|
|
784
|
+
key: 0,
|
|
785
|
+
class: "skeleton-form",
|
|
786
|
+
active: "",
|
|
787
|
+
loading: !0
|
|
788
|
+
})) : w("", !0),
|
|
789
|
+
m(l, {
|
|
790
|
+
layout: r.labelPosition,
|
|
791
|
+
class: V([[r.customClass, s.readModeFlag ? "readonly-mode-form" : ""], "render-form tpf-form"]),
|
|
792
|
+
"label-width": r.labelWidth,
|
|
793
|
+
"validate-on-rule-change": !1,
|
|
794
|
+
model: s.formDataModel,
|
|
795
|
+
ref: "renderForm",
|
|
796
|
+
onKeydown: E(r.onFormEnterKey, ["enter"])
|
|
797
|
+
}, {
|
|
798
|
+
default: j(() => [
|
|
799
|
+
m(a, {
|
|
800
|
+
"parent-widget": null,
|
|
801
|
+
"widget-list": r.widgetList,
|
|
802
|
+
formDataModel: s.formDataModel,
|
|
803
|
+
"onUpdate:formDataModel": e[0] || (e[0] = (L) => s.formDataModel = L)
|
|
804
|
+
}, null, 8, ["widget-list", "formDataModel"])
|
|
805
|
+
]),
|
|
806
|
+
_: 1
|
|
807
|
+
}, 8, ["layout", "class", "label-width", "model", "onKeydown"])
|
|
808
|
+
], 4),
|
|
809
|
+
m(R, k(s.dialogProps, { ref: "dynamicDialgRef" }), null, 16)
|
|
828
810
|
], 64);
|
|
829
811
|
}
|
|
830
|
-
const
|
|
812
|
+
const ct = /* @__PURE__ */ Y(Z, [["render", I], ["__scopeId", "data-v-efb592b3"]]);
|
|
831
813
|
export {
|
|
832
|
-
|
|
814
|
+
ct as default
|
|
833
815
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as p, mergeModels as s, useModel as f, ref as b, resolveComponent as i, createElementBlock as c, openBlock as g, Fragment as v, createVNode as a, withCtx as d, normalizeClass as M, createTextVNode as w, toDisplayString as x, unref as C } from "vue";
|
|
2
2
|
import { HttpEditor as h } from "tmgc2-share";
|
|
3
3
|
import "../../utils/i18n.js";
|
|
4
|
-
const
|
|
4
|
+
const k = /* @__PURE__ */ p({
|
|
5
5
|
__name: "index",
|
|
6
6
|
props: /* @__PURE__ */ s({
|
|
7
7
|
drawerTitle: {
|
|
@@ -35,25 +35,25 @@ const N = /* @__PURE__ */ m({
|
|
|
35
35
|
}),
|
|
36
36
|
emits: ["update:optionModel"],
|
|
37
37
|
setup(e) {
|
|
38
|
-
const n = f(e, "optionModel"), o = b(!1),
|
|
38
|
+
const n = f(e, "optionModel"), o = b(!1), r = () => {
|
|
39
39
|
o.value = !0;
|
|
40
40
|
};
|
|
41
41
|
return (S, t) => {
|
|
42
|
-
const u = i("a-button"),
|
|
42
|
+
const u = i("a-button"), m = i("a-form-item");
|
|
43
43
|
return g(), c(v, null, [
|
|
44
|
-
a(
|
|
44
|
+
a(m, {
|
|
45
45
|
label: e.label,
|
|
46
46
|
labelAlign: "left",
|
|
47
47
|
"label-width": "150px"
|
|
48
48
|
}, {
|
|
49
|
-
default:
|
|
49
|
+
default: d(() => [
|
|
50
50
|
a(u, {
|
|
51
51
|
shape: "round",
|
|
52
|
-
onClick:
|
|
52
|
+
onClick: r,
|
|
53
53
|
class: M(["button-text-highlight"])
|
|
54
54
|
}, {
|
|
55
|
-
default:
|
|
56
|
-
w(x(e.buttonName), 1)
|
|
55
|
+
default: d(() => [
|
|
56
|
+
w(x(e.buttonName || e.label), 1)
|
|
57
57
|
]),
|
|
58
58
|
_: 1
|
|
59
59
|
})
|
|
@@ -72,5 +72,5 @@ const N = /* @__PURE__ */ m({
|
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
74
|
export {
|
|
75
|
-
|
|
75
|
+
k as default
|
|
76
76
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { resolveComponent as
|
|
1
|
+
import d from "./ActionButtonListRender.vue2.js";
|
|
2
|
+
import { resolveComponent as n, createElementBlock as s, openBlock as t, normalizeStyle as p, normalizeClass as u, createBlock as a, Teleport as b, createVNode as f, withCtx as l, Fragment as _, renderList as m, createCommentVNode as y, createTextVNode as k, toDisplayString as C } from "vue";
|
|
3
3
|
/* empty css */
|
|
4
|
-
import
|
|
5
|
-
function
|
|
6
|
-
const
|
|
7
|
-
return
|
|
4
|
+
import g from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
function v(o, B, S, $, h, z) {
|
|
6
|
+
const r = n("SvgIcon"), c = n("a-button"), i = n("a-space");
|
|
7
|
+
return t(), s("div", {
|
|
8
8
|
ref: "fieldEditor",
|
|
9
|
-
class:
|
|
10
|
-
style:
|
|
9
|
+
class: u(["button-list-container", ...o.customClass]),
|
|
10
|
+
style: p(o.containerStyle)
|
|
11
11
|
}, [
|
|
12
|
-
(
|
|
12
|
+
(t(), a(b, {
|
|
13
13
|
disabled: o.isDisabled,
|
|
14
14
|
to: o.getContainer
|
|
15
15
|
}, [
|
|
16
|
-
|
|
16
|
+
f(i, { size: 8 }, {
|
|
17
17
|
default: l(() => [
|
|
18
|
-
(
|
|
18
|
+
(t(!0), s(_, null, m(o.visibleButtons, (e) => (t(), a(c, {
|
|
19
19
|
key: e.key,
|
|
20
20
|
type: e.type,
|
|
21
21
|
danger: e.danger,
|
|
@@ -24,17 +24,12 @@ function S(o, B, I, $, h, z) {
|
|
|
24
24
|
onClick: (D) => o.handleClick(e)
|
|
25
25
|
}, {
|
|
26
26
|
default: l(() => [
|
|
27
|
-
e.icon ? (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"icon-class": e.icon,
|
|
34
|
-
class: "button-icon"
|
|
35
|
-
}, null, 8, ["icon-class"])
|
|
36
|
-
], 64)) : y("", !0),
|
|
37
|
-
k(" " + v(e.label), 1)
|
|
27
|
+
e.icon ? (t(), a(r, {
|
|
28
|
+
key: 0,
|
|
29
|
+
"icon-class": e.icon,
|
|
30
|
+
class: "button-icon"
|
|
31
|
+
}, null, 8, ["icon-class"])) : y("", !0),
|
|
32
|
+
k(" " + C(e.label), 1)
|
|
38
33
|
]),
|
|
39
34
|
_: 2
|
|
40
35
|
}, 1032, ["type", "danger", "disabled", "onClick"]))), 128))
|
|
@@ -44,7 +39,7 @@ function S(o, B, I, $, h, z) {
|
|
|
44
39
|
], 8, ["disabled", "to"]))
|
|
45
40
|
], 6);
|
|
46
41
|
}
|
|
47
|
-
const
|
|
42
|
+
const L = /* @__PURE__ */ g(d, [["render", v], ["__scopeId", "data-v-a5c375c2"]]);
|
|
48
43
|
export {
|
|
49
|
-
|
|
44
|
+
L as default
|
|
50
45
|
};
|
package/src/hooks/useLowcode.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import w from "../components/form-render/index.vue.js";
|
|
2
2
|
import { basicFieldsEnums as y } from "../components/form-designer/widget-panel/basicFieldsEnums.js";
|
|
3
|
-
import { getUuidKey as
|
|
4
|
-
import { useDataQueryApi as
|
|
3
|
+
import { getUuidKey as L } from "@kp-ui/tool";
|
|
4
|
+
import { useDataQueryApi as R, useComRef as P, useRouteBackTab as N, routerReloadStatus as j } from "tmgc2-share";
|
|
5
5
|
import { ref as g } from "vue";
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const S = (C) => {
|
|
7
|
+
let { formCode: i, entityCode: l, type: h = "add" } = C;
|
|
8
|
+
const a = g(!1), f = R(), r = P(w), u = g(), { routeBackTab: b } = N(), F = (o = []) => {
|
|
9
|
+
const e = {
|
|
9
10
|
label: "提交",
|
|
10
|
-
name:
|
|
11
|
+
name: L(),
|
|
11
12
|
onCreated: `
|
|
12
13
|
const hidden = this.getFormRef().vfCtx?.type==='view';
|
|
13
14
|
this.setHidden(hidden)
|
|
@@ -21,64 +22,64 @@ const Q = (C) => {
|
|
|
21
22
|
}
|
|
22
23
|
})()`
|
|
23
24
|
};
|
|
24
|
-
return
|
|
25
|
-
}, m = (
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
29
|
-
const
|
|
25
|
+
return o.push(y.button(e)), o;
|
|
26
|
+
}, m = (o = []) => {
|
|
27
|
+
const t = o.reduce((e, n) => {
|
|
28
|
+
const s = y[n.componentType];
|
|
29
|
+
if (s) {
|
|
30
|
+
const d = s({
|
|
30
31
|
name: n.entityPropertyCode,
|
|
31
32
|
label: n.entityPropertyName,
|
|
32
33
|
...n.options
|
|
33
34
|
});
|
|
34
|
-
|
|
35
|
+
e = [...e, d];
|
|
35
36
|
}
|
|
36
|
-
return
|
|
37
|
+
return e;
|
|
37
38
|
}, []);
|
|
38
|
-
return
|
|
39
|
-
},
|
|
40
|
-
var
|
|
39
|
+
return t.length ? F(t) : t;
|
|
40
|
+
}, c = async (o = [], t) => {
|
|
41
|
+
var n, s;
|
|
41
42
|
let e = { widgetList: [], formConfig: {} };
|
|
42
|
-
if (
|
|
43
|
-
(
|
|
43
|
+
if (i = t || i, i && h) {
|
|
44
|
+
(n = r.value) == null || n.setLoading(!0);
|
|
44
45
|
try {
|
|
45
|
-
const
|
|
46
|
-
e = JSON.parse(
|
|
46
|
+
const d = await f.dataQueryDetail({ code: i }, "FormDefinitionManagement").then((v) => v.data.object || {});
|
|
47
|
+
e = JSON.parse(d.frontendDefinition || "{}");
|
|
47
48
|
} finally {
|
|
48
|
-
(
|
|
49
|
+
(s = r.value) == null || s.setLoading(!1);
|
|
49
50
|
}
|
|
50
51
|
} else
|
|
51
|
-
e.widgetList = m(
|
|
52
|
-
return
|
|
52
|
+
e.widgetList = m(o);
|
|
53
|
+
return a.value = !1, console.log("json: ", e), u.value = e.formConfig, r.value.setFormJson(e), e;
|
|
53
54
|
}, p = async () => {
|
|
54
|
-
if (
|
|
55
|
-
return
|
|
56
|
-
const
|
|
55
|
+
if (a.value = !0, !l)
|
|
56
|
+
return c([]), [];
|
|
57
|
+
const o = {
|
|
57
58
|
pageCode: "EntityPropertyFormItem",
|
|
58
59
|
conditions: [{ fieldCode: "entityCode", type: "EQ", value: l }],
|
|
59
60
|
requiredFields: ["entityPropertyCode", "entityPropertyName", "valueType"],
|
|
60
61
|
page: 1,
|
|
61
62
|
pageSize: null,
|
|
62
63
|
sorts: []
|
|
63
|
-
},
|
|
64
|
-
return
|
|
64
|
+
}, t = await f.execute(o).then((e) => e.data.object.list);
|
|
65
|
+
return c(t), t;
|
|
65
66
|
};
|
|
66
67
|
return {
|
|
67
|
-
isLoading:
|
|
68
|
-
goBack: (
|
|
69
|
-
b(
|
|
68
|
+
isLoading: a,
|
|
69
|
+
goBack: (o = j.view) => {
|
|
70
|
+
b(o);
|
|
70
71
|
},
|
|
71
72
|
formConfig: u,
|
|
72
73
|
getInitRenderJSON: m,
|
|
73
|
-
vfdRef:
|
|
74
|
-
getComponentJson:
|
|
74
|
+
vfdRef: r,
|
|
75
|
+
getComponentJson: c,
|
|
75
76
|
getFieldList: p,
|
|
76
|
-
fieldListApi: async () => (await p()).map((
|
|
77
|
-
showName:
|
|
78
|
-
fieldCode:
|
|
77
|
+
fieldListApi: async () => (await p()).map((t) => ({
|
|
78
|
+
showName: t.entityPropertyName,
|
|
79
|
+
fieldCode: t.entityPropertyCode
|
|
79
80
|
}))
|
|
80
81
|
};
|
|
81
82
|
};
|
|
82
83
|
export {
|
|
83
|
-
|
|
84
|
+
S as useLowcode
|
|
84
85
|
};
|