@fluxhub/fluxhub-lib 10.0.519 → 10.0.521

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.
@@ -11388,6 +11388,12 @@ class FHAutoCompleteComponent {
11388
11388
  fillCombo() {
11389
11389
  this.myData = new Array();
11390
11390
  this.searchItemsFiltered = new Array();
11391
+ if (this.sql == null)
11392
+ this.sql = "";
11393
+ if (this.sql.indexOf("|") != -1 && this.sql.indexOf("$") != -1) {
11394
+ this.set_options(this.sql);
11395
+ return;
11396
+ }
11391
11397
  let p = new QParam();
11392
11398
  p.sql = this.sql;
11393
11399
  p.types = this.types;
@@ -25766,6 +25772,1809 @@ fh_win_ask_richtext.ctorParameters = () => [
25766
25772
  { type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] }
25767
25773
  ];
25768
25774
 
25775
+ class FHGridComponentN {
25776
+ constructor(_gridservice, _toast, _dataService, m_appService, slimLoadingBarService, m_dialog, uti_s, _fileService, clipboard) {
25777
+ this._gridservice = _gridservice;
25778
+ this._toast = _toast;
25779
+ this._dataService = _dataService;
25780
+ this.m_appService = m_appService;
25781
+ this.slimLoadingBarService = slimLoadingBarService;
25782
+ this.m_dialog = m_dialog;
25783
+ this.uti_s = uti_s;
25784
+ this._fileService = _fileService;
25785
+ this.clipboard = clipboard;
25786
+ this.width_max = '100%';
25787
+ this.browser = 'nd';
25788
+ this.tooltipShowDelay = 2000;
25789
+ this.elimina_label = 'ELIMINA';
25790
+ this.export_field_aggiuntivi = '';
25791
+ this.end_point = null;
25792
+ this.tbl_name = "";
25793
+ this.num_per_pag = 35;
25794
+ this.grid_key = "PRO_H";
25795
+ this.enabled = true;
25796
+ this.show_link = false;
25797
+ this.show_help_bar = false;
25798
+ this.help_label_bar = 'HELP';
25799
+ this.auto_load = true;
25800
+ this.auto_height = false;
25801
+ this.enable_export = true;
25802
+ this.enabled_pag = true;
25803
+ this.show_help = true;
25804
+ this.show_num_elem = true;
25805
+ this.system_dest = 1;
25806
+ this.header_h = 35;
25807
+ this.selection_mode = 'multiple';
25808
+ this.init_fill = true;
25809
+ this.no_pref = false;
25810
+ this.pref_hidden = true;
25811
+ this.enable_export_pdf = true;
25812
+ this.enable_export_xls = true;
25813
+ this.enable_copy = true;
25814
+ this.autosize_at_ini = true;
25815
+ this.label_elementi = " Elementi";
25816
+ this.trova_label = "TROVA";
25817
+ this.mantieni_impostazioni = "Mantieni Imp.";
25818
+ this.curr_filter = "";
25819
+ this.show_buttons = true;
25820
+ this.fill_end = new EventEmitter();
25821
+ this.cell_edited = new EventEmitter();
25822
+ this.clicked = new EventEmitter();
25823
+ this.dclicked = new EventEmitter();
25824
+ this.columndclicked = new EventEmitter();
25825
+ this.cell_clicked = new EventEmitter();
25826
+ this.custom_export = false;
25827
+ this.toolbar_type = "NONE";
25828
+ this.toolbar_wkfapp = null;
25829
+ this.toolbar_custom_commands = [];
25830
+ this.command = new EventEmitter();
25831
+ this.b_ensure = false;
25832
+ this.curr_config = "-1";
25833
+ /* calcola_filtro(obj_filtro, filter_v, key, add_end = true) {
25834
+ console.log('calcola_filtro ',key,add_end);
25835
+ let b_filter: boolean = false;
25836
+ if (obj_filtro.type != null) {
25837
+ if (obj_filtro.filter != null) {
25838
+
25839
+ if (add_end) filter_v = filter_v + " and ";
25840
+ b_filter = true;
25841
+ if (obj_filtro.filterType == "number") {
25842
+ if (obj_filtro.type == "greaterThan")
25843
+ filter_v = filter_v + " " + key + " > " + obj_filtro.filter;
25844
+ if (obj_filtro.type == "equals")
25845
+ filter_v = filter_v + " " + key + " = " + obj_filtro.filter;
25846
+ if (obj_filtro.type == "notEqual")
25847
+ filter_v = filter_v + " " + key + " <> " + obj_filtro.filter;
25848
+ if (obj_filtro.type == "lessThan")
25849
+ filter_v = filter_v + " " + key + " < " + obj_filtro.filter;
25850
+ if (obj_filtro.type == "lessThanOrEqual")
25851
+ filter_v = filter_v + " " + key + " <= " + obj_filtro.filter;
25852
+ if (obj_filtro.type == "greaterThanOrEqual")
25853
+ filter_v = filter_v + " " + key + " >= " + obj_filtro.filter;
25854
+ if (obj_filtro.type == "inRange")
25855
+ filter_v =
25856
+ filter_v +
25857
+ " (" +
25858
+ key +
25859
+ " >= " +
25860
+ obj_filtro.filter +
25861
+ " and " +
25862
+ key +
25863
+ " <= " +
25864
+ obj_filtro.filterTo +
25865
+ ")";
25866
+ } else {
25867
+ if (obj_filtro.type == "contains")
25868
+ filter_v =
25869
+ filter_v +
25870
+ " upper(" +
25871
+ key +
25872
+ ") like '%" +
25873
+ obj_filtro.filter.replace("'", "$'").replace("*", "$*").replace("?", "$?").replace("[", "$[").replace("]", "$]").replace("!", "'$").toUpperCase() +
25874
+ "%' ESCAPE '$'";
25875
+ if (obj_filtro.type == "startsWith")
25876
+ filter_v =
25877
+ filter_v +
25878
+ " upper(" +
25879
+ key +
25880
+ ") like '" +
25881
+ obj_filtro.filter.replace("'", "$'").replace("*", "$*").replace("?", "$?").replace("[", "$[").replace("]", "$]").replace("!", "'$").toUpperCase() +
25882
+ "%' ESCAPE '$'";
25883
+ if (obj_filtro.type == "equals")
25884
+ filter_v =
25885
+ filter_v +
25886
+ " upper(" +
25887
+ key +
25888
+ ") = '" +
25889
+ obj_filtro.filter.replace("'", "''").toUpperCase() +
25890
+ "%'";
25891
+ if (obj_filtro.type == "notContains")
25892
+ filter_v =
25893
+ filter_v +
25894
+ "not upper(" +
25895
+ key +
25896
+ ") like '%" +
25897
+ obj_filtro.filter.replace("'", "$'").replace("*", "$*").replace("?", "$?").replace("[", "$[").replace("]", "$]").replace("!", "'$").toUpperCase() +
25898
+ "%' ESCAPE '$'";
25899
+
25900
+ if (obj_filtro.type == "notEqual")
25901
+ filter_v =
25902
+ filter_v +
25903
+ " upper(" +
25904
+ key +
25905
+ ") <> '" +
25906
+ obj_filtro.filter.replace("'", "''").toUpperCase() +
25907
+ "'";
25908
+ if (obj_filtro.type == "endsWith")
25909
+ filter_v =
25910
+ filter_v +
25911
+ " upper(" +
25912
+ key +
25913
+ ") like '%" +
25914
+ obj_filtro.replace("'", "$'").replace("*", "$*").replace("?", "$?").replace("[", "$[").replace("]", "$]").replace("!", "'$").toUpperCase() +
25915
+ "' ESCAPE '$'";
25916
+ // if(obj_filtro.type=="startsWith") filter_v = filter_v +' upper('+ key + ') like \'' + obj_filtro.filter.replace('\'', '\'\'').toUpperCase() + '%\'';
25917
+ }
25918
+ }
25919
+ if (obj_filtro.type == 'inRange'){
25920
+ if (obj_filtro.dateTo != null && obj_filtro.dateFrom != null) {
25921
+ if(obj_filtro.dateFrom>=obj_filtro.dateTo){
25922
+ this._toast.error('Data inizio range deve essere maggiore di data fine range');
25923
+ return;
25924
+ }
25925
+ b_filter = true;
25926
+ if (add_end) filter_v = filter_v + " and ";
25927
+ filter_v = filter_v + ' ('+key+'>='+ this.uti_s.sql_date_grid(
25928
+ this.uti_s.string2date(obj_filtro.dateFrom, 5)
25929
+ )+' and '+key+'<='+ this.uti_s.sql_date_grid(
25930
+ this.uti_s.string2date(obj_filtro.dateTo, 5)
25931
+ )+') ';
25932
+ }
25933
+ }else
25934
+ if (obj_filtro.dateTo != null || obj_filtro.dateFrom != null) {
25935
+ b_filter = true;
25936
+ if (add_end) filter_v = filter_v + " and ";
25937
+ filter_v = filter_v + " (";
25938
+ // if (obj_filtro.dateFrom != null && obj_filtro.dateTo != null && this.uti_s.sql_date_grid(this.uti_s.string2date(obj_filtro.dateFrom, 5))!='dbnull') filter_v = filter_v + key + ">=" + this.uti_s.sql_date_grid(this.uti_s.string2date(obj_filtro.dateFrom, 5));
25939
+
25940
+ if (
25941
+ obj_filtro.dateFrom != null &&
25942
+ this.uti_s.sql_date_grid(
25943
+ this.uti_s.string2date(obj_filtro.dateFrom, 5)
25944
+ ) != "dbnull"
25945
+ ) {
25946
+ let q: string = "";
25947
+ if (obj_filtro.type == "greaterThan")
25948
+ q =
25949
+ " " +
25950
+ key +
25951
+ " >= " +
25952
+ this.uti_s.sql_date_grid(
25953
+ this.uti_s.string2date(obj_filtro.dateFrom, 5)
25954
+ ) +
25955
+ "";
25956
+ if (obj_filtro.type == "equals")
25957
+ q =
25958
+ " (" +
25959
+ key +
25960
+ " >=" +
25961
+ this.uti_s.sql_date_grid(
25962
+ this.uti_s.string2date(obj_filtro.dateFrom, 5)
25963
+ ) +
25964
+ " and " +
25965
+ key +
25966
+ " <=" +
25967
+ this.uti_s.sql_date_grid(
25968
+ this.uti_s.string2date(obj_filtro.dateFrom, 5),
25969
+ "T23:59:00"
25970
+ ) +
25971
+ ")";
25972
+ if (obj_filtro.type == "notEqual")
25973
+ q =
25974
+ " " +
25975
+ key +
25976
+ " <> " +
25977
+ this.uti_s.sql_date_grid(
25978
+ this.uti_s.string2date(obj_filtro.dateFrom, 5)
25979
+ ) +
25980
+ "";
25981
+ if (obj_filtro.type == "lessThan")
25982
+ q =
25983
+ " " +
25984
+ key +
25985
+ " <= " +
25986
+ this.uti_s.sql_date_grid(
25987
+ this.uti_s.string2date(obj_filtro.dateFrom, 5)
25988
+ ) +
25989
+ "";
25990
+ let dtx:Date= this.uti_s.string2date(obj_filtro.dateFrom, 5)
25991
+ dtx.setHours(23);
25992
+ dtx.setMinutes(59);
25993
+
25994
+ if (obj_filtro.type == "lessThanOrEqual")
25995
+ q =
25996
+ " " +
25997
+ key +
25998
+ " <= " +
25999
+ this.uti_s.sql_date_grid(
26000
+ dtx
26001
+ ) +
26002
+ "";
26003
+ if (obj_filtro.type == "greaterThanOrEqual")
26004
+ q =
26005
+ " " +
26006
+ key +
26007
+ " >= " +
26008
+ this.uti_s.sql_date_grid(
26009
+ this.uti_s.string2date(obj_filtro.dateFrom, 5)
26010
+ ) +
26011
+ "";
26012
+ filter_v = filter_v + q;
26013
+ } else filter_v = filter_v + "1=1";
26014
+ filter_v = filter_v + " )";
26015
+ }
26016
+ } else {
26017
+ // if(obj_filtro.length>0)filter_v= filter_v+' and ';
26018
+ let like_f:string='';
26019
+ let sq: string = "";
26020
+ let include_null_value: boolean = false;
26021
+ if (obj_filtro.values != null)
26022
+ for (let i: number = 0; i < obj_filtro.values.length; i++)
26023
+ if (obj_filtro.values[i] != null) {
26024
+ if (sq != "") sq = sq + ",";
26025
+
26026
+ sq = sq + "'" + obj_filtro.values[i].replace("'", "''") + "'";
26027
+ if (like_f != "") like_f = like_f + " or ";
26028
+ like_f = like_f + " upper(" +
26029
+ key +
26030
+ ") like '%" +
26031
+ obj_filtro.values[i].replace("'", "$'").replace("*", "$*").replace("?", "$?").replace("[", "$[").replace("]", "$]").replace("!", "'$").toUpperCase() +
26032
+ "%' ESCAPE '$'";
26033
+
26034
+ } else {
26035
+ include_null_value = true;
26036
+ }
26037
+ let num_all=-1;
26038
+
26039
+ let countryFilterComponent:ColDef = this.gridOptions.api.getColumnDef(key);
26040
+
26041
+ if(countryFilterComponent!=null)
26042
+ if(countryFilterComponent.filterParams!=null)
26043
+ if(countryFilterComponent.filterParams.values!=null)
26044
+ {
26045
+ let model = countryFilterComponent.filterParams.values;
26046
+ model=model.filter((n, i) => model.indexOf(n) === i);
26047
+
26048
+ if(model!=null)num_all=model.length;
26049
+ }
26050
+ console.log('KEY!!!! ',key);
26051
+ if(key!='pers_int'){
26052
+ if (sq != "" ) {
26053
+ if(obj_filtro.values.length!=num_all){
26054
+ b_filter = true;
26055
+ if (add_end) filter_v = filter_v + " and ";
26056
+ if (!include_null_value) filter_v = filter_v + key + " in (" + sq + ")";
26057
+ else
26058
+ filter_v =
26059
+ filter_v + "(" + key + " in (" + sq + ") or " + key + " is null)";
26060
+ }
26061
+ } else {
26062
+ b_filter = true;
26063
+ if (add_end) filter_v = filter_v + " and ";
26064
+ if (!include_null_value) filter_v = filter_v + " (1=0)";
26065
+ else filter_v = filter_v + " " + key + " is null";
26066
+ }
26067
+ }else
26068
+ {
26069
+ if(like_f!=''){
26070
+ console.log('like_f ',like_f);
26071
+ b_filter = true;
26072
+ if (add_end)filter_v = filter_v + " and ";
26073
+ filter_v = filter_v +"(" + like_f + ")";
26074
+ }
26075
+ }
26076
+ }
26077
+
26078
+ console.log('return filter_v ',filter_v);
26079
+ return filter_v;
26080
+ }*/
26081
+ this.init_end = new EventEmitter();
26082
+ this.off_set = 0;
26083
+ this.first_ref = true;
26084
+ this.b_restored = false;
26085
+ this.str_curr_q_p = "";
26086
+ this.p_fi = {};
26087
+ this.dataSource = {
26088
+ //rowCount: ???, - not setting the row count, infinite paging will be used
26089
+ getRows: (params) => {
26090
+ // this code should contact the server for rows. however for the purposes of the demo,
26091
+ // the data is generated locally, a timer is used to give the experience of
26092
+ // an asynchronous call
26093
+ // console.log('asking for ' + params.startRow + ' to ' + params.endRow);
26094
+ //console.log( params.filterModel);// + ' params.filterModel ' +params.filterModel);
26095
+ this.slimLoadingBarService.start(() => { });
26096
+ let p = { kd: this.tbl_name };
26097
+ // p.table = this.tbl_name;
26098
+ // p.table_count = this.tbl_name;
26099
+ //if (this.count_tbl_name != "") p.table_count = this.count_tbl_name;
26100
+ // console.log(params);
26101
+ p.num_per_pag = params.endRow - params.startRow;
26102
+ // this.gridOptions.paginationPageSize = this.num_per_pag;
26103
+ // this.gridOptions.cacheBlockSize = this.num_per_pag;
26104
+ // console.log(this.gridOptions.cacheBlockSize );
26105
+ // console.log(this.gridOptions.paginationPageSize );
26106
+ p.curr_page = Math.round(params.startRow / p.num_per_pag);
26107
+ if (p.curr_page == null)
26108
+ p.curr_page = 0;
26109
+ if (p.num_per_pag == null)
26110
+ p.num_per_pag = 100;
26111
+ p.system_dest = this.system_dest;
26112
+ p.p = JSON.stringify({ sort_model: params.sortModel, filter_model: params.filterModel, free_search: this.ric_libera });
26113
+ //p.sort_field = this.sort_field;
26114
+ /*
26115
+ if (params.sortModel != null)
26116
+ if (params.sortModel.length > 0) {
26117
+ p.sort_field = "";
26118
+ for (var i: number = 0; i < params.sortModel.length; i++) {
26119
+ if (p.sort_field != "") p.sort_field = p.sort_field + ",";
26120
+ if (params.sortModel[i].colId == "autori")
26121
+ p.sort_field =
26122
+ p.sort_field +
26123
+ "case when CHARINDEX('" +
26124
+ this.m_appService.user +
26125
+ "',autori)>0 then 1 else 0 end" +
26126
+ " " +
26127
+ params.sortModel[i].sort;
26128
+ else
26129
+ p.sort_field =
26130
+ p.sort_field +
26131
+ params.sortModel[i].colId +
26132
+ " " +
26133
+ params.sortModel[i].sort;
26134
+ }
26135
+ }
26136
+
26137
+
26138
+
26139
+
26140
+ if (this.filters != null) p.filter = this.filters;
26141
+
26142
+ if (this.fix_flt != "") {
26143
+ if (p.filter != "") p.filter = p.filter + " and ";
26144
+ p.filter = p.filter + " (" + this.fix_flt + " )";
26145
+ }
26146
+
26147
+ if (this.fix_flt_temp != "") {
26148
+ if (p.filter != "") p.filter = p.filter + " and ";
26149
+ p.filter = p.filter + " (" + this.fix_flt_temp + " )";
26150
+ }
26151
+
26152
+ // console.log('Filter model');
26153
+ //console.log(params.filterModel);
26154
+
26155
+ if (params.filterModel != null) {
26156
+ // console.log('Filtri');
26157
+
26158
+ for (let key in params.filterModel) {
26159
+ // console.log(key);
26160
+ // if (p.hasOwnProperty(key)) {
26161
+ // console.log( params.filterModel[key]);
26162
+ let obj_filtro_test = params.filterModel[key];
26163
+ console.log(params.filterModel[key], key);
26164
+ if (obj_filtro_test.operator == null) {
26165
+ if (p.filter == "")
26166
+ p.filter += this.calcola_filtro(
26167
+ params.filterModel[key],
26168
+ "",
26169
+ key,
26170
+ false
26171
+ );
26172
+ else
26173
+ p.filter += this.calcola_filtro(
26174
+ params.filterModel[key],
26175
+ "",
26176
+ key,
26177
+ true
26178
+ );
26179
+ } else {
26180
+ if (p.filter != "") p.filter += " and ";
26181
+ p.filter += " (";
26182
+ p.filter += this.calcola_filtro(
26183
+ params.filterModel[key].condition1,
26184
+ "",
26185
+ key,
26186
+ false
26187
+ );
26188
+
26189
+ p.filter += " " + obj_filtro_test.operator + " ";
26190
+ p.filter += this.calcola_filtro(
26191
+ params.filterModel[key].condition2,
26192
+ "",
26193
+ key,
26194
+ false
26195
+ );
26196
+
26197
+ p.filter += ")";
26198
+ }
26199
+ // }
26200
+ }
26201
+ }
26202
+
26203
+ (data) => {
26204
+ //p.num_per_pag=5000;
26205
+ // console.log(this._gridservice);
26206
+ this.str_curr_q_p = "";
26207
+ if (p.filter != "") this.str_curr_q_p = "where " + p.filter;
26208
+ if (p.sort_field != "")
26209
+ this.str_curr_q_p = this.str_curr_q_p + " order by " + p.sort_field;
26210
+ this.curr_filter = p.filter;*/
26211
+ //console.log('params.filterModel ',params.filterModel, JSON.stringify(params.filterModel));
26212
+ if ((params.filterModel == null || JSON.stringify(params.filterModel) == '{}') && (this.ric_libera == null || this.ric_libera == ''))
26213
+ this.show_pulisci_filtri = false;
26214
+ else
26215
+ this.show_pulisci_filtri = true;
26216
+ // this._gridservice.url='https://web.raytecvision.com/test/api/dogridn';
26217
+ this.p_fi = { kd: p.kd, system_dest: p.system_dest, p: p.p };
26218
+ this._gridservice.doQuery(p, true, this.m_appService.API_ENDPOINT + 'dogridn').subscribe((data) => {
26219
+ let ok_op = false;
26220
+ if (data != null)
26221
+ if (data.result_msg == "OK") {
26222
+ ok_op = true;
26223
+ // console.log(data.result_data);
26224
+ params.successCallback(data.result_data, data.count);
26225
+ this.b_init = true;
26226
+ this.myData = data.result_data.slice();
26227
+ this.num_r = data.count;
26228
+ this.slimLoadingBarService.complete();
26229
+ this.fill_end.emit();
26230
+ // console.log("end");
26231
+ // console.log(localStorage.getItem(this.grid_key+'_POS'));
26232
+ localStorage.setItem(this.grid_key + "_POS1", JSON.stringify(p));
26233
+ if (localStorage.getItem(this.grid_key + "_POS2") != null)
26234
+ if (this.gridOptions != null)
26235
+ if (this.gridOptions.api != null)
26236
+ this.gridOptions.api.forEachNode((node) => {
26237
+ // console.log(node)
26238
+ if (this.getRowNodeId(node) ===
26239
+ localStorage.getItem(this.grid_key + "_POS2")) {
26240
+ node.setSelected(true);
26241
+ localStorage.removeItem(this.grid_key + "_POS2");
26242
+ if (localStorage.getItem(this.grid_key + "_LAST_ROW") != null)
26243
+ this.sRow = JSON.parse(localStorage.getItem(this.grid_key + "_LAST_ROW"));
26244
+ localStorage.removeItem(this.grid_key + "_LAST_ROW");
26245
+ }
26246
+ });
26247
+ let b_mantieni_ck = false;
26248
+ if (this.toggle_mantieni != null)
26249
+ b_mantieni_ck = this.toggle_mantieni.checked;
26250
+ if (this.no_pref && !this.b_init1) {
26251
+ this.autoSizeAll();
26252
+ }
26253
+ this.b_init1 = true;
26254
+ this.ensure_visible();
26255
+ /*if (localStorage.getItem(this.grid_key + '_COLS')==null && this.first_ref) {
26256
+ setTimeout(() => {
26257
+ this.autoSizeAll();
26258
+ }, 300);
26259
+ this.first_ref = false;
26260
+
26261
+
26262
+ } else*/ if (localStorage.getItem(this.grid_key + "_COLS") == null &&
26263
+ this.autosize_at_ini)
26264
+ setTimeout(() => {
26265
+ this.autoSizeAll();
26266
+ }, 300);
26267
+ //console.log('xxxxxxxxxxxxxxxxxxx');
26268
+ // console.log(this.m_appService.getState().grid_obj[this.grid_key+'_NODE'].id);
26269
+ //if(this.m_appService.getState().grid_obj[this.grid_key+'_NODE']!=null)
26270
+ /*
26271
+
26272
+ this.gridOptions.api.forEachNode( (node) =>{
26273
+ // select the node
26274
+ // console.log(node.id+' '+this.m_appService.getState().grid_obj[this.grid_key+'_NODE'].id);
26275
+ if(node.rowIndex==parseInt(localStorage.getItem(this.grid_key+'_POS'))){
26276
+ // console.log(node.id+' '+this.m_appService.getState().grid_obj[this.grid_key+'_NODE'].id);
26277
+ node.setSelected(true);
26278
+
26279
+ }}*/
26280
+ // if(this.m_appService.getState().grid_obj[this.grid_key+'_NODE']!=null)
26281
+ //this.gridOptions.api.get(parseInt(localStorage.getItem(this.grid_key+'_POS'))).setSelected(true);
26282
+ // console.log(this.myData);
26283
+ }
26284
+ if (!ok_op) {
26285
+ this.errorMsg = data.msg + " [" + data.result_msg + "]";
26286
+ }
26287
+ }, (err) => {
26288
+ this.errorMsg =
26289
+ "ERRORE DI CONNESSIONE CON IL SERVER. RITENTARE PIU' TARDI";
26290
+ });
26291
+ // this.gridOptions.api.setDatasource(this.dataSource);
26292
+ },
26293
+ };
26294
+ this.getContextMenuItems_n_e = () => [
26295
+ "autoSizeAll",
26296
+ "expandAll",
26297
+ "contractAll",
26298
+ "copy",
26299
+ "copyWithHeaders",
26300
+ "paste",
26301
+ ];
26302
+ this.getContextMenuItems_e = () => [
26303
+ "autoSizeAll",
26304
+ "expandAll",
26305
+ "contractAll",
26306
+ "copy",
26307
+ "copyWithHeaders",
26308
+ "paste",
26309
+ // 'resetColumns',
26310
+ {
26311
+ name: "Esporta",
26312
+ action: () => {
26313
+ this.export_excel();
26314
+ },
26315
+ icon: '<img src="assets/icons/square-o/xlsx.svg"/>',
26316
+ },
26317
+ ];
26318
+ this.gridOptions = {
26319
+ debug: false,
26320
+ headerHeight: this.header_h,
26321
+ enableRangeSelection: true,
26322
+ defaultColDef: { resizable: true, sortable: true, floatingFilter: true },
26323
+ allowContextMenuWithControlKey: true,
26324
+ rowModelType: "infinite",
26325
+ localeText: {
26326
+ // for filter panel
26327
+ page: "pagina",
26328
+ more: "altre",
26329
+ to: "a",
26330
+ of: "di",
26331
+ next: "prossima",
26332
+ last: "ultima",
26333
+ first: "prima",
26334
+ previous: "precedente",
26335
+ loadingOoo: "Caricamento...",
26336
+ // for set filter
26337
+ selectAll: "Seleziona Tutto",
26338
+ searchOoo: "Trova...",
26339
+ blanks: "Vuoto",
26340
+ // for number filter and text filter
26341
+ filterOoo: "Filtro...",
26342
+ applyFilter: "Applica Filtro...",
26343
+ // for number filter
26344
+ equals: "Uguale",
26345
+ notEqual: "Diverso",
26346
+ lessThan: "Minore o Uguale",
26347
+ greaterThan: "Maggiore o Uguale",
26348
+ // for text filter
26349
+ notContains: "Non Contiene",
26350
+ contains: "Contiene",
26351
+ startsWith: "Inizia Con",
26352
+ endsWith: "Finisce Con",
26353
+ // the header of the default group column
26354
+ group: "Gruppo",
26355
+ // tool panel
26356
+ columns: "Colonne",
26357
+ rowGroupColumns: "Colonne Pivot",
26358
+ rowGroupColumnsEmptyMessage: "trascina le colonne per raggrupparle",
26359
+ valueColumns: "Colonne Valore",
26360
+ pivotMode: "Modalità Pivot",
26361
+ groups: "Gruppi",
26362
+ values: "Valori",
26363
+ pivots: "Pivots",
26364
+ valueColumnsEmptyMessage: "trascina le colonne per aggreare",
26365
+ pivotColumnsEmptyMessage: "trascina le colonne per pivot",
26366
+ // other
26367
+ noRowsToShow: "nessun dato",
26368
+ // enterprise menu
26369
+ pinColumn: "Sposta Colonna",
26370
+ valueAggregation: "Aggregazione",
26371
+ autosizeThiscolumn: "Autosize colonna",
26372
+ autosizeAllColumns: "Autosize tutte le colonne",
26373
+ groupBy: "Raggruppa per",
26374
+ ungroupBy: "Spacca per",
26375
+ resetColumns: "Resetta queste colonna",
26376
+ expandAll: "Espandi",
26377
+ collapseAll: "Chiudi",
26378
+ toolPanel: "Impostazioni",
26379
+ // enterprise menu pinning
26380
+ pinLeft: "Sposta <<",
26381
+ pinRight: "Sposta >>",
26382
+ noPin: "Sposta <>",
26383
+ // enterprise menu aggregation and status panel
26384
+ sum: "Somma",
26385
+ min: "Minimo",
26386
+ max: "Massimo",
26387
+ none: "Nessuno",
26388
+ count: "Numero",
26389
+ average: "Media",
26390
+ // standard menu
26391
+ copy: "Copia",
26392
+ ctrlC: "ctrl n C",
26393
+ paste: "Incolla",
26394
+ ctrlV: "ctrl n C",
26395
+ },
26396
+ getRowNodeId: function (item) {
26397
+ // console.log(item);
26398
+ if (item.ID != null)
26399
+ return String(item.ID);
26400
+ if (item.id != null)
26401
+ return String(item.id);
26402
+ if (item.uiid != null)
26403
+ return item.uiid;
26404
+ if (item.codice != null)
26405
+ return item.codice;
26406
+ if (item.id_doc != null)
26407
+ return item.id_doc;
26408
+ if (item.notesid != null)
26409
+ return item.notesid;
26410
+ if (item.ord != null)
26411
+ return item.ord;
26412
+ },
26413
+ };
26414
+ this.last_copy = '';
26415
+ this.b_init = false;
26416
+ this.b_init1 = false;
26417
+ this.errorMsg = "";
26418
+ this.innerWidth = 750;
26419
+ this.show_pulisci_filtri = false;
26420
+ this.uiid_stampa = "";
26421
+ this.xxopx = 0;
26422
+ this.num_r = 0;
26423
+ this.ready = false;
26424
+ this.ckk_ed = false;
26425
+ this.myData = new Array();
26426
+ this.b_iniended = false;
26427
+ this.ric_libera = "";
26428
+ this.fix_flt = "";
26429
+ this.fix_flt_temp = "";
26430
+ if (this.m_appService.getState().grid_obj == null)
26431
+ this.m_appService.getState().grid_obj = {};
26432
+ this.browser = this.getBrowserName();
26433
+ if (this.browser == 'ie')
26434
+ this.width_max = '';
26435
+ }
26436
+ getBrowserName() {
26437
+ const agent = window.navigator.userAgent.toLowerCase();
26438
+ switch (true) {
26439
+ case agent.indexOf('edge') > -1:
26440
+ return 'edge';
26441
+ case agent.indexOf('opr') > -1 && !!window.opr:
26442
+ return 'opera';
26443
+ case agent.indexOf('chrome') > -1 && !!window.chrome:
26444
+ return 'chrome';
26445
+ case agent.indexOf('trident') > -1:
26446
+ return 'ie';
26447
+ case agent.indexOf('firefox') > -1:
26448
+ return 'firefox';
26449
+ case agent.indexOf('safari') > -1:
26450
+ return 'safari';
26451
+ default:
26452
+ return 'other';
26453
+ }
26454
+ }
26455
+ docmd(o) {
26456
+ this.command.emit(o);
26457
+ }
26458
+ ensure_visible() {
26459
+ if (this.b_ensure)
26460
+ return;
26461
+ this.b_ensure = true;
26462
+ try {
26463
+ if (localStorage.getItem(this.grid_key + "_POS") != null) {
26464
+ this.gridOptions.api.ensureIndexVisible(parseInt(localStorage.getItem(this.grid_key + "_POS")));
26465
+ localStorage.removeItem(this.grid_key + "_POS");
26466
+ }
26467
+ }
26468
+ catch (e) {
26469
+ console.log(e);
26470
+ }
26471
+ }
26472
+ ck_flag() {
26473
+ if (!this.toggle_mantieni.checked) {
26474
+ localStorage.setItem(this.grid_key + "_MANTIENI", "SI");
26475
+ }
26476
+ else {
26477
+ localStorage.setItem(this.grid_key + "_MANTIENI", "NO");
26478
+ }
26479
+ }
26480
+ refresh_all_rows() {
26481
+ setTimeout(() => {
26482
+ this.gridOptions.api.refreshCells({
26483
+ force: true,
26484
+ });
26485
+ }, 0);
26486
+ }
26487
+ ch_config() {
26488
+ if (this.no_pref)
26489
+ return;
26490
+ this.curr_config = this.gf.getValue();
26491
+ if (this.curr_config == "-1")
26492
+ return;
26493
+ localStorage.removeItem(this.grid_key + "_COLS");
26494
+ // localStorage.removeItem(this.grid_key + "_SORT");
26495
+ localStorage.removeItem(this.grid_key + "_FILTER");
26496
+ localStorage.removeItem(this.grid_key + "_CFG_DEFAULT");
26497
+ localStorage.removeItem(this.grid_key + "_FILTER_UP");
26498
+ if (this.gf.getObj().COL != null)
26499
+ if (this.gf.getObj().COL != "")
26500
+ localStorage.setItem(this.grid_key + "_COLS", this.gf.getObj().COL);
26501
+ // if (this.gf.getObj().SORT != null)
26502
+ // if (this.gf.getObj().SORT != "")
26503
+ // localStorage.setItem(this.grid_key + "_SORT", this.gf.getObj().SORT);
26504
+ if (this.gf.getObj().FILTER != null)
26505
+ if (this.gf.getObj().FILTER != "")
26506
+ localStorage.setItem(this.grid_key + "_FILTER", this.gf.getObj().FILTER);
26507
+ if (this.gf.getDescri() != null)
26508
+ if (this.gf.getDescri() != "-1")
26509
+ localStorage.setItem(this.grid_key + "_CFG_DEFAULT", this.gf.getDescri());
26510
+ this.curr_config = this.gf.getValue();
26511
+ this.res_columns(true);
26512
+ }
26513
+ elimina_config() {
26514
+ if (this.gf.getObj().username != null)
26515
+ if (this.m_appService.user != this.gf.getObj().username) {
26516
+ this._toast.error("Configurazione gestibile da: " + this.gf.getObj().username);
26517
+ return;
26518
+ }
26519
+ localStorage.setItem(this.m_appService.COMPANY_KEY + "title_dialog", "Conferma Operazione");
26520
+ localStorage.setItem(this.m_appService.COMPANY_KEY + "msg_dialog", "Confermi di voler cancellare la configurazione " +
26521
+ this.gf.getDescri() +
26522
+ "?");
26523
+ let dialogRef = this.m_dialog.open(fh_win_confirm, {
26524
+ disableClose: true,
26525
+ });
26526
+ dialogRef.afterClosed().subscribe((result) => {
26527
+ if (result) {
26528
+ let p = new QParam();
26529
+ p.sql = "DELETE_CFG_GRID";
26530
+ p.types = ["string", "string"];
26531
+ p.values = [this.gf.getDescri(), this.grid_key];
26532
+ let ok_op = false;
26533
+ this._dataService.doQuery(p).subscribe((data) => {
26534
+ let ok_op = false;
26535
+ if (data != null)
26536
+ if (data.result_msg == "OK") {
26537
+ this._toast.info("Configurazione eliminata");
26538
+ this.gf.types = ["string"];
26539
+ this.gf.values = [this.grid_key];
26540
+ this.gf.fillCombo();
26541
+ this.curr_config = "-1";
26542
+ }
26543
+ });
26544
+ }
26545
+ });
26546
+ }
26547
+ edit_config() {
26548
+ if (this.gf.getObj().username != null)
26549
+ if (this.m_appService.user != this.gf.getObj().username) {
26550
+ this._toast.error("Configurazione gestibile da: " + this.gf.getObj().username);
26551
+ return;
26552
+ }
26553
+ localStorage.setItem(this.m_appService.COMPANY_KEY + "title_dialog", "Conferma Operazione");
26554
+ localStorage.setItem(this.m_appService.COMPANY_KEY + "msg_dialog", "Confermi di voler sovrascrivere la configurazione " +
26555
+ this.gf.getDescri() +
26556
+ "?");
26557
+ let dialogRef = this.m_dialog.open(fh_win_confirm, {
26558
+ disableClose: true,
26559
+ });
26560
+ dialogRef.afterClosed().subscribe((result) => {
26561
+ if (result) {
26562
+ let p = new QParam();
26563
+ p.sql = "INSERT_UPDATE_CFG_GRID";
26564
+ let p_col = "";
26565
+ // let p_sort: string = "";
26566
+ let p_filter = "";
26567
+ if (localStorage.getItem(this.grid_key + "_COLS") != null)
26568
+ p_col = localStorage.getItem(this.grid_key + "_COLS");
26569
+ // if (localStorage.getItem(this.grid_key + "_SORT") != null)
26570
+ // p_sort = localStorage.getItem(this.grid_key + "_SORT");
26571
+ if (localStorage.getItem(this.grid_key + "_FILTER") != null)
26572
+ p_filter = localStorage.getItem(this.grid_key + "_FILTER");
26573
+ p.types = ["string", "string", "string", "string", "string", "string"];
26574
+ p.values = [
26575
+ this.gf.getDescri(),
26576
+ this.grid_key,
26577
+ p_col,
26578
+ '',
26579
+ p_filter,
26580
+ this.m_appService.user,
26581
+ ];
26582
+ let ok_op = false;
26583
+ this._dataService.doQuery(p).subscribe((data) => {
26584
+ let ok_op = false;
26585
+ if (data != null)
26586
+ if (data.result_msg == "OK") {
26587
+ this._toast.info("Configurazione salvata");
26588
+ this.gf.types = ["string"];
26589
+ this.gf.values = [this.grid_key];
26590
+ this.gf.fillCombo();
26591
+ this.curr_config = "-1";
26592
+ }
26593
+ if (!ok_op) {
26594
+ }
26595
+ }, (err) => { });
26596
+ }
26597
+ });
26598
+ }
26599
+ refresh_access(wkfx) {
26600
+ this.toolbar_wkfapp = wkfx;
26601
+ }
26602
+ getGridApi() {
26603
+ return this.gridOptions.api;
26604
+ }
26605
+ getGridOptions() {
26606
+ return this.gridOptions;
26607
+ }
26608
+ insert_config() {
26609
+ this.win_opt = this.m_dialog.open(fh_win_ask_text, {
26610
+ disableClose: true,
26611
+ });
26612
+ setTimeout(() => {
26613
+ this.win_opt.componentInstance.title = "Salva Configurazione";
26614
+ this.win_opt.componentInstance.label = "Nome";
26615
+ });
26616
+ this.win_opt.afterClosed().subscribe((result) => {
26617
+ if (result)
26618
+ if (result != null) {
26619
+ let p = new QParam();
26620
+ p.sql = "INSERT_UPDATE_CFG_GRID";
26621
+ let p_col = "";
26622
+ // let p_sort: string = "";
26623
+ let p_filter = "";
26624
+ if (localStorage.getItem(this.grid_key + "_COLS") != null)
26625
+ p_col = localStorage.getItem(this.grid_key + "_COLS");
26626
+ // if (localStorage.getItem(this.grid_key + "_SORT") != null)
26627
+ // p_sort = localStorage.getItem(this.grid_key + "_SORT");
26628
+ if (localStorage.getItem(this.grid_key + "_FILTER") != null)
26629
+ p_filter = localStorage.getItem(this.grid_key + "_FILTER");
26630
+ p.types = [
26631
+ "string",
26632
+ "string",
26633
+ "string",
26634
+ "string",
26635
+ "string",
26636
+ "string",
26637
+ ];
26638
+ p.values = [
26639
+ result,
26640
+ this.grid_key,
26641
+ p_col,
26642
+ '',
26643
+ p_filter,
26644
+ this.m_appService.user,
26645
+ ];
26646
+ let ok_op = false;
26647
+ this._dataService.doQuery(p).subscribe((data) => {
26648
+ let ok_op = false;
26649
+ if (data != null)
26650
+ if (data.result_msg == "OK") {
26651
+ this._toast.info("Configurazione salvata");
26652
+ ok_op = true;
26653
+ this.gf.types = ["string"];
26654
+ this.gf.values = [this.grid_key];
26655
+ this.gf.fillCombo();
26656
+ }
26657
+ if (!ok_op) {
26658
+ }
26659
+ }, (err) => { });
26660
+ }
26661
+ });
26662
+ }
26663
+ onBtExport() {
26664
+ this.export_excel();
26665
+ /*
26666
+ var params = {
26667
+ skipHeader: false,
26668
+ columnGroups: false,
26669
+ skipFooters: true,
26670
+ skipGroups: true,
26671
+ skipPinnedTop: true,
26672
+ skipPinnedBottom: true,
26673
+ allColumns: true,
26674
+ onlySelected: false,
26675
+ suppressQuotes: false,
26676
+ processCellCallback: (params) => {
26677
+ if (params.value) {
26678
+ // console.log(params.value);
26679
+ if (params.value == null) return '';
26680
+ if (typeof params.value.getMonth === 'function') {
26681
+
26682
+ return this.uti_s.pad(params.value.getDate(), 2) + '/' + this.uti_s.pad(params.value.getMonth() + 1, 2) + '/' + params.value.getFullYear();
26683
+ } else if (params.value.length == 24 && params.value.indexOf(':00.000Z') > -1) {
26684
+ // console.log( new Date(params.value));
26685
+ let arrdt: Date = new Date(params.value);
26686
+
26687
+ // let arrdt2=arrdt[1].split(':');
26688
+ return this.uti_s.pad(arrdt.getDate(), 2) + '/' + this.uti_s.pad(arrdt.getMonth() + 1, 2) + '/' + arrdt.getFullYear() + ' ' + this.uti_s.pad(arrdt.getHours(), 2) + ':' + this.uti_s.pad(arrdt.getMinutes(), 2);
26689
+
26690
+
26691
+ }
26692
+ else
26693
+ return params.value;
26694
+ }
26695
+
26696
+ }
26697
+ }
26698
+
26699
+ this.gridOptions.api.exportDataAsExcel(params);*/
26700
+ }
26701
+ export_excel(type = 'excel') {
26702
+ this.dialogRef_W = this.m_dialog.open(fh_win_wait, {
26703
+ disableClose: true,
26704
+ });
26705
+ setTimeout(() => {
26706
+ this.dialogRef_W.componentInstance.label = "EXPORT IN CORSO";
26707
+ });
26708
+ // this._toast.info('da implementare lato server');
26709
+ this.p_fi.type = type;
26710
+ this.p_fi.uiid_stampa = this.uti_s.newGuid();
26711
+ this.uiid_stampa = this.p_fi.uiid_stampa;
26712
+ this._gridservice.doQuery(this.p_fi, true, this.m_appService.API_ENDPOINT + 'doexportn').subscribe((data) => {
26713
+ this.check_end(type == 'pdf' ? '.pdf' : '.xlsx');
26714
+ });
26715
+ }
26716
+ check_end(format) {
26717
+ let p = new FSInput();
26718
+ p.p1 =
26719
+ this.m_appService.LOCAL_PATH +
26720
+ "grid_reports\\" +
26721
+ this.uiid_stampa +
26722
+ "_" +
26723
+ this.m_appService.user +
26724
+ format;
26725
+ p.command = "check_file";
26726
+ this._fileService.doQuery(p).subscribe((data) => {
26727
+ if (data != null)
26728
+ if (data.msg == "N") {
26729
+ setTimeout(() => {
26730
+ this.check_end(format);
26731
+ }, 1000);
26732
+ }
26733
+ else {
26734
+ setTimeout(() => {
26735
+ this.dialogRef_W.componentInstance.update_progess(100);
26736
+ });
26737
+ window.open(this.m_appService.COMPANY_SITE_ROOT +
26738
+ "/grid_reports/" +
26739
+ this.uiid_stampa +
26740
+ "_" +
26741
+ this.m_appService.user +
26742
+ format);
26743
+ }
26744
+ });
26745
+ }
26746
+ setHeaderHeight(n) {
26747
+ this.header_h = n;
26748
+ this.gridOptions.api.setHeaderHeight(this.header_h);
26749
+ this.gridOptions.suppressCopyRowsToClipboard = true;
26750
+ this.gridOptions.sendToClipboard = (v) => {
26751
+ console.log('v ', v);
26752
+ if (this.enable_copy)
26753
+ this.gridApi.copySelectedRangeToClipboard();
26754
+ {
26755
+ this.clipboard.copy(v.data.split('\n')[0]);
26756
+ }
26757
+ };
26758
+ }
26759
+ getRowNodeId(item) {
26760
+ // console.log(item);
26761
+ if (item == null)
26762
+ return this.uti_s.newGuid();
26763
+ if (item.data == null)
26764
+ return this.uti_s.newGuid();
26765
+ if (item.data.id != null)
26766
+ return String(item.data.id);
26767
+ if (item.data.uiid != null)
26768
+ return item.data.uiid;
26769
+ if (item.data.codice != null)
26770
+ return item.data.codice;
26771
+ return "NA";
26772
+ }
26773
+ ngAfterViewInit() {
26774
+ if (this.grid_key == "PRO_H")
26775
+ this.no_pref = true;
26776
+ setTimeout(() => {
26777
+ if (this.end_point == null)
26778
+ this.end_point =
26779
+ this.m_appService.API_ENDPOINT + this.m_appService.GRID_ENDPOINT;
26780
+ if (localStorage.getItem(this.grid_key + "_FILTER_UP") != null)
26781
+ this.ric_libera = localStorage.getItem(this.grid_key + "_FILTER_UP");
26782
+ this.onResize();
26783
+ });
26784
+ }
26785
+ okr(event) {
26786
+ //console.log(event.column.colDef.field);
26787
+ event.data.nome_colonna = event.column.colDef.field;
26788
+ this.cell_edited.emit(event.data);
26789
+ }
26790
+ help_window() {
26791
+ let dialogRef = this.m_dialog.open(win_grid_help, { disableClose: true });
26792
+ dialogRef.afterClosed().subscribe((result) => {
26793
+ return;
26794
+ });
26795
+ }
26796
+ onResize(event) {
26797
+ return;
26798
+ // console.log("auto height "+this.auto_height+ "("+bodyWidth+")");
26799
+ //if(bodyWidth>1400){
26800
+ // this.g_height= Number(this.m_appService.getState().body_height.split('px').join(''))-40-this.off_set+'px';
26801
+ //console.log('this.g_height '+this.g_height);
26802
+ //if(this.m_appService.getState( ).mobile)this.g_height=Number(this.m_appService.getState().body_height.split('px').join(''))-40+'px';
26803
+ // this.num_per_pag=Math.round((700-50-this.off_set)/50);
26804
+ //}
26805
+ //else
26806
+ //if(bodyWidth>800){
26807
+ //this.g_height=520-this.off_set+'px';
26808
+ // this.num_per_pag=Math.round((520-50-this.off_set)/50);
26809
+ //}
26810
+ //else{
26811
+ //this.g_height=400-this.off_set+'px';
26812
+ // this.num_per_pag=Math.round((400-50-this.off_set)/50);
26813
+ //}
26814
+ // console.log( this.g_height);
26815
+ }
26816
+ autoSizeAll() {
26817
+ if (this.gridOptions == null)
26818
+ return;
26819
+ if (this.gridOptions.columnApi == null)
26820
+ return;
26821
+ let allColumnIds = [];
26822
+ this.gridOptions.columnApi.getAllGridColumns().map((v) => {
26823
+ allColumnIds.push(v.getColId());
26824
+ });
26825
+ this.gridOptions.columnApi.autoSizeColumns(allColumnIds);
26826
+ if (this.gridOptions.columnApi.getColumnState().length > 0)
26827
+ if (this.gridOptions.columnApi.getColumnState()[0].width == 24) {
26828
+ setTimeout(() => {
26829
+ this.autoSizeAll();
26830
+ }, 300);
26831
+ return;
26832
+ }
26833
+ this.save_cfg();
26834
+ }
26835
+ fitSizeAll() {
26836
+ // console.log("fitSizeAll");
26837
+ this.gridOptions.api.sizeColumnsToFit();
26838
+ this.save_cfg();
26839
+ }
26840
+ selectCount() {
26841
+ let i = 0;
26842
+ this.gridOptions.api.forEachNode((node) => {
26843
+ if (node.isSelected())
26844
+ i++;
26845
+ });
26846
+ return i;
26847
+ }
26848
+ getquerySelected(f, t) {
26849
+ let s = "";
26850
+ if (t == "String") {
26851
+ this.gridOptions.api.forEachNode((node) => {
26852
+ if (node.isSelected())
26853
+ if (node.data[f] != null) {
26854
+ if (s != "")
26855
+ s = s + ",";
26856
+ s = s + "'" + node.data[f] + "'";
26857
+ }
26858
+ });
26859
+ }
26860
+ // console.log('ENTRO '+f+" "+t);
26861
+ if (t == "Number") {
26862
+ // console.log('CERCO SEL');
26863
+ this.gridOptions.api.forEachNode((node) => {
26864
+ if (node.isSelected())
26865
+ if (node.data[f] != null) {
26866
+ // console.log('selected');
26867
+ if (s != "")
26868
+ s = s + ",";
26869
+ s = s + node.data[f];
26870
+ }
26871
+ });
26872
+ }
26873
+ return s;
26874
+ }
26875
+ selectAllFiltered() {
26876
+ this.gridOptions.api.forEachNode((node) => {
26877
+ this.gridOptions.api.selectNode(node, true);
26878
+ });
26879
+ }
26880
+ deselectAllFiltered() {
26881
+ this.gridOptions.api.forEachNode((node) => {
26882
+ this.gridOptions.api.selectNode(node, false);
26883
+ });
26884
+ }
26885
+ pulisci_filtri(resetr = true) {
26886
+ localStorage.removeItem(this.grid_key + "_FILTER");
26887
+ if (resetr) {
26888
+ if (this.ric_libera != "")
26889
+ this.doFill("", true, false);
26890
+ this.ric_libera = "";
26891
+ localStorage.removeItem(this.grid_key + "_FILTER_UP");
26892
+ }
26893
+ this.fix_flt_temp = "";
26894
+ this.gridOptions.api.setFilterModel(null);
26895
+ let filtrtm = {}; /*
26896
+ this.columnDefs.map((v)=>{
26897
+ if(v.filter=='agSetColumnFilter'){
26898
+ filtrtm[v.field]={type:'set',values:[]}
26899
+ }
26900
+ });*/
26901
+ this.gridOptions.api.setFilterModel(filtrtm);
26902
+ }
26903
+ /*
26904
+ public export_excel(format: string = "xlsx") {
26905
+ if(this.custom_export){
26906
+ this.command.emit({ cmd: "export_excel",v:format });
26907
+ return;}
26908
+ if (this.num_r > 15000) {
26909
+ this._toast.error("Massimo 15000 elementi esportabili");
26910
+ return;
26911
+ }
26912
+ format = "." + format;
26913
+
26914
+ this.uiid_stampa = this.uti_s.newGuid();
26915
+ this.xxopx = 0;
26916
+ let q: string = "";
26917
+ this.dialogRef_W = this.m_dialog.open(fh_win_wait, {
26918
+ disableClose: true,
26919
+ });
26920
+ setTimeout(() => {
26921
+ this.dialogRef_W.componentInstance.label = "EXPORT IN CORSO";
26922
+ });
26923
+ let cmds: Array<any> = [];
26924
+
26925
+ let str_fields = "";
26926
+ let p_col = this.gridOptions.columnApi.getAllDisplayedColumns();
26927
+
26928
+ for (let j = 0; j < p_col.length; j++) {
26929
+ if (str_fields != "") str_fields += ",";
26930
+ if (p_col[j].getColDef().headerName == null)
26931
+ str_fields += "[" + p_col[j].getColDef().field + "]";
26932
+ else if (p_col[j].getColDef().headerName == "")
26933
+ str_fields += "[" + p_col[j].getColDef().field + "]";
26934
+ else
26935
+ str_fields +=
26936
+ "[" +
26937
+ p_col[j].getColDef().field +
26938
+ "] [" +
26939
+ p_col[j].getColDef().headerName.split('[').join('').split(']').join('') +
26940
+ "]";
26941
+ }
26942
+ if (this.fields.indexOf("DISTINCT") != -1)
26943
+ str_fields = "DISTINCT " + str_fields;
26944
+ cmds.push(
26945
+ this.officeService.operation(
26946
+ "GB_XLS_APRI",
26947
+ "tpl_report.xlsx",
26948
+ "" + this.uiid_stampa + ".xlsx",
26949
+ this.xxopx++
26950
+ )
26951
+ );
26952
+ let opx:string='GB_CREA_TABELLA_FROM_DB';
26953
+ if(this.system_dest==2)opx='GB_CREA_TABELLA_FROM_DB1';
26954
+ if(this.export_field_aggiuntivi=='')
26955
+ cmds.push(
26956
+ this.officeService.operation(
26957
+ opx,
26958
+ "select " +
26959
+ str_fields+
26960
+ " from " +
26961
+ this.tbl_name +
26962
+ " " +
26963
+ this.str_curr_q_p,
26964
+ "3",
26965
+ this.xxopx++
26966
+ )
26967
+ );
26968
+ else
26969
+ cmds.push(
26970
+ this.officeService.operation(
26971
+ opx,
26972
+ "select " +
26973
+ str_fields +','+this.export_field_aggiuntivi+
26974
+ " from " +
26975
+ this.tbl_name +
26976
+ " " +
26977
+ this.str_curr_q_p,
26978
+ "3",
26979
+ this.xxopx++
26980
+ )
26981
+ );
26982
+ cmds.push(
26983
+ this.officeService.operation(
26984
+ "GB_XLS_SAVE",
26985
+ this.m_appService.LOCAL_PATH +
26986
+ "grid_reports\\" +
26987
+ this.uiid_stampa +
26988
+ "_" +
26989
+ this.m_appService.user +
26990
+ format,
26991
+ "",
26992
+ this.xxopx++
26993
+ )
26994
+ );
26995
+
26996
+ this.officeService
26997
+ .runCommands(this.uiid_stampa, cmds, this.dialogRef_W,false)
26998
+ .subscribe((data) => {
26999
+ this.check_end(format);
27000
+ });
27001
+ }
27002
+ check_end(format){
27003
+
27004
+
27005
+ let p: FSInput = new FSInput();
27006
+ p.p1 =
27007
+ this.m_appService.LOCAL_PATH +
27008
+ "grid_reports\\" +
27009
+ this.uiid_stampa +
27010
+ "_" +
27011
+ this.m_appService.user +
27012
+ format;
27013
+ p.command = "check_file";
27014
+ this._fileService.doQuery(p).subscribe((data) => {
27015
+ if (data != null)
27016
+ if (data.msg == "N") {
27017
+ setTimeout(() => {
27018
+ this.check_end(format);
27019
+ },5000);
27020
+ } else {
27021
+ setTimeout(() => {
27022
+ this.dialogRef_W.componentInstance.update_progess(100);
27023
+ });
27024
+ window.open(
27025
+ this.m_appService.COMPANY_SITE_ROOT +
27026
+ "/grid_reports/" +
27027
+ this.uiid_stampa +
27028
+ "_" +
27029
+ this.m_appService.user +
27030
+ format
27031
+ );
27032
+ }
27033
+ });
27034
+
27035
+ }
27036
+
27037
+ */
27038
+ print() {
27039
+ if (this.custom_export)
27040
+ this.command.emit({ cmd: "print_pdf" });
27041
+ else
27042
+ this.export_excel('pdf');
27043
+ }
27044
+ init_conf() {
27045
+ // console.log(" init_conf()");
27046
+ //this.ckk();
27047
+ }
27048
+ createColumnDefs(em) { }
27049
+ ckk() {
27050
+ if (!this.auto_load)
27051
+ return;
27052
+ if (this.columnDefs == null) {
27053
+ setTimeout(() => {
27054
+ this.ckk();
27055
+ }, 500);
27056
+ return;
27057
+ }
27058
+ if (this.columnDefs.length == 0) {
27059
+ setTimeout(() => {
27060
+ this.ckk();
27061
+ }, 500);
27062
+ return;
27063
+ }
27064
+ if (this.ckk_ed)
27065
+ return;
27066
+ this.ckk_ed = true;
27067
+ if (this.toggle_mantieni != null) {
27068
+ this.toggle_mantieni.checked = true;
27069
+ if (localStorage.getItem(this.grid_key + "_MANTIENI") != null)
27070
+ if (localStorage.getItem(this.grid_key + "_MANTIENI") == "NO") {
27071
+ this.toggle_mantieni.checked = false;
27072
+ }
27073
+ }
27074
+ this.res_columns();
27075
+ if (localStorage.getItem(this.grid_key + "_POS") != null)
27076
+ this.b_restored = true;
27077
+ if (localStorage.getItem(this.grid_key + "_FILTER_UP") != null)
27078
+ if (localStorage.getItem(this.grid_key + "_FILTER_UP") != "") {
27079
+ this.ric_libera = localStorage.getItem(this.grid_key + "_FILTER_UP");
27080
+ let arr = this.ric_libera.split(" ");
27081
+ let arr_F = new Array();
27082
+ for (let i = 0; i < arr.length; i++)
27083
+ arr_F.push(arr[i]);
27084
+ //if (arr[i].length > 2)
27085
+ //else
27086
+ // this._toast.error("ignorato termine: " + arr[i] + " troppo corto");
27087
+ if (arr_F.length == 0)
27088
+ return;
27089
+ let ss = "";
27090
+ for (let i = 0; i < arr_F.length; i++) {
27091
+ let ss_r = "";
27092
+ for (let y = 0; y < this.columnDefs.length; y++) {
27093
+ if (this.columnDefs[y] != null)
27094
+ if (this.columnDefs[y].no_filter == null)
27095
+ if (this.columnDefs[y].field != null)
27096
+ if (this.columnDefs[y].field != "")
27097
+ if (this.columnDefs[y].filter != "agDateColumnFilter") {
27098
+ if (ss_r != "")
27099
+ ss_r += " or ";
27100
+ ss_r +=
27101
+ this.columnDefs[y].field +
27102
+ " LIKE '%" +
27103
+ this.uti_s.string_sqlvalue(arr_F[i]).replace("'", "$'").replace("*", "$*").replace("?", "$?").replace("[", "$[").replace("]", "$]").replace("!", "'$").toUpperCase() +
27104
+ "%' ESCAPE '$'";
27105
+ }
27106
+ }
27107
+ if (this.full_text_added_columns != null)
27108
+ this.full_text_added_columns.map((v) => {
27109
+ if (v != null)
27110
+ if (v != '') {
27111
+ if (ss_r != "")
27112
+ ss_r += " or ";
27113
+ ss_r +=
27114
+ v +
27115
+ " LIKE '%" +
27116
+ this.uti_s.string_sqlvalue(arr_F[i]).replace("'", "$'").replace("*", "$*").replace("?", "$?").replace("[", "$[").replace("]", "$]").replace("!", "'$").toUpperCase() +
27117
+ "%' ESCAPE '$'";
27118
+ }
27119
+ });
27120
+ if (ss_r != '') {
27121
+ if (ss != "")
27122
+ ss += " and ";
27123
+ ss += '(' + ss_r + ')';
27124
+ }
27125
+ }
27126
+ this.fix_flt_temp = ss;
27127
+ }
27128
+ if (this.init_fill) {
27129
+ setTimeout(() => {
27130
+ this.ref_dt();
27131
+ }, 100);
27132
+ }
27133
+ // this.createNewDatasource();
27134
+ /*
27135
+ if(this.m_appService.getState().grid_obj[this.grid_key+'_startPage']!=null)
27136
+ {
27137
+ //console.log('setto pag: '+this.m_appService.getState().grid_obj[this.grid_key+'_startPage']);
27138
+ this.gridOptions.api.paginationGoToPage(this.m_appService.getState().grid_obj[this.grid_key+'_startPage']);
27139
+ } */
27140
+ }
27141
+ set_init_size() {
27142
+ if (this.myData.length == 0) {
27143
+ setTimeout(() => { this.set_init_size(); }, 500);
27144
+ return;
27145
+ }
27146
+ if (this.columnDefs.length <= 6)
27147
+ this.fitSizeAll();
27148
+ else
27149
+ this.autoSizeAll();
27150
+ }
27151
+ res_columns(forza = false) {
27152
+ if (this.columnDefs == null) {
27153
+ setTimeout(() => {
27154
+ this.res_columns(forza);
27155
+ }, 200);
27156
+ return;
27157
+ }
27158
+ if (this.columnDefs.length == 0) {
27159
+ setTimeout(() => {
27160
+ this.res_columns(forza);
27161
+ }, 200);
27162
+ return;
27163
+ }
27164
+ let b_mantieni_ck = false;
27165
+ let b_rip = false;
27166
+ if (this.toggle_mantieni != null)
27167
+ b_mantieni_ck = this.toggle_mantieni.checked;
27168
+ if (localStorage.getItem(this.grid_key + "_COLS") == null ||
27169
+ localStorage.getItem(this.grid_key + "_COLS") == "") {
27170
+ this.set_init_size();
27171
+ return;
27172
+ }
27173
+ if (localStorage.getItem(this.grid_key + "_COLS") != null &&
27174
+ (b_mantieni_ck || forza))
27175
+ if (localStorage.getItem(this.grid_key + "_COLS") != "") {
27176
+ b_rip = true;
27177
+ try {
27178
+ let a = JSON.parse(localStorage.getItem(this.grid_key + "_COLS"));
27179
+ let annulla = true;
27180
+ for (let i = 0; i < a.length; i++) {
27181
+ if (!a[i].hide)
27182
+ annulla = false;
27183
+ }
27184
+ if (annulla)
27185
+ localStorage.getItem(this.grid_key + "_COLS");
27186
+ else
27187
+ this.gridOptions.columnApi.setColumnState(JSON.parse(localStorage.getItem(this.grid_key + "_COLS")));
27188
+ }
27189
+ catch (eer) {
27190
+ console.log(eer);
27191
+ }
27192
+ }
27193
+ /* try {
27194
+ this.gridOptions.api.setSortModel(null);
27195
+ } catch (eer) {
27196
+ console.log(eer);
27197
+ }
27198
+ if (
27199
+ localStorage.getItem(this.grid_key + "_SORT") != null &&
27200
+ (b_mantieni_ck || forza)
27201
+ )
27202
+ if (localStorage.getItem(this.grid_key + "_SORT") != "") {
27203
+ // console.log('setto sort: '+localStorage.getItem(this.grid_key+'_SORT'));
27204
+ // console.log(localStorage.getItem(this.grid_key+'_SORT'));
27205
+ try {
27206
+ this.gridOptions.api.setSortModel(
27207
+ JSON.parse(localStorage.getItem(this.grid_key + "_SORT"))
27208
+ );
27209
+ } catch (eer) {
27210
+ console.log(eer);
27211
+ }
27212
+ }
27213
+ try {
27214
+ this.gridOptions.api.setFilterModel(null);
27215
+ } catch (eer) {
27216
+ console.log(eer);
27217
+ }*/
27218
+ if (localStorage.getItem(this.grid_key + "_FILTER") != null &&
27219
+ (b_mantieni_ck || forza))
27220
+ if (localStorage.getItem(this.grid_key + "_FILTER") != "") {
27221
+ try {
27222
+ this.gridOptions.api.setFilterModel(JSON.parse(localStorage.getItem(this.grid_key + "_FILTER")));
27223
+ }
27224
+ catch (eer) {
27225
+ console.log(eer);
27226
+ }
27227
+ }
27228
+ }
27229
+ getRows() {
27230
+ return this.gridOptions.rowData;
27231
+ }
27232
+ sortAndFilter(sortModel, filterModel) {
27233
+ // return sortData(sortModel, filterData(filterModel, allOfTheData))
27234
+ }
27235
+ ref_dt() {
27236
+ if (this.gridOptions == null)
27237
+ setTimeout(() => {
27238
+ this.ref_dt();
27239
+ }, 500);
27240
+ else {
27241
+ if (this.gridOptions.api == null)
27242
+ setTimeout(() => {
27243
+ this.ref_dt();
27244
+ }, 500);
27245
+ else
27246
+ this.gridOptions.api.setDatasource(this.dataSource);
27247
+ }
27248
+ }
27249
+ updateRow() {
27250
+ this.refresh_all_rows();
27251
+ }
27252
+ onModelUpdated() {
27253
+ // console.log('onModelUpdated');
27254
+ // this.calculateRowCount();
27255
+ }
27256
+ onReady(event) {
27257
+ // console.log(this.header_h);
27258
+ this.gridApi = event.api;
27259
+ this.setHeaderHeight(this.header_h);
27260
+ if (this.gf != null && this.show_buttons && !this.pref_hidden) {
27261
+ this.gf.sql = "SELECT_CFG_GRID";
27262
+ this.gf.types = ["string"];
27263
+ this.gf.values = [this.grid_key];
27264
+ this.gf.fillCombo();
27265
+ if (localStorage.getItem(this.grid_key + "_MANTIENI") != "NO")
27266
+ if (localStorage.getItem(this.grid_key + "_CFG_DEFAULT") != null) {
27267
+ return;
27268
+ }
27269
+ }
27270
+ // let iOS = /iPad|iPhone|iPod/.test(navigator.userAgent);
27271
+ // if(!iOS)this.setAutoHeight();
27272
+ if (this.auto_load)
27273
+ this.onready_go();
27274
+ }
27275
+ init_grid() {
27276
+ this.auto_load = true;
27277
+ this.onready_go();
27278
+ }
27279
+ save_cfg() {
27280
+ localStorage.setItem(this.grid_key + "_COLS", JSON.stringify(this.gridOptions.columnApi.getColumnState()));
27281
+ }
27282
+ fe_cfg() {
27283
+ if (this.gf != null)
27284
+ if (this.gf.getObj() != null)
27285
+ if (localStorage.getItem(this.grid_key + "_MANTIENI") != "NO") {
27286
+ this.gf.setByDescri(localStorage.getItem(this.grid_key + "_CFG_DEFAULT"));
27287
+ localStorage.setItem(this.grid_key + "_COLS", this.gf.getObj().COLS);
27288
+ // localStorage.setItem(this.grid_key + "_SORT", this.gf.getObj().SORT);
27289
+ localStorage.setItem(this.grid_key + "_FILTER", this.gf.getObj().FILTER);
27290
+ this.curr_config = this.gf.getValue();
27291
+ }
27292
+ this.onready_go();
27293
+ }
27294
+ onready_go() {
27295
+ this.ready = true;
27296
+ //console.log('onready_go');
27297
+ setTimeout(() => {
27298
+ this.ckk();
27299
+ }, 10);
27300
+ if (!this.b_iniended) {
27301
+ this.b_iniended = true;
27302
+ this.init_end.emit();
27303
+ }
27304
+ }
27305
+ init_filters() {
27306
+ //this.createNewDatasource();
27307
+ }
27308
+ keyDownFunctioncl(event) {
27309
+ if (event.keyCode == 13) {
27310
+ this.free_search();
27311
+ }
27312
+ }
27313
+ free_search() {
27314
+ if (this.ric_libera == "") {
27315
+ this.pulisci_filtri();
27316
+ this.fix_flt_temp = "";
27317
+ this.doFill("", true, false);
27318
+ localStorage.removeItem(this.grid_key + "_FILTER_UP");
27319
+ return;
27320
+ }
27321
+ localStorage.setItem(this.grid_key + "_FILTER_UP", this.ric_libera);
27322
+ let arr = this.ric_libera.split(" ");
27323
+ let arr_F = new Array();
27324
+ for (let i = 0; i < arr.length; i++)
27325
+ arr_F.push(arr[i]);
27326
+ // if (arr[i].length > 2)
27327
+ // else this._toast.error("ignorato termine: " + arr[i] + " troppo corto");
27328
+ if (arr_F.length == 0)
27329
+ return;
27330
+ let ss = "";
27331
+ for (let i = 0; i < arr_F.length; i++) {
27332
+ let ss_r = "";
27333
+ for (let y = 0; y < this.columnDefs.length; y++) {
27334
+ if (this.columnDefs[y] != null)
27335
+ if (this.columnDefs[y].no_filter == null)
27336
+ if (this.columnDefs[y].field != null)
27337
+ if (this.columnDefs[y].field != "")
27338
+ if (this.columnDefs[y].filter != "agDateColumnFilter") {
27339
+ if (ss_r != "")
27340
+ ss_r += " or ";
27341
+ ss_r +=
27342
+ this.columnDefs[y].field +
27343
+ " LIKE '%" +
27344
+ this.uti_s.string_sqlvalue(arr_F[i]).replace("'", "$'").replace("*", "$*").replace("?", "$?").replace("[", "$[").replace("]", "$]").replace("!", "'$").toUpperCase() +
27345
+ "%' ESCAPE '$'";
27346
+ }
27347
+ }
27348
+ if (this.full_text_added_columns != null)
27349
+ this.full_text_added_columns.map((v) => {
27350
+ if (v != null)
27351
+ if (v != '') {
27352
+ if (ss_r != "")
27353
+ ss_r += " or ";
27354
+ ss_r +=
27355
+ v +
27356
+ " LIKE '%" +
27357
+ this.uti_s.string_sqlvalue(arr_F[i]).replace("'", "$'").replace("*", "$*").replace("?", "$?").replace("[", "$[").replace("]", "$]").replace("!", "'$").toUpperCase() +
27358
+ "%' ESCAPE '$'";
27359
+ }
27360
+ });
27361
+ if (ss_r != '') {
27362
+ console.log('ADDO '), ss_r;
27363
+ if (ss != "")
27364
+ ss += " and ";
27365
+ ss += '(' + ss_r + ')';
27366
+ }
27367
+ }
27368
+ this.pulisci_filtri(false);
27369
+ this.doFill_Temp(ss, true);
27370
+ }
27371
+ onCellClicked(event) {
27372
+ // console.log(event.rowIndex + ' ' + event.colDef.field);
27373
+ this.cell_clicked.emit(event);
27374
+ // console.log(this.myModalNormal);
27375
+ // this.testom.element.nativeElement.value=event.data.descrizione;
27376
+ // this.testom.element.nativeElement.scrollTop =0;
27377
+ //this.testom.element.nativeElement.focus();
27378
+ //this.testom.element.nativeElement.setSelectionRange(0, 0);
27379
+ // this.myModalNormal.element.nativeElement.show();
27380
+ }
27381
+ onCellValueChanged(event) {
27382
+ // console.log('onCellValueChanged: ' + event.oldValue + ' to ' + event.newValue);
27383
+ }
27384
+ onCellDoubleClicked(event) {
27385
+ // console.log('onCellDoubleClicked: ' + event.rowIndex + ' ' + event.colDef.field);
27386
+ }
27387
+ onCellFocused(event) {
27388
+ //console.log('onCellFocused: (' + event.rowIndex + ',' + event.colIndex + ')');
27389
+ }
27390
+ onSelectionChanged() {
27391
+ // console.log('selectionChanged');
27392
+ }
27393
+ onBeforeFilterChanged() {
27394
+ // console.log('beforeFilterChanged');
27395
+ }
27396
+ oncolumnEverythingChanged(event) {
27397
+ // console.log('oncolumnEverythingChanged');
27398
+ if (this.b_init) {
27399
+ // console.log('salvo f: '+JSON.stringify(this.gridOptions.columnApi.getColumnState()));
27400
+ localStorage.setItem(this.grid_key + "_COLS", JSON.stringify(this.gridOptions.columnApi.getColumnState()));
27401
+ }
27402
+ }
27403
+ onFilterModified() {
27404
+ if (this.no_pref)
27405
+ return;
27406
+ setTimeout(() => {
27407
+ if (this.b_init) {
27408
+ localStorage.setItem(this.grid_key + "_FILTER", JSON.stringify(this.gridOptions.api.getFilterModel()));
27409
+ }
27410
+ }, 200);
27411
+ }
27412
+ onBeforeSortChanged() {
27413
+ // console.log('onBeforeSortChanged');
27414
+ }
27415
+ onAfterSortChanged() {
27416
+ // console.log('onAfterSortChanged');
27417
+ if (this.no_pref)
27418
+ return;
27419
+ if (this.b_init) {
27420
+ localStorage.setItem(this.grid_key + "_COLS", JSON.stringify(this.gridOptions.columnApi.getColumnState()));
27421
+ // console.log('salvo s: '+this.gridOptions.api.getSortModel());
27422
+ /*
27423
+
27424
+ localStorage.setItem(
27425
+ this.grid_key + "_SORT",
27426
+ JSON.stringify(this.gridOptions.api.getSortModel())
27427
+ );*/
27428
+ }
27429
+ }
27430
+ onVirtualRowRemoved($event) {
27431
+ // because this event gets fired LOTS of times, we don't print it to the
27432
+ // console. if you want to see it, just uncomment out this line
27433
+ // console.log('onVirtualRowRemoved: ' + event.rowIndex);
27434
+ }
27435
+ onRowClicked($event) {
27436
+ //console.log('onRowClicked: ' );
27437
+ var selectedInGrid = this.gridOptions.api.getSelectedNodes();
27438
+ if (selectedInGrid != null)
27439
+ if (selectedInGrid[0] != null) {
27440
+ // console.log((this.gridOptions.api.getVerticalPixelRange()));
27441
+ localStorage.setItem(this.grid_key + "_POS", String(selectedInGrid[0].rowIndex));
27442
+ localStorage.setItem(this.grid_key + "_POS_BAR", JSON.stringify(this.gridOptions.api.getVerticalPixelRange()));
27443
+ localStorage.setItem(this.grid_key + "_POS2", this.getRowNodeId(selectedInGrid[0]));
27444
+ // this.m_appService.getState().grid_obj=new Object();
27445
+ // this.m_appService.getState().grid_obj[this.grid_key+'_NODE']=this.gridOptions.api.getSelectedRows[0];
27446
+ }
27447
+ this.sRow = $event.data;
27448
+ localStorage.setItem(this.grid_key + "_LAST_ROW", JSON.stringify(this.sRow));
27449
+ this.clicked.emit($event.data);
27450
+ var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent);
27451
+ if (iOS) {
27452
+ this.columndclicked.emit($event);
27453
+ this.dclicked.emit($event.data);
27454
+ }
27455
+ }
27456
+ onRowDClicked($event) {
27457
+ //console.log('onRowClicked: ' );
27458
+ //console.log(event);
27459
+ this.dclicked.emit($event.data);
27460
+ var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent);
27461
+ if (iOS) {
27462
+ this.columndclicked.emit($event);
27463
+ //this.dclicked.emit($event.data);
27464
+ }
27465
+ }
27466
+ onQuickFilterChanged($event) {
27467
+ this.gridOptions.api.setQuickFilter($event.target.value);
27468
+ }
27469
+ // here we use one generic event to handle all the column type events.
27470
+ // the method just prints the event name
27471
+ onColumnEvent($event) {
27472
+ this.columndclicked.emit($event);
27473
+ // console.log('onColumnEvent: ' + $event);
27474
+ // localStorage.setItem(this.grid_key+'_COLUMN',JSON.stringify(this.gridOptions.api.getColumnDef()));
27475
+ }
27476
+ doFill(flt, reset_prec = true, over_fixed = true) {
27477
+ // if (reset_prec) this.filters = "";
27478
+ if (over_fixed)
27479
+ this.fix_flt = flt;
27480
+ this.ckk_ed = false;
27481
+ // this.createNewDatasource();
27482
+ this.b_init = true;
27483
+ this.init_fill = true;
27484
+ //this.createNewDatasource();
27485
+ setTimeout(() => {
27486
+ this.ckk();
27487
+ }, 10);
27488
+ }
27489
+ doFill_Temp(flt, reset_prec = true) {
27490
+ //if (reset_prec) this.filters = "";
27491
+ this.fix_flt_temp = flt;
27492
+ this.ckk_ed = false;
27493
+ // this.createNewDatasource();
27494
+ this.b_init = true;
27495
+ this.init_fill = true;
27496
+ //this.createNewDatasource();
27497
+ setTimeout(() => {
27498
+ this.Refresh();
27499
+ }, 10);
27500
+ }
27501
+ Refresh() {
27502
+ this.ref_dt();
27503
+ }
27504
+ RefreshOnlyMemory() {
27505
+ this.updateRow();
27506
+ }
27507
+ }
27508
+ FHGridComponentN.decorators = [
27509
+ { type: Component, args: [{
27510
+ selector: "FHGridN",
27511
+ template: "<div fxLayout=\"column\" fxFlexFill>\n <div\n fxLayout=\"row\"\n fxLayout.xs=\"column\"\n fxLayoutAlign=\"center start\"\n fxLayoutGap=\"3px\"\n style=\"min-height: 55px;\"\n [hidden]=\"!show_buttons\"\n >\n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <div fxLayout=\"row\" fxLayoutGap=\"3px\" fxLayoutAlign=\"start center\">\n <div>\n <h5>{{num_r}}&nbsp;{{label_elementi}}</h5>\n </div>\n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <input\n matInput\n [placeholder]=\"trova_label\"\n (keydown)=\"keyDownFunctioncl($event)\"\n [(ngModel)]=\"ric_libera\"\n style=\"\n width: 200px;\n border: 1px solid;\n min-height: 30px;\n \"\n />\n </div>\n\n <div\n matTooltip=\"REMOVE FILTER\"\n matTooltipPosition=\"above\"\n *ngIf=\"show_pulisci_filtri\"\n >\n <button mat-flat-button (click)=\"pulisci_filtri()\" color=\"warn\">\n <mat-icon>filter_none</mat-icon>&nbsp;\n </button>\n </div>\n <div matTooltip=\"AUTO SIZE\" matTooltipPosition=\"above\">\n <button\n mat-flat-button\n (click)=\"autoSizeAll()\"\n color=\"accent\"\n *ngIf=\"show_buttons\"\n >\n <mat-icon>swap_horiz</mat-icon>\n </button>\n </div>\n <div fxHide fxShow.gt-sm matTooltip=\"FIT SIZE\" matTooltipPosition=\"above\">\n <button\n mat-flat-button\n (click)=\"fitSizeAll()\"\n color=\"accent\"\n *ngIf=\"show_buttons\"\n >\n <mat-icon>keyboard_tab</mat-icon>\n </button>\n </div>\n <div fxHide fxShow.gt-sm matTooltip=\"Refresh\" matTooltipPosition=\"above\">\n <button\n mat-flat-button\n (click)=\"Refresh()\"\n color=\"accent\"\n *ngIf=\"show_buttons\"\n >\n <mat-icon>autorenew</mat-icon>\n </button>\n </div>\n <FHFilterComboBox\n fxHide\n fxShow.gt-sm\n [hidden]=\"!show_buttons || pref_hidden\"\n (selchange)=\"ch_config()\"\n (fillend)=\"fe_cfg()\"\n #gf\n init_fill=\"false\"\n ></FHFilterComboBox>\n <div\n matTooltip=\"Modifica Preferenza\"\n matTooltipPosition=\"above\"\n *ngIf=\"curr_config!='-1'\"\n >\n <button\n mat-icon-button\n *ngIf=\"show_buttons && !pref_hidden\"\n style=\"color: rgb(248, 105, 10);\"\n >\n <mat-icon (click)=\"edit_config()\">save</mat-icon>\n </button>\n </div>\n <div\n matTooltip=\"Elimina Preferenza\"\n matTooltipPosition=\"above\"\n *ngIf=\"curr_config!='-1'\"\n >\n <button\n mat-icon-button\n *ngIf=\"show_buttons && !pref_hidden\"\n style=\"color: rgb(248, 105, 10);\"\n >\n <mat-icon (click)=\"elimina_config()\">delete</mat-icon>\n </button>\n </div>\n <div\n fxHide\n fxShow.gt-sm\n matTooltip=\"Crea Nuova Preferenza\"\n matTooltipPosition=\"above\"\n >\n <button\n mat-icon-button\n style=\"color: rgb(16, 98, 16);\"\n *ngIf=\"show_buttons && !pref_hidden\"\n >\n <mat-icon (click)=\"insert_config()\">library_add</mat-icon>\n </button>\n </div>\n\n <mat-slide-toggle\n fxHide\n fxShow.gt-sm\n [hidden]=\"!show_buttons || pref_hidden\"\n (click)=\"ck_flag()\"\n #toggle_mantieni\n >\n {{mantieni_impostazioni}}\n </mat-slide-toggle>\n\n &nbsp;\n <div fxHide fxShow.gt-sm matTooltip=\"HELP\" matTooltipPosition=\"above\">\n <button\n mat-flat-button\n (click)=\"help_window()\"\n color=\"primary\"\n *ngIf=\"show_buttons && show_help\"\n >\n <mat-icon>help</mat-icon>\n </button>\n </div>\n &nbsp;&nbsp;&nbsp;&nbsp;\n\n <img\n *ngIf=\"enable_export && enable_export_pdf\"\n matTooltip=\"EXPORT PDF\"\n matTooltipPosition=\"above\"\n src=\"assets/icons/square-o/pdf.svg\"\n style=\"width: 24px; height: 24px; cursor: pointer\"\n (click)=\"print()\"\n alt=\"Export PDF\"\n width=\"24\" height=\"24\"\n />\n\n\n <img *ngIf=\"enable_export && enable_export_xls\"\n matTooltip=\"EXPORT EXCEL\"\n matTooltipPosition=\"above\"\n src=\"assets/icons/square-o/xlsx.svg\"\n style=\"width: 24px; height: 24px; cursor: pointer\"\n (click)=\"export_excel()\"\n alt=\"Export Excel\"\n width=\"24\" height=\"24\"\n />\n\n </div>\n <div\n fxLayout=\"row\"\n fxLayoutAlign=\"end center\"\n\n [style.width]=\"width_max\"\n *ngIf=\"enabled\"\n >\n\n <FHGridToolBar\n (command)=\"docmd($event)\"\n [type]=\"toolbar_type\"\n [show_link]=\"show_link\"\n [show_help]=\"show_help_bar\"\n [help_label]=\"help_label_bar\"\n [custom_commands]=\"toolbar_custom_commands\"\n [toolbar_wkfapp]=\"toolbar_wkfapp\"\n [elimina_label]=\"elimina_label\"\n [sRow]=\"sRow\"\n ></FHGridToolBar>\n </div>\n </div>\n\n\n <div fxLayout=\"row\" style=\"width: 100%;\" [fxFlex]=\"show_buttons ? 100:95\">\n <ag-grid-angular\n ref-agGrid\n style=\"width: 100%; height: 100%;\"\n id=\"myGrid\"\n (cellDoubleClicked)=\"onColumnEvent($event)\"\n (cellClicked)=\"onCellClicked($event)\"\n [headerHeight]=\"header_h\"\n [groupHeaderHeight]=\"header_h\"\n class=\"ag-theme-balham\"\n [singleClickEdit]=\"true\"\n [gridOptions]=\"gridOptions\"\n [columnDefs]=\"columnDefs\"\n [rowData]=\"rowData\"\n [rowSelection]=\"selection_mode\"\n [tooltipShowDelay]=\"tooltipShowDelay\"\n [getContextMenuItems]=\"enable_export ? getContextMenuItems_e:getContextMenuItems_n_e\"\n (filterModified)=\"onFilterModified()\"\n (rowDoubleClicked)=\"onRowDClicked($event)\"\n (rowClicked)=\"onRowClicked($event)\"\n (columnVisible)=\"oncolumnEverythingChanged($event)\"\n (columnResized)=\"oncolumnEverythingChanged($event)\"\n (columnMoved)=\"oncolumnEverythingChanged($event)\"\n (cellValueChanged)=\"okr($event)\"\n (sortChanged)=\"onAfterSortChanged()\"\n [paginationPageSize]=\"num_per_pag\"\n (gridReady)=\"onReady($event)\"\n >\n </ag-grid-angular>\n </div>\n</div>\n",
27512
+ styles: [``]
27513
+ },] }
27514
+ ];
27515
+ FHGridComponentN.ctorParameters = () => [
27516
+ { type: GridService },
27517
+ { type: ToastrService },
27518
+ { type: QueryService },
27519
+ { type: AppService },
27520
+ { type: SlimLoadingBarService },
27521
+ { type: MatDialog },
27522
+ { type: UtilityService },
27523
+ { type: FileService },
27524
+ { type: Clipboard }
27525
+ ];
27526
+ FHGridComponentN.propDecorators = {
27527
+ tooltipShowDelay: [{ type: Input }],
27528
+ elimina_label: [{ type: Input }],
27529
+ export_field_aggiuntivi: [{ type: Input }],
27530
+ end_point: [{ type: Input }],
27531
+ tbl_name: [{ type: Input }],
27532
+ columnDefs: [{ type: Input }],
27533
+ num_per_pag: [{ type: Input }],
27534
+ grid_key: [{ type: Input }],
27535
+ enabled: [{ type: Input }],
27536
+ show_link: [{ type: Input }],
27537
+ show_help_bar: [{ type: Input }],
27538
+ help_label_bar: [{ type: Input }],
27539
+ auto_load: [{ type: Input }],
27540
+ auto_height: [{ type: Input }],
27541
+ enable_export: [{ type: Input }],
27542
+ enabled_pag: [{ type: Input }],
27543
+ show_help: [{ type: Input }],
27544
+ show_num_elem: [{ type: Input }],
27545
+ system_dest: [{ type: Input }],
27546
+ header_h: [{ type: Input }],
27547
+ selection_mode: [{ type: Input }],
27548
+ init_fill: [{ type: Input }],
27549
+ no_pref: [{ type: Input }],
27550
+ pref_hidden: [{ type: Input }],
27551
+ enable_export_pdf: [{ type: Input }],
27552
+ enable_export_xls: [{ type: Input }],
27553
+ enable_copy: [{ type: Input }],
27554
+ full_text_added_columns: [{ type: Input }],
27555
+ autosize_at_ini: [{ type: Input }],
27556
+ label_elementi: [{ type: Input }],
27557
+ trova_label: [{ type: Input }],
27558
+ mantieni_impostazioni: [{ type: Input }],
27559
+ show_buttons: [{ type: Input }],
27560
+ fill_end: [{ type: Output }],
27561
+ cell_edited: [{ type: Output }],
27562
+ clicked: [{ type: Output }],
27563
+ dclicked: [{ type: Output }],
27564
+ columndclicked: [{ type: Output }],
27565
+ cell_clicked: [{ type: Output }],
27566
+ custom_export: [{ type: Input }],
27567
+ toolbar_type: [{ type: Input }],
27568
+ toolbar_wkfapp: [{ type: Input }],
27569
+ toolbar_custom_commands: [{ type: Input }],
27570
+ command: [{ type: Output }],
27571
+ gf: [{ type: ViewChild, args: ["gf",] }],
27572
+ toggle_mantieni: [{ type: ViewChild, args: ["toggle_mantieni",] }],
27573
+ init_end: [{ type: Output }],
27574
+ off_set: [{ type: Input }],
27575
+ onResize: [{ type: HostListener, args: ["window:resize", ["event"],] }]
27576
+ };
27577
+
25769
27578
  class FluxhubLibModule {
25770
27579
  static forRoot() {
25771
27580
  return {
@@ -25865,6 +27674,7 @@ FluxhubLibModule.decorators = [
25865
27674
  FHUploadPanelComponent,
25866
27675
  FHUploadComponent,
25867
27676
  FHGridComponent,
27677
+ FHGridComponentN,
25868
27678
  FHComboboxComponent,
25869
27679
  fh_win_confirm,
25870
27680
  FHAutoCompleteComponent,
@@ -25933,6 +27743,7 @@ FluxhubLibModule.decorators = [
25933
27743
  FHUploadComponent,
25934
27744
  wkf_header_bar,
25935
27745
  FHGridComponent,
27746
+ FHGridComponentN,
25936
27747
  FHComboboxComponent,
25937
27748
  fh_win_confirm,
25938
27749
  FHAutoCompleteComponent,
@@ -26996,5 +28807,5 @@ wkfapp_v2.ctorParameters = () => [
26996
28807
  * Generated bundle index. Do not edit.
26997
28808
  */
26998
28809
 
26999
- export { AppMakerService, AppService, ApprovaGridComponent, AuthenticationService, CheckboxEditorComponent, ComboBoxEditor, CurrencyComponent, FHAutoCompleteComponent, FHCheckBox, FHComboboxComponent, FHConfirmValues, FHCurrencyFormatterDirective, FHCurrencyPipe, FHDatePickerComponent, FHFieldPickListComponent, FHFormToolBarComponent, FHGridComponent, FHGridJSONComponent, FHGuard, FHListComponent, FHLogPanelComponent, FHMdReader, FHNumericFieldComponent, FHPickFieldComponent, FHRichText, FHRoleManager, FHTableManager, FHTextArea, FHTextInput, FHTimePickerComponent, FHUploadComponent, FHUploadPanelComponent, FHUploadPanelS3Component, FHUploadS3Component, FHUserFieldComponent, FSInput, FSResult, FileService, FluxhubLibModule, FormBuilderComponent, FormExecuterComponent, GridService, LocalDBService, NumericEditorComponent, OdbcService, OfficeAutomatorService, QGParam, QGResult, QParam, QResult, QueryService, ReplaceLineBreaks, TextAreaEditor, UtilityService, WkfService, dati_aggiuntivi, dati_aggiuntivi_v2, fh_win_app_logs, fh_win_ask_big_text, fh_win_ask_buttons, fh_win_ask_number, fh_win_ask_richtext, fh_win_ask_text, fh_win_auto_complete, fh_win_combo, fh_win_confirm, fh_win_list, fh_win_mappa, fh_win_output, fh_win_picklist, fh_win_show_email, fh_win_show_email_s3, fh_win_show_image, fh_win_show_log, fh_win_show_log_dett, fh_win_time_slider, fh_win_uploads, fh_win_user_info, fh_win_user_picker, fh_win_wait, fhimagepreview, win_insert_commento, win_salva_annulla, wkf_header_bar, wkf_header_bar_v2, wkfapp, wkfapp_v2, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$1 as ɵa, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$3 as ɵb, win_log_v2 as ɵba, win_recupera_doc_v2 as ɵbb, win_riassegna_select_level_v2 as ɵbc, win_riassegna_select_user_v2 as ɵbd, win_sostituisci_utente_v2 as ɵbe, win_commento_sel_notif_v2 as ɵbf, win_insert_commento_v2 as ɵbg, win_show_log_info_dett as ɵbh, FHViewerComponent as ɵbi, FHGridToolBarComponent as ɵbk, win_assegna as ɵbl, win_conferma as ɵbm, win_select_canale as ɵbn, win_select_level as ɵbo, win_commenti as ɵbp, win_info_doc as ɵbq, win_log as ɵbr, win_recupera_doc as ɵbs, win_riassegna_select_level as ɵbt, win_riassegna_select_user as ɵbu, win_sostituisci_utente as ɵbv, win_commento_sel_notif as ɵbw, win_manage_values as ɵbx, win_manage_roles as ɵby, FHComboboxComponentFilter as ɵbz, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$8 as ɵc, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$5 as ɵd, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR as ɵe, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$6 as ɵf, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR_NUMERIC as ɵg, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR_RT as ɵh, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$4 as ɵi, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$2 as ɵj, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$7 as ɵk, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$9 as ɵl, FHHelpButton as ɵm, SafePipe as ɵn, MOMENT_DATE_FORMATS as ɵo, MomentDateAdapter as ɵp, win_grid_help as ɵq, HighlightService as ɵr, win_salva_annulla_v2 as ɵs, win_assegna_v2 as ɵt, win_conferma_v2 as ɵu, win_select_canale_v2 as ɵv, win_select_level_v2 as ɵw, win_uploads_v2 as ɵx, win_commenti_v2 as ɵy, win_info_doc_v2 as ɵz };
28810
+ export { AppMakerService, AppService, ApprovaGridComponent, AuthenticationService, CheckboxEditorComponent, ComboBoxEditor, CurrencyComponent, FHAutoCompleteComponent, FHCheckBox, FHComboboxComponent, FHConfirmValues, FHCurrencyFormatterDirective, FHCurrencyPipe, FHDatePickerComponent, FHFieldPickListComponent, FHFormToolBarComponent, FHGridComponent, FHGridComponentN, FHGridJSONComponent, FHGuard, FHListComponent, FHLogPanelComponent, FHMdReader, FHNumericFieldComponent, FHPickFieldComponent, FHRichText, FHRoleManager, FHTableManager, FHTextArea, FHTextInput, FHTimePickerComponent, FHUploadComponent, FHUploadPanelComponent, FHUploadPanelS3Component, FHUploadS3Component, FHUserFieldComponent, FSInput, FSResult, FileService, FluxhubLibModule, FormBuilderComponent, FormExecuterComponent, GridService, LocalDBService, NumericEditorComponent, OdbcService, OfficeAutomatorService, QGParam, QGResult, QParam, QResult, QueryService, ReplaceLineBreaks, TextAreaEditor, UtilityService, WkfService, dati_aggiuntivi, dati_aggiuntivi_v2, fh_win_app_logs, fh_win_ask_big_text, fh_win_ask_buttons, fh_win_ask_number, fh_win_ask_richtext, fh_win_ask_text, fh_win_auto_complete, fh_win_combo, fh_win_confirm, fh_win_list, fh_win_mappa, fh_win_output, fh_win_picklist, fh_win_show_email, fh_win_show_email_s3, fh_win_show_image, fh_win_show_log, fh_win_show_log_dett, fh_win_time_slider, fh_win_uploads, fh_win_user_info, fh_win_user_picker, fh_win_wait, fhimagepreview, win_insert_commento, win_salva_annulla, wkf_header_bar, wkf_header_bar_v2, wkfapp, wkfapp_v2, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$1 as ɵa, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$3 as ɵb, win_log_v2 as ɵba, win_recupera_doc_v2 as ɵbb, win_riassegna_select_level_v2 as ɵbc, win_riassegna_select_user_v2 as ɵbd, win_sostituisci_utente_v2 as ɵbe, win_commento_sel_notif_v2 as ɵbf, win_insert_commento_v2 as ɵbg, win_show_log_info_dett as ɵbh, FHViewerComponent as ɵbi, FHGridToolBarComponent as ɵbk, win_assegna as ɵbl, win_conferma as ɵbm, win_select_canale as ɵbn, win_select_level as ɵbo, win_commenti as ɵbp, win_info_doc as ɵbq, win_log as ɵbr, win_recupera_doc as ɵbs, win_riassegna_select_level as ɵbt, win_riassegna_select_user as ɵbu, win_sostituisci_utente as ɵbv, win_commento_sel_notif as ɵbw, win_manage_values as ɵbx, win_manage_roles as ɵby, FHComboboxComponentFilter as ɵbz, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$8 as ɵc, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$5 as ɵd, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR as ɵe, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$6 as ɵf, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR_NUMERIC as ɵg, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR_RT as ɵh, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$4 as ɵi, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$2 as ɵj, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$7 as ɵk, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$9 as ɵl, FHHelpButton as ɵm, SafePipe as ɵn, MOMENT_DATE_FORMATS as ɵo, MomentDateAdapter as ɵp, win_grid_help as ɵq, HighlightService as ɵr, win_salva_annulla_v2 as ɵs, win_assegna_v2 as ɵt, win_conferma_v2 as ɵu, win_select_canale_v2 as ɵv, win_select_level_v2 as ɵw, win_uploads_v2 as ɵx, win_commenti_v2 as ɵy, win_info_doc_v2 as ɵz };
27000
28811
  //# sourceMappingURL=fluxhub-fluxhub-lib.js.map