dts-backoffice-util 2.8.2 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/dts-backoffice-util.umd.js +419 -2359
- package/bundles/dts-backoffice-util.umd.js.map +1 -1
- package/esm2015/dts-backoffice-util.js +2 -6
- package/esm2015/lib/components/totvs-schedule-execution/totvs-schedule-execution.component.js +15 -131
- package/esm2015/lib/components/totvs-schedule-execution/totvs-schedule-execution.model.js +1 -125
- package/esm2015/lib/components/totvs-schedule-execution/totvs-schedule-execution.service.js +19 -172
- package/esm2015/lib/dts-backoffice-util.module.js +2 -8
- package/esm2015/lib/interfaces/filter-range.interface.js +2 -47
- package/esm2015/lib/interfaces/totvs-response.interface.js +2 -16
- package/esm2015/lib/model/session-info.model.js +1 -116
- package/esm2015/lib/pipes/dts-date-format.pipe.js +2 -11
- package/esm2015/lib/services/breadcrumb-control.service.js +9 -44
- package/esm2015/lib/services/cache-params.service.js +10 -24
- package/esm2015/lib/services/menu-datasul.service.js +9 -18
- package/esm2015/lib/services/profile.service.js +17 -78
- package/esm2015/lib/services/report.service.js +20 -81
- package/esm2015/lib/services/session-info.service.js +12 -27
- package/esm2015/lib/services/translate.service.js +2 -15
- package/esm2015/lib/utils/date.util.js +1 -39
- package/esm2015/lib/utils/disclaimer.util.js +33 -317
- package/esm2015/lib/utils/field-validation.util.js +1 -96
- package/esm2015/lib/utils/file.util.js +7 -102
- package/esm2015/lib/utils/filter-range.util.js +1 -20
- package/esm2015/lib/utils/generic-functions.utils.js +12 -137
- package/esm2015/public-api.js +22 -25
- package/fesm2015/dts-backoffice-util.js +176 -1501
- package/fesm2015/dts-backoffice-util.js.map +1 -1
- package/package.json +9 -8
- package/CHANGELOG.md +0 -159
- package/bundles/dts-backoffice-util.umd.min.js +0 -2
- package/bundles/dts-backoffice-util.umd.min.js.map +0 -1
- package/esm5/dts-backoffice-util.js +0 -9
- package/esm5/lib/components/totvs-schedule-execution/totvs-schedule-execution.component.js +0 -448
- package/esm5/lib/components/totvs-schedule-execution/totvs-schedule-execution.model.js +0 -143
- package/esm5/lib/components/totvs-schedule-execution/totvs-schedule-execution.service.js +0 -434
- package/esm5/lib/dts-backoffice-util.module.js +0 -53
- package/esm5/lib/interfaces/filter-range.interface.js +0 -47
- package/esm5/lib/interfaces/totvs-response.interface.js +0 -16
- package/esm5/lib/model/session-info.model.js +0 -239
- package/esm5/lib/pipes/dts-date-format.pipe.js +0 -36
- package/esm5/lib/services/breadcrumb-control.service.js +0 -157
- package/esm5/lib/services/cache-params.service.js +0 -61
- package/esm5/lib/services/menu-datasul.service.js +0 -92
- package/esm5/lib/services/profile.service.js +0 -146
- package/esm5/lib/services/report.service.js +0 -137
- package/esm5/lib/services/session-info.service.js +0 -64
- package/esm5/lib/services/translate.service.js +0 -47
- package/esm5/lib/utils/date.util.js +0 -135
- package/esm5/lib/utils/disclaimer.util.js +0 -930
- package/esm5/lib/utils/field-validation.util.js +0 -358
- package/esm5/lib/utils/file.util.js +0 -262
- package/esm5/lib/utils/filter-range.util.js +0 -69
- package/esm5/lib/utils/generic-functions.utils.js +0 -358
- package/esm5/public-api.js +0 -37
- package/fesm5/dts-backoffice-util.js +0 -3944
- package/fesm5/dts-backoffice-util.js.map +0 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, EventEmitter, Component, ViewChild, Input, Output, Pipe, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common/http';
|
|
2
4
|
import { HttpClient, HttpErrorResponse, HttpClientModule } from '@angular/common/http';
|
|
3
5
|
import { of } from 'rxjs';
|
|
4
6
|
import { map } from 'rxjs/operators';
|
|
@@ -6,22 +8,12 @@ import { PoI18nService, PoNotificationService, PoModule } from '@po-ui/ng-compon
|
|
|
6
8
|
import { FormsModule } from '@angular/forms';
|
|
7
9
|
import { CommonModule } from '@angular/common';
|
|
8
10
|
|
|
9
|
-
/**
|
|
10
|
-
* @fileoverview added by tsickle
|
|
11
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
12
|
-
*/
|
|
13
11
|
class UserLoginService {
|
|
14
|
-
/**
|
|
15
|
-
* @param {?} http
|
|
16
|
-
*/
|
|
17
12
|
constructor(http) {
|
|
18
13
|
this.http = http;
|
|
19
14
|
this.apiUrl = '/totvs-menu/rest/getSessionInfo';
|
|
20
15
|
this.userLogin = undefined;
|
|
21
16
|
}
|
|
22
|
-
/**
|
|
23
|
-
* @return {?}
|
|
24
|
-
*/
|
|
25
17
|
getUserLogin() {
|
|
26
18
|
if (localStorage.getItem('username')) {
|
|
27
19
|
return of(localStorage.getItem('username'));
|
|
@@ -31,126 +23,59 @@ class UserLoginService {
|
|
|
31
23
|
}
|
|
32
24
|
else {
|
|
33
25
|
return this.http.get(`${this.apiUrl}`)
|
|
34
|
-
.pipe(map((
|
|
35
|
-
* @param {?} response
|
|
36
|
-
* @return {?}
|
|
37
|
-
*/
|
|
38
|
-
(response) => {
|
|
26
|
+
.pipe(map((response) => {
|
|
39
27
|
this.userLogin = response.userName;
|
|
40
28
|
return response.userName;
|
|
41
|
-
}))
|
|
29
|
+
}));
|
|
42
30
|
}
|
|
43
31
|
}
|
|
44
32
|
}
|
|
33
|
+
/** @nocollapse */ UserLoginService.ɵprov = i0.ɵɵdefineInjectable({ factory: function UserLoginService_Factory() { return new UserLoginService(i0.ɵɵinject(i1.HttpClient)); }, token: UserLoginService, providedIn: "root" });
|
|
34
|
+
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
45
35
|
UserLoginService.decorators = [
|
|
46
36
|
{ type: Injectable, args: [{
|
|
47
37
|
providedIn: 'root'
|
|
48
38
|
},] }
|
|
49
39
|
];
|
|
50
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* @type {function(): !Array<(null|{
|
|
42
|
+
* type: ?,
|
|
43
|
+
* decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
|
|
44
|
+
* })>}
|
|
45
|
+
* @nocollapse
|
|
46
|
+
*/
|
|
51
47
|
UserLoginService.ctorParameters = () => [
|
|
52
48
|
{ type: HttpClient }
|
|
53
|
-
];
|
|
54
|
-
/** @nocollapse */ UserLoginService.ɵprov = ɵɵdefineInjectable({ factory: function UserLoginService_Factory() { return new UserLoginService(ɵɵinject(HttpClient)); }, token: UserLoginService, providedIn: "root" });
|
|
55
|
-
if (false) {
|
|
56
|
-
/** @type {?} */
|
|
57
|
-
UserLoginService.prototype.apiUrl;
|
|
58
|
-
/** @type {?} */
|
|
59
|
-
UserLoginService.prototype.userLogin;
|
|
60
|
-
/** @type {?} */
|
|
61
|
-
UserLoginService.prototype.http;
|
|
62
|
-
}
|
|
49
|
+
];
|
|
63
50
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
* @record
|
|
70
|
-
*/
|
|
71
|
-
function IProfile() { }
|
|
72
|
-
if (false) {
|
|
73
|
-
/** @type {?} */
|
|
74
|
-
IProfile.prototype.pageId;
|
|
75
|
-
/** @type {?} */
|
|
76
|
-
IProfile.prototype.dataCode;
|
|
77
|
-
/** @type {?} */
|
|
78
|
-
IProfile.prototype.userCode;
|
|
79
|
-
/** @type {?|undefined} */
|
|
80
|
-
IProfile.prototype.dataValue;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* @record
|
|
84
|
-
*/
|
|
85
|
-
function IProfileResponse() { }
|
|
86
|
-
if (false) {
|
|
87
|
-
/** @type {?} */
|
|
88
|
-
IProfileResponse.prototype.message;
|
|
89
|
-
/** @type {?} */
|
|
90
|
-
IProfileResponse.prototype.length;
|
|
91
|
-
/** @type {?} */
|
|
92
|
-
IProfileResponse.prototype.data;
|
|
93
|
-
}
|
|
94
|
-
/** @enum {number} */
|
|
95
|
-
const EDataType = {
|
|
96
|
-
STRING: 1,
|
|
97
|
-
JSON: 2,
|
|
98
|
-
};
|
|
99
|
-
EDataType[EDataType.STRING] = 'STRING';
|
|
100
|
-
EDataType[EDataType.JSON] = 'JSON';
|
|
51
|
+
var EDataType;
|
|
52
|
+
(function (EDataType) {
|
|
53
|
+
EDataType[EDataType["STRING"] = 1] = "STRING";
|
|
54
|
+
EDataType[EDataType["JSON"] = 2] = "JSON";
|
|
55
|
+
})(EDataType || (EDataType = {}));
|
|
101
56
|
class ProfileService {
|
|
102
|
-
/**
|
|
103
|
-
* @param {?} http
|
|
104
|
-
*/
|
|
105
57
|
constructor(http) {
|
|
106
58
|
this.http = http;
|
|
107
59
|
this.apiURL = '/dts/datasul-rest/resources/api/btb/btapi930za';
|
|
108
60
|
}
|
|
109
|
-
/**
|
|
110
|
-
* @param {?} profile
|
|
111
|
-
* @return {?}
|
|
112
|
-
*/
|
|
113
61
|
setProfile(profile) {
|
|
114
|
-
/** @type {?} */
|
|
115
62
|
const headers = { 'X-PO-Screen-Lock': 'true' };
|
|
116
63
|
const { pageId, userCode } = profile;
|
|
117
64
|
return this.http
|
|
118
65
|
.post(`${this.apiURL}/setProfile?userCode=${userCode}&pageId=${pageId}`, profile, { headers });
|
|
119
66
|
}
|
|
120
|
-
/**
|
|
121
|
-
* @param {?} profile
|
|
122
|
-
* @param {?=} showLoading
|
|
123
|
-
* @return {?}
|
|
124
|
-
*/
|
|
125
67
|
getProfileAsString(profile, showLoading) {
|
|
126
68
|
return this.getProfile(profile, EDataType.STRING, showLoading ? 'true' : 'false');
|
|
127
69
|
}
|
|
128
|
-
/**
|
|
129
|
-
* @param {?} profile
|
|
130
|
-
* @param {?=} showLoading
|
|
131
|
-
* @return {?}
|
|
132
|
-
*/
|
|
133
70
|
getProfileAsJSON(profile, showLoading) {
|
|
134
71
|
return this.getProfile(profile, EDataType.JSON, showLoading ? 'true' : 'false');
|
|
135
72
|
}
|
|
136
|
-
/**
|
|
137
|
-
* @private
|
|
138
|
-
* @param {?} profile
|
|
139
|
-
* @param {?} dataType
|
|
140
|
-
* @param {?=} showLoading
|
|
141
|
-
* @return {?}
|
|
142
|
-
*/
|
|
143
73
|
getProfile(profile, dataType, showLoading) {
|
|
144
|
-
/** @type {?} */
|
|
145
74
|
const headers = { 'X-PO-Screen-Lock': showLoading };
|
|
146
75
|
const { pageId, dataCode, userCode } = profile;
|
|
147
76
|
return this.http
|
|
148
77
|
.get(`${this.apiURL}/getProfile?userCode=${userCode}&pageId=${pageId}&dataCode=${dataCode}`, { headers })
|
|
149
|
-
.pipe(map(
|
|
150
|
-
* @param {?} preference
|
|
151
|
-
* @return {?}
|
|
152
|
-
*/
|
|
153
|
-
preference => {
|
|
78
|
+
.pipe(map(preference => {
|
|
154
79
|
if (preference.data[0]) {
|
|
155
80
|
if (dataType === EDataType.STRING) {
|
|
156
81
|
return preference.data[0].dataValue;
|
|
@@ -162,125 +87,65 @@ class ProfileService {
|
|
|
162
87
|
else {
|
|
163
88
|
return undefined;
|
|
164
89
|
}
|
|
165
|
-
}))
|
|
90
|
+
}));
|
|
166
91
|
}
|
|
167
92
|
}
|
|
93
|
+
/** @nocollapse */ ProfileService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ProfileService_Factory() { return new ProfileService(i0.ɵɵinject(i1.HttpClient)); }, token: ProfileService, providedIn: "root" });
|
|
94
|
+
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
168
95
|
ProfileService.decorators = [
|
|
169
96
|
{ type: Injectable, args: [{
|
|
170
97
|
providedIn: 'root'
|
|
171
98
|
},] }
|
|
172
99
|
];
|
|
173
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* @type {function(): !Array<(null|{
|
|
102
|
+
* type: ?,
|
|
103
|
+
* decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
|
|
104
|
+
* })>}
|
|
105
|
+
* @nocollapse
|
|
106
|
+
*/
|
|
174
107
|
ProfileService.ctorParameters = () => [
|
|
175
108
|
{ type: HttpClient }
|
|
176
|
-
];
|
|
177
|
-
/** @nocollapse */ ProfileService.ɵprov = ɵɵdefineInjectable({ factory: function ProfileService_Factory() { return new ProfileService(ɵɵinject(HttpClient)); }, token: ProfileService, providedIn: "root" });
|
|
178
|
-
if (false) {
|
|
179
|
-
/** @type {?} */
|
|
180
|
-
ProfileService.prototype.apiURL;
|
|
181
|
-
/** @type {?} */
|
|
182
|
-
ProfileService.prototype.http;
|
|
183
|
-
}
|
|
109
|
+
];
|
|
184
110
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
function IProperty() { }
|
|
193
|
-
if (false) {
|
|
194
|
-
/** @type {?} */
|
|
195
|
-
IProperty.prototype.name;
|
|
196
|
-
/** @type {?} */
|
|
197
|
-
IProperty.prototype.value;
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* @record
|
|
201
|
-
*/
|
|
202
|
-
function IReportServiceParams() { }
|
|
203
|
-
if (false) {
|
|
204
|
-
/** @type {?} */
|
|
205
|
-
IReportServiceParams.prototype.reportName;
|
|
206
|
-
/** @type {?} */
|
|
207
|
-
IReportServiceParams.prototype.programName;
|
|
208
|
-
/** @type {?} */
|
|
209
|
-
IReportServiceParams.prototype.properties;
|
|
210
|
-
/** @type {?} */
|
|
211
|
-
IReportServiceParams.prototype.dialect;
|
|
212
|
-
/** @type {?} */
|
|
213
|
-
IReportServiceParams.prototype.downloadName;
|
|
214
|
-
/** @type {?} */
|
|
215
|
-
IReportServiceParams.prototype.download;
|
|
216
|
-
/** @type {?} */
|
|
217
|
-
IReportServiceParams.prototype.format;
|
|
218
|
-
}
|
|
219
|
-
/** @enum {string} */
|
|
220
|
-
const ReportFormats = {
|
|
221
|
-
XLSX: 'xlsx',
|
|
222
|
-
PDF: 'pdf',
|
|
223
|
-
DOCX: 'docx',
|
|
224
|
-
HTML: 'html',
|
|
225
|
-
};
|
|
111
|
+
var ReportFormats;
|
|
112
|
+
(function (ReportFormats) {
|
|
113
|
+
ReportFormats["XLSX"] = "xlsx";
|
|
114
|
+
ReportFormats["PDF"] = "pdf";
|
|
115
|
+
ReportFormats["DOCX"] = "docx";
|
|
116
|
+
ReportFormats["HTML"] = "html";
|
|
117
|
+
})(ReportFormats || (ReportFormats = {}));
|
|
226
118
|
class ReportService {
|
|
227
|
-
/**
|
|
228
|
-
* @param {?} httpClient
|
|
229
|
-
*/
|
|
230
119
|
constructor(httpClient) {
|
|
231
120
|
this.httpClient = httpClient;
|
|
232
121
|
this.URL = window.location.href.indexOf('totvs-menu') > 0 ? '/totvs-menu/rest/report/run/'
|
|
233
122
|
: '/dts/datasul-report/resources/run/';
|
|
234
123
|
}
|
|
235
|
-
/**
|
|
236
|
-
* @param {?} params
|
|
237
|
-
* @param {?=} showLoading
|
|
238
|
-
* @return {?}
|
|
239
|
-
*/
|
|
240
124
|
generate(params, showLoading = true) {
|
|
241
|
-
/** @type {?} */
|
|
242
125
|
const headers = { 'X-PO-Screen-Lock': showLoading ? 'true' : 'false' };
|
|
243
|
-
/** @type {?} */
|
|
244
126
|
let reportURL = `${this.URL}${params.reportName}`;
|
|
245
127
|
if (params.properties.length > 0) {
|
|
246
128
|
reportURL += '?';
|
|
247
|
-
params.properties.forEach((
|
|
248
|
-
* @param {?} property
|
|
249
|
-
* @param {?} index
|
|
250
|
-
* @return {?}
|
|
251
|
-
*/
|
|
252
|
-
(property, index) => {
|
|
129
|
+
params.properties.forEach((property, index) => {
|
|
253
130
|
if (index > 0) {
|
|
254
131
|
reportURL += '&';
|
|
255
132
|
}
|
|
256
133
|
reportURL += `c_properties=${property.name}&c_values=${property.value}`;
|
|
257
|
-
})
|
|
134
|
+
});
|
|
258
135
|
}
|
|
259
136
|
reportURL += `&dialect=${params.dialect}&format=${params.format}`;
|
|
260
137
|
reportURL += `&program=${params.programName}&resultFileName=${params.downloadName}`;
|
|
261
138
|
return this.httpClient.post(reportURL, {}, { headers, responseType: 'blob' })
|
|
262
|
-
.pipe(map(
|
|
263
|
-
* @param {?} report
|
|
264
|
-
* @return {?}
|
|
265
|
-
*/
|
|
266
|
-
report => {
|
|
139
|
+
.pipe(map(report => {
|
|
267
140
|
if (params.download) {
|
|
268
141
|
this.download(report, `${params.downloadName}.${params.format}`);
|
|
269
142
|
}
|
|
270
143
|
return report;
|
|
271
|
-
}))
|
|
144
|
+
}));
|
|
272
145
|
}
|
|
273
|
-
/**
|
|
274
|
-
* @param {?} file
|
|
275
|
-
* @param {?} fileName
|
|
276
|
-
* @return {?}
|
|
277
|
-
*/
|
|
278
146
|
download(file, fileName) {
|
|
279
|
-
/** @type {?} */
|
|
280
147
|
const binaryData = [file];
|
|
281
|
-
/** @type {?} */
|
|
282
148
|
const downloadLink = document.createElement('a');
|
|
283
|
-
/** @type {?} */
|
|
284
149
|
const urlDownload = window.URL.createObjectURL(new Blob(binaryData, { type: file.type }));
|
|
285
150
|
downloadLink.href = urlDownload;
|
|
286
151
|
downloadLink.setAttribute('download', fileName);
|
|
@@ -290,45 +155,33 @@ class ReportService {
|
|
|
290
155
|
downloadLink.remove();
|
|
291
156
|
}
|
|
292
157
|
}
|
|
158
|
+
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
293
159
|
ReportService.decorators = [
|
|
294
160
|
{ type: Injectable }
|
|
295
161
|
];
|
|
296
|
-
/**
|
|
162
|
+
/**
|
|
163
|
+
* @type {function(): !Array<(null|{
|
|
164
|
+
* type: ?,
|
|
165
|
+
* decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
|
|
166
|
+
* })>}
|
|
167
|
+
* @nocollapse
|
|
168
|
+
*/
|
|
297
169
|
ReportService.ctorParameters = () => [
|
|
298
170
|
{ type: HttpClient }
|
|
299
|
-
];
|
|
300
|
-
if (false) {
|
|
301
|
-
/** @type {?} */
|
|
302
|
-
ReportService.prototype.URL;
|
|
303
|
-
/** @type {?} */
|
|
304
|
-
ReportService.prototype.httpClient;
|
|
305
|
-
}
|
|
171
|
+
];
|
|
306
172
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
173
|
+
/*
|
|
174
|
+
Versão: 1.003
|
|
175
|
+
Data Criação: 06/08/2018
|
|
176
|
+
*/
|
|
311
177
|
class BreadcrumbControlService {
|
|
312
178
|
constructor() { }
|
|
313
|
-
/**
|
|
314
|
-
* @return {?}
|
|
315
|
-
*/
|
|
316
179
|
newBreadcrumb() {
|
|
317
180
|
this.breadcrumb = { items: [] };
|
|
318
181
|
}
|
|
319
|
-
/**
|
|
320
|
-
* @param {?} literal
|
|
321
|
-
* @param {?} activatedRoute
|
|
322
|
-
* @return {?}
|
|
323
|
-
*/
|
|
324
182
|
addBreadcrumb(literal, activatedRoute) {
|
|
325
183
|
this.addBreadcrumbURL(literal, decodeURIComponent(activatedRoute.snapshot['_routerState'].url));
|
|
326
184
|
}
|
|
327
|
-
/**
|
|
328
|
-
* @param {?} literal
|
|
329
|
-
* @param {?} url
|
|
330
|
-
* @return {?}
|
|
331
|
-
*/
|
|
332
185
|
addBreadcrumbURL(literal, url) {
|
|
333
186
|
if (!literal || literal === '') {
|
|
334
187
|
return;
|
|
@@ -336,9 +189,7 @@ class BreadcrumbControlService {
|
|
|
336
189
|
if (!this.breadcrumb) {
|
|
337
190
|
this.newBreadcrumb();
|
|
338
191
|
}
|
|
339
|
-
/** @type {?} */
|
|
340
192
|
const breadcrumbAux = { items: [] };
|
|
341
|
-
/** @type {?} */
|
|
342
193
|
let idx = 0;
|
|
343
194
|
for (idx = 0; idx < this.breadcrumb.items.length; idx++) {
|
|
344
195
|
if (this.breadcrumb.items[idx].label !== literal) {
|
|
@@ -351,14 +202,7 @@ class BreadcrumbControlService {
|
|
|
351
202
|
breadcrumbAux.items.push({ label: literal, link: url });
|
|
352
203
|
this.breadcrumb = breadcrumbAux;
|
|
353
204
|
}
|
|
354
|
-
/**
|
|
355
|
-
* @param {?} literal
|
|
356
|
-
* @param {?} valueOld
|
|
357
|
-
* @param {?} valueNew
|
|
358
|
-
* @return {?}
|
|
359
|
-
*/
|
|
360
205
|
updBreadcrumbURL(literal, valueOld, valueNew) {
|
|
361
|
-
/** @type {?} */
|
|
362
206
|
let currentRouterURL = this.getCurrentRouter();
|
|
363
207
|
if (!currentRouterURL) {
|
|
364
208
|
return;
|
|
@@ -372,18 +216,12 @@ class BreadcrumbControlService {
|
|
|
372
216
|
currentRouterURL = currentRouterURL.replace(valueOld, valueNew);
|
|
373
217
|
this.addBreadcrumbURL(literal, currentRouterURL);
|
|
374
218
|
}
|
|
375
|
-
/**
|
|
376
|
-
* @return {?}
|
|
377
|
-
*/
|
|
378
219
|
getBreadcrumb() {
|
|
379
220
|
if (!this.breadcrumb) {
|
|
380
221
|
this.newBreadcrumb();
|
|
381
222
|
}
|
|
382
223
|
return this.breadcrumb;
|
|
383
224
|
}
|
|
384
|
-
/**
|
|
385
|
-
* @return {?}
|
|
386
|
-
*/
|
|
387
225
|
getCurrentRouter() {
|
|
388
226
|
if (!this.breadcrumb) {
|
|
389
227
|
this.newBreadcrumb();
|
|
@@ -393,9 +231,6 @@ class BreadcrumbControlService {
|
|
|
393
231
|
}
|
|
394
232
|
return this.breadcrumb.items[this.breadcrumb.items.length - 1].link;
|
|
395
233
|
}
|
|
396
|
-
/**
|
|
397
|
-
* @return {?}
|
|
398
|
-
*/
|
|
399
234
|
getPrevRouter() {
|
|
400
235
|
if (!this.breadcrumb) {
|
|
401
236
|
this.newBreadcrumb();
|
|
@@ -405,35 +240,29 @@ class BreadcrumbControlService {
|
|
|
405
240
|
}
|
|
406
241
|
return this.breadcrumb.items[this.breadcrumb.items.length - 2].link;
|
|
407
242
|
}
|
|
408
|
-
/**
|
|
409
|
-
* @return {?}
|
|
410
|
-
*/
|
|
411
243
|
hasPreviousRouter() {
|
|
412
244
|
return this.breadcrumb.items.length > 1;
|
|
413
245
|
}
|
|
414
246
|
}
|
|
247
|
+
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
415
248
|
BreadcrumbControlService.decorators = [
|
|
416
249
|
{ type: Injectable }
|
|
417
250
|
];
|
|
418
|
-
/** @nocollapse */
|
|
419
|
-
BreadcrumbControlService.ctorParameters = () => [];
|
|
420
|
-
if (false) {
|
|
421
|
-
/** @type {?} */
|
|
422
|
-
BreadcrumbControlService.prototype.breadcrumb;
|
|
423
|
-
}
|
|
424
|
-
|
|
425
251
|
/**
|
|
426
|
-
* @
|
|
427
|
-
*
|
|
252
|
+
* @type {function(): !Array<(null|{
|
|
253
|
+
* type: ?,
|
|
254
|
+
* decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
|
|
255
|
+
* })>}
|
|
256
|
+
* @nocollapse
|
|
428
257
|
*/
|
|
258
|
+
BreadcrumbControlService.ctorParameters = () => [];
|
|
259
|
+
|
|
429
260
|
class MenuDatasulService {
|
|
430
261
|
constructor() { }
|
|
431
262
|
/**
|
|
432
263
|
* var program = {};
|
|
433
264
|
* program['prg'] = "cd0210";
|
|
434
265
|
* program['params'] = '01|123456'
|
|
435
|
-
* @param {?} program
|
|
436
|
-
* @return {?}
|
|
437
266
|
*/
|
|
438
267
|
callProgress(program) {
|
|
439
268
|
parent.postMessage({ program }, '*');
|
|
@@ -443,22 +272,12 @@ class MenuDatasulService {
|
|
|
443
272
|
* notification['type'] = 'success';
|
|
444
273
|
* notification['title'] = 'Notification Title'
|
|
445
274
|
* notification['detail'] = 'Notification Detail'
|
|
446
|
-
* @param {?} notification
|
|
447
|
-
* @return {?}
|
|
448
275
|
*/
|
|
449
276
|
sendNotification(notification) {
|
|
450
277
|
parent.postMessage({ notification }, '*');
|
|
451
278
|
}
|
|
452
|
-
/**
|
|
453
|
-
* @param {?} programName
|
|
454
|
-
* @param {?} params
|
|
455
|
-
* @param {?=} parent
|
|
456
|
-
* @return {?}
|
|
457
|
-
*/
|
|
458
279
|
openPath(programName, params, parent = true) {
|
|
459
|
-
/** @type {?} */
|
|
460
280
|
const datasulPath = document.referrer.indexOf('totvs-menu') > 0 ? 'totvs-menu' : 'menu-html';
|
|
461
|
-
/** @type {?} */
|
|
462
281
|
let baseUrl = `/${datasulPath}/#/${datasulPath}/program-html/${programName}/#`;
|
|
463
282
|
if (params) {
|
|
464
283
|
baseUrl = `${baseUrl}/${params}`;
|
|
@@ -471,78 +290,57 @@ class MenuDatasulService {
|
|
|
471
290
|
}
|
|
472
291
|
}
|
|
473
292
|
}
|
|
293
|
+
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
474
294
|
MenuDatasulService.decorators = [
|
|
475
295
|
{ type: Injectable }
|
|
476
296
|
];
|
|
477
|
-
/** @nocollapse */
|
|
478
|
-
MenuDatasulService.ctorParameters = () => [];
|
|
479
|
-
|
|
480
297
|
/**
|
|
481
|
-
* @
|
|
482
|
-
*
|
|
298
|
+
* @type {function(): !Array<(null|{
|
|
299
|
+
* type: ?,
|
|
300
|
+
* decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
|
|
301
|
+
* })>}
|
|
302
|
+
* @nocollapse
|
|
483
303
|
*/
|
|
304
|
+
MenuDatasulService.ctorParameters = () => [];
|
|
305
|
+
|
|
484
306
|
class CacheParamsService {
|
|
485
307
|
constructor() {
|
|
486
308
|
this.values = {};
|
|
487
309
|
}
|
|
488
|
-
/**
|
|
489
|
-
* @param {?} key
|
|
490
|
-
* @param {?} value
|
|
491
|
-
* @return {?}
|
|
492
|
-
*/
|
|
493
310
|
setValue(key, value) {
|
|
494
311
|
this.values[key] = value;
|
|
495
312
|
}
|
|
496
|
-
/**
|
|
497
|
-
* @param {?} key
|
|
498
|
-
* @return {?}
|
|
499
|
-
*/
|
|
500
313
|
getValue(key) {
|
|
501
314
|
return this.values[key];
|
|
502
315
|
}
|
|
503
|
-
/**
|
|
504
|
-
* @param {?} key
|
|
505
|
-
* @return {?}
|
|
506
|
-
*/
|
|
507
316
|
removeValue(key) {
|
|
508
317
|
delete this.values[key];
|
|
509
318
|
}
|
|
510
319
|
}
|
|
320
|
+
/** @nocollapse */ CacheParamsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CacheParamsService_Factory() { return new CacheParamsService(); }, token: CacheParamsService, providedIn: "root" });
|
|
321
|
+
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
511
322
|
CacheParamsService.decorators = [
|
|
512
323
|
{ type: Injectable, args: [{
|
|
513
324
|
providedIn: 'root'
|
|
514
325
|
},] }
|
|
515
326
|
];
|
|
516
|
-
/** @nocollapse */
|
|
517
|
-
CacheParamsService.ctorParameters = () => [];
|
|
518
|
-
/** @nocollapse */ CacheParamsService.ɵprov = ɵɵdefineInjectable({ factory: function CacheParamsService_Factory() { return new CacheParamsService(); }, token: CacheParamsService, providedIn: "root" });
|
|
519
|
-
if (false) {
|
|
520
|
-
/** @type {?} */
|
|
521
|
-
CacheParamsService.prototype.values;
|
|
522
|
-
}
|
|
523
|
-
|
|
524
327
|
/**
|
|
525
|
-
* @
|
|
526
|
-
*
|
|
328
|
+
* @type {function(): !Array<(null|{
|
|
329
|
+
* type: ?,
|
|
330
|
+
* decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
|
|
331
|
+
* })>}
|
|
332
|
+
* @nocollapse
|
|
527
333
|
*/
|
|
334
|
+
CacheParamsService.ctorParameters = () => [];
|
|
335
|
+
|
|
528
336
|
class TranslateService {
|
|
529
|
-
/**
|
|
530
|
-
* @return {?}
|
|
531
|
-
*/
|
|
532
337
|
static getSuportLanguage() {
|
|
533
338
|
return ['pt-BR', 'pt', 'en-US', 'en', 'es'];
|
|
534
339
|
}
|
|
535
|
-
/**
|
|
536
|
-
* @return {?}
|
|
537
|
-
*/
|
|
538
340
|
static getDefaultCurrencyCode() {
|
|
539
341
|
return '$';
|
|
540
342
|
}
|
|
541
|
-
/**
|
|
542
|
-
* @return {?}
|
|
543
|
-
*/
|
|
544
343
|
static getCurrentLanguage() {
|
|
545
|
-
/** @type {?} */
|
|
546
344
|
const locale = localStorage.getItem('user.language') || navigator.language;
|
|
547
345
|
if (locale && this.getSuportLanguage().includes(locale)) {
|
|
548
346
|
return locale;
|
|
@@ -550,14 +348,11 @@ class TranslateService {
|
|
|
550
348
|
return 'en-US';
|
|
551
349
|
}
|
|
552
350
|
}
|
|
351
|
+
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
553
352
|
TranslateService.decorators = [
|
|
554
353
|
{ type: Injectable }
|
|
555
354
|
];
|
|
556
355
|
|
|
557
|
-
/**
|
|
558
|
-
* @fileoverview added by tsickle
|
|
559
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
560
|
-
*/
|
|
561
356
|
/*
|
|
562
357
|
Versão: 1.000
|
|
563
358
|
Data Criação: 18/04/2019
|
|
@@ -565,46 +360,24 @@ Data Criação: 18/04/2019
|
|
|
565
360
|
class DateUtil {
|
|
566
361
|
constructor() { }
|
|
567
362
|
/* Transforma data para o padrão YYYY-MM-DD */
|
|
568
|
-
/**
|
|
569
|
-
* @param {?} date
|
|
570
|
-
* @return {?}
|
|
571
|
-
*/
|
|
572
363
|
static dateToQueryParam(date) {
|
|
573
|
-
/** @type {?} */
|
|
574
364
|
const iDay = date.getDate();
|
|
575
|
-
/** @type {?} */
|
|
576
365
|
const iMonth = date.getMonth() + 1;
|
|
577
|
-
/** @type {?} */
|
|
578
366
|
const iYear = date.getFullYear();
|
|
579
367
|
return `${iYear}-${this.pad(iMonth)}-${this.pad(iDay)}`;
|
|
580
368
|
}
|
|
581
369
|
/* Transforma data no padrão YYYY-MM-DD para DATE */
|
|
582
|
-
/**
|
|
583
|
-
* @param {?} param
|
|
584
|
-
* @return {?}
|
|
585
|
-
*/
|
|
586
370
|
static queryParamToDate(param) {
|
|
587
|
-
/** @type {?} */
|
|
588
371
|
const iDay = +param.split('-')[2];
|
|
589
|
-
/** @type {?} */
|
|
590
372
|
const iMonth = +param.split('-')[1];
|
|
591
|
-
/** @type {?} */
|
|
592
373
|
const iYear = +param.split('-')[0];
|
|
593
374
|
return new Date(iYear, iMonth - 1, iDay);
|
|
594
375
|
}
|
|
595
376
|
/* Valida se foi informado uma data válida */
|
|
596
|
-
/**
|
|
597
|
-
* @param {?} date
|
|
598
|
-
* @return {?}
|
|
599
|
-
*/
|
|
600
377
|
static isValidDate(date) {
|
|
601
378
|
return date instanceof Date && !isNaN(date.getTime());
|
|
602
379
|
}
|
|
603
380
|
/* Ajusta a data retornando o padrão DATE */
|
|
604
|
-
/**
|
|
605
|
-
* @param {?} param
|
|
606
|
-
* @return {?}
|
|
607
|
-
*/
|
|
608
381
|
static ajustDate(param) {
|
|
609
382
|
if (param instanceof Date) {
|
|
610
383
|
return param;
|
|
@@ -615,31 +388,19 @@ class DateUtil {
|
|
|
615
388
|
return this.queryParamToDate(param.split('T')[0]);
|
|
616
389
|
}
|
|
617
390
|
/* Ajusta a data para o padrão DATE - utilizada nos construtores dos modelos */
|
|
618
|
-
/**
|
|
619
|
-
* @param {?=} values
|
|
620
|
-
* @param {?=} fieldName
|
|
621
|
-
* @return {?}
|
|
622
|
-
*/
|
|
623
391
|
static ajustDateToModel(values = {}, fieldName) {
|
|
624
392
|
if (values.hasOwnProperty(fieldName) && (values[fieldName])) {
|
|
625
393
|
if (values[fieldName].indexOf('T') >= 0) {
|
|
626
394
|
return new Date(values[fieldName]);
|
|
627
395
|
}
|
|
628
|
-
/** @type {?} */
|
|
629
396
|
const iDay = +values[fieldName].split('-')[2];
|
|
630
|
-
/** @type {?} */
|
|
631
397
|
const iMonth = +values[fieldName].split('-')[1];
|
|
632
|
-
/** @type {?} */
|
|
633
398
|
const iYear = +values[fieldName].split('-')[0];
|
|
634
399
|
return new Date(iYear, iMonth - 1, iDay);
|
|
635
400
|
}
|
|
636
401
|
return null;
|
|
637
402
|
}
|
|
638
403
|
/* Adicona zero a esquerda do número */
|
|
639
|
-
/**
|
|
640
|
-
* @param {?} number
|
|
641
|
-
* @return {?}
|
|
642
|
-
*/
|
|
643
404
|
static pad(number) {
|
|
644
405
|
if (number < 10) {
|
|
645
406
|
return '0' + number;
|
|
@@ -648,34 +409,17 @@ class DateUtil {
|
|
|
648
409
|
}
|
|
649
410
|
}
|
|
650
411
|
|
|
651
|
-
/**
|
|
652
|
-
* @fileoverview added by tsickle
|
|
653
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
654
|
-
*/
|
|
655
412
|
/*
|
|
656
413
|
Versão: 1.009
|
|
657
414
|
Data Criação: 06/08/2018
|
|
658
415
|
*/
|
|
659
416
|
class DisclaimerUtil {
|
|
660
|
-
/**
|
|
661
|
-
* @param {?} poNotification
|
|
662
|
-
* @param {?} poI18nPipe
|
|
663
|
-
* @param {?} literals
|
|
664
|
-
*/
|
|
665
417
|
constructor(poNotification, poI18nPipe, literals) {
|
|
666
418
|
this.literals = {};
|
|
667
419
|
this.poNotification = poNotification;
|
|
668
420
|
this.poI18nPipe = poI18nPipe;
|
|
669
421
|
this.literals = literals;
|
|
670
422
|
}
|
|
671
|
-
/**
|
|
672
|
-
* @param {?} property
|
|
673
|
-
* @param {?} value
|
|
674
|
-
* @param {?=} hideClose
|
|
675
|
-
* @param {?=} tradValue
|
|
676
|
-
* @param {?=} vldBlank
|
|
677
|
-
* @return {?}
|
|
678
|
-
*/
|
|
679
423
|
makeDisclaimer(property, value, hideClose = false, tradValue = false, vldBlank = false) {
|
|
680
424
|
if (value === null || value === undefined) {
|
|
681
425
|
return { label: '', property: '', value: '' };
|
|
@@ -690,13 +434,6 @@ class DisclaimerUtil {
|
|
|
690
434
|
value: `${value}`
|
|
691
435
|
};
|
|
692
436
|
}
|
|
693
|
-
/**
|
|
694
|
-
* @param {?} property
|
|
695
|
-
* @param {?} value
|
|
696
|
-
* @param {?=} hideClose
|
|
697
|
-
* @param {?=} vldBlank
|
|
698
|
-
* @return {?}
|
|
699
|
-
*/
|
|
700
437
|
makeDisclaimerFromNumber(property, value, hideClose = false, vldBlank = false) {
|
|
701
438
|
if (value === null || value === undefined) {
|
|
702
439
|
return { label: '', property: '', value: '' };
|
|
@@ -711,12 +448,6 @@ class DisclaimerUtil {
|
|
|
711
448
|
value: `${value}`
|
|
712
449
|
};
|
|
713
450
|
}
|
|
714
|
-
/**
|
|
715
|
-
* @param {?} property
|
|
716
|
-
* @param {?} value
|
|
717
|
-
* @param {?=} hideClose
|
|
718
|
-
* @return {?}
|
|
719
|
-
*/
|
|
720
451
|
makeDisclaimerFromBoolean(property, value, hideClose = false) {
|
|
721
452
|
if (value === null || value === undefined) {
|
|
722
453
|
return { label: '', property: '', value: '' };
|
|
@@ -728,14 +459,7 @@ class DisclaimerUtil {
|
|
|
728
459
|
value: `${value}`
|
|
729
460
|
};
|
|
730
461
|
}
|
|
731
|
-
/**
|
|
732
|
-
* @param {?} property
|
|
733
|
-
* @param {?} value
|
|
734
|
-
* @param {?=} hideClose
|
|
735
|
-
* @return {?}
|
|
736
|
-
*/
|
|
737
462
|
makeDisclaimerFromDate(property, value, hideClose = false) {
|
|
738
|
-
/** @type {?} */
|
|
739
463
|
const dDate = this.ajustDate(value);
|
|
740
464
|
if (!this.isValidDate(dDate)) {
|
|
741
465
|
return { label: '', property: '', value: '' };
|
|
@@ -747,18 +471,8 @@ class DisclaimerUtil {
|
|
|
747
471
|
value: `${this.dateToQueryParam(dDate)}`
|
|
748
472
|
};
|
|
749
473
|
}
|
|
750
|
-
/**
|
|
751
|
-
* @param {?} property
|
|
752
|
-
* @param {?} value
|
|
753
|
-
* @param {?=} length
|
|
754
|
-
* @param {?=} hideClose
|
|
755
|
-
* @param {?=} tradValue
|
|
756
|
-
* @return {?}
|
|
757
|
-
*/
|
|
758
474
|
makeDisclaimerFromMultiSelect(property, value, length = 0, hideClose = false, tradValue = false) {
|
|
759
|
-
/** @type {?} */
|
|
760
475
|
let lstLabels = '';
|
|
761
|
-
/** @type {?} */
|
|
762
476
|
let lstValues = '';
|
|
763
477
|
if (!value) {
|
|
764
478
|
return { label: '', property: '', value: '' };
|
|
@@ -768,11 +482,7 @@ class DisclaimerUtil {
|
|
|
768
482
|
lstValues = 'all';
|
|
769
483
|
}
|
|
770
484
|
else {
|
|
771
|
-
value.map(
|
|
772
|
-
* @param {?} item
|
|
773
|
-
* @return {?}
|
|
774
|
-
*/
|
|
775
|
-
item => {
|
|
485
|
+
value.map(item => {
|
|
776
486
|
if (lstLabels !== '') {
|
|
777
487
|
lstLabels = `${lstLabels}, `;
|
|
778
488
|
}
|
|
@@ -781,7 +491,7 @@ class DisclaimerUtil {
|
|
|
781
491
|
}
|
|
782
492
|
lstLabels = `${lstLabels}${tradValue ? this.literals[item] : item}`;
|
|
783
493
|
lstValues = `${lstValues}${item}`;
|
|
784
|
-
})
|
|
494
|
+
});
|
|
785
495
|
}
|
|
786
496
|
return {
|
|
787
497
|
hideClose,
|
|
@@ -790,20 +500,9 @@ class DisclaimerUtil {
|
|
|
790
500
|
value: `${lstValues}`
|
|
791
501
|
};
|
|
792
502
|
}
|
|
793
|
-
/**
|
|
794
|
-
* @param {?} property
|
|
795
|
-
* @param {?} value
|
|
796
|
-
* @param {?} options
|
|
797
|
-
* @param {?=} length
|
|
798
|
-
* @param {?=} hideClose
|
|
799
|
-
* @return {?}
|
|
800
|
-
*/
|
|
801
503
|
makeDisclaimerFromMultiSelectNumber(property, value, options, length = 0, hideClose = false) {
|
|
802
|
-
/** @type {?} */
|
|
803
504
|
let lstLabels = '';
|
|
804
|
-
/** @type {?} */
|
|
805
505
|
let lstValues = '';
|
|
806
|
-
/** @type {?} */
|
|
807
506
|
let opt = null;
|
|
808
507
|
if (!value || !options) {
|
|
809
508
|
return { label: '', property: '', value: '' };
|
|
@@ -813,25 +512,17 @@ class DisclaimerUtil {
|
|
|
813
512
|
lstValues = 'all';
|
|
814
513
|
}
|
|
815
514
|
else {
|
|
816
|
-
value.map(
|
|
817
|
-
* @param {?} item
|
|
818
|
-
* @return {?}
|
|
819
|
-
*/
|
|
820
|
-
item => {
|
|
515
|
+
value.map(item => {
|
|
821
516
|
if (lstLabels !== '') {
|
|
822
517
|
lstLabels = `${lstLabels}, `;
|
|
823
518
|
}
|
|
824
519
|
if (lstValues !== '') {
|
|
825
520
|
lstValues = `${lstValues},`;
|
|
826
521
|
}
|
|
827
|
-
opt = options.find(
|
|
828
|
-
* @param {?} itOpt
|
|
829
|
-
* @return {?}
|
|
830
|
-
*/
|
|
831
|
-
itOpt => itOpt.value === item));
|
|
522
|
+
opt = options.find(itOpt => itOpt.value === item);
|
|
832
523
|
lstLabels = `${lstLabels}${opt ? opt.label : item}`;
|
|
833
524
|
lstValues = `${lstValues}${item}`;
|
|
834
|
-
})
|
|
525
|
+
});
|
|
835
526
|
}
|
|
836
527
|
return {
|
|
837
528
|
hideClose,
|
|
@@ -840,17 +531,8 @@ class DisclaimerUtil {
|
|
|
840
531
|
value: `${lstValues}`
|
|
841
532
|
};
|
|
842
533
|
}
|
|
843
|
-
/**
|
|
844
|
-
* @param {?} property
|
|
845
|
-
* @param {?} value
|
|
846
|
-
* @param {?=} length
|
|
847
|
-
* @param {?=} hideClose
|
|
848
|
-
* @return {?}
|
|
849
|
-
*/
|
|
850
534
|
makeDisclaimerFromCheckboxGroup(property, value, length = 0, hideClose = false) {
|
|
851
|
-
/** @type {?} */
|
|
852
535
|
let lstLabels = '';
|
|
853
|
-
/** @type {?} */
|
|
854
536
|
let lstValues = '';
|
|
855
537
|
if (!value) {
|
|
856
538
|
return { label: '', property: '', value: '' };
|
|
@@ -864,11 +546,7 @@ class DisclaimerUtil {
|
|
|
864
546
|
lstValues = 'all';
|
|
865
547
|
}
|
|
866
548
|
else {
|
|
867
|
-
value.map(
|
|
868
|
-
* @param {?} checkParam
|
|
869
|
-
* @return {?}
|
|
870
|
-
*/
|
|
871
|
-
checkParam => {
|
|
549
|
+
value.map(checkParam => {
|
|
872
550
|
if (lstLabels !== '') {
|
|
873
551
|
lstLabels = `${lstLabels}, `;
|
|
874
552
|
}
|
|
@@ -877,7 +555,7 @@ class DisclaimerUtil {
|
|
|
877
555
|
}
|
|
878
556
|
lstLabels = `${lstLabels}${this.literals[checkParam]}`;
|
|
879
557
|
lstValues = `${lstValues}${checkParam}`;
|
|
880
|
-
})
|
|
558
|
+
});
|
|
881
559
|
}
|
|
882
560
|
return {
|
|
883
561
|
hideClose,
|
|
@@ -886,13 +564,6 @@ class DisclaimerUtil {
|
|
|
886
564
|
value: `${lstValues}`
|
|
887
565
|
};
|
|
888
566
|
}
|
|
889
|
-
/**
|
|
890
|
-
* @param {?} property
|
|
891
|
-
* @param {?} value
|
|
892
|
-
* @param {?=} hideClose
|
|
893
|
-
* @param {?=} validateEqual
|
|
894
|
-
* @return {?}
|
|
895
|
-
*/
|
|
896
567
|
makeDisclaimerFromRangeCharacter(property, value, hideClose = false, validateEqual = true) {
|
|
897
568
|
if (value.valInitial === null || value.valInitial === undefined) {
|
|
898
569
|
value.valInitial = value.iniInitial;
|
|
@@ -912,13 +583,6 @@ class DisclaimerUtil {
|
|
|
912
583
|
value: `${value.valInitial};${value.valFinal}`
|
|
913
584
|
};
|
|
914
585
|
}
|
|
915
|
-
/**
|
|
916
|
-
* @param {?} property
|
|
917
|
-
* @param {?} value
|
|
918
|
-
* @param {?=} hideClose
|
|
919
|
-
* @param {?=} validateEqual
|
|
920
|
-
* @return {?}
|
|
921
|
-
*/
|
|
922
586
|
makeDisclaimerFromRangeNumber(property, value, hideClose = false, validateEqual = true) {
|
|
923
587
|
if (value.valInitial === null || value.valInitial === undefined) {
|
|
924
588
|
value.valInitial = value.iniInitial;
|
|
@@ -938,17 +602,8 @@ class DisclaimerUtil {
|
|
|
938
602
|
value: `${value.valInitial};${value.valFinal}`
|
|
939
603
|
};
|
|
940
604
|
}
|
|
941
|
-
/**
|
|
942
|
-
* @param {?} property
|
|
943
|
-
* @param {?} value
|
|
944
|
-
* @param {?=} hideClose
|
|
945
|
-
* @param {?=} validateEqual
|
|
946
|
-
* @return {?}
|
|
947
|
-
*/
|
|
948
605
|
makeDisclaimerFromRangeDate(property, value, hideClose = false, validateEqual = true) {
|
|
949
|
-
/** @type {?} */
|
|
950
606
|
let valInitDate = this.ajustDate(value.valInitial);
|
|
951
|
-
/** @type {?} */
|
|
952
607
|
let valFinalDate = this.ajustDate(value.valFinal);
|
|
953
608
|
if (!this.isValidDate(valInitDate)) {
|
|
954
609
|
valInitDate = value.iniInitial;
|
|
@@ -970,21 +625,10 @@ class DisclaimerUtil {
|
|
|
970
625
|
value: `${this.dateToQueryParam(valInitDate)};${this.dateToQueryParam(valFinalDate)}`
|
|
971
626
|
};
|
|
972
627
|
}
|
|
973
|
-
/**
|
|
974
|
-
* @param {?} disclaimers
|
|
975
|
-
* @param {?} property
|
|
976
|
-
* @param {?} defaultValue
|
|
977
|
-
* @return {?}
|
|
978
|
-
*/
|
|
979
628
|
atzCharFromDisclamer(disclaimers, property, defaultValue) {
|
|
980
|
-
/** @type {?} */
|
|
981
629
|
let returnValue = defaultValue;
|
|
982
630
|
if (disclaimers && disclaimers.length > 0) {
|
|
983
|
-
disclaimers.find((
|
|
984
|
-
* @param {?} item
|
|
985
|
-
* @return {?}
|
|
986
|
-
*/
|
|
987
|
-
(item) => {
|
|
631
|
+
disclaimers.find((item) => {
|
|
988
632
|
if (item.property === property) {
|
|
989
633
|
if (item.value === null) {
|
|
990
634
|
return false;
|
|
@@ -993,25 +637,14 @@ class DisclaimerUtil {
|
|
|
993
637
|
return true;
|
|
994
638
|
}
|
|
995
639
|
return false;
|
|
996
|
-
})
|
|
640
|
+
});
|
|
997
641
|
}
|
|
998
642
|
return returnValue;
|
|
999
643
|
}
|
|
1000
|
-
/**
|
|
1001
|
-
* @param {?} disclaimers
|
|
1002
|
-
* @param {?} property
|
|
1003
|
-
* @param {?} defaultValue
|
|
1004
|
-
* @return {?}
|
|
1005
|
-
*/
|
|
1006
644
|
atzNumberFromDisclamer(disclaimers, property, defaultValue) {
|
|
1007
|
-
/** @type {?} */
|
|
1008
645
|
let returnValue = defaultValue;
|
|
1009
646
|
if (disclaimers && disclaimers.length > 0) {
|
|
1010
|
-
disclaimers.find((
|
|
1011
|
-
* @param {?} item
|
|
1012
|
-
* @return {?}
|
|
1013
|
-
*/
|
|
1014
|
-
(item) => {
|
|
647
|
+
disclaimers.find((item) => {
|
|
1015
648
|
if (item.property === property) {
|
|
1016
649
|
if (item.value === null) {
|
|
1017
650
|
return false;
|
|
@@ -1020,26 +653,14 @@ class DisclaimerUtil {
|
|
|
1020
653
|
return true;
|
|
1021
654
|
}
|
|
1022
655
|
return false;
|
|
1023
|
-
})
|
|
656
|
+
});
|
|
1024
657
|
}
|
|
1025
658
|
return returnValue;
|
|
1026
659
|
}
|
|
1027
|
-
/**
|
|
1028
|
-
* @param {?} disclaimers
|
|
1029
|
-
* @param {?} property
|
|
1030
|
-
* @param {?} defaultValue
|
|
1031
|
-
* @return {?}
|
|
1032
|
-
*/
|
|
1033
660
|
atzBooleanFromDisclamer(disclaimers, property, defaultValue) {
|
|
1034
|
-
/** @type {?} */
|
|
1035
661
|
const returnValue = defaultValue;
|
|
1036
662
|
if (disclaimers && disclaimers.length > 0) {
|
|
1037
|
-
|
|
1038
|
-
const disclaimerFind = disclaimers.find((/**
|
|
1039
|
-
* @param {?} item
|
|
1040
|
-
* @return {?}
|
|
1041
|
-
*/
|
|
1042
|
-
(item) => item.property === property));
|
|
663
|
+
const disclaimerFind = disclaimers.find((item) => item.property === property);
|
|
1043
664
|
if (disclaimerFind && disclaimerFind.value !== null && disclaimerFind.value !== undefined) {
|
|
1044
665
|
if (disclaimerFind.value === 'true') {
|
|
1045
666
|
return true;
|
|
@@ -1051,21 +672,10 @@ class DisclaimerUtil {
|
|
|
1051
672
|
}
|
|
1052
673
|
return returnValue;
|
|
1053
674
|
}
|
|
1054
|
-
/**
|
|
1055
|
-
* @param {?} disclaimers
|
|
1056
|
-
* @param {?} property
|
|
1057
|
-
* @param {?} defaultValue
|
|
1058
|
-
* @return {?}
|
|
1059
|
-
*/
|
|
1060
675
|
atzDateFromDisclamer(disclaimers, property, defaultValue) {
|
|
1061
|
-
/** @type {?} */
|
|
1062
676
|
let returnValue = this.ajustDate(defaultValue);
|
|
1063
677
|
if (disclaimers && disclaimers.length > 0) {
|
|
1064
|
-
disclaimers.find((
|
|
1065
|
-
* @param {?} item
|
|
1066
|
-
* @return {?}
|
|
1067
|
-
*/
|
|
1068
|
-
(item) => {
|
|
678
|
+
disclaimers.find((item) => {
|
|
1069
679
|
if (item.property === property) {
|
|
1070
680
|
if (item.value === null) {
|
|
1071
681
|
return false;
|
|
@@ -1074,131 +684,69 @@ class DisclaimerUtil {
|
|
|
1074
684
|
return true;
|
|
1075
685
|
}
|
|
1076
686
|
return false;
|
|
1077
|
-
})
|
|
687
|
+
});
|
|
1078
688
|
}
|
|
1079
689
|
return returnValue;
|
|
1080
690
|
}
|
|
1081
|
-
/**
|
|
1082
|
-
* @param {?} disclaimers
|
|
1083
|
-
* @param {?} property
|
|
1084
|
-
* @param {?} defaultValue
|
|
1085
|
-
* @return {?}
|
|
1086
|
-
*/
|
|
1087
691
|
atzMultiSelectCharFromDisclamer(disclaimers, property, defaultValue) {
|
|
1088
692
|
return this.atzMultiSelectFromDisclamer('char', disclaimers, property, defaultValue);
|
|
1089
693
|
}
|
|
1090
|
-
/**
|
|
1091
|
-
* @param {?} disclaimers
|
|
1092
|
-
* @param {?} property
|
|
1093
|
-
* @param {?} defaultValue
|
|
1094
|
-
* @return {?}
|
|
1095
|
-
*/
|
|
1096
694
|
atzMultiSelectNumberFromDisclamer(disclaimers, property, defaultValue) {
|
|
1097
695
|
return this.atzMultiSelectFromDisclamer('number', disclaimers, property, defaultValue);
|
|
1098
696
|
}
|
|
1099
|
-
/**
|
|
1100
|
-
* @param {?} type
|
|
1101
|
-
* @param {?} disclaimers
|
|
1102
|
-
* @param {?} property
|
|
1103
|
-
* @param {?} defaultValue
|
|
1104
|
-
* @return {?}
|
|
1105
|
-
*/
|
|
1106
697
|
atzMultiSelectFromDisclamer(type, disclaimers, property, defaultValue) {
|
|
1107
|
-
/** @type {?} */
|
|
1108
698
|
let returnValue = [];
|
|
1109
|
-
defaultValue.map(
|
|
1110
|
-
* @param {?} item
|
|
1111
|
-
* @return {?}
|
|
1112
|
-
*/
|
|
1113
|
-
item => {
|
|
699
|
+
defaultValue.map(item => {
|
|
1114
700
|
returnValue.push(item.value);
|
|
1115
|
-
})
|
|
701
|
+
});
|
|
1116
702
|
if (disclaimers && disclaimers.length > 0) {
|
|
1117
|
-
disclaimers.find((
|
|
1118
|
-
* @param {?} item
|
|
1119
|
-
* @return {?}
|
|
1120
|
-
*/
|
|
1121
|
-
(item) => {
|
|
703
|
+
disclaimers.find((item) => {
|
|
1122
704
|
if (item.property === property) {
|
|
1123
705
|
if (item.value === null || item.value === 'all' || item.value === 'none') {
|
|
1124
706
|
return false;
|
|
1125
707
|
}
|
|
1126
708
|
returnValue = [];
|
|
1127
|
-
item.value.split(',').forEach(
|
|
1128
|
-
* @param {?} itemOpt
|
|
1129
|
-
* @return {?}
|
|
1130
|
-
*/
|
|
1131
|
-
itemOpt => {
|
|
709
|
+
item.value.split(',').forEach(itemOpt => {
|
|
1132
710
|
if (type === 'char') {
|
|
1133
711
|
returnValue.push(itemOpt);
|
|
1134
712
|
}
|
|
1135
713
|
if (type === 'number') {
|
|
1136
714
|
returnValue.push(+itemOpt);
|
|
1137
715
|
}
|
|
1138
|
-
})
|
|
716
|
+
});
|
|
1139
717
|
return true;
|
|
1140
718
|
}
|
|
1141
719
|
return false;
|
|
1142
|
-
})
|
|
720
|
+
});
|
|
1143
721
|
}
|
|
1144
722
|
return returnValue;
|
|
1145
723
|
}
|
|
1146
|
-
/**
|
|
1147
|
-
* @param {?} disclaimers
|
|
1148
|
-
* @param {?} property
|
|
1149
|
-
* @param {?} options
|
|
1150
|
-
* @return {?}
|
|
1151
|
-
*/
|
|
1152
724
|
atzCheckboxFromDisclamer(disclaimers, property, options) {
|
|
1153
|
-
/** @type {?} */
|
|
1154
725
|
let returnValue = [];
|
|
1155
|
-
options.map(
|
|
1156
|
-
* @param {?} item
|
|
1157
|
-
* @return {?}
|
|
1158
|
-
*/
|
|
1159
|
-
item => {
|
|
726
|
+
options.map(item => {
|
|
1160
727
|
returnValue.push(item.value);
|
|
1161
|
-
})
|
|
728
|
+
});
|
|
1162
729
|
if (disclaimers && disclaimers.length > 0) {
|
|
1163
|
-
disclaimers.find((
|
|
1164
|
-
* @param {?} item
|
|
1165
|
-
* @return {?}
|
|
1166
|
-
*/
|
|
1167
|
-
(item) => {
|
|
730
|
+
disclaimers.find((item) => {
|
|
1168
731
|
if (item.property === property) {
|
|
1169
732
|
if (item.value === null || item.value === 'all' || item.value === 'none') {
|
|
1170
733
|
return false;
|
|
1171
734
|
}
|
|
1172
735
|
returnValue = [];
|
|
1173
|
-
item.value.split(',').forEach(
|
|
1174
|
-
* @param {?} itemOpt
|
|
1175
|
-
* @return {?}
|
|
1176
|
-
*/
|
|
1177
|
-
itemOpt => {
|
|
736
|
+
item.value.split(',').forEach(itemOpt => {
|
|
1178
737
|
returnValue.push(itemOpt);
|
|
1179
|
-
})
|
|
738
|
+
});
|
|
1180
739
|
return true;
|
|
1181
740
|
}
|
|
1182
741
|
return false;
|
|
1183
|
-
})
|
|
742
|
+
});
|
|
1184
743
|
}
|
|
1185
744
|
return returnValue;
|
|
1186
745
|
}
|
|
1187
|
-
/**
|
|
1188
|
-
* @param {?} disclaimers
|
|
1189
|
-
* @param {?} property
|
|
1190
|
-
* @param {?} rangeChar
|
|
1191
|
-
* @return {?}
|
|
1192
|
-
*/
|
|
1193
746
|
atzRangeCharFromDisclamer(disclaimers, property, rangeChar) {
|
|
1194
|
-
/** @type {?} */
|
|
1195
747
|
let value = '';
|
|
1196
748
|
if (disclaimers && disclaimers.length > 0) {
|
|
1197
|
-
disclaimers.find((
|
|
1198
|
-
* @param {?} item
|
|
1199
|
-
* @return {?}
|
|
1200
|
-
*/
|
|
1201
|
-
(item) => {
|
|
749
|
+
disclaimers.find((item) => {
|
|
1202
750
|
if (item.property === property) {
|
|
1203
751
|
if (item.value === null) {
|
|
1204
752
|
return false;
|
|
@@ -1207,25 +755,14 @@ class DisclaimerUtil {
|
|
|
1207
755
|
return true;
|
|
1208
756
|
}
|
|
1209
757
|
return false;
|
|
1210
|
-
})
|
|
758
|
+
});
|
|
1211
759
|
}
|
|
1212
760
|
return this.atzRangeCharFromQueryParam(value, rangeChar);
|
|
1213
761
|
}
|
|
1214
|
-
/**
|
|
1215
|
-
* @param {?} disclaimers
|
|
1216
|
-
* @param {?} property
|
|
1217
|
-
* @param {?} rangeNum
|
|
1218
|
-
* @return {?}
|
|
1219
|
-
*/
|
|
1220
762
|
atzRangeNumFromDisclamer(disclaimers, property, rangeNum) {
|
|
1221
|
-
/** @type {?} */
|
|
1222
763
|
let value = '';
|
|
1223
764
|
if (disclaimers && disclaimers.length > 0) {
|
|
1224
|
-
disclaimers.find((
|
|
1225
|
-
* @param {?} item
|
|
1226
|
-
* @return {?}
|
|
1227
|
-
*/
|
|
1228
|
-
(item) => {
|
|
765
|
+
disclaimers.find((item) => {
|
|
1229
766
|
if (item.property === property) {
|
|
1230
767
|
if (item.value === null) {
|
|
1231
768
|
return false;
|
|
@@ -1234,25 +771,14 @@ class DisclaimerUtil {
|
|
|
1234
771
|
return true;
|
|
1235
772
|
}
|
|
1236
773
|
return false;
|
|
1237
|
-
})
|
|
774
|
+
});
|
|
1238
775
|
}
|
|
1239
776
|
return this.atzRangeNumFromQueryParam(value, rangeNum);
|
|
1240
777
|
}
|
|
1241
|
-
/**
|
|
1242
|
-
* @param {?} disclaimers
|
|
1243
|
-
* @param {?} property
|
|
1244
|
-
* @param {?} rangeDate
|
|
1245
|
-
* @return {?}
|
|
1246
|
-
*/
|
|
1247
778
|
atzRangeDateFromDisclamer(disclaimers, property, rangeDate) {
|
|
1248
|
-
/** @type {?} */
|
|
1249
779
|
let value = '';
|
|
1250
780
|
if (disclaimers && disclaimers.length > 0) {
|
|
1251
|
-
disclaimers.find((
|
|
1252
|
-
* @param {?} item
|
|
1253
|
-
* @return {?}
|
|
1254
|
-
*/
|
|
1255
|
-
(item) => {
|
|
781
|
+
disclaimers.find((item) => {
|
|
1256
782
|
if (item.property === property) {
|
|
1257
783
|
if (item.value === null) {
|
|
1258
784
|
return false;
|
|
@@ -1261,15 +787,10 @@ class DisclaimerUtil {
|
|
|
1261
787
|
return true;
|
|
1262
788
|
}
|
|
1263
789
|
return false;
|
|
1264
|
-
})
|
|
790
|
+
});
|
|
1265
791
|
}
|
|
1266
792
|
return this.atzRangeDateFromQueryParam(value, rangeDate);
|
|
1267
793
|
}
|
|
1268
|
-
/**
|
|
1269
|
-
* @param {?} value
|
|
1270
|
-
* @param {?} rangeChar
|
|
1271
|
-
* @return {?}
|
|
1272
|
-
*/
|
|
1273
794
|
atzRangeCharFromQueryParam(value, rangeChar) {
|
|
1274
795
|
rangeChar.valInitial = rangeChar.iniInitial;
|
|
1275
796
|
rangeChar.valFinal = rangeChar.iniFinal;
|
|
@@ -1283,11 +804,6 @@ class DisclaimerUtil {
|
|
|
1283
804
|
}
|
|
1284
805
|
return rangeChar;
|
|
1285
806
|
}
|
|
1286
|
-
/**
|
|
1287
|
-
* @param {?} value
|
|
1288
|
-
* @param {?} rangeNum
|
|
1289
|
-
* @return {?}
|
|
1290
|
-
*/
|
|
1291
807
|
atzRangeNumFromQueryParam(value, rangeNum) {
|
|
1292
808
|
rangeNum.valInitial = rangeNum.iniInitial;
|
|
1293
809
|
rangeNum.valFinal = rangeNum.iniFinal;
|
|
@@ -1301,11 +817,6 @@ class DisclaimerUtil {
|
|
|
1301
817
|
}
|
|
1302
818
|
return rangeNum;
|
|
1303
819
|
}
|
|
1304
|
-
/**
|
|
1305
|
-
* @param {?} value
|
|
1306
|
-
* @param {?} rangeDate
|
|
1307
|
-
* @return {?}
|
|
1308
|
-
*/
|
|
1309
820
|
atzRangeDateFromQueryParam(value, rangeDate) {
|
|
1310
821
|
rangeDate.valInitial = rangeDate.iniInitial;
|
|
1311
822
|
rangeDate.valFinal = rangeDate.iniFinal;
|
|
@@ -1319,43 +830,21 @@ class DisclaimerUtil {
|
|
|
1319
830
|
}
|
|
1320
831
|
return rangeDate;
|
|
1321
832
|
}
|
|
1322
|
-
/**
|
|
1323
|
-
* @param {?} date
|
|
1324
|
-
* @return {?}
|
|
1325
|
-
*/
|
|
1326
833
|
dateToQueryParam(date) {
|
|
1327
|
-
/** @type {?} */
|
|
1328
834
|
const iDay = date.getDate();
|
|
1329
|
-
/** @type {?} */
|
|
1330
835
|
const iMonth = date.getMonth() + 1;
|
|
1331
|
-
/** @type {?} */
|
|
1332
836
|
const iYear = date.getFullYear();
|
|
1333
837
|
return `${iYear}-${this.pad(iMonth)}-${this.pad(iDay)}`;
|
|
1334
838
|
}
|
|
1335
|
-
/**
|
|
1336
|
-
* @param {?} param
|
|
1337
|
-
* @return {?}
|
|
1338
|
-
*/
|
|
1339
839
|
queryParamToDate(param) {
|
|
1340
|
-
/** @type {?} */
|
|
1341
840
|
const iDay = +param.split('-')[2];
|
|
1342
|
-
/** @type {?} */
|
|
1343
841
|
const iMonth = +param.split('-')[1];
|
|
1344
|
-
/** @type {?} */
|
|
1345
842
|
const iYear = +param.split('-')[0];
|
|
1346
843
|
return new Date(iYear, iMonth - 1, iDay);
|
|
1347
844
|
}
|
|
1348
|
-
/**
|
|
1349
|
-
* @param {?} date
|
|
1350
|
-
* @return {?}
|
|
1351
|
-
*/
|
|
1352
845
|
isValidDate(date) {
|
|
1353
846
|
return date instanceof Date && !isNaN(date.getTime());
|
|
1354
847
|
}
|
|
1355
|
-
/**
|
|
1356
|
-
* @param {?} param
|
|
1357
|
-
* @return {?}
|
|
1358
|
-
*/
|
|
1359
848
|
ajustDate(param) {
|
|
1360
849
|
if (param instanceof Date) {
|
|
1361
850
|
return param;
|
|
@@ -1365,36 +854,19 @@ class DisclaimerUtil {
|
|
|
1365
854
|
}
|
|
1366
855
|
return this.queryParamToDate(param.split('T')[0]);
|
|
1367
856
|
}
|
|
1368
|
-
/**
|
|
1369
|
-
* @param {?} number
|
|
1370
|
-
* @return {?}
|
|
1371
|
-
*/
|
|
1372
857
|
pad(number) {
|
|
1373
858
|
if (number < 10) {
|
|
1374
859
|
return '0' + number;
|
|
1375
860
|
}
|
|
1376
861
|
return number;
|
|
1377
862
|
}
|
|
1378
|
-
}
|
|
1379
|
-
if (false) {
|
|
1380
|
-
/** @type {?} */
|
|
1381
|
-
DisclaimerUtil.prototype.poNotification;
|
|
1382
|
-
/** @type {?} */
|
|
1383
|
-
DisclaimerUtil.prototype.poI18nPipe;
|
|
1384
|
-
/** @type {?} */
|
|
1385
|
-
DisclaimerUtil.prototype.literals;
|
|
1386
863
|
}
|
|
1387
864
|
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
865
|
+
/*
|
|
866
|
+
Versão: 1.002
|
|
867
|
+
Data Criação: 19/02/2019
|
|
868
|
+
*/
|
|
1392
869
|
class FieldValidationUtil {
|
|
1393
|
-
/**
|
|
1394
|
-
* @param {?} poNotification
|
|
1395
|
-
* @param {?} poI18nPipe
|
|
1396
|
-
* @param {?} literals
|
|
1397
|
-
*/
|
|
1398
870
|
constructor(poNotification, poI18nPipe, literals) {
|
|
1399
871
|
this.literals = {};
|
|
1400
872
|
this.poNotification = poNotification;
|
|
@@ -1402,11 +874,6 @@ class FieldValidationUtil {
|
|
|
1402
874
|
this.literals = literals;
|
|
1403
875
|
this.disclaimerUtil = new DisclaimerUtil(this.poNotification, this.poI18nPipe, this.literals);
|
|
1404
876
|
}
|
|
1405
|
-
/**
|
|
1406
|
-
* @param {?} field
|
|
1407
|
-
* @param {?} value
|
|
1408
|
-
* @return {?}
|
|
1409
|
-
*/
|
|
1410
877
|
vldFieldCharacter(field, value) {
|
|
1411
878
|
if (!value || value.trim() === '') {
|
|
1412
879
|
this.poNotification.error({
|
|
@@ -1417,13 +884,6 @@ class FieldValidationUtil {
|
|
|
1417
884
|
return true;
|
|
1418
885
|
}
|
|
1419
886
|
// Valida uma faixa de caracteres se o inicial é menor que final
|
|
1420
|
-
/**
|
|
1421
|
-
* @param {?} initialField
|
|
1422
|
-
* @param {?} finalField
|
|
1423
|
-
* @param {?} initialValue
|
|
1424
|
-
* @param {?} finalValue
|
|
1425
|
-
* @return {?}
|
|
1426
|
-
*/
|
|
1427
887
|
vldRangeCharacter(initialField, finalField, initialValue, finalValue) {
|
|
1428
888
|
if (!initialValue || !finalValue) {
|
|
1429
889
|
return true;
|
|
@@ -1436,13 +896,6 @@ class FieldValidationUtil {
|
|
|
1436
896
|
}
|
|
1437
897
|
return true;
|
|
1438
898
|
}
|
|
1439
|
-
/**
|
|
1440
|
-
* @param {?} field
|
|
1441
|
-
* @param {?} value
|
|
1442
|
-
* @param {?=} vldValue
|
|
1443
|
-
* @param {?=} zeroAccept
|
|
1444
|
-
* @return {?}
|
|
1445
|
-
*/
|
|
1446
899
|
vldFieldNumber(field, value, vldValue = false, zeroAccept = false) {
|
|
1447
900
|
if (vldValue && !this.vldValueOfNumber(field, value)) {
|
|
1448
901
|
return false;
|
|
@@ -1458,11 +911,6 @@ class FieldValidationUtil {
|
|
|
1458
911
|
}
|
|
1459
912
|
return true;
|
|
1460
913
|
}
|
|
1461
|
-
/**
|
|
1462
|
-
* @param {?} field
|
|
1463
|
-
* @param {?} value
|
|
1464
|
-
* @return {?}
|
|
1465
|
-
*/
|
|
1466
914
|
vldValueOfNumber(field, value) {
|
|
1467
915
|
if (value && value < 0) {
|
|
1468
916
|
this.poNotification.error({ message: this.poI18nPipe.transform(this.literals['fieldVldNumber'], [value.toString(), this.literals[field]]) });
|
|
@@ -1470,12 +918,6 @@ class FieldValidationUtil {
|
|
|
1470
918
|
}
|
|
1471
919
|
return true;
|
|
1472
920
|
}
|
|
1473
|
-
/**
|
|
1474
|
-
* @param {?} field
|
|
1475
|
-
* @param {?} value
|
|
1476
|
-
* @param {?=} vldValue
|
|
1477
|
-
* @return {?}
|
|
1478
|
-
*/
|
|
1479
921
|
vldFieldPercent(field, value, vldValue = false) {
|
|
1480
922
|
if (vldValue && !this.vldValueOfPercent(field, value)) {
|
|
1481
923
|
return false;
|
|
@@ -1485,11 +927,6 @@ class FieldValidationUtil {
|
|
|
1485
927
|
}
|
|
1486
928
|
return true;
|
|
1487
929
|
}
|
|
1488
|
-
/**
|
|
1489
|
-
* @param {?} field
|
|
1490
|
-
* @param {?} value
|
|
1491
|
-
* @return {?}
|
|
1492
|
-
*/
|
|
1493
930
|
vldValueOfPercent(field, value) {
|
|
1494
931
|
if (value && value < 0) {
|
|
1495
932
|
this.poNotification.error({ message: this.poI18nPipe.transform(this.literals['fieldVldNumber'], [value.toString(), this.literals[field]]) });
|
|
@@ -1502,13 +939,6 @@ class FieldValidationUtil {
|
|
|
1502
939
|
return true;
|
|
1503
940
|
}
|
|
1504
941
|
// Valida uma faixa de números se o inicial é menor que final
|
|
1505
|
-
/**
|
|
1506
|
-
* @param {?} initialField
|
|
1507
|
-
* @param {?} finalField
|
|
1508
|
-
* @param {?} initialValue
|
|
1509
|
-
* @param {?} finalValue
|
|
1510
|
-
* @return {?}
|
|
1511
|
-
*/
|
|
1512
942
|
vldRangeNumber(initialField, finalField, initialValue, finalValue) {
|
|
1513
943
|
if (!initialValue) {
|
|
1514
944
|
initialValue = 0;
|
|
@@ -1524,13 +954,7 @@ class FieldValidationUtil {
|
|
|
1524
954
|
}
|
|
1525
955
|
return true;
|
|
1526
956
|
}
|
|
1527
|
-
/**
|
|
1528
|
-
* @param {?} field
|
|
1529
|
-
* @param {?} value
|
|
1530
|
-
* @return {?}
|
|
1531
|
-
*/
|
|
1532
957
|
vldFieldDate(field, value) {
|
|
1533
|
-
/** @type {?} */
|
|
1534
958
|
const valDate = this.disclaimerUtil.ajustDate(value);
|
|
1535
959
|
if (!this.disclaimerUtil.isValidDate(valDate)) {
|
|
1536
960
|
this.poNotification.error({
|
|
@@ -1541,20 +965,11 @@ class FieldValidationUtil {
|
|
|
1541
965
|
return true;
|
|
1542
966
|
}
|
|
1543
967
|
// Valida uma faixa de datas se o inicial é menor que final
|
|
1544
|
-
/**
|
|
1545
|
-
* @param {?} initialField
|
|
1546
|
-
* @param {?} finalField
|
|
1547
|
-
* @param {?} initialValue
|
|
1548
|
-
* @param {?} finalValue
|
|
1549
|
-
* @return {?}
|
|
1550
|
-
*/
|
|
1551
968
|
vldRangeDate(initialField, finalField, initialValue, finalValue) {
|
|
1552
969
|
if (!initialValue || !finalValue) {
|
|
1553
970
|
return true;
|
|
1554
971
|
}
|
|
1555
|
-
/** @type {?} */
|
|
1556
972
|
const valInitialDate = this.disclaimerUtil.ajustDate(initialValue).getTime();
|
|
1557
|
-
/** @type {?} */
|
|
1558
973
|
const valFinalDate = this.disclaimerUtil.ajustDate(finalValue).getTime();
|
|
1559
974
|
if (valInitialDate > valFinalDate) {
|
|
1560
975
|
this.poNotification.error({
|
|
@@ -1564,11 +979,6 @@ class FieldValidationUtil {
|
|
|
1564
979
|
}
|
|
1565
980
|
return true;
|
|
1566
981
|
}
|
|
1567
|
-
/**
|
|
1568
|
-
* @param {?} field
|
|
1569
|
-
* @param {?} value
|
|
1570
|
-
* @return {?}
|
|
1571
|
-
*/
|
|
1572
982
|
vldFieldMultiSelect(field, value) {
|
|
1573
983
|
if (!value || value.length === 0) {
|
|
1574
984
|
this.poNotification.error({
|
|
@@ -1578,11 +988,6 @@ class FieldValidationUtil {
|
|
|
1578
988
|
}
|
|
1579
989
|
return true;
|
|
1580
990
|
}
|
|
1581
|
-
/**
|
|
1582
|
-
* @param {?} field
|
|
1583
|
-
* @param {?} value
|
|
1584
|
-
* @return {?}
|
|
1585
|
-
*/
|
|
1586
991
|
vldFieldCheckbox(field, value) {
|
|
1587
992
|
if (!value || value.length === 0) {
|
|
1588
993
|
this.poNotification.error({
|
|
@@ -1593,17 +998,8 @@ class FieldValidationUtil {
|
|
|
1593
998
|
return true;
|
|
1594
999
|
}
|
|
1595
1000
|
// Valida formato conforme regra: "9" apenas números, "X" qualquer caracter, "!" apenas letras maiúsculas
|
|
1596
|
-
/**
|
|
1597
|
-
* @param {?} field
|
|
1598
|
-
* @param {?} value
|
|
1599
|
-
* @param {?} format
|
|
1600
|
-
* @param {?=} replacePoint
|
|
1601
|
-
* @return {?}
|
|
1602
|
-
*/
|
|
1603
1001
|
vldFieldFormat(field, value, format, replacePoint = false) {
|
|
1604
|
-
/** @type {?} */
|
|
1605
1002
|
let lOK = true;
|
|
1606
|
-
/** @type {?} */
|
|
1607
1003
|
let oldFormat;
|
|
1608
1004
|
if (!value) {
|
|
1609
1005
|
return lOK;
|
|
@@ -1642,22 +1038,8 @@ class FieldValidationUtil {
|
|
|
1642
1038
|
}
|
|
1643
1039
|
return lOK;
|
|
1644
1040
|
}
|
|
1645
|
-
}
|
|
1646
|
-
if (false) {
|
|
1647
|
-
/** @type {?} */
|
|
1648
|
-
FieldValidationUtil.prototype.poNotification;
|
|
1649
|
-
/** @type {?} */
|
|
1650
|
-
FieldValidationUtil.prototype.poI18nPipe;
|
|
1651
|
-
/** @type {?} */
|
|
1652
|
-
FieldValidationUtil.prototype.literals;
|
|
1653
|
-
/** @type {?} */
|
|
1654
|
-
FieldValidationUtil.prototype.disclaimerUtil;
|
|
1655
1041
|
}
|
|
1656
1042
|
|
|
1657
|
-
/**
|
|
1658
|
-
* @fileoverview added by tsickle
|
|
1659
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1660
|
-
*/
|
|
1661
1043
|
/*
|
|
1662
1044
|
Versão: 1.000
|
|
1663
1045
|
Data Criação: 06/08/2018
|
|
@@ -1665,11 +1047,6 @@ Data Criação: 06/08/2018
|
|
|
1665
1047
|
class FilterRangeUtil {
|
|
1666
1048
|
constructor() {
|
|
1667
1049
|
}
|
|
1668
|
-
/**
|
|
1669
|
-
* @param {?} iniInitial
|
|
1670
|
-
* @param {?} iniFinal
|
|
1671
|
-
* @return {?}
|
|
1672
|
-
*/
|
|
1673
1050
|
static makeFilterRangeCharacter(iniInitial, iniFinal) {
|
|
1674
1051
|
return {
|
|
1675
1052
|
iniInitial,
|
|
@@ -1678,11 +1055,6 @@ class FilterRangeUtil {
|
|
|
1678
1055
|
valFinal: iniFinal
|
|
1679
1056
|
};
|
|
1680
1057
|
}
|
|
1681
|
-
/**
|
|
1682
|
-
* @param {?} iniInitial
|
|
1683
|
-
* @param {?} iniFinal
|
|
1684
|
-
* @return {?}
|
|
1685
|
-
*/
|
|
1686
1058
|
static makeFilterRangeNumber(iniInitial, iniFinal) {
|
|
1687
1059
|
return {
|
|
1688
1060
|
iniInitial,
|
|
@@ -1691,11 +1063,6 @@ class FilterRangeUtil {
|
|
|
1691
1063
|
valFinal: iniFinal
|
|
1692
1064
|
};
|
|
1693
1065
|
}
|
|
1694
|
-
/**
|
|
1695
|
-
* @param {?} iniInitial
|
|
1696
|
-
* @param {?} iniFinal
|
|
1697
|
-
* @return {?}
|
|
1698
|
-
*/
|
|
1699
1066
|
static makeFilterRangeDate(iniInitial, iniFinal) {
|
|
1700
1067
|
return {
|
|
1701
1068
|
iniInitial,
|
|
@@ -1706,49 +1073,17 @@ class FilterRangeUtil {
|
|
|
1706
1073
|
}
|
|
1707
1074
|
}
|
|
1708
1075
|
|
|
1709
|
-
/**
|
|
1710
|
-
* @fileoverview added by tsickle
|
|
1711
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1712
|
-
*/
|
|
1713
1076
|
/*
|
|
1714
1077
|
Versão: 1.003
|
|
1715
1078
|
Data Criação: 18/04/2019
|
|
1716
1079
|
*/
|
|
1717
|
-
/**
|
|
1718
|
-
* @record
|
|
1719
|
-
*/
|
|
1720
|
-
function ChartSeries() { }
|
|
1721
|
-
if (false) {
|
|
1722
|
-
/** @type {?|undefined} */
|
|
1723
|
-
ChartSeries.prototype.name;
|
|
1724
|
-
/** @type {?|undefined} */
|
|
1725
|
-
ChartSeries.prototype.data;
|
|
1726
|
-
}
|
|
1727
|
-
/**
|
|
1728
|
-
* @record
|
|
1729
|
-
*/
|
|
1730
|
-
function ChartValues() { }
|
|
1731
|
-
if (false) {
|
|
1732
|
-
/** @type {?} */
|
|
1733
|
-
ChartValues.prototype.minValue;
|
|
1734
|
-
/** @type {?} */
|
|
1735
|
-
ChartValues.prototype.maxValue;
|
|
1736
|
-
}
|
|
1737
1080
|
class GenericFunctionsUtils {
|
|
1738
|
-
/**
|
|
1739
|
-
* @param {?} literals
|
|
1740
|
-
*/
|
|
1741
1081
|
constructor(literals) {
|
|
1742
1082
|
this.literals = {};
|
|
1743
1083
|
this.literals = literals;
|
|
1744
1084
|
}
|
|
1745
1085
|
/* Transforma uma Lista separada por "," em um Array */
|
|
1746
|
-
/**
|
|
1747
|
-
* @param {?} list
|
|
1748
|
-
* @return {?}
|
|
1749
|
-
*/
|
|
1750
1086
|
static listToArrayCharacter(list) {
|
|
1751
|
-
/** @type {?} */
|
|
1752
1087
|
let returnArray = new Array();
|
|
1753
1088
|
if (list && list !== '') {
|
|
1754
1089
|
returnArray = list.split(',');
|
|
@@ -1756,24 +1091,14 @@ class GenericFunctionsUtils {
|
|
|
1756
1091
|
return returnArray;
|
|
1757
1092
|
}
|
|
1758
1093
|
/* Transforma um Array em uma Lista separada por "," */
|
|
1759
|
-
/**
|
|
1760
|
-
* @param {?} array
|
|
1761
|
-
* @return {?}
|
|
1762
|
-
*/
|
|
1763
1094
|
static ArrayToListCharacter(array) {
|
|
1764
|
-
/** @type {?} */
|
|
1765
1095
|
let list = '';
|
|
1766
1096
|
if (array && array.length > 0) {
|
|
1767
1097
|
list = array.join(',');
|
|
1768
1098
|
}
|
|
1769
1099
|
return list;
|
|
1770
1100
|
}
|
|
1771
|
-
/**
|
|
1772
|
-
* @param {?} object
|
|
1773
|
-
* @return {?}
|
|
1774
|
-
*/
|
|
1775
1101
|
static isEmpty(object) {
|
|
1776
|
-
/** @type {?} */
|
|
1777
1102
|
let isEmpty = true;
|
|
1778
1103
|
for (const content in object) {
|
|
1779
1104
|
if (object.hasOwnProperty(content)) {
|
|
@@ -1782,24 +1107,12 @@ class GenericFunctionsUtils {
|
|
|
1782
1107
|
}
|
|
1783
1108
|
return isEmpty;
|
|
1784
1109
|
}
|
|
1785
|
-
/**
|
|
1786
|
-
* @param {?} chartData
|
|
1787
|
-
* @return {?}
|
|
1788
|
-
*/
|
|
1789
1110
|
static getChartValues(chartData) {
|
|
1790
|
-
/** @type {?} */
|
|
1791
1111
|
let chartValues;
|
|
1792
|
-
|
|
1793
|
-
let maxValue;
|
|
1794
|
-
/** @type {?} */
|
|
1795
|
-
let minValue;
|
|
1112
|
+
let maxValue, minValue;
|
|
1796
1113
|
maxValue = undefined;
|
|
1797
1114
|
minValue = undefined;
|
|
1798
|
-
chartData.map(
|
|
1799
|
-
* @param {?} item
|
|
1800
|
-
* @return {?}
|
|
1801
|
-
*/
|
|
1802
|
-
item => {
|
|
1115
|
+
chartData.map(item => {
|
|
1803
1116
|
if (maxValue === undefined && minValue === undefined) {
|
|
1804
1117
|
maxValue = item.data[0];
|
|
1805
1118
|
minValue = item.data[0];
|
|
@@ -1812,7 +1125,7 @@ class GenericFunctionsUtils {
|
|
|
1812
1125
|
maxValue = item.data[0];
|
|
1813
1126
|
}
|
|
1814
1127
|
}
|
|
1815
|
-
})
|
|
1128
|
+
});
|
|
1816
1129
|
if (maxValue > 0 && minValue > 0) {
|
|
1817
1130
|
chartValues = { maxValue: maxValue, minValue: 0 };
|
|
1818
1131
|
}
|
|
@@ -1820,7 +1133,6 @@ class GenericFunctionsUtils {
|
|
|
1820
1133
|
chartValues = { maxValue: maxValue, minValue: minValue };
|
|
1821
1134
|
}
|
|
1822
1135
|
if (maxValue < 0 && minValue < 0) {
|
|
1823
|
-
/** @type {?} */
|
|
1824
1136
|
const max = (minValue / 3) * (-1);
|
|
1825
1137
|
chartValues = { maxValue: max, minValue: minValue };
|
|
1826
1138
|
}
|
|
@@ -1828,7 +1140,6 @@ class GenericFunctionsUtils {
|
|
|
1828
1140
|
chartValues = { maxValue: maxValue, minValue: 0 };
|
|
1829
1141
|
}
|
|
1830
1142
|
if (maxValue === 0 && minValue < 0) {
|
|
1831
|
-
/** @type {?} */
|
|
1832
1143
|
const max = (minValue / 3) * (-1);
|
|
1833
1144
|
chartValues = { maxValue: max, minValue: minValue };
|
|
1834
1145
|
}
|
|
@@ -1840,97 +1151,52 @@ class GenericFunctionsUtils {
|
|
|
1840
1151
|
return chartValues;
|
|
1841
1152
|
}
|
|
1842
1153
|
/*Deixa no list apenas o itens que existem no options*/
|
|
1843
|
-
/**
|
|
1844
|
-
* @param {?} options
|
|
1845
|
-
* @param {?} list
|
|
1846
|
-
* @return {?}
|
|
1847
|
-
*/
|
|
1848
1154
|
static atzMultiSelectListByOptions(options, list) {
|
|
1849
|
-
/** @type {?} */
|
|
1850
1155
|
let idx;
|
|
1851
|
-
/** @type {?} */
|
|
1852
1156
|
let newList;
|
|
1853
1157
|
if (!list) {
|
|
1854
1158
|
return list;
|
|
1855
1159
|
}
|
|
1856
1160
|
newList = new Array();
|
|
1857
|
-
list.map(
|
|
1858
|
-
* @param {?} item
|
|
1859
|
-
* @return {?}
|
|
1860
|
-
*/
|
|
1861
|
-
item => {
|
|
1161
|
+
list.map(item => {
|
|
1862
1162
|
if (item) {
|
|
1863
|
-
idx = options.findIndex(
|
|
1864
|
-
* @param {?} itemOptions
|
|
1865
|
-
* @return {?}
|
|
1866
|
-
*/
|
|
1867
|
-
itemOptions => itemOptions.value === item));
|
|
1163
|
+
idx = options.findIndex(itemOptions => itemOptions.value === item);
|
|
1868
1164
|
if (idx >= 0) {
|
|
1869
1165
|
newList.push(item);
|
|
1870
1166
|
}
|
|
1871
1167
|
}
|
|
1872
|
-
})
|
|
1168
|
+
});
|
|
1873
1169
|
return newList;
|
|
1874
1170
|
}
|
|
1875
1171
|
/*Carrega o Options com os valores defaults passados como parâmetro (list)*/
|
|
1876
|
-
/**
|
|
1877
|
-
* @param {?} options
|
|
1878
|
-
* @param {?} list
|
|
1879
|
-
* @return {?}
|
|
1880
|
-
*/
|
|
1881
1172
|
loadOptionsMultiSelect(options, list) {
|
|
1882
|
-
/** @type {?} */
|
|
1883
1173
|
let idx;
|
|
1884
1174
|
if (!list) {
|
|
1885
1175
|
return;
|
|
1886
1176
|
}
|
|
1887
|
-
list.map(
|
|
1888
|
-
* @param {?} item
|
|
1889
|
-
* @return {?}
|
|
1890
|
-
*/
|
|
1891
|
-
item => {
|
|
1177
|
+
list.map(item => {
|
|
1892
1178
|
if (item) {
|
|
1893
|
-
idx = options.findIndex(
|
|
1894
|
-
* @param {?} itemOptions
|
|
1895
|
-
* @return {?}
|
|
1896
|
-
*/
|
|
1897
|
-
itemOptions => itemOptions.value === item));
|
|
1179
|
+
idx = options.findIndex(itemOptions => itemOptions.value === item);
|
|
1898
1180
|
if (idx === -1) {
|
|
1899
1181
|
options.push({ label: item === 'all' ? this.literals['all'] : item, value: item });
|
|
1900
1182
|
}
|
|
1901
1183
|
}
|
|
1902
|
-
})
|
|
1184
|
+
});
|
|
1903
1185
|
}
|
|
1904
1186
|
/*Carrega o Options com os valores defaults passados como parâmetro (list)*/
|
|
1905
|
-
/**
|
|
1906
|
-
* @param {?} options
|
|
1907
|
-
* @param {?} selectValue
|
|
1908
|
-
* @param {?=} tradValue
|
|
1909
|
-
* @return {?}
|
|
1910
|
-
*/
|
|
1911
1187
|
loadOptionsSelect(options, selectValue, tradValue = false) {
|
|
1912
|
-
/** @type {?} */
|
|
1913
1188
|
let idx;
|
|
1914
1189
|
if (!selectValue) {
|
|
1915
1190
|
return;
|
|
1916
1191
|
}
|
|
1917
1192
|
if (selectValue) {
|
|
1918
|
-
idx = options.findIndex(
|
|
1919
|
-
* @param {?} itemOptions
|
|
1920
|
-
* @return {?}
|
|
1921
|
-
*/
|
|
1922
|
-
itemOptions => itemOptions.value === selectValue));
|
|
1193
|
+
idx = options.findIndex(itemOptions => itemOptions.value === selectValue);
|
|
1923
1194
|
if (idx === -1) {
|
|
1924
1195
|
options.push({ label: tradValue ? this.literals[selectValue] : selectValue, value: selectValue });
|
|
1925
1196
|
}
|
|
1926
1197
|
}
|
|
1927
1198
|
}
|
|
1928
1199
|
/*Método que compara 2 objetos e retorna se são iguais ou diferentes*/
|
|
1929
|
-
/**
|
|
1930
|
-
* @param {?} firstObject
|
|
1931
|
-
* @param {?} secondObject
|
|
1932
|
-
* @return {?}
|
|
1933
|
-
*/
|
|
1934
1200
|
compareObjects(firstObject, secondObject) {
|
|
1935
1201
|
if (!firstObject || !secondObject) {
|
|
1936
1202
|
return false;
|
|
@@ -1949,21 +1215,11 @@ class GenericFunctionsUtils {
|
|
|
1949
1215
|
}
|
|
1950
1216
|
return true;
|
|
1951
1217
|
}
|
|
1952
|
-
/**
|
|
1953
|
-
* @param {?} charInd
|
|
1954
|
-
* @param {?} dateRef
|
|
1955
|
-
* @return {?}
|
|
1956
|
-
*/
|
|
1957
1218
|
referenceGeneration(charInd, dateRef) {
|
|
1958
|
-
/** @type {?} */
|
|
1959
1219
|
let reference;
|
|
1960
|
-
/** @type {?} */
|
|
1961
1220
|
let random;
|
|
1962
|
-
/** @type {?} */
|
|
1963
1221
|
const iDay = dateRef.getDate();
|
|
1964
|
-
/** @type {?} */
|
|
1965
1222
|
const iMonth = dateRef.getMonth() + 1;
|
|
1966
|
-
/** @type {?} */
|
|
1967
1223
|
const iYear = dateRef.getFullYear();
|
|
1968
1224
|
reference = `${this.pad(iYear)}${this.pad(iMonth)}${this.pad(iDay)}${charInd}`;
|
|
1969
1225
|
random = btoa(`${(new Date()).getTime()}`);
|
|
@@ -1971,10 +1227,6 @@ class GenericFunctionsUtils {
|
|
|
1971
1227
|
random = random.slice(random.length - 3, random.length);
|
|
1972
1228
|
return `${reference}${random}`;
|
|
1973
1229
|
}
|
|
1974
|
-
/**
|
|
1975
|
-
* @param {?} number
|
|
1976
|
-
* @return {?}
|
|
1977
|
-
*/
|
|
1978
1230
|
pad(number) {
|
|
1979
1231
|
if (number < 10) {
|
|
1980
1232
|
return '0' + number;
|
|
@@ -1984,47 +1236,20 @@ class GenericFunctionsUtils {
|
|
|
1984
1236
|
}
|
|
1985
1237
|
return number;
|
|
1986
1238
|
}
|
|
1987
|
-
/**
|
|
1988
|
-
* @param {?} idField
|
|
1989
|
-
* @return {?}
|
|
1990
|
-
*/
|
|
1991
1239
|
focusInternalInput(idField) {
|
|
1992
|
-
/** @type {?} */
|
|
1993
1240
|
const fieldComponent = document.getElementById(idField);
|
|
1994
|
-
|
|
1995
|
-
const fieldInput = ((/** @type {?} */ ((/** @type {?} */ (fieldComponent.getElementsByClassName('po-input'))))))[0];
|
|
1241
|
+
const fieldInput = fieldComponent.getElementsByClassName('po-input')[0];
|
|
1996
1242
|
fieldInput.focus();
|
|
1997
1243
|
}
|
|
1998
|
-
}
|
|
1999
|
-
if (false) {
|
|
2000
|
-
/** @type {?} */
|
|
2001
|
-
GenericFunctionsUtils.prototype.literals;
|
|
2002
1244
|
}
|
|
2003
1245
|
|
|
2004
|
-
/**
|
|
2005
|
-
* @fileoverview added by tsickle
|
|
2006
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2007
|
-
*/
|
|
2008
1246
|
class FileUtil {
|
|
2009
1247
|
constructor() { }
|
|
2010
|
-
/**
|
|
2011
|
-
* @param {?} data
|
|
2012
|
-
* @param {?} fileName
|
|
2013
|
-
* @param {?=} contentType
|
|
2014
|
-
* @param {?=} base64
|
|
2015
|
-
* @return {?}
|
|
2016
|
-
*/
|
|
2017
1248
|
static downloadFile(data, fileName, contentType, base64) {
|
|
2018
1249
|
base64 = (base64 === false) ? false : true;
|
|
2019
|
-
/** @type {?} */
|
|
2020
1250
|
const dataBlob = base64 ? this.b64toBlob(data, contentType) : data;
|
|
2021
1251
|
this.download(dataBlob, fileName);
|
|
2022
1252
|
}
|
|
2023
|
-
/**
|
|
2024
|
-
* @param {?} data
|
|
2025
|
-
* @param {?=} dwldDataParam
|
|
2026
|
-
* @return {?}
|
|
2027
|
-
*/
|
|
2028
1253
|
static downloadData(data, dwldDataParam = null) {
|
|
2029
1254
|
if (!data) {
|
|
2030
1255
|
return;
|
|
@@ -2047,22 +1272,12 @@ class FileUtil {
|
|
|
2047
1272
|
if (!dwldDataParam.columnExclude) {
|
|
2048
1273
|
dwldDataParam.columnExclude = [];
|
|
2049
1274
|
}
|
|
2050
|
-
/** @type {?} */
|
|
2051
1275
|
const datab64 = btoa(this.jsonToString(data, dwldDataParam));
|
|
2052
1276
|
this.downloadFile(datab64, dwldDataParam.fileName, 'text/csv');
|
|
2053
1277
|
}
|
|
2054
|
-
/**
|
|
2055
|
-
* @private
|
|
2056
|
-
* @param {?} file
|
|
2057
|
-
* @param {?} fileName
|
|
2058
|
-
* @return {?}
|
|
2059
|
-
*/
|
|
2060
1278
|
static download(file, fileName) {
|
|
2061
|
-
/** @type {?} */
|
|
2062
1279
|
const binaryData = [file];
|
|
2063
|
-
/** @type {?} */
|
|
2064
1280
|
const downloadLink = document.createElement('a');
|
|
2065
|
-
/** @type {?} */
|
|
2066
1281
|
const urlDownload = window.URL.createObjectURL(new Blob(binaryData, { type: file.type }));
|
|
2067
1282
|
/**Verifica se é ie ou edge, pois o mesmo tem tratamento próprio para arquivos blob */
|
|
2068
1283
|
if (navigator.userAgent.toUpperCase().indexOf('.NET') > 0 || navigator.userAgent.toUpperCase().indexOf('EDGE') > 0) {
|
|
@@ -2077,55 +1292,31 @@ class FileUtil {
|
|
|
2077
1292
|
downloadLink.remove();
|
|
2078
1293
|
}
|
|
2079
1294
|
}
|
|
2080
|
-
/**
|
|
2081
|
-
* @private
|
|
2082
|
-
* @param {?} b64Data
|
|
2083
|
-
* @param {?=} contentType
|
|
2084
|
-
* @param {?=} sliceSize
|
|
2085
|
-
* @return {?}
|
|
2086
|
-
*/
|
|
2087
1295
|
static b64toBlob(b64Data, contentType, sliceSize) {
|
|
2088
1296
|
contentType = contentType || '';
|
|
2089
1297
|
sliceSize = sliceSize || 512;
|
|
2090
|
-
/** @type {?} */
|
|
2091
1298
|
const byteCharacters = atob(b64Data);
|
|
2092
|
-
/** @type {?} */
|
|
2093
1299
|
const byteArrays = [];
|
|
2094
1300
|
for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) {
|
|
2095
|
-
/** @type {?} */
|
|
2096
1301
|
const slice = byteCharacters.slice(offset, offset + sliceSize);
|
|
2097
|
-
/** @type {?} */
|
|
2098
1302
|
const byteNumbers = new Array(slice.length);
|
|
2099
1303
|
for (let i = 0; i < slice.length; i++) {
|
|
2100
1304
|
byteNumbers[i] = slice.charCodeAt(i);
|
|
2101
1305
|
}
|
|
2102
|
-
/** @type {?} */
|
|
2103
1306
|
const byteArray = new Uint8Array(byteNumbers);
|
|
2104
1307
|
byteArrays.push(byteArray);
|
|
2105
1308
|
}
|
|
2106
|
-
/** @type {?} */
|
|
2107
1309
|
const blob = new Blob(byteArrays, { type: contentType });
|
|
2108
1310
|
return blob;
|
|
2109
1311
|
}
|
|
2110
|
-
/**
|
|
2111
|
-
* @private
|
|
2112
|
-
* @param {?} jsonData
|
|
2113
|
-
* @param {?} dwldDataParam
|
|
2114
|
-
* @return {?}
|
|
2115
|
-
*/
|
|
2116
1312
|
static jsonToString(jsonData, dwldDataParam) {
|
|
2117
1313
|
if (!jsonData || jsonData.length === 0) {
|
|
2118
1314
|
return '';
|
|
2119
1315
|
}
|
|
2120
|
-
/** @type {?} */
|
|
2121
1316
|
const lineDelimiter = '\n';
|
|
2122
|
-
/** @type {?} */
|
|
2123
1317
|
let columnOrig = null;
|
|
2124
|
-
/** @type {?} */
|
|
2125
1318
|
let columnHeader = null;
|
|
2126
|
-
/** @type {?} */
|
|
2127
1319
|
const keys = [];
|
|
2128
|
-
/** @type {?} */
|
|
2129
1320
|
let includeKey;
|
|
2130
1321
|
if (dwldDataParam.columnList &&
|
|
2131
1322
|
dwldDataParam.columnList.length > 0) {
|
|
@@ -2134,11 +1325,7 @@ class FileUtil {
|
|
|
2134
1325
|
else {
|
|
2135
1326
|
columnOrig = Object.keys(jsonData[0]);
|
|
2136
1327
|
}
|
|
2137
|
-
columnOrig.forEach(
|
|
2138
|
-
* @param {?} key
|
|
2139
|
-
* @return {?}
|
|
2140
|
-
*/
|
|
2141
|
-
key => {
|
|
1328
|
+
columnOrig.forEach(key => {
|
|
2142
1329
|
includeKey = true;
|
|
2143
1330
|
if (dwldDataParam.columnExclude &&
|
|
2144
1331
|
dwldDataParam.columnExclude.length > 0 &&
|
|
@@ -2150,23 +1337,11 @@ class FileUtil {
|
|
|
2150
1337
|
columnHeader = (!columnHeader) ? '' : columnHeader + dwldDataParam.columnDelimiter;
|
|
2151
1338
|
columnHeader += (dwldDataParam.literals[key]) ? dwldDataParam.literals[key] : key;
|
|
2152
1339
|
}
|
|
2153
|
-
})
|
|
2154
|
-
|
|
2155
|
-
const lineStr = jsonData.reduce((/**
|
|
2156
|
-
* @param {?} accLineStr
|
|
2157
|
-
* @param {?} currentItem
|
|
2158
|
-
* @return {?}
|
|
2159
|
-
*/
|
|
2160
|
-
(accLineStr, currentItem) => {
|
|
2161
|
-
/** @type {?} */
|
|
1340
|
+
});
|
|
1341
|
+
const lineStr = jsonData.reduce((accLineStr, currentItem) => {
|
|
2162
1342
|
let first = true;
|
|
2163
|
-
/** @type {?} */
|
|
2164
1343
|
let columnValue = null;
|
|
2165
|
-
keys.forEach(
|
|
2166
|
-
* @param {?} key
|
|
2167
|
-
* @return {?}
|
|
2168
|
-
*/
|
|
2169
|
-
key => {
|
|
1344
|
+
keys.forEach(key => {
|
|
2170
1345
|
if (!first) {
|
|
2171
1346
|
accLineStr += dwldDataParam.columnDelimiter;
|
|
2172
1347
|
}
|
|
@@ -2187,245 +1362,23 @@ class FileUtil {
|
|
|
2187
1362
|
}
|
|
2188
1363
|
accLineStr += columnValue;
|
|
2189
1364
|
first = false;
|
|
2190
|
-
})
|
|
1365
|
+
});
|
|
2191
1366
|
return accLineStr + lineDelimiter;
|
|
2192
|
-
}
|
|
1367
|
+
}, columnHeader + lineDelimiter);
|
|
2193
1368
|
return lineStr;
|
|
2194
1369
|
}
|
|
2195
1370
|
}
|
|
2196
|
-
/**
|
|
2197
|
-
* @record
|
|
2198
|
-
*/
|
|
2199
|
-
function IDownloadDataParams() { }
|
|
2200
|
-
if (false) {
|
|
2201
|
-
/** @type {?} */
|
|
2202
|
-
IDownloadDataParams.prototype.fileName;
|
|
2203
|
-
/** @type {?} */
|
|
2204
|
-
IDownloadDataParams.prototype.literals;
|
|
2205
|
-
/** @type {?} */
|
|
2206
|
-
IDownloadDataParams.prototype.columnDelimiter;
|
|
2207
|
-
/** @type {?} */
|
|
2208
|
-
IDownloadDataParams.prototype.columnList;
|
|
2209
|
-
/** @type {?} */
|
|
2210
|
-
IDownloadDataParams.prototype.columnExclude;
|
|
2211
|
-
}
|
|
2212
1371
|
class DownloadDataParams {
|
|
2213
|
-
}
|
|
2214
|
-
if (false) {
|
|
2215
|
-
/** @type {?} */
|
|
2216
|
-
DownloadDataParams.prototype.fileName;
|
|
2217
|
-
/** @type {?} */
|
|
2218
|
-
DownloadDataParams.prototype.literals;
|
|
2219
|
-
/** @type {?} */
|
|
2220
|
-
DownloadDataParams.prototype.columnDelimiter;
|
|
2221
|
-
/** @type {?} */
|
|
2222
|
-
DownloadDataParams.prototype.columnList;
|
|
2223
|
-
/** @type {?} */
|
|
2224
|
-
DownloadDataParams.prototype.columnExclude;
|
|
2225
|
-
}
|
|
2226
|
-
|
|
2227
|
-
/**
|
|
2228
|
-
* @fileoverview added by tsickle
|
|
2229
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2230
|
-
*/
|
|
2231
|
-
/**
|
|
2232
|
-
* @record
|
|
2233
|
-
* @template T
|
|
2234
|
-
*/
|
|
2235
|
-
function TotvsResponse() { }
|
|
2236
|
-
if (false) {
|
|
2237
|
-
/** @type {?} */
|
|
2238
|
-
TotvsResponse.prototype.items;
|
|
2239
|
-
/** @type {?|undefined} */
|
|
2240
|
-
TotvsResponse.prototype.hasNext;
|
|
2241
1372
|
}
|
|
2242
1373
|
|
|
2243
|
-
/**
|
|
2244
|
-
* @fileoverview added by tsickle
|
|
2245
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2246
|
-
*/
|
|
2247
|
-
/**
|
|
2248
|
-
* @record
|
|
2249
|
-
*/
|
|
2250
|
-
function IFilterRangeCharacter() { }
|
|
2251
|
-
if (false) {
|
|
2252
|
-
/** @type {?} */
|
|
2253
|
-
IFilterRangeCharacter.prototype.iniInitial;
|
|
2254
|
-
/** @type {?} */
|
|
2255
|
-
IFilterRangeCharacter.prototype.iniFinal;
|
|
2256
|
-
/** @type {?} */
|
|
2257
|
-
IFilterRangeCharacter.prototype.valInitial;
|
|
2258
|
-
/** @type {?} */
|
|
2259
|
-
IFilterRangeCharacter.prototype.valFinal;
|
|
2260
|
-
}
|
|
2261
|
-
/**
|
|
2262
|
-
* @record
|
|
2263
|
-
*/
|
|
2264
|
-
function IFilterRangeNumber() { }
|
|
2265
|
-
if (false) {
|
|
2266
|
-
/** @type {?} */
|
|
2267
|
-
IFilterRangeNumber.prototype.iniInitial;
|
|
2268
|
-
/** @type {?} */
|
|
2269
|
-
IFilterRangeNumber.prototype.iniFinal;
|
|
2270
|
-
/** @type {?} */
|
|
2271
|
-
IFilterRangeNumber.prototype.valInitial;
|
|
2272
|
-
/** @type {?} */
|
|
2273
|
-
IFilterRangeNumber.prototype.valFinal;
|
|
2274
|
-
}
|
|
2275
|
-
/**
|
|
2276
|
-
* @record
|
|
2277
|
-
*/
|
|
2278
|
-
function IFilterRangeDate() { }
|
|
2279
|
-
if (false) {
|
|
2280
|
-
/** @type {?} */
|
|
2281
|
-
IFilterRangeDate.prototype.iniInitial;
|
|
2282
|
-
/** @type {?} */
|
|
2283
|
-
IFilterRangeDate.prototype.iniFinal;
|
|
2284
|
-
/** @type {?} */
|
|
2285
|
-
IFilterRangeDate.prototype.valInitial;
|
|
2286
|
-
/** @type {?} */
|
|
2287
|
-
IFilterRangeDate.prototype.valFinal;
|
|
2288
|
-
}
|
|
2289
|
-
|
|
2290
|
-
/**
|
|
2291
|
-
* @fileoverview added by tsickle
|
|
2292
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2293
|
-
*/
|
|
2294
|
-
/**
|
|
2295
|
-
* @record
|
|
2296
|
-
*/
|
|
2297
|
-
function IScheduleParameters() { }
|
|
2298
|
-
if (false) {
|
|
2299
|
-
/** @type {?} */
|
|
2300
|
-
IScheduleParameters.prototype.executionType;
|
|
2301
|
-
/** @type {?} */
|
|
2302
|
-
IScheduleParameters.prototype.execAppointDate;
|
|
2303
|
-
/** @type {?} */
|
|
2304
|
-
IScheduleParameters.prototype.execAppointHour;
|
|
2305
|
-
/** @type {?} */
|
|
2306
|
-
IScheduleParameters.prototype.executionServer;
|
|
2307
|
-
/** @type {?} */
|
|
2308
|
-
IScheduleParameters.prototype.repeatExecution;
|
|
2309
|
-
/** @type {?} */
|
|
2310
|
-
IScheduleParameters.prototype.repeatType;
|
|
2311
|
-
/** @type {?} */
|
|
2312
|
-
IScheduleParameters.prototype.frequency;
|
|
2313
|
-
/** @type {?} */
|
|
2314
|
-
IScheduleParameters.prototype.frequencyValue;
|
|
2315
|
-
/** @type {?} */
|
|
2316
|
-
IScheduleParameters.prototype.frequencyType;
|
|
2317
|
-
/** @type {?} */
|
|
2318
|
-
IScheduleParameters.prototype.execAppointHourInit;
|
|
2319
|
-
/** @type {?} */
|
|
2320
|
-
IScheduleParameters.prototype.execAppointHourFinal;
|
|
2321
|
-
/** @type {?} */
|
|
2322
|
-
IScheduleParameters.prototype.selectWeeklys;
|
|
2323
|
-
/** @type {?} */
|
|
2324
|
-
IScheduleParameters.prototype.dayOfMonth;
|
|
2325
|
-
}
|
|
2326
1374
|
class ScheduleParameters {
|
|
2327
1375
|
}
|
|
2328
|
-
if (false) {
|
|
2329
|
-
/** @type {?} */
|
|
2330
|
-
ScheduleParameters.prototype.executionType;
|
|
2331
|
-
/** @type {?} */
|
|
2332
|
-
ScheduleParameters.prototype.execAppointDate;
|
|
2333
|
-
/** @type {?} */
|
|
2334
|
-
ScheduleParameters.prototype.execAppointHour;
|
|
2335
|
-
/** @type {?} */
|
|
2336
|
-
ScheduleParameters.prototype.executionServer;
|
|
2337
|
-
/** @type {?} */
|
|
2338
|
-
ScheduleParameters.prototype.repeatExecution;
|
|
2339
|
-
/** @type {?} */
|
|
2340
|
-
ScheduleParameters.prototype.repeatType;
|
|
2341
|
-
/** @type {?} */
|
|
2342
|
-
ScheduleParameters.prototype.frequency;
|
|
2343
|
-
/** @type {?} */
|
|
2344
|
-
ScheduleParameters.prototype.frequencyValue;
|
|
2345
|
-
/** @type {?} */
|
|
2346
|
-
ScheduleParameters.prototype.frequencyType;
|
|
2347
|
-
/** @type {?} */
|
|
2348
|
-
ScheduleParameters.prototype.execAppointHourInit;
|
|
2349
|
-
/** @type {?} */
|
|
2350
|
-
ScheduleParameters.prototype.execAppointHourFinal;
|
|
2351
|
-
/** @type {?} */
|
|
2352
|
-
ScheduleParameters.prototype.selectWeeklys;
|
|
2353
|
-
/** @type {?} */
|
|
2354
|
-
ScheduleParameters.prototype.dayOfMonth;
|
|
2355
|
-
}
|
|
2356
|
-
/**
|
|
2357
|
-
* @record
|
|
2358
|
-
*/
|
|
2359
|
-
function IExecutionStatus() { }
|
|
2360
|
-
if (false) {
|
|
2361
|
-
/** @type {?} */
|
|
2362
|
-
IExecutionStatus.prototype.jobScheduleID;
|
|
2363
|
-
/** @type {?} */
|
|
2364
|
-
IExecutionStatus.prototype.executionID;
|
|
2365
|
-
/** @type {?} */
|
|
2366
|
-
IExecutionStatus.prototype.startedDate;
|
|
2367
|
-
/** @type {?} */
|
|
2368
|
-
IExecutionStatus.prototype.error;
|
|
2369
|
-
/** @type {?} */
|
|
2370
|
-
IExecutionStatus.prototype.status;
|
|
2371
|
-
}
|
|
2372
1376
|
class ExecutionStatus {
|
|
2373
1377
|
}
|
|
2374
|
-
if (false) {
|
|
2375
|
-
/** @type {?} */
|
|
2376
|
-
ExecutionStatus.prototype.jobScheduleID;
|
|
2377
|
-
/** @type {?} */
|
|
2378
|
-
ExecutionStatus.prototype.executionID;
|
|
2379
|
-
/** @type {?} */
|
|
2380
|
-
ExecutionStatus.prototype.startedDate;
|
|
2381
|
-
/** @type {?} */
|
|
2382
|
-
ExecutionStatus.prototype.error;
|
|
2383
|
-
/** @type {?} */
|
|
2384
|
-
ExecutionStatus.prototype.status;
|
|
2385
|
-
}
|
|
2386
|
-
/**
|
|
2387
|
-
* @record
|
|
2388
|
-
*/
|
|
2389
|
-
function IExecutionParameters() { }
|
|
2390
|
-
if (false) {
|
|
2391
|
-
/** @type {?} */
|
|
2392
|
-
IExecutionParameters.prototype.executionServer;
|
|
2393
|
-
/** @type {?} */
|
|
2394
|
-
IExecutionParameters.prototype.programName;
|
|
2395
|
-
/** @type {?} */
|
|
2396
|
-
IExecutionParameters.prototype.externalName;
|
|
2397
|
-
/** @type {?} */
|
|
2398
|
-
IExecutionParameters.prototype.programEMS5;
|
|
2399
|
-
/** @type {?} */
|
|
2400
|
-
IExecutionParameters.prototype.programVersion;
|
|
2401
|
-
/** @type {?} */
|
|
2402
|
-
IExecutionParameters.prototype.businessParams;
|
|
2403
|
-
}
|
|
2404
1378
|
class ExecutionParameters {
|
|
2405
|
-
}
|
|
2406
|
-
if (false) {
|
|
2407
|
-
/** @type {?} */
|
|
2408
|
-
ExecutionParameters.prototype.executionServer;
|
|
2409
|
-
/** @type {?} */
|
|
2410
|
-
ExecutionParameters.prototype.programName;
|
|
2411
|
-
/** @type {?} */
|
|
2412
|
-
ExecutionParameters.prototype.externalName;
|
|
2413
|
-
/** @type {?} */
|
|
2414
|
-
ExecutionParameters.prototype.programEMS5;
|
|
2415
|
-
/** @type {?} */
|
|
2416
|
-
ExecutionParameters.prototype.programVersion;
|
|
2417
|
-
/** @type {?} */
|
|
2418
|
-
ExecutionParameters.prototype.businessParams;
|
|
2419
1379
|
}
|
|
2420
1380
|
|
|
2421
|
-
/**
|
|
2422
|
-
* @fileoverview added by tsickle
|
|
2423
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2424
|
-
*/
|
|
2425
1381
|
class TotvsScheduleExecutionService {
|
|
2426
|
-
/**
|
|
2427
|
-
* @param {?} http
|
|
2428
|
-
*/
|
|
2429
1382
|
constructor(http) {
|
|
2430
1383
|
this.http = http;
|
|
2431
1384
|
this.headers = { headers: { 'X-PO-Screen-Lock': 'true' } };
|
|
@@ -2433,12 +1386,7 @@ class TotvsScheduleExecutionService {
|
|
|
2433
1386
|
this.urlJobScheduler = '/dts/datasul-rest/resources/prg/framework/v1/jobScheduler';
|
|
2434
1387
|
this.urlJobExecution = '/dts/datasul-rest/resources/prg/framework/v1/jobExecution';
|
|
2435
1388
|
}
|
|
2436
|
-
/**
|
|
2437
|
-
* @param {?} params
|
|
2438
|
-
* @return {?}
|
|
2439
|
-
*/
|
|
2440
1389
|
getFilteredItems(params) {
|
|
2441
|
-
/** @type {?} */
|
|
2442
1390
|
const urlParams = new Array();
|
|
2443
1391
|
urlParams.push(`pageSize=${params.pageSize.toString()}`);
|
|
2444
1392
|
urlParams.push(`page=${params.page.toString()}`);
|
|
@@ -2447,20 +1395,10 @@ class TotvsScheduleExecutionService {
|
|
|
2447
1395
|
}
|
|
2448
1396
|
return this.http.get(`${this.urlCadServidor}?${urlParams.join('&')}`);
|
|
2449
1397
|
}
|
|
2450
|
-
/**
|
|
2451
|
-
* @param {?} id
|
|
2452
|
-
* @return {?}
|
|
2453
|
-
*/
|
|
2454
1398
|
getObjectByValue(id) {
|
|
2455
1399
|
return this.http.get(`${this.urlCadServidor}/${id}`, this.headers);
|
|
2456
1400
|
}
|
|
2457
|
-
/**
|
|
2458
|
-
* @param {?} parameters
|
|
2459
|
-
* @param {?} loading
|
|
2460
|
-
* @return {?}
|
|
2461
|
-
*/
|
|
2462
1401
|
createExecution(parameters, loading) {
|
|
2463
|
-
/** @type {?} */
|
|
2464
1402
|
const params = JSON.parse(JSON.stringify(parameters).replace(/\\\\/g, '*|'));
|
|
2465
1403
|
if (loading) {
|
|
2466
1404
|
return this.http.post(`${this.urlJobScheduler}`, params, this.headers);
|
|
@@ -2469,17 +1407,9 @@ class TotvsScheduleExecutionService {
|
|
|
2469
1407
|
return this.http.post(`${this.urlJobScheduler}`, params);
|
|
2470
1408
|
}
|
|
2471
1409
|
}
|
|
2472
|
-
/**
|
|
2473
|
-
* @param {?} executionParams
|
|
2474
|
-
* @param {?} loading
|
|
2475
|
-
* @return {?}
|
|
2476
|
-
*/
|
|
2477
1410
|
createExecutionForNow(executionParams, loading) {
|
|
2478
|
-
/** @type {?} */
|
|
2479
1411
|
let jobScheduleParams;
|
|
2480
|
-
/** @type {?} */
|
|
2481
1412
|
const date = new Date();
|
|
2482
|
-
/** @type {?} */
|
|
2483
1413
|
const params = JSON.parse(JSON.stringify(executionParams).replace(/\\\\/g, '*|'));
|
|
2484
1414
|
if (!params.businessParams || params.businessParams.length === 0) {
|
|
2485
1415
|
params.businessParams = [{ chave: '', valor: '' }];
|
|
@@ -2505,40 +1435,14 @@ class TotvsScheduleExecutionService {
|
|
|
2505
1435
|
return this.http.post(`${this.urlJobScheduler}`, jobScheduleParams);
|
|
2506
1436
|
}
|
|
2507
1437
|
}
|
|
2508
|
-
/**
|
|
2509
|
-
* @param {?} jobScheduleID
|
|
2510
|
-
* @param {?=} loading
|
|
2511
|
-
* @return {?}
|
|
2512
|
-
*/
|
|
2513
1438
|
getExecutionByJobScheduleID(jobScheduleID, loading = false) {
|
|
2514
|
-
/** @type {?} */
|
|
2515
1439
|
const url = `${this.urlJobExecution}?jobScheduleID=${jobScheduleID}`;
|
|
2516
|
-
return this.getExecution(url, loading).pipe(map((
|
|
2517
|
-
* @param {?} response
|
|
2518
|
-
* @return {?}
|
|
2519
|
-
*/
|
|
2520
|
-
(response) => this.transformExecution('jobScheduleID', response))));
|
|
1440
|
+
return this.getExecution(url, loading).pipe(map((response) => this.transformExecution('jobScheduleID', response)));
|
|
2521
1441
|
}
|
|
2522
|
-
/**
|
|
2523
|
-
* @param {?} executionID
|
|
2524
|
-
* @param {?=} loading
|
|
2525
|
-
* @return {?}
|
|
2526
|
-
*/
|
|
2527
1442
|
getExecutionByExecutionID(executionID, loading = false) {
|
|
2528
|
-
/** @type {?} */
|
|
2529
1443
|
const url = `${this.urlJobExecution}/${executionID}`;
|
|
2530
|
-
return this.getExecution(url, loading).pipe(map((
|
|
2531
|
-
* @param {?} response
|
|
2532
|
-
* @return {?}
|
|
2533
|
-
*/
|
|
2534
|
-
(response) => this.transformExecution('executionID', response))));
|
|
1444
|
+
return this.getExecution(url, loading).pipe(map((response) => this.transformExecution('executionID', response)));
|
|
2535
1445
|
}
|
|
2536
|
-
/**
|
|
2537
|
-
* @private
|
|
2538
|
-
* @param {?} url
|
|
2539
|
-
* @param {?} loading
|
|
2540
|
-
* @return {?}
|
|
2541
|
-
*/
|
|
2542
1446
|
getExecution(url, loading) {
|
|
2543
1447
|
if (loading) {
|
|
2544
1448
|
return this.http.get(url, this.headers);
|
|
@@ -2547,18 +1451,11 @@ class TotvsScheduleExecutionService {
|
|
|
2547
1451
|
return this.http.get(url);
|
|
2548
1452
|
}
|
|
2549
1453
|
}
|
|
2550
|
-
/**
|
|
2551
|
-
* @private
|
|
2552
|
-
* @param {?} type
|
|
2553
|
-
* @param {?} response
|
|
2554
|
-
* @return {?}
|
|
2555
|
-
*/
|
|
2556
1454
|
transformExecution(type, response) {
|
|
2557
1455
|
if (!response || !response.items || response.items.length === 0) {
|
|
2558
1456
|
return;
|
|
2559
1457
|
}
|
|
2560
1458
|
response = response.items[0];
|
|
2561
|
-
/** @type {?} */
|
|
2562
1459
|
const execStatus = new ExecutionStatus();
|
|
2563
1460
|
execStatus.jobScheduleID = response.jobScheduleID;
|
|
2564
1461
|
execStatus.executionID = response.executionID;
|
|
@@ -2567,43 +1464,15 @@ class TotvsScheduleExecutionService {
|
|
|
2567
1464
|
execStatus.status = response.status;
|
|
2568
1465
|
return execStatus;
|
|
2569
1466
|
}
|
|
2570
|
-
/**
|
|
2571
|
-
* @param {?} jobScheduleID
|
|
2572
|
-
* @param {?} intervalNum
|
|
2573
|
-
* @param {?} fncCallBack
|
|
2574
|
-
* @param {?=} loading
|
|
2575
|
-
* @return {?}
|
|
2576
|
-
*/
|
|
2577
1467
|
followUpExcByJobScheduleID(jobScheduleID, intervalNum, fncCallBack, loading = false) {
|
|
2578
1468
|
this.followUpExecution('jobScheduleID', jobScheduleID, intervalNum, fncCallBack, loading);
|
|
2579
1469
|
}
|
|
2580
|
-
/**
|
|
2581
|
-
* @param {?} executionID
|
|
2582
|
-
* @param {?} intervalNum
|
|
2583
|
-
* @param {?} fncCallBack
|
|
2584
|
-
* @param {?=} loading
|
|
2585
|
-
* @return {?}
|
|
2586
|
-
*/
|
|
2587
1470
|
followUpExcByExecutionID(executionID, intervalNum, fncCallBack, loading = false) {
|
|
2588
1471
|
this.followUpExecution('executionID', executionID, intervalNum, fncCallBack, loading);
|
|
2589
1472
|
}
|
|
2590
|
-
/**
|
|
2591
|
-
* @private
|
|
2592
|
-
* @param {?} type
|
|
2593
|
-
* @param {?} execID
|
|
2594
|
-
* @param {?} intervalNum
|
|
2595
|
-
* @param {?} fncCallBack
|
|
2596
|
-
* @param {?} loading
|
|
2597
|
-
* @return {?}
|
|
2598
|
-
*/
|
|
2599
1473
|
followUpExecution(type, execID, intervalNum, fncCallBack, loading) {
|
|
2600
1474
|
this.jobExecutionSubscription$ = null;
|
|
2601
|
-
|
|
2602
|
-
const intervalID = setInterval((/**
|
|
2603
|
-
* @return {?}
|
|
2604
|
-
*/
|
|
2605
|
-
() => {
|
|
2606
|
-
/** @type {?} */
|
|
1475
|
+
const intervalID = setInterval(() => {
|
|
2607
1476
|
const execStatus = new ExecutionStatus();
|
|
2608
1477
|
execStatus.jobScheduleID = (type === 'jobScheduleID') ? execID : '';
|
|
2609
1478
|
execStatus.executionID = (type === 'executionID') ? execID : '';
|
|
@@ -2615,47 +1484,22 @@ class TotvsScheduleExecutionService {
|
|
|
2615
1484
|
}
|
|
2616
1485
|
if (type === 'jobScheduleID') {
|
|
2617
1486
|
this.jobExecutionSubscription$ = this.getExecutionByJobScheduleID(execID, loading)
|
|
2618
|
-
.subscribe((
|
|
2619
|
-
* @param {?} response
|
|
2620
|
-
* @return {?}
|
|
2621
|
-
*/
|
|
2622
|
-
(response) => {
|
|
1487
|
+
.subscribe((response) => {
|
|
2623
1488
|
this.followUpExecReturnOk(execID, execStatus, response, intervalID, fncCallBack);
|
|
2624
|
-
}
|
|
2625
|
-
* @param {?} error
|
|
2626
|
-
* @return {?}
|
|
2627
|
-
*/
|
|
2628
|
-
(error) => {
|
|
1489
|
+
}, (error) => {
|
|
2629
1490
|
this.followUpExecReturnError(error, execStatus, intervalID, fncCallBack);
|
|
2630
|
-
})
|
|
1491
|
+
});
|
|
2631
1492
|
}
|
|
2632
1493
|
if (type === 'executionID') {
|
|
2633
1494
|
this.jobExecutionSubscription$ = this.getExecutionByExecutionID(execID, loading)
|
|
2634
|
-
.subscribe((
|
|
2635
|
-
* @param {?} response
|
|
2636
|
-
* @return {?}
|
|
2637
|
-
*/
|
|
2638
|
-
(response) => {
|
|
1495
|
+
.subscribe((response) => {
|
|
2639
1496
|
this.followUpExecReturnOk(execID, execStatus, response, intervalID, fncCallBack);
|
|
2640
|
-
}
|
|
2641
|
-
* @param {?} error
|
|
2642
|
-
* @return {?}
|
|
2643
|
-
*/
|
|
2644
|
-
(error) => {
|
|
1497
|
+
}, (error) => {
|
|
2645
1498
|
this.followUpExecReturnError(error, execStatus, intervalID, fncCallBack);
|
|
2646
|
-
})
|
|
1499
|
+
});
|
|
2647
1500
|
}
|
|
2648
|
-
}
|
|
1501
|
+
}, intervalNum);
|
|
2649
1502
|
}
|
|
2650
|
-
/**
|
|
2651
|
-
* @private
|
|
2652
|
-
* @param {?} execID
|
|
2653
|
-
* @param {?} execStatus
|
|
2654
|
-
* @param {?} response
|
|
2655
|
-
* @param {?} intervalID
|
|
2656
|
-
* @param {?} fncCallBack
|
|
2657
|
-
* @return {?}
|
|
2658
|
-
*/
|
|
2659
1503
|
followUpExecReturnOk(execID, execStatus, response, intervalID, fncCallBack) {
|
|
2660
1504
|
if (response) {
|
|
2661
1505
|
execStatus = response;
|
|
@@ -2671,16 +1515,7 @@ class TotvsScheduleExecutionService {
|
|
|
2671
1515
|
}
|
|
2672
1516
|
this.jobExecutionSubscription$ = null;
|
|
2673
1517
|
}
|
|
2674
|
-
/**
|
|
2675
|
-
* @private
|
|
2676
|
-
* @param {?} error
|
|
2677
|
-
* @param {?} execStatus
|
|
2678
|
-
* @param {?} intervalID
|
|
2679
|
-
* @param {?} fncCallBack
|
|
2680
|
-
* @return {?}
|
|
2681
|
-
*/
|
|
2682
1518
|
followUpExecReturnError(error, execStatus, intervalID, fncCallBack) {
|
|
2683
|
-
/** @type {?} */
|
|
2684
1519
|
let erroDesc = '';
|
|
2685
1520
|
if (error instanceof HttpErrorResponse) {
|
|
2686
1521
|
erroDesc = error.message;
|
|
@@ -2706,13 +1541,7 @@ class TotvsScheduleExecutionService {
|
|
|
2706
1541
|
clearInterval(intervalID);
|
|
2707
1542
|
this.jobExecutionSubscription$ = null;
|
|
2708
1543
|
}
|
|
2709
|
-
/**
|
|
2710
|
-
* @private
|
|
2711
|
-
* @param {?} num
|
|
2712
|
-
* @return {?}
|
|
2713
|
-
*/
|
|
2714
1544
|
addZero(num) {
|
|
2715
|
-
/** @type {?} */
|
|
2716
1545
|
let str = `${num}`;
|
|
2717
1546
|
if (num < 10) {
|
|
2718
1547
|
str = `0${num}`;
|
|
@@ -2720,53 +1549,22 @@ class TotvsScheduleExecutionService {
|
|
|
2720
1549
|
return str;
|
|
2721
1550
|
}
|
|
2722
1551
|
}
|
|
1552
|
+
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
2723
1553
|
TotvsScheduleExecutionService.decorators = [
|
|
2724
1554
|
{ type: Injectable }
|
|
2725
1555
|
];
|
|
2726
|
-
/**
|
|
1556
|
+
/**
|
|
1557
|
+
* @type {function(): !Array<(null|{
|
|
1558
|
+
* type: ?,
|
|
1559
|
+
* decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
|
|
1560
|
+
* })>}
|
|
1561
|
+
* @nocollapse
|
|
1562
|
+
*/
|
|
2727
1563
|
TotvsScheduleExecutionService.ctorParameters = () => [
|
|
2728
1564
|
{ type: HttpClient }
|
|
2729
|
-
];
|
|
2730
|
-
if (false) {
|
|
2731
|
-
/**
|
|
2732
|
-
* @type {?}
|
|
2733
|
-
* @private
|
|
2734
|
-
*/
|
|
2735
|
-
TotvsScheduleExecutionService.prototype.headers;
|
|
2736
|
-
/**
|
|
2737
|
-
* @type {?}
|
|
2738
|
-
* @private
|
|
2739
|
-
*/
|
|
2740
|
-
TotvsScheduleExecutionService.prototype.urlCadServidor;
|
|
2741
|
-
/**
|
|
2742
|
-
* @type {?}
|
|
2743
|
-
* @private
|
|
2744
|
-
*/
|
|
2745
|
-
TotvsScheduleExecutionService.prototype.urlJobScheduler;
|
|
2746
|
-
/**
|
|
2747
|
-
* @type {?}
|
|
2748
|
-
* @private
|
|
2749
|
-
*/
|
|
2750
|
-
TotvsScheduleExecutionService.prototype.urlJobExecution;
|
|
2751
|
-
/**
|
|
2752
|
-
* @type {?}
|
|
2753
|
-
* @private
|
|
2754
|
-
*/
|
|
2755
|
-
TotvsScheduleExecutionService.prototype.jobExecutionSubscription$;
|
|
2756
|
-
/** @type {?} */
|
|
2757
|
-
TotvsScheduleExecutionService.prototype.http;
|
|
2758
|
-
}
|
|
1565
|
+
];
|
|
2759
1566
|
|
|
2760
|
-
/**
|
|
2761
|
-
* @fileoverview added by tsickle
|
|
2762
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2763
|
-
*/
|
|
2764
1567
|
class TotvsScheduleExecutionComponent {
|
|
2765
|
-
/**
|
|
2766
|
-
* @param {?} poI18nService
|
|
2767
|
-
* @param {?} rpwService
|
|
2768
|
-
* @param {?} poNotification
|
|
2769
|
-
*/
|
|
2770
1568
|
constructor(poI18nService, rpwService, poNotification) {
|
|
2771
1569
|
this.poI18nService = poI18nService;
|
|
2772
1570
|
this.rpwService = rpwService;
|
|
@@ -2779,9 +1577,6 @@ class TotvsScheduleExecutionComponent {
|
|
|
2779
1577
|
this.jsonObject = {};
|
|
2780
1578
|
this.literals = {};
|
|
2781
1579
|
}
|
|
2782
|
-
/**
|
|
2783
|
-
* @return {?}
|
|
2784
|
-
*/
|
|
2785
1580
|
ngOnInit() {
|
|
2786
1581
|
/* VERIFICAR COMO FICARÁ A TRADUÇÃO
|
|
2787
1582
|
forkJoin(
|
|
@@ -2793,9 +1588,6 @@ class TotvsScheduleExecutionComponent {
|
|
|
2793
1588
|
});*/
|
|
2794
1589
|
this.setupComponents();
|
|
2795
1590
|
}
|
|
2796
|
-
/**
|
|
2797
|
-
* @return {?}
|
|
2798
|
-
*/
|
|
2799
1591
|
setupComponents() {
|
|
2800
1592
|
this.executionTypeOptions = [
|
|
2801
1593
|
{ label: 'Executar Hoje', value: 1 },
|
|
@@ -2827,46 +1619,25 @@ class TotvsScheduleExecutionComponent {
|
|
|
2827
1619
|
this.model.repeatType = 1;
|
|
2828
1620
|
this.model.repeatExecution = false;
|
|
2829
1621
|
}
|
|
2830
|
-
/**
|
|
2831
|
-
* @param {?} schParam
|
|
2832
|
-
* @return {?}
|
|
2833
|
-
*/
|
|
2834
1622
|
setScheduleParameters(schParam) {
|
|
2835
1623
|
if (!schParam) {
|
|
2836
1624
|
return;
|
|
2837
1625
|
}
|
|
2838
1626
|
this.model = schParam;
|
|
2839
1627
|
}
|
|
2840
|
-
/**
|
|
2841
|
-
* @param {?} value
|
|
2842
|
-
* @return {?}
|
|
2843
|
-
*/
|
|
2844
1628
|
fieldRpwServiceFormat(value) {
|
|
2845
1629
|
return `${value.code} - ${value.name}`;
|
|
2846
1630
|
}
|
|
2847
|
-
/**
|
|
2848
|
-
* @return {?}
|
|
2849
|
-
*/
|
|
2850
1631
|
isExecutionSchedule() {
|
|
2851
1632
|
return (this.model.executionType === 2);
|
|
2852
1633
|
}
|
|
2853
|
-
/**
|
|
2854
|
-
* @return {?}
|
|
2855
|
-
*/
|
|
2856
1634
|
isRepeatExecution() {
|
|
2857
1635
|
return this.model.repeatExecution;
|
|
2858
1636
|
}
|
|
2859
|
-
/**
|
|
2860
|
-
* @return {?}
|
|
2861
|
-
*/
|
|
2862
1637
|
isFrenquency() {
|
|
2863
1638
|
return (this.model.frequency === 'yes');
|
|
2864
1639
|
}
|
|
2865
|
-
/**
|
|
2866
|
-
* @return {?}
|
|
2867
|
-
*/
|
|
2868
1640
|
changeRepeatExecution() {
|
|
2869
|
-
/** @type {?} */
|
|
2870
1641
|
const date = new Date();
|
|
2871
1642
|
if (!this.model.execAppointHourInit) {
|
|
2872
1643
|
this.model.execAppointHourInit = `${this.addZero(date.getHours())}:${this.addZero(date.getMinutes())}`;
|
|
@@ -2880,49 +1651,26 @@ class TotvsScheduleExecutionComponent {
|
|
|
2880
1651
|
this.model.frequencyType = 'hour';
|
|
2881
1652
|
this.model.frequencyValue = 0;
|
|
2882
1653
|
}
|
|
2883
|
-
/**
|
|
2884
|
-
* @return {?}
|
|
2885
|
-
*/
|
|
2886
1654
|
changeExecutionType() {
|
|
2887
|
-
/** @type {?} */
|
|
2888
1655
|
const date = new Date();
|
|
2889
1656
|
this.model.execAppointDate = date;
|
|
2890
1657
|
this.model.execAppointHour = `${this.addZero(date.getHours())}:${this.addZero(date.getMinutes())}`;
|
|
2891
1658
|
}
|
|
2892
|
-
/**
|
|
2893
|
-
* @return {?}
|
|
2894
|
-
*/
|
|
2895
1659
|
changeTypeFrequency() {
|
|
2896
1660
|
}
|
|
2897
|
-
/**
|
|
2898
|
-
* @param {?} codTab
|
|
2899
|
-
* @return {?}
|
|
2900
|
-
*/
|
|
2901
1661
|
getActiveTab(codTab) {
|
|
2902
1662
|
return (this.model.repeatType === codTab);
|
|
2903
1663
|
}
|
|
2904
|
-
/**
|
|
2905
|
-
* @param {?} codTab
|
|
2906
|
-
* @return {?}
|
|
2907
|
-
*/
|
|
2908
1664
|
setActiveTab(codTab) {
|
|
2909
1665
|
this.model.repeatType = codTab;
|
|
2910
1666
|
}
|
|
2911
|
-
/**
|
|
2912
|
-
* @param {?} num
|
|
2913
|
-
* @return {?}
|
|
2914
|
-
*/
|
|
2915
1667
|
addZero(num) {
|
|
2916
|
-
/** @type {?} */
|
|
2917
1668
|
let str = `${num}`;
|
|
2918
1669
|
if (num < 10) {
|
|
2919
1670
|
str = `0${num}`;
|
|
2920
1671
|
}
|
|
2921
1672
|
return str;
|
|
2922
1673
|
}
|
|
2923
|
-
/**
|
|
2924
|
-
* @return {?}
|
|
2925
|
-
*/
|
|
2926
1674
|
executeSchedule() {
|
|
2927
1675
|
if (this.disabledParams) {
|
|
2928
1676
|
return;
|
|
@@ -2936,7 +1684,6 @@ class TotvsScheduleExecutionComponent {
|
|
|
2936
1684
|
this.jsonObject.recurrent = this.model.repeatExecution;
|
|
2937
1685
|
this.jsonObject.executionParameter = {};
|
|
2938
1686
|
if (this.model.executionType === 1) {
|
|
2939
|
-
/** @type {?} */
|
|
2940
1687
|
const date = new Date();
|
|
2941
1688
|
this.jsonObject.firstExecution = `${date.getFullYear()}-${(date.getMonth() + 1)}-${date.getDate()}T${this.addZero(date.getHours())}:${this.addZero(date.getMinutes())}:00.000Z`;
|
|
2942
1689
|
}
|
|
@@ -2951,12 +1698,9 @@ class TotvsScheduleExecutionComponent {
|
|
|
2951
1698
|
this.jsonObject.executionParameter.parametros[4] = {};
|
|
2952
1699
|
this.jsonObject.executionParameter.parametros[4].parametros_negocio = this.parameters;
|
|
2953
1700
|
// Executa hoje ou agendada
|
|
2954
|
-
this.rpwService.createExecution(this.jsonObject, this.loading).subscribe((
|
|
2955
|
-
* @return {?}
|
|
2956
|
-
*/
|
|
2957
|
-
() => {
|
|
1701
|
+
this.rpwService.createExecution(this.jsonObject, this.loading).subscribe(() => {
|
|
2958
1702
|
this.poNotification.success('Agendamento realizado com sucesso !');
|
|
2959
|
-
})
|
|
1703
|
+
});
|
|
2960
1704
|
if (this.model.repeatExecution) {
|
|
2961
1705
|
if (this.model.repeatType === 1) {
|
|
2962
1706
|
this.jsonObject.daily = {
|
|
@@ -2991,19 +1735,11 @@ class TotvsScheduleExecutionComponent {
|
|
|
2991
1735
|
};
|
|
2992
1736
|
}
|
|
2993
1737
|
// Executa a diária, semanal ou mensal
|
|
2994
|
-
this.rpwService.createExecution(this.jsonObject, this.loading).subscribe((
|
|
2995
|
-
|
|
2996
|
-
*/
|
|
2997
|
-
() => {
|
|
2998
|
-
}));
|
|
1738
|
+
this.rpwService.createExecution(this.jsonObject, this.loading).subscribe(() => {
|
|
1739
|
+
});
|
|
2999
1740
|
}
|
|
3000
1741
|
this.endExecution.emit(this.model);
|
|
3001
1742
|
}
|
|
3002
|
-
/**
|
|
3003
|
-
* @param {?} value
|
|
3004
|
-
* @param {?} type
|
|
3005
|
-
* @return {?}
|
|
3006
|
-
*/
|
|
3007
1743
|
getHourOrMinute(value, type) {
|
|
3008
1744
|
if (type === 'h') {
|
|
3009
1745
|
return +value.substring(0, 2);
|
|
@@ -3012,11 +1748,6 @@ class TotvsScheduleExecutionComponent {
|
|
|
3012
1748
|
return +value.substring(3, 6);
|
|
3013
1749
|
}
|
|
3014
1750
|
}
|
|
3015
|
-
/**
|
|
3016
|
-
* @param {?} hourInit
|
|
3017
|
-
* @param {?} hourFinal
|
|
3018
|
-
* @return {?}
|
|
3019
|
-
*/
|
|
3020
1751
|
compareHour(hourInit, hourFinal) {
|
|
3021
1752
|
if (hourInit === hourFinal) {
|
|
3022
1753
|
return false;
|
|
@@ -3029,9 +1760,6 @@ class TotvsScheduleExecutionComponent {
|
|
|
3029
1760
|
}
|
|
3030
1761
|
return true;
|
|
3031
1762
|
}
|
|
3032
|
-
/**
|
|
3033
|
-
* @return {?}
|
|
3034
|
-
*/
|
|
3035
1763
|
validate() {
|
|
3036
1764
|
if (!this.scheduleExecutionForm.valid) {
|
|
3037
1765
|
this.poNotification.error('Verifique as inconsistências em tela.');
|
|
@@ -3072,19 +1800,27 @@ class TotvsScheduleExecutionComponent {
|
|
|
3072
1800
|
return true;
|
|
3073
1801
|
}
|
|
3074
1802
|
}
|
|
1803
|
+
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
3075
1804
|
TotvsScheduleExecutionComponent.decorators = [
|
|
3076
1805
|
{ type: Component, args: [{
|
|
3077
1806
|
selector: 'app-totvs-schedule-execution',
|
|
3078
1807
|
template: "<form #scheduleExecutionForm=\"ngForm\">\r\n <div class=\"po-row po-sm-12 po-md-12 po-lg-12 po-xl-12\">\r\n <po-radio-group \r\n class=\"po-sm-12 po-md-12 po-lg-12 po-xl-12\"\r\n name=\"executionType\"\r\n p-label=\"Data de Execu\u00E7\u00E3o\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.executionType\"\r\n [p-options]=\"executionTypeOptions\"\r\n (p-change)=\"changeExecutionType()\">\r\n </po-radio-group>\r\n\r\n <po-datepicker *ngIf=isExecutionSchedule()\r\n class=\"po-sm-6 po-md-6 po-lg-6 po-xl-6\"\r\n name=\"model.execAppointDate\"\r\n p-label=\"Agendar para\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.execAppointDate\">\r\n </po-datepicker>\r\n\r\n <po-input *ngIf=isExecutionSchedule()\r\n class=\"po-sm-6 po-md-6 po-lg-6 po-xl-6\"\r\n name=\"execAppointHour\"\r\n p-label=\"Hora\"\r\n p-mask=\"99:99\"\r\n p-mask-format-model=\"true\"\r\n p-pattern=\"^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$\"\r\n p-error-pattern=\"Hora inv\u00E1lida\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.execAppointHour\">\r\n </po-input>\r\n </div>\r\n\r\n <div class=\"po-row po-sm-12 po-md-12 po-lg-12 po-xl-12\">\r\n <po-lookup\r\n class=\"po-sm-12 po-md-12 po-lg-12 po-xl-12\"\r\n name=\"executionServer\"\r\n p-label=\"Servidor de Execu\u00E7\u00E3o\"\r\n p-placeholder=\"Servidor de Execu\u00E7\u00E3o\"\r\n [p-columns]=\"zoomRpwServiceColumns\"\r\n [p-field-format]=\"fieldRpwServiceFormat\"\r\n [p-filter-service]=\"rpwService\"\r\n p-field-label=\"name\"\r\n p-field-value=\"code\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.executionServer\">\r\n </po-lookup>\r\n </div>\r\n\r\n <div class=\"po-row po-sm-12 po-md-12 po-lg-12 po-xl-12\">\r\n <po-switch\r\n class=\"po-sm-6 po-md-6 po-lg-6 po-xl-6\"\r\n name=\"repeatExecution\"\r\n p-label=\"Repetir ocorr\u00EAncia ?\"\r\n p-label-off=\"N\u00E3o\"\r\n p-label-on=\"Sim\"\r\n [(ngModel)]=\"model.repeatExecution\"\r\n [p-disabled]=\"disabledParams\"\r\n (click)=\"changeRepeatExecution()\">\r\n </po-switch>\r\n </div>\r\n\r\n <div class=\"po-row\" *ngIf=\"isRepeatExecution()\">\r\n \r\n <po-tabs>\r\n\r\n <po-tab \r\n p-label=\"Di\u00E1ria\" \r\n [p-active]=\"getActiveTab(1)\" \r\n (p-click)=\"setActiveTab(1)\">\r\n\r\n <div class=\"po-sm-6 po-md-6 po-lg-6 po-xl-6\">\r\n <po-radio-group \r\n class=\"po-sm-12 po-md-12 po-lg-12 po-xl-12\"\r\n name=\"frequencyDaily\"\r\n p-label=\"Frequ\u00EAncia\"\r\n p-columns=1\r\n [(ngModel)]=\"model.frequency\"\r\n [p-disabled]=\"disabledParams\"\r\n [p-options]=\"frequencyOptions\"\r\n (p-change)=\"changeTypeFrequency()\">\r\n </po-radio-group>\r\n </div>\r\n \r\n <div class=\"po-sm-6 po-md-6 po-lg-6 po-xl-6\"> \r\n <po-input\r\n class=\"po-sm-6 po-md-6 po-lg-6 po-xl-6\"\r\n name=\"execAppointHourInitDaily\"\r\n p-label=\"Hora In\u00EDcio\"\r\n p-mask=\"99:99\"\r\n p-mask-format-model=\"true\"\r\n p-pattern=\"^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$\"\r\n p-error-pattern=\"Hora inv\u00E1lida\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.execAppointHourInit\">\r\n </po-input>\r\n \r\n <po-input *ngIf=\"isFrenquency()\"\r\n class=\"po-sm-6 po-md-6 po-lg-6 po-xl-6\"\r\n name=\"execAppointHourFinalDaily\"\r\n p-label=\"Hora Fim\"\r\n p-mask=\"99:99\"\r\n p-mask-format-model=\"true\"\r\n p-pattern=\"^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$\"\r\n p-error-pattern=\"Hora inv\u00E1lida\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.execAppointHourFinal\">\r\n </po-input>\r\n \r\n <po-number *ngIf=\"isFrenquency()\"\r\n class=\"po-sm-5 po-md-5 po-lg-5 po-xl-5\"\r\n name=\"frequencyValueDaily\"\r\n p-label=\"A cada\"\r\n p-minlength=\"1\"\r\n p-maxlength=\"3\"\r\n p-min=\"0\"\r\n p-max=\"999\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.frequencyValue\">\r\n </po-number>\r\n \r\n <po-select *ngIf=\"isFrenquency()\"\r\n class=\"po-mt-3 po-sm-7 po-md-7 po-lg-7 po-xl-7\"\r\n name=\"frequencyTypeDaily\"\r\n p-label=\"\"\r\n [p-options]=\"frequencyTypeOptions\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.frequencyType\">\r\n </po-select>\r\n </div>\r\n </po-tab>\r\n\r\n <po-tab \r\n p-label=\"Semanal\"\r\n [p-active]=\"getActiveTab(2)\"\r\n (p-click)=\"setActiveTab(2)\">\r\n\r\n <div class=\"po-row po-sm-12 po-md-12 po-lg-12 po-xl-12\">\r\n <po-multiselect\r\n class=\"po-sm-12 po-md-12 po-lg-12 po-xl-12\"\r\n name=\"selectWeeklys\"\r\n p-label=\"Dias da Semana\"\r\n p-placeholder=\"Escolha os dias da semana\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.selectWeeklys\"\r\n [p-options]=\"weeklyOptions\">\r\n </po-multiselect>\r\n </div>\r\n\r\n <div class=\"po-sm-6 po-md-6 po-lg-6 po-xl-6\">\r\n <po-radio-group \r\n class=\"po-sm-12 po-md-12 po-lg-12 po-xl-12\"\r\n name=\"frequencyWeekly\"\r\n p-label=\"Frequ\u00EAncia\"\r\n p-columns=1\r\n [(ngModel)]=\"model.frequency\"\r\n [p-disabled]=\"disabledParams\"\r\n [p-options]=\"frequencyOptions\"\r\n (p-change)=\"changeTypeFrequency()\">\r\n </po-radio-group>\r\n </div>\r\n\r\n <div class=\"po-sm-6 po-md-6 po-lg-6 po-xl-6\">\r\n <po-input\r\n class=\"po-sm-6 po-md-6 po-lg-6 po-xl-6\"\r\n name=\"execAppointHourInitWeekly\"\r\n p-label=\"Hora In\u00EDcio\"\r\n p-mask=\"99:99\"\r\n p-mask-format-model=\"true\"\r\n p-pattern=\"^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$\"\r\n p-error-pattern=\"Hora inv\u00E1lida\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.execAppointHourInit\">\r\n </po-input>\r\n\r\n <po-input *ngIf=\"isFrenquency()\"\r\n class=\"po-sm-6 po-md-6 po-lg-6 po-xl-6\"\r\n name=\"execAppointHourFinalWeekly\"\r\n p-label=\"Hora Fim\"\r\n p-mask=\"99:99\"\r\n p-mask-format-model=\"true\"\r\n p-pattern=\"^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$\"\r\n p-error-pattern=\"Hora inv\u00E1lida\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.execAppointHourFinal\">\r\n </po-input>\r\n\r\n <po-number *ngIf=\"isFrenquency()\"\r\n class=\"po-sm-5 po-md-5 po-lg-5 po-xl-5\"\r\n name=\"frequencyValueWeekly\"\r\n p-label=\"A cada\"\r\n p-minlength=\"1\"\r\n p-maxlength=\"3\"\r\n p-min=\"0\"\r\n p-max=\"999\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.frequencyValue\">\r\n </po-number>\r\n\r\n <po-select *ngIf=\"isFrenquency()\"\r\n class=\"po-mt-3 po-sm-7 po-md-7 po-lg-7 po-xl-7\"\r\n name=\"frequencyTypeWeekly\"\r\n p-label=\"\"\r\n [p-options]=\"frequencyTypeOptions\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.frequencyType\">\r\n </po-select>\r\n </div>\r\n </po-tab>\r\n\r\n <po-tab \r\n p-label=\"Mensal\" \r\n [p-active]=\"getActiveTab(3)\" \r\n (p-click)=\"setActiveTab(3)\">\r\n\r\n <div class=\"po-row po-sm-12 po-md-12 po-lg-12 po-xl-12\">\r\n <po-number\r\n class=\"po-sm-3 po-md-3 po-lg-3 po-xl-3\"\r\n name=\"dayOfMonth\"\r\n p-label=\"Dia do m\u00EAs\"\r\n p-minlength=\"1\"\r\n p-maxlength=\"2\"\r\n p-min=\"0\"\r\n p-max=\"31\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.dayOfMonth\">\r\n </po-number>\r\n </div>\r\n\r\n <div class=\"po-row po-sm-6 po-md-6 po-lg-6 po-xl-6\">\r\n <po-radio-group \r\n class=\"po-sm-12 po-md-12 po-lg-12 po-xl-12\"\r\n name=\"frequencyMonthly\"\r\n p-label=\"Frequ\u00EAncia\"\r\n p-columns=1\r\n [(ngModel)]=\"model.frequency\"\r\n [p-disabled]=\"disabledParams\"\r\n [p-options]=\"frequencyOptions\"\r\n (p-change)=\"changeTypeFrequency()\">\r\n </po-radio-group>\r\n </div>\r\n\r\n <div class=\"po-row po-sm-6 po-md-6 po-lg-6 po-xl-6\">\r\n <po-input\r\n class=\"po-sm-6 po-md-6 po-lg-6 po-xl-6\"\r\n name=\"execAppointHourInitMonthly\"\r\n p-label=\"Hora In\u00EDcio\"\r\n p-mask=\"99:99\"\r\n p-mask-format-model=\"true\"\r\n p-pattern=\"^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$\"\r\n p-error-pattern=\"Hora inv\u00E1lida\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.execAppointHourInit\">\r\n </po-input>\r\n\r\n <po-input *ngIf=\"isFrenquency()\"\r\n class=\"po-sm-6 po-md-6 po-lg-6 po-xl-6\"\r\n name=\"execAppointHourFinalWeekly\"\r\n p-label=\"Hora Fim\"\r\n p-mask=\"99:99\"\r\n p-mask-format-model=\"true\"\r\n p-pattern=\"^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$\"\r\n p-error-pattern=\"Hora inv\u00E1lida\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.execAppointHourFinal\">\r\n </po-input>\r\n\r\n <po-number *ngIf=\"isFrenquency()\"\r\n class=\"po-sm-5 po-md-5 po-lg-5 po-xl-5\"\r\n name=\"frequencyValueWeekly\"\r\n p-label=\"A cada\"\r\n p-minlength=\"1\"\r\n p-maxlength=\"3\"\r\n p-min=\"0\"\r\n p-max=\"999\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.frequencyValue\">\r\n </po-number>\r\n\r\n <po-select *ngIf=\"isFrenquency()\"\r\n class=\"po-mt-3 po-sm-7 po-md-7 po-lg-7 po-xl-7\"\r\n name=\"frequencyTypeWeekly\"\r\n p-label=\"\"\r\n [p-options]=\"frequencyTypeOptions\"\r\n [p-disabled]=\"disabledParams\"\r\n [(ngModel)]=\"model.frequencyType\">\r\n </po-select>\r\n </div>\r\n </po-tab>\r\n </po-tabs>\r\n </div>\r\n\r\n <div class=\"po-sm-12 po-md-12 po-lg-12 po-xl-12\" style=\"padding-top: 15px;\">\r\n <po-button\r\n style=\"float: right;\"\r\n p-label=\"Gerar Agendamento RPW\"\r\n [p-disabled]=\"disabledParams\"\r\n (click)=\"executeSchedule()\">\r\n </po-button>\r\n </div>\r\n</form>\r\n",
|
|
3079
1808
|
styles: [""]
|
|
3080
|
-
}] }
|
|
1809
|
+
},] }
|
|
3081
1810
|
];
|
|
3082
|
-
/**
|
|
1811
|
+
/**
|
|
1812
|
+
* @type {function(): !Array<(null|{
|
|
1813
|
+
* type: ?,
|
|
1814
|
+
* decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
|
|
1815
|
+
* })>}
|
|
1816
|
+
* @nocollapse
|
|
1817
|
+
*/
|
|
3083
1818
|
TotvsScheduleExecutionComponent.ctorParameters = () => [
|
|
3084
1819
|
{ type: PoI18nService },
|
|
3085
1820
|
{ type: TotvsScheduleExecutionService },
|
|
3086
1821
|
{ type: PoNotificationService }
|
|
3087
1822
|
];
|
|
1823
|
+
/** @type {!Object<string, !Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
|
|
3088
1824
|
TotvsScheduleExecutionComponent.propDecorators = {
|
|
3089
1825
|
scheduleExecutionForm: [{ type: ViewChild, args: ['scheduleExecutionForm', { static: true },] }],
|
|
3090
1826
|
programName: [{ type: Input }],
|
|
@@ -3095,86 +1831,25 @@ TotvsScheduleExecutionComponent.propDecorators = {
|
|
|
3095
1831
|
disabledParams: [{ type: Input }],
|
|
3096
1832
|
loading: [{ type: Input }],
|
|
3097
1833
|
endExecution: [{ type: Output }]
|
|
3098
|
-
};
|
|
3099
|
-
if (false) {
|
|
3100
|
-
/** @type {?} */
|
|
3101
|
-
TotvsScheduleExecutionComponent.prototype.scheduleExecutionForm;
|
|
3102
|
-
/** @type {?} */
|
|
3103
|
-
TotvsScheduleExecutionComponent.prototype.programName;
|
|
3104
|
-
/** @type {?} */
|
|
3105
|
-
TotvsScheduleExecutionComponent.prototype.externalName;
|
|
3106
|
-
/** @type {?} */
|
|
3107
|
-
TotvsScheduleExecutionComponent.prototype.programEMS5;
|
|
3108
|
-
/** @type {?} */
|
|
3109
|
-
TotvsScheduleExecutionComponent.prototype.programVersion;
|
|
3110
|
-
/** @type {?} */
|
|
3111
|
-
TotvsScheduleExecutionComponent.prototype.parameters;
|
|
3112
|
-
/** @type {?} */
|
|
3113
|
-
TotvsScheduleExecutionComponent.prototype.disabledParams;
|
|
3114
|
-
/** @type {?} */
|
|
3115
|
-
TotvsScheduleExecutionComponent.prototype.loading;
|
|
3116
|
-
/** @type {?} */
|
|
3117
|
-
TotvsScheduleExecutionComponent.prototype.endExecution;
|
|
3118
|
-
/** @type {?} */
|
|
3119
|
-
TotvsScheduleExecutionComponent.prototype.executionTypeOptions;
|
|
3120
|
-
/** @type {?} */
|
|
3121
|
-
TotvsScheduleExecutionComponent.prototype.frequencyOptions;
|
|
3122
|
-
/** @type {?} */
|
|
3123
|
-
TotvsScheduleExecutionComponent.prototype.frequencyTypeOptions;
|
|
3124
|
-
/** @type {?} */
|
|
3125
|
-
TotvsScheduleExecutionComponent.prototype.weeklyOptions;
|
|
3126
|
-
/** @type {?} */
|
|
3127
|
-
TotvsScheduleExecutionComponent.prototype.zoomRpwServiceColumns;
|
|
3128
|
-
/** @type {?} */
|
|
3129
|
-
TotvsScheduleExecutionComponent.prototype.model;
|
|
3130
|
-
/**
|
|
3131
|
-
* @type {?}
|
|
3132
|
-
* @private
|
|
3133
|
-
*/
|
|
3134
|
-
TotvsScheduleExecutionComponent.prototype.jsonObject;
|
|
3135
|
-
/** @type {?} */
|
|
3136
|
-
TotvsScheduleExecutionComponent.prototype.literals;
|
|
3137
|
-
/** @type {?} */
|
|
3138
|
-
TotvsScheduleExecutionComponent.prototype.poI18nService;
|
|
3139
|
-
/** @type {?} */
|
|
3140
|
-
TotvsScheduleExecutionComponent.prototype.rpwService;
|
|
3141
|
-
/** @type {?} */
|
|
3142
|
-
TotvsScheduleExecutionComponent.prototype.poNotification;
|
|
3143
|
-
}
|
|
1834
|
+
};
|
|
3144
1835
|
|
|
3145
|
-
/**
|
|
3146
|
-
* @fileoverview added by tsickle
|
|
3147
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3148
|
-
*/
|
|
3149
1836
|
class DtsDateFormatPipe {
|
|
3150
|
-
/**
|
|
3151
|
-
* @param {?} value
|
|
3152
|
-
* @param {?=} format
|
|
3153
|
-
* @return {?}
|
|
3154
|
-
*/
|
|
3155
1837
|
transform(value, format = 'dd/MM/yyyy') {
|
|
3156
1838
|
const { 0: year, 1: month, 2: day } = value.split('-');
|
|
3157
|
-
/** @type {?} */
|
|
3158
1839
|
const formattedDate = format.replace('dd', day)
|
|
3159
1840
|
.replace('MM', month)
|
|
3160
1841
|
.replace('yyyy', year);
|
|
3161
1842
|
return formattedDate;
|
|
3162
1843
|
}
|
|
3163
1844
|
}
|
|
1845
|
+
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
3164
1846
|
DtsDateFormatPipe.decorators = [
|
|
3165
1847
|
{ type: Pipe, args: [{
|
|
3166
1848
|
name: 'dtsDateFormat'
|
|
3167
1849
|
},] }
|
|
3168
1850
|
];
|
|
3169
1851
|
|
|
3170
|
-
/**
|
|
3171
|
-
* @fileoverview added by tsickle
|
|
3172
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3173
|
-
*/
|
|
3174
1852
|
class DtsBackofficeUtilsModule {
|
|
3175
|
-
/**
|
|
3176
|
-
* @return {?}
|
|
3177
|
-
*/
|
|
3178
1853
|
static forRoot() {
|
|
3179
1854
|
return {
|
|
3180
1855
|
ngModule: DtsBackofficeUtilsModule,
|
|
@@ -3182,6 +1857,7 @@ class DtsBackofficeUtilsModule {
|
|
|
3182
1857
|
};
|
|
3183
1858
|
}
|
|
3184
1859
|
}
|
|
1860
|
+
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
|
|
3185
1861
|
DtsBackofficeUtilsModule.decorators = [
|
|
3186
1862
|
{ type: NgModule, args: [{
|
|
3187
1863
|
declarations: [
|
|
@@ -3204,14 +1880,13 @@ DtsBackofficeUtilsModule.decorators = [
|
|
|
3204
1880
|
},] }
|
|
3205
1881
|
];
|
|
3206
1882
|
|
|
3207
|
-
|
|
3208
|
-
*
|
|
3209
|
-
|
|
3210
|
-
|
|
1883
|
+
/*
|
|
1884
|
+
* Public API Surface of dts-backoffice-util
|
|
1885
|
+
*/
|
|
1886
|
+
// Pipes
|
|
3211
1887
|
|
|
3212
1888
|
/**
|
|
3213
|
-
*
|
|
3214
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1889
|
+
* Generated bundle index. Do not edit.
|
|
3215
1890
|
*/
|
|
3216
1891
|
|
|
3217
1892
|
export { BreadcrumbControlService, CacheParamsService, DateUtil, DisclaimerUtil, DownloadDataParams, DtsBackofficeUtilsModule, DtsDateFormatPipe, ExecutionParameters, ExecutionStatus, FieldValidationUtil, FileUtil, FilterRangeUtil, GenericFunctionsUtils, MenuDatasulService, ProfileService, ReportFormats, ReportService, ScheduleParameters, TotvsScheduleExecutionComponent, TotvsScheduleExecutionService, TranslateService, UserLoginService };
|