@kp-ui/lowcode 2.14.0-beta.1 → 2.14.0-beta.11
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 +27 -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 -323
- 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 +19 -18
- 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 +100 -102
- 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 -6
- 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 +95 -110
- 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/event-handler/onVformAdd-editor.vue.js +0 -49
- package/src/components/form-designer/setting-panel/property-editor/labelTooltip-editor.vue.js +0 -31
|
@@ -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传入的表单数据
|
|
@@ -149,10 +154,6 @@ const et = {
|
|
|
149
154
|
this.isLoading = t;
|
|
150
155
|
},
|
|
151
156
|
// 处理回车键事件
|
|
152
|
-
handleEnterKey() {
|
|
153
|
-
var t;
|
|
154
|
-
((t = this.formConfig) == null ? void 0 : t.isEnterSubmit) === 1 && this.handleOnSubmit();
|
|
155
|
-
},
|
|
156
157
|
handleCancelClick() {
|
|
157
158
|
if (!this.isClosing && this.handleBeforeClose())
|
|
158
159
|
try {
|
|
@@ -181,7 +182,7 @@ const et = {
|
|
|
181
182
|
var e;
|
|
182
183
|
const t = this.formConfig.serveList;
|
|
183
184
|
if ((e = t.vformDetail.http) != null && e.url) {
|
|
184
|
-
const i = await
|
|
185
|
+
const i = await C.call(this, t.vformDetail, {
|
|
185
186
|
vfCtx: this.vfCtx
|
|
186
187
|
});
|
|
187
188
|
return console.log("res: ", i), i;
|
|
@@ -191,7 +192,7 @@ const et = {
|
|
|
191
192
|
var i;
|
|
192
193
|
const t = await this.getFormData(), e = this.formConfig.serveList;
|
|
193
194
|
if ((i = e.vformDetail.http) != null && i.url) {
|
|
194
|
-
const o = await
|
|
195
|
+
const o = await C.call(this, e.vformUpdate, {
|
|
195
196
|
data: t,
|
|
196
197
|
vfCtx: this.vfCtx
|
|
197
198
|
});
|
|
@@ -199,7 +200,7 @@ const et = {
|
|
|
199
200
|
}
|
|
200
201
|
},
|
|
201
202
|
initFormObject(t = !0) {
|
|
202
|
-
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(() => {
|
|
203
204
|
this.disableForm();
|
|
204
205
|
});
|
|
205
206
|
},
|
|
@@ -210,14 +211,14 @@ const et = {
|
|
|
210
211
|
return t.type + "-widget";
|
|
211
212
|
},
|
|
212
213
|
initLocale() {
|
|
213
|
-
const { t, messages: e } =
|
|
214
|
-
i &&
|
|
214
|
+
const { t, messages: e } = _(), i = e.value[this.getLocale];
|
|
215
|
+
i && N(this.getLocale, i.lang), this.changeLanguage(this.getLocale);
|
|
215
216
|
},
|
|
216
217
|
insertCustomStyleAndScriptNode() {
|
|
217
|
-
this.formConfig && this.formConfig.cssCode &&
|
|
218
|
+
this.formConfig && this.formConfig.cssCode && G(
|
|
218
219
|
this.formConfig.cssCode,
|
|
219
220
|
this.previewState ? "" : this.formId
|
|
220
|
-
), this.formConfig && this.formConfig.functions &&
|
|
221
|
+
), this.formConfig && this.formConfig.functions && q(
|
|
221
222
|
this.formConfig.functions,
|
|
222
223
|
this.previewState ? "" : this.formId
|
|
223
224
|
);
|
|
@@ -268,7 +269,7 @@ const et = {
|
|
|
268
269
|
this.formDataModel[e] = f(i);
|
|
269
270
|
} else {
|
|
270
271
|
const i = [];
|
|
271
|
-
|
|
272
|
+
K(t, (r) => {
|
|
272
273
|
i.push(r);
|
|
273
274
|
});
|
|
274
275
|
const s = {};
|
|
@@ -341,8 +342,17 @@ const et = {
|
|
|
341
342
|
handleOnCreated() {
|
|
342
343
|
this.formConfig && this.formConfig.onFormCreated && new Function(this.formConfig.onFormCreated).call(this);
|
|
343
344
|
},
|
|
344
|
-
|
|
345
|
-
|
|
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
|
+
}
|
|
346
356
|
},
|
|
347
357
|
handleOnMounted() {
|
|
348
358
|
this.formConfig && this.formConfig.onFormMounted && new Function(this.formConfig.onFormMounted).call(this);
|
|
@@ -352,7 +362,7 @@ const et = {
|
|
|
352
362
|
i && i.setDisabled ? i.setDisabled(e) : this.findWidgetOfSubFormAndSetDisabled(t, e);
|
|
353
363
|
},
|
|
354
364
|
findWidgetOfSubFormAndSetDisabled(t, e) {
|
|
355
|
-
const i =
|
|
365
|
+
const i = D(
|
|
356
366
|
this.formJsonObj.widgetList,
|
|
357
367
|
t,
|
|
358
368
|
!0
|
|
@@ -367,7 +377,7 @@ const et = {
|
|
|
367
377
|
i && i.setDisabled ? i.setHidden(e) : this.findWidgetOfSubFormAndSetHidden(t, e);
|
|
368
378
|
},
|
|
369
379
|
findWidgetOfSubFormAndSetHidden(t, e) {
|
|
370
|
-
const i =
|
|
380
|
+
const i = D(
|
|
371
381
|
this.formJsonObj.widgetList,
|
|
372
382
|
t,
|
|
373
383
|
!0
|
|
@@ -383,7 +393,7 @@ const et = {
|
|
|
383
393
|
const o = (s, r) => {
|
|
384
394
|
s.options && s.options.name === t && (i = r.options.name);
|
|
385
395
|
};
|
|
386
|
-
if (
|
|
396
|
+
if (z(this.widgetList, o), i) {
|
|
387
397
|
const s = this.getWidgetRef(i);
|
|
388
398
|
if (s) {
|
|
389
399
|
const r = s.getRowIdData();
|
|
@@ -399,13 +409,13 @@ const et = {
|
|
|
399
409
|
this.getFieldWidgets().forEach((e) => {
|
|
400
410
|
e.field.options.dsEnabled && e.field.options.dsName && e.field.options.dataSetName && t.add(e.field.options.dsName);
|
|
401
411
|
}), t.size > 0 && t.forEach(async (e) => {
|
|
402
|
-
const i =
|
|
412
|
+
const i = F(this.formConfig, e);
|
|
403
413
|
if (i) {
|
|
404
414
|
const o = new Object({});
|
|
405
|
-
|
|
415
|
+
h(o, this.globalDsv || {});
|
|
406
416
|
let s = null;
|
|
407
417
|
try {
|
|
408
|
-
s = await
|
|
418
|
+
s = await b(
|
|
409
419
|
i,
|
|
410
420
|
o,
|
|
411
421
|
this,
|
|
@@ -453,8 +463,8 @@ const et = {
|
|
|
453
463
|
return;
|
|
454
464
|
}
|
|
455
465
|
this.clearFormDataModel(), this.buildFormModel(e.widgetList);
|
|
456
|
-
const i = f(
|
|
457
|
-
|
|
466
|
+
const i = f(T());
|
|
467
|
+
h(i, e.formConfig), this.formJsonObj.formConfig = i, this.formJsonObj.widgetList = e.widgetList, this.insertCustomStyleAndScriptNode(), this.$nextTick(() => {
|
|
458
468
|
this.initFormObject(!1), this.initDataSetRequest(), this.handleOnMounted();
|
|
459
469
|
});
|
|
460
470
|
} else
|
|
@@ -594,14 +604,14 @@ const et = {
|
|
|
594
604
|
* @returns {*[]}
|
|
595
605
|
*/
|
|
596
606
|
getFieldWidgets(t = !1) {
|
|
597
|
-
return
|
|
607
|
+
return H(this.formJsonObj.widgetList, t);
|
|
598
608
|
},
|
|
599
609
|
/**
|
|
600
610
|
* 获取所有容器组件
|
|
601
611
|
* @returns {*[]}
|
|
602
612
|
*/
|
|
603
613
|
getContainerWidgets() {
|
|
604
|
-
return
|
|
614
|
+
return P(this.formJsonObj.widgetList);
|
|
605
615
|
},
|
|
606
616
|
/**
|
|
607
617
|
* 增加外部组件引用,可通过getEC()方法获取外部组件,以便在VForm内部调用外部组件方法
|
|
@@ -654,8 +664,8 @@ const et = {
|
|
|
654
664
|
* @param localDsv
|
|
655
665
|
*/
|
|
656
666
|
async executeDataSource(t, e) {
|
|
657
|
-
const i =
|
|
658
|
-
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);
|
|
659
669
|
},
|
|
660
670
|
/**
|
|
661
671
|
* 获取父级VFormRender组件实例
|
|
@@ -706,15 +716,15 @@ const et = {
|
|
|
706
716
|
* @param extraData
|
|
707
717
|
*/
|
|
708
718
|
showDialog(t, e = {}, i = {}) {
|
|
709
|
-
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);
|
|
710
720
|
if (!t || r.type !== "vf-dialog") {
|
|
711
721
|
this.$message.error(this.i18nt("render.hint.refNotFound") + t);
|
|
712
722
|
return;
|
|
713
723
|
}
|
|
714
724
|
const n = {
|
|
715
725
|
widgetList: f(r.widgetList),
|
|
716
|
-
formConfig:
|
|
717
|
-
}, a =
|
|
726
|
+
formConfig: p(o.formConfig)
|
|
727
|
+
}, a = c() + "";
|
|
718
728
|
this.dialogProps = {
|
|
719
729
|
options: r.options,
|
|
720
730
|
formJson: n,
|
|
@@ -728,15 +738,15 @@ const et = {
|
|
|
728
738
|
}, this.$refs.dynamicDialgRef.appContext = this.$root.$.appContext, this.$refs.dynamicDialgRef.show();
|
|
729
739
|
},
|
|
730
740
|
showDrawer(t, e = {}, i = {}) {
|
|
731
|
-
const o = this.getTopFormRef(), s =
|
|
741
|
+
const o = this.getTopFormRef(), s = g(o.widgetList, t);
|
|
732
742
|
if (!s || s.type !== "vf-drawer") {
|
|
733
743
|
this.$message.error(this.i18nt("render.hint.refNotFound") + t);
|
|
734
744
|
return;
|
|
735
745
|
}
|
|
736
746
|
const r = {
|
|
737
747
|
widgetList: f(s.widgetList),
|
|
738
|
-
formConfig:
|
|
739
|
-
}, n =
|
|
748
|
+
formConfig: p(o.formConfig)
|
|
749
|
+
}, n = c() + "", a = m(X, {
|
|
740
750
|
options: s.options,
|
|
741
751
|
formJson: r,
|
|
742
752
|
formData: e || {},
|
|
@@ -747,8 +757,8 @@ const et = {
|
|
|
747
757
|
wrapperId: n
|
|
748
758
|
});
|
|
749
759
|
a.appContext = this.$root.$.appContext;
|
|
750
|
-
const
|
|
751
|
-
|
|
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();
|
|
752
762
|
},
|
|
753
763
|
/**
|
|
754
764
|
* 判断表单是否处于设计器预览状态
|
|
@@ -763,68 +773,43 @@ const et = {
|
|
|
763
773
|
//--------------------- 以上为组件支持外部调用的API方法 end ------------------//
|
|
764
774
|
}
|
|
765
775
|
};
|
|
766
|
-
function
|
|
767
|
-
const n =
|
|
768
|
-
return
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
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
|
-
]), 1032, ["widget", "data", "parent-list", "index-of-parent-list", "model"])) : (m(), W(O(r.getWidgetName(l)), {
|
|
801
|
-
field: l,
|
|
802
|
-
"form-model": s.formDataModel,
|
|
803
|
-
designer: null,
|
|
804
|
-
key: l.id,
|
|
805
|
-
"parent-list": r.widgetList,
|
|
806
|
-
"index-of-parent-list": S,
|
|
807
|
-
"parent-widget": null
|
|
808
|
-
}, v({ _: 2 }, [
|
|
809
|
-
C(Object.keys(t.$slots), (h) => ({
|
|
810
|
-
name: h,
|
|
811
|
-
fn: g((p) => [
|
|
812
|
-
M(t.$slots, h, y({ ref_for: !0 }, p), void 0, !0)
|
|
813
|
-
])
|
|
814
|
-
}))
|
|
815
|
-
]), 1032, ["field", "form-model", "parent-list", "index-of-parent-list"]))
|
|
816
|
-
], 64))), 256))
|
|
817
|
-
]),
|
|
818
|
-
_: 3
|
|
819
|
-
}, 8, ["layout", "class", "label-width", "model", "onKeydown"])
|
|
820
|
-
], 4)
|
|
821
|
-
]),
|
|
822
|
-
_: 3
|
|
823
|
-
}, 8, ["spinning"]),
|
|
824
|
-
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)
|
|
825
810
|
], 64);
|
|
826
811
|
}
|
|
827
|
-
const
|
|
812
|
+
const ct = /* @__PURE__ */ Y(Z, [["render", I], ["__scopeId", "data-v-efb592b3"]]);
|
|
828
813
|
export {
|
|
829
|
-
|
|
814
|
+
ct as default
|
|
830
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
|
};
|
package/src/lang/en-US.js
CHANGED
|
@@ -171,6 +171,8 @@ const e = {
|
|
|
171
171
|
generateSFC: "Generate SFC"
|
|
172
172
|
},
|
|
173
173
|
setting: {
|
|
174
|
+
// 序号
|
|
175
|
+
seq: "Seq",
|
|
174
176
|
containerInputPlaceholder: "Enter the container selector",
|
|
175
177
|
langMode: "language Mode",
|
|
176
178
|
editAPIConfig: "Edit API Config",
|
|
@@ -182,6 +184,7 @@ const e = {
|
|
|
182
184
|
tags: "Tags Mode",
|
|
183
185
|
buttonList: "Button Group",
|
|
184
186
|
buttonPosition: "Position",
|
|
187
|
+
autoWidth: "Auto Width",
|
|
185
188
|
fixed: "Fixed Position",
|
|
186
189
|
fixedRight: "Fixed Right",
|
|
187
190
|
resizableColumn: "Resizable Column",
|
|
@@ -306,7 +309,6 @@ const e = {
|
|
|
306
309
|
customLabelIcon: "Custom Label",
|
|
307
310
|
labelIconClass: "Label Icon Class",
|
|
308
311
|
labelIconPosition: "Label Icon Position",
|
|
309
|
-
labelTooltip: "Label Tooltip",
|
|
310
312
|
minValue: "Min Value",
|
|
311
313
|
maxValue: "Max Value",
|
|
312
314
|
precision: "Precision",
|
|
@@ -322,7 +324,6 @@ const e = {
|
|
|
322
324
|
appendButtonDisabled: "Button Disabled",
|
|
323
325
|
appendButtonIcon: "Append Button Icon",
|
|
324
326
|
buttonIcon: "Button Icon",
|
|
325
|
-
danger: "Danger Button",
|
|
326
327
|
switchWidth: "Width of Switch(px)",
|
|
327
328
|
checkedValue: "Active Text",
|
|
328
329
|
unCheckedValue: "Inactive Text",
|
|
@@ -357,10 +358,8 @@ const e = {
|
|
|
357
358
|
buttonConfig: "Button Config",
|
|
358
359
|
placement: "Placement",
|
|
359
360
|
bottomLeft: "Bottom Left",
|
|
360
|
-
bottom: "Bottom Center",
|
|
361
361
|
bottomRight: "Bottom Right",
|
|
362
362
|
topLeft: "Top Left",
|
|
363
|
-
top: "Top Center",
|
|
364
363
|
topRight: "Top Right",
|
|
365
364
|
menuList: "Menu Options",
|
|
366
365
|
widgetName: "Unique Name",
|
|
@@ -414,6 +413,7 @@ const e = {
|
|
|
414
413
|
showSummary: "Show Summary",
|
|
415
414
|
rowSpacing: "Row Spacing(px)",
|
|
416
415
|
editAction: "Edit...",
|
|
416
|
+
dsEnabled: "Use Datasource",
|
|
417
417
|
columnName: "Name",
|
|
418
418
|
columnLabel: "Label",
|
|
419
419
|
columnWidth: "Width(px/%)",
|