fix(core,data-source): 事件参数中关联数据源字段无法自动更新
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
import { union } from 'lodash-es';
|
||||
|
||||
import type { AppCore } from '@tmagic/schema';
|
||||
import { getDepNodeIds, getNodes } from '@tmagic/utils';
|
||||
import { getDepNodeIds, getNodes, isPage } from '@tmagic/utils';
|
||||
|
||||
import DataSourceManager from './DataSourceManager';
|
||||
import type { ChangeEvent, DataSourceManagerData } from './types';
|
||||
@@ -66,7 +66,18 @@ export const createDataSourceManager = (app: AppCore, useMock?: boolean, initial
|
||||
node.condResult = dataSourceManager.compliedConds(node);
|
||||
}
|
||||
|
||||
return dataSourceManager.compiledNode(node);
|
||||
const newNode = dataSourceManager.compiledNode(node);
|
||||
|
||||
if (typeof app.page?.setData === 'function') {
|
||||
if (isPage(newNode)) {
|
||||
app.page.setData(newNode);
|
||||
} else {
|
||||
const n = app.page.getNode(node.id);
|
||||
n?.setData(newNode);
|
||||
}
|
||||
}
|
||||
|
||||
return newNode;
|
||||
}),
|
||||
sourceId,
|
||||
changeEvent,
|
||||
|
||||
Reference in New Issue
Block a user