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({ this.setSharedContext({
currentBlockModel: this, currentBlockModel: this,
}); });
console.log('DataBlockModel onInit', this);
} }
addAppends(fieldPath: string, refresh = false) { addAppends(fieldPath: string, refresh = false) {

View File

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

View File

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