From 850899bfef9d3446dc572a454b7e21fcacdffbe1 Mon Sep 17 00:00:00 2001 From: wibetter <365533093@qq.com> Date: Mon, 20 Jun 2022 20:18:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AE=8C=E5=96=84=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=9D=A2=E6=9D=BF=E5=BC=82=E5=B8=B8=E6=B8=B2?= =?UTF-8?q?=E6=9F=93=E5=B1=8F=E8=94=BD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7641a9b4b800b4abecb27718504475b1712a5287 --- packages/amis-editor/package.json | 2 +- packages/amis-editor/src/plugin/Form/Item.tsx | 3 ++- packages/amis-editor/src/plugin/Panel.tsx | 4 ++-- packages/amis-editor/src/plugin/TableView.tsx | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/amis-editor/package.json b/packages/amis-editor/package.json index 4b97a12de..db714549d 100644 --- a/packages/amis-editor/package.json +++ b/packages/amis-editor/package.json @@ -1,6 +1,6 @@ { "name": "amis-editor", - "version": "5.2.0-beta.5", + "version": "5.2.0-beta.6", "description": "amis 可视化编辑器", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/packages/amis-editor/src/plugin/Form/Item.tsx b/packages/amis-editor/src/plugin/Form/Item.tsx index 2ce0e63d1..1d3fb2803 100644 --- a/packages/amis-editor/src/plugin/Form/Item.tsx +++ b/packages/amis-editor/src/plugin/Form/Item.tsx @@ -25,6 +25,7 @@ export class ItemPlugin extends BasePlugin { panels: Array ) { const renderer = context.info.renderer; + const store = this.manager.store; if (context.selections.length) { return; @@ -42,7 +43,7 @@ export class ItemPlugin extends BasePlugin { title: this.panelTitle, render: this.manager.makeSchemaFormRender({ body: this.panelBodyCreator(context), - rendererName: plugin.rendererName, + panelById: store.activeId, formKey: 'form-item', }), order: -200 diff --git a/packages/amis-editor/src/plugin/Panel.tsx b/packages/amis-editor/src/plugin/Panel.tsx index 4bba19413..b64ef69a8 100644 --- a/packages/amis-editor/src/plugin/Panel.tsx +++ b/packages/amis-editor/src/plugin/Panel.tsx @@ -215,8 +215,8 @@ export class PanelPlugin extends BasePlugin { context: BuildPanelEventContext, panels: Array ) { - const plugin: PluginInterface = this; const schema = context.schema; + const store = this.manager.store; if ( context.info.renderer.name === 'form' && @@ -230,7 +230,7 @@ export class PanelPlugin extends BasePlugin { title: this.panelTitle, render: this.manager.makeSchemaFormRender({ body: this.panelBodyCreator(context), - rendererName: 'form' + panelById: store.activeId }) }); } else { diff --git a/packages/amis-editor/src/plugin/TableView.tsx b/packages/amis-editor/src/plugin/TableView.tsx index 07bec2ba7..79fb022fa 100644 --- a/packages/amis-editor/src/plugin/TableView.tsx +++ b/packages/amis-editor/src/plugin/TableView.tsx @@ -494,7 +494,7 @@ export class TableViewPlugin extends BasePlugin { panels: Array ) { super.buildEditorPanel(context, panels); - const plugin: PluginInterface = this; + const store = this.manager.store; if (context.info.schemaPath.endsWith('/td')) { panels.push({ @@ -509,7 +509,7 @@ export class TableViewPlugin extends BasePlugin { body: this.tdVRendererConfig.panelBodyCreator ? this.tdVRendererConfig.panelBodyCreator(context) : this.tdVRendererConfig.panelBody!, - rendererName: plugin.rendererName + panelById: store.activeId }) }); } else if (context.info.schemaPath.endsWith('/tr')) { @@ -525,7 +525,7 @@ export class TableViewPlugin extends BasePlugin { body: this.trVRendererConfig.panelBodyCreator ? this.trVRendererConfig.panelBodyCreator(context) : this.trVRendererConfig.panelBody!, - rendererName: plugin.rendererName + panelById: store.activeId }) }); }