From c9bf105b094a6777bcf2a51807ddfc653e911f4c Mon Sep 17 00:00:00 2001 From: ascend13 <384035991@qq.com> Date: Tue, 19 Sep 2023 21:09:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E6=8E=89triggerNode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/amis-editor-core/src/component/Preview.tsx | 9 --------- packages/amis-editor-core/src/store/editor.ts | 8 +------- packages/amis-editor/src/plugin/Dialog.tsx | 2 +- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/packages/amis-editor-core/src/component/Preview.tsx b/packages/amis-editor-core/src/component/Preview.tsx index 19fc43e0d..e6cac27c4 100644 --- a/packages/amis-editor-core/src/component/Preview.tsx +++ b/packages/amis-editor-core/src/component/Preview.tsx @@ -94,15 +94,6 @@ export default class Preview extends Component { store.changeOutlineTabsKey('dialog-outline'); store.setPreviewDialogId(dialogId); store.setActiveId(dialogId); - // 添加触发弹窗事件的上下文 - const eventPaths = store - .getSchemaPath(dialogId) - ?.split('/onEvent')[0] - ?.split('/'); - if (eventPaths.length) { - const triggerNode = store.getSchemaByPath(eventPaths); - store.setTriggerNodeId(triggerNode.$$id); - } } else { store.setActiveId(store.getRootId()); } diff --git a/packages/amis-editor-core/src/store/editor.ts b/packages/amis-editor-core/src/store/editor.ts index 6380886fd..81a702f97 100644 --- a/packages/amis-editor-core/src/store/editor.ts +++ b/packages/amis-editor-core/src/store/editor.ts @@ -223,9 +223,7 @@ export const MainStore = types /** 应用语料 */ appCorpusData: types.optional(types.frozen(), {}), /** 应用多语言状态,用于其它组件进行订阅 */ - appLocaleState: types.optional(types.number, 0), - /** 当前触发弹窗的节点id */ - triggerNodeId: '' + appLocaleState: types.optional(types.number, 0) }) .views(self => { return { @@ -1922,10 +1920,6 @@ export const MainStore = types setAppCorpusData(data: any = {}) { self.appCorpusData = data; this.updateAppLocaleState(); - }, - - setTriggerNodeId(id: string) { - self.triggerNodeId = id; } }; }); diff --git a/packages/amis-editor/src/plugin/Dialog.tsx b/packages/amis-editor/src/plugin/Dialog.tsx index 33b811fe5..4e06d992f 100644 --- a/packages/amis-editor/src/plugin/Dialog.tsx +++ b/packages/amis-editor/src/plugin/Dialog.tsx @@ -490,7 +490,7 @@ export class DialogPlugin extends BasePlugin { } } - // 弹窗改版无法可能会有多个按钮触发一个弹窗,无法确定按钮的上下文 + // 弹窗改版可能会有多个按钮触发一个弹窗,无法确定按钮的上下文 // TODO 数据链 // const hostNodeDataSchema = // await this.manager.config.getHostNodeDataSchema?.();