From 3e56f5f7c171806549ac61ce3b8875c7d5255c02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E4=B8=B9?= <365533093@qq.com> Date: Thu, 2 Nov 2023 09:10:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(amis-editor):=20=E4=BC=98=E5=8C=96=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=BF=AB=E6=8D=B7=E9=94=AE=E6=89=A7=E8=A1=8C=E9=80=BB?= =?UTF-8?q?=E8=BE=91=20(#8584)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(amis-editor): flex布局容器的主轴排列方式配置默认用center,和flex组件默认样式保持一致 * fix(amis-editor): 优化删除快捷键执行逻辑 --- packages/amis-editor-core/src/component/Editor.tsx | 9 +++++++-- .../amis-editor/src/plugin/Layout/FlexPluginBase.tsx | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/amis-editor-core/src/component/Editor.tsx b/packages/amis-editor-core/src/component/Editor.tsx index a4721e907..fed3ff314 100644 --- a/packages/amis-editor-core/src/component/Editor.tsx +++ b/packages/amis-editor-core/src/component/Editor.tsx @@ -373,11 +373,16 @@ export default class Editor extends Component { // 删除快捷键 if (this.store.activeId) { const node = store.getNodeById(this.store.activeId); - if (node && store.activeRegion) { + if ( + node && + store.activeRegion && + node.info?.regions && + node.info.regions.length > 1 + ) { toast.warning('区域节点不可以直接删除。'); } else if (store.isRootSchema(this.store.activeId)) { toast.warning('根节点不允许删除。'); - } else if (node && node.moveable) { + } else if (node && (node.removable || node.removable === undefined)) { this.manager.del(this.store.activeId); } else { toast.warning('当前元素不允许删除。'); diff --git a/packages/amis-editor/src/plugin/Layout/FlexPluginBase.tsx b/packages/amis-editor/src/plugin/Layout/FlexPluginBase.tsx index 8b6ecedd7..74405c5a7 100644 --- a/packages/amis-editor/src/plugin/Layout/FlexPluginBase.tsx +++ b/packages/amis-editor/src/plugin/Layout/FlexPluginBase.tsx @@ -107,7 +107,7 @@ export class FlexPluginBase extends LayoutBasePlugin { getSchemaTpl('layout:flex-setting', { label: '弹性布局设置', direction: curRendererSchema.direction, - justify: curRendererSchema.justify, + justify: curRendererSchema.justify || 'center', alignItems: curRendererSchema.alignItems }),