mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-02-27 20:30:28 +00:00
fix: 兼容 listSetter 内部变量,修复回退 fieldId 重置问题
This commit is contained in:
parent
87c2e0b386
commit
c95e618121
@ -3,11 +3,19 @@ import { isJSSlot, isI18nData, isJSExpression } from '@ali/lowcode-types';
|
||||
import { isPlainObject } from '@ali/lowcode-utils';
|
||||
import i18nUtil from './i18n-util';
|
||||
|
||||
function isVariable(obj: any) {
|
||||
return obj && obj.type === 'variable';
|
||||
}
|
||||
|
||||
// FIXME: 表达式使用 mock 值,未来live 模式直接使用原始值
|
||||
export function deepValueParser(obj?: any): any {
|
||||
if (isJSExpression(obj)) {
|
||||
obj = obj.mock;
|
||||
}
|
||||
// 兼容 ListSetter 中的变量结构
|
||||
if (isVariable(obj)) {
|
||||
obj = obj.value;
|
||||
}
|
||||
if (!obj) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ designer.addPropsReducer((props, node) => {
|
||||
// FIXME! item.name could be 'xxx.xxx'
|
||||
const ov = props[item.name];
|
||||
const v = item.initial(node as any, getRealValue(ov));
|
||||
if (v !== undefined) {
|
||||
if (!ov && v !== undefined) {
|
||||
if (isVariable(ov)) {
|
||||
newProps[item.name] = {
|
||||
...ov,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user