setUpdate改成异步
This commit is contained in:
parent
454bbfdde9
commit
ddd0133497
|
|
@ -389,16 +389,25 @@ function makeCommonComponentMethods(features, exceptionRouterDict, formData) {
|
|||
return features.runningTree.resetUpdateData(this.state.oakFullpath);
|
||||
},
|
||||
setAction: function (action, path) {
|
||||
var fullpath = path
|
||||
? "".concat(this.state.oakFullpath, ".").concat(path)
|
||||
: this.state.oakFullpath;
|
||||
return features.runningTree.setAction(fullpath, action);
|
||||
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
||||
var fullpath;
|
||||
return tslib_1.__generator(this, function (_a) {
|
||||
fullpath = path
|
||||
? "".concat(this.state.oakFullpath, ".").concat(path)
|
||||
: this.state.oakFullpath;
|
||||
return [2 /*return*/, features.runningTree.setAction(fullpath, action)];
|
||||
});
|
||||
});
|
||||
},
|
||||
setUpdateData: function (attr, value) {
|
||||
if (this.state.oakExecuting) {
|
||||
return;
|
||||
}
|
||||
return features.runningTree.setUpdateData(this.state.oakFullpath, attr, value);
|
||||
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
||||
return tslib_1.__generator(this, function (_a) {
|
||||
if (this.state.oakExecuting) {
|
||||
return [2 /*return*/];
|
||||
}
|
||||
return [2 /*return*/, features.runningTree.setUpdateData(this.state.oakFullpath, attr, value)];
|
||||
});
|
||||
});
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export declare type OakCommonComponentMethods<ED extends EntityDict & BaseEntity
|
|||
delta: number;
|
||||
}) => Promise<void>;
|
||||
resetUpdateData: () => void;
|
||||
setUpdateData: (attr: string, input: any) => void;
|
||||
setUpdateData: (attr: string, input: any) => Promise<void>;
|
||||
t(key: string, params?: object): string;
|
||||
callPicker: (attr: string, params: Record<string, any>) => void;
|
||||
setForeignKey: (id: string, goBackDelta?: number) => Promise<void>;
|
||||
|
|
|
|||
|
|
@ -420,14 +420,14 @@ export function makeCommonComponentMethods<
|
|||
return features.runningTree.resetUpdateData(this.state.oakFullpath);
|
||||
},
|
||||
|
||||
setAction(action, path) {
|
||||
async setAction(action, path) {
|
||||
const fullpath = path
|
||||
? `${this.state.oakFullpath}.${path}`
|
||||
: this.state.oakFullpath;
|
||||
return features.runningTree.setAction(fullpath, action);
|
||||
},
|
||||
|
||||
setUpdateData(attr, value) {
|
||||
async setUpdateData(attr, value) {
|
||||
if (this.state.oakExecuting) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -254,7 +254,7 @@ export type OakCommonComponentMethods<ED extends EntityDict & BaseEntityDict, T
|
|||
) => Promise<void>;
|
||||
navigateBack: (option?: { delta: number }) => Promise<void>;
|
||||
resetUpdateData: () => void;
|
||||
setUpdateData: (attr: string, input: any) => void;
|
||||
setUpdateData: (attr: string, input: any) => Promise<void>;
|
||||
t(key: string, params?: object): string;
|
||||
callPicker: (attr: string, params: Record<string, any>) => void;
|
||||
setForeignKey: (id: string, goBackDelta?: number) => Promise<void>;
|
||||
|
|
|
|||
Loading…
Reference in New Issue