Skip to content

Commit

Permalink
fix:优化调用链锚定提示
Browse files Browse the repository at this point in the history
  • Loading branch information
hsm-lv committed Nov 27, 2024
1 parent 1b4c3ce commit 0ac28d9
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions packages/amis-editor/src/renderer/event-control/helper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import {
defaultValue,
EditorManager,
getSchemaTpl,
JSONCanMoveUp,
JSONGetById,
JSONGetByPath,
JSONGetParentById,
JSONGetPathById,
persistGet,
persistSet,
RendererPluginAction,
Expand Down Expand Up @@ -282,20 +286,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);
}}
>
Expand Down

0 comments on commit 0ac28d9

Please sign in to comment.