From 2e632e7a966292965074424ed1a3b519a9bf8ceb Mon Sep 17 00:00:00 2001 From: vdpAdmin Date: Thu, 10 Mar 2022 15:33:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E5=88=B02.2.4=EF=BC=9A=201.?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96=E5=8D=A1=E7=89=87=E7=BB=84=E4=BB=B6card?= =?UTF-8?q?=E7=9A=84=E6=8E=A5=E6=94=B6=E6=8B=96=E6=8B=BD=E5=8C=BA=E5=9F=9F?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=EF=BC=9B=202.=20=E4=BF=AE=E5=A4=8Dtype?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E7=BC=96=E8=BE=91=E5=99=A8=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/components/form-designer/setting-panel/index.vue | 9 +++++++++ .../form-designer/setting-panel/propertyRegister.js | 8 ++++++++ src/components/form-designer/toolbar-panel/index.vue | 2 +- src/extension/extension-loader.js | 2 +- src/extension/samples/card/card-widget.vue | 8 ++++++++ src/lang/zh-CN.js | 4 ++-- src/styles/global.scss | 5 +++++ src/utils/config.js | 2 +- 9 files changed, 36 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 9cbd54d..9a2d68e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "variant-form", - "version": "2.2.3", + "version": "2.2.4", "private": false, "scripts": { "serve": "vue-cli-service serve --open src/main.js", diff --git a/src/components/form-designer/setting-panel/index.vue b/src/components/form-designer/setting-panel/index.vue index 033d42b..ba8af2e 100644 --- a/src/components/form-designer/setting-panel/index.vue +++ b/src/components/form-designer/setting-panel/index.vue @@ -97,6 +97,7 @@ addWindowResizeHandler, } from "@/utils/util"; import i18n from "@/utils/i18n"; + import { propertyRegistered } from "@/components/form-designer/setting-panel/propertyRegister"; const {COMMON_PROPERTIES, ADVANCED_PROPERTIES, EVENT_PROPERTIES} = WidgetProperties @@ -222,6 +223,14 @@ return false } + /* alert组件注册了两个type属性编辑器,跳过第一个type属性编辑器,只显示第二个alert-type属性编辑器!! */ + if (propName.indexOf('-') <= -1) { + let uniquePropName = this.selectedWidget.type + '-' + propName + if (propertyRegistered(uniquePropName)) { + return false + } + } + let originalPropName = propName.replace(this.selectedWidget.type + '-', '') //去掉组件名称前缀-,如果有的话!! return this.designer.hasConfig(this.selectedWidget, originalPropName) }, diff --git a/src/components/form-designer/setting-panel/propertyRegister.js b/src/components/form-designer/setting-panel/propertyRegister.js index 6d0bf51..acebe77 100644 --- a/src/components/form-designer/setting-panel/propertyRegister.js +++ b/src/components/form-designer/setting-panel/propertyRegister.js @@ -160,6 +160,14 @@ export function registerEventProperty(uniquePropName, propEditorName) { EVENT_PROPERTIES[uniquePropName] = propEditorName } +/** + * 判断属性是否已注册 + * @param uniquePropName 属性名称(保证名称唯一,不跟其他组件属性冲突) + */ +export function propertyRegistered(uniquePropName) { + return !!COMMON_PROPERTIES[uniquePropName] || !!ADVANCED_PROPERTIES[uniquePropName] || !!EVENT_PROPERTIES[uniquePropName] +} + /** * 注册常见属性对应的属性编辑器 * @param uniquePropName diff --git a/src/components/form-designer/toolbar-panel/index.vue b/src/components/form-designer/toolbar-panel/index.vue index 3796f95..91e94d7 100644 --- a/src/components/form-designer/toolbar-panel/index.vue +++ b/src/components/form-designer/toolbar-panel/index.vue @@ -66,7 +66,7 @@ {{i18nt('designer.hint.disableForm')}} {{i18nt('designer.hint.enableForm')}} {{i18nt('designer.hint.closePreview')}} - PrintFormJson + PrintFormJson diff --git a/src/extension/extension-loader.js b/src/extension/extension-loader.js index d25f912..3c57235 100644 --- a/src/extension/extension-loader.js +++ b/src/extension/extension-loader.js @@ -76,7 +76,7 @@ export const loadExtension = function () { {label: 'info', value: 'info'}, {label: 'error', value: 'error'}, ] - PERegister.registerCPEditor('type', 'alert-type-editor', + PERegister.registerCPEditor('alert-type', 'alert-type-editor', PEFactory.createSelectEditor('type', 'extension.setting.alertType', {optionItems: typeOptions})) diff --git a/src/extension/samples/card/card-widget.vue b/src/extension/samples/card/card-widget.vue index 611bfbf..d4caae7 100644 --- a/src/extension/samples/card/card-widget.vue +++ b/src/extension/samples/card/card-widget.vue @@ -95,6 +95,14 @@ outline: 2px solid $--color-primary !important; } + .card-container { + margin: 3px; + + .form-widget-list { + min-height: 28px; + } + } + ::v-deep .el-card__header { padding: 10px 12px; } diff --git a/src/lang/zh-CN.js b/src/lang/zh-CN.js index 05ef4e8..450f7d2 100644 --- a/src/lang/zh-CN.js +++ b/src/lang/zh-CN.js @@ -169,7 +169,7 @@ export default { eventSetting: '事件属性', uniqueName: '唯一名称', editNameHelp: '修改名称后需按回车确认', - label: '字段标签', + label: '标签', displayType: '显示类型', defaultValue: '默认值', placeholder: '占位内容', @@ -302,7 +302,7 @@ export default { labelPosition: '字段标签位置', topPosition: '顶部', leftPosition: '左边', - labelAlign: '字段标签对齐', + labelAlign: '标签对齐', leftAlign: '居左', centerAlign: '居中', rightAlign: '居右', diff --git a/src/styles/global.scss b/src/styles/global.scss index e140a94..76f2814 100644 --- a/src/styles/global.scss +++ b/src/styles/global.scss @@ -54,6 +54,11 @@ $--color-primary: #409EFF; } } +.el-card { + margin-top: 3px; + margin-bottom: 3px; +} + input[type="password"]::-ms-reveal { /* 隐藏IE/Edge原生的密码查看按钮 */ display: none; } diff --git a/src/utils/config.js b/src/utils/config.js index d994a77..2b8f158 100644 --- a/src/utils/config.js +++ b/src/utils/config.js @@ -8,7 +8,7 @@ export const DESIGNER_OPTIONS = { } -export const VARIANT_FORM_VERSION = '2.2.3' +export const VARIANT_FORM_VERSION = '2.2.4' //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/'