Skip to content

Commit bc3d09f

Browse files
fix isvj-7291, isvj-7511 web打印running回调不应触发 review by songym
1 parent 8e1b237 commit bc3d09f

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

src/common/iServer/WebPrintingService.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,13 @@ export class WebPrintingService extends CommonServiceBase {
7171

7272
/**
7373
* @function WebPrintingService.prototype.getPrintingJob
74-
* @description 获取 Web 打印输出文档任务。
75-
* @param {string} jobId - Web 打印输入文档任务 ID
74+
* @description 获取 Web 打印输出文档任务, 轮询获取打印状态,只有当状态为完成或失败才返回结果
75+
* @param {string} jobId - Web 打印任务 ID
7676
* @param {RequestCallback} callback - 回调函数。
7777
*/
7878
getPrintingJob(jobId, callback) {
7979
var me = this;
80-
me.processAsync(`jobs/${jobId}`, 'GET', function(result) {
81-
me.rollingProcess(result, me._processUrl(`jobs/${jobId}`), callback);
82-
});
80+
me.rollingProcess(me._processUrl(`jobs/${jobId}`), callback);
8381
}
8482

8583
/**
@@ -108,11 +106,8 @@ export class WebPrintingService extends CommonServiceBase {
108106
* @description 轮询查询 Web 打印任务。
109107
* @param {Object} result - 服务器返回的结果对象。
110108
*/
111-
rollingProcess(result, url, callback) {
109+
rollingProcess(url, callback) {
112110
var me = this;
113-
if (!result) {
114-
return;
115-
}
116111
this.id && clearInterval(this.id);
117112
this.id = setInterval(function () {
118113
me.request({
@@ -142,6 +137,8 @@ export class WebPrintingService extends CommonServiceBase {
142137
result = Util.transformResult(result);
143138
if (result.status === 'FINISHED' || result.status === 'ERROR') {
144139
clearInterval(this.id);
140+
} else if (result.status === 'RUNNING') {
141+
options.success = false;
145142
}
146143
return { result, options };
147144
}

src/openlayers/mapping/WebMap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3236,7 +3236,7 @@ export class WebMap extends Observable {
32363236
}
32373237
if (featureType === "LINE") {
32383238
colors.push(customSettings[key].strokeColor);
3239-
} else {
3239+
} else if(customSettings[key].fillColor) {
32403240
colors.push(customSettings[key].fillColor);
32413241
}
32423242
});

0 commit comments

Comments
 (0)