From 7d3d81dc41330597c569d20f2f39ec84b52a2442 Mon Sep 17 00:00:00 2001 From: vdpAdmin Date: Wed, 11 May 2022 17:24:41 +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 --- package.json | 2 +- .../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 | 3 +-- src/utils/config.js | 12 +----------- 7 files changed, 14 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 27fb80d..e3a5f2e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "variant-form", - "version": "2.2.5", + "version": "2.2.6", "private": false, "scripts": { "serve": "vue-cli-service serve --open src/main.js", 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 92b2e89..a18c22a 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 @@ -19,7 +19,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 34d5744..697d3df 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 @@ -19,7 +19,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 53a7fba..72ebbbf 100644 --- a/src/components/form-render/container-item/containerItemMixin.js +++ b/src/components/form-render/container-item/containerItemMixin.js @@ -153,6 +153,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 efe566a..3fa372b 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 ad8631a..16bb813 100644 --- a/src/components/form-render/index.vue +++ b/src/components/form-render/index.vue @@ -560,14 +560,13 @@ subFormNames.forEach(sfName => { if (!!this.subFormRefList[sfName].resetSubForm) { this.subFormRefList[sfName].resetSubForm() - this.subFormRefList[sfName].addSubFormRow() } }) 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 54ab5ac..bfc410f 100644 --- a/src/utils/config.js +++ b/src/utils/config.js @@ -1,14 +1,4 @@ -export const DESIGNER_OPTIONS = { - showLanguageMenu: true, - showGetSourceURL: true, - showGithubURL: true, - showDocumentURL: true, - showChatGroup: true, - // - -} - -export const VARIANT_FORM_VERSION = '2.2.5' +export const VARIANT_FORM_VERSION = '2.2.6' //export const MOCK_CASE_URL = 'https://www.fastmock.site/mock/2de212e0dc4b8e0885fea44ab9f2e1d0/vform/' export const MOCK_CASE_URL = 'https://ks3-cn-beijing.ksyuncs.com/vform-static/vcase/'