@fluxhub/fluxhub-lib 1.0.234 → 1.0.236

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.
@@ -3008,7 +3008,6 @@ var FHUploadComponent = /** @class */ (function () {
3008
3008
  */
3009
3009
  function () {
3010
3010
  var _this = this;
3011
- console.log('INIT');
3012
3011
  /** @type {?} */
3013
3012
  var uo = {};
3014
3013
  uo.headers = [{ name: 'Authorization', value: 'Bearer ' + localStorage.getItem(this.app_s.COMPANY_KEY + "token") }];
@@ -3625,6 +3624,8 @@ var FHUploadPanelComponent = /** @class */ (function () {
3625
3624
  this.b_False = false;
3626
3625
  this.b_mobile = false;
3627
3626
  this.b_ini = false;
3627
+ this.m_p_tipo = "";
3628
+ this.m_programma_da_eseguire = "";
3628
3629
  }
3629
3630
  /**
3630
3631
  * @param {?} ax
@@ -3694,29 +3695,36 @@ var FHUploadPanelComponent = /** @class */ (function () {
3694
3695
  * @return {?}
3695
3696
  */
3696
3697
  function () {
3697
- console.log('INIT1');
3698
3698
  this.upc.single = false;
3699
3699
  this.b_mobile = this._appservice.getState().pageFullscreen;
3700
3700
  this
3701
3701
  .upc
3702
- .init(this.App, this.K, 'Descrizione Allegato');
3702
+ .init(this.App, this.K, 'Descrizione Allegato', this.m_p_tipo, this.m_programma_da_eseguire);
3703
3703
  this.ref_allegato();
3704
3704
  };
3705
3705
  /**
3706
3706
  * @param {?} p_app
3707
3707
  * @param {?} p_k
3708
+ * @param {?=} p_tipo
3709
+ * @param {?=} programma_da_eseguire
3708
3710
  * @return {?}
3709
3711
  */
3710
3712
  FHUploadPanelComponent.prototype.init = /**
3711
3713
  * @param {?} p_app
3712
3714
  * @param {?} p_k
3715
+ * @param {?=} p_tipo
3716
+ * @param {?=} programma_da_eseguire
3713
3717
  * @return {?}
3714
3718
  */
3715
- function (p_app, p_k) {
3719
+ function (p_app, p_k, p_tipo, programma_da_eseguire) {
3720
+ if (p_tipo === void 0) { p_tipo = ""; }
3721
+ if (programma_da_eseguire === void 0) { programma_da_eseguire = ""; }
3716
3722
  this.App = p_app;
3717
3723
  this.K = p_k;
3718
3724
  this.b_ini = true;
3719
3725
  this.b_edit_loaded = false;
3726
+ this.m_p_tipo = p_tipo;
3727
+ this.m_programma_da_eseguire = programma_da_eseguire;
3720
3728
  this.ngOnInit();
3721
3729
  };
3722
3730
  /**
@@ -12074,61 +12082,109 @@ var win_log = /** @class */ (function () {
12074
12082
  * @fileoverview added by tsickle
12075
12083
  * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
12076
12084
  */
12085
+ var OfficeOperation = /** @class */ (function () {
12086
+ function OfficeOperation() {
12087
+ }
12088
+ return OfficeOperation;
12089
+ }());
12077
12090
  var OfficeAutomatorService = /** @class */ (function () {
12078
- /**
12079
- *
12080
- */
12081
- function OfficeAutomatorService(dataService, fileService, toastr, utility) {
12091
+ function OfficeAutomatorService(dataService, fileService, toastr) {
12082
12092
  this.dataService = dataService;
12083
12093
  this.fileService = fileService;
12084
12094
  this.toastr = toastr;
12085
- this.utility = utility;
12095
+ /**
12096
+ * @param commands
12097
+ * @param options
12098
+ * @export
12099
+ */
12100
+ this.eprog = 0;
12086
12101
  }
12087
12102
  /**
12088
- * @param commands
12089
- * @param options
12090
- * @export
12103
+ * @param {?} operazione
12104
+ * @param {?} v1
12105
+ * @param {?} v2
12106
+ * @param {?} ordine
12107
+ * @return {?}
12108
+ */
12109
+ OfficeAutomatorService.prototype.operation = /**
12110
+ * @param {?} operazione
12111
+ * @param {?} v1
12112
+ * @param {?} v2
12113
+ * @param {?} ordine
12114
+ * @return {?}
12091
12115
  */
12116
+ function (operazione, v1, v2, ordine) {
12117
+ /** @type {?} */
12118
+ var op = new OfficeOperation();
12119
+ op.op = operazione;
12120
+ op.v1 = v1;
12121
+ op.v2 = v2;
12122
+ op.ord = ordine;
12123
+ return op;
12124
+ };
12092
12125
  /**
12093
- * @export
12126
+ * @private
12127
+ * @param {?=} dialogRef_W
12128
+ * @return {?}
12129
+ */
12130
+ OfficeAutomatorService.prototype.progress_update = /**
12131
+ * @private
12132
+ * @param {?=} dialogRef_W
12133
+ * @return {?}
12134
+ */
12135
+ function (dialogRef_W) {
12136
+ var _this = this;
12137
+ if (dialogRef_W === void 0) { dialogRef_W = null; }
12138
+ if (dialogRef_W == null)
12139
+ return;
12140
+ if (dialogRef_W.componentInstance == null)
12141
+ return;
12142
+ if (this.eprog >= 100)
12143
+ return;
12144
+ this.eprog += 10;
12145
+ dialogRef_W.componentInstance.update_progess(this.eprog);
12146
+ setTimeout(function () {
12147
+ _this.progress_update(dialogRef_W);
12148
+ }, 2000);
12149
+ };
12150
+ /**
12151
+ * @param {?} uiid
12094
12152
  * @param {?} commands
12095
- * @param {?} options
12153
+ * @param {?} dialogRef_W
12096
12154
  * @return {?}
12097
12155
  */
12098
12156
  OfficeAutomatorService.prototype.runCommands = /**
12099
- * @export
12157
+ * @param {?} uiid
12100
12158
  * @param {?} commands
12101
- * @param {?} options
12159
+ * @param {?} dialogRef_W
12102
12160
  * @return {?}
12103
12161
  */
12104
- function (commands, options) {
12162
+ function (uiid, commands, dialogRef_W) {
12105
12163
  var _this = this;
12106
- /** @type {?} */
12107
- var uiid = this.utility.newGuid();
12108
- // TODO: check order
12109
- // TODO: check id
12110
- // create job in db
12111
- /** @type {?} */
12112
- var q = '';
12113
- for (var i = 0; i < commands.length; i++) {
12114
- if (q != "") {
12115
- q = q + ";;;";
12116
- }
12117
- q = q + (commands[i].id || uiid) + ";;;" + commands[i].op + ";;;" + (commands[i].v1 || ' ') + ";;;" + (commands[i].v2 || ' ') + ";;;" + (commands[i].ord);
12118
- }
12164
+ this.eprog = 0;
12119
12165
  /** @type {?} */
12120
12166
  var p = new QParam();
12121
- p.sql = "INSERT_CMD_STAMPA_MULTI";
12122
- p.types = ['string', 'string', 'string', 'string', 'int'];
12123
- p.values = [q];
12167
+ p.sql = "INSERT_OFFICE_OPERATION";
12168
+ p.types = ['string', 'string'];
12169
+ commands.sort(function (left, right) {
12170
+ if (left.ord < right.ord)
12171
+ return -1;
12172
+ if (left.ord > right.ord)
12173
+ return 1;
12174
+ });
12175
+ console.log('commands ', commands);
12176
+ p.values = [uiid, JSON.stringify(commands)];
12124
12177
  return this.dataService.doQuery(p).pipe(flatMap(function (data) {
12125
12178
  if (data != null) {
12126
12179
  if (data.result_msg == "OK") {
12127
- // create job file
12128
12180
  /** @type {?} */
12129
12181
  var p_1 = new FSInput();
12130
- p_1.command = "wg_create";
12131
- p_1.p1 = uiid;
12182
+ p_1.command = "exec_app";
12183
+ p_1.p1 = "print_manager";
12184
+ p_1.p2 = uiid;
12185
+ setTimeout(function () {
12186
+ _this.progress_update(dialogRef_W);
12187
+ }, 2000);
12132
12188
  return _this.fileService.doQuery(p_1).pipe(flatMap(function (data) {
12133
12189
  if (data != null && data.result_msg == "OK") {
12134
12190
  // check the job is done
@@ -12140,35 +12196,31 @@ var OfficeAutomatorService = /** @class */ (function () {
12140
12196
  /** @type {?} */
12141
12197
  var timeoutTimer = setTimeout(function () {
12142
12198
  isTimeout = true;
12143
- }, options.timeout || 3 * 60 * 1000);
12144
- // 3 min default timeout
12145
- /** @type {?} */
12146
- var logOffset = 0;
12147
- ck_files();
12199
+ }, 3 * 60 * 1000);
12200
+ ck_files(uiid);
12148
12201
  /**
12149
- *
12202
+ * @param {?} uiid
12150
12203
  * @return {?}
12151
12204
  */
12152
- function ck_files() {
12205
+ function ck_files(uiid) {
12153
12206
  /** @type {?} */
12154
- var p = new FSInput();
12155
- p.command = "wg_getlog";
12156
- p.p1 = uiid;
12157
- p.p2 = logOffset.toString();
12158
- self.fileService.doQuery(p).subscribe(function (data) {
12207
+ var p = new QParam();
12208
+ p.sql = "SELECT_OFFICE_OPERATION_FINISCHED";
12209
+ p.types = ['string'];
12210
+ p.values = [uiid];
12211
+ self.dataService.doQuery(p).subscribe(function (data) {
12159
12212
  if (data != null && data.result_msg == 'OK') {
12160
12213
  /** @type {?} */
12161
- var chunkInfo = data.result_data[0];
12162
- logOffset += chunkInfo.chunk.length;
12163
- subscriber.next(chunkInfo);
12164
- if (chunkInfo.done) {
12214
+ var chunkInfo = data.result_data;
12215
+ if (chunkInfo.length == 1) {
12216
+ subscriber.next({ message: chunkInfo[0].result_message, result: chunkInfo[0].result });
12165
12217
  subscriber.complete();
12166
12218
  }
12167
12219
  else {
12168
12220
  if (!isTimeout) {
12169
12221
  setTimeout(function () {
12170
- ck_files();
12171
- }, options.checkInterval || 3000); // 3 sec default check interval
12222
+ ck_files(uiid);
12223
+ }, 3000); // 3 sec default check interval
12172
12224
  }
12173
12225
  else {
12174
12226
  console.log('Timeout');
@@ -12178,9 +12230,11 @@ var OfficeAutomatorService = /** @class */ (function () {
12178
12230
  }
12179
12231
  }
12180
12232
  else {
12181
- console.error(data);
12182
- subscriber.error(data);
12183
- subscriber.complete();
12233
+ if (!isTimeout) {
12234
+ setTimeout(function () {
12235
+ ck_files(uiid);
12236
+ }, 3000); // 3 sec default check interval
12237
+ }
12184
12238
  }
12185
12239
  });
12186
12240
  }
@@ -12191,37 +12245,6 @@ var OfficeAutomatorService = /** @class */ (function () {
12191
12245
  }
12192
12246
  }));
12193
12247
  };
12194
- /**
12195
- * @param {?} fs_path
12196
- * @param {?} web_path
12197
- * @param {?=} error_msg
12198
- * @return {?}
12199
- */
12200
- OfficeAutomatorService.prototype.send_file_to_user = /**
12201
- * @param {?} fs_path
12202
- * @param {?} web_path
12203
- * @param {?=} error_msg
12204
- * @return {?}
12205
- */
12206
- function (fs_path, web_path, error_msg) {
12207
- var _this = this;
12208
- if (error_msg === void 0) { error_msg = 'errore nella creazione del file'; }
12209
- /** @type {?} */
12210
- var p = new FSInput();
12211
- p.p1 = fs_path;
12212
- p.command = "check_file";
12213
- this.fileService.doQuery(p).subscribe(function (data) {
12214
- if (data != null)
12215
- if (data.msg != "N") {
12216
- window.open(web_path);
12217
- }
12218
- else {
12219
- if (error_msg != null)
12220
- if (error_msg != '')
12221
- _this.toastr.error(error_msg);
12222
- }
12223
- });
12224
- };
12225
12248
  OfficeAutomatorService.decorators = [
12226
12249
  { type: Injectable, args: [{
12227
12250
  providedIn: 'root',
@@ -12231,10 +12254,9 @@ var OfficeAutomatorService = /** @class */ (function () {
12231
12254
  OfficeAutomatorService.ctorParameters = function () { return [
12232
12255
  { type: QueryService },
12233
12256
  { type: FileService },
12234
- { type: ToastrService },
12235
- { type: UtilityService }
12257
+ { type: ToastrService }
12236
12258
  ]; };
12237
- /** @nocollapse */ OfficeAutomatorService.ngInjectableDef = defineInjectable({ factory: function OfficeAutomatorService_Factory() { return new OfficeAutomatorService(inject(QueryService), inject(FileService), inject(ToastrService), inject(UtilityService)); }, token: OfficeAutomatorService, providedIn: "root" });
12259
+ /** @nocollapse */ OfficeAutomatorService.ngInjectableDef = defineInjectable({ factory: function OfficeAutomatorService_Factory() { return new OfficeAutomatorService(inject(QueryService), inject(FileService), inject(ToastrService)); }, token: OfficeAutomatorService, providedIn: "root" });
12238
12260
  return OfficeAutomatorService;
12239
12261
  }());
12240
12262