mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 03:01:16 +00:00
fix(editor-skeleton): fix missing i18n
This commit is contained in:
parent
5c6572e302
commit
be309cba01
@ -1,8 +1,14 @@
|
|||||||
import { IPublicTypeTransformedComponentMetadata, IPublicTypeFieldConfig, IPublicModelSettingTarget } from '@alilc/lowcode-types';
|
import {
|
||||||
|
IPublicTypeTransformedComponentMetadata,
|
||||||
|
IPublicTypeFieldConfig,
|
||||||
|
IPublicModelSettingTarget,
|
||||||
|
} from '@alilc/lowcode-types';
|
||||||
import { IconSlot } from '../icons/slot';
|
import { IconSlot } from '../icons/slot';
|
||||||
import { getConvertedExtraKey } from '@alilc/lowcode-designer';
|
import { getConvertedExtraKey } from '@alilc/lowcode-designer';
|
||||||
|
|
||||||
export default function (metadata: IPublicTypeTransformedComponentMetadata): IPublicTypeTransformedComponentMetadata {
|
export default function (
|
||||||
|
metadata: IPublicTypeTransformedComponentMetadata,
|
||||||
|
): IPublicTypeTransformedComponentMetadata {
|
||||||
const { componentName, configure = {} } = metadata;
|
const { componentName, configure = {} } = metadata;
|
||||||
|
|
||||||
// 如果已经处理过,不再重新执行一遍
|
// 如果已经处理过,不再重新执行一遍
|
||||||
@ -111,35 +117,33 @@ export default function (metadata: IPublicTypeTransformedComponentMetadata): IPu
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
/*
|
// propsGroup.push({
|
||||||
propsGroup.push({
|
// name: '#generals',
|
||||||
name: '#generals',
|
// title: { type: 'i18n', 'zh-CN': '通用', 'en-US': 'General' },
|
||||||
title: { type: 'i18n', 'zh-CN': '通用', 'en-US': 'General' },
|
// items: [
|
||||||
items: [
|
// {
|
||||||
{
|
// name: 'id',
|
||||||
name: 'id',
|
// title: 'ID',
|
||||||
title: 'ID',
|
// setter: 'StringSetter',
|
||||||
setter: 'StringSetter',
|
// },
|
||||||
},
|
// {
|
||||||
{
|
// name: 'key',
|
||||||
name: 'key',
|
// title: 'Key',
|
||||||
title: 'Key',
|
// // todo: use Mixin
|
||||||
// todo: use Mixin
|
// setter: 'StringSetter',
|
||||||
setter: 'StringSetter',
|
// },
|
||||||
},
|
// {
|
||||||
{
|
// name: 'ref',
|
||||||
name: 'ref',
|
// title: 'Ref',
|
||||||
title: 'Ref',
|
// setter: 'StringSetter',
|
||||||
setter: 'StringSetter',
|
// },
|
||||||
},
|
// {
|
||||||
{
|
// name: '!more',
|
||||||
name: '!more',
|
// title: '更多',
|
||||||
title: '更多',
|
// setter: 'PropertiesSetter',
|
||||||
setter: 'PropertiesSetter',
|
// },
|
||||||
},
|
// ],
|
||||||
],
|
// });
|
||||||
});
|
|
||||||
*/
|
|
||||||
const stylesGroup: IPublicTypeFieldConfig[] = [];
|
const stylesGroup: IPublicTypeFieldConfig[] = [];
|
||||||
const advancedGroup: IPublicTypeFieldConfig[] = [];
|
const advancedGroup: IPublicTypeFieldConfig[] = [];
|
||||||
if (propsGroup) {
|
if (propsGroup) {
|
||||||
@ -216,18 +220,24 @@ export default function (metadata: IPublicTypeTransformedComponentMetadata): IPu
|
|||||||
|
|
||||||
setValue(field: IPublicModelSettingTarget, eventData) {
|
setValue(field: IPublicModelSettingTarget, eventData) {
|
||||||
const { eventDataList, eventList } = eventData;
|
const { eventDataList, eventList } = eventData;
|
||||||
Array.isArray(eventList) && eventList.map((item) => {
|
Array.isArray(eventList) &&
|
||||||
field.parent.clearPropValue(item.name);
|
eventList.map((item) => {
|
||||||
return item;
|
field.parent.clearPropValue(item.name);
|
||||||
});
|
return item;
|
||||||
Array.isArray(eventDataList) && eventDataList.map((item) => {
|
});
|
||||||
field.parent.setPropValue(item.name, {
|
Array.isArray(eventDataList) &&
|
||||||
type: 'JSFunction',
|
eventDataList.map((item) => {
|
||||||
// 需要传下入参
|
field.parent.setPropValue(item.name, {
|
||||||
value: `function(){return this.${item.relatedEventName}.apply(this,Array.prototype.slice.call(arguments).concat([${item.paramStr ? item.paramStr : ''}])) }`,
|
type: 'JSFunction',
|
||||||
|
// 需要传下入参
|
||||||
|
value: `function(){return this.${
|
||||||
|
item.relatedEventName
|
||||||
|
}.apply(this,Array.prototype.slice.call(arguments).concat([${
|
||||||
|
item.paramStr ? item.paramStr : ''
|
||||||
|
}])) }`,
|
||||||
|
});
|
||||||
|
return item;
|
||||||
});
|
});
|
||||||
return item;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -296,7 +306,7 @@ export default function (metadata: IPublicTypeTransformedComponentMetadata): IPu
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'key',
|
name: 'key',
|
||||||
title: '循环 Key',
|
title: { type: 'i18n', 'zh-CN': '循环 Key', 'en-US': 'Loop Key' },
|
||||||
setter: [
|
setter: [
|
||||||
{
|
{
|
||||||
componentName: 'StringSetter',
|
componentName: 'StringSetter',
|
||||||
@ -317,8 +327,16 @@ export default function (metadata: IPublicTypeTransformedComponentMetadata): IPu
|
|||||||
advancedGroup.push({
|
advancedGroup.push({
|
||||||
name: 'key',
|
name: 'key',
|
||||||
title: {
|
title: {
|
||||||
label: '渲染唯一标识(key)',
|
label: {
|
||||||
tip: '搭配「条件渲染」或「循环渲染」时使用,和 react 组件中的 key 原理相同,点击查看帮助',
|
type: 'i18n',
|
||||||
|
'zh-CN': '渲染唯一标识 (key)',
|
||||||
|
'en-US': 'Render unique identifier (key)',
|
||||||
|
},
|
||||||
|
tip: {
|
||||||
|
type: 'i18n',
|
||||||
|
'zh-CN': '搭配「条件渲染」或「循环渲染」时使用,和 react 组件中的 key 原理相同,点击查看帮助',
|
||||||
|
'en-US': 'Used with 「Conditional Rendering」or「Cycle Rendering」, the same principle as the key in the react component, click to view the help',
|
||||||
|
},
|
||||||
docUrl: 'https://www.yuque.com/lce/doc/qm75w3',
|
docUrl: 'https://www.yuque.com/lce/doc/qm75w3',
|
||||||
},
|
},
|
||||||
setter: [
|
setter: [
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user