mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-07 02:47:12 +00:00
fix: fieldId 重置bug
This commit is contained in:
parent
488a5d8283
commit
31215da05b
@ -26,8 +26,9 @@ export const designer = new Designer({ editor: editor });
|
|||||||
editor.set(Designer, designer);
|
editor.set(Designer, designer);
|
||||||
editor.set('designer', designer);
|
editor.set('designer', designer);
|
||||||
|
|
||||||
const nodeCache: any = {};
|
let nodeCache: any = {};
|
||||||
designer.project.onCurrentDocumentChange((doc) => {
|
designer.project.onCurrentDocumentChange((doc) => {
|
||||||
|
nodeCache = {};
|
||||||
doc.nodesMap.forEach((node) => {
|
doc.nodesMap.forEach((node) => {
|
||||||
nodeCache[node.id] = node;
|
nodeCache[node.id] = node;
|
||||||
});
|
});
|
||||||
@ -97,6 +98,9 @@ designer.addPropsReducer((props, node) => {
|
|||||||
if (newProps.fieldId) {
|
if (newProps.fieldId) {
|
||||||
const fieldIds: any = [];
|
const fieldIds: any = [];
|
||||||
Object.keys(nodeCache).forEach(nodeId => {
|
Object.keys(nodeCache).forEach(nodeId => {
|
||||||
|
if (nodeId === node.id) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const fieldId = nodeCache[nodeId].getPropValue('fieldId');
|
const fieldId = nodeCache[nodeId].getPropValue('fieldId');
|
||||||
if (fieldId) {
|
if (fieldId) {
|
||||||
fieldIds.push(fieldId);
|
fieldIds.push(fieldId);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user