This commit is contained in:
chenos 2025-06-23 15:16:04 +08:00
parent 395f9b67fc
commit 951380a27d
3 changed files with 4 additions and 3 deletions

View File

@ -19,6 +19,7 @@ export class DataBlockModel<T = DefaultStructure> extends BlockModel<T> {
this.setSharedContext({
currentBlockModel: this,
});
console.log('DataBlockModel onInit', this);
}
addAppends(fieldPath: string, refresh = false) {

View File

@ -84,7 +84,6 @@ export class TableModel extends DataBlockModel<S> {
},
]}
onModelCreated={async (model: TableColumnModel) => {
console.log(model.parent, model.getSharedContext());
// model.setSharedContext({ currentBlockModel: this });
await model.applyAutoFlows();
}}

View File

@ -64,7 +64,7 @@ export class FlowModel<Structure extends { parent?: any; subModels?: any } = Def
/**
* model
*/
private _sharedContext: Record<string, any> = {};
protected _sharedContext: Record<string, any> = {};
/**
* applyAutoFlows
@ -851,7 +851,8 @@ export class FlowModel<Structure extends { parent?: any; subModels?: any } = Def
}
public setSharedContext(ctx: Record<string, any>) {
this._sharedContext = { ...this._sharedContext, ...ctx };
this._sharedContext = ctx;
// this._sharedContext = { ...this._sharedContext, ...ctx };
}
public getSharedContext() {