From be7d23cddf213c6b01fec87246276d63ca7d975f Mon Sep 17 00:00:00 2001 From: vdpAdmin Date: Wed, 11 May 2022 17:25:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=BE=E7=89=87=E3=80=81?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0=E7=BB=84=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E7=B1=BB=E5=9E=8B=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E7=BC=96=E8=BE=91=E5=99=A8=E9=94=99=E8=AF=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form-widget/field-widget/fieldMixin.js | 4 +++- .../field-file-upload/file-upload-fileTypes-editor.vue | 2 +- .../picture-upload-fileTypes-editor.vue | 2 +- .../form-render/container-item/containerItemMixin.js | 4 ++++ .../form-render/container-item/sub-form-item.vue | 5 +++++ src/components/form-render/index.vue | 2 +- src/utils/config.js | 10 ---------- 7 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/components/form-designer/form-widget/field-widget/fieldMixin.js b/src/components/form-designer/form-widget/field-widget/fieldMixin.js index 7fb587c..9fef1ec 100644 --- a/src/components/form-designer/form-widget/field-widget/fieldMixin.js +++ b/src/components/form-designer/form-widget/field-widget/fieldMixin.js @@ -316,7 +316,9 @@ export default { if (!!this.subFormItemFlag) { let subFormData = this.formModel[this.subFormName] || [{}] let subFormDataRow = subFormData[this.subFormRowIndex] - subFormDataRow[this.field.options.name] = value + if (!!subFormDataRow) { // 重置表单后subFormDataRow为undefined,应跳过!! + subFormDataRow[this.field.options.name] = value + } } else { this.formModel[this.field.options.name] = value } diff --git a/src/components/form-designer/setting-panel/property-editor/field-file-upload/file-upload-fileTypes-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-file-upload/file-upload-fileTypes-editor.vue index 098e9e3..57b7b27 100644 --- a/src/components/form-designer/setting-panel/property-editor/field-file-upload/file-upload-fileTypes-editor.vue +++ b/src/components/form-designer/setting-panel/property-editor/field-file-upload/file-upload-fileTypes-editor.vue @@ -21,7 +21,7 @@ import i18n from "@/utils/i18n" export default { - name: "fileTypes-editor", + name: "file-upload-fileTypes-editor", mixins: [i18n], props: { designer: Object, diff --git a/src/components/form-designer/setting-panel/property-editor/field-picture-upload/picture-upload-fileTypes-editor.vue b/src/components/form-designer/setting-panel/property-editor/field-picture-upload/picture-upload-fileTypes-editor.vue index ddb1a77..97d9adc 100644 --- a/src/components/form-designer/setting-panel/property-editor/field-picture-upload/picture-upload-fileTypes-editor.vue +++ b/src/components/form-designer/setting-panel/property-editor/field-picture-upload/picture-upload-fileTypes-editor.vue @@ -21,7 +21,7 @@ import i18n from "@/utils/i18n" export default { - name: "fileTypes-editor", + name: "picture-upload-fileTypes-editor", mixins: [i18n], props: { designer: Object, diff --git a/src/components/form-render/container-item/containerItemMixin.js b/src/components/form-render/container-item/containerItemMixin.js index e041905..2cfbf4a 100644 --- a/src/components/form-render/container-item/containerItemMixin.js +++ b/src/components/form-render/container-item/containerItemMixin.js @@ -152,6 +152,10 @@ export default { subFormModel.splice(0, subFormModel.length) this.rowIdData.splice(0, this.rowIdData.length) } + + if (this.widget.options.showBlankRow) { + this.addSubFormRow() + } } }, diff --git a/src/components/form-render/container-item/sub-form-item.vue b/src/components/form-render/container-item/sub-form-item.vue index bff4f26..c017b0f 100644 --- a/src/components/form-render/container-item/sub-form-item.vue +++ b/src/components/form-render/container-item/sub-form-item.vue @@ -150,6 +150,11 @@ return this.rowIdData }, + getWidgetRefOfSubForm(widgetName, rowIndex) { + let realWidgetName = widgetName + '@row' + this.rowIdData[rowIndex] + return this.getWidgetRef(realWidgetName) + }, + initFieldSchemaData() { //初始化fieldSchemaData!!! if (this.widget.type !== 'sub-form') { return diff --git a/src/components/form-render/index.vue b/src/components/form-render/index.vue index 28ad263..46b2bd9 100644 --- a/src/components/form-render/index.vue +++ b/src/components/form-render/index.vue @@ -540,7 +540,7 @@ let wNameList = Object.keys(this.widgetRefList) wNameList.forEach(wName => { let foundW = this.getWidgetRef(wName) - if (!!foundW && !!foundW.resetField) { + if (!!foundW && !foundW.subFormItemFlag && !!foundW.resetField) { // 跳过子表单字段!! foundW.resetField() } }) diff --git a/src/utils/config.js b/src/utils/config.js index 5b9ae2f..7e35793 100644 --- a/src/utils/config.js +++ b/src/utils/config.js @@ -1,13 +1,3 @@ -export const DESIGNER_OPTIONS = { - showLanguageMenu: true, - showGetSourceURL: true, - showGithubURL: true, - showDocumentURL: true, - showChatGroup: true, - // - -} - export const VARIANT_FORM_VERSION = '3.0.7' //export const MOCK_CASE_URL = 'https://www.fastmock.site/mock/2de212e0dc4b8e0885fea44ab9f2e1d0/vform/'