From 9083751018e84543a0a5300d764096dca9879821 Mon Sep 17 00:00:00 2001 From: lvxiaojiao Date: Wed, 27 Nov 2024 14:14:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BC=98=E5=8C=96=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E9=93=BE=E9=94=9A=E5=AE=9A=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scss/control/_event-action.scss | 5 +++++ .../src/renderer/event-control/helper.tsx | 15 ++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/amis-editor-core/scss/control/_event-action.scss b/packages/amis-editor-core/scss/control/_event-action.scss index 6f4035d60..d1e8466cf 100644 --- a/packages/amis-editor-core/scss/control/_event-action.scss +++ b/packages/amis-editor-core/scss/control/_event-action.scss @@ -512,4 +512,9 @@ width: 255px; max-height: 360px; overflow: auto; + .variables-select-panel-tree { + *:not(svg) { + font-size: 12px; + } + } } diff --git a/packages/amis-editor/src/renderer/event-control/helper.tsx b/packages/amis-editor/src/renderer/event-control/helper.tsx index cb8c7eea7..56922fc9a 100644 --- a/packages/amis-editor/src/renderer/event-control/helper.tsx +++ b/packages/amis-editor/src/renderer/event-control/helper.tsx @@ -8,6 +8,7 @@ import { EditorManager, getSchemaTpl, JSONGetById, + JSONGetPathById, persistGet, persistSet, RendererPluginAction, @@ -282,20 +283,24 @@ export const buildLinkActionDesc = (manager: EditorManager, info: any) => { e.preventDefault(); e.stopPropagation(); - if (/^u:[A-Za-z0-9]{12}$/.test(desc)) { - toast.info('该组件可能在弹窗内,暂无法锚定到该组件'); - return; - } - const schema = JSONGetById( manager.store.schema, info.componentId, 'id' ); + if (!schema) { toast.info('温馨提示:未找到该组件'); return; } + + const path = JSONGetPathById(manager.store.schema, schema.$$id); + + if (path?.includes('dialog') || path?.includes('drawer')) { + toast.info('该组件在弹窗内,暂无法直接锚定到该组件'); + return; + } + manager.store.setActiveId(schema.$$id); }} >