提交 e3396b90 编写于 作者: KK's avatar KK

实体服务基类调整

上级 5579d09d
import { Http } from '../utils'; import { Http, HttpResponse } from '../utils';
import { CodeListService } from "@/ibiz-core"; import { CodeListService } from "@/ibiz-core";
/** /**
...@@ -162,9 +162,9 @@ export class EntityService { ...@@ -162,9 +162,9 @@ export class EntityService {
return Object.is(item[this.APPDEKEY],data[this.APPDEKEY]); return Object.is(item[this.APPDEKEY],data[this.APPDEKEY]);
}) })
let tempResultData:any = tempResult.length>0?tempResult[0]:Object.assign({},data); let tempResultData:any = tempResult.length>0?tempResult[0]:Object.assign({},data);
return {"status":200,"data":tempResultData}; return new HttpResponse(200,tempResultData)
}else{ }else{
return {"status":500,"data":null}; return new HttpResponse(500,null)
} }
} }
} }
...@@ -184,9 +184,9 @@ export class EntityService { ...@@ -184,9 +184,9 @@ export class EntityService {
data.srffrontuf = "0"; data.srffrontuf = "0";
tempData.push(data); tempData.push(data);
this.tempStorage.setItem(context.srfsessionkey+'_'+this.APPDENAME,JSON.stringify(tempData)); this.tempStorage.setItem(context.srfsessionkey+'_'+this.APPDENAME,JSON.stringify(tempData));
return {"status":200,"data":data}; return new HttpResponse(200,data);
}else{ }else{
return {"status":200,"data":{}}; return new HttpResponse(200,{});
} }
} }
...@@ -207,9 +207,9 @@ export class EntityService { ...@@ -207,9 +207,9 @@ export class EntityService {
return Object.is(item[this.APPDEKEY],data[this.APPDEKEY]); return Object.is(item[this.APPDEKEY],data[this.APPDEKEY]);
}) })
let tempResultData:any = tempResult.length>0?tempResult[0]:Object.assign({},data); let tempResultData:any = tempResult.length>0?tempResult[0]:Object.assign({},data);
return {"status":200,"data":tempResultData}; return new HttpResponse(200,tempResultData)
}else{ }else{
return {"status":500,"data":null}; return new HttpResponse(500,null);
} }
} }
} }
...@@ -250,7 +250,7 @@ export class EntityService { ...@@ -250,7 +250,7 @@ export class EntityService {
* @memberof EntityService * @memberof EntityService
*/ */
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return { status: 500, data: { title: '失败', message: '预置实体行为 Save 未实现' }}; return new HttpResponse(500, { title: '失败', message: '预置实体行为 Save 未实现' });
} }
/** /**
...@@ -281,9 +281,9 @@ export class EntityService { ...@@ -281,9 +281,9 @@ export class EntityService {
} }
}); });
this.tempStorage.setItem(context.srfsessionkey+'_'+this.APPDENAME,JSON.stringify(tempData)); this.tempStorage.setItem(context.srfsessionkey+'_'+this.APPDENAME,JSON.stringify(tempData));
return {"status":200,"data":data}; return new HttpResponse(200, data);
}else{ }else{
return {"status":500,"data":null}; return new HttpResponse(500, null);
} }
} }
} }
...@@ -306,9 +306,9 @@ export class EntityService { ...@@ -306,9 +306,9 @@ export class EntityService {
return !Object.is(item[this.APPDEKEY],data[this.APPDEKEY]); return !Object.is(item[this.APPDEKEY],data[this.APPDEKEY]);
}) })
this.tempStorage.setItem(context.srfsessionkey+'_'+this.APPDENAME,JSON.stringify(tempResult)); this.tempStorage.setItem(context.srfsessionkey+'_'+this.APPDENAME,JSON.stringify(tempResult));
return {"status":200,"data":data}; return new HttpResponse(200, data);
}else{ }else{
return {"status":500,"data":null}; return new HttpResponse(500, null);
} }
} }
} }
...@@ -332,9 +332,9 @@ export class EntityService { ...@@ -332,9 +332,9 @@ export class EntityService {
flag = true; flag = true;
} }
}); });
return {"status":200,"data":flag}; return new HttpResponse(200, flag);
}else{ }else{
return {"status":500,"data":null}; return new HttpResponse(500, null);
} }
} }
} }
...@@ -459,7 +459,7 @@ export class EntityService { ...@@ -459,7 +459,7 @@ export class EntityService {
value: data[this.APPDEKEY] value: data[this.APPDEKEY]
}); });
Object.assign(data,tempData); Object.assign(data,tempData);
return {"status":200,"data":data}; return new HttpResponse(200,{"status":200,"data":data});
} }
/** /**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册