amis-saas-8146 1. 子编辑器 subEditor 不再重复设置 editorStore; 2. 增加 ListItem 和 ButtonToolbar 属性国际化

Change-Id: I724fcd3569afc57a8fbf010a1a366c998ce1aeeb
This commit is contained in:
wangyuzhen01 2023-01-29 09:33:02 +08:00
parent 72e3637daa
commit c25a29700e
2 changed files with 52 additions and 80 deletions

View File

@ -1,4 +1,4 @@
import {registerEditorPlugin} from 'amis-editor-core';
import {registerEditorPlugin, translateSchema} from 'amis-editor-core';
import {BasePlugin, RegionConfig, BaseEventContext} from 'amis-editor-core';
import {getSchemaTpl} from 'amis-editor-core';
@ -85,6 +85,7 @@ export class ButtonToolbarControlPlugin extends BasePlugin {
minLength: 1,
draggable: true,
editable: false,
pipeIn: (value: any) => translateSchema(value),
items: [
{
type: 'tpl',

View File

@ -1,5 +1,5 @@
import React from 'react';
import {registerEditorPlugin} from 'amis-editor-core';
import {getI18nEnabled, registerEditorPlugin} from 'amis-editor-core';
import {
BaseEventContext,
BasePlugin,
@ -37,52 +37,22 @@ export class ListItemPlugin extends BasePlugin {
];
panelTitle = '列表项';
panelBody = getSchemaTpl('tabs', [
panelBodyCreator = (context: BaseEventContext) => {
const i18nEnabled = getI18nEnabled();
return getSchemaTpl('tabs', [
{
title: '基本',
body: [
// {
// children: (
// <Button
// size="sm"
// className="m-b-sm"
// level="info"
// block
// onClick={() => {
// this.pickChild('actions', 'actions', undefined, ['button']);
// }}
// >
// 新增按钮
// </Button>
// )
// },
// {
// children: (
// <div>
// <Button
// level="primary"
// size="sm"
// block
// onClick={this.handleAdd}
// >
// 新增内容
// </Button>
// </div>
// )
// },
// {
// type: 'divider'
// },
getSchemaTpl('layout:originPosition', {value: 'left-top'}),
{
name: 'title',
type: 'input-text',
type: i18nEnabled ? 'input-text-i18n' : 'input-text',
label: '标题',
descrition: '支持模板语法如: ${xxx}'
},
{
name: 'subTitle',
type: 'input-text',
type: i18nEnabled ? 'input-text-i18n' : 'input-text',
label: '副标题',
descrition: '支持模板语法如: ${xxx}'
},
@ -94,7 +64,7 @@ export class ListItemPlugin extends BasePlugin {
},
{
name: 'desc',
type: 'textarea',
type: i18nEnabled ? 'textarea-i18n' : 'textarea',
label: '描述',
descrition: '支持模板语法如: ${xxx}'
}
@ -114,7 +84,8 @@ export class ListItemPlugin extends BasePlugin {
})
]
}
]);
])
};
getRendererInfo({
renderer,