BCE-FE-1181 fix: 当组件配置description时,公式编辑器tag展示异常

Change-Id: I2cae42aa00ba5c5b9c7d0b66934826d409400481
This commit is contained in:
igrowp 2023-01-11 10:48:38 +08:00
parent 6d1aa48525
commit 4ed1b6e09a

View File

@ -1,4 +1,4 @@
import {isExpression, resolveVariableAndFilter} from 'amis-core';
import {isExpression, mapTree, resolveVariableAndFilter} from 'amis-core';
/**
* amis数据域中取变量数据
@ -11,6 +11,10 @@ export async function resolveVariablesFromScope(node: any, manager: any) {
const dataPropsAsOptions = manager?.dataSchema?.getDataPropsAsOptions();
if (dataPropsAsOptions) {
mapTree(dataPropsAsOptions, item => {
item.tag = item.type;
return item;
});
return dataPropsAsOptions
.map((item: any) => ({
selectMode: 'tree',