提交 1fe8a86c 编写于 作者: zcdtk's avatar zcdtk

upate

上级 98b51d8f
......@@ -1134,67 +1134,55 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
/**
* 保存并退出
*
* @param {any[]} args
* @protected
* @param {any[]} data
* @returns {Promise<any>}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected saveAndExit(data:any[]):Promise<any>{
let _this = this;
return new Promise((resolve: any, reject: any) =>{
let arg: any = {};
Object.assign(arg,data[0]);
_this.currentAction = "saveAndExit";
_this.save([arg]).then((res) =>{
if(res){
_this.closeView(res.data);
protected async saveAndExit(data: any[]): Promise<any> {
const arg: any = { ...data[0] };
this.currentAction = 'saveAndExit';
const response: any = await this.save([arg]);
if (response && response.status === 200) {
this.closeView(response.data);
}
resolve(res);
}).catch((error) =>{
reject(error);
})
})
return response;
}
/**
* 保存并新建
*
* @param {any[]} args
* @protected
* @param {any[]} data
* @returns {Promise<any>}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected saveAndNew(data:any[]):Promise<any>{
let _this = this;
return new Promise((resolve: any, reject: any) =>{
let arg: any = {};
Object.assign(arg,data[0]);
_this.currentAction = "saveAndNew";
_this.save([arg]).then((res) =>{
_this.ResetData(res);
_this.loadDraft({});
}).catch((error) =>{
reject(error);
})
})
protected async saveAndNew(data: any[]): Promise<any> {
let arg: any = { ...data[0] };
this.currentAction = 'saveAndNew';
const response: any = await this.save([arg]);
if (response && response.status === 200) {
this.ResetData(res);
this.loadDraft({});
}
return response;
}
/**
* 删除并退出
*
* @param {any[]} args
* @protected
* @param {any[]} data
* @returns {Promise<any>}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected removeAndExit(data:any[]):Promise<any>{
let _this = this;
return new Promise((resolve: any, reject: any) =>{
let arg: any = {};
Object.assign(arg,data[0]);
_this.remove([arg]).then((res) =>{
if(res){
_this.closeView(res.data);
protected async removeAndExit(data: any[]): Promise<any> {
let arg: any = { ...data[0] };
const response: any = await this.remove([arg]);
if (response && response.status === 200) {
this.closeView(response.data);
}
resolve(res);
}).catch((error) =>{
reject(error);
})
})
return response;
}
/**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册