dts-backoffice-util 3.0.0 → 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/bundles/dts-backoffice-util.umd.js +111 -1472
- 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 -7
- package/esm2015/lib/components/totvs-schedule-execution/totvs-schedule-execution.component.js +6 -131
- package/esm2015/lib/components/totvs-schedule-execution/totvs-schedule-execution.model.js +1 -126
- package/esm2015/lib/components/totvs-schedule-execution/totvs-schedule-execution.service.js +11 -172
- package/esm2015/lib/dts-backoffice-util.module.js +1 -9
- package/esm2015/lib/interfaces/filter-range.interface.js +2 -48
- package/esm2015/lib/interfaces/totvs-response.interface.js +2 -17
- package/esm2015/lib/model/session-info.model.js +1 -117
- package/esm2015/lib/pipes/dts-date-format.pipe.js +1 -12
- package/esm2015/lib/services/breadcrumb-control.service.js +1 -44
- package/esm2015/lib/services/cache-params.service.js +2 -24
- package/esm2015/lib/services/menu-datasul.service.js +1 -18
- package/esm2015/lib/services/profile.service.js +9 -78
- package/esm2015/lib/services/report.service.js +12 -81
- package/esm2015/lib/services/session-info.service.js +4 -27
- package/esm2015/lib/services/translate.service.js +1 -16
- package/esm2015/lib/utils/date.util.js +1 -40
- package/esm2015/lib/utils/disclaimer.util.js +33 -318
- package/esm2015/lib/utils/field-validation.util.js +1 -97
- package/esm2015/lib/utils/file.util.js +7 -103
- package/esm2015/lib/utils/filter-range.util.js +1 -21
- package/esm2015/lib/utils/generic-functions.utils.js +12 -138
- package/esm2015/public-api.js +22 -26
- package/fesm2015/dts-backoffice-util.js +108 -1517
- package/fesm2015/dts-backoffice-util.js.map +1 -1
- package/package.json +5 -5
- package/CHANGELOG.md +0 -159
|
@@ -4,23 +4,12 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['dts-backoffice-util'] = {}, global.ng.core, global.ng.common.http, global.rxjs, global.rxjs.operators, global.ngComponents, global.ng.forms, global.ng.common));
|
|
5
5
|
}(this, (function (exports, i0, i1, rxjs, operators, ngComponents, forms, common) { 'use strict';
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* @fileoverview added by tsickle
|
|
9
|
-
* Generated from: lib/services/session-info.service.ts
|
|
10
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
11
|
-
*/
|
|
12
7
|
var UserLoginService = /** @class */ (function () {
|
|
13
|
-
/**
|
|
14
|
-
* @param {?} http
|
|
15
|
-
*/
|
|
16
8
|
function UserLoginService(http) {
|
|
17
9
|
this.http = http;
|
|
18
10
|
this.apiUrl = '/totvs-menu/rest/getSessionInfo';
|
|
19
11
|
this.userLogin = undefined;
|
|
20
12
|
}
|
|
21
|
-
/**
|
|
22
|
-
* @return {?}
|
|
23
|
-
*/
|
|
24
13
|
UserLoginService.prototype.getUserLogin = function () {
|
|
25
14
|
var _this = this;
|
|
26
15
|
if (localStorage.getItem('username')) {
|
|
@@ -31,17 +20,15 @@
|
|
|
31
20
|
}
|
|
32
21
|
else {
|
|
33
22
|
return this.http.get("" + this.apiUrl)
|
|
34
|
-
.pipe(operators.map((
|
|
35
|
-
* @param {?} response
|
|
36
|
-
* @return {?}
|
|
37
|
-
*/function (response) {
|
|
23
|
+
.pipe(operators.map(function (response) {
|
|
38
24
|
_this.userLogin = response.userName;
|
|
39
25
|
return response.userName;
|
|
40
|
-
}))
|
|
26
|
+
}));
|
|
41
27
|
}
|
|
42
28
|
};
|
|
43
29
|
return UserLoginService;
|
|
44
30
|
}());
|
|
31
|
+
/** @nocollapse */ UserLoginService.ɵprov = i0.ɵɵdefineInjectable({ factory: function UserLoginService_Factory() { return new UserLoginService(i0.ɵɵinject(i1.HttpClient)); }, token: UserLoginService, providedIn: "root" });
|
|
45
32
|
UserLoginService.decorators = [
|
|
46
33
|
{ type: i0.Injectable, args: [{
|
|
47
34
|
providedIn: 'root'
|
|
@@ -50,110 +37,36 @@
|
|
|
50
37
|
/** @nocollapse */
|
|
51
38
|
UserLoginService.ctorParameters = function () { return [
|
|
52
39
|
{ type: i1.HttpClient }
|
|
53
|
-
]; };
|
|
54
|
-
/** @nocollapse */ UserLoginService.ɵprov = i0.ɵɵdefineInjectable({ factory: function UserLoginService_Factory() { return new UserLoginService(i0.ɵɵinject(i1.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
|
-
/**
|
|
70
|
-
* @record
|
|
71
|
-
*/
|
|
72
|
-
function IProfile() { }
|
|
73
|
-
if (false) {
|
|
74
|
-
/** @type {?} */
|
|
75
|
-
IProfile.prototype.pageId;
|
|
76
|
-
/** @type {?} */
|
|
77
|
-
IProfile.prototype.dataCode;
|
|
78
|
-
/** @type {?} */
|
|
79
|
-
IProfile.prototype.userCode;
|
|
80
|
-
/** @type {?|undefined} */
|
|
81
|
-
IProfile.prototype.dataValue;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* @record
|
|
85
|
-
*/
|
|
86
|
-
function IProfileResponse() { }
|
|
87
|
-
if (false) {
|
|
88
|
-
/** @type {?} */
|
|
89
|
-
IProfileResponse.prototype.message;
|
|
90
|
-
/** @type {?} */
|
|
91
|
-
IProfileResponse.prototype.length;
|
|
92
|
-
/** @type {?} */
|
|
93
|
-
IProfileResponse.prototype.data;
|
|
94
|
-
}
|
|
95
|
-
/** @enum {number} */
|
|
96
|
-
var EDataType = {
|
|
97
|
-
STRING: 1,
|
|
98
|
-
JSON: 2,
|
|
99
|
-
};
|
|
100
|
-
EDataType[EDataType.STRING] = 'STRING';
|
|
101
|
-
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 = {}));
|
|
102
47
|
var ProfileService = /** @class */ (function () {
|
|
103
|
-
/**
|
|
104
|
-
* @param {?} http
|
|
105
|
-
*/
|
|
106
48
|
function ProfileService(http) {
|
|
107
49
|
this.http = http;
|
|
108
50
|
this.apiURL = '/dts/datasul-rest/resources/api/btb/btapi930za';
|
|
109
51
|
}
|
|
110
|
-
/**
|
|
111
|
-
* @param {?} profile
|
|
112
|
-
* @return {?}
|
|
113
|
-
*/
|
|
114
52
|
ProfileService.prototype.setProfile = function (profile) {
|
|
115
|
-
/** @type {?} */
|
|
116
53
|
var headers = { 'X-PO-Screen-Lock': 'true' };
|
|
117
54
|
var pageId = profile.pageId, userCode = profile.userCode;
|
|
118
55
|
return this.http
|
|
119
56
|
.post(this.apiURL + "/setProfile?userCode=" + userCode + "&pageId=" + pageId, profile, { headers: headers });
|
|
120
57
|
};
|
|
121
|
-
/**
|
|
122
|
-
* @param {?} profile
|
|
123
|
-
* @param {?=} showLoading
|
|
124
|
-
* @return {?}
|
|
125
|
-
*/
|
|
126
58
|
ProfileService.prototype.getProfileAsString = function (profile, showLoading) {
|
|
127
59
|
return this.getProfile(profile, EDataType.STRING, showLoading ? 'true' : 'false');
|
|
128
60
|
};
|
|
129
|
-
/**
|
|
130
|
-
* @param {?} profile
|
|
131
|
-
* @param {?=} showLoading
|
|
132
|
-
* @return {?}
|
|
133
|
-
*/
|
|
134
61
|
ProfileService.prototype.getProfileAsJSON = function (profile, showLoading) {
|
|
135
62
|
return this.getProfile(profile, EDataType.JSON, showLoading ? 'true' : 'false');
|
|
136
63
|
};
|
|
137
|
-
/**
|
|
138
|
-
* @private
|
|
139
|
-
* @param {?} profile
|
|
140
|
-
* @param {?} dataType
|
|
141
|
-
* @param {?=} showLoading
|
|
142
|
-
* @return {?}
|
|
143
|
-
*/
|
|
144
64
|
ProfileService.prototype.getProfile = function (profile, dataType, showLoading) {
|
|
145
|
-
/** @type {?} */
|
|
146
65
|
var headers = { 'X-PO-Screen-Lock': showLoading };
|
|
147
66
|
var pageId = profile.pageId, dataCode = profile.dataCode, userCode = profile.userCode;
|
|
148
67
|
return this.http
|
|
149
68
|
.get(this.apiURL + "/getProfile?userCode=" + userCode + "&pageId=" + pageId + "&dataCode=" + dataCode, { headers: headers })
|
|
150
|
-
.pipe(operators.map((
|
|
151
|
-
* @param {?} preference
|
|
152
|
-
* @return {?}
|
|
153
|
-
*/function (/**
|
|
154
|
-
* @param {?} preference
|
|
155
|
-
* @return {?}
|
|
156
|
-
*/ preference) {
|
|
69
|
+
.pipe(operators.map(function (preference) {
|
|
157
70
|
if (preference.data[0]) {
|
|
158
71
|
if (dataType === EDataType.STRING) {
|
|
159
72
|
return preference.data[0].dataValue;
|
|
@@ -165,10 +78,11 @@
|
|
|
165
78
|
else {
|
|
166
79
|
return undefined;
|
|
167
80
|
}
|
|
168
|
-
}))
|
|
81
|
+
}));
|
|
169
82
|
};
|
|
170
83
|
return ProfileService;
|
|
171
84
|
}());
|
|
85
|
+
/** @nocollapse */ ProfileService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ProfileService_Factory() { return new ProfileService(i0.ɵɵinject(i1.HttpClient)); }, token: ProfileService, providedIn: "root" });
|
|
172
86
|
ProfileService.decorators = [
|
|
173
87
|
{ type: i0.Injectable, args: [{
|
|
174
88
|
providedIn: 'root'
|
|
@@ -177,118 +91,47 @@
|
|
|
177
91
|
/** @nocollapse */
|
|
178
92
|
ProfileService.ctorParameters = function () { return [
|
|
179
93
|
{ type: i1.HttpClient }
|
|
180
|
-
]; };
|
|
181
|
-
/** @nocollapse */ ProfileService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ProfileService_Factory() { return new ProfileService(i0.ɵɵinject(i1.HttpClient)); }, token: ProfileService, providedIn: "root" });
|
|
182
|
-
if (false) {
|
|
183
|
-
/** @type {?} */
|
|
184
|
-
ProfileService.prototype.apiURL;
|
|
185
|
-
/** @type {?} */
|
|
186
|
-
ProfileService.prototype.http;
|
|
187
|
-
}
|
|
94
|
+
]; };
|
|
188
95
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
* @record
|
|
196
|
-
*/
|
|
197
|
-
function IProperty() { }
|
|
198
|
-
if (false) {
|
|
199
|
-
/** @type {?} */
|
|
200
|
-
IProperty.prototype.name;
|
|
201
|
-
/** @type {?} */
|
|
202
|
-
IProperty.prototype.value;
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* @record
|
|
206
|
-
*/
|
|
207
|
-
function IReportServiceParams() { }
|
|
208
|
-
if (false) {
|
|
209
|
-
/** @type {?} */
|
|
210
|
-
IReportServiceParams.prototype.reportName;
|
|
211
|
-
/** @type {?} */
|
|
212
|
-
IReportServiceParams.prototype.programName;
|
|
213
|
-
/** @type {?} */
|
|
214
|
-
IReportServiceParams.prototype.properties;
|
|
215
|
-
/** @type {?} */
|
|
216
|
-
IReportServiceParams.prototype.dialect;
|
|
217
|
-
/** @type {?} */
|
|
218
|
-
IReportServiceParams.prototype.downloadName;
|
|
219
|
-
/** @type {?} */
|
|
220
|
-
IReportServiceParams.prototype.download;
|
|
221
|
-
/** @type {?} */
|
|
222
|
-
IReportServiceParams.prototype.format;
|
|
223
|
-
}
|
|
224
|
-
/** @enum {string} */
|
|
225
|
-
var ReportFormats = {
|
|
226
|
-
XLSX: "xlsx",
|
|
227
|
-
PDF: "pdf",
|
|
228
|
-
DOCX: "docx",
|
|
229
|
-
HTML: "html",
|
|
230
|
-
};
|
|
96
|
+
(function (ReportFormats) {
|
|
97
|
+
ReportFormats["XLSX"] = "xlsx";
|
|
98
|
+
ReportFormats["PDF"] = "pdf";
|
|
99
|
+
ReportFormats["DOCX"] = "docx";
|
|
100
|
+
ReportFormats["HTML"] = "html";
|
|
101
|
+
})(exports.ReportFormats || (exports.ReportFormats = {}));
|
|
231
102
|
var ReportService = /** @class */ (function () {
|
|
232
|
-
/**
|
|
233
|
-
* @param {?} httpClient
|
|
234
|
-
*/
|
|
235
103
|
function ReportService(httpClient) {
|
|
236
104
|
this.httpClient = httpClient;
|
|
237
105
|
this.URL = window.location.href.indexOf('totvs-menu') > 0 ? '/totvs-menu/rest/report/run/'
|
|
238
106
|
: '/dts/datasul-report/resources/run/';
|
|
239
107
|
}
|
|
240
|
-
/**
|
|
241
|
-
* @param {?} params
|
|
242
|
-
* @param {?=} showLoading
|
|
243
|
-
* @return {?}
|
|
244
|
-
*/
|
|
245
108
|
ReportService.prototype.generate = function (params, showLoading) {
|
|
246
109
|
var _this = this;
|
|
247
110
|
if (showLoading === void 0) { showLoading = true; }
|
|
248
|
-
/** @type {?} */
|
|
249
111
|
var headers = { 'X-PO-Screen-Lock': showLoading ? 'true' : 'false' };
|
|
250
|
-
/** @type {?} */
|
|
251
112
|
var reportURL = "" + this.URL + params.reportName;
|
|
252
113
|
if (params.properties.length > 0) {
|
|
253
114
|
reportURL += '?';
|
|
254
|
-
params.properties.forEach((
|
|
255
|
-
* @param {?} property
|
|
256
|
-
* @param {?} index
|
|
257
|
-
* @return {?}
|
|
258
|
-
*/function (property, index) {
|
|
115
|
+
params.properties.forEach(function (property, index) {
|
|
259
116
|
if (index > 0) {
|
|
260
117
|
reportURL += '&';
|
|
261
118
|
}
|
|
262
119
|
reportURL += "c_properties=" + property.name + "&c_values=" + property.value;
|
|
263
|
-
})
|
|
120
|
+
});
|
|
264
121
|
}
|
|
265
122
|
reportURL += "&dialect=" + params.dialect + "&format=" + params.format;
|
|
266
123
|
reportURL += "&program=" + params.programName + "&resultFileName=" + params.downloadName;
|
|
267
124
|
return this.httpClient.post(reportURL, {}, { headers: headers, responseType: 'blob' })
|
|
268
|
-
.pipe(operators.map((
|
|
269
|
-
* @param {?} report
|
|
270
|
-
* @return {?}
|
|
271
|
-
*/function (/**
|
|
272
|
-
* @param {?} report
|
|
273
|
-
* @return {?}
|
|
274
|
-
*/ report) {
|
|
125
|
+
.pipe(operators.map(function (report) {
|
|
275
126
|
if (params.download) {
|
|
276
127
|
_this.download(report, params.downloadName + "." + params.format);
|
|
277
128
|
}
|
|
278
129
|
return report;
|
|
279
|
-
}))
|
|
130
|
+
}));
|
|
280
131
|
};
|
|
281
|
-
/**
|
|
282
|
-
* @param {?} file
|
|
283
|
-
* @param {?} fileName
|
|
284
|
-
* @return {?}
|
|
285
|
-
*/
|
|
286
132
|
ReportService.prototype.download = function (file, fileName) {
|
|
287
|
-
/** @type {?} */
|
|
288
133
|
var binaryData = [file];
|
|
289
|
-
/** @type {?} */
|
|
290
134
|
var downloadLink = document.createElement('a');
|
|
291
|
-
/** @type {?} */
|
|
292
135
|
var urlDownload = window.URL.createObjectURL(new Blob(binaryData, { type: file.type }));
|
|
293
136
|
downloadLink.href = urlDownload;
|
|
294
137
|
downloadLink.setAttribute('download', fileName);
|
|
@@ -305,41 +148,21 @@
|
|
|
305
148
|
/** @nocollapse */
|
|
306
149
|
ReportService.ctorParameters = function () { return [
|
|
307
150
|
{ type: i1.HttpClient }
|
|
308
|
-
]; };
|
|
309
|
-
if (false) {
|
|
310
|
-
/** @type {?} */
|
|
311
|
-
ReportService.prototype.URL;
|
|
312
|
-
/** @type {?} */
|
|
313
|
-
ReportService.prototype.httpClient;
|
|
314
|
-
}
|
|
151
|
+
]; };
|
|
315
152
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
*/
|
|
153
|
+
/*
|
|
154
|
+
Versão: 1.003
|
|
155
|
+
Data Criação: 06/08/2018
|
|
156
|
+
*/
|
|
321
157
|
var BreadcrumbControlService = /** @class */ (function () {
|
|
322
158
|
function BreadcrumbControlService() {
|
|
323
159
|
}
|
|
324
|
-
/**
|
|
325
|
-
* @return {?}
|
|
326
|
-
*/
|
|
327
160
|
BreadcrumbControlService.prototype.newBreadcrumb = function () {
|
|
328
161
|
this.breadcrumb = { items: [] };
|
|
329
162
|
};
|
|
330
|
-
/**
|
|
331
|
-
* @param {?} literal
|
|
332
|
-
* @param {?} activatedRoute
|
|
333
|
-
* @return {?}
|
|
334
|
-
*/
|
|
335
163
|
BreadcrumbControlService.prototype.addBreadcrumb = function (literal, activatedRoute) {
|
|
336
164
|
this.addBreadcrumbURL(literal, decodeURIComponent(activatedRoute.snapshot['_routerState'].url));
|
|
337
165
|
};
|
|
338
|
-
/**
|
|
339
|
-
* @param {?} literal
|
|
340
|
-
* @param {?} url
|
|
341
|
-
* @return {?}
|
|
342
|
-
*/
|
|
343
166
|
BreadcrumbControlService.prototype.addBreadcrumbURL = function (literal, url) {
|
|
344
167
|
if (!literal || literal === '') {
|
|
345
168
|
return;
|
|
@@ -347,9 +170,7 @@
|
|
|
347
170
|
if (!this.breadcrumb) {
|
|
348
171
|
this.newBreadcrumb();
|
|
349
172
|
}
|
|
350
|
-
/** @type {?} */
|
|
351
173
|
var breadcrumbAux = { items: [] };
|
|
352
|
-
/** @type {?} */
|
|
353
174
|
var idx = 0;
|
|
354
175
|
for (idx = 0; idx < this.breadcrumb.items.length; idx++) {
|
|
355
176
|
if (this.breadcrumb.items[idx].label !== literal) {
|
|
@@ -362,14 +183,7 @@
|
|
|
362
183
|
breadcrumbAux.items.push({ label: literal, link: url });
|
|
363
184
|
this.breadcrumb = breadcrumbAux;
|
|
364
185
|
};
|
|
365
|
-
/**
|
|
366
|
-
* @param {?} literal
|
|
367
|
-
* @param {?} valueOld
|
|
368
|
-
* @param {?} valueNew
|
|
369
|
-
* @return {?}
|
|
370
|
-
*/
|
|
371
186
|
BreadcrumbControlService.prototype.updBreadcrumbURL = function (literal, valueOld, valueNew) {
|
|
372
|
-
/** @type {?} */
|
|
373
187
|
var currentRouterURL = this.getCurrentRouter();
|
|
374
188
|
if (!currentRouterURL) {
|
|
375
189
|
return;
|
|
@@ -383,18 +197,12 @@
|
|
|
383
197
|
currentRouterURL = currentRouterURL.replace(valueOld, valueNew);
|
|
384
198
|
this.addBreadcrumbURL(literal, currentRouterURL);
|
|
385
199
|
};
|
|
386
|
-
/**
|
|
387
|
-
* @return {?}
|
|
388
|
-
*/
|
|
389
200
|
BreadcrumbControlService.prototype.getBreadcrumb = function () {
|
|
390
201
|
if (!this.breadcrumb) {
|
|
391
202
|
this.newBreadcrumb();
|
|
392
203
|
}
|
|
393
204
|
return this.breadcrumb;
|
|
394
205
|
};
|
|
395
|
-
/**
|
|
396
|
-
* @return {?}
|
|
397
|
-
*/
|
|
398
206
|
BreadcrumbControlService.prototype.getCurrentRouter = function () {
|
|
399
207
|
if (!this.breadcrumb) {
|
|
400
208
|
this.newBreadcrumb();
|
|
@@ -404,9 +212,6 @@
|
|
|
404
212
|
}
|
|
405
213
|
return this.breadcrumb.items[this.breadcrumb.items.length - 1].link;
|
|
406
214
|
};
|
|
407
|
-
/**
|
|
408
|
-
* @return {?}
|
|
409
|
-
*/
|
|
410
215
|
BreadcrumbControlService.prototype.getPrevRouter = function () {
|
|
411
216
|
if (!this.breadcrumb) {
|
|
412
217
|
this.newBreadcrumb();
|
|
@@ -416,9 +221,6 @@
|
|
|
416
221
|
}
|
|
417
222
|
return this.breadcrumb.items[this.breadcrumb.items.length - 2].link;
|
|
418
223
|
};
|
|
419
|
-
/**
|
|
420
|
-
* @return {?}
|
|
421
|
-
*/
|
|
422
224
|
BreadcrumbControlService.prototype.hasPreviousRouter = function () {
|
|
423
225
|
return this.breadcrumb.items.length > 1;
|
|
424
226
|
};
|
|
@@ -428,17 +230,8 @@
|
|
|
428
230
|
{ type: i0.Injectable }
|
|
429
231
|
];
|
|
430
232
|
/** @nocollapse */
|
|
431
|
-
BreadcrumbControlService.ctorParameters = function () { return []; };
|
|
432
|
-
if (false) {
|
|
433
|
-
/** @type {?} */
|
|
434
|
-
BreadcrumbControlService.prototype.breadcrumb;
|
|
435
|
-
}
|
|
233
|
+
BreadcrumbControlService.ctorParameters = function () { return []; };
|
|
436
234
|
|
|
437
|
-
/**
|
|
438
|
-
* @fileoverview added by tsickle
|
|
439
|
-
* Generated from: lib/services/menu-datasul.service.ts
|
|
440
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
441
|
-
*/
|
|
442
235
|
var MenuDatasulService = /** @class */ (function () {
|
|
443
236
|
function MenuDatasulService() {
|
|
444
237
|
}
|
|
@@ -446,8 +239,6 @@
|
|
|
446
239
|
* var program = {};
|
|
447
240
|
* program['prg'] = "cd0210";
|
|
448
241
|
* program['params'] = '01|123456'
|
|
449
|
-
* @param {?} program
|
|
450
|
-
* @return {?}
|
|
451
242
|
*/
|
|
452
243
|
MenuDatasulService.prototype.callProgress = function (program) {
|
|
453
244
|
parent.postMessage({ program: program }, '*');
|
|
@@ -457,23 +248,13 @@
|
|
|
457
248
|
* notification['type'] = 'success';
|
|
458
249
|
* notification['title'] = 'Notification Title'
|
|
459
250
|
* notification['detail'] = 'Notification Detail'
|
|
460
|
-
* @param {?} notification
|
|
461
|
-
* @return {?}
|
|
462
251
|
*/
|
|
463
252
|
MenuDatasulService.prototype.sendNotification = function (notification) {
|
|
464
253
|
parent.postMessage({ notification: notification }, '*');
|
|
465
254
|
};
|
|
466
|
-
/**
|
|
467
|
-
* @param {?} programName
|
|
468
|
-
* @param {?} params
|
|
469
|
-
* @param {?=} parent
|
|
470
|
-
* @return {?}
|
|
471
|
-
*/
|
|
472
255
|
MenuDatasulService.prototype.openPath = function (programName, params, parent) {
|
|
473
256
|
if (parent === void 0) { parent = true; }
|
|
474
|
-
/** @type {?} */
|
|
475
257
|
var datasulPath = document.referrer.indexOf('totvs-menu') > 0 ? 'totvs-menu' : 'menu-html';
|
|
476
|
-
/** @type {?} */
|
|
477
258
|
var baseUrl = "/" + datasulPath + "/#/" + datasulPath + "/program-html/" + programName + "/#";
|
|
478
259
|
if (params) {
|
|
479
260
|
baseUrl = baseUrl + "/" + params;
|
|
@@ -493,77 +274,40 @@
|
|
|
493
274
|
/** @nocollapse */
|
|
494
275
|
MenuDatasulService.ctorParameters = function () { return []; };
|
|
495
276
|
|
|
496
|
-
/**
|
|
497
|
-
* @fileoverview added by tsickle
|
|
498
|
-
* Generated from: lib/services/cache-params.service.ts
|
|
499
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
500
|
-
*/
|
|
501
277
|
var CacheParamsService = /** @class */ (function () {
|
|
502
278
|
function CacheParamsService() {
|
|
503
279
|
this.values = {};
|
|
504
280
|
}
|
|
505
|
-
/**
|
|
506
|
-
* @param {?} key
|
|
507
|
-
* @param {?} value
|
|
508
|
-
* @return {?}
|
|
509
|
-
*/
|
|
510
281
|
CacheParamsService.prototype.setValue = function (key, value) {
|
|
511
282
|
this.values[key] = value;
|
|
512
283
|
};
|
|
513
|
-
/**
|
|
514
|
-
* @param {?} key
|
|
515
|
-
* @return {?}
|
|
516
|
-
*/
|
|
517
284
|
CacheParamsService.prototype.getValue = function (key) {
|
|
518
285
|
return this.values[key];
|
|
519
286
|
};
|
|
520
|
-
/**
|
|
521
|
-
* @param {?} key
|
|
522
|
-
* @return {?}
|
|
523
|
-
*/
|
|
524
287
|
CacheParamsService.prototype.removeValue = function (key) {
|
|
525
288
|
delete this.values[key];
|
|
526
289
|
};
|
|
527
290
|
return CacheParamsService;
|
|
528
291
|
}());
|
|
292
|
+
/** @nocollapse */ CacheParamsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CacheParamsService_Factory() { return new CacheParamsService(); }, token: CacheParamsService, providedIn: "root" });
|
|
529
293
|
CacheParamsService.decorators = [
|
|
530
294
|
{ type: i0.Injectable, args: [{
|
|
531
295
|
providedIn: 'root'
|
|
532
296
|
},] }
|
|
533
297
|
];
|
|
534
298
|
/** @nocollapse */
|
|
535
|
-
CacheParamsService.ctorParameters = function () { return []; };
|
|
536
|
-
/** @nocollapse */ CacheParamsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CacheParamsService_Factory() { return new CacheParamsService(); }, token: CacheParamsService, providedIn: "root" });
|
|
537
|
-
if (false) {
|
|
538
|
-
/** @type {?} */
|
|
539
|
-
CacheParamsService.prototype.values;
|
|
540
|
-
}
|
|
299
|
+
CacheParamsService.ctorParameters = function () { return []; };
|
|
541
300
|
|
|
542
|
-
/**
|
|
543
|
-
* @fileoverview added by tsickle
|
|
544
|
-
* Generated from: lib/services/translate.service.ts
|
|
545
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
546
|
-
*/
|
|
547
301
|
var TranslateService = /** @class */ (function () {
|
|
548
302
|
function TranslateService() {
|
|
549
303
|
}
|
|
550
|
-
/**
|
|
551
|
-
* @return {?}
|
|
552
|
-
*/
|
|
553
304
|
TranslateService.getSuportLanguage = function () {
|
|
554
305
|
return ['pt-BR', 'pt', 'en-US', 'en', 'es'];
|
|
555
306
|
};
|
|
556
|
-
/**
|
|
557
|
-
* @return {?}
|
|
558
|
-
*/
|
|
559
307
|
TranslateService.getDefaultCurrencyCode = function () {
|
|
560
308
|
return '$';
|
|
561
309
|
};
|
|
562
|
-
/**
|
|
563
|
-
* @return {?}
|
|
564
|
-
*/
|
|
565
310
|
TranslateService.getCurrentLanguage = function () {
|
|
566
|
-
/** @type {?} */
|
|
567
311
|
var locale = localStorage.getItem('user.language') || navigator.language;
|
|
568
312
|
if (locale && this.getSuportLanguage().includes(locale)) {
|
|
569
313
|
return locale;
|
|
@@ -576,11 +320,6 @@
|
|
|
576
320
|
{ type: i0.Injectable }
|
|
577
321
|
];
|
|
578
322
|
|
|
579
|
-
/**
|
|
580
|
-
* @fileoverview added by tsickle
|
|
581
|
-
* Generated from: lib/utils/date.util.ts
|
|
582
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
583
|
-
*/
|
|
584
323
|
/*
|
|
585
324
|
Versão: 1.000
|
|
586
325
|
Data Criação: 18/04/2019
|
|
@@ -589,46 +328,24 @@
|
|
|
589
328
|
function DateUtil() {
|
|
590
329
|
}
|
|
591
330
|
/* Transforma data para o padrão YYYY-MM-DD */
|
|
592
|
-
/**
|
|
593
|
-
* @param {?} date
|
|
594
|
-
* @return {?}
|
|
595
|
-
*/
|
|
596
331
|
DateUtil.dateToQueryParam = function (date) {
|
|
597
|
-
/** @type {?} */
|
|
598
332
|
var iDay = date.getDate();
|
|
599
|
-
/** @type {?} */
|
|
600
333
|
var iMonth = date.getMonth() + 1;
|
|
601
|
-
/** @type {?} */
|
|
602
334
|
var iYear = date.getFullYear();
|
|
603
335
|
return iYear + "-" + this.pad(iMonth) + "-" + this.pad(iDay);
|
|
604
336
|
};
|
|
605
337
|
/* Transforma data no padrão YYYY-MM-DD para DATE */
|
|
606
|
-
/**
|
|
607
|
-
* @param {?} param
|
|
608
|
-
* @return {?}
|
|
609
|
-
*/
|
|
610
338
|
DateUtil.queryParamToDate = function (param) {
|
|
611
|
-
/** @type {?} */
|
|
612
339
|
var iDay = +param.split('-')[2];
|
|
613
|
-
/** @type {?} */
|
|
614
340
|
var iMonth = +param.split('-')[1];
|
|
615
|
-
/** @type {?} */
|
|
616
341
|
var iYear = +param.split('-')[0];
|
|
617
342
|
return new Date(iYear, iMonth - 1, iDay);
|
|
618
343
|
};
|
|
619
344
|
/* Valida se foi informado uma data válida */
|
|
620
|
-
/**
|
|
621
|
-
* @param {?} date
|
|
622
|
-
* @return {?}
|
|
623
|
-
*/
|
|
624
345
|
DateUtil.isValidDate = function (date) {
|
|
625
346
|
return date instanceof Date && !isNaN(date.getTime());
|
|
626
347
|
};
|
|
627
348
|
/* Ajusta a data retornando o padrão DATE */
|
|
628
|
-
/**
|
|
629
|
-
* @param {?} param
|
|
630
|
-
* @return {?}
|
|
631
|
-
*/
|
|
632
349
|
DateUtil.ajustDate = function (param) {
|
|
633
350
|
if (param instanceof Date) {
|
|
634
351
|
return param;
|
|
@@ -639,32 +356,20 @@
|
|
|
639
356
|
return this.queryParamToDate(param.split('T')[0]);
|
|
640
357
|
};
|
|
641
358
|
/* Ajusta a data para o padrão DATE - utilizada nos construtores dos modelos */
|
|
642
|
-
/**
|
|
643
|
-
* @param {?=} values
|
|
644
|
-
* @param {?=} fieldName
|
|
645
|
-
* @return {?}
|
|
646
|
-
*/
|
|
647
359
|
DateUtil.ajustDateToModel = function (values, fieldName) {
|
|
648
360
|
if (values === void 0) { values = {}; }
|
|
649
361
|
if (values.hasOwnProperty(fieldName) && (values[fieldName])) {
|
|
650
362
|
if (values[fieldName].indexOf('T') >= 0) {
|
|
651
363
|
return new Date(values[fieldName]);
|
|
652
364
|
}
|
|
653
|
-
/** @type {?} */
|
|
654
365
|
var iDay = +values[fieldName].split('-')[2];
|
|
655
|
-
/** @type {?} */
|
|
656
366
|
var iMonth = +values[fieldName].split('-')[1];
|
|
657
|
-
/** @type {?} */
|
|
658
367
|
var iYear = +values[fieldName].split('-')[0];
|
|
659
368
|
return new Date(iYear, iMonth - 1, iDay);
|
|
660
369
|
}
|
|
661
370
|
return null;
|
|
662
371
|
};
|
|
663
372
|
/* Adicona zero a esquerda do número */
|
|
664
|
-
/**
|
|
665
|
-
* @param {?} number
|
|
666
|
-
* @return {?}
|
|
667
|
-
*/
|
|
668
373
|
DateUtil.pad = function (number) {
|
|
669
374
|
if (number < 10) {
|
|
670
375
|
return '0' + number;
|
|
@@ -674,35 +379,17 @@
|
|
|
674
379
|
return DateUtil;
|
|
675
380
|
}());
|
|
676
381
|
|
|
677
|
-
/**
|
|
678
|
-
* @fileoverview added by tsickle
|
|
679
|
-
* Generated from: lib/utils/disclaimer.util.ts
|
|
680
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
681
|
-
*/
|
|
682
382
|
/*
|
|
683
383
|
Versão: 1.009
|
|
684
384
|
Data Criação: 06/08/2018
|
|
685
385
|
*/
|
|
686
386
|
var DisclaimerUtil = /** @class */ (function () {
|
|
687
|
-
/**
|
|
688
|
-
* @param {?} poNotification
|
|
689
|
-
* @param {?} poI18nPipe
|
|
690
|
-
* @param {?} literals
|
|
691
|
-
*/
|
|
692
387
|
function DisclaimerUtil(poNotification, poI18nPipe, literals) {
|
|
693
388
|
this.literals = {};
|
|
694
389
|
this.poNotification = poNotification;
|
|
695
390
|
this.poI18nPipe = poI18nPipe;
|
|
696
391
|
this.literals = literals;
|
|
697
392
|
}
|
|
698
|
-
/**
|
|
699
|
-
* @param {?} property
|
|
700
|
-
* @param {?} value
|
|
701
|
-
* @param {?=} hideClose
|
|
702
|
-
* @param {?=} tradValue
|
|
703
|
-
* @param {?=} vldBlank
|
|
704
|
-
* @return {?}
|
|
705
|
-
*/
|
|
706
393
|
DisclaimerUtil.prototype.makeDisclaimer = function (property, value, hideClose, tradValue, vldBlank) {
|
|
707
394
|
if (hideClose === void 0) { hideClose = false; }
|
|
708
395
|
if (tradValue === void 0) { tradValue = false; }
|
|
@@ -720,13 +407,6 @@
|
|
|
720
407
|
value: "" + value
|
|
721
408
|
};
|
|
722
409
|
};
|
|
723
|
-
/**
|
|
724
|
-
* @param {?} property
|
|
725
|
-
* @param {?} value
|
|
726
|
-
* @param {?=} hideClose
|
|
727
|
-
* @param {?=} vldBlank
|
|
728
|
-
* @return {?}
|
|
729
|
-
*/
|
|
730
410
|
DisclaimerUtil.prototype.makeDisclaimerFromNumber = function (property, value, hideClose, vldBlank) {
|
|
731
411
|
if (hideClose === void 0) { hideClose = false; }
|
|
732
412
|
if (vldBlank === void 0) { vldBlank = false; }
|
|
@@ -743,12 +423,6 @@
|
|
|
743
423
|
value: "" + value
|
|
744
424
|
};
|
|
745
425
|
};
|
|
746
|
-
/**
|
|
747
|
-
* @param {?} property
|
|
748
|
-
* @param {?} value
|
|
749
|
-
* @param {?=} hideClose
|
|
750
|
-
* @return {?}
|
|
751
|
-
*/
|
|
752
426
|
DisclaimerUtil.prototype.makeDisclaimerFromBoolean = function (property, value, hideClose) {
|
|
753
427
|
if (hideClose === void 0) { hideClose = false; }
|
|
754
428
|
if (value === null || value === undefined) {
|
|
@@ -761,15 +435,8 @@
|
|
|
761
435
|
value: "" + value
|
|
762
436
|
};
|
|
763
437
|
};
|
|
764
|
-
/**
|
|
765
|
-
* @param {?} property
|
|
766
|
-
* @param {?} value
|
|
767
|
-
* @param {?=} hideClose
|
|
768
|
-
* @return {?}
|
|
769
|
-
*/
|
|
770
438
|
DisclaimerUtil.prototype.makeDisclaimerFromDate = function (property, value, hideClose) {
|
|
771
439
|
if (hideClose === void 0) { hideClose = false; }
|
|
772
|
-
/** @type {?} */
|
|
773
440
|
var dDate = this.ajustDate(value);
|
|
774
441
|
if (!this.isValidDate(dDate)) {
|
|
775
442
|
return { label: '', property: '', value: '' };
|
|
@@ -781,22 +448,12 @@
|
|
|
781
448
|
value: "" + this.dateToQueryParam(dDate)
|
|
782
449
|
};
|
|
783
450
|
};
|
|
784
|
-
/**
|
|
785
|
-
* @param {?} property
|
|
786
|
-
* @param {?} value
|
|
787
|
-
* @param {?=} length
|
|
788
|
-
* @param {?=} hideClose
|
|
789
|
-
* @param {?=} tradValue
|
|
790
|
-
* @return {?}
|
|
791
|
-
*/
|
|
792
451
|
DisclaimerUtil.prototype.makeDisclaimerFromMultiSelect = function (property, value, length, hideClose, tradValue) {
|
|
793
452
|
var _this = this;
|
|
794
453
|
if (length === void 0) { length = 0; }
|
|
795
454
|
if (hideClose === void 0) { hideClose = false; }
|
|
796
455
|
if (tradValue === void 0) { tradValue = false; }
|
|
797
|
-
/** @type {?} */
|
|
798
456
|
var lstLabels = '';
|
|
799
|
-
/** @type {?} */
|
|
800
457
|
var lstValues = '';
|
|
801
458
|
if (!value) {
|
|
802
459
|
return { label: '', property: '', value: '' };
|
|
@@ -806,13 +463,7 @@
|
|
|
806
463
|
lstValues = 'all';
|
|
807
464
|
}
|
|
808
465
|
else {
|
|
809
|
-
value.map((
|
|
810
|
-
* @param {?} item
|
|
811
|
-
* @return {?}
|
|
812
|
-
*/function (/**
|
|
813
|
-
* @param {?} item
|
|
814
|
-
* @return {?}
|
|
815
|
-
*/ item) {
|
|
466
|
+
value.map(function (item) {
|
|
816
467
|
if (lstLabels !== '') {
|
|
817
468
|
lstLabels = lstLabels + ", ";
|
|
818
469
|
}
|
|
@@ -821,7 +472,7 @@
|
|
|
821
472
|
}
|
|
822
473
|
lstLabels = "" + lstLabels + (tradValue ? _this.literals[item] : item);
|
|
823
474
|
lstValues = "" + lstValues + item;
|
|
824
|
-
})
|
|
475
|
+
});
|
|
825
476
|
}
|
|
826
477
|
return {
|
|
827
478
|
hideClose: hideClose,
|
|
@@ -830,22 +481,11 @@
|
|
|
830
481
|
value: "" + lstValues
|
|
831
482
|
};
|
|
832
483
|
};
|
|
833
|
-
/**
|
|
834
|
-
* @param {?} property
|
|
835
|
-
* @param {?} value
|
|
836
|
-
* @param {?} options
|
|
837
|
-
* @param {?=} length
|
|
838
|
-
* @param {?=} hideClose
|
|
839
|
-
* @return {?}
|
|
840
|
-
*/
|
|
841
484
|
DisclaimerUtil.prototype.makeDisclaimerFromMultiSelectNumber = function (property, value, options, length, hideClose) {
|
|
842
485
|
if (length === void 0) { length = 0; }
|
|
843
486
|
if (hideClose === void 0) { hideClose = false; }
|
|
844
|
-
/** @type {?} */
|
|
845
487
|
var lstLabels = '';
|
|
846
|
-
/** @type {?} */
|
|
847
488
|
var lstValues = '';
|
|
848
|
-
/** @type {?} */
|
|
849
489
|
var opt = null;
|
|
850
490
|
if (!value || !options) {
|
|
851
491
|
return { label: '', property: '', value: '' };
|
|
@@ -855,29 +495,17 @@
|
|
|
855
495
|
lstValues = 'all';
|
|
856
496
|
}
|
|
857
497
|
else {
|
|
858
|
-
value.map((
|
|
859
|
-
* @param {?} item
|
|
860
|
-
* @return {?}
|
|
861
|
-
*/function (/**
|
|
862
|
-
* @param {?} item
|
|
863
|
-
* @return {?}
|
|
864
|
-
*/ item) {
|
|
498
|
+
value.map(function (item) {
|
|
865
499
|
if (lstLabels !== '') {
|
|
866
500
|
lstLabels = lstLabels + ", ";
|
|
867
501
|
}
|
|
868
502
|
if (lstValues !== '') {
|
|
869
503
|
lstValues = lstValues + ",";
|
|
870
504
|
}
|
|
871
|
-
opt = options.find((
|
|
872
|
-
* @param {?} itOpt
|
|
873
|
-
* @return {?}
|
|
874
|
-
*/function (/**
|
|
875
|
-
* @param {?} itOpt
|
|
876
|
-
* @return {?}
|
|
877
|
-
*/ itOpt) { return itOpt.value === item; }));
|
|
505
|
+
opt = options.find(function (itOpt) { return itOpt.value === item; });
|
|
878
506
|
lstLabels = "" + lstLabels + (opt ? opt.label : item);
|
|
879
507
|
lstValues = "" + lstValues + item;
|
|
880
|
-
})
|
|
508
|
+
});
|
|
881
509
|
}
|
|
882
510
|
return {
|
|
883
511
|
hideClose: hideClose,
|
|
@@ -886,20 +514,11 @@
|
|
|
886
514
|
value: "" + lstValues
|
|
887
515
|
};
|
|
888
516
|
};
|
|
889
|
-
/**
|
|
890
|
-
* @param {?} property
|
|
891
|
-
* @param {?} value
|
|
892
|
-
* @param {?=} length
|
|
893
|
-
* @param {?=} hideClose
|
|
894
|
-
* @return {?}
|
|
895
|
-
*/
|
|
896
517
|
DisclaimerUtil.prototype.makeDisclaimerFromCheckboxGroup = function (property, value, length, hideClose) {
|
|
897
518
|
var _this = this;
|
|
898
519
|
if (length === void 0) { length = 0; }
|
|
899
520
|
if (hideClose === void 0) { hideClose = false; }
|
|
900
|
-
/** @type {?} */
|
|
901
521
|
var lstLabels = '';
|
|
902
|
-
/** @type {?} */
|
|
903
522
|
var lstValues = '';
|
|
904
523
|
if (!value) {
|
|
905
524
|
return { label: '', property: '', value: '' };
|
|
@@ -913,13 +532,7 @@
|
|
|
913
532
|
lstValues = 'all';
|
|
914
533
|
}
|
|
915
534
|
else {
|
|
916
|
-
value.map((
|
|
917
|
-
* @param {?} checkParam
|
|
918
|
-
* @return {?}
|
|
919
|
-
*/function (/**
|
|
920
|
-
* @param {?} checkParam
|
|
921
|
-
* @return {?}
|
|
922
|
-
*/ checkParam) {
|
|
535
|
+
value.map(function (checkParam) {
|
|
923
536
|
if (lstLabels !== '') {
|
|
924
537
|
lstLabels = lstLabels + ", ";
|
|
925
538
|
}
|
|
@@ -928,7 +541,7 @@
|
|
|
928
541
|
}
|
|
929
542
|
lstLabels = "" + lstLabels + _this.literals[checkParam];
|
|
930
543
|
lstValues = "" + lstValues + checkParam;
|
|
931
|
-
})
|
|
544
|
+
});
|
|
932
545
|
}
|
|
933
546
|
return {
|
|
934
547
|
hideClose: hideClose,
|
|
@@ -937,13 +550,6 @@
|
|
|
937
550
|
value: "" + lstValues
|
|
938
551
|
};
|
|
939
552
|
};
|
|
940
|
-
/**
|
|
941
|
-
* @param {?} property
|
|
942
|
-
* @param {?} value
|
|
943
|
-
* @param {?=} hideClose
|
|
944
|
-
* @param {?=} validateEqual
|
|
945
|
-
* @return {?}
|
|
946
|
-
*/
|
|
947
553
|
DisclaimerUtil.prototype.makeDisclaimerFromRangeCharacter = function (property, value, hideClose, validateEqual) {
|
|
948
554
|
if (hideClose === void 0) { hideClose = false; }
|
|
949
555
|
if (validateEqual === void 0) { validateEqual = true; }
|
|
@@ -965,13 +571,6 @@
|
|
|
965
571
|
value: value.valInitial + ";" + value.valFinal
|
|
966
572
|
};
|
|
967
573
|
};
|
|
968
|
-
/**
|
|
969
|
-
* @param {?} property
|
|
970
|
-
* @param {?} value
|
|
971
|
-
* @param {?=} hideClose
|
|
972
|
-
* @param {?=} validateEqual
|
|
973
|
-
* @return {?}
|
|
974
|
-
*/
|
|
975
574
|
DisclaimerUtil.prototype.makeDisclaimerFromRangeNumber = function (property, value, hideClose, validateEqual) {
|
|
976
575
|
if (hideClose === void 0) { hideClose = false; }
|
|
977
576
|
if (validateEqual === void 0) { validateEqual = true; }
|
|
@@ -993,19 +592,10 @@
|
|
|
993
592
|
value: value.valInitial + ";" + value.valFinal
|
|
994
593
|
};
|
|
995
594
|
};
|
|
996
|
-
/**
|
|
997
|
-
* @param {?} property
|
|
998
|
-
* @param {?} value
|
|
999
|
-
* @param {?=} hideClose
|
|
1000
|
-
* @param {?=} validateEqual
|
|
1001
|
-
* @return {?}
|
|
1002
|
-
*/
|
|
1003
595
|
DisclaimerUtil.prototype.makeDisclaimerFromRangeDate = function (property, value, hideClose, validateEqual) {
|
|
1004
596
|
if (hideClose === void 0) { hideClose = false; }
|
|
1005
597
|
if (validateEqual === void 0) { validateEqual = true; }
|
|
1006
|
-
/** @type {?} */
|
|
1007
598
|
var valInitDate = this.ajustDate(value.valInitial);
|
|
1008
|
-
/** @type {?} */
|
|
1009
599
|
var valFinalDate = this.ajustDate(value.valFinal);
|
|
1010
600
|
if (!this.isValidDate(valInitDate)) {
|
|
1011
601
|
valInitDate = value.iniInitial;
|
|
@@ -1027,20 +617,10 @@
|
|
|
1027
617
|
value: this.dateToQueryParam(valInitDate) + ";" + this.dateToQueryParam(valFinalDate)
|
|
1028
618
|
};
|
|
1029
619
|
};
|
|
1030
|
-
/**
|
|
1031
|
-
* @param {?} disclaimers
|
|
1032
|
-
* @param {?} property
|
|
1033
|
-
* @param {?} defaultValue
|
|
1034
|
-
* @return {?}
|
|
1035
|
-
*/
|
|
1036
620
|
DisclaimerUtil.prototype.atzCharFromDisclamer = function (disclaimers, property, defaultValue) {
|
|
1037
|
-
/** @type {?} */
|
|
1038
621
|
var returnValue = defaultValue;
|
|
1039
622
|
if (disclaimers && disclaimers.length > 0) {
|
|
1040
|
-
disclaimers.find((
|
|
1041
|
-
* @param {?} item
|
|
1042
|
-
* @return {?}
|
|
1043
|
-
*/function (item) {
|
|
623
|
+
disclaimers.find(function (item) {
|
|
1044
624
|
if (item.property === property) {
|
|
1045
625
|
if (item.value === null) {
|
|
1046
626
|
return false;
|
|
@@ -1049,24 +629,14 @@
|
|
|
1049
629
|
return true;
|
|
1050
630
|
}
|
|
1051
631
|
return false;
|
|
1052
|
-
})
|
|
632
|
+
});
|
|
1053
633
|
}
|
|
1054
634
|
return returnValue;
|
|
1055
635
|
};
|
|
1056
|
-
/**
|
|
1057
|
-
* @param {?} disclaimers
|
|
1058
|
-
* @param {?} property
|
|
1059
|
-
* @param {?} defaultValue
|
|
1060
|
-
* @return {?}
|
|
1061
|
-
*/
|
|
1062
636
|
DisclaimerUtil.prototype.atzNumberFromDisclamer = function (disclaimers, property, defaultValue) {
|
|
1063
|
-
/** @type {?} */
|
|
1064
637
|
var returnValue = defaultValue;
|
|
1065
638
|
if (disclaimers && disclaimers.length > 0) {
|
|
1066
|
-
disclaimers.find((
|
|
1067
|
-
* @param {?} item
|
|
1068
|
-
* @return {?}
|
|
1069
|
-
*/function (item) {
|
|
639
|
+
disclaimers.find(function (item) {
|
|
1070
640
|
if (item.property === property) {
|
|
1071
641
|
if (item.value === null) {
|
|
1072
642
|
return false;
|
|
@@ -1075,25 +645,14 @@
|
|
|
1075
645
|
return true;
|
|
1076
646
|
}
|
|
1077
647
|
return false;
|
|
1078
|
-
})
|
|
648
|
+
});
|
|
1079
649
|
}
|
|
1080
650
|
return returnValue;
|
|
1081
651
|
};
|
|
1082
|
-
/**
|
|
1083
|
-
* @param {?} disclaimers
|
|
1084
|
-
* @param {?} property
|
|
1085
|
-
* @param {?} defaultValue
|
|
1086
|
-
* @return {?}
|
|
1087
|
-
*/
|
|
1088
652
|
DisclaimerUtil.prototype.atzBooleanFromDisclamer = function (disclaimers, property, defaultValue) {
|
|
1089
|
-
/** @type {?} */
|
|
1090
653
|
var returnValue = defaultValue;
|
|
1091
654
|
if (disclaimers && disclaimers.length > 0) {
|
|
1092
|
-
|
|
1093
|
-
var disclaimerFind = disclaimers.find(( /**
|
|
1094
|
-
* @param {?} item
|
|
1095
|
-
* @return {?}
|
|
1096
|
-
*/function (item) { return item.property === property; }));
|
|
655
|
+
var disclaimerFind = disclaimers.find(function (item) { return item.property === property; });
|
|
1097
656
|
if (disclaimerFind && disclaimerFind.value !== null && disclaimerFind.value !== undefined) {
|
|
1098
657
|
if (disclaimerFind.value === 'true') {
|
|
1099
658
|
return true;
|
|
@@ -1105,21 +664,11 @@
|
|
|
1105
664
|
}
|
|
1106
665
|
return returnValue;
|
|
1107
666
|
};
|
|
1108
|
-
/**
|
|
1109
|
-
* @param {?} disclaimers
|
|
1110
|
-
* @param {?} property
|
|
1111
|
-
* @param {?} defaultValue
|
|
1112
|
-
* @return {?}
|
|
1113
|
-
*/
|
|
1114
667
|
DisclaimerUtil.prototype.atzDateFromDisclamer = function (disclaimers, property, defaultValue) {
|
|
1115
668
|
var _this = this;
|
|
1116
|
-
/** @type {?} */
|
|
1117
669
|
var returnValue = this.ajustDate(defaultValue);
|
|
1118
670
|
if (disclaimers && disclaimers.length > 0) {
|
|
1119
|
-
disclaimers.find((
|
|
1120
|
-
* @param {?} item
|
|
1121
|
-
* @return {?}
|
|
1122
|
-
*/function (item) {
|
|
671
|
+
disclaimers.find(function (item) {
|
|
1123
672
|
if (item.property === property) {
|
|
1124
673
|
if (item.value === null) {
|
|
1125
674
|
return false;
|
|
@@ -1128,136 +677,69 @@
|
|
|
1128
677
|
return true;
|
|
1129
678
|
}
|
|
1130
679
|
return false;
|
|
1131
|
-
})
|
|
680
|
+
});
|
|
1132
681
|
}
|
|
1133
682
|
return returnValue;
|
|
1134
683
|
};
|
|
1135
|
-
/**
|
|
1136
|
-
* @param {?} disclaimers
|
|
1137
|
-
* @param {?} property
|
|
1138
|
-
* @param {?} defaultValue
|
|
1139
|
-
* @return {?}
|
|
1140
|
-
*/
|
|
1141
684
|
DisclaimerUtil.prototype.atzMultiSelectCharFromDisclamer = function (disclaimers, property, defaultValue) {
|
|
1142
685
|
return this.atzMultiSelectFromDisclamer('char', disclaimers, property, defaultValue);
|
|
1143
686
|
};
|
|
1144
|
-
/**
|
|
1145
|
-
* @param {?} disclaimers
|
|
1146
|
-
* @param {?} property
|
|
1147
|
-
* @param {?} defaultValue
|
|
1148
|
-
* @return {?}
|
|
1149
|
-
*/
|
|
1150
687
|
DisclaimerUtil.prototype.atzMultiSelectNumberFromDisclamer = function (disclaimers, property, defaultValue) {
|
|
1151
688
|
return this.atzMultiSelectFromDisclamer('number', disclaimers, property, defaultValue);
|
|
1152
689
|
};
|
|
1153
|
-
/**
|
|
1154
|
-
* @param {?} type
|
|
1155
|
-
* @param {?} disclaimers
|
|
1156
|
-
* @param {?} property
|
|
1157
|
-
* @param {?} defaultValue
|
|
1158
|
-
* @return {?}
|
|
1159
|
-
*/
|
|
1160
690
|
DisclaimerUtil.prototype.atzMultiSelectFromDisclamer = function (type, disclaimers, property, defaultValue) {
|
|
1161
|
-
/** @type {?} */
|
|
1162
691
|
var returnValue = [];
|
|
1163
|
-
defaultValue.map((
|
|
1164
|
-
* @param {?} item
|
|
1165
|
-
* @return {?}
|
|
1166
|
-
*/function (/**
|
|
1167
|
-
* @param {?} item
|
|
1168
|
-
* @return {?}
|
|
1169
|
-
*/ item) {
|
|
692
|
+
defaultValue.map(function (item) {
|
|
1170
693
|
returnValue.push(item.value);
|
|
1171
|
-
})
|
|
694
|
+
});
|
|
1172
695
|
if (disclaimers && disclaimers.length > 0) {
|
|
1173
|
-
disclaimers.find((
|
|
1174
|
-
* @param {?} item
|
|
1175
|
-
* @return {?}
|
|
1176
|
-
*/function (item) {
|
|
696
|
+
disclaimers.find(function (item) {
|
|
1177
697
|
if (item.property === property) {
|
|
1178
698
|
if (item.value === null || item.value === 'all' || item.value === 'none') {
|
|
1179
699
|
return false;
|
|
1180
700
|
}
|
|
1181
701
|
returnValue = [];
|
|
1182
|
-
item.value.split(',').forEach((
|
|
1183
|
-
* @param {?} itemOpt
|
|
1184
|
-
* @return {?}
|
|
1185
|
-
*/function (/**
|
|
1186
|
-
* @param {?} itemOpt
|
|
1187
|
-
* @return {?}
|
|
1188
|
-
*/ itemOpt) {
|
|
702
|
+
item.value.split(',').forEach(function (itemOpt) {
|
|
1189
703
|
if (type === 'char') {
|
|
1190
704
|
returnValue.push(itemOpt);
|
|
1191
705
|
}
|
|
1192
706
|
if (type === 'number') {
|
|
1193
707
|
returnValue.push(+itemOpt);
|
|
1194
708
|
}
|
|
1195
|
-
})
|
|
709
|
+
});
|
|
1196
710
|
return true;
|
|
1197
711
|
}
|
|
1198
712
|
return false;
|
|
1199
|
-
})
|
|
713
|
+
});
|
|
1200
714
|
}
|
|
1201
715
|
return returnValue;
|
|
1202
716
|
};
|
|
1203
|
-
/**
|
|
1204
|
-
* @param {?} disclaimers
|
|
1205
|
-
* @param {?} property
|
|
1206
|
-
* @param {?} options
|
|
1207
|
-
* @return {?}
|
|
1208
|
-
*/
|
|
1209
717
|
DisclaimerUtil.prototype.atzCheckboxFromDisclamer = function (disclaimers, property, options) {
|
|
1210
|
-
/** @type {?} */
|
|
1211
718
|
var returnValue = [];
|
|
1212
|
-
options.map((
|
|
1213
|
-
* @param {?} item
|
|
1214
|
-
* @return {?}
|
|
1215
|
-
*/function (/**
|
|
1216
|
-
* @param {?} item
|
|
1217
|
-
* @return {?}
|
|
1218
|
-
*/ item) {
|
|
719
|
+
options.map(function (item) {
|
|
1219
720
|
returnValue.push(item.value);
|
|
1220
|
-
})
|
|
721
|
+
});
|
|
1221
722
|
if (disclaimers && disclaimers.length > 0) {
|
|
1222
|
-
disclaimers.find((
|
|
1223
|
-
* @param {?} item
|
|
1224
|
-
* @return {?}
|
|
1225
|
-
*/function (item) {
|
|
723
|
+
disclaimers.find(function (item) {
|
|
1226
724
|
if (item.property === property) {
|
|
1227
725
|
if (item.value === null || item.value === 'all' || item.value === 'none') {
|
|
1228
726
|
return false;
|
|
1229
727
|
}
|
|
1230
728
|
returnValue = [];
|
|
1231
|
-
item.value.split(',').forEach((
|
|
1232
|
-
* @param {?} itemOpt
|
|
1233
|
-
* @return {?}
|
|
1234
|
-
*/function (/**
|
|
1235
|
-
* @param {?} itemOpt
|
|
1236
|
-
* @return {?}
|
|
1237
|
-
*/ itemOpt) {
|
|
729
|
+
item.value.split(',').forEach(function (itemOpt) {
|
|
1238
730
|
returnValue.push(itemOpt);
|
|
1239
|
-
})
|
|
731
|
+
});
|
|
1240
732
|
return true;
|
|
1241
733
|
}
|
|
1242
734
|
return false;
|
|
1243
|
-
})
|
|
735
|
+
});
|
|
1244
736
|
}
|
|
1245
737
|
return returnValue;
|
|
1246
738
|
};
|
|
1247
|
-
/**
|
|
1248
|
-
* @param {?} disclaimers
|
|
1249
|
-
* @param {?} property
|
|
1250
|
-
* @param {?} rangeChar
|
|
1251
|
-
* @return {?}
|
|
1252
|
-
*/
|
|
1253
739
|
DisclaimerUtil.prototype.atzRangeCharFromDisclamer = function (disclaimers, property, rangeChar) {
|
|
1254
|
-
/** @type {?} */
|
|
1255
740
|
var value = '';
|
|
1256
741
|
if (disclaimers && disclaimers.length > 0) {
|
|
1257
|
-
disclaimers.find((
|
|
1258
|
-
* @param {?} item
|
|
1259
|
-
* @return {?}
|
|
1260
|
-
*/function (item) {
|
|
742
|
+
disclaimers.find(function (item) {
|
|
1261
743
|
if (item.property === property) {
|
|
1262
744
|
if (item.value === null) {
|
|
1263
745
|
return false;
|
|
@@ -1266,24 +748,14 @@
|
|
|
1266
748
|
return true;
|
|
1267
749
|
}
|
|
1268
750
|
return false;
|
|
1269
|
-
})
|
|
751
|
+
});
|
|
1270
752
|
}
|
|
1271
753
|
return this.atzRangeCharFromQueryParam(value, rangeChar);
|
|
1272
754
|
};
|
|
1273
|
-
/**
|
|
1274
|
-
* @param {?} disclaimers
|
|
1275
|
-
* @param {?} property
|
|
1276
|
-
* @param {?} rangeNum
|
|
1277
|
-
* @return {?}
|
|
1278
|
-
*/
|
|
1279
755
|
DisclaimerUtil.prototype.atzRangeNumFromDisclamer = function (disclaimers, property, rangeNum) {
|
|
1280
|
-
/** @type {?} */
|
|
1281
756
|
var value = '';
|
|
1282
757
|
if (disclaimers && disclaimers.length > 0) {
|
|
1283
|
-
disclaimers.find((
|
|
1284
|
-
* @param {?} item
|
|
1285
|
-
* @return {?}
|
|
1286
|
-
*/function (item) {
|
|
758
|
+
disclaimers.find(function (item) {
|
|
1287
759
|
if (item.property === property) {
|
|
1288
760
|
if (item.value === null) {
|
|
1289
761
|
return false;
|
|
@@ -1292,24 +764,14 @@
|
|
|
1292
764
|
return true;
|
|
1293
765
|
}
|
|
1294
766
|
return false;
|
|
1295
|
-
})
|
|
767
|
+
});
|
|
1296
768
|
}
|
|
1297
769
|
return this.atzRangeNumFromQueryParam(value, rangeNum);
|
|
1298
770
|
};
|
|
1299
|
-
/**
|
|
1300
|
-
* @param {?} disclaimers
|
|
1301
|
-
* @param {?} property
|
|
1302
|
-
* @param {?} rangeDate
|
|
1303
|
-
* @return {?}
|
|
1304
|
-
*/
|
|
1305
771
|
DisclaimerUtil.prototype.atzRangeDateFromDisclamer = function (disclaimers, property, rangeDate) {
|
|
1306
|
-
/** @type {?} */
|
|
1307
772
|
var value = '';
|
|
1308
773
|
if (disclaimers && disclaimers.length > 0) {
|
|
1309
|
-
disclaimers.find((
|
|
1310
|
-
* @param {?} item
|
|
1311
|
-
* @return {?}
|
|
1312
|
-
*/function (item) {
|
|
774
|
+
disclaimers.find(function (item) {
|
|
1313
775
|
if (item.property === property) {
|
|
1314
776
|
if (item.value === null) {
|
|
1315
777
|
return false;
|
|
@@ -1318,15 +780,10 @@
|
|
|
1318
780
|
return true;
|
|
1319
781
|
}
|
|
1320
782
|
return false;
|
|
1321
|
-
})
|
|
783
|
+
});
|
|
1322
784
|
}
|
|
1323
785
|
return this.atzRangeDateFromQueryParam(value, rangeDate);
|
|
1324
786
|
};
|
|
1325
|
-
/**
|
|
1326
|
-
* @param {?} value
|
|
1327
|
-
* @param {?} rangeChar
|
|
1328
|
-
* @return {?}
|
|
1329
|
-
*/
|
|
1330
787
|
DisclaimerUtil.prototype.atzRangeCharFromQueryParam = function (value, rangeChar) {
|
|
1331
788
|
rangeChar.valInitial = rangeChar.iniInitial;
|
|
1332
789
|
rangeChar.valFinal = rangeChar.iniFinal;
|
|
@@ -1340,11 +797,6 @@
|
|
|
1340
797
|
}
|
|
1341
798
|
return rangeChar;
|
|
1342
799
|
};
|
|
1343
|
-
/**
|
|
1344
|
-
* @param {?} value
|
|
1345
|
-
* @param {?} rangeNum
|
|
1346
|
-
* @return {?}
|
|
1347
|
-
*/
|
|
1348
800
|
DisclaimerUtil.prototype.atzRangeNumFromQueryParam = function (value, rangeNum) {
|
|
1349
801
|
rangeNum.valInitial = rangeNum.iniInitial;
|
|
1350
802
|
rangeNum.valFinal = rangeNum.iniFinal;
|
|
@@ -1358,11 +810,6 @@
|
|
|
1358
810
|
}
|
|
1359
811
|
return rangeNum;
|
|
1360
812
|
};
|
|
1361
|
-
/**
|
|
1362
|
-
* @param {?} value
|
|
1363
|
-
* @param {?} rangeDate
|
|
1364
|
-
* @return {?}
|
|
1365
|
-
*/
|
|
1366
813
|
DisclaimerUtil.prototype.atzRangeDateFromQueryParam = function (value, rangeDate) {
|
|
1367
814
|
rangeDate.valInitial = rangeDate.iniInitial;
|
|
1368
815
|
rangeDate.valFinal = rangeDate.iniFinal;
|
|
@@ -1376,43 +823,21 @@
|
|
|
1376
823
|
}
|
|
1377
824
|
return rangeDate;
|
|
1378
825
|
};
|
|
1379
|
-
/**
|
|
1380
|
-
* @param {?} date
|
|
1381
|
-
* @return {?}
|
|
1382
|
-
*/
|
|
1383
826
|
DisclaimerUtil.prototype.dateToQueryParam = function (date) {
|
|
1384
|
-
/** @type {?} */
|
|
1385
827
|
var iDay = date.getDate();
|
|
1386
|
-
/** @type {?} */
|
|
1387
828
|
var iMonth = date.getMonth() + 1;
|
|
1388
|
-
/** @type {?} */
|
|
1389
829
|
var iYear = date.getFullYear();
|
|
1390
830
|
return iYear + "-" + this.pad(iMonth) + "-" + this.pad(iDay);
|
|
1391
831
|
};
|
|
1392
|
-
/**
|
|
1393
|
-
* @param {?} param
|
|
1394
|
-
* @return {?}
|
|
1395
|
-
*/
|
|
1396
832
|
DisclaimerUtil.prototype.queryParamToDate = function (param) {
|
|
1397
|
-
/** @type {?} */
|
|
1398
833
|
var iDay = +param.split('-')[2];
|
|
1399
|
-
/** @type {?} */
|
|
1400
834
|
var iMonth = +param.split('-')[1];
|
|
1401
|
-
/** @type {?} */
|
|
1402
835
|
var iYear = +param.split('-')[0];
|
|
1403
836
|
return new Date(iYear, iMonth - 1, iDay);
|
|
1404
837
|
};
|
|
1405
|
-
/**
|
|
1406
|
-
* @param {?} date
|
|
1407
|
-
* @return {?}
|
|
1408
|
-
*/
|
|
1409
838
|
DisclaimerUtil.prototype.isValidDate = function (date) {
|
|
1410
839
|
return date instanceof Date && !isNaN(date.getTime());
|
|
1411
840
|
};
|
|
1412
|
-
/**
|
|
1413
|
-
* @param {?} param
|
|
1414
|
-
* @return {?}
|
|
1415
|
-
*/
|
|
1416
841
|
DisclaimerUtil.prototype.ajustDate = function (param) {
|
|
1417
842
|
if (param instanceof Date) {
|
|
1418
843
|
return param;
|
|
@@ -1422,10 +847,6 @@
|
|
|
1422
847
|
}
|
|
1423
848
|
return this.queryParamToDate(param.split('T')[0]);
|
|
1424
849
|
};
|
|
1425
|
-
/**
|
|
1426
|
-
* @param {?} number
|
|
1427
|
-
* @return {?}
|
|
1428
|
-
*/
|
|
1429
850
|
DisclaimerUtil.prototype.pad = function (number) {
|
|
1430
851
|
if (number < 10) {
|
|
1431
852
|
return '0' + number;
|
|
@@ -1433,27 +854,13 @@
|
|
|
1433
854
|
return number;
|
|
1434
855
|
};
|
|
1435
856
|
return DisclaimerUtil;
|
|
1436
|
-
}());
|
|
1437
|
-
if (false) {
|
|
1438
|
-
/** @type {?} */
|
|
1439
|
-
DisclaimerUtil.prototype.poNotification;
|
|
1440
|
-
/** @type {?} */
|
|
1441
|
-
DisclaimerUtil.prototype.poI18nPipe;
|
|
1442
|
-
/** @type {?} */
|
|
1443
|
-
DisclaimerUtil.prototype.literals;
|
|
1444
|
-
}
|
|
857
|
+
}());
|
|
1445
858
|
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
*/
|
|
859
|
+
/*
|
|
860
|
+
Versão: 1.002
|
|
861
|
+
Data Criação: 19/02/2019
|
|
862
|
+
*/
|
|
1451
863
|
var FieldValidationUtil = /** @class */ (function () {
|
|
1452
|
-
/**
|
|
1453
|
-
* @param {?} poNotification
|
|
1454
|
-
* @param {?} poI18nPipe
|
|
1455
|
-
* @param {?} literals
|
|
1456
|
-
*/
|
|
1457
864
|
function FieldValidationUtil(poNotification, poI18nPipe, literals) {
|
|
1458
865
|
this.literals = {};
|
|
1459
866
|
this.poNotification = poNotification;
|
|
@@ -1461,11 +868,6 @@
|
|
|
1461
868
|
this.literals = literals;
|
|
1462
869
|
this.disclaimerUtil = new DisclaimerUtil(this.poNotification, this.poI18nPipe, this.literals);
|
|
1463
870
|
}
|
|
1464
|
-
/**
|
|
1465
|
-
* @param {?} field
|
|
1466
|
-
* @param {?} value
|
|
1467
|
-
* @return {?}
|
|
1468
|
-
*/
|
|
1469
871
|
FieldValidationUtil.prototype.vldFieldCharacter = function (field, value) {
|
|
1470
872
|
if (!value || value.trim() === '') {
|
|
1471
873
|
this.poNotification.error({
|
|
@@ -1476,13 +878,6 @@
|
|
|
1476
878
|
return true;
|
|
1477
879
|
};
|
|
1478
880
|
// Valida uma faixa de caracteres se o inicial é menor que final
|
|
1479
|
-
/**
|
|
1480
|
-
* @param {?} initialField
|
|
1481
|
-
* @param {?} finalField
|
|
1482
|
-
* @param {?} initialValue
|
|
1483
|
-
* @param {?} finalValue
|
|
1484
|
-
* @return {?}
|
|
1485
|
-
*/
|
|
1486
881
|
FieldValidationUtil.prototype.vldRangeCharacter = function (initialField, finalField, initialValue, finalValue) {
|
|
1487
882
|
if (!initialValue || !finalValue) {
|
|
1488
883
|
return true;
|
|
@@ -1495,13 +890,6 @@
|
|
|
1495
890
|
}
|
|
1496
891
|
return true;
|
|
1497
892
|
};
|
|
1498
|
-
/**
|
|
1499
|
-
* @param {?} field
|
|
1500
|
-
* @param {?} value
|
|
1501
|
-
* @param {?=} vldValue
|
|
1502
|
-
* @param {?=} zeroAccept
|
|
1503
|
-
* @return {?}
|
|
1504
|
-
*/
|
|
1505
893
|
FieldValidationUtil.prototype.vldFieldNumber = function (field, value, vldValue, zeroAccept) {
|
|
1506
894
|
if (vldValue === void 0) { vldValue = false; }
|
|
1507
895
|
if (zeroAccept === void 0) { zeroAccept = false; }
|
|
@@ -1519,11 +907,6 @@
|
|
|
1519
907
|
}
|
|
1520
908
|
return true;
|
|
1521
909
|
};
|
|
1522
|
-
/**
|
|
1523
|
-
* @param {?} field
|
|
1524
|
-
* @param {?} value
|
|
1525
|
-
* @return {?}
|
|
1526
|
-
*/
|
|
1527
910
|
FieldValidationUtil.prototype.vldValueOfNumber = function (field, value) {
|
|
1528
911
|
if (value && value < 0) {
|
|
1529
912
|
this.poNotification.error({ message: this.poI18nPipe.transform(this.literals['fieldVldNumber'], [value.toString(), this.literals[field]]) });
|
|
@@ -1531,12 +914,6 @@
|
|
|
1531
914
|
}
|
|
1532
915
|
return true;
|
|
1533
916
|
};
|
|
1534
|
-
/**
|
|
1535
|
-
* @param {?} field
|
|
1536
|
-
* @param {?} value
|
|
1537
|
-
* @param {?=} vldValue
|
|
1538
|
-
* @return {?}
|
|
1539
|
-
*/
|
|
1540
917
|
FieldValidationUtil.prototype.vldFieldPercent = function (field, value, vldValue) {
|
|
1541
918
|
if (vldValue === void 0) { vldValue = false; }
|
|
1542
919
|
if (vldValue && !this.vldValueOfPercent(field, value)) {
|
|
@@ -1547,11 +924,6 @@
|
|
|
1547
924
|
}
|
|
1548
925
|
return true;
|
|
1549
926
|
};
|
|
1550
|
-
/**
|
|
1551
|
-
* @param {?} field
|
|
1552
|
-
* @param {?} value
|
|
1553
|
-
* @return {?}
|
|
1554
|
-
*/
|
|
1555
927
|
FieldValidationUtil.prototype.vldValueOfPercent = function (field, value) {
|
|
1556
928
|
if (value && value < 0) {
|
|
1557
929
|
this.poNotification.error({ message: this.poI18nPipe.transform(this.literals['fieldVldNumber'], [value.toString(), this.literals[field]]) });
|
|
@@ -1564,13 +936,6 @@
|
|
|
1564
936
|
return true;
|
|
1565
937
|
};
|
|
1566
938
|
// Valida uma faixa de números se o inicial é menor que final
|
|
1567
|
-
/**
|
|
1568
|
-
* @param {?} initialField
|
|
1569
|
-
* @param {?} finalField
|
|
1570
|
-
* @param {?} initialValue
|
|
1571
|
-
* @param {?} finalValue
|
|
1572
|
-
* @return {?}
|
|
1573
|
-
*/
|
|
1574
939
|
FieldValidationUtil.prototype.vldRangeNumber = function (initialField, finalField, initialValue, finalValue) {
|
|
1575
940
|
if (!initialValue) {
|
|
1576
941
|
initialValue = 0;
|
|
@@ -1586,13 +951,7 @@
|
|
|
1586
951
|
}
|
|
1587
952
|
return true;
|
|
1588
953
|
};
|
|
1589
|
-
/**
|
|
1590
|
-
* @param {?} field
|
|
1591
|
-
* @param {?} value
|
|
1592
|
-
* @return {?}
|
|
1593
|
-
*/
|
|
1594
954
|
FieldValidationUtil.prototype.vldFieldDate = function (field, value) {
|
|
1595
|
-
/** @type {?} */
|
|
1596
955
|
var valDate = this.disclaimerUtil.ajustDate(value);
|
|
1597
956
|
if (!this.disclaimerUtil.isValidDate(valDate)) {
|
|
1598
957
|
this.poNotification.error({
|
|
@@ -1603,20 +962,11 @@
|
|
|
1603
962
|
return true;
|
|
1604
963
|
};
|
|
1605
964
|
// Valida uma faixa de datas se o inicial é menor que final
|
|
1606
|
-
/**
|
|
1607
|
-
* @param {?} initialField
|
|
1608
|
-
* @param {?} finalField
|
|
1609
|
-
* @param {?} initialValue
|
|
1610
|
-
* @param {?} finalValue
|
|
1611
|
-
* @return {?}
|
|
1612
|
-
*/
|
|
1613
965
|
FieldValidationUtil.prototype.vldRangeDate = function (initialField, finalField, initialValue, finalValue) {
|
|
1614
966
|
if (!initialValue || !finalValue) {
|
|
1615
967
|
return true;
|
|
1616
968
|
}
|
|
1617
|
-
/** @type {?} */
|
|
1618
969
|
var valInitialDate = this.disclaimerUtil.ajustDate(initialValue).getTime();
|
|
1619
|
-
/** @type {?} */
|
|
1620
970
|
var valFinalDate = this.disclaimerUtil.ajustDate(finalValue).getTime();
|
|
1621
971
|
if (valInitialDate > valFinalDate) {
|
|
1622
972
|
this.poNotification.error({
|
|
@@ -1626,11 +976,6 @@
|
|
|
1626
976
|
}
|
|
1627
977
|
return true;
|
|
1628
978
|
};
|
|
1629
|
-
/**
|
|
1630
|
-
* @param {?} field
|
|
1631
|
-
* @param {?} value
|
|
1632
|
-
* @return {?}
|
|
1633
|
-
*/
|
|
1634
979
|
FieldValidationUtil.prototype.vldFieldMultiSelect = function (field, value) {
|
|
1635
980
|
if (!value || value.length === 0) {
|
|
1636
981
|
this.poNotification.error({
|
|
@@ -1640,11 +985,6 @@
|
|
|
1640
985
|
}
|
|
1641
986
|
return true;
|
|
1642
987
|
};
|
|
1643
|
-
/**
|
|
1644
|
-
* @param {?} field
|
|
1645
|
-
* @param {?} value
|
|
1646
|
-
* @return {?}
|
|
1647
|
-
*/
|
|
1648
988
|
FieldValidationUtil.prototype.vldFieldCheckbox = function (field, value) {
|
|
1649
989
|
if (!value || value.length === 0) {
|
|
1650
990
|
this.poNotification.error({
|
|
@@ -1655,18 +995,9 @@
|
|
|
1655
995
|
return true;
|
|
1656
996
|
};
|
|
1657
997
|
// Valida formato conforme regra: "9" apenas números, "X" qualquer caracter, "!" apenas letras maiúsculas
|
|
1658
|
-
/**
|
|
1659
|
-
* @param {?} field
|
|
1660
|
-
* @param {?} value
|
|
1661
|
-
* @param {?} format
|
|
1662
|
-
* @param {?=} replacePoint
|
|
1663
|
-
* @return {?}
|
|
1664
|
-
*/
|
|
1665
998
|
FieldValidationUtil.prototype.vldFieldFormat = function (field, value, format, replacePoint) {
|
|
1666
999
|
if (replacePoint === void 0) { replacePoint = false; }
|
|
1667
|
-
/** @type {?} */
|
|
1668
1000
|
var lOK = true;
|
|
1669
|
-
/** @type {?} */
|
|
1670
1001
|
var oldFormat;
|
|
1671
1002
|
if (!value) {
|
|
1672
1003
|
return lOK;
|
|
@@ -1706,23 +1037,8 @@
|
|
|
1706
1037
|
return lOK;
|
|
1707
1038
|
};
|
|
1708
1039
|
return FieldValidationUtil;
|
|
1709
|
-
}());
|
|
1710
|
-
if (false) {
|
|
1711
|
-
/** @type {?} */
|
|
1712
|
-
FieldValidationUtil.prototype.poNotification;
|
|
1713
|
-
/** @type {?} */
|
|
1714
|
-
FieldValidationUtil.prototype.poI18nPipe;
|
|
1715
|
-
/** @type {?} */
|
|
1716
|
-
FieldValidationUtil.prototype.literals;
|
|
1717
|
-
/** @type {?} */
|
|
1718
|
-
FieldValidationUtil.prototype.disclaimerUtil;
|
|
1719
|
-
}
|
|
1040
|
+
}());
|
|
1720
1041
|
|
|
1721
|
-
/**
|
|
1722
|
-
* @fileoverview added by tsickle
|
|
1723
|
-
* Generated from: lib/utils/filter-range.util.ts
|
|
1724
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1725
|
-
*/
|
|
1726
1042
|
/*
|
|
1727
1043
|
Versão: 1.000
|
|
1728
1044
|
Data Criação: 06/08/2018
|
|
@@ -1730,11 +1046,6 @@
|
|
|
1730
1046
|
var FilterRangeUtil = /** @class */ (function () {
|
|
1731
1047
|
function FilterRangeUtil() {
|
|
1732
1048
|
}
|
|
1733
|
-
/**
|
|
1734
|
-
* @param {?} iniInitial
|
|
1735
|
-
* @param {?} iniFinal
|
|
1736
|
-
* @return {?}
|
|
1737
|
-
*/
|
|
1738
1049
|
FilterRangeUtil.makeFilterRangeCharacter = function (iniInitial, iniFinal) {
|
|
1739
1050
|
return {
|
|
1740
1051
|
iniInitial: iniInitial,
|
|
@@ -1743,11 +1054,6 @@
|
|
|
1743
1054
|
valFinal: iniFinal
|
|
1744
1055
|
};
|
|
1745
1056
|
};
|
|
1746
|
-
/**
|
|
1747
|
-
* @param {?} iniInitial
|
|
1748
|
-
* @param {?} iniFinal
|
|
1749
|
-
* @return {?}
|
|
1750
|
-
*/
|
|
1751
1057
|
FilterRangeUtil.makeFilterRangeNumber = function (iniInitial, iniFinal) {
|
|
1752
1058
|
return {
|
|
1753
1059
|
iniInitial: iniInitial,
|
|
@@ -1756,11 +1062,6 @@
|
|
|
1756
1062
|
valFinal: iniFinal
|
|
1757
1063
|
};
|
|
1758
1064
|
};
|
|
1759
|
-
/**
|
|
1760
|
-
* @param {?} iniInitial
|
|
1761
|
-
* @param {?} iniFinal
|
|
1762
|
-
* @return {?}
|
|
1763
|
-
*/
|
|
1764
1065
|
FilterRangeUtil.makeFilterRangeDate = function (iniInitial, iniFinal) {
|
|
1765
1066
|
return {
|
|
1766
1067
|
iniInitial: iniInitial,
|
|
@@ -1772,50 +1073,17 @@
|
|
|
1772
1073
|
return FilterRangeUtil;
|
|
1773
1074
|
}());
|
|
1774
1075
|
|
|
1775
|
-
/**
|
|
1776
|
-
* @fileoverview added by tsickle
|
|
1777
|
-
* Generated from: lib/utils/generic-functions.utils.ts
|
|
1778
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1779
|
-
*/
|
|
1780
1076
|
/*
|
|
1781
1077
|
Versão: 1.003
|
|
1782
1078
|
Data Criação: 18/04/2019
|
|
1783
1079
|
*/
|
|
1784
|
-
/**
|
|
1785
|
-
* @record
|
|
1786
|
-
*/
|
|
1787
|
-
function ChartSeries() { }
|
|
1788
|
-
if (false) {
|
|
1789
|
-
/** @type {?|undefined} */
|
|
1790
|
-
ChartSeries.prototype.name;
|
|
1791
|
-
/** @type {?|undefined} */
|
|
1792
|
-
ChartSeries.prototype.data;
|
|
1793
|
-
}
|
|
1794
|
-
/**
|
|
1795
|
-
* @record
|
|
1796
|
-
*/
|
|
1797
|
-
function ChartValues() { }
|
|
1798
|
-
if (false) {
|
|
1799
|
-
/** @type {?} */
|
|
1800
|
-
ChartValues.prototype.minValue;
|
|
1801
|
-
/** @type {?} */
|
|
1802
|
-
ChartValues.prototype.maxValue;
|
|
1803
|
-
}
|
|
1804
1080
|
var GenericFunctionsUtils = /** @class */ (function () {
|
|
1805
|
-
/**
|
|
1806
|
-
* @param {?} literals
|
|
1807
|
-
*/
|
|
1808
1081
|
function GenericFunctionsUtils(literals) {
|
|
1809
1082
|
this.literals = {};
|
|
1810
1083
|
this.literals = literals;
|
|
1811
1084
|
}
|
|
1812
1085
|
/* Transforma uma Lista separada por "," em um Array */
|
|
1813
|
-
/**
|
|
1814
|
-
* @param {?} list
|
|
1815
|
-
* @return {?}
|
|
1816
|
-
*/
|
|
1817
1086
|
GenericFunctionsUtils.listToArrayCharacter = function (list) {
|
|
1818
|
-
/** @type {?} */
|
|
1819
1087
|
var returnArray = new Array();
|
|
1820
1088
|
if (list && list !== '') {
|
|
1821
1089
|
returnArray = list.split(',');
|
|
@@ -1823,24 +1091,14 @@
|
|
|
1823
1091
|
return returnArray;
|
|
1824
1092
|
};
|
|
1825
1093
|
/* Transforma um Array em uma Lista separada por "," */
|
|
1826
|
-
/**
|
|
1827
|
-
* @param {?} array
|
|
1828
|
-
* @return {?}
|
|
1829
|
-
*/
|
|
1830
1094
|
GenericFunctionsUtils.ArrayToListCharacter = function (array) {
|
|
1831
|
-
/** @type {?} */
|
|
1832
1095
|
var list = '';
|
|
1833
1096
|
if (array && array.length > 0) {
|
|
1834
1097
|
list = array.join(',');
|
|
1835
1098
|
}
|
|
1836
1099
|
return list;
|
|
1837
1100
|
};
|
|
1838
|
-
/**
|
|
1839
|
-
* @param {?} object
|
|
1840
|
-
* @return {?}
|
|
1841
|
-
*/
|
|
1842
1101
|
GenericFunctionsUtils.isEmpty = function (object) {
|
|
1843
|
-
/** @type {?} */
|
|
1844
1102
|
var isEmpty = true;
|
|
1845
1103
|
for (var content in object) {
|
|
1846
1104
|
if (object.hasOwnProperty(content)) {
|
|
@@ -1849,26 +1107,12 @@
|
|
|
1849
1107
|
}
|
|
1850
1108
|
return isEmpty;
|
|
1851
1109
|
};
|
|
1852
|
-
/**
|
|
1853
|
-
* @param {?} chartData
|
|
1854
|
-
* @return {?}
|
|
1855
|
-
*/
|
|
1856
1110
|
GenericFunctionsUtils.getChartValues = function (chartData) {
|
|
1857
|
-
/** @type {?} */
|
|
1858
1111
|
var chartValues;
|
|
1859
|
-
|
|
1860
|
-
var maxValue;
|
|
1861
|
-
/** @type {?} */
|
|
1862
|
-
var minValue;
|
|
1112
|
+
var maxValue, minValue;
|
|
1863
1113
|
maxValue = undefined;
|
|
1864
1114
|
minValue = undefined;
|
|
1865
|
-
chartData.map((
|
|
1866
|
-
* @param {?} item
|
|
1867
|
-
* @return {?}
|
|
1868
|
-
*/function (/**
|
|
1869
|
-
* @param {?} item
|
|
1870
|
-
* @return {?}
|
|
1871
|
-
*/ item) {
|
|
1115
|
+
chartData.map(function (item) {
|
|
1872
1116
|
if (maxValue === undefined && minValue === undefined) {
|
|
1873
1117
|
maxValue = item.data[0];
|
|
1874
1118
|
minValue = item.data[0];
|
|
@@ -1881,7 +1125,7 @@
|
|
|
1881
1125
|
maxValue = item.data[0];
|
|
1882
1126
|
}
|
|
1883
1127
|
}
|
|
1884
|
-
})
|
|
1128
|
+
});
|
|
1885
1129
|
if (maxValue > 0 && minValue > 0) {
|
|
1886
1130
|
chartValues = { maxValue: maxValue, minValue: 0 };
|
|
1887
1131
|
}
|
|
@@ -1889,7 +1133,6 @@
|
|
|
1889
1133
|
chartValues = { maxValue: maxValue, minValue: minValue };
|
|
1890
1134
|
}
|
|
1891
1135
|
if (maxValue < 0 && minValue < 0) {
|
|
1892
|
-
/** @type {?} */
|
|
1893
1136
|
var max = (minValue / 3) * (-1);
|
|
1894
1137
|
chartValues = { maxValue: max, minValue: minValue };
|
|
1895
1138
|
}
|
|
@@ -1897,7 +1140,6 @@
|
|
|
1897
1140
|
chartValues = { maxValue: maxValue, minValue: 0 };
|
|
1898
1141
|
}
|
|
1899
1142
|
if (maxValue === 0 && minValue < 0) {
|
|
1900
|
-
/** @type {?} */
|
|
1901
1143
|
var max = (minValue / 3) * (-1);
|
|
1902
1144
|
chartValues = { maxValue: max, minValue: minValue };
|
|
1903
1145
|
}
|
|
@@ -1909,109 +1151,54 @@
|
|
|
1909
1151
|
return chartValues;
|
|
1910
1152
|
};
|
|
1911
1153
|
/*Deixa no list apenas o itens que existem no options*/
|
|
1912
|
-
/**
|
|
1913
|
-
* @param {?} options
|
|
1914
|
-
* @param {?} list
|
|
1915
|
-
* @return {?}
|
|
1916
|
-
*/
|
|
1917
1154
|
GenericFunctionsUtils.atzMultiSelectListByOptions = function (options, list) {
|
|
1918
|
-
/** @type {?} */
|
|
1919
1155
|
var idx;
|
|
1920
|
-
/** @type {?} */
|
|
1921
1156
|
var newList;
|
|
1922
1157
|
if (!list) {
|
|
1923
1158
|
return list;
|
|
1924
1159
|
}
|
|
1925
1160
|
newList = new Array();
|
|
1926
|
-
list.map((
|
|
1927
|
-
* @param {?} item
|
|
1928
|
-
* @return {?}
|
|
1929
|
-
*/function (/**
|
|
1930
|
-
* @param {?} item
|
|
1931
|
-
* @return {?}
|
|
1932
|
-
*/ item) {
|
|
1161
|
+
list.map(function (item) {
|
|
1933
1162
|
if (item) {
|
|
1934
|
-
idx = options.findIndex((
|
|
1935
|
-
* @param {?} itemOptions
|
|
1936
|
-
* @return {?}
|
|
1937
|
-
*/function (/**
|
|
1938
|
-
* @param {?} itemOptions
|
|
1939
|
-
* @return {?}
|
|
1940
|
-
*/ itemOptions) { return itemOptions.value === item; }));
|
|
1163
|
+
idx = options.findIndex(function (itemOptions) { return itemOptions.value === item; });
|
|
1941
1164
|
if (idx >= 0) {
|
|
1942
1165
|
newList.push(item);
|
|
1943
1166
|
}
|
|
1944
1167
|
}
|
|
1945
|
-
})
|
|
1168
|
+
});
|
|
1946
1169
|
return newList;
|
|
1947
1170
|
};
|
|
1948
1171
|
/*Carrega o Options com os valores defaults passados como parâmetro (list)*/
|
|
1949
|
-
/**
|
|
1950
|
-
* @param {?} options
|
|
1951
|
-
* @param {?} list
|
|
1952
|
-
* @return {?}
|
|
1953
|
-
*/
|
|
1954
1172
|
GenericFunctionsUtils.prototype.loadOptionsMultiSelect = function (options, list) {
|
|
1955
1173
|
var _this = this;
|
|
1956
|
-
/** @type {?} */
|
|
1957
1174
|
var idx;
|
|
1958
1175
|
if (!list) {
|
|
1959
1176
|
return;
|
|
1960
1177
|
}
|
|
1961
|
-
list.map((
|
|
1962
|
-
* @param {?} item
|
|
1963
|
-
* @return {?}
|
|
1964
|
-
*/function (/**
|
|
1965
|
-
* @param {?} item
|
|
1966
|
-
* @return {?}
|
|
1967
|
-
*/ item) {
|
|
1178
|
+
list.map(function (item) {
|
|
1968
1179
|
if (item) {
|
|
1969
|
-
idx = options.findIndex((
|
|
1970
|
-
* @param {?} itemOptions
|
|
1971
|
-
* @return {?}
|
|
1972
|
-
*/function (/**
|
|
1973
|
-
* @param {?} itemOptions
|
|
1974
|
-
* @return {?}
|
|
1975
|
-
*/ itemOptions) { return itemOptions.value === item; }));
|
|
1180
|
+
idx = options.findIndex(function (itemOptions) { return itemOptions.value === item; });
|
|
1976
1181
|
if (idx === -1) {
|
|
1977
1182
|
options.push({ label: item === 'all' ? _this.literals['all'] : item, value: item });
|
|
1978
1183
|
}
|
|
1979
1184
|
}
|
|
1980
|
-
})
|
|
1185
|
+
});
|
|
1981
1186
|
};
|
|
1982
1187
|
/*Carrega o Options com os valores defaults passados como parâmetro (list)*/
|
|
1983
|
-
/**
|
|
1984
|
-
* @param {?} options
|
|
1985
|
-
* @param {?} selectValue
|
|
1986
|
-
* @param {?=} tradValue
|
|
1987
|
-
* @return {?}
|
|
1988
|
-
*/
|
|
1989
1188
|
GenericFunctionsUtils.prototype.loadOptionsSelect = function (options, selectValue, tradValue) {
|
|
1990
1189
|
if (tradValue === void 0) { tradValue = false; }
|
|
1991
|
-
/** @type {?} */
|
|
1992
1190
|
var idx;
|
|
1993
1191
|
if (!selectValue) {
|
|
1994
1192
|
return;
|
|
1995
1193
|
}
|
|
1996
1194
|
if (selectValue) {
|
|
1997
|
-
idx = options.findIndex((
|
|
1998
|
-
* @param {?} itemOptions
|
|
1999
|
-
* @return {?}
|
|
2000
|
-
*/function (/**
|
|
2001
|
-
* @param {?} itemOptions
|
|
2002
|
-
* @return {?}
|
|
2003
|
-
*/ itemOptions) { return itemOptions.value === selectValue; }));
|
|
1195
|
+
idx = options.findIndex(function (itemOptions) { return itemOptions.value === selectValue; });
|
|
2004
1196
|
if (idx === -1) {
|
|
2005
1197
|
options.push({ label: tradValue ? this.literals[selectValue] : selectValue, value: selectValue });
|
|
2006
1198
|
}
|
|
2007
1199
|
}
|
|
2008
1200
|
};
|
|
2009
1201
|
/*Método que compara 2 objetos e retorna se são iguais ou diferentes*/
|
|
2010
|
-
/**
|
|
2011
|
-
* @param {?} firstObject
|
|
2012
|
-
* @param {?} secondObject
|
|
2013
|
-
* @return {?}
|
|
2014
|
-
*/
|
|
2015
1202
|
GenericFunctionsUtils.prototype.compareObjects = function (firstObject, secondObject) {
|
|
2016
1203
|
if (!firstObject || !secondObject) {
|
|
2017
1204
|
return false;
|
|
@@ -2030,21 +1217,11 @@
|
|
|
2030
1217
|
}
|
|
2031
1218
|
return true;
|
|
2032
1219
|
};
|
|
2033
|
-
/**
|
|
2034
|
-
* @param {?} charInd
|
|
2035
|
-
* @param {?} dateRef
|
|
2036
|
-
* @return {?}
|
|
2037
|
-
*/
|
|
2038
1220
|
GenericFunctionsUtils.prototype.referenceGeneration = function (charInd, dateRef) {
|
|
2039
|
-
/** @type {?} */
|
|
2040
1221
|
var reference;
|
|
2041
|
-
/** @type {?} */
|
|
2042
1222
|
var random;
|
|
2043
|
-
/** @type {?} */
|
|
2044
1223
|
var iDay = dateRef.getDate();
|
|
2045
|
-
/** @type {?} */
|
|
2046
1224
|
var iMonth = dateRef.getMonth() + 1;
|
|
2047
|
-
/** @type {?} */
|
|
2048
1225
|
var iYear = dateRef.getFullYear();
|
|
2049
1226
|
reference = "" + this.pad(iYear) + this.pad(iMonth) + this.pad(iDay) + charInd;
|
|
2050
1227
|
random = btoa("" + (new Date()).getTime());
|
|
@@ -2052,10 +1229,6 @@
|
|
|
2052
1229
|
random = random.slice(random.length - 3, random.length);
|
|
2053
1230
|
return "" + reference + random;
|
|
2054
1231
|
};
|
|
2055
|
-
/**
|
|
2056
|
-
* @param {?} number
|
|
2057
|
-
* @return {?}
|
|
2058
|
-
*/
|
|
2059
1232
|
GenericFunctionsUtils.prototype.pad = function (number) {
|
|
2060
1233
|
if (number < 10) {
|
|
2061
1234
|
return '0' + number;
|
|
@@ -2065,50 +1238,22 @@
|
|
|
2065
1238
|
}
|
|
2066
1239
|
return number;
|
|
2067
1240
|
};
|
|
2068
|
-
/**
|
|
2069
|
-
* @param {?} idField
|
|
2070
|
-
* @return {?}
|
|
2071
|
-
*/
|
|
2072
1241
|
GenericFunctionsUtils.prototype.focusInternalInput = function (idField) {
|
|
2073
|
-
/** @type {?} */
|
|
2074
1242
|
var fieldComponent = document.getElementById(idField);
|
|
2075
|
-
|
|
2076
|
-
var fieldInput = (( /** @type {?} */(( /** @type {?} */(fieldComponent.getElementsByClassName('po-input'))))))[0];
|
|
1243
|
+
var fieldInput = fieldComponent.getElementsByClassName('po-input')[0];
|
|
2077
1244
|
fieldInput.focus();
|
|
2078
1245
|
};
|
|
2079
1246
|
return GenericFunctionsUtils;
|
|
2080
|
-
}());
|
|
2081
|
-
if (false) {
|
|
2082
|
-
/** @type {?} */
|
|
2083
|
-
GenericFunctionsUtils.prototype.literals;
|
|
2084
|
-
}
|
|
1247
|
+
}());
|
|
2085
1248
|
|
|
2086
|
-
/**
|
|
2087
|
-
* @fileoverview added by tsickle
|
|
2088
|
-
* Generated from: lib/utils/file.util.ts
|
|
2089
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2090
|
-
*/
|
|
2091
1249
|
var FileUtil = /** @class */ (function () {
|
|
2092
1250
|
function FileUtil() {
|
|
2093
1251
|
}
|
|
2094
|
-
/**
|
|
2095
|
-
* @param {?} data
|
|
2096
|
-
* @param {?} fileName
|
|
2097
|
-
* @param {?=} contentType
|
|
2098
|
-
* @param {?=} base64
|
|
2099
|
-
* @return {?}
|
|
2100
|
-
*/
|
|
2101
1252
|
FileUtil.downloadFile = function (data, fileName, contentType, base64) {
|
|
2102
1253
|
base64 = (base64 === false) ? false : true;
|
|
2103
|
-
/** @type {?} */
|
|
2104
1254
|
var dataBlob = base64 ? this.b64toBlob(data, contentType) : data;
|
|
2105
1255
|
this.download(dataBlob, fileName);
|
|
2106
1256
|
};
|
|
2107
|
-
/**
|
|
2108
|
-
* @param {?} data
|
|
2109
|
-
* @param {?=} dwldDataParam
|
|
2110
|
-
* @return {?}
|
|
2111
|
-
*/
|
|
2112
1257
|
FileUtil.downloadData = function (data, dwldDataParam) {
|
|
2113
1258
|
if (dwldDataParam === void 0) { dwldDataParam = null; }
|
|
2114
1259
|
if (!data) {
|
|
@@ -2132,22 +1277,12 @@
|
|
|
2132
1277
|
if (!dwldDataParam.columnExclude) {
|
|
2133
1278
|
dwldDataParam.columnExclude = [];
|
|
2134
1279
|
}
|
|
2135
|
-
/** @type {?} */
|
|
2136
1280
|
var datab64 = btoa(this.jsonToString(data, dwldDataParam));
|
|
2137
1281
|
this.downloadFile(datab64, dwldDataParam.fileName, 'text/csv');
|
|
2138
1282
|
};
|
|
2139
|
-
/**
|
|
2140
|
-
* @private
|
|
2141
|
-
* @param {?} file
|
|
2142
|
-
* @param {?} fileName
|
|
2143
|
-
* @return {?}
|
|
2144
|
-
*/
|
|
2145
1283
|
FileUtil.download = function (file, fileName) {
|
|
2146
|
-
/** @type {?} */
|
|
2147
1284
|
var binaryData = [file];
|
|
2148
|
-
/** @type {?} */
|
|
2149
1285
|
var downloadLink = document.createElement('a');
|
|
2150
|
-
/** @type {?} */
|
|
2151
1286
|
var urlDownload = window.URL.createObjectURL(new Blob(binaryData, { type: file.type }));
|
|
2152
1287
|
/**Verifica se é ie ou edge, pois o mesmo tem tratamento próprio para arquivos blob */
|
|
2153
1288
|
if (navigator.userAgent.toUpperCase().indexOf('.NET') > 0 || navigator.userAgent.toUpperCase().indexOf('EDGE') > 0) {
|
|
@@ -2162,55 +1297,31 @@
|
|
|
2162
1297
|
downloadLink.remove();
|
|
2163
1298
|
}
|
|
2164
1299
|
};
|
|
2165
|
-
/**
|
|
2166
|
-
* @private
|
|
2167
|
-
* @param {?} b64Data
|
|
2168
|
-
* @param {?=} contentType
|
|
2169
|
-
* @param {?=} sliceSize
|
|
2170
|
-
* @return {?}
|
|
2171
|
-
*/
|
|
2172
1300
|
FileUtil.b64toBlob = function (b64Data, contentType, sliceSize) {
|
|
2173
1301
|
contentType = contentType || '';
|
|
2174
1302
|
sliceSize = sliceSize || 512;
|
|
2175
|
-
/** @type {?} */
|
|
2176
1303
|
var byteCharacters = atob(b64Data);
|
|
2177
|
-
/** @type {?} */
|
|
2178
1304
|
var byteArrays = [];
|
|
2179
1305
|
for (var offset = 0; offset < byteCharacters.length; offset += sliceSize) {
|
|
2180
|
-
/** @type {?} */
|
|
2181
1306
|
var slice = byteCharacters.slice(offset, offset + sliceSize);
|
|
2182
|
-
/** @type {?} */
|
|
2183
1307
|
var byteNumbers = new Array(slice.length);
|
|
2184
1308
|
for (var i = 0; i < slice.length; i++) {
|
|
2185
1309
|
byteNumbers[i] = slice.charCodeAt(i);
|
|
2186
1310
|
}
|
|
2187
|
-
/** @type {?} */
|
|
2188
1311
|
var byteArray = new Uint8Array(byteNumbers);
|
|
2189
1312
|
byteArrays.push(byteArray);
|
|
2190
1313
|
}
|
|
2191
|
-
/** @type {?} */
|
|
2192
1314
|
var blob = new Blob(byteArrays, { type: contentType });
|
|
2193
1315
|
return blob;
|
|
2194
1316
|
};
|
|
2195
|
-
/**
|
|
2196
|
-
* @private
|
|
2197
|
-
* @param {?} jsonData
|
|
2198
|
-
* @param {?} dwldDataParam
|
|
2199
|
-
* @return {?}
|
|
2200
|
-
*/
|
|
2201
1317
|
FileUtil.jsonToString = function (jsonData, dwldDataParam) {
|
|
2202
1318
|
if (!jsonData || jsonData.length === 0) {
|
|
2203
1319
|
return '';
|
|
2204
1320
|
}
|
|
2205
|
-
/** @type {?} */
|
|
2206
1321
|
var lineDelimiter = '\n';
|
|
2207
|
-
/** @type {?} */
|
|
2208
1322
|
var columnOrig = null;
|
|
2209
|
-
/** @type {?} */
|
|
2210
1323
|
var columnHeader = null;
|
|
2211
|
-
/** @type {?} */
|
|
2212
1324
|
var keys = [];
|
|
2213
|
-
/** @type {?} */
|
|
2214
1325
|
var includeKey;
|
|
2215
1326
|
if (dwldDataParam.columnList &&
|
|
2216
1327
|
dwldDataParam.columnList.length > 0) {
|
|
@@ -2219,13 +1330,7 @@
|
|
|
2219
1330
|
else {
|
|
2220
1331
|
columnOrig = Object.keys(jsonData[0]);
|
|
2221
1332
|
}
|
|
2222
|
-
columnOrig.forEach((
|
|
2223
|
-
* @param {?} key
|
|
2224
|
-
* @return {?}
|
|
2225
|
-
*/function (/**
|
|
2226
|
-
* @param {?} key
|
|
2227
|
-
* @return {?}
|
|
2228
|
-
*/ key) {
|
|
1333
|
+
columnOrig.forEach(function (key) {
|
|
2229
1334
|
includeKey = true;
|
|
2230
1335
|
if (dwldDataParam.columnExclude &&
|
|
2231
1336
|
dwldDataParam.columnExclude.length > 0 &&
|
|
@@ -2237,24 +1342,11 @@
|
|
|
2237
1342
|
columnHeader = (!columnHeader) ? '' : columnHeader + dwldDataParam.columnDelimiter;
|
|
2238
1343
|
columnHeader += (dwldDataParam.literals[key]) ? dwldDataParam.literals[key] : key;
|
|
2239
1344
|
}
|
|
2240
|
-
})
|
|
2241
|
-
|
|
2242
|
-
var lineStr = jsonData.reduce(( /**
|
|
2243
|
-
* @param {?} accLineStr
|
|
2244
|
-
* @param {?} currentItem
|
|
2245
|
-
* @return {?}
|
|
2246
|
-
*/function (accLineStr, currentItem) {
|
|
2247
|
-
/** @type {?} */
|
|
1345
|
+
});
|
|
1346
|
+
var lineStr = jsonData.reduce(function (accLineStr, currentItem) {
|
|
2248
1347
|
var first = true;
|
|
2249
|
-
/** @type {?} */
|
|
2250
1348
|
var columnValue = null;
|
|
2251
|
-
keys.forEach((
|
|
2252
|
-
* @param {?} key
|
|
2253
|
-
* @return {?}
|
|
2254
|
-
*/function (/**
|
|
2255
|
-
* @param {?} key
|
|
2256
|
-
* @return {?}
|
|
2257
|
-
*/ key) {
|
|
1349
|
+
keys.forEach(function (key) {
|
|
2258
1350
|
if (!first) {
|
|
2259
1351
|
accLineStr += dwldDataParam.columnDelimiter;
|
|
2260
1352
|
}
|
|
@@ -2275,197 +1367,36 @@
|
|
|
2275
1367
|
}
|
|
2276
1368
|
accLineStr += columnValue;
|
|
2277
1369
|
first = false;
|
|
2278
|
-
})
|
|
1370
|
+
});
|
|
2279
1371
|
return accLineStr + lineDelimiter;
|
|
2280
|
-
}
|
|
1372
|
+
}, columnHeader + lineDelimiter);
|
|
2281
1373
|
return lineStr;
|
|
2282
1374
|
};
|
|
2283
1375
|
return FileUtil;
|
|
2284
1376
|
}());
|
|
2285
|
-
/**
|
|
2286
|
-
* @record
|
|
2287
|
-
*/
|
|
2288
|
-
function IDownloadDataParams() { }
|
|
2289
|
-
if (false) {
|
|
2290
|
-
/** @type {?} */
|
|
2291
|
-
IDownloadDataParams.prototype.fileName;
|
|
2292
|
-
/** @type {?} */
|
|
2293
|
-
IDownloadDataParams.prototype.literals;
|
|
2294
|
-
/** @type {?} */
|
|
2295
|
-
IDownloadDataParams.prototype.columnDelimiter;
|
|
2296
|
-
/** @type {?} */
|
|
2297
|
-
IDownloadDataParams.prototype.columnList;
|
|
2298
|
-
/** @type {?} */
|
|
2299
|
-
IDownloadDataParams.prototype.columnExclude;
|
|
2300
|
-
}
|
|
2301
1377
|
var DownloadDataParams = /** @class */ (function () {
|
|
2302
1378
|
function DownloadDataParams() {
|
|
2303
1379
|
}
|
|
2304
1380
|
return DownloadDataParams;
|
|
2305
|
-
}());
|
|
2306
|
-
if (false) {
|
|
2307
|
-
/** @type {?} */
|
|
2308
|
-
DownloadDataParams.prototype.fileName;
|
|
2309
|
-
/** @type {?} */
|
|
2310
|
-
DownloadDataParams.prototype.literals;
|
|
2311
|
-
/** @type {?} */
|
|
2312
|
-
DownloadDataParams.prototype.columnDelimiter;
|
|
2313
|
-
/** @type {?} */
|
|
2314
|
-
DownloadDataParams.prototype.columnList;
|
|
2315
|
-
/** @type {?} */
|
|
2316
|
-
DownloadDataParams.prototype.columnExclude;
|
|
2317
|
-
}
|
|
1381
|
+
}());
|
|
2318
1382
|
|
|
2319
|
-
/**
|
|
2320
|
-
* @fileoverview added by tsickle
|
|
2321
|
-
* Generated from: lib/components/totvs-schedule-execution/totvs-schedule-execution.model.ts
|
|
2322
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2323
|
-
*/
|
|
2324
|
-
/**
|
|
2325
|
-
* @record
|
|
2326
|
-
*/
|
|
2327
|
-
function IScheduleParameters() { }
|
|
2328
|
-
if (false) {
|
|
2329
|
-
/** @type {?} */
|
|
2330
|
-
IScheduleParameters.prototype.executionType;
|
|
2331
|
-
/** @type {?} */
|
|
2332
|
-
IScheduleParameters.prototype.execAppointDate;
|
|
2333
|
-
/** @type {?} */
|
|
2334
|
-
IScheduleParameters.prototype.execAppointHour;
|
|
2335
|
-
/** @type {?} */
|
|
2336
|
-
IScheduleParameters.prototype.executionServer;
|
|
2337
|
-
/** @type {?} */
|
|
2338
|
-
IScheduleParameters.prototype.repeatExecution;
|
|
2339
|
-
/** @type {?} */
|
|
2340
|
-
IScheduleParameters.prototype.repeatType;
|
|
2341
|
-
/** @type {?} */
|
|
2342
|
-
IScheduleParameters.prototype.frequency;
|
|
2343
|
-
/** @type {?} */
|
|
2344
|
-
IScheduleParameters.prototype.frequencyValue;
|
|
2345
|
-
/** @type {?} */
|
|
2346
|
-
IScheduleParameters.prototype.frequencyType;
|
|
2347
|
-
/** @type {?} */
|
|
2348
|
-
IScheduleParameters.prototype.execAppointHourInit;
|
|
2349
|
-
/** @type {?} */
|
|
2350
|
-
IScheduleParameters.prototype.execAppointHourFinal;
|
|
2351
|
-
/** @type {?} */
|
|
2352
|
-
IScheduleParameters.prototype.selectWeeklys;
|
|
2353
|
-
/** @type {?} */
|
|
2354
|
-
IScheduleParameters.prototype.dayOfMonth;
|
|
2355
|
-
}
|
|
2356
1383
|
var ScheduleParameters = /** @class */ (function () {
|
|
2357
1384
|
function ScheduleParameters() {
|
|
2358
1385
|
}
|
|
2359
1386
|
return ScheduleParameters;
|
|
2360
1387
|
}());
|
|
2361
|
-
if (false) {
|
|
2362
|
-
/** @type {?} */
|
|
2363
|
-
ScheduleParameters.prototype.executionType;
|
|
2364
|
-
/** @type {?} */
|
|
2365
|
-
ScheduleParameters.prototype.execAppointDate;
|
|
2366
|
-
/** @type {?} */
|
|
2367
|
-
ScheduleParameters.prototype.execAppointHour;
|
|
2368
|
-
/** @type {?} */
|
|
2369
|
-
ScheduleParameters.prototype.executionServer;
|
|
2370
|
-
/** @type {?} */
|
|
2371
|
-
ScheduleParameters.prototype.repeatExecution;
|
|
2372
|
-
/** @type {?} */
|
|
2373
|
-
ScheduleParameters.prototype.repeatType;
|
|
2374
|
-
/** @type {?} */
|
|
2375
|
-
ScheduleParameters.prototype.frequency;
|
|
2376
|
-
/** @type {?} */
|
|
2377
|
-
ScheduleParameters.prototype.frequencyValue;
|
|
2378
|
-
/** @type {?} */
|
|
2379
|
-
ScheduleParameters.prototype.frequencyType;
|
|
2380
|
-
/** @type {?} */
|
|
2381
|
-
ScheduleParameters.prototype.execAppointHourInit;
|
|
2382
|
-
/** @type {?} */
|
|
2383
|
-
ScheduleParameters.prototype.execAppointHourFinal;
|
|
2384
|
-
/** @type {?} */
|
|
2385
|
-
ScheduleParameters.prototype.selectWeeklys;
|
|
2386
|
-
/** @type {?} */
|
|
2387
|
-
ScheduleParameters.prototype.dayOfMonth;
|
|
2388
|
-
}
|
|
2389
|
-
/**
|
|
2390
|
-
* @record
|
|
2391
|
-
*/
|
|
2392
|
-
function IExecutionStatus() { }
|
|
2393
|
-
if (false) {
|
|
2394
|
-
/** @type {?} */
|
|
2395
|
-
IExecutionStatus.prototype.jobScheduleID;
|
|
2396
|
-
/** @type {?} */
|
|
2397
|
-
IExecutionStatus.prototype.executionID;
|
|
2398
|
-
/** @type {?} */
|
|
2399
|
-
IExecutionStatus.prototype.startedDate;
|
|
2400
|
-
/** @type {?} */
|
|
2401
|
-
IExecutionStatus.prototype.error;
|
|
2402
|
-
/** @type {?} */
|
|
2403
|
-
IExecutionStatus.prototype.status;
|
|
2404
|
-
}
|
|
2405
1388
|
var ExecutionStatus = /** @class */ (function () {
|
|
2406
1389
|
function ExecutionStatus() {
|
|
2407
1390
|
}
|
|
2408
1391
|
return ExecutionStatus;
|
|
2409
1392
|
}());
|
|
2410
|
-
if (false) {
|
|
2411
|
-
/** @type {?} */
|
|
2412
|
-
ExecutionStatus.prototype.jobScheduleID;
|
|
2413
|
-
/** @type {?} */
|
|
2414
|
-
ExecutionStatus.prototype.executionID;
|
|
2415
|
-
/** @type {?} */
|
|
2416
|
-
ExecutionStatus.prototype.startedDate;
|
|
2417
|
-
/** @type {?} */
|
|
2418
|
-
ExecutionStatus.prototype.error;
|
|
2419
|
-
/** @type {?} */
|
|
2420
|
-
ExecutionStatus.prototype.status;
|
|
2421
|
-
}
|
|
2422
|
-
/**
|
|
2423
|
-
* @record
|
|
2424
|
-
*/
|
|
2425
|
-
function IExecutionParameters() { }
|
|
2426
|
-
if (false) {
|
|
2427
|
-
/** @type {?} */
|
|
2428
|
-
IExecutionParameters.prototype.executionServer;
|
|
2429
|
-
/** @type {?} */
|
|
2430
|
-
IExecutionParameters.prototype.programName;
|
|
2431
|
-
/** @type {?} */
|
|
2432
|
-
IExecutionParameters.prototype.externalName;
|
|
2433
|
-
/** @type {?} */
|
|
2434
|
-
IExecutionParameters.prototype.programEMS5;
|
|
2435
|
-
/** @type {?} */
|
|
2436
|
-
IExecutionParameters.prototype.programVersion;
|
|
2437
|
-
/** @type {?} */
|
|
2438
|
-
IExecutionParameters.prototype.businessParams;
|
|
2439
|
-
}
|
|
2440
1393
|
var ExecutionParameters = /** @class */ (function () {
|
|
2441
1394
|
function ExecutionParameters() {
|
|
2442
1395
|
}
|
|
2443
1396
|
return ExecutionParameters;
|
|
2444
|
-
}());
|
|
2445
|
-
if (false) {
|
|
2446
|
-
/** @type {?} */
|
|
2447
|
-
ExecutionParameters.prototype.executionServer;
|
|
2448
|
-
/** @type {?} */
|
|
2449
|
-
ExecutionParameters.prototype.programName;
|
|
2450
|
-
/** @type {?} */
|
|
2451
|
-
ExecutionParameters.prototype.externalName;
|
|
2452
|
-
/** @type {?} */
|
|
2453
|
-
ExecutionParameters.prototype.programEMS5;
|
|
2454
|
-
/** @type {?} */
|
|
2455
|
-
ExecutionParameters.prototype.programVersion;
|
|
2456
|
-
/** @type {?} */
|
|
2457
|
-
ExecutionParameters.prototype.businessParams;
|
|
2458
|
-
}
|
|
1397
|
+
}());
|
|
2459
1398
|
|
|
2460
|
-
/**
|
|
2461
|
-
* @fileoverview added by tsickle
|
|
2462
|
-
* Generated from: lib/components/totvs-schedule-execution/totvs-schedule-execution.service.ts
|
|
2463
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2464
|
-
*/
|
|
2465
1399
|
var TotvsScheduleExecutionService = /** @class */ (function () {
|
|
2466
|
-
/**
|
|
2467
|
-
* @param {?} http
|
|
2468
|
-
*/
|
|
2469
1400
|
function TotvsScheduleExecutionService(http) {
|
|
2470
1401
|
this.http = http;
|
|
2471
1402
|
this.headers = { headers: { 'X-PO-Screen-Lock': 'true' } };
|
|
@@ -2473,12 +1404,7 @@
|
|
|
2473
1404
|
this.urlJobScheduler = '/dts/datasul-rest/resources/prg/framework/v1/jobScheduler';
|
|
2474
1405
|
this.urlJobExecution = '/dts/datasul-rest/resources/prg/framework/v1/jobExecution';
|
|
2475
1406
|
}
|
|
2476
|
-
/**
|
|
2477
|
-
* @param {?} params
|
|
2478
|
-
* @return {?}
|
|
2479
|
-
*/
|
|
2480
1407
|
TotvsScheduleExecutionService.prototype.getFilteredItems = function (params) {
|
|
2481
|
-
/** @type {?} */
|
|
2482
1408
|
var urlParams = new Array();
|
|
2483
1409
|
urlParams.push("pageSize=" + params.pageSize.toString());
|
|
2484
1410
|
urlParams.push("page=" + params.page.toString());
|
|
@@ -2487,20 +1413,10 @@
|
|
|
2487
1413
|
}
|
|
2488
1414
|
return this.http.get(this.urlCadServidor + "?" + urlParams.join('&'));
|
|
2489
1415
|
};
|
|
2490
|
-
/**
|
|
2491
|
-
* @param {?} id
|
|
2492
|
-
* @return {?}
|
|
2493
|
-
*/
|
|
2494
1416
|
TotvsScheduleExecutionService.prototype.getObjectByValue = function (id) {
|
|
2495
1417
|
return this.http.get(this.urlCadServidor + "/" + id, this.headers);
|
|
2496
1418
|
};
|
|
2497
|
-
/**
|
|
2498
|
-
* @param {?} parameters
|
|
2499
|
-
* @param {?} loading
|
|
2500
|
-
* @return {?}
|
|
2501
|
-
*/
|
|
2502
1419
|
TotvsScheduleExecutionService.prototype.createExecution = function (parameters, loading) {
|
|
2503
|
-
/** @type {?} */
|
|
2504
1420
|
var params = JSON.parse(JSON.stringify(parameters).replace(/\\\\/g, '*|'));
|
|
2505
1421
|
if (loading) {
|
|
2506
1422
|
return this.http.post("" + this.urlJobScheduler, params, this.headers);
|
|
@@ -2509,17 +1425,9 @@
|
|
|
2509
1425
|
return this.http.post("" + this.urlJobScheduler, params);
|
|
2510
1426
|
}
|
|
2511
1427
|
};
|
|
2512
|
-
/**
|
|
2513
|
-
* @param {?} executionParams
|
|
2514
|
-
* @param {?} loading
|
|
2515
|
-
* @return {?}
|
|
2516
|
-
*/
|
|
2517
1428
|
TotvsScheduleExecutionService.prototype.createExecutionForNow = function (executionParams, loading) {
|
|
2518
|
-
/** @type {?} */
|
|
2519
1429
|
var jobScheduleParams;
|
|
2520
|
-
/** @type {?} */
|
|
2521
1430
|
var date = new Date();
|
|
2522
|
-
/** @type {?} */
|
|
2523
1431
|
var params = JSON.parse(JSON.stringify(executionParams).replace(/\\\\/g, '*|'));
|
|
2524
1432
|
if (!params.businessParams || params.businessParams.length === 0) {
|
|
2525
1433
|
params.businessParams = [{ chave: '', valor: '' }];
|
|
@@ -2545,42 +1453,18 @@
|
|
|
2545
1453
|
return this.http.post("" + this.urlJobScheduler, jobScheduleParams);
|
|
2546
1454
|
}
|
|
2547
1455
|
};
|
|
2548
|
-
/**
|
|
2549
|
-
* @param {?} jobScheduleID
|
|
2550
|
-
* @param {?=} loading
|
|
2551
|
-
* @return {?}
|
|
2552
|
-
*/
|
|
2553
1456
|
TotvsScheduleExecutionService.prototype.getExecutionByJobScheduleID = function (jobScheduleID, loading) {
|
|
2554
1457
|
var _this = this;
|
|
2555
1458
|
if (loading === void 0) { loading = false; }
|
|
2556
|
-
/** @type {?} */
|
|
2557
1459
|
var url = this.urlJobExecution + "?jobScheduleID=" + jobScheduleID;
|
|
2558
|
-
return this.getExecution(url, loading).pipe(operators.map((
|
|
2559
|
-
* @param {?} response
|
|
2560
|
-
* @return {?}
|
|
2561
|
-
*/function (response) { return _this.transformExecution('jobScheduleID', response); })));
|
|
1460
|
+
return this.getExecution(url, loading).pipe(operators.map(function (response) { return _this.transformExecution('jobScheduleID', response); }));
|
|
2562
1461
|
};
|
|
2563
|
-
/**
|
|
2564
|
-
* @param {?} executionID
|
|
2565
|
-
* @param {?=} loading
|
|
2566
|
-
* @return {?}
|
|
2567
|
-
*/
|
|
2568
1462
|
TotvsScheduleExecutionService.prototype.getExecutionByExecutionID = function (executionID, loading) {
|
|
2569
1463
|
var _this = this;
|
|
2570
1464
|
if (loading === void 0) { loading = false; }
|
|
2571
|
-
/** @type {?} */
|
|
2572
1465
|
var url = this.urlJobExecution + "/" + executionID;
|
|
2573
|
-
return this.getExecution(url, loading).pipe(operators.map((
|
|
2574
|
-
* @param {?} response
|
|
2575
|
-
* @return {?}
|
|
2576
|
-
*/function (response) { return _this.transformExecution('executionID', response); })));
|
|
1466
|
+
return this.getExecution(url, loading).pipe(operators.map(function (response) { return _this.transformExecution('executionID', response); }));
|
|
2577
1467
|
};
|
|
2578
|
-
/**
|
|
2579
|
-
* @private
|
|
2580
|
-
* @param {?} url
|
|
2581
|
-
* @param {?} loading
|
|
2582
|
-
* @return {?}
|
|
2583
|
-
*/
|
|
2584
1468
|
TotvsScheduleExecutionService.prototype.getExecution = function (url, loading) {
|
|
2585
1469
|
if (loading) {
|
|
2586
1470
|
return this.http.get(url, this.headers);
|
|
@@ -2589,18 +1473,11 @@
|
|
|
2589
1473
|
return this.http.get(url);
|
|
2590
1474
|
}
|
|
2591
1475
|
};
|
|
2592
|
-
/**
|
|
2593
|
-
* @private
|
|
2594
|
-
* @param {?} type
|
|
2595
|
-
* @param {?} response
|
|
2596
|
-
* @return {?}
|
|
2597
|
-
*/
|
|
2598
1476
|
TotvsScheduleExecutionService.prototype.transformExecution = function (type, response) {
|
|
2599
1477
|
if (!response || !response.items || response.items.length === 0) {
|
|
2600
1478
|
return;
|
|
2601
1479
|
}
|
|
2602
1480
|
response = response.items[0];
|
|
2603
|
-
/** @type {?} */
|
|
2604
1481
|
var execStatus = new ExecutionStatus();
|
|
2605
1482
|
execStatus.jobScheduleID = response.jobScheduleID;
|
|
2606
1483
|
execStatus.executionID = response.executionID;
|
|
@@ -2609,45 +1486,18 @@
|
|
|
2609
1486
|
execStatus.status = response.status;
|
|
2610
1487
|
return execStatus;
|
|
2611
1488
|
};
|
|
2612
|
-
/**
|
|
2613
|
-
* @param {?} jobScheduleID
|
|
2614
|
-
* @param {?} intervalNum
|
|
2615
|
-
* @param {?} fncCallBack
|
|
2616
|
-
* @param {?=} loading
|
|
2617
|
-
* @return {?}
|
|
2618
|
-
*/
|
|
2619
1489
|
TotvsScheduleExecutionService.prototype.followUpExcByJobScheduleID = function (jobScheduleID, intervalNum, fncCallBack, loading) {
|
|
2620
1490
|
if (loading === void 0) { loading = false; }
|
|
2621
1491
|
this.followUpExecution('jobScheduleID', jobScheduleID, intervalNum, fncCallBack, loading);
|
|
2622
1492
|
};
|
|
2623
|
-
/**
|
|
2624
|
-
* @param {?} executionID
|
|
2625
|
-
* @param {?} intervalNum
|
|
2626
|
-
* @param {?} fncCallBack
|
|
2627
|
-
* @param {?=} loading
|
|
2628
|
-
* @return {?}
|
|
2629
|
-
*/
|
|
2630
1493
|
TotvsScheduleExecutionService.prototype.followUpExcByExecutionID = function (executionID, intervalNum, fncCallBack, loading) {
|
|
2631
1494
|
if (loading === void 0) { loading = false; }
|
|
2632
1495
|
this.followUpExecution('executionID', executionID, intervalNum, fncCallBack, loading);
|
|
2633
1496
|
};
|
|
2634
|
-
/**
|
|
2635
|
-
* @private
|
|
2636
|
-
* @param {?} type
|
|
2637
|
-
* @param {?} execID
|
|
2638
|
-
* @param {?} intervalNum
|
|
2639
|
-
* @param {?} fncCallBack
|
|
2640
|
-
* @param {?} loading
|
|
2641
|
-
* @return {?}
|
|
2642
|
-
*/
|
|
2643
1497
|
TotvsScheduleExecutionService.prototype.followUpExecution = function (type, execID, intervalNum, fncCallBack, loading) {
|
|
2644
1498
|
var _this = this;
|
|
2645
1499
|
this.jobExecutionSubscription$ = null;
|
|
2646
|
-
|
|
2647
|
-
var intervalID = setInterval(( /**
|
|
2648
|
-
* @return {?}
|
|
2649
|
-
*/function () {
|
|
2650
|
-
/** @type {?} */
|
|
1500
|
+
var intervalID = setInterval(function () {
|
|
2651
1501
|
var execStatus = new ExecutionStatus();
|
|
2652
1502
|
execStatus.jobScheduleID = (type === 'jobScheduleID') ? execID : '';
|
|
2653
1503
|
execStatus.executionID = (type === 'executionID') ? execID : '';
|
|
@@ -2659,43 +1509,22 @@
|
|
|
2659
1509
|
}
|
|
2660
1510
|
if (type === 'jobScheduleID') {
|
|
2661
1511
|
_this.jobExecutionSubscription$ = _this.getExecutionByJobScheduleID(execID, loading)
|
|
2662
|
-
.subscribe((
|
|
2663
|
-
* @param {?} response
|
|
2664
|
-
* @return {?}
|
|
2665
|
-
*/function (response) {
|
|
1512
|
+
.subscribe(function (response) {
|
|
2666
1513
|
_this.followUpExecReturnOk(execID, execStatus, response, intervalID, fncCallBack);
|
|
2667
|
-
}
|
|
2668
|
-
* @param {?} error
|
|
2669
|
-
* @return {?}
|
|
2670
|
-
*/function (error) {
|
|
1514
|
+
}, function (error) {
|
|
2671
1515
|
_this.followUpExecReturnError(error, execStatus, intervalID, fncCallBack);
|
|
2672
|
-
})
|
|
1516
|
+
});
|
|
2673
1517
|
}
|
|
2674
1518
|
if (type === 'executionID') {
|
|
2675
1519
|
_this.jobExecutionSubscription$ = _this.getExecutionByExecutionID(execID, loading)
|
|
2676
|
-
.subscribe((
|
|
2677
|
-
* @param {?} response
|
|
2678
|
-
* @return {?}
|
|
2679
|
-
*/function (response) {
|
|
1520
|
+
.subscribe(function (response) {
|
|
2680
1521
|
_this.followUpExecReturnOk(execID, execStatus, response, intervalID, fncCallBack);
|
|
2681
|
-
}
|
|
2682
|
-
* @param {?} error
|
|
2683
|
-
* @return {?}
|
|
2684
|
-
*/function (error) {
|
|
1522
|
+
}, function (error) {
|
|
2685
1523
|
_this.followUpExecReturnError(error, execStatus, intervalID, fncCallBack);
|
|
2686
|
-
})
|
|
1524
|
+
});
|
|
2687
1525
|
}
|
|
2688
|
-
}
|
|
1526
|
+
}, intervalNum);
|
|
2689
1527
|
};
|
|
2690
|
-
/**
|
|
2691
|
-
* @private
|
|
2692
|
-
* @param {?} execID
|
|
2693
|
-
* @param {?} execStatus
|
|
2694
|
-
* @param {?} response
|
|
2695
|
-
* @param {?} intervalID
|
|
2696
|
-
* @param {?} fncCallBack
|
|
2697
|
-
* @return {?}
|
|
2698
|
-
*/
|
|
2699
1528
|
TotvsScheduleExecutionService.prototype.followUpExecReturnOk = function (execID, execStatus, response, intervalID, fncCallBack) {
|
|
2700
1529
|
if (response) {
|
|
2701
1530
|
execStatus = response;
|
|
@@ -2711,16 +1540,7 @@
|
|
|
2711
1540
|
}
|
|
2712
1541
|
this.jobExecutionSubscription$ = null;
|
|
2713
1542
|
};
|
|
2714
|
-
/**
|
|
2715
|
-
* @private
|
|
2716
|
-
* @param {?} error
|
|
2717
|
-
* @param {?} execStatus
|
|
2718
|
-
* @param {?} intervalID
|
|
2719
|
-
* @param {?} fncCallBack
|
|
2720
|
-
* @return {?}
|
|
2721
|
-
*/
|
|
2722
1543
|
TotvsScheduleExecutionService.prototype.followUpExecReturnError = function (error, execStatus, intervalID, fncCallBack) {
|
|
2723
|
-
/** @type {?} */
|
|
2724
1544
|
var erroDesc = '';
|
|
2725
1545
|
if (error instanceof i1.HttpErrorResponse) {
|
|
2726
1546
|
erroDesc = error.message;
|
|
@@ -2746,13 +1566,7 @@
|
|
|
2746
1566
|
clearInterval(intervalID);
|
|
2747
1567
|
this.jobExecutionSubscription$ = null;
|
|
2748
1568
|
};
|
|
2749
|
-
/**
|
|
2750
|
-
* @private
|
|
2751
|
-
* @param {?} num
|
|
2752
|
-
* @return {?}
|
|
2753
|
-
*/
|
|
2754
1569
|
TotvsScheduleExecutionService.prototype.addZero = function (num) {
|
|
2755
|
-
/** @type {?} */
|
|
2756
1570
|
var str = "" + num;
|
|
2757
1571
|
if (num < 10) {
|
|
2758
1572
|
str = "0" + num;
|
|
@@ -2767,48 +1581,9 @@
|
|
|
2767
1581
|
/** @nocollapse */
|
|
2768
1582
|
TotvsScheduleExecutionService.ctorParameters = function () { return [
|
|
2769
1583
|
{ type: i1.HttpClient }
|
|
2770
|
-
]; };
|
|
2771
|
-
if (false) {
|
|
2772
|
-
/**
|
|
2773
|
-
* @type {?}
|
|
2774
|
-
* @private
|
|
2775
|
-
*/
|
|
2776
|
-
TotvsScheduleExecutionService.prototype.headers;
|
|
2777
|
-
/**
|
|
2778
|
-
* @type {?}
|
|
2779
|
-
* @private
|
|
2780
|
-
*/
|
|
2781
|
-
TotvsScheduleExecutionService.prototype.urlCadServidor;
|
|
2782
|
-
/**
|
|
2783
|
-
* @type {?}
|
|
2784
|
-
* @private
|
|
2785
|
-
*/
|
|
2786
|
-
TotvsScheduleExecutionService.prototype.urlJobScheduler;
|
|
2787
|
-
/**
|
|
2788
|
-
* @type {?}
|
|
2789
|
-
* @private
|
|
2790
|
-
*/
|
|
2791
|
-
TotvsScheduleExecutionService.prototype.urlJobExecution;
|
|
2792
|
-
/**
|
|
2793
|
-
* @type {?}
|
|
2794
|
-
* @private
|
|
2795
|
-
*/
|
|
2796
|
-
TotvsScheduleExecutionService.prototype.jobExecutionSubscription$;
|
|
2797
|
-
/** @type {?} */
|
|
2798
|
-
TotvsScheduleExecutionService.prototype.http;
|
|
2799
|
-
}
|
|
1584
|
+
]; };
|
|
2800
1585
|
|
|
2801
|
-
/**
|
|
2802
|
-
* @fileoverview added by tsickle
|
|
2803
|
-
* Generated from: lib/components/totvs-schedule-execution/totvs-schedule-execution.component.ts
|
|
2804
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2805
|
-
*/
|
|
2806
1586
|
var TotvsScheduleExecutionComponent = /** @class */ (function () {
|
|
2807
|
-
/**
|
|
2808
|
-
* @param {?} poI18nService
|
|
2809
|
-
* @param {?} rpwService
|
|
2810
|
-
* @param {?} poNotification
|
|
2811
|
-
*/
|
|
2812
1587
|
function TotvsScheduleExecutionComponent(poI18nService, rpwService, poNotification) {
|
|
2813
1588
|
this.poI18nService = poI18nService;
|
|
2814
1589
|
this.rpwService = rpwService;
|
|
@@ -2821,9 +1596,6 @@
|
|
|
2821
1596
|
this.jsonObject = {};
|
|
2822
1597
|
this.literals = {};
|
|
2823
1598
|
}
|
|
2824
|
-
/**
|
|
2825
|
-
* @return {?}
|
|
2826
|
-
*/
|
|
2827
1599
|
TotvsScheduleExecutionComponent.prototype.ngOnInit = function () {
|
|
2828
1600
|
/* VERIFICAR COMO FICARÁ A TRADUÇÃO
|
|
2829
1601
|
forkJoin(
|
|
@@ -2835,9 +1607,6 @@
|
|
|
2835
1607
|
});*/
|
|
2836
1608
|
this.setupComponents();
|
|
2837
1609
|
};
|
|
2838
|
-
/**
|
|
2839
|
-
* @return {?}
|
|
2840
|
-
*/
|
|
2841
1610
|
TotvsScheduleExecutionComponent.prototype.setupComponents = function () {
|
|
2842
1611
|
this.executionTypeOptions = [
|
|
2843
1612
|
{ label: 'Executar Hoje', value: 1 },
|
|
@@ -2869,46 +1638,25 @@
|
|
|
2869
1638
|
this.model.repeatType = 1;
|
|
2870
1639
|
this.model.repeatExecution = false;
|
|
2871
1640
|
};
|
|
2872
|
-
/**
|
|
2873
|
-
* @param {?} schParam
|
|
2874
|
-
* @return {?}
|
|
2875
|
-
*/
|
|
2876
1641
|
TotvsScheduleExecutionComponent.prototype.setScheduleParameters = function (schParam) {
|
|
2877
1642
|
if (!schParam) {
|
|
2878
1643
|
return;
|
|
2879
1644
|
}
|
|
2880
1645
|
this.model = schParam;
|
|
2881
1646
|
};
|
|
2882
|
-
/**
|
|
2883
|
-
* @param {?} value
|
|
2884
|
-
* @return {?}
|
|
2885
|
-
*/
|
|
2886
1647
|
TotvsScheduleExecutionComponent.prototype.fieldRpwServiceFormat = function (value) {
|
|
2887
1648
|
return value.code + " - " + value.name;
|
|
2888
1649
|
};
|
|
2889
|
-
/**
|
|
2890
|
-
* @return {?}
|
|
2891
|
-
*/
|
|
2892
1650
|
TotvsScheduleExecutionComponent.prototype.isExecutionSchedule = function () {
|
|
2893
1651
|
return (this.model.executionType === 2);
|
|
2894
1652
|
};
|
|
2895
|
-
/**
|
|
2896
|
-
* @return {?}
|
|
2897
|
-
*/
|
|
2898
1653
|
TotvsScheduleExecutionComponent.prototype.isRepeatExecution = function () {
|
|
2899
1654
|
return this.model.repeatExecution;
|
|
2900
1655
|
};
|
|
2901
|
-
/**
|
|
2902
|
-
* @return {?}
|
|
2903
|
-
*/
|
|
2904
1656
|
TotvsScheduleExecutionComponent.prototype.isFrenquency = function () {
|
|
2905
1657
|
return (this.model.frequency === 'yes');
|
|
2906
1658
|
};
|
|
2907
|
-
/**
|
|
2908
|
-
* @return {?}
|
|
2909
|
-
*/
|
|
2910
1659
|
TotvsScheduleExecutionComponent.prototype.changeRepeatExecution = function () {
|
|
2911
|
-
/** @type {?} */
|
|
2912
1660
|
var date = new Date();
|
|
2913
1661
|
if (!this.model.execAppointHourInit) {
|
|
2914
1662
|
this.model.execAppointHourInit = this.addZero(date.getHours()) + ":" + this.addZero(date.getMinutes());
|
|
@@ -2922,49 +1670,26 @@
|
|
|
2922
1670
|
this.model.frequencyType = 'hour';
|
|
2923
1671
|
this.model.frequencyValue = 0;
|
|
2924
1672
|
};
|
|
2925
|
-
/**
|
|
2926
|
-
* @return {?}
|
|
2927
|
-
*/
|
|
2928
1673
|
TotvsScheduleExecutionComponent.prototype.changeExecutionType = function () {
|
|
2929
|
-
/** @type {?} */
|
|
2930
1674
|
var date = new Date();
|
|
2931
1675
|
this.model.execAppointDate = date;
|
|
2932
1676
|
this.model.execAppointHour = this.addZero(date.getHours()) + ":" + this.addZero(date.getMinutes());
|
|
2933
1677
|
};
|
|
2934
|
-
/**
|
|
2935
|
-
* @return {?}
|
|
2936
|
-
*/
|
|
2937
1678
|
TotvsScheduleExecutionComponent.prototype.changeTypeFrequency = function () {
|
|
2938
1679
|
};
|
|
2939
|
-
/**
|
|
2940
|
-
* @param {?} codTab
|
|
2941
|
-
* @return {?}
|
|
2942
|
-
*/
|
|
2943
1680
|
TotvsScheduleExecutionComponent.prototype.getActiveTab = function (codTab) {
|
|
2944
1681
|
return (this.model.repeatType === codTab);
|
|
2945
1682
|
};
|
|
2946
|
-
/**
|
|
2947
|
-
* @param {?} codTab
|
|
2948
|
-
* @return {?}
|
|
2949
|
-
*/
|
|
2950
1683
|
TotvsScheduleExecutionComponent.prototype.setActiveTab = function (codTab) {
|
|
2951
1684
|
this.model.repeatType = codTab;
|
|
2952
1685
|
};
|
|
2953
|
-
/**
|
|
2954
|
-
* @param {?} num
|
|
2955
|
-
* @return {?}
|
|
2956
|
-
*/
|
|
2957
1686
|
TotvsScheduleExecutionComponent.prototype.addZero = function (num) {
|
|
2958
|
-
/** @type {?} */
|
|
2959
1687
|
var str = "" + num;
|
|
2960
1688
|
if (num < 10) {
|
|
2961
1689
|
str = "0" + num;
|
|
2962
1690
|
}
|
|
2963
1691
|
return str;
|
|
2964
1692
|
};
|
|
2965
|
-
/**
|
|
2966
|
-
* @return {?}
|
|
2967
|
-
*/
|
|
2968
1693
|
TotvsScheduleExecutionComponent.prototype.executeSchedule = function () {
|
|
2969
1694
|
var _this = this;
|
|
2970
1695
|
if (this.disabledParams) {
|
|
@@ -2979,7 +1704,6 @@
|
|
|
2979
1704
|
this.jsonObject.recurrent = this.model.repeatExecution;
|
|
2980
1705
|
this.jsonObject.executionParameter = {};
|
|
2981
1706
|
if (this.model.executionType === 1) {
|
|
2982
|
-
/** @type {?} */
|
|
2983
1707
|
var date = new Date();
|
|
2984
1708
|
this.jsonObject.firstExecution = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + "T" + this.addZero(date.getHours()) + ":" + this.addZero(date.getMinutes()) + ":00.000Z";
|
|
2985
1709
|
}
|
|
@@ -2994,11 +1718,9 @@
|
|
|
2994
1718
|
this.jsonObject.executionParameter.parametros[4] = {};
|
|
2995
1719
|
this.jsonObject.executionParameter.parametros[4].parametros_negocio = this.parameters;
|
|
2996
1720
|
// Executa hoje ou agendada
|
|
2997
|
-
this.rpwService.createExecution(this.jsonObject, this.loading).subscribe((
|
|
2998
|
-
* @return {?}
|
|
2999
|
-
*/function () {
|
|
1721
|
+
this.rpwService.createExecution(this.jsonObject, this.loading).subscribe(function () {
|
|
3000
1722
|
_this.poNotification.success('Agendamento realizado com sucesso !');
|
|
3001
|
-
})
|
|
1723
|
+
});
|
|
3002
1724
|
if (this.model.repeatExecution) {
|
|
3003
1725
|
if (this.model.repeatType === 1) {
|
|
3004
1726
|
this.jsonObject.daily = {
|
|
@@ -3033,18 +1755,11 @@
|
|
|
3033
1755
|
};
|
|
3034
1756
|
}
|
|
3035
1757
|
// Executa a diária, semanal ou mensal
|
|
3036
|
-
this.rpwService.createExecution(this.jsonObject, this.loading).subscribe((
|
|
3037
|
-
|
|
3038
|
-
*/function () {
|
|
3039
|
-
}));
|
|
1758
|
+
this.rpwService.createExecution(this.jsonObject, this.loading).subscribe(function () {
|
|
1759
|
+
});
|
|
3040
1760
|
}
|
|
3041
1761
|
this.endExecution.emit(this.model);
|
|
3042
1762
|
};
|
|
3043
|
-
/**
|
|
3044
|
-
* @param {?} value
|
|
3045
|
-
* @param {?} type
|
|
3046
|
-
* @return {?}
|
|
3047
|
-
*/
|
|
3048
1763
|
TotvsScheduleExecutionComponent.prototype.getHourOrMinute = function (value, type) {
|
|
3049
1764
|
if (type === 'h') {
|
|
3050
1765
|
return +value.substring(0, 2);
|
|
@@ -3053,11 +1768,6 @@
|
|
|
3053
1768
|
return +value.substring(3, 6);
|
|
3054
1769
|
}
|
|
3055
1770
|
};
|
|
3056
|
-
/**
|
|
3057
|
-
* @param {?} hourInit
|
|
3058
|
-
* @param {?} hourFinal
|
|
3059
|
-
* @return {?}
|
|
3060
|
-
*/
|
|
3061
1771
|
TotvsScheduleExecutionComponent.prototype.compareHour = function (hourInit, hourFinal) {
|
|
3062
1772
|
if (hourInit === hourFinal) {
|
|
3063
1773
|
return false;
|
|
@@ -3070,9 +1780,6 @@
|
|
|
3070
1780
|
}
|
|
3071
1781
|
return true;
|
|
3072
1782
|
};
|
|
3073
|
-
/**
|
|
3074
|
-
* @return {?}
|
|
3075
|
-
*/
|
|
3076
1783
|
TotvsScheduleExecutionComponent.prototype.validate = function () {
|
|
3077
1784
|
if (!this.scheduleExecutionForm.valid) {
|
|
3078
1785
|
this.poNotification.error('Verifique as inconsistências em tela.');
|
|
@@ -3119,7 +1826,7 @@
|
|
|
3119
1826
|
selector: 'app-totvs-schedule-execution',
|
|
3120
1827
|
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",
|
|
3121
1828
|
styles: [""]
|
|
3122
|
-
}] }
|
|
1829
|
+
},] }
|
|
3123
1830
|
];
|
|
3124
1831
|
/** @nocollapse */
|
|
3125
1832
|
TotvsScheduleExecutionComponent.ctorParameters = function () { return [
|
|
@@ -3137,70 +1844,14 @@
|
|
|
3137
1844
|
disabledParams: [{ type: i0.Input }],
|
|
3138
1845
|
loading: [{ type: i0.Input }],
|
|
3139
1846
|
endExecution: [{ type: i0.Output }]
|
|
3140
|
-
};
|
|
3141
|
-
if (false) {
|
|
3142
|
-
/** @type {?} */
|
|
3143
|
-
TotvsScheduleExecutionComponent.prototype.scheduleExecutionForm;
|
|
3144
|
-
/** @type {?} */
|
|
3145
|
-
TotvsScheduleExecutionComponent.prototype.programName;
|
|
3146
|
-
/** @type {?} */
|
|
3147
|
-
TotvsScheduleExecutionComponent.prototype.externalName;
|
|
3148
|
-
/** @type {?} */
|
|
3149
|
-
TotvsScheduleExecutionComponent.prototype.programEMS5;
|
|
3150
|
-
/** @type {?} */
|
|
3151
|
-
TotvsScheduleExecutionComponent.prototype.programVersion;
|
|
3152
|
-
/** @type {?} */
|
|
3153
|
-
TotvsScheduleExecutionComponent.prototype.parameters;
|
|
3154
|
-
/** @type {?} */
|
|
3155
|
-
TotvsScheduleExecutionComponent.prototype.disabledParams;
|
|
3156
|
-
/** @type {?} */
|
|
3157
|
-
TotvsScheduleExecutionComponent.prototype.loading;
|
|
3158
|
-
/** @type {?} */
|
|
3159
|
-
TotvsScheduleExecutionComponent.prototype.endExecution;
|
|
3160
|
-
/** @type {?} */
|
|
3161
|
-
TotvsScheduleExecutionComponent.prototype.executionTypeOptions;
|
|
3162
|
-
/** @type {?} */
|
|
3163
|
-
TotvsScheduleExecutionComponent.prototype.frequencyOptions;
|
|
3164
|
-
/** @type {?} */
|
|
3165
|
-
TotvsScheduleExecutionComponent.prototype.frequencyTypeOptions;
|
|
3166
|
-
/** @type {?} */
|
|
3167
|
-
TotvsScheduleExecutionComponent.prototype.weeklyOptions;
|
|
3168
|
-
/** @type {?} */
|
|
3169
|
-
TotvsScheduleExecutionComponent.prototype.zoomRpwServiceColumns;
|
|
3170
|
-
/** @type {?} */
|
|
3171
|
-
TotvsScheduleExecutionComponent.prototype.model;
|
|
3172
|
-
/**
|
|
3173
|
-
* @type {?}
|
|
3174
|
-
* @private
|
|
3175
|
-
*/
|
|
3176
|
-
TotvsScheduleExecutionComponent.prototype.jsonObject;
|
|
3177
|
-
/** @type {?} */
|
|
3178
|
-
TotvsScheduleExecutionComponent.prototype.literals;
|
|
3179
|
-
/** @type {?} */
|
|
3180
|
-
TotvsScheduleExecutionComponent.prototype.poI18nService;
|
|
3181
|
-
/** @type {?} */
|
|
3182
|
-
TotvsScheduleExecutionComponent.prototype.rpwService;
|
|
3183
|
-
/** @type {?} */
|
|
3184
|
-
TotvsScheduleExecutionComponent.prototype.poNotification;
|
|
3185
|
-
}
|
|
1847
|
+
};
|
|
3186
1848
|
|
|
3187
|
-
/**
|
|
3188
|
-
* @fileoverview added by tsickle
|
|
3189
|
-
* Generated from: lib/pipes/dts-date-format.pipe.ts
|
|
3190
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3191
|
-
*/
|
|
3192
1849
|
var DtsDateFormatPipe = /** @class */ (function () {
|
|
3193
1850
|
function DtsDateFormatPipe() {
|
|
3194
1851
|
}
|
|
3195
|
-
/**
|
|
3196
|
-
* @param {?} value
|
|
3197
|
-
* @param {?=} format
|
|
3198
|
-
* @return {?}
|
|
3199
|
-
*/
|
|
3200
1852
|
DtsDateFormatPipe.prototype.transform = function (value, format) {
|
|
3201
1853
|
if (format === void 0) { format = 'dd/MM/yyyy'; }
|
|
3202
1854
|
var _a = value.split('-'), year = _a[0], month = _a[1], day = _a[2];
|
|
3203
|
-
/** @type {?} */
|
|
3204
1855
|
var formattedDate = format.replace('dd', day)
|
|
3205
1856
|
.replace('MM', month)
|
|
3206
1857
|
.replace('yyyy', year);
|
|
@@ -3214,17 +1865,9 @@
|
|
|
3214
1865
|
},] }
|
|
3215
1866
|
];
|
|
3216
1867
|
|
|
3217
|
-
/**
|
|
3218
|
-
* @fileoverview added by tsickle
|
|
3219
|
-
* Generated from: lib/dts-backoffice-util.module.ts
|
|
3220
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3221
|
-
*/
|
|
3222
1868
|
var DtsBackofficeUtilsModule = /** @class */ (function () {
|
|
3223
1869
|
function DtsBackofficeUtilsModule() {
|
|
3224
1870
|
}
|
|
3225
|
-
/**
|
|
3226
|
-
* @return {?}
|
|
3227
|
-
*/
|
|
3228
1871
|
DtsBackofficeUtilsModule.forRoot = function () {
|
|
3229
1872
|
return {
|
|
3230
1873
|
ngModule: DtsBackofficeUtilsModule,
|
|
@@ -3255,16 +1898,13 @@
|
|
|
3255
1898
|
},] }
|
|
3256
1899
|
];
|
|
3257
1900
|
|
|
3258
|
-
|
|
3259
|
-
*
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
*/
|
|
1901
|
+
/*
|
|
1902
|
+
* Public API Surface of dts-backoffice-util
|
|
1903
|
+
*/
|
|
1904
|
+
// Pipes
|
|
3263
1905
|
|
|
3264
1906
|
/**
|
|
3265
|
-
*
|
|
3266
|
-
* Generated from: dts-backoffice-util.ts
|
|
3267
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1907
|
+
* Generated bundle index. Do not edit.
|
|
3268
1908
|
*/
|
|
3269
1909
|
|
|
3270
1910
|
exports.BreadcrumbControlService = BreadcrumbControlService;
|
|
@@ -3282,7 +1922,6 @@
|
|
|
3282
1922
|
exports.GenericFunctionsUtils = GenericFunctionsUtils;
|
|
3283
1923
|
exports.MenuDatasulService = MenuDatasulService;
|
|
3284
1924
|
exports.ProfileService = ProfileService;
|
|
3285
|
-
exports.ReportFormats = ReportFormats;
|
|
3286
1925
|
exports.ReportService = ReportService;
|
|
3287
1926
|
exports.ScheduleParameters = ScheduleParameters;
|
|
3288
1927
|
exports.TotvsScheduleExecutionComponent = TotvsScheduleExecutionComponent;
|