@kp-ui/lowcode 1.0.30 → 1.0.31
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/_virtual/virtual_svg-icons-register.js +2 -2
- package/index.js +0 -2
- package/package.json +1 -1
- package/render.js +79 -69
- package/src/components/CustomRender/components/index.js +10 -0
- package/src/components/CustomRender/useCustomRender.js +68 -0
- package/src/components/code-editor/index.vue.js +3 -167
- package/src/components/code-editor/index.vue2.js +166 -0
- package/src/components/form-designer/form-widget/container-widget/data-table-widget.vue.js +233 -104
- package/src/components/form-designer/form-widget/container-widget/data-table-widget.vue3.js +106 -0
- package/src/components/form-designer/form-widget/container-widget/grid-col-widget.vue.js +3 -1
- package/src/components/form-designer/form-widget/container-widget/grid-sub-form-widget.vue.js +3 -1
- package/src/components/form-designer/form-widget/container-widget/{grid-widget.vue.js → grid-widget.vue2.js} +1 -1
- package/src/components/form-designer/form-widget/container-widget/index.js +4 -4
- package/src/components/form-designer/form-widget/container-widget/sub-form-widget.vue.js +3 -1
- package/src/components/form-designer/form-widget/container-widget/tab-widget.vue.js +3 -1
- package/src/components/form-designer/form-widget/container-widget/table-cell-widget.vue.js +3 -1
- package/src/components/form-designer/form-widget/container-widget/{table-widget.vue.js → table-widget.vue2.js} +1 -1
- package/src/components/form-designer/form-widget/container-widget/vf-box-widget.vue.js +3 -1
- package/src/components/form-designer/form-widget/container-widget/vf-collapse-widget.vue.js +124 -156
- package/src/components/form-designer/form-widget/container-widget/vf-collapse-widget.vue4.js +158 -0
- package/src/components/form-designer/form-widget/container-widget/vf-dialog-widget.vue.js +3 -1
- package/src/components/form-designer/form-widget/container-widget/vf-drawer-widget.vue.js +3 -1
- package/src/components/form-designer/form-widget/field-widget/attachment-render-widget.vue.js +1 -3
- package/src/components/form-designer/form-widget/field-widget/diy-compontent-widget.vue.js +101 -0
- package/src/components/form-designer/form-widget/field-widget/fieldMixin.js +122 -87
- package/src/components/form-designer/form-widget/field-widget/index.js +3 -1
- package/src/components/form-designer/form-widget/field-widget/slot-widget.vue.js +6 -6
- package/src/components/form-designer/form-widget/index.vue.js +7 -5
- package/src/components/form-designer/setting-panel/option-items-setting.vue.js +5 -3
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-showButtonsColumn-editor.vue.js +4 -3
- package/src/components/form-designer/setting-panel/property-editor/container-grid/gutter-editor.vue.js +3 -2
- package/src/components/form-designer/setting-panel/property-editor/container-tab/tab-customClass-editor.vue.js +4 -3
- package/src/components/form-designer/setting-panel/property-editor/diy-compontent-editor.vue.js +33 -0
- package/src/components/form-designer/setting-panel/property-editor/index.js +2 -1
- package/src/components/form-designer/setting-panel/propertyRegister.js +1 -0
- package/src/components/form-designer/toolbar-panel/index.vue.js +4 -779
- package/src/components/form-designer/toolbar-panel/widgetList.js +780 -0
- package/src/components/form-designer/widget-panel/advanced/attachment-render.js +3 -3
- package/src/components/form-designer/widget-panel/advanced/diy-compontent.js +23 -0
- package/src/components/form-designer/widget-panel/advanced/slot.js +1 -1
- package/src/components/form-designer/widget-panel/advancedFieldsEnums.js +4 -2
- package/src/components/form-designer/widget-panel/index.vue.js +3 -2
- package/src/components/form-render/container-item/index.js +1 -1
- package/src/components/form-render/container-item/{table-item.vue2.js → table-item.vue.js} +1 -1
- package/src/components/form-render/container-item/vf-collapse-item.vue.js +1 -1
- package/src/components/form-render/dynamic-dialog.vue.js +241 -231
- package/src/components/form-render/dynamic-dialog.vue3.js +5 -0
- package/src/components/form-render/dynamic-drawer.vue.js +2 -203
- package/src/components/form-render/dynamic-drawer.vue2.js +247 -0
- package/src/lang/zh-CN.js +4 -5
- package/src/mixins/useDataTableMixin.js +1 -1
- package/src/utils/config.js +0 -2
- package/src/utils/i18n.js +14 -1
- package/styles/style.css +1 -1
- package/types/install.d.ts.map +1 -1
- package/types/src/components/CustomRender/components/AttachmentRender.d.ts +31 -0
- package/types/src/components/CustomRender/components/AttachmentRender.d.ts.map +1 -0
- package/types/src/components/CustomRender/components/index.d.ts +2 -0
- package/types/src/components/CustomRender/components/index.d.ts.map +1 -0
- package/types/src/components/CustomRender/{index.d.ts → useCustomRender.d.ts} +2 -2
- package/types/src/components/CustomRender/useCustomRender.d.ts.map +1 -0
- package/types/src/components/code-editor/code-modal-editor.d.ts +1 -1
- package/types/src/components/code-editor/index.d.ts +41 -55
- package/types/src/components/code-editor/index.d.ts.map +1 -1
- package/types/src/components/form-designer/setting-panel/index.d.ts +1 -0
- package/types/src/components/form-designer/toolbar-panel/index.d.ts +1 -1
- package/types/src/components/form-designer/toolbar-panel/widgetList.d.ts +556 -0
- package/types/src/components/form-designer/toolbar-panel/widgetList.d.ts.map +1 -0
- package/types/src/components/form-designer/widget-panel/advanced/attachment-render.d.ts +2 -14
- package/types/src/components/form-designer/widget-panel/advanced/attachment-render.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/advanced/bpmn-editor.d.ts +2 -15
- package/types/src/components/form-designer/widget-panel/advanced/bpmn-editor.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/advanced/cascader.d.ts +2 -55
- package/types/src/components/form-designer/widget-panel/advanced/cascader.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/advanced/code-editor.d.ts +2 -25
- package/types/src/components/form-designer/widget-panel/advanced/code-editor.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/advanced/diy-compontent.d.ts +9 -0
- package/types/src/components/form-designer/widget-panel/advanced/diy-compontent.d.ts.map +1 -0
- package/types/src/components/form-designer/widget-panel/advanced/file-upload.d.ts +2 -29
- package/types/src/components/form-designer/widget-panel/advanced/file-upload.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/advanced/rich-editor.d.ts +2 -26
- package/types/src/components/form-designer/widget-panel/advanced/rich-editor.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/advanced/slot.d.ts +2 -9
- package/types/src/components/form-designer/widget-panel/advanced/slot.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/advanced/tree-select.d.ts +2 -56
- package/types/src/components/form-designer/widget-panel/advanced/tree-select.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/advancedFieldsEnums.d.ts +75 -0
- package/types/src/components/form-designer/widget-panel/advancedFieldsEnums.d.ts.map +1 -0
- package/types/src/components/form-designer/widget-panel/basicFields/button.d.ts +2 -19
- package/types/src/components/form-designer/widget-panel/basicFields/button.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/basicFields/checkbox.d.ts +2 -40
- package/types/src/components/form-designer/widget-panel/basicFields/checkbox.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/basicFields/color.d.ts +2 -26
- package/types/src/components/form-designer/widget-panel/basicFields/color.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/basicFields/date.d.ts +2 -36
- package/types/src/components/form-designer/widget-panel/basicFields/date.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/basicFields/dateRange.d.ts +2 -36
- package/types/src/components/form-designer/widget-panel/basicFields/dateRange.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/basicFields/divider.d.ts +2 -13
- package/types/src/components/form-designer/widget-panel/basicFields/divider.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/basicFields/dropdown.d.ts +2 -24
- package/types/src/components/form-designer/widget-panel/basicFields/dropdown.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/basicFields/htmlText.d.ts +2 -11
- package/types/src/components/form-designer/widget-panel/basicFields/htmlText.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/basicFields/input.d.ts +2 -37
- package/types/src/components/form-designer/widget-panel/basicFields/input.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/basicFields/number.d.ts +2 -33
- package/types/src/components/form-designer/widget-panel/basicFields/number.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/basicFields/radio.d.ts +2 -44
- package/types/src/components/form-designer/widget-panel/basicFields/radio.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/basicFields/rate.d.ts +2 -28
- package/types/src/components/form-designer/widget-panel/basicFields/rate.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/basicFields/select.d.ts +2 -51
- package/types/src/components/form-designer/widget-panel/basicFields/select.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/basicFields/slider.d.ts +2 -30
- package/types/src/components/form-designer/widget-panel/basicFields/slider.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/basicFields/staticText.d.ts +2 -11
- package/types/src/components/form-designer/widget-panel/basicFields/staticText.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/basicFields/switch.d.ts +2 -24
- package/types/src/components/form-designer/widget-panel/basicFields/switch.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/basicFields/textarea.d.ts +2 -35
- package/types/src/components/form-designer/widget-panel/basicFields/textarea.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/basicFields/time.d.ts +2 -33
- package/types/src/components/form-designer/widget-panel/basicFields/time.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/basicFields/timeRange.d.ts +2 -34
- package/types/src/components/form-designer/widget-panel/basicFields/timeRange.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/business/department-select.d.ts +2 -51
- package/types/src/components/form-designer/widget-panel/business/department-select.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/business/material-select.d.ts +2 -51
- package/types/src/components/form-designer/widget-panel/business/material-select.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/business/operation-select.d.ts +2 -51
- package/types/src/components/form-designer/widget-panel/business/operation-select.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/business/post-select.d.ts +2 -53
- package/types/src/components/form-designer/widget-panel/business/post-select.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/business/project-group-select.d.ts +2 -51
- package/types/src/components/form-designer/widget-panel/business/project-group-select.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/business/project-select.d.ts +2 -51
- package/types/src/components/form-designer/widget-panel/business/project-select.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/business/user-select.d.ts +2 -54
- package/types/src/components/form-designer/widget-panel/business/user-select.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/containers/data-table.d.ts +2 -90
- package/types/src/components/form-designer/widget-panel/containers/data-table.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/containers/grid-col.d.ts +2 -14
- package/types/src/components/form-designer/widget-panel/containers/grid-col.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/containers/grid-sub-form.d.ts +2 -8
- package/types/src/components/form-designer/widget-panel/containers/grid-sub-form.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/containers/grid.d.ts +2 -8
- package/types/src/components/form-designer/widget-panel/containers/grid.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/containers/tab.d.ts +2 -12
- package/types/src/components/form-designer/widget-panel/containers/tab.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/containers/vf-box.d.ts +2 -6
- package/types/src/components/form-designer/widget-panel/containers/vf-box.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/containers/vf-collapse.d.ts +2 -12
- package/types/src/components/form-designer/widget-panel/containers/vf-collapse.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/containers/vf-dialog.d.ts +2 -22
- package/types/src/components/form-designer/widget-panel/containers/vf-dialog.d.ts.map +1 -1
- package/types/src/components/form-render/index.d.ts +4 -0
- package/types/src/components/form-render/index.d.ts.map +1 -1
- package/types/src/components/lowcodeCompontent/index.d.ts +6 -0
- package/types/src/components/lowcodeCompontent/index.d.ts.map +1 -0
- package/types/src/components/svg-icon/index.d.ts +47 -0
- package/types/src/components/svg-icon/index.d.ts.map +1 -0
- package/src/components/CustomRender/index.js +0 -52
- package/src/components/form-designer/form-widget/container-widget/data-table-widget.vue2.js +0 -235
- package/src/components/form-designer/form-widget/container-widget/vf-collapse-widget.vue2.js +0 -126
- package/stats.html +0 -4949
- package/types/src/components/CustomRender/index.d.ts.map +0 -1
|
@@ -2,6 +2,7 @@ import i18n from "../../../../utils/i18n.js";
|
|
|
2
2
|
import refMixinDesign from "../../refMixinDesign.js";
|
|
3
3
|
import comps from "../field-widget/index.js";
|
|
4
4
|
import ContainerWrapper from "./container-wrapper.vue.js";
|
|
5
|
+
import draggableComponent from "../../../../lib/vuedraggable/src/vuedraggable.js";
|
|
5
6
|
import { resolveComponent, createBlock, openBlock, withCtx, createElementBlock, withModifiers, normalizeClass, createVNode, mergeProps, createElementVNode, resolveDynamicComponent } from "vue";
|
|
6
7
|
/* empty css */
|
|
7
8
|
import _export_sfc from "../../../../../_virtual/_plugin-vue_export-helper.js";
|
|
@@ -11,6 +12,7 @@ const _sfc_main = {
|
|
|
11
12
|
mixins: [i18n, refMixinDesign],
|
|
12
13
|
inject: ["refList"],
|
|
13
14
|
components: {
|
|
15
|
+
Draggable: draggableComponent,
|
|
14
16
|
ContainerWrapper,
|
|
15
17
|
...comps
|
|
16
18
|
},
|
|
@@ -146,7 +148,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
146
148
|
_: 1
|
|
147
149
|
}, 8, ["designer", "widget", "parent-widget", "parent-list", "index-of-parent-list"]);
|
|
148
150
|
}
|
|
149
|
-
const vfDrawerWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
151
|
+
const vfDrawerWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-3c06805c"]]);
|
|
150
152
|
export {
|
|
151
153
|
vfDrawerWidget as default
|
|
152
154
|
};
|
package/src/components/form-designer/form-widget/field-widget/attachment-render-widget.vue.js
CHANGED
|
@@ -2,11 +2,9 @@ import FormItemWrapper from "./form-item-wrapper.vue.js";
|
|
|
2
2
|
import emitter from "../../../../utils/emitter.js";
|
|
3
3
|
import i18n from "../../../../utils/i18n.js";
|
|
4
4
|
import fieldMixin from "./fieldMixin.js";
|
|
5
|
-
import { useCustomRender } from "../../../CustomRender/index.js";
|
|
6
5
|
import { resolveComponent, createBlock, createCommentVNode, openBlock, withCtx, createElementVNode, createElementBlock, resolveDynamicComponent } from "vue";
|
|
7
6
|
/* empty css */
|
|
8
7
|
import _export_sfc from "../../../../../_virtual/_plugin-vue_export-helper.js";
|
|
9
|
-
useCustomRender();
|
|
10
8
|
const _sfc_main = {
|
|
11
9
|
name: "attachment-render-widget",
|
|
12
10
|
componentName: "FieldWidget",
|
|
@@ -109,7 +107,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
109
107
|
_: 1
|
|
110
108
|
}, 8, ["designer", "field", "rules", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"])) : createCommentVNode("", true);
|
|
111
109
|
}
|
|
112
|
-
const attachmentRenderWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
110
|
+
const attachmentRenderWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-cab28d0a"]]);
|
|
113
111
|
export {
|
|
114
112
|
attachmentRenderWidget as default
|
|
115
113
|
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import StaticContentWrapper from "./static-content-wrapper.vue.js";
|
|
2
|
+
import emitter from "../../../../utils/emitter.js";
|
|
3
|
+
import i18n from "../../../../utils/i18n.js";
|
|
4
|
+
import fieldMixin from "./fieldMixin.js";
|
|
5
|
+
import { useCustomRender } from "../../../CustomRender/useCustomRender.js";
|
|
6
|
+
import { resolveComponent, createBlock, openBlock, withCtx, createElementVNode, normalizeClass, createElementBlock, toDisplayString, resolveDynamicComponent, normalizeProps, guardReactiveProps } from "vue";
|
|
7
|
+
/* empty css */
|
|
8
|
+
import _export_sfc from "../../../../../_virtual/_plugin-vue_export-helper.js";
|
|
9
|
+
const { renderComponent } = useCustomRender();
|
|
10
|
+
const _sfc_main = {
|
|
11
|
+
name: "diy-compontent-widget",
|
|
12
|
+
componentName: "FieldWidget",
|
|
13
|
+
//必须固定为FieldWidget,用于接收父级组件的broadcast事件
|
|
14
|
+
mixins: [emitter, fieldMixin, i18n],
|
|
15
|
+
props: {
|
|
16
|
+
field: Object,
|
|
17
|
+
parentWidget: Object,
|
|
18
|
+
parentList: Array,
|
|
19
|
+
indexOfParentList: Number,
|
|
20
|
+
designer: Object,
|
|
21
|
+
designState: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: false
|
|
24
|
+
},
|
|
25
|
+
subFormRowIndex: {
|
|
26
|
+
/* 子表单组件行索引,从0开始计数 */
|
|
27
|
+
type: Number,
|
|
28
|
+
default: -1
|
|
29
|
+
},
|
|
30
|
+
subFormColIndex: {
|
|
31
|
+
/* 子表单组件列索引,从0开始计数 */
|
|
32
|
+
type: Number,
|
|
33
|
+
default: -1
|
|
34
|
+
},
|
|
35
|
+
subFormRowId: {
|
|
36
|
+
/* 子表单组件行Id,唯一id且不可变 */
|
|
37
|
+
type: String,
|
|
38
|
+
default: ""
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
data() {
|
|
42
|
+
return {};
|
|
43
|
+
},
|
|
44
|
+
components: {
|
|
45
|
+
StaticContentWrapper
|
|
46
|
+
},
|
|
47
|
+
computed: {},
|
|
48
|
+
beforeCreate() {
|
|
49
|
+
},
|
|
50
|
+
created() {
|
|
51
|
+
this.registerToRefList();
|
|
52
|
+
this.initEventHandler();
|
|
53
|
+
this.handleOnCreated();
|
|
54
|
+
},
|
|
55
|
+
mounted() {
|
|
56
|
+
this.handleOnMounted();
|
|
57
|
+
},
|
|
58
|
+
beforeUnmount() {
|
|
59
|
+
this.unregisterFromRefList();
|
|
60
|
+
},
|
|
61
|
+
methods: {
|
|
62
|
+
renderComponent
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const _hoisted_1 = {
|
|
66
|
+
key: 0,
|
|
67
|
+
class: "slot-title"
|
|
68
|
+
};
|
|
69
|
+
const _hoisted_2 = { key: 1 };
|
|
70
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
71
|
+
const _component_static_content_wrapper = resolveComponent("static-content-wrapper");
|
|
72
|
+
return openBlock(), createBlock(_component_static_content_wrapper, {
|
|
73
|
+
designer: $props.designer,
|
|
74
|
+
field: $props.field,
|
|
75
|
+
"design-state": $props.designState,
|
|
76
|
+
"parent-widget": $props.parentWidget,
|
|
77
|
+
"parent-list": $props.parentList,
|
|
78
|
+
"index-of-parent-list": $props.indexOfParentList,
|
|
79
|
+
"sub-form-row-index": $props.subFormRowIndex,
|
|
80
|
+
"sub-form-col-index": $props.subFormColIndex,
|
|
81
|
+
"sub-form-row-id": $props.subFormRowId
|
|
82
|
+
}, {
|
|
83
|
+
default: withCtx(() => [
|
|
84
|
+
createElementVNode("div", {
|
|
85
|
+
class: normalizeClass([!!$props.designState ? "slot-wrapper-design" : "slot-wrapper-render"])
|
|
86
|
+
}, [
|
|
87
|
+
!!$props.designState ? (openBlock(), createElementBlock("div", _hoisted_1, toDisplayString(_ctx.i18nt("designer.widgetLabel.diy-compontent")) + " " + toDisplayString($props.field.options.diyCompontent), 1)) : (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
88
|
+
(openBlock(), createBlock(resolveDynamicComponent($options.renderComponent($props.field.options.diyCompontent)), normalizeProps(guardReactiveProps({
|
|
89
|
+
data: _ctx.fieldModel,
|
|
90
|
+
...$props.field.options.props
|
|
91
|
+
})), null, 16))
|
|
92
|
+
]))
|
|
93
|
+
], 2)
|
|
94
|
+
]),
|
|
95
|
+
_: 1
|
|
96
|
+
}, 8, ["designer", "field", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
|
|
97
|
+
}
|
|
98
|
+
const diyCompontentWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-09f07dbc"]]);
|
|
99
|
+
export {
|
|
100
|
+
diyCompontentWidget as default
|
|
101
|
+
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { translateOptionItems, deepClone } from
|
|
2
|
-
import FormValidators from
|
|
3
|
-
import { fmtHttpParams } from
|
|
4
|
-
import { eq, isArray } from
|
|
1
|
+
import { translateOptionItems, deepClone } from '../../../../utils/util.js';
|
|
2
|
+
import FormValidators from '../../../../utils/validators.js';
|
|
3
|
+
import { fmtHttpParams } from '../../../../utils/request/fmtHttpParams.js';
|
|
4
|
+
import { eq, isArray } from 'lodash-es';
|
|
5
5
|
const fieldMixin = {
|
|
6
6
|
inject: [
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
'refList',
|
|
8
|
+
'getFormConfig',
|
|
9
|
+
'globalOptionData',
|
|
10
|
+
'globalModel',
|
|
11
|
+
'getOptionData',
|
|
12
|
+
'getGlobalDsv',
|
|
13
|
+
'getReadMode',
|
|
14
|
+
'getSubFormFieldFlag',
|
|
15
|
+
'getSubFormName',
|
|
16
|
+
'getDSResultCache'
|
|
17
17
|
],
|
|
18
18
|
data() {
|
|
19
19
|
return {
|
|
@@ -22,11 +22,14 @@ const fieldMixin = {
|
|
|
22
22
|
};
|
|
23
23
|
},
|
|
24
24
|
computed: {
|
|
25
|
+
isFileMode() {
|
|
26
|
+
return this.field.type === 'file-upload' || this.field.type === 'picture-upload';
|
|
27
|
+
},
|
|
25
28
|
formConfig() {
|
|
26
29
|
return this.getFormConfig();
|
|
27
30
|
},
|
|
28
31
|
subFormName() {
|
|
29
|
-
return !!this.getSubFormName ? this.getSubFormName() :
|
|
32
|
+
return !!this.getSubFormName ? this.getSubFormName() : '';
|
|
30
33
|
},
|
|
31
34
|
subFormItemFlag() {
|
|
32
35
|
return !!this.getSubFormFieldFlag ? this.getSubFormFieldFlag() : false;
|
|
@@ -42,13 +45,17 @@ const fieldMixin = {
|
|
|
42
45
|
},
|
|
43
46
|
optionLabel() {
|
|
44
47
|
if (this.fieldModel === null) {
|
|
45
|
-
return
|
|
48
|
+
return '';
|
|
46
49
|
} else {
|
|
47
|
-
let resultContent =
|
|
50
|
+
let resultContent = '';
|
|
48
51
|
const { valueKey, labelKey } = this.field.options;
|
|
49
|
-
this.field.options.optionItems.forEach(
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
+
this.field.options.optionItems.forEach(oItem => {
|
|
53
|
+
if (
|
|
54
|
+
oItem[valueKey] === this.fieldModel ||
|
|
55
|
+
this.findInArray(this.fieldModel, oItem[valueKey]) !== -1
|
|
56
|
+
) {
|
|
57
|
+
resultContent =
|
|
58
|
+
resultContent === '' ? oItem[labelKey] : resultContent + ' ' + oItem[labelKey];
|
|
52
59
|
}
|
|
53
60
|
});
|
|
54
61
|
return resultContent;
|
|
@@ -95,7 +102,7 @@ const fieldMixin = {
|
|
|
95
102
|
//--------------------- 组件内部方法 begin ------------------//
|
|
96
103
|
getPropName() {
|
|
97
104
|
if (this.subFormItemFlag && !this.designState) {
|
|
98
|
-
return this.subFormName +
|
|
105
|
+
return this.subFormName + '.' + this.subFormRowIndex + '.' + this.field.options.name;
|
|
99
106
|
} else {
|
|
100
107
|
return this.field.options.name;
|
|
101
108
|
}
|
|
@@ -106,9 +113,15 @@ const fieldMixin = {
|
|
|
106
113
|
}
|
|
107
114
|
if (!!this.subFormItemFlag && !this.designState) {
|
|
108
115
|
const subFormData = this.formModel[this.subFormName];
|
|
109
|
-
if (
|
|
116
|
+
if (
|
|
117
|
+
(subFormData === void 0 ||
|
|
118
|
+
subFormData[this.subFormRowIndex] === void 0 ||
|
|
119
|
+
subFormData[this.subFormRowIndex][this.field.options.name] === void 0) &&
|
|
120
|
+
this.field.options.defaultValue !== void 0
|
|
121
|
+
) {
|
|
110
122
|
this.fieldModel = this.field.options.defaultValue;
|
|
111
|
-
subFormData[this.subFormRowIndex][this.field.options.name] =
|
|
123
|
+
subFormData[this.subFormRowIndex][this.field.options.name] =
|
|
124
|
+
this.field.options.defaultValue;
|
|
112
125
|
} else if (subFormData[this.subFormRowIndex][this.field.options.name] === void 0) {
|
|
113
126
|
this.fieldModel = null;
|
|
114
127
|
subFormData[this.subFormRowIndex][this.field.options.name] = null;
|
|
@@ -128,7 +141,10 @@ const fieldMixin = {
|
|
|
128
141
|
this.initFileList();
|
|
129
142
|
return;
|
|
130
143
|
}
|
|
131
|
-
if (
|
|
144
|
+
if (
|
|
145
|
+
this.formModel[this.field.options.name] === void 0 &&
|
|
146
|
+
this.field.options.defaultValue !== void 0
|
|
147
|
+
) {
|
|
132
148
|
this.fieldModel = this.field.options.defaultValue;
|
|
133
149
|
} else if (this.formModel[this.field.options.name] === void 0) {
|
|
134
150
|
this.formModel[this.field.options.name] = null;
|
|
@@ -139,7 +155,7 @@ const fieldMixin = {
|
|
|
139
155
|
this.initFileList();
|
|
140
156
|
},
|
|
141
157
|
initFileList() {
|
|
142
|
-
if (this.
|
|
158
|
+
if (!this.isFileMode || this.designState === true) {
|
|
143
159
|
return;
|
|
144
160
|
}
|
|
145
161
|
if (!!this.fieldModel) {
|
|
@@ -151,12 +167,16 @@ const fieldMixin = {
|
|
|
151
167
|
}
|
|
152
168
|
},
|
|
153
169
|
initEventHandler() {
|
|
154
|
-
this.on$(
|
|
170
|
+
this.on$('setFormData', newFormData => {
|
|
155
171
|
if (!this.subFormItemFlag) {
|
|
156
|
-
|
|
172
|
+
let data = newFormData?.[this.field.options.name] || '';
|
|
173
|
+
if (this.isFileMode) {
|
|
174
|
+
if (typeof data === 'string' && data !== '') data = JSON.parse(data);
|
|
175
|
+
}
|
|
176
|
+
this.setValue(data);
|
|
157
177
|
}
|
|
158
178
|
});
|
|
159
|
-
this.on$(
|
|
179
|
+
this.on$('field-value-changed', values => {
|
|
160
180
|
if (!!this.subFormItemFlag) {
|
|
161
181
|
const subFormData = this.formModel[this.subFormName];
|
|
162
182
|
this.handleOnChangeForSubForm(values[0], values[1], subFormData, this.subFormRowId);
|
|
@@ -164,10 +184,10 @@ const fieldMixin = {
|
|
|
164
184
|
this.handleOnChange(values[0], values[1]);
|
|
165
185
|
}
|
|
166
186
|
});
|
|
167
|
-
this.on$(
|
|
187
|
+
this.on$('loadOptionItemsFromDataSet', dsName => {
|
|
168
188
|
this.loadOptionItemsFromDataSet(dsName);
|
|
169
189
|
});
|
|
170
|
-
this.on$(
|
|
190
|
+
this.on$('reloadOptionItems', widgetNames => {
|
|
171
191
|
if (widgetNames.length === 0 || widgetNames.indexOf(this.field.options.name) > -1) {
|
|
172
192
|
this.initOptionItems(true);
|
|
173
193
|
}
|
|
@@ -195,9 +215,9 @@ const fieldMixin = {
|
|
|
195
215
|
if (this.refList !== null && !!this.field.options.name) {
|
|
196
216
|
if (this.subFormItemFlag && !this.designState) {
|
|
197
217
|
if (!!oldRefName) {
|
|
198
|
-
delete this.refList[oldRefName +
|
|
218
|
+
delete this.refList[oldRefName + '@row' + this.subFormRowId];
|
|
199
219
|
}
|
|
200
|
-
this.refList[this.field.options.name +
|
|
220
|
+
this.refList[this.field.options.name + '@row' + this.subFormRowId] = this;
|
|
201
221
|
} else {
|
|
202
222
|
if (!!oldRefName) {
|
|
203
223
|
delete this.refList[oldRefName];
|
|
@@ -210,7 +230,7 @@ const fieldMixin = {
|
|
|
210
230
|
if (this.refList !== null && !!this.field.options.name) {
|
|
211
231
|
const oldRefName = this.field.options.name;
|
|
212
232
|
if (this.subFormItemFlag && !this.designState) {
|
|
213
|
-
delete this.refList[oldRefName +
|
|
233
|
+
delete this.refList[oldRefName + '@row' + this.subFormRowId];
|
|
214
234
|
} else {
|
|
215
235
|
delete this.refList[oldRefName];
|
|
216
236
|
}
|
|
@@ -228,8 +248,11 @@ const fieldMixin = {
|
|
|
228
248
|
}
|
|
229
249
|
if (this.loading) return;
|
|
230
250
|
this.loading = true;
|
|
231
|
-
if ([
|
|
232
|
-
if (
|
|
251
|
+
if (['radio', 'checkbox', 'select', 'cascader', 'treeSelect'].includes(this.field.type)) {
|
|
252
|
+
if (
|
|
253
|
+
!!this.field.options.dsEnabled &&
|
|
254
|
+
((_a = this.field.options.http) == null ? void 0 : _a.url)
|
|
255
|
+
) {
|
|
233
256
|
try {
|
|
234
257
|
const dsResult = await fmtHttpParams.call(this, this.field.options, {
|
|
235
258
|
fieldCode: this.field.options.name
|
|
@@ -247,7 +270,7 @@ const fieldMixin = {
|
|
|
247
270
|
}
|
|
248
271
|
}
|
|
249
272
|
} catch (err) {
|
|
250
|
-
console.error(
|
|
273
|
+
console.error('err: ', err);
|
|
251
274
|
}
|
|
252
275
|
}
|
|
253
276
|
const newOptionItems = this.getOptionData();
|
|
@@ -265,10 +288,20 @@ const fieldMixin = {
|
|
|
265
288
|
if (this.designState) {
|
|
266
289
|
return;
|
|
267
290
|
}
|
|
268
|
-
if (
|
|
291
|
+
if (
|
|
292
|
+
this.field.type !== 'radio' &&
|
|
293
|
+
this.field.type !== 'checkbox' &&
|
|
294
|
+
this.field.type !== 'select' &&
|
|
295
|
+
this.field.type !== 'cascader'
|
|
296
|
+
) {
|
|
269
297
|
return;
|
|
270
298
|
}
|
|
271
|
-
if (
|
|
299
|
+
if (
|
|
300
|
+
!this.field.options.dsEnabled ||
|
|
301
|
+
!this.field.options.dsName ||
|
|
302
|
+
!this.field.options.dataSetName ||
|
|
303
|
+
this.field.options.dsName !== dsName
|
|
304
|
+
) {
|
|
272
305
|
return;
|
|
273
306
|
}
|
|
274
307
|
const dataCache = this.getDSResultCache();
|
|
@@ -298,10 +331,8 @@ const fieldMixin = {
|
|
|
298
331
|
this.rules.push({
|
|
299
332
|
required: true,
|
|
300
333
|
//trigger: ['blur', 'change'],
|
|
301
|
-
trigger: [
|
|
302
|
-
|
|
303
|
-
],
|
|
304
|
-
message: this.field.options.requiredHint || this.i18nt("render.hint.fieldRequired")
|
|
334
|
+
trigger: ['blur'],
|
|
335
|
+
message: this.field.options.requiredHint || this.i18nt('render.hint.fieldRequired')
|
|
305
336
|
});
|
|
306
337
|
}
|
|
307
338
|
if (!!this.field.options.validation) {
|
|
@@ -309,14 +340,14 @@ const fieldMixin = {
|
|
|
309
340
|
if (!!FormValidators[vldName]) {
|
|
310
341
|
this.rules.push({
|
|
311
342
|
validator: FormValidators[vldName],
|
|
312
|
-
trigger: [
|
|
343
|
+
trigger: ['blur', 'change'],
|
|
313
344
|
label: this.field.options.label,
|
|
314
345
|
errorMsg: this.field.options.validationHint
|
|
315
346
|
});
|
|
316
347
|
} else {
|
|
317
348
|
this.rules.push({
|
|
318
|
-
validator: FormValidators[
|
|
319
|
-
trigger: [
|
|
349
|
+
validator: FormValidators['regExp'],
|
|
350
|
+
trigger: ['blur', 'change'],
|
|
320
351
|
regExp: vldName,
|
|
321
352
|
label: this.field.options.label,
|
|
322
353
|
errorMsg: this.field.options.validationHint
|
|
@@ -325,12 +356,12 @@ const fieldMixin = {
|
|
|
325
356
|
}
|
|
326
357
|
if (!!this.field.options.onValidate) {
|
|
327
358
|
const customFn = (rule, value) => {
|
|
328
|
-
const tmpFunc = new Function(
|
|
359
|
+
const tmpFunc = new Function('rule', 'value', this.field.options.onValidate);
|
|
329
360
|
return tmpFunc.call(this, rule, value);
|
|
330
361
|
};
|
|
331
362
|
this.rules.push({
|
|
332
363
|
validator: customFn,
|
|
333
|
-
trigger: [
|
|
364
|
+
trigger: ['blur'],
|
|
334
365
|
label: this.field.options.label
|
|
335
366
|
});
|
|
336
367
|
}
|
|
@@ -342,7 +373,7 @@ const fieldMixin = {
|
|
|
342
373
|
if (!this.rules) {
|
|
343
374
|
return;
|
|
344
375
|
}
|
|
345
|
-
this.rules.forEach(
|
|
376
|
+
this.rules.forEach(rule => {
|
|
346
377
|
if (!!rule.trigger) {
|
|
347
378
|
rule.trigger.splice(0, rule.trigger.length);
|
|
348
379
|
}
|
|
@@ -355,16 +386,16 @@ const fieldMixin = {
|
|
|
355
386
|
if (!this.rules) {
|
|
356
387
|
return;
|
|
357
388
|
}
|
|
358
|
-
this.rules.forEach(
|
|
389
|
+
this.rules.forEach(rule => {
|
|
359
390
|
if (!!rule.trigger) {
|
|
360
|
-
rule.trigger.push(
|
|
361
|
-
rule.trigger.push(
|
|
391
|
+
rule.trigger.push('blur');
|
|
392
|
+
rule.trigger.push('change');
|
|
362
393
|
}
|
|
363
394
|
});
|
|
364
395
|
},
|
|
365
396
|
disableOptionOfList(optionList, optionValue) {
|
|
366
397
|
if (!!optionList && optionList.length > 0) {
|
|
367
|
-
optionList.forEach(
|
|
398
|
+
optionList.forEach(opt => {
|
|
368
399
|
if (opt.value === optionValue) {
|
|
369
400
|
opt.disabled = true;
|
|
370
401
|
}
|
|
@@ -373,7 +404,7 @@ const fieldMixin = {
|
|
|
373
404
|
},
|
|
374
405
|
enableOptionOfList(optionList, optionValue) {
|
|
375
406
|
if (!!optionList && optionList.length > 0) {
|
|
376
|
-
optionList.forEach(
|
|
407
|
+
optionList.forEach(opt => {
|
|
377
408
|
if (opt.value === optionValue) {
|
|
378
409
|
opt.disabled = false;
|
|
379
410
|
}
|
|
@@ -386,8 +417,8 @@ const fieldMixin = {
|
|
|
386
417
|
if (newValue) {
|
|
387
418
|
newValue = newValue.target ? newValue.target.value : newValue;
|
|
388
419
|
}
|
|
389
|
-
this.emit$(
|
|
390
|
-
this.dispatch(
|
|
420
|
+
this.emit$('field-value-changed', [newValue, oldValue]);
|
|
421
|
+
this.dispatch('VFormRender', 'fieldChange', [
|
|
391
422
|
this.field.options.name,
|
|
392
423
|
newValue,
|
|
393
424
|
oldValue,
|
|
@@ -419,7 +450,7 @@ const fieldMixin = {
|
|
|
419
450
|
this.syncUpdateFormModel(value);
|
|
420
451
|
this.emitFieldDataChange(value, this.oldFieldValue);
|
|
421
452
|
this.oldFieldValue = deepClone(value);
|
|
422
|
-
this.dispatch(
|
|
453
|
+
this.dispatch('VFormRender', 'fieldValidation', [this.getPropName()]);
|
|
423
454
|
},
|
|
424
455
|
handleFocusCustomEvent(event) {
|
|
425
456
|
if (!!this.designState) {
|
|
@@ -427,7 +458,7 @@ const fieldMixin = {
|
|
|
427
458
|
}
|
|
428
459
|
this.oldFieldValue = deepClone(this.fieldModel);
|
|
429
460
|
if (!!this.field.options.onFocus) {
|
|
430
|
-
const customFn = new Function(
|
|
461
|
+
const customFn = new Function('event', this.field.options.onFocus);
|
|
431
462
|
customFn.call(this, event);
|
|
432
463
|
}
|
|
433
464
|
if (this.field.options.loadingPage) {
|
|
@@ -440,7 +471,7 @@ const fieldMixin = {
|
|
|
440
471
|
return;
|
|
441
472
|
}
|
|
442
473
|
if (!!this.field.options.onBlur) {
|
|
443
|
-
const customFn = new Function(
|
|
474
|
+
const customFn = new Function('event', this.field.options.onBlur);
|
|
444
475
|
customFn.call(this, event);
|
|
445
476
|
}
|
|
446
477
|
},
|
|
@@ -452,9 +483,9 @@ const fieldMixin = {
|
|
|
452
483
|
return;
|
|
453
484
|
}
|
|
454
485
|
this.syncUpdateFormModel(value);
|
|
455
|
-
this.dispatch(
|
|
486
|
+
this.dispatch('VFormRender', 'fieldValidation', [this.getPropName()]);
|
|
456
487
|
if (!!this.field.options.onInput) {
|
|
457
|
-
const customFn = new Function(
|
|
488
|
+
const customFn = new Function('value', this.field.options.onInput);
|
|
458
489
|
customFn.call(this, value);
|
|
459
490
|
}
|
|
460
491
|
},
|
|
@@ -466,7 +497,7 @@ const fieldMixin = {
|
|
|
466
497
|
const customFn = new Function(this.field.options.onAppendButtonClick);
|
|
467
498
|
customFn.call(this);
|
|
468
499
|
} else {
|
|
469
|
-
this.dispatch(
|
|
500
|
+
this.dispatch('VFormRender', 'appendButtonClick', [this]);
|
|
470
501
|
}
|
|
471
502
|
},
|
|
472
503
|
handleOnChange(val, oldVal, ops = []) {
|
|
@@ -474,7 +505,7 @@ const fieldMixin = {
|
|
|
474
505
|
return;
|
|
475
506
|
}
|
|
476
507
|
if (!!this.field.options.onChange) {
|
|
477
|
-
const changeFn = new Function(
|
|
508
|
+
const changeFn = new Function('value', 'oldValue', 'ops', this.field.options.onChange);
|
|
478
509
|
changeFn.call(this, val, oldVal, ops[0]);
|
|
479
510
|
}
|
|
480
511
|
},
|
|
@@ -484,11 +515,11 @@ const fieldMixin = {
|
|
|
484
515
|
}
|
|
485
516
|
if (!!this.field.options.onChange) {
|
|
486
517
|
const changeFn = new Function(
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
518
|
+
'value',
|
|
519
|
+
'oldValue',
|
|
520
|
+
'ops',
|
|
521
|
+
'subFormData',
|
|
522
|
+
'rowId',
|
|
492
523
|
this.field.options.onChange
|
|
493
524
|
);
|
|
494
525
|
changeFn.call(this, val, oldVal, ops[0], subFormData, rowId);
|
|
@@ -502,7 +533,7 @@ const fieldMixin = {
|
|
|
502
533
|
const customFn = new Function(this.field.options.onClick);
|
|
503
534
|
return customFn.call(this);
|
|
504
535
|
} else {
|
|
505
|
-
this.dispatch(
|
|
536
|
+
this.dispatch('VFormRender', 'buttonClick', [this]);
|
|
506
537
|
}
|
|
507
538
|
},
|
|
508
539
|
handleButtonWidgetClick() {
|
|
@@ -513,7 +544,7 @@ const fieldMixin = {
|
|
|
513
544
|
const customFn = new Function(this.field.options.onClick);
|
|
514
545
|
return customFn.call(this);
|
|
515
546
|
} else {
|
|
516
|
-
this.dispatch(
|
|
547
|
+
this.dispatch('VFormRender', 'buttonClick', [this]);
|
|
517
548
|
}
|
|
518
549
|
},
|
|
519
550
|
/**
|
|
@@ -545,17 +576,17 @@ const fieldMixin = {
|
|
|
545
576
|
//--------------------- 以下为组件支持外部调用的API方法 begin ------------------//
|
|
546
577
|
/* 提示:用户可自行扩充这些方法!!! */
|
|
547
578
|
getFormRef() {
|
|
548
|
-
return this.refList[
|
|
579
|
+
return this.refList['v_form_ref'];
|
|
549
580
|
},
|
|
550
581
|
getWidgetRef(widgetName, showError) {
|
|
551
582
|
const foundRef = this.refList[widgetName];
|
|
552
583
|
if (!foundRef && !!showError) {
|
|
553
|
-
this.$message.error(this.i18nt(
|
|
584
|
+
this.$message.error(this.i18nt('render.hint.refNotFound') + widgetName);
|
|
554
585
|
}
|
|
555
586
|
return foundRef;
|
|
556
587
|
},
|
|
557
588
|
getFieldEditor() {
|
|
558
|
-
return this.$refs[
|
|
589
|
+
return this.$refs['fieldEditor'];
|
|
559
590
|
},
|
|
560
591
|
showFileList(list) {
|
|
561
592
|
if (!isArray(list)) return [];
|
|
@@ -577,9 +608,9 @@ const fieldMixin = {
|
|
|
577
608
|
if (eq(this.fieldModel, newValue)) return;
|
|
578
609
|
if (!!this.field.formItemFlag) {
|
|
579
610
|
const oldValue = deepClone(this.fieldModel);
|
|
580
|
-
if (this.field.type ===
|
|
611
|
+
if (this.field.type === 'file-upload') {
|
|
581
612
|
newValue = this.showFileList(newValue || []);
|
|
582
|
-
} else if (this.field.type ===
|
|
613
|
+
} else if (this.field.type === 'code-editor') {
|
|
583
614
|
this.$refs.fieldEditor.setValue(newValue);
|
|
584
615
|
}
|
|
585
616
|
this.fieldModel = newValue;
|
|
@@ -598,9 +629,8 @@ const fieldMixin = {
|
|
|
598
629
|
resetField() {
|
|
599
630
|
const defaultValue = this.field.options.defaultValue;
|
|
600
631
|
this.setValue(defaultValue);
|
|
601
|
-
this.$nextTick(() => {
|
|
602
|
-
|
|
603
|
-
if (this.field.type === "picture-upload" || this.field.type === "file-upload") {
|
|
632
|
+
this.$nextTick(() => {});
|
|
633
|
+
if (this.field.type === 'picture-upload' || this.field.type === 'file-upload') {
|
|
604
634
|
this.fileList.splice(0, this.fileList.length);
|
|
605
635
|
this.handleChangeEvent(this.fileList);
|
|
606
636
|
}
|
|
@@ -658,13 +688,20 @@ const fieldMixin = {
|
|
|
658
688
|
}
|
|
659
689
|
},
|
|
660
690
|
clearSelectedOptions() {
|
|
661
|
-
if (
|
|
691
|
+
if (
|
|
692
|
+
this.field.type !== 'checkbox' &&
|
|
693
|
+
this.field.type !== 'radio' &&
|
|
694
|
+
this.field.type !== 'select'
|
|
695
|
+
) {
|
|
662
696
|
return;
|
|
663
697
|
}
|
|
664
|
-
if (
|
|
698
|
+
if (
|
|
699
|
+
this.field.type === 'checkbox' ||
|
|
700
|
+
(this.field.type === 'select' && this.field.options.multiple)
|
|
701
|
+
) {
|
|
665
702
|
this.fieldModel = [];
|
|
666
703
|
} else {
|
|
667
|
-
this.fieldModel =
|
|
704
|
+
this.fieldModel = '';
|
|
668
705
|
}
|
|
669
706
|
},
|
|
670
707
|
/**
|
|
@@ -675,8 +712,8 @@ const fieldMixin = {
|
|
|
675
712
|
this.field.options.optionItems = translateOptionItems(
|
|
676
713
|
options,
|
|
677
714
|
this.field.type,
|
|
678
|
-
this.field.options.labelKey ||
|
|
679
|
-
this.field.options.valueKey ||
|
|
715
|
+
this.field.options.labelKey || 'label',
|
|
716
|
+
this.field.options.valueKey || 'value'
|
|
680
717
|
);
|
|
681
718
|
},
|
|
682
719
|
/**
|
|
@@ -687,8 +724,8 @@ const fieldMixin = {
|
|
|
687
724
|
this.field.options.optionItems = translateOptionItems(
|
|
688
725
|
options,
|
|
689
726
|
this.field.type,
|
|
690
|
-
this.field.options.labelKey ||
|
|
691
|
-
this.field.options.valueKey ||
|
|
727
|
+
this.field.options.labelKey || 'label',
|
|
728
|
+
this.field.options.valueKey || 'value'
|
|
692
729
|
);
|
|
693
730
|
},
|
|
694
731
|
disableOption(optionValue) {
|
|
@@ -766,6 +803,4 @@ const fieldMixin = {
|
|
|
766
803
|
//--------------------- 以上为组件支持外部调用的API方法 end ------------------//
|
|
767
804
|
}
|
|
768
805
|
};
|
|
769
|
-
export {
|
|
770
|
-
fieldMixin as default
|
|
771
|
-
};
|
|
806
|
+
export { fieldMixin as default };
|
|
@@ -8,6 +8,7 @@ import * as colorWidget from "./color-widget.vue.js";
|
|
|
8
8
|
import * as dateRangeWidget from "./date-range-widget.vue.js";
|
|
9
9
|
import * as dateWidget from "./date-widget.vue.js";
|
|
10
10
|
import * as dividerWidget from "./divider-widget.vue.js";
|
|
11
|
+
import * as diyCompontentWidget from "./diy-compontent-widget.vue.js";
|
|
11
12
|
import * as dropdownWidget from "./dropdown-widget.vue.js";
|
|
12
13
|
import * as fileUploadWidget from "./file-upload-widget.vue.js";
|
|
13
14
|
import * as formItemWrapper from "./form-item-wrapper.vue.js";
|
|
@@ -29,7 +30,8 @@ import * as timeRangeWidget from "./time-range-widget.vue.js";
|
|
|
29
30
|
import * as timeWidget from "./time-widget.vue.js";
|
|
30
31
|
import * as treeSelectWidget from "./treeSelect-widget.vue.js";
|
|
31
32
|
const comps = {};
|
|
32
|
-
const modules = /* @__PURE__ */ Object.assign({ "./attachment-render-widget.vue": attachmentRenderWidget, "./bpmn-editor-widget.vue": bpmnEditorWidget, "./button-widget.vue": buttonWidget, "./cascader-widget.vue": cascaderWidget, "./checkbox-widget.vue": checkboxWidget, "./code-editor-widget.vue": codeEditorWidget, "./color-widget.vue": colorWidget, "./date-range-widget.vue": dateRangeWidget, "./date-widget.vue": dateWidget, "./divider-widget.vue": dividerWidget, "./dropdown-widget.vue": dropdownWidget, "./file-upload-widget.vue": fileUploadWidget, "./form-item-wrapper.vue": formItemWrapper, "./html-text-widget.vue": htmlTextWidget, "./input-widget.vue": inputWidget, "./number-widget.vue": numberWidget, "./picture-upload-widget.vue": pictureUploadWidget, "./radio-widget.vue": radioWidget, "./rate-widget.vue": rateWidget, "./rich-editor-widget.vue": richEditorWidget, "./select-widget.vue": selectWidget, "./slider-widget.vue": sliderWidget, "./slot-widget.vue": slotWidget, "./static-content-wrapper.vue": staticContentWrapper, "./static-text-widget.vue": staticTextWidget, "./switch-widget.vue": switchWidget, "./textarea-widget.vue": textareaWidget, "./time-range-widget.vue": timeRangeWidget, "./time-widget.vue": timeWidget, "./treeSelect-widget.vue": treeSelectWidget });
|
|
33
|
+
const modules = /* @__PURE__ */ Object.assign({ "./attachment-render-widget.vue": attachmentRenderWidget, "./bpmn-editor-widget.vue": bpmnEditorWidget, "./button-widget.vue": buttonWidget, "./cascader-widget.vue": cascaderWidget, "./checkbox-widget.vue": checkboxWidget, "./code-editor-widget.vue": codeEditorWidget, "./color-widget.vue": colorWidget, "./date-range-widget.vue": dateRangeWidget, "./date-widget.vue": dateWidget, "./divider-widget.vue": dividerWidget, "./diy-compontent-widget.vue": diyCompontentWidget, "./dropdown-widget.vue": dropdownWidget, "./file-upload-widget.vue": fileUploadWidget, "./form-item-wrapper.vue": formItemWrapper, "./html-text-widget.vue": htmlTextWidget, "./input-widget.vue": inputWidget, "./number-widget.vue": numberWidget, "./picture-upload-widget.vue": pictureUploadWidget, "./radio-widget.vue": radioWidget, "./rate-widget.vue": rateWidget, "./rich-editor-widget.vue": richEditorWidget, "./select-widget.vue": selectWidget, "./slider-widget.vue": sliderWidget, "./slot-widget.vue": slotWidget, "./static-content-wrapper.vue": staticContentWrapper, "./static-text-widget.vue": staticTextWidget, "./switch-widget.vue": switchWidget, "./textarea-widget.vue": textareaWidget, "./time-range-widget.vue": timeRangeWidget, "./time-widget.vue": timeWidget, "./treeSelect-widget.vue": treeSelectWidget });
|
|
34
|
+
console.log(modules);
|
|
33
35
|
for (const path in modules) {
|
|
34
36
|
const cname = modules[path].default.name;
|
|
35
37
|
comps[cname] = modules[path].default;
|