更新了一两个小的bug
This commit is contained in:
parent
e0f8544c8a
commit
b817fbd384
|
|
@ -156,7 +156,7 @@ export default OakComponent({
|
|||
return false;
|
||||
});
|
||||
const schema = this.features.cache.getSchema();
|
||||
const legalSourceEntity = !!schema[choice.entity].relation?.length || choice.entity === 'user';
|
||||
const legalSourceEntity = !!schema[choice.entity].relation?.length || !!choice.entity;
|
||||
this.setState({
|
||||
pathChoice: pathChoice2,
|
||||
pathChosen: pathChosen2,
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ export declare class DebugStore<ED extends EntityDict & BaseEntityDict, Cxt exte
|
|||
constructor(storageSchema: StorageSchema<ED>, contextBuilder: (store: DebugStore<ED, Cxt>) => Cxt, authDeduceRelationMap: AuthDeduceRelationMap<ED>, selectFreeEntities?: (keyof ED)[], updateFreeDict?: {
|
||||
[A in keyof ED]?: string[];
|
||||
});
|
||||
checkRelationAsync<T extends keyof ED, Cxt extends AsyncContext<ED>>(entity: T, operation: Omit<ED[T]["Operation"] | ED[T]["Selection"], "id">, context: Cxt): Promise<void>;
|
||||
exec(script: string, txnId?: string): Promise<void>;
|
||||
aggregate<T extends keyof ED, OP extends SelectOption>(entity: T, aggregation: ED[T]["Aggregation"], context: Cxt, option: OP): Promise<AggregationResult<ED[T]["Schema"]>>;
|
||||
begin(option?: TxnOption): Promise<string>;
|
||||
|
|
|
|||
|
|
@ -18,10 +18,9 @@ export class DebugStore extends TreeStore {
|
|||
this.executor = new TriggerExecutor(() => contextBuilder(this));
|
||||
this.relationAuth = new RelationAuth(storageSchema, authDeduceRelationMap, selectFreeEntities, updateFreeDict);
|
||||
}
|
||||
/*
|
||||
checkRelationAsync<T extends keyof ED, Cxt extends AsyncContext<ED>>(entity: T, operation: Omit<ED[T]["Operation"] | ED[T]["Selection"], "id">, context: Cxt): Promise<void> {
|
||||
return this.relationAuth.checkRelationAsync(entity, operation, context);
|
||||
} */
|
||||
checkRelationAsync(entity, operation, context) {
|
||||
return this.relationAuth.checkRelationAsync(entity, operation, context);
|
||||
}
|
||||
async exec(script, txnId) {
|
||||
throw new Error('debugStore dont support exec script directly');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -684,6 +684,10 @@ export function createComponent(option, features) {
|
|||
hide() {
|
||||
const { hide } = this.oakOption.lifetimes || {};
|
||||
hide && hide.call(this);
|
||||
/**
|
||||
* 不能unsubscribeAll,小程序的页面不会销毁,如果一个页面需要token才能取数据,这时候去了登录页再回来就得依靠feature上的subscribe来refresh
|
||||
* by Xc 20250913
|
||||
*/
|
||||
// this.unsubscribeAll();
|
||||
},
|
||||
resize(resizeOption) {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ export declare class DebugStore<ED extends EntityDict & BaseEntityDict, Cxt exte
|
|||
constructor(storageSchema: StorageSchema<ED>, contextBuilder: (store: DebugStore<ED, Cxt>) => Cxt, authDeduceRelationMap: AuthDeduceRelationMap<ED>, selectFreeEntities?: (keyof ED)[], updateFreeDict?: {
|
||||
[A in keyof ED]?: string[];
|
||||
});
|
||||
checkRelationAsync<T extends keyof ED, Cxt extends AsyncContext<ED>>(entity: T, operation: Omit<ED[T]["Operation"] | ED[T]["Selection"], "id">, context: Cxt): Promise<void>;
|
||||
exec(script: string, txnId?: string): Promise<void>;
|
||||
aggregate<T extends keyof ED, OP extends SelectOption>(entity: T, aggregation: ED[T]["Aggregation"], context: Cxt, option: OP): Promise<AggregationResult<ED[T]["Schema"]>>;
|
||||
begin(option?: TxnOption): Promise<string>;
|
||||
|
|
|
|||
|
|
@ -21,10 +21,9 @@ class DebugStore extends oak_memory_tree_store_1.TreeStore {
|
|||
this.executor = new TriggerExecutor_1.TriggerExecutor(() => contextBuilder(this));
|
||||
this.relationAuth = new RelationAuth_1.RelationAuth(storageSchema, authDeduceRelationMap, selectFreeEntities, updateFreeDict);
|
||||
}
|
||||
/*
|
||||
checkRelationAsync<T extends keyof ED, Cxt extends AsyncContext<ED>>(entity: T, operation: Omit<ED[T]["Operation"] | ED[T]["Selection"], "id">, context: Cxt): Promise<void> {
|
||||
return this.relationAuth.checkRelationAsync(entity, operation, context);
|
||||
} */
|
||||
checkRelationAsync(entity, operation, context) {
|
||||
return this.relationAuth.checkRelationAsync(entity, operation, context);
|
||||
}
|
||||
async exec(script, txnId) {
|
||||
throw new Error('debugStore dont support exec script directly');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -682,12 +682,16 @@ function createComponent(option, features) {
|
|||
const { show } = this.oakOption.lifetimes || {};
|
||||
show && show.call(this);
|
||||
this.reRender();
|
||||
this.subscribeAll();
|
||||
// this.subscribeAll();
|
||||
},
|
||||
hide() {
|
||||
const { hide } = this.oakOption.lifetimes || {};
|
||||
hide && hide.call(this);
|
||||
this.unsubscribeAll();
|
||||
/**
|
||||
* 不能unsubscribeAll,小程序的页面不会销毁,如果一个页面需要token才能取数据,这时候去了登录页再回来就得依靠feature上的subscribe来refresh
|
||||
* by Xc 20250913
|
||||
*/
|
||||
// this.unsubscribeAll();
|
||||
},
|
||||
resize(resizeOption) {
|
||||
const { resize } = this.oakOption.lifetimes || {};
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ export default OakComponent({
|
|||
}
|
||||
);
|
||||
const schema = this.features.cache.getSchema();
|
||||
const legalSourceEntity = !!schema[choice.entity as keyof typeof schema].relation?.length || choice.entity;
|
||||
const legalSourceEntity = !!schema[choice.entity as keyof typeof schema].relation?.length || !!choice.entity;
|
||||
this.setState({
|
||||
pathChoice: pathChoice2,
|
||||
pathChosen: pathChosen2,
|
||||
|
|
|
|||
|
|
@ -41,10 +41,10 @@ export class DebugStore<ED extends EntityDict & BaseEntityDict, Cxt extends Asyn
|
|||
this.executor = new TriggerExecutor(() => contextBuilder(this));
|
||||
this.relationAuth = new RelationAuth(storageSchema, authDeduceRelationMap, selectFreeEntities, updateFreeDict);
|
||||
}
|
||||
/*
|
||||
|
||||
checkRelationAsync<T extends keyof ED, Cxt extends AsyncContext<ED>>(entity: T, operation: Omit<ED[T]["Operation"] | ED[T]["Selection"], "id">, context: Cxt): Promise<void> {
|
||||
return this.relationAuth.checkRelationAsync(entity, operation, context);
|
||||
} */
|
||||
}
|
||||
|
||||
async exec(script: string, txnId?: string) {
|
||||
throw new Error('debugStore dont support exec script directly');
|
||||
|
|
|
|||
Loading…
Reference in New Issue