@fluxhub/fluxhub-lib 1.0.575 → 1.0.577

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.
@@ -12853,206 +12853,18 @@ var win_select_level = /** @class */ (function () {
12853
12853
  */
12854
12854
  var win_uploads = /** @class */ (function () {
12855
12855
  function win_uploads(dialogRef, _dataService, toastr, dialog, app_s) {
12856
- var _this = this;
12857
12856
  this.dialogRef = dialogRef;
12858
12857
  this._dataService = _dataService;
12859
12858
  this.toastr = toastr;
12860
12859
  this.dialog = dialog;
12861
12860
  this.app_s = app_s;
12862
12861
  this.enabled = true;
12863
- this.change = new EventEmitter();
12864
12862
  this.access_control = true;
12865
12863
  this.App = '';
12866
12864
  this.K = '';
12867
- this.b_edit_loaded = false;
12868
12865
  this.title = "ALLEGATI";
12869
- this.b_ini = false;
12870
12866
  this.sovrascrivi_path = '';
12871
- this.single = true;
12872
- this.descrizione = '';
12873
- this.label = 'Descrizione Allegato';
12874
- this.username = '';
12875
- this.uploader = new FileUploader({
12876
- url: this.app_s.API_ENDPOINT + this.app_s.UPLOAD_ENDPOINT
12877
- });
12878
- this.username = this.app_s.user;
12879
- this.uploader.onBeforeUploadItem = (/**
12880
- * @param {?} item
12881
- * @return {?}
12882
- */
12883
- function (item) {
12884
- item.withCredentials = false;
12885
- });
12886
- this.uploader.onCompleteItem = (/**
12887
- * @param {?} item
12888
- * @param {?} response
12889
- * @param {?} status
12890
- * @param {?} header
12891
- * @return {?}
12892
- */
12893
- function (item, response, status, header) {
12894
- if (status === 200) {
12895
- _this.descrizione = "";
12896
- _this
12897
- .toastr
12898
- .info("INFO", "ALLEGATO INSERITO", {
12899
- timeOut: 1000,
12900
- progressBar: true
12901
- });
12902
- _this.ref_allegato();
12903
- _this
12904
- .change
12905
- .emit();
12906
- }
12907
- });
12908
12867
  }
12909
- /**
12910
- * @param {?} ax
12911
- * @return {?}
12912
- */
12913
- win_uploads.prototype.download_all = /**
12914
- * @param {?} ax
12915
- * @return {?}
12916
- */
12917
- function (ax) {
12918
- if (ax.APP != null)
12919
- ax.App = ax.APP;
12920
- if (this.sovrascrivi_path == '')
12921
- window.open(this.app_s.COMPANY_SITE_ROOT + '/uploads/' + ax.App + '/' + ax.K + '/' + ax.Filename);
12922
- else
12923
- window.open(this.sovrascrivi_path + '/uploads/' + ax.App + '/' + ax.K + '/' + ax.Filename);
12924
- };
12925
- /**
12926
- * @param {?} ax
12927
- * @return {?}
12928
- */
12929
- win_uploads.prototype.delete = /**
12930
- * @param {?} ax
12931
- * @return {?}
12932
- */
12933
- function (ax) {
12934
- var _this = this;
12935
- localStorage.setItem(this.app_s.COMPANY_KEY + "title_dialog", 'Conferma Operazione');
12936
- localStorage.setItem(this.app_s.COMPANY_KEY + "msg_dialog", "Confermi l'eliminazione dell'elemento?");
12937
- /** @type {?} */
12938
- var dialogRef1 = this
12939
- .dialog
12940
- .open(FHConfirmComponent);
12941
- dialogRef1
12942
- .afterClosed()
12943
- .subscribe((/**
12944
- * @param {?} result
12945
- * @return {?}
12946
- */
12947
- function (result) {
12948
- if (result) {
12949
- /** @type {?} */
12950
- var p = new QParam();
12951
- p.sql = "DELETE_ALLEGATO";
12952
- p.types = ['int', 'string'];
12953
- p.values = [ax.id, _this.app_s.user];
12954
- _this
12955
- ._dataService
12956
- .doQuery(p)
12957
- .subscribe((/**
12958
- * @param {?} data
12959
- * @return {?}
12960
- */
12961
- function (data) {
12962
- if (data != null)
12963
- if (data.result_msg == "OK") {
12964
- _this.arr_g = data.result_data;
12965
- _this.ref_allegato();
12966
- _this
12967
- .toastr
12968
- .info("INFO", "ALLEGATO ELIMINATO", {
12969
- timeOut: 1000,
12970
- progressBar: true
12971
- });
12972
- }
12973
- }));
12974
- }
12975
- }));
12976
- };
12977
- /**
12978
- * @param {?} fileItem
12979
- * @return {?}
12980
- */
12981
- win_uploads.prototype.ch = /**
12982
- * @param {?} fileItem
12983
- * @return {?}
12984
- */
12985
- function (fileItem) {
12986
- var _this = this;
12987
- for (var i = 0; i < this.arr_g.length; i++) {
12988
- if (this.arr_g[i].Filename.toLowerCase() == fileItem.file.name.toLowerCase()) {
12989
- this.toastr.error('File già presente (cancellarlo per aggiornarlo)');
12990
- return;
12991
- }
12992
- }
12993
- this.uploader.onBuildItemForm = (/**
12994
- * @param {?} item
12995
- * @param {?} form
12996
- * @return {?}
12997
- */
12998
- function (item, form) {
12999
- form.append('App', _this.App);
13000
- form.append('K', _this.K);
13001
- form.append('descrizione', _this.descrizione);
13002
- form.append('single', _this.single);
13003
- form.append('username', _this.username);
13004
- form.append('tipo', '');
13005
- form.append('local_path', _this.app_s.LOCAL_PATH);
13006
- });
13007
- /** @type {?} */
13008
- var uo = {};
13009
- uo.headers = [{ name: 'Authorization', value: 'Bearer ' + localStorage.getItem(this.app_s.COMPANY_KEY + "token") }];
13010
- this.uploader.setOptions(uo);
13011
- this
13012
- .uploader
13013
- .uploadAll();
13014
- };
13015
- /**
13016
- * @return {?}
13017
- */
13018
- win_uploads.prototype.ref_allegato = /**
13019
- * @return {?}
13020
- */
13021
- function () {
13022
- var _this = this;
13023
- if (this.App == null)
13024
- return;
13025
- if (this.App == "")
13026
- return;
13027
- /** @type {?} */
13028
- var p = new QParam();
13029
- p.sql = "SELECT_ALLEGATO_INFO";
13030
- p.types = ['string', 'string'];
13031
- p.values = [this.App, this.K];
13032
- this
13033
- ._dataService
13034
- .doQuery(p)
13035
- .subscribe((/**
13036
- * @param {?} data
13037
- * @return {?}
13038
- */
13039
- function (data) {
13040
- if (data != null)
13041
- if (data.result_msg == "OK") {
13042
- _this.arr_g = data.result_data;
13043
- /** @type {?} */
13044
- var iconf = "webinfo";
13045
- for (var i = 0; i < _this.arr_g.length; i++) {
13046
- /** @type {?} */
13047
- var arrf = _this.arr_g[i].Filename.split('.');
13048
- if ('3G2|3GA|3GP|7Z|AA|AAC|AC|ACCDB|ACCDT|ADN|AI|AIF|AIFC|AIFF|AIT|AMR|ANI|APK|APP|APPLESCRIPT|ASA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PUB|PY|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)
13049
- iconf = arrf[arrf.length - 1].toLocaleLowerCase();
13050
- _this.arr_g[i].icon = iconf + '.svg';
13051
- _this.arr_g[i].can_delete = !_this.access_control || _this.arr_g[i].idp == _this.app_s.user;
13052
- }
13053
- }
13054
- }));
13055
- };
13056
12868
  /**
13057
12869
  * @return {?}
13058
12870
  */
@@ -13060,19 +12872,9 @@ var win_uploads = /** @class */ (function () {
13060
12872
  * @return {?}
13061
12873
  */
13062
12874
  function () {
13063
- var _this = this;
13064
12875
  this.App = this.app_s.getState().wkf_doc_info.uiid_app;
13065
12876
  this.K = this.app_s.getState().wkf_doc_info.uiid_doc;
13066
- this.single = false;
13067
- this.uploader.onAfterAddingFile = (/**
13068
- * @param {?} fileItem
13069
- * @return {?}
13070
- */
13071
- function (fileItem) {
13072
- _this.ch(fileItem);
13073
- });
13074
12877
  this.init(this.App, this.K);
13075
- this.ref_allegato();
13076
12878
  };
13077
12879
  /**
13078
12880
  * @param {?} p_app
@@ -13087,15 +12889,12 @@ var win_uploads = /** @class */ (function () {
13087
12889
  function (p_app, p_k) {
13088
12890
  this.App = p_app;
13089
12891
  this.K = p_k;
13090
- this.b_ini = true;
13091
- this.b_edit_loaded = false;
13092
- //this.descrizione = "Descrizione Allegato";
13093
- this.ref_allegato();
12892
+ this.upc.init(this.App, this.K);
13094
12893
  };
13095
12894
  win_uploads.decorators = [
13096
12895
  { type: Component, args: [{
13097
12896
  selector: 'wkf_win_upload',
13098
- 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 ",
12897
+ 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\" [sovrascrivi_path]=\"sovrascrivi_path\"></FHUploadPanel>\n </mat-dialog-content>\n ",
13099
12898
  styles: ["\n\n \n "]
13100
12899
  }] }
13101
12900
  ];
@@ -13108,11 +12907,7 @@ var win_uploads = /** @class */ (function () {
13108
12907
  { type: AppService }
13109
12908
  ]; };
13110
12909
  win_uploads.propDecorators = {
13111
- enabled: [{ type: Input }],
13112
- change: [{ type: Output }],
13113
- upc: [{ type: ViewChild, args: ['upc',] }],
13114
- access_control: [{ type: Input }],
13115
- single: [{ type: Input }]
12910
+ upc: [{ type: ViewChild, args: ['upc',] }]
13116
12911
  };
13117
12912
  return win_uploads;
13118
12913
  }());