@fluxhub/fluxhub-lib 1.0.575 → 1.0.576

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.
@@ -12875,206 +12875,18 @@
12875
12875
  */
12876
12876
  var win_uploads = /** @class */ (function () {
12877
12877
  function win_uploads(dialogRef, _dataService, toastr, dialog, app_s) {
12878
- var _this = this;
12879
12878
  this.dialogRef = dialogRef;
12880
12879
  this._dataService = _dataService;
12881
12880
  this.toastr = toastr;
12882
12881
  this.dialog = dialog;
12883
12882
  this.app_s = app_s;
12884
12883
  this.enabled = true;
12885
- this.change = new core.EventEmitter();
12886
12884
  this.access_control = true;
12887
12885
  this.App = '';
12888
12886
  this.K = '';
12889
- this.b_edit_loaded = false;
12890
12887
  this.title = "ALLEGATI";
12891
- this.b_ini = false;
12892
12888
  this.sovrascrivi_path = '';
12893
- this.single = true;
12894
- this.descrizione = '';
12895
- this.label = 'Descrizione Allegato';
12896
- this.username = '';
12897
- this.uploader = new ng2FileUpload.FileUploader({
12898
- url: this.app_s.API_ENDPOINT + this.app_s.UPLOAD_ENDPOINT
12899
- });
12900
- this.username = this.app_s.user;
12901
- this.uploader.onBeforeUploadItem = (/**
12902
- * @param {?} item
12903
- * @return {?}
12904
- */
12905
- function (item) {
12906
- item.withCredentials = false;
12907
- });
12908
- this.uploader.onCompleteItem = (/**
12909
- * @param {?} item
12910
- * @param {?} response
12911
- * @param {?} status
12912
- * @param {?} header
12913
- * @return {?}
12914
- */
12915
- function (item, response, status, header) {
12916
- if (status === 200) {
12917
- _this.descrizione = "";
12918
- _this
12919
- .toastr
12920
- .info("INFO", "ALLEGATO INSERITO", {
12921
- timeOut: 1000,
12922
- progressBar: true
12923
- });
12924
- _this.ref_allegato();
12925
- _this
12926
- .change
12927
- .emit();
12928
- }
12929
- });
12930
12889
  }
12931
- /**
12932
- * @param {?} ax
12933
- * @return {?}
12934
- */
12935
- win_uploads.prototype.download_all = /**
12936
- * @param {?} ax
12937
- * @return {?}
12938
- */
12939
- function (ax) {
12940
- if (ax.APP != null)
12941
- ax.App = ax.APP;
12942
- if (this.sovrascrivi_path == '')
12943
- window.open(this.app_s.COMPANY_SITE_ROOT + '/uploads/' + ax.App + '/' + ax.K + '/' + ax.Filename);
12944
- else
12945
- window.open(this.sovrascrivi_path + '/uploads/' + ax.App + '/' + ax.K + '/' + ax.Filename);
12946
- };
12947
- /**
12948
- * @param {?} ax
12949
- * @return {?}
12950
- */
12951
- win_uploads.prototype.delete = /**
12952
- * @param {?} ax
12953
- * @return {?}
12954
- */
12955
- function (ax) {
12956
- var _this = this;
12957
- localStorage.setItem(this.app_s.COMPANY_KEY + "title_dialog", 'Conferma Operazione');
12958
- localStorage.setItem(this.app_s.COMPANY_KEY + "msg_dialog", "Confermi l'eliminazione dell'elemento?");
12959
- /** @type {?} */
12960
- var dialogRef1 = this
12961
- .dialog
12962
- .open(FHConfirmComponent);
12963
- dialogRef1
12964
- .afterClosed()
12965
- .subscribe((/**
12966
- * @param {?} result
12967
- * @return {?}
12968
- */
12969
- function (result) {
12970
- if (result) {
12971
- /** @type {?} */
12972
- var p = new QParam();
12973
- p.sql = "DELETE_ALLEGATO";
12974
- p.types = ['int', 'string'];
12975
- p.values = [ax.id, _this.app_s.user];
12976
- _this
12977
- ._dataService
12978
- .doQuery(p)
12979
- .subscribe((/**
12980
- * @param {?} data
12981
- * @return {?}
12982
- */
12983
- function (data) {
12984
- if (data != null)
12985
- if (data.result_msg == "OK") {
12986
- _this.arr_g = data.result_data;
12987
- _this.ref_allegato();
12988
- _this
12989
- .toastr
12990
- .info("INFO", "ALLEGATO ELIMINATO", {
12991
- timeOut: 1000,
12992
- progressBar: true
12993
- });
12994
- }
12995
- }));
12996
- }
12997
- }));
12998
- };
12999
- /**
13000
- * @param {?} fileItem
13001
- * @return {?}
13002
- */
13003
- win_uploads.prototype.ch = /**
13004
- * @param {?} fileItem
13005
- * @return {?}
13006
- */
13007
- function (fileItem) {
13008
- var _this = this;
13009
- for (var i = 0; i < this.arr_g.length; i++) {
13010
- if (this.arr_g[i].Filename.toLowerCase() == fileItem.file.name.toLowerCase()) {
13011
- this.toastr.error('File già presente (cancellarlo per aggiornarlo)');
13012
- return;
13013
- }
13014
- }
13015
- this.uploader.onBuildItemForm = (/**
13016
- * @param {?} item
13017
- * @param {?} form
13018
- * @return {?}
13019
- */
13020
- function (item, form) {
13021
- form.append('App', _this.App);
13022
- form.append('K', _this.K);
13023
- form.append('descrizione', _this.descrizione);
13024
- form.append('single', _this.single);
13025
- form.append('username', _this.username);
13026
- form.append('tipo', '');
13027
- form.append('local_path', _this.app_s.LOCAL_PATH);
13028
- });
13029
- /** @type {?} */
13030
- var uo = {};
13031
- uo.headers = [{ name: 'Authorization', value: 'Bearer ' + localStorage.getItem(this.app_s.COMPANY_KEY + "token") }];
13032
- this.uploader.setOptions(uo);
13033
- this
13034
- .uploader
13035
- .uploadAll();
13036
- };
13037
- /**
13038
- * @return {?}
13039
- */
13040
- win_uploads.prototype.ref_allegato = /**
13041
- * @return {?}
13042
- */
13043
- function () {
13044
- var _this = this;
13045
- if (this.App == null)
13046
- return;
13047
- if (this.App == "")
13048
- return;
13049
- /** @type {?} */
13050
- var p = new QParam();
13051
- p.sql = "SELECT_ALLEGATO_INFO";
13052
- p.types = ['string', 'string'];
13053
- p.values = [this.App, this.K];
13054
- this
13055
- ._dataService
13056
- .doQuery(p)
13057
- .subscribe((/**
13058
- * @param {?} data
13059
- * @return {?}
13060
- */
13061
- function (data) {
13062
- if (data != null)
13063
- if (data.result_msg == "OK") {
13064
- _this.arr_g = data.result_data;
13065
- /** @type {?} */
13066
- var iconf = "webinfo";
13067
- for (var i = 0; i < _this.arr_g.length; i++) {
13068
- /** @type {?} */
13069
- var arrf = _this.arr_g[i].Filename.split('.');
13070
- if ('3G2|3GA|3GP|7Z|AA|AAC|AC|ACCDB|ACCDT|ADN|AI|AIF|AIFC|AIFF|AIT|AMR|ANI|APK|APP|APPLESCRIPT|ASAX|ASC|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PYC|QT|RA|RAM|RAR|RAW|RB|RDF|RESX|RETRY|RM|ROM|RPM|RSA|RSS|RTF|RU|RUB|SASS|SCSS|SDF|SED|SH|SITEMAP|SKIN|SLDM|SLDX|SLN|SOL|SQL|SQLITE|STEP|STL|SVG|SWD|SWF|SWIFT|SYS|TAR|TCSH|TEX|TFIGNORE|TGA|TGZ|TIF|TIFF|TMP|TORRENT|TS|TSV|TTF|TWIG|TXT|UDF|VB|VBPROJ|VBS|VCD|VCS|VDI|VDX|VMDK|VOB|VSCODEIGNORE|VSD|VSS|VST|VSX|VTX|WAR|WAV|WBK|WEBINFO|WEBM|WEBP|WMA|WMF|WMV|WOFF|WOFF2|WPS|WSF|XAML|XCF|XLM|XLS|XLSM|XLSX|XLT|XLTM|XLTX|XML|XPI|XPS|XRB|XSD|XSL|XSPF|XZ|YAML|YML|Z|ZIP|ZSH'.indexOf(arrf[arrf.length - 1].toLocaleUpperCase()) != -1)
13071
- iconf = arrf[arrf.length - 1].toLocaleLowerCase();
13072
- _this.arr_g[i].icon = iconf + '.svg';
13073
- _this.arr_g[i].can_delete = !_this.access_control || _this.arr_g[i].idp == _this.app_s.user;
13074
- }
13075
- }
13076
- }));
13077
- };
13078
12890
  /**
13079
12891
  * @return {?}
13080
12892
  */
@@ -13082,19 +12894,9 @@
13082
12894
  * @return {?}
13083
12895
  */
13084
12896
  function () {
13085
- var _this = this;
13086
12897
  this.App = this.app_s.getState().wkf_doc_info.uiid_app;
13087
12898
  this.K = this.app_s.getState().wkf_doc_info.uiid_doc;
13088
- this.single = false;
13089
- this.uploader.onAfterAddingFile = (/**
13090
- * @param {?} fileItem
13091
- * @return {?}
13092
- */
13093
- function (fileItem) {
13094
- _this.ch(fileItem);
13095
- });
13096
12899
  this.init(this.App, this.K);
13097
- this.ref_allegato();
13098
12900
  };
13099
12901
  /**
13100
12902
  * @param {?} p_app
@@ -13109,15 +12911,12 @@
13109
12911
  function (p_app, p_k) {
13110
12912
  this.App = p_app;
13111
12913
  this.K = p_k;
13112
- this.b_ini = true;
13113
- this.b_edit_loaded = false;
13114
- //this.descrizione = "Descrizione Allegato";
13115
- this.ref_allegato();
12914
+ this.upc.init(this.App, this.K);
13116
12915
  };
13117
12916
  win_uploads.decorators = [
13118
12917
  { type: core.Component, args: [{
13119
12918
  selector: 'wkf_win_upload',
13120
- template: "\n\n <mat-toolbar color=\"primary\" style=\"width:90%;\"><div fxFlex=\"20\">{{title}}</div>\n <div fxLayout=\"row\" fxLayoutAlign=\"center end\" fxFlex=\"90\" >\n\n <button mat-flat-button color=\"accent\" (click)=\"dialogRef.close('')\">\n <mat-icon>close</mat-icon>\n CHIUDI\n </button>\n </div>\n </mat-toolbar>\n <mat-dialog-content style=\"font-size:12px\">\n <div fxLayout=\"column\">\n <br>\n <div *ngIf=\"enabled\">\n <mat-form-field appearance=\"outline\" floatLabel=\"always\"><mat-label>{{label}}</mat-label>\n <input matInput type=\"text\" name=\"descrizione\" [(ngModel)]=\"descrizione\" >\n </mat-form-field>\n\n <input type=\"file\" ng2FileSelect [uploader]=\"uploader\" multiple />\n <!--<button mat-flat-button *ngIf=\"b_edit_loaded\" (click)=\"download_all()\">{{label_b}}</button>-->\n </div>\n <br>\n <div [style.height]=\"(app_s.getState().body_h-600)+'px'\" style=\"overflow:auto;\">\n\n \n\n <table style=\"width: 100%;\" class=\"fh_table\">\n <thead>\n <tr>\n <th style=\"width:40px\"></th>\n <th style=\"width:50%\">Nome</th>\n <th style=\"width:60px;text-align:center\">Dim.</th>\n <th style=\"width:50%\">Descrizione</th>\n \n <th style=\"width:30%\">Utente</th>\n <th style=\"width:240px;text-align:center\">Data</th>\n <th style=\"width:40px\" class=\"actions\"></th>\n <th *ngIf=\"enabled\" style=\"width:40px\" class=\"actions\"></th>\n </tr>\n </thead>\n <tbody>\n\n <tr *ngFor=\"let app of arr_g;let odd=odd; let even=even;index as i\" [ngClass]=\"{ odd: odd, even: even }\" >\n <td style=\"text-align:center;vertical-align: middle;width:36px;height:36px;\">\n <div style=\"text-align:center;vertical-align: middle;width:28px;height:28px;\">\n <img src=\"assets/icons/square-o/{{app.icon}}\" style=\"width:28px;height:28px;\"></div> </td>\n <td>{{app.Filename}}</td>\n <td style=\"text-align:center\">{{app.Filesize}}</td>\n <td>{{app.descrizione}}</td>\n <td>{{app.nc}}</td>\n <td style=\"text-align:center\">{{app.dt_ins | date: 'dd/MM/yyyy HH:mm:ss'}}</td>\n <td style=\"text-align:center\">\n <button mat-icon-button matTooltip=\"Download File\" (click)=\"download_all(app)\">\n <mat-icon>save_alt</mat-icon>\n </button>\n </td>\n\n\n <td *ngIf=\"enabled\" style=\"text-align:center\">\n <a mat-icon-button matTooltip=\"Elimina File\" *ngIf=\"app.can_delete\" (click)=\"delete(app)\">\n <mat-icon>delete</mat-icon>\n </a>\n\n <a mat-icon-button [matTooltip]=\"'Cancellazione consentita solo a: '+app.nc\" *ngIf=\"!app.can_delete\" [disabled]=\"true\" >\n <mat-icon>delete</mat-icon>\n </a>\n\n </td>\n </tr>\n </table>\n\n </div>\n </div>\n\n <div *ngIf=\"!b_ini\" style=\"color:#ff0000\"><b>ATTENZIONE COMPONENTE NON INIZIALIZZATO</b></div>\n </mat-dialog-content>\n ",
12919
+ template: "\n\n <mat-toolbar color=\"primary\" style=\"width:90%;\"><div fxFlex=\"20\">{{title}}</div>\n <div fxLayout=\"row\" fxLayoutAlign=\"center end\" fxFlex=\"90\" >\n\n <button mat-flat-button color=\"accent\" (click)=\"dialogRef.close('')\">\n <mat-icon>close</mat-icon>\n CHIUDI\n </button>\n </div>\n </mat-toolbar>\n <mat-dialog-content style=\"font-size:12px\">\n<FHUploadPanel [enabled]=\"enabled\" #upc [access_control]=\"access_control\"></FHUploadPanel>\n </mat-dialog-content>\n ",
13121
12920
  styles: ["\n\n \n "]
13122
12921
  }] }
13123
12922
  ];
@@ -13130,11 +12929,7 @@
13130
12929
  { type: AppService }
13131
12930
  ]; };
13132
12931
  win_uploads.propDecorators = {
13133
- enabled: [{ type: core.Input }],
13134
- change: [{ type: core.Output }],
13135
- upc: [{ type: core.ViewChild, args: ['upc',] }],
13136
- access_control: [{ type: core.Input }],
13137
- single: [{ type: core.Input }]
12932
+ upc: [{ type: core.ViewChild, args: ['upc',] }]
13138
12933
  };
13139
12934
  return win_uploads;
13140
12935
  }());