@@ -27,17 +27,15 @@ export class GeoprocessingService extends CommonServiceBase {
27
27
* @description 获取地理处理工具列表。
28
28
*/
29
29
getTools ( ) {
30
- const url = `${ this . url } /list` ;
31
- this . _get ( url ) ;
30
+ this . _get ( `${ this . url } /list` ) ;
32
31
}
33
32
/**
34
33
* @function SuperMap.GeoprocessingService.prototype.getTool
35
34
* @description 获取地理处理工具的ID、名称、描述、输入参数、环境参数和输出结果等相关参数。
36
35
* @param {string } identifier - 地理处理工具ID。
37
36
*/
38
37
getTool ( identifier ) {
39
- const url = `${ this . url } /${ identifier } ` ;
40
- this . _get ( url ) ;
38
+ this . _get ( `${ this . url } /${ identifier } ` ) ;
41
39
}
42
40
/**
43
41
* @function SuperMap.GeoprocessingService.prototype.execute
@@ -49,9 +47,8 @@ export class GeoprocessingService extends CommonServiceBase {
49
47
execute ( identifier , parameter , environment ) {
50
48
parameter = parameter ? parameter : null ;
51
49
environment = environment ? environment : null ;
52
- const paramter = { parameter, environment } ;
53
- const url = `${ this . url } /${ identifier } /execute` ;
54
- this . _get ( url , paramter ) ;
50
+ const executeParamter = { parameter, environment } ;
51
+ this . _get ( `${ this . url } /${ identifier } /execute` , executeParamter ) ;
55
52
}
56
53
/**
57
54
* @function SuperMap.GeoprocessingService.prototype.submitJob
@@ -63,13 +60,12 @@ export class GeoprocessingService extends CommonServiceBase {
63
60
submitJob ( identifier , parameter , environments ) {
64
61
parameter = parameter ? parameter : null ;
65
62
environments = environments ? environments : null ;
66
- const asyncParameter = { parameter : parameter , environments : environments } ;
67
- const url = `${ this . url } /${ identifier } /jobs` ;
63
+ const asyncParamter = { parameter : parameter , environments : environments } ;
68
64
this . request ( {
69
- url : url ,
65
+ url : ` ${ this . url } / ${ identifier } /jobs` ,
70
66
headers : { 'Content-type' : 'application/json' } ,
71
67
method : 'POST' ,
72
- data : JSON . stringify ( asyncParameter ) ,
68
+ data : JSON . stringify ( asyncParamter ) ,
73
69
scope : this ,
74
70
success : this . serviceProcessCompleted ,
75
71
failure : this . serviceProcessFailed
@@ -87,7 +83,6 @@ export class GeoprocessingService extends CommonServiceBase {
87
83
*/
88
84
waitForJobCompletion ( jobId , identifier , options ) {
89
85
const me = this ;
90
- const url = `${ me . url } /${ identifier } /jobs/${ jobId } ` ;
91
86
const timer = setInterval ( function ( ) {
92
87
const serviceProcessCompleted = function ( serverResult ) {
93
88
const state = serverResult . state . runState ;
@@ -107,15 +102,15 @@ export class GeoprocessingService extends CommonServiceBase {
107
102
result : serverResult
108
103
} ) ;
109
104
break ;
110
- case 'CANCEL ' :
105
+ case 'CANCELED ' :
111
106
clearInterval ( timer ) ;
112
107
me . events . triggerEvent ( 'processFailed' , {
113
108
result : serverResult
114
109
} ) ;
115
110
break ;
116
111
}
117
112
} ;
118
- me . _get ( url , null , serviceProcessCompleted ) ;
113
+ me . _get ( ` ${ me . url } / ${ identifier } /jobs/ ${ jobId } ` , null , serviceProcessCompleted ) ;
119
114
} , options . interval ) ;
120
115
}
121
116
@@ -126,8 +121,7 @@ export class GeoprocessingService extends CommonServiceBase {
126
121
* @param {string } jobId - 地理处理任务ID。
127
122
*/
128
123
getJobInfo ( identifier , jobId ) {
129
- const url = `${ this . url } /${ identifier } /jobs/${ jobId } ` ;
130
- this . _get ( url ) ;
124
+ this . _get ( `${ this . url } /${ identifier } /jobs/${ jobId } ` ) ;
131
125
}
132
126
133
127
/**
@@ -137,8 +131,7 @@ export class GeoprocessingService extends CommonServiceBase {
137
131
* @param {string } jobId - 地理处理任务ID。
138
132
*/
139
133
cancelJob ( identifier , jobId ) {
140
- const url = `${ this . url } /${ identifier } /jobs/${ jobId } /cancel` ;
141
- this . _get ( url ) ;
134
+ this . _get ( `${ this . url } /${ identifier } /jobs/${ jobId } /cancel` ) ;
142
135
}
143
136
/**
144
137
* @function SuperMap.GeoprocessingService.prototype.getJobs
0 commit comments