@fluxhub/fluxhub-lib 10.0.511 → 10.0.513

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.
@@ -6109,8 +6109,10 @@ class FHGridComponent {
6109
6109
  this.clipboard = clipboard;
6110
6110
  this.width_max = '100%';
6111
6111
  this.browser = 'nd';
6112
- this.exec_ft = new EventEmitter();
6113
6112
  this.over_fulltext = false;
6113
+ this.over_fulltext_types = [];
6114
+ this.over_fulltext_values = [];
6115
+ this.over_fulltext_sql = '';
6114
6116
  this.tooltipShowDelay = 2000;
6115
6117
  this.elimina_label = 'ELIMINA';
6116
6118
  this.export_field_aggiuntivi = '';
@@ -6268,79 +6270,162 @@ class FHGridComponent {
6268
6270
  if (p.sort_field != "")
6269
6271
  this.str_curr_q_p = this.str_curr_q_p + " order by " + p.sort_field;
6270
6272
  this.curr_filter = p.filter;
6271
- this._gridservice.doQuery(p, true, this.end_point).subscribe((data) => {
6272
- let ok_op = false;
6273
- if (data != null)
6274
- if (data.result_msg == "OK") {
6275
- ok_op = true;
6276
- // console.log(data.result_data);
6277
- params.successCallback(data.result_data, data.count);
6278
- this.b_init = true;
6279
- this.myData = data.result_data.slice();
6280
- this.num_r = data.count;
6281
- this.slimLoadingBarService.complete();
6282
- this.fill_end.emit();
6283
- // console.log("end");
6284
- // console.log(localStorage.getItem(this.grid_key+'_POS'));
6285
- localStorage.setItem(this.grid_key + "_POS1", JSON.stringify(p));
6286
- if (localStorage.getItem(this.grid_key + "_POS2") != null)
6287
- if (this.gridOptions != null)
6288
- if (this.gridOptions.api != null)
6289
- this.gridOptions.api.forEachNode((node) => {
6290
- // console.log(node)
6291
- if (this.getRowNodeId(node) ===
6292
- localStorage.getItem(this.grid_key + "_POS2")) {
6293
- node.setSelected(true);
6294
- localStorage.removeItem(this.grid_key + "_POS2");
6295
- if (localStorage.getItem(this.grid_key + "_LAST_ROW") != null)
6296
- this.sRow = JSON.parse(localStorage.getItem(this.grid_key + "_LAST_ROW"));
6297
- localStorage.removeItem(this.grid_key + "_LAST_ROW");
6298
- }
6299
- });
6300
- let b_mantieni_ck = false;
6301
- if (this.toggle_mantieni != null)
6302
- b_mantieni_ck = this.toggle_mantieni.checked;
6303
- if (this.no_pref && !this.b_init1) {
6304
- this.autoSizeAll();
6273
+ if (this.ric_libera == '' || !this.over_fulltext) {
6274
+ this._gridservice.doQuery(p, true, this.end_point).subscribe((data) => {
6275
+ let ok_op = false;
6276
+ if (data != null)
6277
+ if (data.result_msg == "OK") {
6278
+ ok_op = true;
6279
+ // console.log(data.result_data);
6280
+ params.successCallback(data.result_data, data.count);
6281
+ this.b_init = true;
6282
+ this.myData = data.result_data.slice();
6283
+ this.num_r = data.count;
6284
+ this.slimLoadingBarService.complete();
6285
+ this.fill_end.emit();
6286
+ // console.log("end");
6287
+ // console.log(localStorage.getItem(this.grid_key+'_POS'));
6288
+ localStorage.setItem(this.grid_key + "_POS1", JSON.stringify(p));
6289
+ if (localStorage.getItem(this.grid_key + "_POS2") != null)
6290
+ if (this.gridOptions != null)
6291
+ if (this.gridOptions.api != null)
6292
+ this.gridOptions.api.forEachNode((node) => {
6293
+ // console.log(node)
6294
+ if (this.getRowNodeId(node) ===
6295
+ localStorage.getItem(this.grid_key + "_POS2")) {
6296
+ node.setSelected(true);
6297
+ localStorage.removeItem(this.grid_key + "_POS2");
6298
+ if (localStorage.getItem(this.grid_key + "_LAST_ROW") != null)
6299
+ this.sRow = JSON.parse(localStorage.getItem(this.grid_key + "_LAST_ROW"));
6300
+ localStorage.removeItem(this.grid_key + "_LAST_ROW");
6301
+ }
6302
+ });
6303
+ let b_mantieni_ck = false;
6304
+ if (this.toggle_mantieni != null)
6305
+ b_mantieni_ck = this.toggle_mantieni.checked;
6306
+ if (this.no_pref && !this.b_init1) {
6307
+ this.autoSizeAll();
6308
+ }
6309
+ this.b_init1 = true;
6310
+ this.ensure_visible();
6311
+ /*if (localStorage.getItem(this.grid_key + '_COLS')==null && this.first_ref) {
6312
+ setTimeout(() => {
6313
+ this.autoSizeAll();
6314
+ }, 300);
6315
+ this.first_ref = false;
6316
+
6317
+
6318
+ } else*/ if (localStorage.getItem(this.grid_key + "_COLS") == null &&
6319
+ this.autosize_at_ini)
6320
+ setTimeout(() => {
6321
+ this.autoSizeAll();
6322
+ }, 300);
6323
+ //console.log('xxxxxxxxxxxxxxxxxxx');
6324
+ // console.log(this.m_appService.getState().grid_obj[this.grid_key+'_NODE'].id);
6325
+ //if(this.m_appService.getState().grid_obj[this.grid_key+'_NODE']!=null)
6326
+ /*
6327
+
6328
+ this.gridOptions.api.forEachNode( (node) =>{
6329
+ // select the node
6330
+ // console.log(node.id+' '+this.m_appService.getState().grid_obj[this.grid_key+'_NODE'].id);
6331
+ if(node.rowIndex==parseInt(localStorage.getItem(this.grid_key+'_POS'))){
6332
+ // console.log(node.id+' '+this.m_appService.getState().grid_obj[this.grid_key+'_NODE'].id);
6333
+ node.setSelected(true);
6334
+
6335
+ }}*/
6336
+ // if(this.m_appService.getState().grid_obj[this.grid_key+'_NODE']!=null)
6337
+ //this.gridOptions.api.get(parseInt(localStorage.getItem(this.grid_key+'_POS'))).setSelected(true);
6338
+ // console.log(this.myData);
6305
6339
  }
6306
- this.b_init1 = true;
6307
- this.ensure_visible();
6308
- /*if (localStorage.getItem(this.grid_key + '_COLS')==null && this.first_ref) {
6309
- setTimeout(() => {
6310
- this.autoSizeAll();
6311
- }, 300);
6312
- this.first_ref = false;
6313
-
6314
-
6315
- } else*/ if (localStorage.getItem(this.grid_key + "_COLS") == null &&
6316
- this.autosize_at_ini)
6317
- setTimeout(() => {
6340
+ if (!ok_op) {
6341
+ this.errorMsg = data.msg + " [" + data.result_msg + "]";
6342
+ }
6343
+ }, (err) => {
6344
+ this.errorMsg =
6345
+ "ERRORE DI CONNESSIONE CON IL SERVER. RITENTARE PIU' TARDI";
6346
+ });
6347
+ }
6348
+ else {
6349
+ var px = new QParam();
6350
+ px.sql = this.over_fulltext_sql;
6351
+ px.types = ['string'];
6352
+ px.values = [this.ric_libera];
6353
+ this.over_fulltext_types.map((v) => { px.types.push(v); });
6354
+ this.over_fulltext_values.map((v) => { px.values.push(v); });
6355
+ this._dataService.doQuery(px).subscribe((data) => {
6356
+ let ok_op = false;
6357
+ if (data != null)
6358
+ if (data.result_msg == "OK") {
6359
+ ok_op = true;
6360
+ // console.log(data.result_data);
6361
+ params.successCallback(data.result_data, data.result_data.length);
6362
+ this.b_init = true;
6363
+ this.myData = data.result_data.slice();
6364
+ this.num_r = data.result_data.length;
6365
+ this.slimLoadingBarService.complete();
6366
+ this.fill_end.emit();
6367
+ // console.log("end");
6368
+ // console.log(localStorage.getItem(this.grid_key+'_POS'));
6369
+ localStorage.setItem(this.grid_key + "_POS1", JSON.stringify(p));
6370
+ if (localStorage.getItem(this.grid_key + "_POS2") != null)
6371
+ if (this.gridOptions != null)
6372
+ if (this.gridOptions.api != null)
6373
+ this.gridOptions.api.forEachNode((node) => {
6374
+ // console.log(node)
6375
+ if (this.getRowNodeId(node) ===
6376
+ localStorage.getItem(this.grid_key + "_POS2")) {
6377
+ node.setSelected(true);
6378
+ localStorage.removeItem(this.grid_key + "_POS2");
6379
+ if (localStorage.getItem(this.grid_key + "_LAST_ROW") != null)
6380
+ this.sRow = JSON.parse(localStorage.getItem(this.grid_key + "_LAST_ROW"));
6381
+ localStorage.removeItem(this.grid_key + "_LAST_ROW");
6382
+ }
6383
+ });
6384
+ let b_mantieni_ck = false;
6385
+ if (this.toggle_mantieni != null)
6386
+ b_mantieni_ck = this.toggle_mantieni.checked;
6387
+ if (this.no_pref && !this.b_init1) {
6318
6388
  this.autoSizeAll();
6319
- }, 300);
6320
- //console.log('xxxxxxxxxxxxxxxxxxx');
6321
- // console.log(this.m_appService.getState().grid_obj[this.grid_key+'_NODE'].id);
6322
- //if(this.m_appService.getState().grid_obj[this.grid_key+'_NODE']!=null)
6323
- /*
6324
-
6325
- this.gridOptions.api.forEachNode( (node) =>{
6326
- // select the node
6327
- // console.log(node.id+' '+this.m_appService.getState().grid_obj[this.grid_key+'_NODE'].id);
6328
- if(node.rowIndex==parseInt(localStorage.getItem(this.grid_key+'_POS'))){
6329
- // console.log(node.id+' '+this.m_appService.getState().grid_obj[this.grid_key+'_NODE'].id);
6330
- node.setSelected(true);
6331
-
6332
- }}*/
6333
- // if(this.m_appService.getState().grid_obj[this.grid_key+'_NODE']!=null)
6334
- //this.gridOptions.api.get(parseInt(localStorage.getItem(this.grid_key+'_POS'))).setSelected(true);
6335
- // console.log(this.myData);
6389
+ }
6390
+ this.b_init1 = true;
6391
+ this.ensure_visible();
6392
+ /*if (localStorage.getItem(this.grid_key + '_COLS')==null && this.first_ref) {
6393
+ setTimeout(() => {
6394
+ this.autoSizeAll();
6395
+ }, 300);
6396
+ this.first_ref = false;
6397
+
6398
+
6399
+ } else*/ if (localStorage.getItem(this.grid_key + "_COLS") == null &&
6400
+ this.autosize_at_ini)
6401
+ setTimeout(() => {
6402
+ this.autoSizeAll();
6403
+ }, 300);
6404
+ //console.log('xxxxxxxxxxxxxxxxxxx');
6405
+ // console.log(this.m_appService.getState().grid_obj[this.grid_key+'_NODE'].id);
6406
+ //if(this.m_appService.getState().grid_obj[this.grid_key+'_NODE']!=null)
6407
+ /*
6408
+
6409
+ this.gridOptions.api.forEachNode( (node) =>{
6410
+ // select the node
6411
+ // console.log(node.id+' '+this.m_appService.getState().grid_obj[this.grid_key+'_NODE'].id);
6412
+ if(node.rowIndex==parseInt(localStorage.getItem(this.grid_key+'_POS'))){
6413
+ // console.log(node.id+' '+this.m_appService.getState().grid_obj[this.grid_key+'_NODE'].id);
6414
+ node.setSelected(true);
6415
+
6416
+ }}*/
6417
+ // if(this.m_appService.getState().grid_obj[this.grid_key+'_NODE']!=null)
6418
+ //this.gridOptions.api.get(parseInt(localStorage.getItem(this.grid_key+'_POS'))).setSelected(true);
6419
+ // console.log(this.myData);
6420
+ }
6421
+ if (!ok_op) {
6422
+ this.errorMsg = data.msg + " [" + data.result_msg + "]";
6336
6423
  }
6337
- if (!ok_op) {
6338
- this.errorMsg = data.msg + " [" + data.result_msg + "]";
6339
- }
6340
- }, (err) => {
6341
- this.errorMsg =
6342
- "ERRORE DI CONNESSIONE CON IL SERVER. RITENTARE PIU' TARDI";
6343
- });
6424
+ }, (err) => {
6425
+ this.errorMsg =
6426
+ "ERRORE DI CONNESSIONE CON IL SERVER. RITENTARE PIU' TARDI";
6427
+ });
6428
+ }
6344
6429
  // this.gridOptions.api.setDatasource(this.dataSource);
6345
6430
  },
6346
6431
  };
@@ -7541,7 +7626,6 @@ class FHGridComponent {
7541
7626
  }
7542
7627
  }
7543
7628
  free_search() {
7544
- console.log('free_search !!!! ', this.over_fulltext);
7545
7629
  if (this.ric_libera == "") {
7546
7630
  this.pulisci_filtri();
7547
7631
  this.fix_flt_temp = "";
@@ -7550,11 +7634,6 @@ class FHGridComponent {
7550
7634
  return;
7551
7635
  }
7552
7636
  localStorage.setItem(this.grid_key + "_FILTER_UP", this.ric_libera);
7553
- if (this.over_fulltext) {
7554
- console.log('this.over_fulltext ', this.ric_libera);
7555
- this.exec_ft.emit(this.ric_libera);
7556
- return;
7557
- }
7558
7637
  let arr = this.ric_libera.split(" ");
7559
7638
  let arr_F = new Array();
7560
7639
  for (let i = 0; i < arr.length; i++)
@@ -7773,8 +7852,10 @@ FHGridComponent.ctorParameters = () => [
7773
7852
  { type: Clipboard }
7774
7853
  ];
7775
7854
  FHGridComponent.propDecorators = {
7776
- exec_ft: [{ type: Output }],
7777
7855
  over_fulltext: [{ type: Input }],
7856
+ over_fulltext_types: [{ type: Input }],
7857
+ over_fulltext_values: [{ type: Input }],
7858
+ over_fulltext_sql: [{ type: Input }],
7778
7859
  tooltipShowDelay: [{ type: Input }],
7779
7860
  elimina_label: [{ type: Input }],
7780
7861
  export_field_aggiuntivi: [{ type: Input }],