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