fix: 属性配置面板外层tab使用新版icon

Change-Id: I9a8c301524f4164ee45f5365fa06ecdc8809a243
This commit is contained in:
wibetter 2022-06-23 12:19:50 +08:00
parent 204f701e0f
commit 7567678aea
4 changed files with 22 additions and 5 deletions

View File

@ -190,6 +190,13 @@ $category-2-height: px2rem(32px);
height: 45px;
color: #151b26;
}
// 新版icon
> svg.pluginIcon {
width: 20px;
height: 20px;
color: #151b26;
}
}
}

View File

@ -1,10 +1,10 @@
import {observer} from 'mobx-react';
import React from 'react';
import {Icon} from 'amis';
import {Tab, Tabs, Icon} from 'amis';
import cx from 'classnames';
import {EditorManager} from '../../manager';
import {EditorStoreType} from '../../store/editor';
import cx from 'classnames';
import {Tab, Tabs} from 'amis';
import {Icon as PluginIcon} from '../../plugin-icons/index';
import {autobind} from '../../util';
import {findDOMNode} from 'react-dom';
import {PanelItem} from '../../plugin';
@ -144,7 +144,16 @@ export class RightPanels extends React.Component<
editor-tooltip={panel.title}
tooltip-position="left"
>
<i className={`fa ${panel.icon}`}></i>
{
panel.pluginIcon && (
<PluginIcon icon={panel.pluginIcon} className='pluginIcon' />
)
}
{
!panel.pluginIcon && (
<i className={`fa ${panel.icon}`} />
)
}
</span>
}
className={`editorPanel-tabs-pane ae-Editor-${panel.key}Pane`}

View File

@ -421,6 +421,7 @@ export interface PanelItem {
nodeId?: string;
key: string;
icon: string;
pluginIcon?: string; // 新版iconsvg
title: string | JSX.Element; // 标题
component?: React.ComponentType<PanelProps | any>;
order: number;
@ -955,6 +956,7 @@ export abstract class BasePlugin implements PluginInterface {
panels.push({
key: 'config',
icon: plugin.panelIcon || plugin.icon || 'fa fa-cog',
pluginIcon: plugin.pluginIcon,
title: plugin.panelTitle || '设置',
render: this.manager.makeSchemaFormRender({
definitions: plugin.panelDefinitions,

View File

@ -8,7 +8,6 @@ import {
BuildPanelEventContext,
PluginEvent,
InsertEventContext,
PluginInterface
} from '../plugin';
import {registerEditorPlugin} from '../manager';
import type {MenuItem} from 'amis-ui/lib/components/ContextMenu';