fix: 完善属性配置面板异常渲染屏蔽逻辑

Change-Id: I7641a9b4b800b4abecb27718504475b1712a5287
This commit is contained in:
wibetter 2022-06-20 20:18:56 +08:00
parent c531b77977
commit 197545b5cf
5 changed files with 9 additions and 12 deletions

View File

@ -1,6 +1,6 @@
{
"name": "amis-editor-core",
"version": "5.2.0-beta.5",
"version": "5.2.0-beta.6",
"description": "amis 可视化编辑器",
"main": "lib/index.min.js",
"types": "lib/index.d.ts",

View File

@ -308,7 +308,7 @@ export function makeSchemaFormRender(
api?: any;
submitOnChange?: boolean;
justify?: boolean;
rendererName?: string;
panelById?: string;
formKey?: string;
},
) {
@ -317,12 +317,9 @@ export function makeSchemaFormRender(
return ({value, onChange, popOverContainer, id, store, node}: PanelProps) => {
const ctx = {...manager.store.ctx};
if (schema?.rendererName && schema?.rendererName !== node?.type) {
if (schema?.panelById && schema?.panelById !== node?.id) {
// 用于过滤掉异常的渲染
if (node?.type !== 'cell') {
// 识别表格列
return <></>;
}
return <></>;
}
if (id) {

View File

@ -1553,7 +1553,7 @@ export class EditorManager {
api?: any;
submitOnChange?: boolean;
justify?: boolean;
rendererName?: string;
panelById?: string;
formKey?: string;
}) {
return makeSchemaFormRender(this, schema);

View File

@ -964,7 +964,7 @@ export abstract class BasePlugin implements PluginInterface {
? plugin.panelControlsCreator(context)
: plugin.panelControls!,
justify: plugin.panelJustify,
rendererName: plugin.rendererName
panelById: store.activeId
})
});
} else if (
@ -990,7 +990,7 @@ export abstract class BasePlugin implements PluginInterface {
? plugin.vRendererConfig.panelBodyCreator(context)
: plugin.vRendererConfig.panelBody!,
justify: plugin.vRendererConfig.panelJustify,
rendererName: plugin.rendererName
panelById: store.activeId
})
});
}

View File

@ -530,7 +530,7 @@ export class BasicToolbarPlugin extends BasePlugin {
if (!context.selections.length) {
return;
}
const plugin: PluginInterface = this;
const store = this.manager.store;
let menus: Array<ContextMenuItem> = [];
const contextMenuContext: ContextMenuEventContext = {
@ -561,7 +561,7 @@ export class BasicToolbarPlugin extends BasePlugin {
}))
}
],
rendererName: plugin.rendererName
panelById: store.activeId
})
});
}