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

部件服务基类调整

上级 4cf3d682
...@@ -173,9 +173,9 @@ export class ControlServiceBase { ...@@ -173,9 +173,9 @@ export class ControlServiceBase {
try{ try{
data = this.handleRequestData(action, context, data); data = this.handleRequestData(action, context, data);
if (Util.isFunction(this.service[action])) { if (Util.isFunction(this.service[action])) {
response = await this.service[action](context, data); response = await this.service[action](context, data, isLoading);
} else { } else {
response = await this.service.Create(context, data); response = await this.service.Create(context, data, isLoading);
} }
if (!response.isError && response.isError()) { if (!response.isError && response.isError()) {
response = this.handleResponse(action, response); response = this.handleResponse(action, response);
...@@ -204,9 +204,9 @@ export class ControlServiceBase { ...@@ -204,9 +204,9 @@ export class ControlServiceBase {
try{ try{
data = this.handleRequestData(action, context, data); data = this.handleRequestData(action, context, data);
if (Util.isFunction(this.service[action])) { if (Util.isFunction(this.service[action])) {
response = await this.service[action](context, data); response = await this.service[action](context, data, isLoading);
} else { } else {
response = await this.service.Remove(context, data); response = await this.service.Remove(context, data, isLoading);
} }
if (!response.isError && response.isError()) { if (!response.isError && response.isError()) {
response = this.handleResponse(action, response); response = this.handleResponse(action, response);
...@@ -235,9 +235,9 @@ export class ControlServiceBase { ...@@ -235,9 +235,9 @@ export class ControlServiceBase {
try{ try{
data = this.handleRequestData(action, context, data); data = this.handleRequestData(action, context, data);
if (Util.isFunction(this.service[action])) { if (Util.isFunction(this.service[action])) {
response = await this.service[action](context, data); response = await this.service[action](context, data, isLoading);
} else { } else {
response = await this.service.Update(context, data); response = await this.service.Update(context, data, isLoading);
} }
if (!response.isError && response.isError()) { if (!response.isError && response.isError()) {
response = this.handleResponse(action, response); response = this.handleResponse(action, response);
...@@ -266,9 +266,9 @@ export class ControlServiceBase { ...@@ -266,9 +266,9 @@ export class ControlServiceBase {
try{ try{
data = this.handleRequestData(action, context, data); data = this.handleRequestData(action, context, data);
if (Util.isFunction(this.service[action])) { if (Util.isFunction(this.service[action])) {
response = await this.service[action](context, data); response = await this.service[action](context, data, isLoading);
} else { } else {
response = await this.service.Get(context, data); response = await this.service.Get(context, data, isLoading);
} }
if (!response.isError && response.isError()) { if (!response.isError && response.isError()) {
response = this.handleResponse(action, response); response = this.handleResponse(action, response);
...@@ -301,10 +301,10 @@ export class ControlServiceBase { ...@@ -301,10 +301,10 @@ export class ControlServiceBase {
//仿真主键数据 //仿真主键数据
data[this.appDeKey] = PrimaryKey; data[this.appDeKey] = PrimaryKey;
if (Util.isFunction(this.service[action])) { if (Util.isFunction(this.service[action])) {
response = await this.service[action](context, data); response = await this.service[action](context, data, isLoading);
console.log(response); console.log(response);
} else { } else {
response = await this.service.GetDraft(context, data); response = await this.service.GetDraft(context, data, isLoading);
} }
if (!response.isError && response.isError()) { if (!response.isError && response.isError()) {
response = this.handleResponse(action, response, true); response = this.handleResponse(action, response, true);
...@@ -336,7 +336,7 @@ export class ControlServiceBase { ...@@ -336,7 +336,7 @@ export class ControlServiceBase {
data = this.handleRequestData(action, context, data); data = this.handleRequestData(action, context, data);
let response: HttpResponse; let response: HttpResponse;
if (Util.isFunction(this.service[action])) { if (Util.isFunction(this.service[action])) {
response = await this.service[action](context, data); response = await this.service[action](context, data, isLoading);
} else { } else {
response = new HttpResponse(200, null, { code: 100, message: `${action}前台逻辑未实现` }); response = new HttpResponse(200, null, { code: 100, message: `${action}前台逻辑未实现` });
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册