Skip to content

Commit e0e3eb6

Browse files
committed
【update】 web 打印去掉模板部分字段默认值; web 打印测试增加空值验证; review by songym
1 parent b768bc2 commit e0e3eb6

5 files changed

Lines changed: 10 additions & 8 deletions

File tree

src/common/iServer/WebPrintingJobLayoutOptions.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ export class WebPrintingJobLayoutOptions {
111111
toJSON() {
112112
var params = {
113113
templateName: this.templateName,
114-
title: this.title || '',
115-
subTitle: this.subTitle || '',
116-
author: this.author || '',
117-
copyright: this.copyright || ''
114+
title: this.title,
115+
subTitle: this.subTitle,
116+
author: this.author,
117+
copyright: this.copyright
118118
};
119119
if (this.scaleBarOptions) {
120120
params.scaleBarOptions = this.scaleBarOptions;

src/common/iServer/WebPrintingService.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ export class WebPrintingService extends CommonServiceBase {
5555
return;
5656
}
5757
if (params.layoutOptions) {
58-
!params.layoutOptions.title && (params.layoutOptions.title = '');
59-
!params.layoutOptions.subTitle && (params.layoutOptions.subTitle = '');
60-
!params.layoutOptions.author && (params.layoutOptions.author = '');
61-
!params.layoutOptions.copyright && (params.layoutOptions.copyright = '');
6258
if (params.layoutOptions.legendOptions) {
6359
!params.layoutOptions.legendOptions.title && (params.layoutOptions.legendOptions.title = '');
6460
params.layoutOptions.legendOptions.picAsBase64 =

test/leaflet/services/WebPrintingJobServiceSpec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ describe('leaflet_WebPrintingJobService', () => {
5454
expect(method).toBe('POST');
5555
expect(testUrl).toBe(url + '/jobs');
5656
expect(params).not.toBeNull();
57+
expect(params.layoutOptions.subTitle).toBeNull();
58+
expect(params.layoutOptions.copyright).toBeNull();
5759
expect(options).not.toBeNull();
5860
return Promise.resolve(new Response(JSON.stringify(createWebPringintJobResultJson)));
5961
});

test/mapboxgl/services/WebPrintingJobServiceSpec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ describe('mapboxgl_WebPrintingJobService', () => {
5656
expect(method).toBe('POST');
5757
expect(testUrl).toBe(url + '/jobs');
5858
expect(params).not.toBeNull();
59+
expect(params.layoutOptions.subTitle).toBeNull();
60+
expect(params.layoutOptions.copyright).toBeNull();
5961
expect(options).not.toBeNull();
6062
return Promise.resolve(new Response(JSON.stringify(createWebPringintJobResultJson)));
6163
});

test/openlayers/services/WebPrintingJobServiceSpec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ describe('openlayers_WebPrintingJobService', () => {
5656
expect(method).toBe('POST');
5757
expect(testUrl).toBe(url + '/jobs');
5858
expect(params).not.toBeNull();
59+
expect(params.layoutOptions.subTitle).toBeNull();
60+
expect(params.layoutOptions.copyright).toBeNull();
5961
expect(options).not.toBeNull();
6062
return Promise.resolve(new Response(JSON.stringify(createWebPringintJobResultJson)));
6163
});

0 commit comments

Comments
 (0)