Skip to content

Commit 6e946fb

Browse files
[fix]eventListeners回调进入多次 review by qiw
1 parent ee19aa2 commit 6e946fb

12 files changed

+52
-21
lines changed

src/common/iServer/AddressMatchService.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,15 @@ export class AddressMatchService extends CommonServiceBase {
7171
if (eventId === result.result.eventId && callback) {
7272
delete result.result.eventId;
7373
callback(result);
74+
this.events.un(eventListeners);
75+
return false;
7476
}
7577
},
7678
processFailed: function(result) {
7779
if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
7880
callback(result);
81+
this.events.un(eventListeners);
82+
return false;
7983
}
8084
}
8185
}

src/common/iServer/DatasetService.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,15 @@ export class DatasetService extends CommonServiceBase {
103103
if (eventId === result.result.eventId && callback) {
104104
delete result.result.eventId;
105105
callback(result);
106+
this.events.un(eventListeners);
107+
return false;
106108
}
107109
},
108110
processFailed: function(result) {
109111
if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
110112
callback(result);
113+
this.events.un(eventListeners);
114+
return false;
111115
}
112116
}
113117
}

src/common/iServer/DatasourceService.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,15 @@ export class DatasourceService extends CommonServiceBase {
8080
if (eventId === result.result.eventId && callback) {
8181
delete result.result.eventId;
8282
callback(result);
83+
this.events.un(eventListeners);
84+
return false;
8385
}
8486
},
8587
processFailed: function(result) {
8688
if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
8789
callback(result);
90+
this.events.un(eventListeners);
91+
return false;
8892
}
8993
}
9094
}

src/common/iServer/GeoprocessingService.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,15 @@ export class GeoprocessingService extends CommonServiceBase {
165165
if (eventId === result.result.eventId && callback) {
166166
delete result.result.eventId;
167167
callback(result);
168+
this.events.un(eventListeners);
169+
return false;
168170
}
169171
},
170172
processFailed: function(result) {
171173
if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
172174
callback(result);
175+
this.events.un(eventListeners);
176+
return false;
173177
}
174178
}
175179
}

src/common/iServer/GetGridCellInfosService.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,15 @@ export class GetGridCellInfosService extends CommonServiceBase {
109109
if (eventId === result.result.eventId && callback) {
110110
delete result.result.eventId;
111111
callback(result);
112+
this.events.un(eventListeners);
113+
return false;
112114
}
113115
},
114116
processFailed: function(result) {
115117
if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
116118
callback(result);
119+
this.events.un(eventListeners);
120+
return false;
117121
}
118122
}
119123
}

src/common/iServer/ImageCollectionService.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,15 @@ export default class ImageCollectionService extends CommonServiceBase {
123123
if (eventId === result.result.eventId && callback) {
124124
delete result.result.eventId;
125125
callback(result);
126+
this.events.un(eventListeners);
127+
return false;
126128
}
127129
},
128130
processFailed: function(result) {
129131
if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
130132
callback(result);
133+
this.events.un(eventListeners);
134+
return false;
131135
}
132136
}
133137
}

src/common/iServer/ImageService.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,15 @@ export default class ImageService extends CommonServiceBase {
8484
processCompleted: function (result) {
8585
if (eventId === result.result.eventId && callback) {
8686
callback(result);
87+
this.events.un(eventListeners);
88+
return false;
8789
}
8890
},
8991
processFailed: function (result) {
9092
if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
9193
callback(result);
94+
this.events.un(eventListeners);
95+
return false;
9296
}
9397
}
9498
};

src/common/iServer/KnowledgeGraphService.js

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,16 @@ export class KnowledgeGraphService extends CommonServiceBase {
220220
if (eventId === result.result.eventId && callback) {
221221
delete result.result.eventId;
222222
callback(result);
223+
this.events.un(eventListeners);
224+
return false;
223225
}
224226
},
225227
processFailed: function (result) {
226228
if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
227229
delete result.eventId;
228-
delete result.error.eventId;
229230
callback(result);
231+
this.events.un(eventListeners);
232+
return false;
230233
}
231234
}
232235
};
@@ -249,26 +252,6 @@ export class KnowledgeGraphService extends CommonServiceBase {
249252
}
250253
this.request(requestParams);
251254
}
252-
/**
253-
* @function KnowledgeGraphService.prototype.serviceProcessCompleted
254-
* @param {Object} result - 服务器返回的结果对象
255-
* @description 服务流程是否完成
256-
*/
257-
serviceProcessCompleted(result, options) {
258-
if (result.succeed) {
259-
delete result.succeed;
260-
}
261-
super.serviceProcessCompleted(result, options);
262-
}
263-
264-
/**
265-
* @function KnowledgeGraphService.prototype.serviceProcessCompleted
266-
* @param {Object} result - 服务器返回的结果对象
267-
* @description 服务流程是否失败
268-
*/
269-
serviceProcessFailed(result, options) {
270-
super.serviceProcessFailed(result, options);
271-
}
272255
/**
273256
* @private
274257
* @function _getGraphMapData

src/common/iServer/MapService.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,15 @@ export class MapService extends CommonServiceBase {
8585
if (eventId === result.result.eventId && callback) {
8686
delete result.result.eventId;
8787
callback(result);
88+
this.events.un(eventListeners);
89+
return false;
8890
}
8991
},
9092
processFailed: function(result) {
9193
if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
9294
callback(result);
95+
this.events.un(eventListeners);
96+
return false;
9397
}
9498
}
9599
}

src/common/iServer/MeasureService.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,15 @@ export class MeasureService extends CommonServiceBase {
7373
if (eventId === result.result.eventId && callback) {
7474
delete result.result.eventId;
7575
callback(result);
76+
this.events.un(eventListeners);
77+
return false;
7678
}
7779
},
7880
processFailed: function(result) {
7981
if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
8082
callback(result);
83+
this.events.un(eventListeners);
84+
return false;
8185
}
8286
}
8387
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy