@gsp-svc/formdoc-upload 0.1.27 → 0.1.28
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.
- package/bundles/gsp-svc-formdoc-upload.umd.js +183 -23
- package/bundles/gsp-svc-formdoc-upload.umd.js.map +1 -1
- package/bundles/gsp-svc-formdoc-upload.umd.min.js +1 -1
- package/bundles/gsp-svc-formdoc-upload.umd.min.js.map +1 -1
- package/esm2015/gsp-svc-formdoc-upload.js +2 -1
- package/esm2015/lib/formdoc-upload.module.js +8 -3
- package/esm2015/lib/i18n/language.resource.js +116 -0
- package/esm2015/lib/local.pipe.js +48 -0
- package/esm2015/lib/upload/file-upload/file-upload.component.js +17 -15
- package/esm2015/lib/upload/upload.module.js +9 -4
- package/esm2015/lib/uploaddialog.service.js +18 -8
- package/esm5/gsp-svc-formdoc-upload.js +2 -1
- package/esm5/lib/formdoc-upload.module.js +8 -3
- package/esm5/lib/i18n/language.resource.js +116 -0
- package/esm5/lib/local.pipe.js +51 -0
- package/esm5/lib/upload/file-upload/file-upload.component.js +17 -15
- package/esm5/lib/upload/upload.module.js +9 -4
- package/esm5/lib/uploaddialog.service.js +18 -8
- package/fesm2015/gsp-svc-formdoc-upload.js +181 -26
- package/fesm2015/gsp-svc-formdoc-upload.js.map +1 -1
- package/fesm5/gsp-svc-formdoc-upload.js +183 -26
- package/fesm5/gsp-svc-formdoc-upload.js.map +1 -1
- package/gsp-svc-formdoc-upload.d.ts +1 -0
- package/gsp-svc-formdoc-upload.metadata.json +1 -1
- package/lib/i18n/language.resource.d.ts +110 -0
- package/lib/local.pipe.d.ts +8 -0
- package/lib/upload/file-upload/file-upload.component.d.ts +2 -0
- package/lib/uploaddialog.service.d.ts +3 -0
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@farris/ui-dialog"),require("@angular/common"),require("rxjs/observable/of"),require("rxjs/operators"),require("angular2-uuid"),require("@angular/platform-browser"),require("@progress/kendo-angular-buttons"),require("@farris/ui-messager"),require("@farris/ui-loading"),require("@farris/ui-progress"),require("@angular/forms"),require("@farris/ui-combo-list"),require("@ecp-caf/caf-common"),require("@angular/core"),require("@farris/ui-modal"),require("rxjs"),require("@angular/common/http"),require("@farris/ui-notify")):"function"==typeof define&&define.amd?define("@gsp-svc/formdoc-upload",["exports","@farris/ui-dialog","@angular/common","rxjs/observable/of","rxjs/operators","angular2-uuid","@angular/platform-browser","@progress/kendo-angular-buttons","@farris/ui-messager","@farris/ui-loading","@farris/ui-progress","@angular/forms","@farris/ui-combo-list","@ecp-caf/caf-common","@angular/core","@farris/ui-modal","rxjs","@angular/common/http","@farris/ui-notify"],t):t((e["gsp-svc"]=e["gsp-svc"]||{},e["gsp-svc"]["formdoc-upload"]={}),e.uiDialog,e.ng.common,e.rxjs["observable/of"],e.rxjs.operators,e.angular2Uuid,e.ng.platformBrowser,e.kendoAngularButtons,e.uiMessager,e.uiLoading,e.uiProgress,e.ng.forms,e.uiComboList,e.cafCommon,e.ng.core,e.uiModal,e.rxjs,e.ng.common.http,e.uiNotify)}(this,function(e,t,i,n,o,d,s,l,r,a,p,c,u,f,h,g,m,x,y){"use strict";var v=function(){function e(){}return e.decorators=[{type:h.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[]},e.ngInjectableDef=h.defineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e}(),b=function(){function e(){}return e.prototype.ngOnInit=function(){},e.decorators=[{type:h.Component,args:[{selector:"lib-formdoc-upload",template:"\n <p>\n formdoc-upload works!\n </p>\n "}]}],e.ctorParameters=function(){return[]},e}(),I=function(){function e(){}return e.decorators=[{type:h.NgModule,args:[{declarations:[b],imports:[],exports:[b]}]}],e}(),F={Word:0,Excel:1,Powerpoint:2,Pdf:3,Txt:4,Image:5,Other:6};F[F.Word]="Word",F[F.Excel]="Excel",F[F.Powerpoint]="Powerpoint",F[F.Pdf]="Pdf",F[F.Txt]="Txt",F[F.Image]="Image",F[F.Other]="Other";var w=function W(){},S={Formal:0,Temp:1};S[S.Formal]="Formal",S[S.Temp]="Temp";var k=function H(){},L=function J(){},N=function $(){},C=function(){function e(e){this.http=e}return e.prototype.uploadList=function(e,t){return e.rootId=t,"/api/runtime/dfs/v1.0/formdoc/list",this.http.post("/api/runtime/dfs/v1.0/formdoc/list",e).pipe(o.tap(function(e){}),o.catchError(function(e){return n.of(e)}))},e.prototype.commit=function(e,t){var i=new L;return i.metadataIdList=e,i.rootId=t,"/api/runtime/dfs/v1.0/formdoc/commit",this.http.post("/api/runtime/dfs/v1.0/formdoc/commit",i).pipe()},e.prototype.cancel=function(e,t){var i=new L;return i.metadataIdList=e,i.rootId=t,"/api/runtime/dfs/v1.0/formdoc/cancel",this.http.put("/api/runtime/dfs/v1.0/formdoc/cancel",i).pipe()},e.prototype.removeList=function(e,t){var i=new k;return i.metadataIdList=e,i.mode=S.Temp,i.rootId=t,this.http["delete"]("/api/runtime/dfs/v1.0/formdoc/list",i).pipe()},e.prototype.getFile=function(e,t){var i;return i=""==t?"/api/runtime/dfs/v1.0/formdoc/file/"+e:"/api/runtime/dfs/v1.0/formdoc/file/"+e+"/"+t,this.http.get(i).pipe(o.tap(function(e){}),o.catchError(function(e){return n.of(e)}))},e.prototype.uploadFile=function(e){return this.http.post("/api/runtime/dfs/v1.0/formdoc",e).pipe(o.tap(function(e){}),o.catchError(function(e){return n.of(e)}))},e.prototype.getStorageExtensionInfo=function(){return this.http.get("/api/runtime/dfs/v1.0/storagestrategy/extension").pipe(o.tap(function(e){}),o.catchError(function(e){return n.of(e)}))},e.prototype.changeStorageInstance=function(e,t){var i=new N;return i.fileInfoList=e,i.rootId=t,this.http.post("/api/runtime/dfs/v1.0/formdoc/changeinstance",i).pipe(o.tap(function(e){}),o.catchError(function(e){return n.of(e)}))},e.prototype.getUploadedFileInfoList=function(e,t){var i="/api/runtime/dfs/v1.0/formdoc/uploadedfile/infolist?formid="+e+"&rootid="+t;return this.http.get(i).pipe(o.tap(function(e){}),o.catchError(function(e){return n.of(e)}))},e.prototype.getRootSetting=function(e){var t="/api/runtime/dfs/v1.0/rootsetting/"+e;return this.http.get(t).pipe(o.tap(function(e){}),o.catchError(function(e){return n.of(e)}))},e.decorators=[{type:h.Injectable}],e.ctorParameters=function(){return[{type:f.HttpService}]},e}(),M=function V(){},U=function K(){},T=function Q(){},D={New:0,Update:1};D[D.New]="New",D[D.Update]="Update";var P=function(){function e(e,t,i,n){this.msgService=e,this.uploadService=t,this.loadService=i,this.injector=n,this.files=[],this.metadataIdList=[],this.uploadFileInfoList=[],this.errFileList=[],this.errTypeList=[],this.nullFileList=[],this.showType=0,this.mouseOn=!1,this.bufferSize=1048576,this.selectedFileCount=0,this.uploadIconAddress="/platform/runtime/dfs/images/upload.svg",this.uploadLittleIconAddress="/platform/runtime/dfs/images/uploadIcon.svg",this.hasSelectedFile=!1,this.fileAllSelected=!1,this.uploadProcess={width:"0%"},this.fileTotalChunk={},this.requestArray=new Array,this.requestBodyArray=new Array,this.uploadedChunk={},this.uploadedProcess={},this.defaultPropertyName="",this.propertiesNames=[],this.queueListStyle={width:"480px"},this.dropListValue="",this.uploadedFileTotal=0,this.haveExtensionProperty=!1,this.uploadedFileInfoList=[],this.oldUploadedFileList=[],this.sameNameAllowed=!0,this.fileType="*",this.fileCount=0,this.oldIdList=[],this.exStorageFileList=[]}return e.prototype.ngOnInit=function(){var i=this;this.uploadService.getStorageExtensionInfo().subscribe(function(e){if(null!=e&&null==e.error){i.storageExtension=e,i.defaultPropertyName=i.storageExtension.defaultPropertyName,i.propertiesNames.push({id:"0",name:i.storageExtension.defaultPropertyName});var t=0;i.storageExtension.extensionPropertyNameList.forEach(function(e){i.propertiesNames.push({id:(++t).toString(),name:e})}),i.queueListStyle.width="380px",i.haveExtensionProperty=!0}}),this.uploadService.getRootSetting(this.rootId).subscribe(function(e){null!=e&&null==e.error&&(i.sameNameAllowed=e.sameNameAllowed,i.sameNameAllowed||i.uploadService.getUploadedFileInfoList(i.formId,i.rootId).subscribe(function(e){null!=e&&null==e.error&&(i.uploadedFileInfoList=e,i.oldUploadedFileList=JSON.parse(JSON.stringify(e)))}))}),null!=this.oldIdList&&0<this.oldIdList.length&&this.uploadService.cancel(this.oldIdList,this.rootId).subscribe()},e.prototype.fileSelected=function(e){var r=this,t=this.loadService.show({message:"正在上传文件……"});if(this.hasSelectedFile=!0,this.selectedFiles=document.querySelector("#file"),0<this.fileCount&&this.selectedFiles.files.length+this.files.length>this.fileCount){var i=this.selectedFiles.files.length+this.files.length;this.msgService.warning("已选择"+i+"个文件,超过系统设置的数量限制"+this.fileCount+"个,请重新选择上传文件。")}else{for(var n=function(e){var o=a.selectedFiles.files[e],l=d.UUID.UUID();if(!a.sameNameAllowed&&null!=a.uploadedFileInfoList.find(function(e){return e.fileName==o.name})){var s=a.msgService.show("warning","已上传过同名文件: "+o.name,{initialState:{buttons:[{text:"重命名",cls:"btn btn-secondary",handle:function(){for(var t,e=o.name,i=!0,n=1;i;)t=e.substring(0,e.lastIndexOf("."))+"("+n+")"+e.substring(e.lastIndexOf(".")),null!=r.uploadedFileInfoList.find(function(e){return e.fileName==t})?n++:i=!1;r.uploadFile(l,o,t),s.close()}},{text:"替换",cls:"btn btn-secondary",handle:function(){l=r.uploadedFileInfoList.find(function(e){return e.fileName==o.name}).metadataId,r.uploadFile(l,o,o.name,D.Update),r.uploadedFileTotal--,r.oldUploadedFileList.find(function(e){return e.fileName==o.name})&&(r.uploadedFileTotal++,r.uploadedFileInfoList.splice(r.uploadedFileInfoList.indexOf(r.uploadedFileInfoList.filter(function(e){return e.fileName==o.name})[0]),1)),s.close()}},{text:"取消",cls:"btn btn-secondary",handle:function(){s.close()}}]}});return"continue"}if(0==o.size)return a.nullFileList.push(o.name),"continue";a.uploadFile(l,o,o.name)},a=this,o=0;o<this.selectedFiles.files.length;o++)n(o);if(0<this.errFileList.length){var l=this.listToString(this.errFileList);this.msgService.warning("已上传同名文件: "+l+"请重新选择上传文件。"),this.errFileList=[]}if(0<this.nullFileList.length){var s=this.listToString(this.nullFileList);s=s.substring(0,s.length-1),this.msgService.warning("文件: "+s+" 大小为0,请重新选择上传文件。"),this.nullFileList=[]}this.files=this.files.slice(),this.fileAllSelected=!1,e.target.value="",t.close()}},e.prototype.showErrorMessage=function(e){this.msgService.error("上传附件失败。"+e.errorMessage)},e.prototype.uploadFile=function(s,r,a,e){var d,p=this;void 0===e&&(e=D.New),d={id:s,name:a,type:r.type,source:"",size:this.getFileSize(r.size),fileSize:r.size,picListDisplayName:this.getPicListDisplayName(a),queueListDisplayName:this.getQueueDisplayName(a),hasUploaded:!1,mouseOn:!1,selectd:!1,isUploading:!0,uploadResult:!1,uploadProcess:0,errorMessage:"",extensionDropListId:0,extensionName:""},null!=this.storageExtension&&(d.extensionName=this.defaultPropertyName);var c=Math.ceil(r.size/this.bufferSize),u=0;this.fileTotalChunk[s]=c;var f=new M;f.metadataId=s,f.fileName=d.name,f.fileSize=d.size,f.state=e;for(var t=function(){var t=new U;t.formId=h.formId,t.mode=S.Temp,t.rootId=h.rootId;var i=new w;i.fileName=a,i.metadataId=s,i.total=c,h.uploadedChunk[i.metadataId]=0;var e=Math.min((u+1)*h.bufferSize,r.size),n=r.slice(u*h.bufferSize,e),o=new FileReader;o.readAsBinaryString(n);var l=u;o.onload=function(){i.fileContent=btoa(o.result.toString()),i.index=l,p.haveExtensionProperty&&(i.exPropertyName=p.defaultPropertyName),t.docInfo=i;var e=t;p.requestBodyArray.push(e),p.uploadService.uploadFile(e).subscribe(function(e){null!=e?(p.files[p.files.indexOf(d)].uploadResult=!1,p.files[p.files.indexOf(d)].isUploading=!1,p.files[p.files.indexOf(d)].errorMessage=e.error.Message):(p.uploadedChunk[i.metadataId]++,p.files[p.files.indexOf(d)].uploadProcess=Number.parseInt((p.uploadedChunk[i.metadataId]/p.fileTotalChunk[i.metadataId]*100).toFixed(0)),p.uploadedChunk[i.metadataId]==p.fileTotalChunk[i.metadataId]&&(p.files[p.files.indexOf(d)].uploadResult=!0,p.files[p.files.indexOf(d)].isUploading=!1,p.uploadFileInfoList=p.uploadFileInfoList.concat(f),p.uploadedFileInfoList=p.uploadedFileInfoList.concat(f),p.uploadedFileTotal++))})},u+=1},h=this;u<c;)t();var i=r.type;i.includes("tiff")?this.addDocInfo(r,d,F.Other):i.includes("image")?this.addDocInfo(r,d,F.Image):i.includes("word")?this.addDocInfo(r,d,F.Word):i.includes("pdf")?this.addDocInfo(r,d,F.Pdf):i.includes("plain")?this.addDocInfo(r,d,F.Txt):i.includes("sheet")||i.includes("excel")?this.addDocInfo(r,d,F.Excel):i.includes("powerpoint")||i.includes("presentation")?this.addDocInfo(r,d,F.Powerpoint):this.addDocInfo(r,d,F.Other);var n=-1;this.files.forEach(function(e){e.name==d.name&&-1==n&&(n=p.files.indexOf(e))}),-1!=n&&n!=this.files.length-1&&(this.files.splice(n,1),this.uploadFileInfoList.splice(n,1),this.uploadedFileInfoList.splice(n,1),this.uploadedFileTotal--)},e.prototype.selectAllFile=function(){this.fileAllSelected?(this.files.forEach(function(e){e.selectd=!1}),this.fileAllSelected=!1,this.selectedFileCount=0):(this.files.forEach(function(e){e.selectd=!0}),this.fileAllSelected=!0,this.selectedFileCount=this.files.length)},e.prototype.checkoutSelectFile=function(e){e.selectd=!e.selectd,e.selectd?this.selectedFileCount++:this.selectedFileCount--,this.selectedFileCount==this.files.length?this.fileAllSelected=!0:this.fileAllSelected=!1},e.prototype.listDeleteFile=function(t){if(t.selectd&&this.selectedFileCount--,this.files.splice(this.files.indexOf(t),1),t.uploadResult){var e=[];e.push(t.id),this.uploadService.cancel(e,this.rootId).subscribe(),this.uploadFileInfoList.splice(this.uploadFileInfoList.indexOf(this.uploadFileInfoList.filter(function(e){return e.fileName==t.name})[0]),1),this.uploadedFileInfoList.splice(this.uploadedFileInfoList.indexOf(this.uploadedFileInfoList.filter(function(e){return e.fileName==t.name})[0]),1),this.uploadedFileTotal--}0==this.selectedFileCount&&(this.fileAllSelected=!1)},e.prototype.listMultipleDeleteFile=function(){var e=this,t=[];this.files.forEach(function(e){document.getElementById(e.name).checked&&t.push(e)});var i=[];t.forEach(function(t){i.push(t.id),e.files.splice(e.files.indexOf(t),1),t.uploadResult&&(e.uploadFileInfoList.splice(e.uploadFileInfoList.indexOf(e.uploadFileInfoList.filter(function(e){return e.fileName==t.name})[0]),1),e.uploadedFileInfoList.splice(e.uploadedFileInfoList.indexOf(e.uploadedFileInfoList.filter(function(e){return e.fileName==t.name})[0]),1),e.uploadedFileTotal--)}),this.uploadService.cancel(i,this.rootId).subscribe();var n=document.getElementById("allCheckBox");null!=n&&(n.checked=!1),this.selectedFileCount=0,this.fileAllSelected=!1},e.prototype.getPicListDisplayName=function(e){return e.length<=10?e:e.substring(0,2)+"…"+e.substring(e.lastIndexOf(".")-2)},e.prototype.getQueueDisplayName=function(e){return e},e.prototype.addDocInfo=function(e,n,t){var o=this;switch(t){case F.Word:n.source="/platform/runtime/dfs/images/word.png",this.files.push(n);break;case F.Pdf:n.source="/platform/runtime/dfs/images/pdf.png",this.files.push(n);break;case F.Excel:n.source="/platform/runtime/dfs/images/excel.png",this.files.push(n);break;case F.Txt:n.source="/platform/runtime/dfs/images/txt.png",this.files.push(n);break;case F.Powerpoint:n.source="/platform/runtime/dfs/images/ppt.png",this.files.push(n);break;case F.Other:n.source="/platform/runtime/dfs/images/file.png",this.files.push(n);break;case F.Image:var l=new FileReader;l.readAsDataURL(e),l.onload=function(e){var t=l.result;if(null!=o.injector){var i=o.injector.get(s.DomSanitizer);n.source=i.bypassSecurityTrustResourceUrl(t)}else n.source=t;o.files.push(n)}}},e.prototype.listToString=function(e){for(var t="",i=0;i<e.length;i++)t+=e[i]+",";return t},e.prototype.typeChange=function(e,t){t.extensionName=e.data.name;var i=new T;t.extensionName==this.storageExtension.defaultPropertyName?0<this.exStorageFileList.filter(function(e){return e.metadataId==t.id}).length&&this.exStorageFileList.splice(this.exStorageFileList.findIndex(function(e){return e.metadataId==t.id}),1):0<this.exStorageFileList.filter(function(e){return e.metadataId==t.id}).length?(i=this.exStorageFileList.filter(function(e){return e.metadataId==t.id})[0]).exPropertyName=t.extensionName:(i.metadataId=t.id,i.exPropertyName=t.extensionName,this.exStorageFileList.push(i))},e.prototype.upload=function(){var t=this;if(this.uploadedFileTotal!=this.files.filter(function(e){return e.isUploading||e.uploadResult}).length)return this.msgService.warning("等一下,文档正在上传。"),m.of(!1);if(null==this.storageExtension)return m.of(this.uploadFileInfoList);if(0==this.exStorageFileList.length)return m.of(this.uploadFileInfoList);var i=this.loadService.show({message:"正在将文件保存到"+this.storageExtension.extensionName});return this.uploadService.changeStorageInstance(this.exStorageFileList,this.rootId).pipe(o.map(function(e){return null!=e&&t.msgService.error("保存到"+t.storageExtension.extensionName+"失败,上传文件自动保存到"+t.storageExtension.defaultPropertyName+"存储。"+e.error.Message),i.close(),t.uploadFileInfoList}))},e.prototype.cancel=function(){var t=this;0!=this.uploadFileInfoList.length&&(this.uploadFileInfoList.forEach(function(e){t.metadataIdList.push(e.metadataId)}),this.uploadService.cancel(this.metadataIdList,this.rootId).subscribe())},e.prototype.getUploadFileInfoList=function(){return this.uploadFileInfoList},e.prototype["delete"]=function(t){this.files.splice(this.files.indexOf(t),1),t.uploadResult&&this.uploadedFileTotal--,0<this.exStorageFileList.filter(function(e){return e.metadataId==t.id}).length&&this.exStorageFileList.splice(this.exStorageFileList.findIndex(function(e){return e.metadataId==t.id}),1)},e.prototype.getFileSize=function(e){return e<102400?(e/1024).toFixed(1)+"K":e<1048576?(e/1024).toFixed(0)+"K":e<104857600?(e/1024/1024).toFixed(1)+"M":e<1073741824?(e/1024/1024).toFixed(0)+"M":(e/1024/1024/1024).toFixed(1)+"G"},e.prototype.showByGroup=function(){this.showType=0},e.prototype.showByList=function(){this.showType=1,0!=this.selectedFileCount&&this.selectedFileCount==this.files.length&&(this.fileAllSelected=!0)},e.prototype.mouseOver=function(e){e.mouseOn=!0},e.prototype.mouseOut=function(e){e.mouseOn=!1},e.decorators=[{type:h.Component,args:[{selector:"app-file-upload",template:'<div *ngIf="hasSelectedFile">\n\n <div class="farris-header" style="height: 50px; width: 100%">\n <div class="btn btn-secondary upload_button">\n <img [src]="uploadLittleIconAddress">\n <span>上传文件 </span>\n <input type="file" (change)="fileSelected($event)" id="file" multiple="multiple" title="" [accept]="fileType">\n </div>\n\n\n <button *ngIf="showType==0 && !fileAllSelected && files.length >0 " style="padding-left: 20px" class="btn-link btn ng-star-inserted" (click)="selectAllFile()">全选</button>\n <button *ngIf="showType==0 && fileAllSelected && files.length >0 " style="padding-left: 20px" class="btn-link btn ng-star-inserted" (click)="selectAllFile()">全不选</button>\n <button *ngIf="showType==0 && selectedFileCount>0" style="padding-left: 20px" class="btn-link btn ng-star-inserted" (click)="listMultipleDeleteFile()">删除</button>\n\n <button *ngIf="showType==1 && selectedFileCount>0" style="padding-left: 20px" class="btn-link btn ng-star-inserted" (click)="listMultipleDeleteFile()">删除</button>\n\n <kendo-buttongroup [selection]="\'single\'" class="button_group_upload " style="background-color: #ffffff; color: #388FFF;border: 1px solid #ddd;" look="flat">\n <button kendoButton [selected]="true" [toggleable]="true" [imageUrl]="\'/platform/runtime/dfs/images/piclist.png\'" (click)="showByGroup()"></button>\n <button kendoButton [toggleable]="true" [imageUrl]="\'/platform/runtime/dfs/images/queuelist.png\'" (click)="showByList()"></button>\n </kendo-buttongroup>\n\n\n </div>\n\n \x3c!-- <div class="progress" style="height: 12px;">\n <div class="progress-bar" role="progressbar" [ngStyle]="uploadProcess"></div>\n </div> --\x3e\n\n <div class="pic_list" *ngIf="showType==0">\n <ul *ngFor="let file of files">\n <li (mouseenter)="mouseOver(file)" (mouseleave)="mouseOut(file)">\n <div *ngIf="file.isUploading">\n <farris-progress [type]="\'circle\'" [percent]="file.uploadProcess" [strokeLinecap]="\'square\'" [status]="\'active\'"></farris-progress>\n </div>\n\n <table *ngIf="!file.uploadResult && !file.isUploading" style="margin: 0 auto; border: 1px solid #ddd; width: 135px; height: 160px;">\n <tr style="margin: 0 auto ; height: 80px;">\n <td style="text-align: center"><span class="f-icon f-icon-error"></span></td>\n </tr>\n <tr style="margin: 0 auto ; height: 30px;">\n <td style="text-align: center"> 上传失败 </td>\n </tr>\n <tr>\n <td style="text-align: center"><button style="margin: 0 auto ; height: 20px; " class="btn-link btn ng-star-inserted" (click)="showErrorMessage(file)">详情</button></td>\n </tr>\n </table>\n <div *ngIf="!file.isUploading && file.uploadResult" style="border: 1px solid #ddd;">\n <img [src]=\'file.source\'>\n <div *ngIf="haveExtensionProperty" style="width: 133px; height: 25px; background-color: white; position: absolute;bottom: 0; ">\n\n <div style="width: 100px;height: 25px;position:absolute;margin: 0 17px;">\n <farris-combo-list [(ngModel)]="file.extensionDropListId" [data]="propertiesNames" [idField]="\'id\'" [textField]="\'name\'" (selectChange)="typeChange($event,file)" [enableClear]="false">\n \x3c!-- <ng-template #itemTemp let-item>\n <div class="combo-list">\n <span [class]="\'combo-list-circle combo-list-\'+item.state"></span>\n <span class="combo-list-label">{{item.label}}</span>\n </div>\n </ng-template> --\x3e\n </farris-combo-list>\n </div>\n </div>\n </div>\n <table *ngIf="!file.isUploading">\n <tr style="height: 20px">\n <td style="width: 15px; vertical-align: middle; text-align: center">\n \x3c!-- <input type="checkbox" [id]="file.name" (click)="checkoutSelectFile(file.name)"> --\x3e\n <div class="farris-input-wrap" style="height: 20px" (click)="checkoutSelectFile(file)">\n <div class="custom-control custom-checkbox" style="margin: 4px 0 0;height: 20px;">\n <input class="custom-control-input" type="checkbox" [id]="file.name" [(ngModel)]="file.selectd">\n <label class="custom-control-label" style="padding: 0 0 10px 0; position: relative; top: -8px;"></label>\n </div>\n </div>\n </td>\n <td style="width: 120px; vertical-align: middle; text-align: center" [title]="file.name">\n {{file.picListDisplayName}}</td>\n </tr>\n </table>\n \x3c!-- <span>{{file.picListDisplayName}}</span> --\x3e\n \x3c!-- <p class="filename">{{file.picListDisplayName}}</p> --\x3e\n <button *ngIf="!file.isUploading && file.mouseOn" style="position: absolute; top: 0; right: 0px; width: 24px; height: 24px;" kendoButton [icon]="\'delete\'" (click)="listDeleteFile(file)"></button>\n \x3c!-- <button *ngIf="file.hasUploaded" class="k-primary" kendoButton [icon]="\'check\'" [disabled]="true"></button> --\x3e\n </li>\n </ul>\n <br>\n </div>\n\n <div class="queue_list" *ngIf="showType==1">\n <table>\n <tr style="height: 50px; table-layout:fixed;">\n <th style="width: 40px; vertical-align: middle; text-align: center">\n \x3c!-- <input type="checkbox" id="allCheckBox" (click)="selectAllFile()"> --\x3e\n <div class="farris-input-wrap" (click)="selectAllFile()">\n <div class="custom-control custom-checkbox" style="margin: 4px 0 0">\n <input class="custom-control-input" type="checkbox" id="allCheckBox" [(ngModel)]="fileAllSelected">\n <label class="custom-control-label" style="padding: 0"></label>\n </div>\n </div>\n </th>\n <th style="vertical-align: middle" [ngStyle]="queueListStyle">文件名</th>\n <th style="width: 100px; vertical-align: middle">大小</th>\n <th style="width: 170px; vertical-align: middle; text-align: center">状态</th>\n <th *ngIf="haveExtensionProperty" style="width: 100px; vertical-align: middle; text-align: center">\n {{storageExtension.extensionName}}\n </th>\n <th style="width: 140px; vertical-align: middle; text-align: center">操作</th>\n </tr>\n </table>\n <div style="height: 370px; overflow: auto;">\n <table>\n <tr *ngFor="let file of files" style="height: 40px">\n <td colspan="5" *ngIf="file.isUploading">\n \x3c!-- <div style="width:100%; display: table-cell; vertical-align: middle; text-align: center; "> --\x3e\n <div style="width: 500px;margin:0 auto">\n <farris-progress [percent]="file.uploadProcess" [status]="\'active\'">\n </farris-progress>\n </div>\n\n </td>\n <td *ngIf="!file.isUploading" style=" width: 40px; vertical-align: middle; text-align: center">\n \x3c!-- <input type="checkbox" [id]="file.name" (click)="checkoutSelectFile(file.name)"> --\x3e\n <div class="farris-input-wrap" (click)="checkoutSelectFile(file)">\n <div class="custom-control custom-checkbox" style="margin: 4px 0 0">\n <input class="custom-control-input" type="checkbox" [id]="file.name" [(ngModel)]="file.selectd">\n <label class="custom-control-label" style="padding: 0"></label>\n </div>\n </div>\n </td>\n <td *ngIf="!file.isUploading" style="vertical-align: middle" [ngStyle]="queueListStyle">\n {{file.queueListDisplayName}}</td>\n <td *ngIf="!file.isUploading" style="width: 100px; vertical-align: middle">{{file.size}}</td>\n <td *ngIf="!file.isUploading" style="text-align: center; width: 170px; vertical-align: middle;">\n <table *ngIf="!file.uploadResult" style="margin: 0 auto">\n <tr style="margin: 0 auto">\n <td><span class="f-icon f-icon-error"></span></td>\n <td> 上传失败 </td>\n <td><button style="height: 24px" class="btn-link btn ng-star-inserted" (click)="showErrorMessage(file)">详情</button></td>\n </tr>\n </table>\n \x3c!-- <span *ngIf="!file.uploadResult"><span class="f-icon f-icon-error"></span> 上传失败 <button\n class="btn-link btn ng-star-inserted" (click)="showErrorMessage(file)">详情</button></span> --\x3e\n <span *ngIf="file.uploadResult"><span class="f-icon f-icon-success"></span> 上传成功</span>\n </td>\n <td *ngIf="!file.isUploading&&haveExtensionProperty" style="text-align: center; width: 100px; vertical-align: middle;">\n <farris-combo-list [(ngModel)]="file.extensionDropListId" [data]="propertiesNames" [idField]="\'id\'" [textField]="\'name\'" (selectChange)="typeChange($event,file)" [enableClear]="false">\n \x3c!-- <ng-template #itemTemp let-item>\n <div class="combo-list">\n <span [class]="\'combo-list-circle combo-list-\'+item.state"></span>\n <span class="combo-list-label">{{item.label}}</span>\n </div>\n </ng-template> --\x3e\n </farris-combo-list>\n </td>\n <td *ngIf="!file.isUploading" style="text-align: center; width: 140px; vertical-align: middle;">\n \x3c!-- <button *ngIf="file.uploadResult" class="btn-link btn ng-star-inserted" (click)="retryUploadFile(file.name)">重试</button> --\x3e\n <button class="btn-link btn ng-star-inserted" style="margin: 0 auto" (click)="listDeleteFile(file)">删除</button>\n </td>\n\n </tr>\n </table>\n </div>\n </div>\n</div>\n\n<div *ngIf="!hasSelectedFile" class=\'home_page\'>\n <img [src]="uploadIconAddress">\n <div>\n <span class="btn btn-primary btn-lg">上传文件 </span>\n <input type="file" (change)="fileSelected($event)" id="file" multiple="multiple" title="" [accept]="fileType">\n </div>\n</div>',styles:[".home_page{text-align:center}.home_page img{position:absolute;top:180px;margin-left:-35px;width:70px;height:56px}.home_page div{position:absolute;left:50%;top:255px;margin-left:-75px;width:150px;height:32px;overflow:hidden}.home_page div span{width:150px;height:32px;position:absolute;z-index:10;left:0}.home_page div input{position:absolute;left:0;top:0;opacity:0;filter:'alpha(opacity=0)';z-index:11}.upload_button{width:110px;height:32px;overflow:hidden}.upload_button span{position:relative;right:-4px;top:4px;width:56px;height:22px;font-size:14px}.upload_button input{height:32px;width:110px;position:absolute;left:22px;top:12px;opacity:0;filter:'alpha(opacity=0)';overflow:hidden}.upload_button img{position:relative;left:-6px;top:3px;width:14px;height:14px}.button_group_upload{position:absolute;right:18px;top:12px;height:26px;width:53px}.button_group_upload button{height:26px;width:26px}.fileinput-button{position:absolute;right:60px;bottom:40px;overflow:hidden;width:24px;height:24px;border-radius:12px;transform:scale(2.5);-ms-transform:scale(2.5);-moz-transform:scale(2.5);-webkit-transform:scale(2.5);-o-transform:scale(2.5);color:#0686fd}.fileinput-button input{position:absolute;left:0;top:0;opacity:0;filter:'alpha(opacity=0)'}.pic-droplist{height:24px;color:#e0e1e2;background-color:#e0e1e2}.pic-droplist input-group{display:table-cell;width:100px;text-align:center;border:0}.pic-droplist input-group div{border:0}.pic-droplist input-group div div,.pic-droplist input-group div input{background-color:#e0e1e2}.pic_list{padding:0;height:420px;overflow-y:auto;overflow-x:hidden}.pic_list ul{padding:0;list-style:none;width:100%;margin:20px 0 0 20px}.pic_list ul li{height:180px;width:135px;margin:8px 0 8px 12px;float:left;overflow:hidden;align-items:center;position:relative}.pic_list ul li div{width:135px;height:160px;margin:auto;display:table-cell;vertical-align:middle;text-align:center;position:relative}.pic_list ul li div img{max-width:120px;max-height:118px;align-items:center;margin:auto;vertical-align:middle;text-align:center}.pic_list ul li span.filename{width:100px;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.queue_list{display:block;height:420px;overflow-y:auto}.file_list{list-style:none;margin:0;padding:0;overflow-x:hidden;overflow-y:auto}.file_list li{height:50px;line-height:35px;font-size:16px;position:relative}.file_list li button{float:right;top:6px;right:10px;width:20px}.file_list li p.title{padding:0 0 0 6px;margin:0 210px 0 0}.file_list li p.size{position:absolute;width:100px;top:0;right:100px}"]}]}],e.ctorParameters=function(){return[{type:r.MessagerService},{type:C},{type:a.LoadingService},{type:h.Injector}]},e.propDecorators={formId:[{type:h.Input}],rootId:[{type:h.Input}],fileType:[{type:h.Input}],fileCount:[{type:h.Input}],oldIdList:[{type:h.Input}],opCell:[{type:h.ViewChild,args:["opCell"]}]},e}(),E=function(){function e(){}return e.prototype.getDownloadUrl=function(e,t){return"/api/runtime/dfs/v1.0/doc/filecontent?metadataid="+e+"&rootid="+t+"&token="+this.getToken(this.mergeString(e,t))},e.prototype.getMultipleDownloadUrl=function(e,t){var i=JSON.parse(e);return"/api/runtime/dfs/v1.0/doc/multiple/download?metadataidlist="+e+"&rootid="+t+"&token="+this.getToken(this.mergeString(i[0],t))},e.prototype.getMultipleDownloadUrlWithName=function(e,t,i){var n=JSON.parse(e);return null!=i&&""!=i||(i="unifile.zip"),i.endsWith(".zip")||(i+=".zip"),"/api/runtime/dfs/v1.0/doc/compress/download?metadataidlist="+e+"&rootid="+t+"&token="+this.getToken(this.mergeString(n[0],t))+"&zipName="+encodeURIComponent(i)},e.prototype.getHistoryDownloadUrl=function(e,t,i){return"/api/runtime/dfs/v1.0/doc/historycontent?metadataid="+e+"&rootid="+t+"&version="+i+"&token="+this.getToken(this.mergeString(e,t))},e.prototype.mergeString=function(e,t){var i=e.length<t.length?e.length:t.length,n="",o=0;for(o=0;o<i;o++)n+=e.substring(o,o+1),n+=t.substring(o,o+1);return n+=e.length<t.length?t.substring(o):e.substring(o)},e.prototype.getToken=function(e){var t=[1,2,3];24<e.length&&(e=e.substring(0,24));var i=Math.floor(e.length/3),n=e.substring(0,i),o=e.substring(i,2*i),l=e.substring(2*i,3*i),s=[],r=Math.ceil(3*Math.random());s.push(t[r-1]),t.splice(r-1,1),r=Math.ceil(2*Math.random()),s.push(t[r-1]),t.splice(r-1,1),s.push(t[0]);var a=Math.round((new Date).getTime()/1e3)+"";return a.substring(0,5)+"times"+s[0]+s[1]+s[2]+this.switchStr(n,o,l,s[0])+this.switchStr(n,o,l,s[1])+this.switchStr(n,o,l,s[2])+"times"+a.substring(5)},e.prototype.switchStr=function(e,t,i,n){switch(n){case 1:return e;case 2:return t;case 3:return i}},e.decorators=[{type:h.Injectable}],e.ctorParameters=function(){return[]},e}(),O=function(){function e(){}return e.decorators=[{type:h.NgModule,args:[{declarations:[P],imports:[i.CommonModule,l.ButtonsModule,y.NotifyModule,r.MessagerModule.forRoot(),a.LoadingModule.forRoot(),p.ProgressModule,c.FormsModule,u.ComboListModule],exports:[P],entryComponents:[P],providers:[C,E]}]}],e}(),A=O,_=function(){function e(e){this.modalService=e,this.metadataIdList=[]}return e.prototype.ngOnInit=function(){},e.prototype.showDialog=function(){var e=this;this.dlg=this.modalService.show(P,{title:"选择文件",width:800,height:500,buttons:[{text:"上传",cls:"k-button k-button-icontext k-primary",iconCls:"k-icon k-i-check",handle:function(){e.fileUpload.upload(),e.dlg.close()}},{text:"关闭",cls:"k-button k-button-icontext",iconCls:"k-icon k-i-close",handle:function(){e.fileUpload.cancel(),e.dlg.close()}}],showButtons:!0}),this.dlg.content.formId=this.formId},e.decorators=[{type:h.Component,args:[{selector:"app-uploaddialog",template:"\n",styles:[""]}]}],e.ctorParameters=function(){return[{type:g.BsModalService}]},e.propDecorators={formId:[{type:h.Input}],fileUpload:[{type:h.ViewChild,args:[P]}]},e}(),q=function(){function e(e,t,i){this.modalService=e,this.componentFactoryResolver=t,this.injector=i,this.fileInfoList=[]}return e.prototype.showDialog=function(i,n){var o=this,l=0;return new Promise(function(t){var e=o.componentFactoryResolver.resolveComponentFactory(P).create(o.injector);e.instance.rootId=n,e.instance.formId=i,o.dlg=o.modalService.show(e,{title:"上传文件",width:950,height:570,buttons:[{text:"保存",cls:"k-button k-button-icontext k-primary",handle:function(){o.dlg.content.upload().subscribe(function(e){e&&(t(e),l=1,o.dlg.close())})}},{text:"关闭",cls:"k-button k-button-icontext",handle:function(){o.dlg.close()}}],showButtons:!0,showMaxButton:!1,beforeClose:function(){return 0==l&&o.dlg.content.cancel(),m.of(!0)}})})},e.prototype.uploadFile=function(e,t,i){return void 0===i&&(i=[]),this.uploadFileWithLimit(e,t,null,i)},e.prototype.uploadFileWithLimit=function(i,n,o,l){var s=this;void 0===l&&(l=[]);var r=0;return new Promise(function(t){var e=s.componentFactoryResolver.resolveComponentFactory(P).create(s.injector);null!=o&&(e.instance.fileCount=o.fileCount,null!=o.fileType&&""!=o.fileType&&(e.instance.fileType=o.fileType)),e.instance.rootId=n,e.instance.formId=i,e.instance.oldIdList=l,s.dlg=s.modalService.show(e,{title:"上传文件",width:950,height:570,buttons:[{text:"保存",cls:"k-button k-button-icontext k-primary",handle:function(){s.dlg.content.upload().subscribe(function(e){e&&(t(e),r=1,s.dlg.close())})}},{text:"关闭",cls:"k-button k-button-icontext",handle:function(){s.dlg.close()}}],showButtons:!0,showMaxButton:!1,beforeClose:function(){return 0==r&&s.dlg.content.cancel(),m.of(!0)}})})},e.decorators=[{type:h.Injectable}],e.ctorParameters=function(){return[{type:g.BsModalService},{type:h.ComponentFactoryResolver},{type:h.Injector}]},e}(),R=function(){function e(){}return e.decorators=[{type:h.NgModule,args:[{declarations:[_],imports:[i.CommonModule,t.FarrisDialogModule,r.MessagerModule.forRoot(),O,l.ButtonsModule,y.NotifyModule.forRoot(),x.HttpClientModule],exports:[_,P],entryComponents:[_,P],providers:[g.BsModalService,f.HttpService,q,C]}]}],e}(),B=function X(){this.fileType="*",this.fileCount=0},z=function Y(){},j=function Z(){},G=function ee(){};e.FormdocUploadService=v,e.FormdocUploadComponent=b,e.FormdocUploadModule=I,e.UploadDialogMoudle=R,e.UploadDialogComponent=_,e.UploadDialogService=q,e.UploadService=C,e.DownloadService=E,e.FileUploadComponent=P,e.UploadFileInfo=M,e.UploadModule=O,e.ɵa=A,e.UploadLimit=B,e.GspFormDocOperateEntity=L,e.GspFormRemoveListEntity=k,e.GspFormUploadListEntity=z,e.GspFormDocInfo=w,e.GspDocMetaProperty=j,e.GspFormUploadEntity=U,e.FileInfo=G,e.OperatingModes=S,e.FileState=D,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@farris/ui-dialog"),require("@angular/common"),require("rxjs/observable/of"),require("rxjs/operators"),require("angular2-uuid"),require("@angular/platform-browser"),require("@progress/kendo-angular-buttons"),require("@farris/ui-messager"),require("@farris/ui-loading"),require("@farris/ui-progress"),require("@angular/forms"),require("@farris/ui-combo-list"),require("@ecp-caf/caf-common"),require("@angular/core"),require("@farris/ui-modal"),require("rxjs"),require("@angular/common/http"),require("@farris/ui-notify")):"function"==typeof define&&define.amd?define("@gsp-svc/formdoc-upload",["exports","@farris/ui-dialog","@angular/common","rxjs/observable/of","rxjs/operators","angular2-uuid","@angular/platform-browser","@progress/kendo-angular-buttons","@farris/ui-messager","@farris/ui-loading","@farris/ui-progress","@angular/forms","@farris/ui-combo-list","@ecp-caf/caf-common","@angular/core","@farris/ui-modal","rxjs","@angular/common/http","@farris/ui-notify"],t):t((e["gsp-svc"]=e["gsp-svc"]||{},e["gsp-svc"]["formdoc-upload"]={}),e.uiDialog,e.ng.common,e.rxjs["observable/of"],e.rxjs.operators,e.angular2Uuid,e.ng.platformBrowser,e.kendoAngularButtons,e.uiMessager,e.uiLoading,e.uiProgress,e.ng.forms,e.uiComboList,e.cafCommon,e.ng.core,e.uiModal,e.rxjs,e.ng.common.http,e.uiNotify)}(this,function(e,t,i,o,l,d,s,n,a,r,p,c,u,f,h,g,m,x,v){"use strict";var y=function(){function e(){}return e.decorators=[{type:h.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[]},e.ngInjectableDef=h.defineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e}(),b=function(){function e(){}return e.prototype.ngOnInit=function(){},e.decorators=[{type:h.Component,args:[{selector:"lib-formdoc-upload",template:"\n <p>\n formdoc-upload works!\n </p>\n "}]}],e.ctorParameters=function(){return[]},e}(),I=localStorage.getItem("languageCode")||"zh-CHS",F=function(){function e(){}return e.decorators=[{type:h.NgModule,args:[{declarations:[b],imports:[],exports:[b],providers:[f.LanguageService,{provide:h.LOCALE_ID,useValue:I}]}]}],e}(),w={Word:0,Excel:1,Powerpoint:2,Pdf:3,Txt:4,Image:5,Other:6};w[w.Word]="Word",w[w.Excel]="Excel",w[w.Powerpoint]="Powerpoint",w[w.Pdf]="Pdf",w[w.Txt]="Txt",w[w.Image]="Image",w[w.Other]="Other";var S=function J(){},L={Formal:0,Temp:1};L[L.Formal]="Formal",L[L.Temp]="Temp";var k=function $(){},C=function K(){},N=function Q(){},U=function(){function e(e){this.http=e}return e.prototype.uploadList=function(e,t){return e.rootId=t,"/api/runtime/dfs/v1.0/formdoc/list",this.http.post("/api/runtime/dfs/v1.0/formdoc/list",e).pipe(l.tap(function(e){}),l.catchError(function(e){return o.of(e)}))},e.prototype.commit=function(e,t){var i=new C;return i.metadataIdList=e,i.rootId=t,"/api/runtime/dfs/v1.0/formdoc/commit",this.http.post("/api/runtime/dfs/v1.0/formdoc/commit",i).pipe()},e.prototype.cancel=function(e,t){var i=new C;return i.metadataIdList=e,i.rootId=t,"/api/runtime/dfs/v1.0/formdoc/cancel",this.http.put("/api/runtime/dfs/v1.0/formdoc/cancel",i).pipe()},e.prototype.removeList=function(e,t){var i=new k;return i.metadataIdList=e,i.mode=L.Temp,i.rootId=t,this.http["delete"]("/api/runtime/dfs/v1.0/formdoc/list",i).pipe()},e.prototype.getFile=function(e,t){var i;return i=""==t?"/api/runtime/dfs/v1.0/formdoc/file/"+e:"/api/runtime/dfs/v1.0/formdoc/file/"+e+"/"+t,this.http.get(i).pipe(l.tap(function(e){}),l.catchError(function(e){return o.of(e)}))},e.prototype.uploadFile=function(e){return this.http.post("/api/runtime/dfs/v1.0/formdoc",e).pipe(l.tap(function(e){}),l.catchError(function(e){return o.of(e)}))},e.prototype.getStorageExtensionInfo=function(){return this.http.get("/api/runtime/dfs/v1.0/storagestrategy/extension").pipe(l.tap(function(e){}),l.catchError(function(e){return o.of(e)}))},e.prototype.changeStorageInstance=function(e,t){var i=new N;return i.fileInfoList=e,i.rootId=t,this.http.post("/api/runtime/dfs/v1.0/formdoc/changeinstance",i).pipe(l.tap(function(e){}),l.catchError(function(e){return o.of(e)}))},e.prototype.getUploadedFileInfoList=function(e,t){var i="/api/runtime/dfs/v1.0/formdoc/uploadedfile/infolist?formid="+e+"&rootid="+t;return this.http.get(i).pipe(l.tap(function(e){}),l.catchError(function(e){return o.of(e)}))},e.prototype.getRootSetting=function(e){var t="/api/runtime/dfs/v1.0/rootsetting/"+e;return this.http.get(t).pipe(l.tap(function(e){}),l.catchError(function(e){return o.of(e)}))},e.decorators=[{type:h.Injectable}],e.ctorParameters=function(){return[{type:f.HttpService}]},e}(),M=function X(){},T=function Y(){},D=function ee(){},P={New:0,Update:1};P[P.New]="New",P[P.Update]="Update";var E=function(){function e(e,t,i,o){this.msgService=e,this.uploadService=t,this.loadService=i,this.injector=o,this.files=[],this.metadataIdList=[],this.uploadFileInfoList=[],this.errFileList=[],this.errTypeList=[],this.nullFileList=[],this.showType=0,this.mouseOn=!1,this.bufferSize=1048576,this.selectedFileCount=0,this.uploadIconAddress="/platform/runtime/dfs/images/upload.svg",this.uploadLittleIconAddress="/platform/runtime/dfs/images/uploadIcon.svg",this.hasSelectedFile=!1,this.fileAllSelected=!1,this.uploadProcess={width:"0%"},this.fileTotalChunk={},this.requestArray=new Array,this.requestBodyArray=new Array,this.uploadedChunk={},this.uploadedProcess={},this.defaultPropertyName="",this.propertiesNames=[],this.queueListStyle={width:"480px"},this.dropListValue="",this.uploadedFileTotal=0,this.haveExtensionProperty=!1,this.uploadedFileInfoList=[],this.oldUploadedFileList=[],this.sameNameAllowed=!0,this.fileType="*",this.fileCount=0,this.oldIdList=[],this.exStorageFileList=[]}return e.prototype.ngOnInit=function(){var i=this;this.uploadService.getStorageExtensionInfo().subscribe(function(e){if(null!=e&&null==e.error){i.storageExtension=e,i.defaultPropertyName=i.storageExtension.defaultPropertyName,i.propertiesNames.push({id:"0",name:i.storageExtension.defaultPropertyName});var t=0;i.storageExtension.extensionPropertyNameList.forEach(function(e){i.propertiesNames.push({id:(++t).toString(),name:e})}),i.queueListStyle.width="380px",i.haveExtensionProperty=!0}}),this.uploadService.getRootSetting(this.rootId).subscribe(function(e){null!=e&&null==e.error&&(i.sameNameAllowed=e.sameNameAllowed,i.sameNameAllowed||i.uploadService.getUploadedFileInfoList(i.formId,i.rootId).subscribe(function(e){null!=e&&null==e.error&&(i.uploadedFileInfoList=e,i.oldUploadedFileList=JSON.parse(JSON.stringify(e)))}))}),null!=this.oldIdList&&0<this.oldIdList.length&&this.uploadService.cancel(this.oldIdList,this.rootId).subscribe()},e.prototype.fileSelected=function(e){var a=this,t=this.loadService.show({message:this.localepipe.transform("uploading")});if(this.hasSelectedFile=!0,this.selectedFiles=document.querySelector("#file"),0<this.fileCount&&this.selectedFiles.files.length+this.files.length>this.fileCount){var i=this.selectedFiles.files.length+this.files.length;this.msgService.warning(this.localepipe.transform("selectedCount")+i+this.localepipe.transform("limitCount")+this.fileCount+this.localepipe.transform("rechooseFile"))}else{for(var o=function(e){var l=r.selectedFiles.files[e],n=d.UUID.UUID();if(!r.sameNameAllowed&&null!=r.uploadedFileInfoList.find(function(e){return e.fileName==l.name})){var s=r.msgService.show("warning",r.localepipe.transform("haveSameName")+l.name,{initialState:{buttons:[{text:r.localepipe.transform("rename"),cls:"btn btn-secondary",handle:function(){for(var t,e=l.name,i=!0,o=1;i;)t=e.substring(0,e.lastIndexOf("."))+"("+o+")"+e.substring(e.lastIndexOf(".")),null!=a.uploadedFileInfoList.find(function(e){return e.fileName==t})?o++:i=!1;a.uploadFile(n,l,t),s.close()}},{text:r.localepipe.transform("replace"),cls:"btn btn-secondary",handle:function(){n=a.uploadedFileInfoList.find(function(e){return e.fileName==l.name}).metadataId,a.uploadFile(n,l,l.name,P.Update),a.uploadedFileTotal--,a.oldUploadedFileList.find(function(e){return e.fileName==l.name})&&(a.uploadedFileTotal++,a.uploadedFileInfoList.splice(a.uploadedFileInfoList.indexOf(a.uploadedFileInfoList.filter(function(e){return e.fileName==l.name})[0]),1)),s.close()}},{text:r.localepipe.transform("cancel"),cls:"btn btn-secondary",handle:function(){s.close()}}]}});return"continue"}if(0==l.size)return r.nullFileList.push(l.name),"continue";r.uploadFile(n,l,l.name)},r=this,l=0;l<this.selectedFiles.files.length;l++)o(l);if(0<this.errFileList.length){var n=this.listToString(this.errFileList);this.msgService.warning(this.localepipe.transform("haveSameName")+n+this.localepipe.transform("rechooseFile")),this.errFileList=[]}if(0<this.nullFileList.length){var s=this.listToString(this.nullFileList);s=s.substring(0,s.length-1),this.msgService.warning(s+this.localepipe.transform("sizeZero")+this.localepipe.transform("rechooseFile")),this.nullFileList=[]}this.files=this.files.slice(),this.fileAllSelected=!1,e.target.value="",t.close()}},e.prototype.showErrorMessage=function(e){this.msgService.error(this.localepipe.transform("uploadFailure")+e.errorMessage)},e.prototype.uploadFile=function(s,a,r,e){var d,p=this;void 0===e&&(e=P.New),d={id:s,name:r,type:a.type,source:"",size:this.getFileSize(a.size),fileSize:a.size,picListDisplayName:this.getPicListDisplayName(r),queueListDisplayName:this.getQueueDisplayName(r),hasUploaded:!1,mouseOn:!1,selectd:!1,isUploading:!0,uploadResult:!1,uploadProcess:0,errorMessage:"",extensionDropListId:0,extensionName:""},null!=this.storageExtension&&(d.extensionName=this.defaultPropertyName);var c=Math.ceil(a.size/this.bufferSize),u=0;this.fileTotalChunk[s]=c;var f=new M;f.metadataId=s,f.fileName=d.name,f.fileSize=d.size,f.state=e;for(var t=function(){var t=new T;t.formId=h.formId,t.mode=L.Temp,t.rootId=h.rootId;var i=new S;i.fileName=r,i.metadataId=s,i.total=c,h.uploadedChunk[i.metadataId]=0;var e=Math.min((u+1)*h.bufferSize,a.size),o=a.slice(u*h.bufferSize,e),l=new FileReader;l.readAsBinaryString(o);var n=u;l.onload=function(){i.fileContent=btoa(l.result.toString()),i.index=n,p.haveExtensionProperty&&(i.exPropertyName=p.defaultPropertyName),t.docInfo=i;var e=t;p.requestBodyArray.push(e),p.uploadService.uploadFile(e).subscribe(function(e){null!=e?(p.files[p.files.indexOf(d)].uploadResult=!1,p.files[p.files.indexOf(d)].isUploading=!1,p.files[p.files.indexOf(d)].errorMessage=e.error.Message):(p.uploadedChunk[i.metadataId]++,p.files[p.files.indexOf(d)].uploadProcess=Number.parseInt((p.uploadedChunk[i.metadataId]/p.fileTotalChunk[i.metadataId]*100).toFixed(0)),p.uploadedChunk[i.metadataId]==p.fileTotalChunk[i.metadataId]&&(p.files[p.files.indexOf(d)].uploadResult=!0,p.files[p.files.indexOf(d)].isUploading=!1,p.uploadFileInfoList=p.uploadFileInfoList.concat(f),p.uploadedFileInfoList=p.uploadedFileInfoList.concat(f),p.uploadedFileTotal++))})},u+=1},h=this;u<c;)t();var i=a.type;i.includes("tiff")?this.addDocInfo(a,d,w.Other):i.includes("image")?this.addDocInfo(a,d,w.Image):i.includes("word")?this.addDocInfo(a,d,w.Word):i.includes("pdf")?this.addDocInfo(a,d,w.Pdf):i.includes("plain")?this.addDocInfo(a,d,w.Txt):i.includes("sheet")||i.includes("excel")?this.addDocInfo(a,d,w.Excel):i.includes("powerpoint")||i.includes("presentation")?this.addDocInfo(a,d,w.Powerpoint):this.addDocInfo(a,d,w.Other);var o=-1;this.files.forEach(function(e){e.name==d.name&&-1==o&&(o=p.files.indexOf(e))}),-1!=o&&o!=this.files.length-1&&(this.files.splice(o,1),this.uploadFileInfoList.splice(o,1),this.uploadedFileInfoList.splice(o,1),this.uploadedFileTotal--)},e.prototype.selectAllFile=function(){this.fileAllSelected?(this.files.forEach(function(e){e.selectd=!1}),this.fileAllSelected=!1,this.selectedFileCount=0):(this.files.forEach(function(e){e.selectd=!0}),this.fileAllSelected=!0,this.selectedFileCount=this.files.length)},e.prototype.checkoutSelectFile=function(e){e.selectd=!e.selectd,e.selectd?this.selectedFileCount++:this.selectedFileCount--,this.selectedFileCount==this.files.length?this.fileAllSelected=!0:this.fileAllSelected=!1},e.prototype.listDeleteFile=function(t){if(t.selectd&&this.selectedFileCount--,this.files.splice(this.files.indexOf(t),1),t.uploadResult){var e=[];e.push(t.id),this.uploadService.cancel(e,this.rootId).subscribe(),this.uploadFileInfoList.splice(this.uploadFileInfoList.indexOf(this.uploadFileInfoList.filter(function(e){return e.fileName==t.name})[0]),1),this.uploadedFileInfoList.splice(this.uploadedFileInfoList.indexOf(this.uploadedFileInfoList.filter(function(e){return e.fileName==t.name})[0]),1),this.uploadedFileTotal--}0==this.selectedFileCount&&(this.fileAllSelected=!1)},e.prototype.listMultipleDeleteFile=function(){var e=this,t=[];this.files.forEach(function(e){document.getElementById(e.name).checked&&t.push(e)});var i=[];t.forEach(function(t){i.push(t.id),e.files.splice(e.files.indexOf(t),1),t.uploadResult&&(e.uploadFileInfoList.splice(e.uploadFileInfoList.indexOf(e.uploadFileInfoList.filter(function(e){return e.fileName==t.name})[0]),1),e.uploadedFileInfoList.splice(e.uploadedFileInfoList.indexOf(e.uploadedFileInfoList.filter(function(e){return e.fileName==t.name})[0]),1),e.uploadedFileTotal--)}),this.uploadService.cancel(i,this.rootId).subscribe();var o=document.getElementById("allCheckBox");null!=o&&(o.checked=!1),this.selectedFileCount=0,this.fileAllSelected=!1},e.prototype.getPicListDisplayName=function(e){return e.length<=10?e:e.substring(0,2)+"…"+e.substring(e.lastIndexOf(".")-2)},e.prototype.getQueueDisplayName=function(e){return e},e.prototype.addDocInfo=function(e,o,t){var l=this;switch(t){case w.Word:o.source="/platform/runtime/dfs/images/word.png",this.files.push(o);break;case w.Pdf:o.source="/platform/runtime/dfs/images/pdf.png",this.files.push(o);break;case w.Excel:o.source="/platform/runtime/dfs/images/excel.png",this.files.push(o);break;case w.Txt:o.source="/platform/runtime/dfs/images/txt.png",this.files.push(o);break;case w.Powerpoint:o.source="/platform/runtime/dfs/images/ppt.png",this.files.push(o);break;case w.Other:o.source="/platform/runtime/dfs/images/file.png",this.files.push(o);break;case w.Image:var n=new FileReader;n.readAsDataURL(e),n.onload=function(e){var t=n.result;if(null!=l.injector){var i=l.injector.get(s.DomSanitizer);o.source=i.bypassSecurityTrustResourceUrl(t)}else o.source=t;l.files.push(o)}}},e.prototype.listToString=function(e){for(var t="",i=0;i<e.length;i++)t+=e[i]+",";return t},e.prototype.typeChange=function(e,t){t.extensionName=e.data.name;var i=new D;t.extensionName==this.storageExtension.defaultPropertyName?0<this.exStorageFileList.filter(function(e){return e.metadataId==t.id}).length&&this.exStorageFileList.splice(this.exStorageFileList.findIndex(function(e){return e.metadataId==t.id}),1):0<this.exStorageFileList.filter(function(e){return e.metadataId==t.id}).length?(i=this.exStorageFileList.filter(function(e){return e.metadataId==t.id})[0]).exPropertyName=t.extensionName:(i.metadataId=t.id,i.exPropertyName=t.extensionName,this.exStorageFileList.push(i))},e.prototype.upload=function(){var t=this;if(this.uploadedFileTotal!=this.files.filter(function(e){return e.isUploading||e.uploadResult}).length)return this.msgService.warning(this.localepipe.transform("wait")),m.of(!1);if(null==this.storageExtension)return m.of(this.uploadFileInfoList);if(0==this.exStorageFileList.length)return m.of(this.uploadFileInfoList);var i=this.loadService.show({message:this.localepipe.transform("saveTo")+this.storageExtension.extensionName});return this.uploadService.changeStorageInstance(this.exStorageFileList,this.rootId).pipe(l.map(function(e){return i.close(),t.uploadFileInfoList}))},e.prototype.cancel=function(){var t=this;0!=this.uploadFileInfoList.length&&(this.uploadFileInfoList.forEach(function(e){t.metadataIdList.push(e.metadataId)}),this.uploadService.cancel(this.metadataIdList,this.rootId).subscribe())},e.prototype.getUploadFileInfoList=function(){return this.uploadFileInfoList},e.prototype["delete"]=function(t){this.files.splice(this.files.indexOf(t),1),t.uploadResult&&this.uploadedFileTotal--,0<this.exStorageFileList.filter(function(e){return e.metadataId==t.id}).length&&this.exStorageFileList.splice(this.exStorageFileList.findIndex(function(e){return e.metadataId==t.id}),1)},e.prototype.getFileSize=function(e){return e<102400?(e/1024).toFixed(1)+"K":e<1048576?(e/1024).toFixed(0)+"K":e<104857600?(e/1024/1024).toFixed(1)+"M":e<1073741824?(e/1024/1024).toFixed(0)+"M":(e/1024/1024/1024).toFixed(1)+"G"},e.prototype.showByGroup=function(){this.showType=0},e.prototype.showByList=function(){this.showType=1,0!=this.selectedFileCount&&this.selectedFileCount==this.files.length&&(this.fileAllSelected=!0)},e.prototype.mouseOver=function(e){e.mouseOn=!0},e.prototype.mouseOut=function(e){e.mouseOn=!1},e.decorators=[{type:h.Component,args:[{selector:"app-file-upload",template:'<div *ngIf="hasSelectedFile">\n\n <div class="farris-header" style="height: 50px; width: 100%">\n <div class="btn btn-secondary upload_button">\n <img [src]="uploadLittleIconAddress">\n <span>{{\'uploadFile\' | locale}} </span>\n <input type="file" (change)="fileSelected($event)" id="file" multiple="multiple" title="" [accept]="fileType">\n </div>\n\n\n <button *ngIf="showType==0 && !fileAllSelected && files.length >0 " style="padding-left: 20px" class="btn-link btn ng-star-inserted" (click)="selectAllFile()">{{\'selectAll\' | locale}}</button>\n <button *ngIf="showType==0 && fileAllSelected && files.length >0 " style="padding-left: 20px" class="btn-link btn ng-star-inserted" (click)="selectAllFile()">{{\'selectNull\' | locale}}</button>\n <button *ngIf="showType==0 && selectedFileCount>0" style="padding-left: 20px" class="btn-link btn ng-star-inserted" (click)="listMultipleDeleteFile()">{{\'delete\' | locale}}</button>\n\n <button *ngIf="showType==1 && selectedFileCount>0" style="padding-left: 20px" class="btn-link btn ng-star-inserted" (click)="listMultipleDeleteFile()">{{\'delete\' | locale}}</button>\n\n <kendo-buttongroup [selection]="\'single\'" class="button_group_upload " style="background-color: #ffffff; color: #388FFF;border: 1px solid #ddd;" look="flat">\n <button kendoButton [selected]="true" [toggleable]="true" [imageUrl]="\'/platform/runtime/dfs/images/piclist.png\'" (click)="showByGroup()"></button>\n <button kendoButton [toggleable]="true" [imageUrl]="\'/platform/runtime/dfs/images/queuelist.png\'" (click)="showByList()"></button>\n </kendo-buttongroup>\n\n\n </div>\n\n \x3c!-- <div class="progress" style="height: 12px;">\n <div class="progress-bar" role="progressbar" [ngStyle]="uploadProcess"></div>\n </div> --\x3e\n\n <div class="pic_list" *ngIf="showType==0">\n <ul *ngFor="let file of files">\n <li (mouseenter)="mouseOver(file)" (mouseleave)="mouseOut(file)">\n <div *ngIf="file.isUploading">\n <farris-progress [type]="\'circle\'" [percent]="file.uploadProcess" [strokeLinecap]="\'square\'" [status]="\'active\'"></farris-progress>\n </div>\n\n <table *ngIf="!file.uploadResult && !file.isUploading" style="margin: 0 auto; border: 1px solid #ddd; width: 135px; height: 160px;">\n <tr style="margin: 0 auto ; height: 80px;">\n <td style="text-align: center"><span class="f-icon f-icon-error"></span></td>\n </tr>\n <tr style="margin: 0 auto ; height: 30px;">\n <td style="text-align: center"> {{\'uploadFailure\' | locale}} </td>\n </tr>\n <tr>\n <td style="text-align: center"><button style="margin: 0 auto ; height: 20px; " class="btn-link btn ng-star-inserted" (click)="showErrorMessage(file)">{{\'detail\' | locale}}</button></td>\n </tr>\n </table>\n <div *ngIf="!file.isUploading && file.uploadResult" style="border: 1px solid #ddd;">\n <img [src]=\'file.source\'>\n <div *ngIf="haveExtensionProperty" style="width: 133px; height: 25px; background-color: white; position: absolute;bottom: 0; ">\n\n <div style="width: 100px;height: 25px;position:absolute;margin: 0 17px;">\n <farris-combo-list [(ngModel)]="file.extensionDropListId" [data]="propertiesNames" [idField]="\'id\'" [textField]="\'name\'" (selectChange)="typeChange($event,file)" [enableClear]="false">\n \x3c!-- <ng-template #itemTemp let-item>\n <div class="combo-list">\n <span [class]="\'combo-list-circle combo-list-\'+item.state"></span>\n <span class="combo-list-label">{{item.label}}</span>\n </div>\n </ng-template> --\x3e\n </farris-combo-list>\n </div>\n </div>\n </div>\n <table *ngIf="!file.isUploading">\n <tr style="height: 20px">\n <td style="width: 15px; vertical-align: middle; text-align: center">\n \x3c!-- <input type="checkbox" [id]="file.name" (click)="checkoutSelectFile(file.name)"> --\x3e\n <div class="farris-input-wrap" style="height: 20px" (click)="checkoutSelectFile(file)">\n <div class="custom-control custom-checkbox" style="margin: 4px 0 0;height: 20px;">\n <input class="custom-control-input" type="checkbox" [id]="file.name" [(ngModel)]="file.selectd">\n <label class="custom-control-label" style="padding: 0 0 10px 0; position: relative; top: -8px;"></label>\n </div>\n </div>\n </td>\n <td style="width: 120px; vertical-align: middle; text-align: center" [title]="file.name">\n {{file.picListDisplayName}}</td>\n </tr>\n </table>\n \x3c!-- <span>{{file.picListDisplayName}}</span> --\x3e\n \x3c!-- <p class="filename">{{file.picListDisplayName}}</p> --\x3e\n <button *ngIf="!file.isUploading && file.mouseOn" style="position: absolute; top: 0; right: 0px; width: 24px; height: 24px;" kendoButton [icon]="\'delete\'" (click)="listDeleteFile(file)"></button>\n \x3c!-- <button *ngIf="file.hasUploaded" class="k-primary" kendoButton [icon]="\'check\'" [disabled]="true"></button> --\x3e\n </li>\n </ul>\n <br>\n </div>\n\n <div class="queue_list" *ngIf="showType==1">\n <table>\n <tr style="height: 50px; table-layout:fixed;">\n <th style="width: 40px; vertical-align: middle; text-align: center">\n \x3c!-- <input type="checkbox" id="allCheckBox" (click)="selectAllFile()"> --\x3e\n <div class="farris-input-wrap" (click)="selectAllFile()">\n <div class="custom-control custom-checkbox" style="margin: 4px 0 0">\n <input class="custom-control-input" type="checkbox" id="allCheckBox" [(ngModel)]="fileAllSelected">\n <label class="custom-control-label" style="padding: 0"></label>\n </div>\n </div>\n </th>\n <th style="vertical-align: middle" [ngStyle]="queueListStyle">{{\'fileName\' | locale}}</th>\n <th style="width: 100px; vertical-align: middle">{{\'size\' | locale}}</th>\n <th style="width: 170px; vertical-align: middle; text-align: center">{{\'state\' | locale}}</th>\n <th *ngIf="haveExtensionProperty" style="width: 100px; vertical-align: middle; text-align: center">\n {{storageExtension.extensionName}}\n </th>\n <th style="width: 140px; vertical-align: middle; text-align: center">{{\'operation\' | locale}}</th>\n </tr>\n </table>\n <div style="height: 370px; overflow: auto;">\n <table>\n <tr *ngFor="let file of files" style="height: 40px">\n <td colspan="5" *ngIf="file.isUploading">\n \x3c!-- <div style="width:100%; display: table-cell; vertical-align: middle; text-align: center; "> --\x3e\n <div style="width: 500px;margin:0 auto">\n <farris-progress [percent]="file.uploadProcess" [status]="\'active\'">\n </farris-progress>\n </div>\n\n </td>\n <td *ngIf="!file.isUploading" style=" width: 40px; vertical-align: middle; text-align: center">\n \x3c!-- <input type="checkbox" [id]="file.name" (click)="checkoutSelectFile(file.name)"> --\x3e\n <div class="farris-input-wrap" (click)="checkoutSelectFile(file)">\n <div class="custom-control custom-checkbox" style="margin: 4px 0 0">\n <input class="custom-control-input" type="checkbox" [id]="file.name" [(ngModel)]="file.selectd">\n <label class="custom-control-label" style="padding: 0"></label>\n </div>\n </div>\n </td>\n <td *ngIf="!file.isUploading" style="vertical-align: middle" [ngStyle]="queueListStyle">\n {{file.queueListDisplayName}}</td>\n <td *ngIf="!file.isUploading" style="width: 100px; vertical-align: middle">{{file.size}}</td>\n <td *ngIf="!file.isUploading" style="text-align: center; width: 170px; vertical-align: middle;">\n <table *ngIf="!file.uploadResult" style="margin: 0 auto">\n <tr style="margin: 0 auto">\n <td><span class="f-icon f-icon-error"></span></td>\n <td> {{\'uploadFailure\' | locale}} </td>\n <td><button style="height: 24px" class="btn-link btn ng-star-inserted" (click)="showErrorMessage(file)">{{\'detail\' | locale}}</button></td>\n </tr>\n </table>\n \x3c!-- <span *ngIf="!file.uploadResult"><span class="f-icon f-icon-error"></span> 上传失败 <button\n class="btn-link btn ng-star-inserted" (click)="showErrorMessage(file)">详情</button></span> --\x3e\n <span *ngIf="file.uploadResult"><span class="f-icon f-icon-success"></span> {{\'uploadSucceed\' | locale}}</span>\n </td>\n <td *ngIf="!file.isUploading&&haveExtensionProperty" style="text-align: center; width: 100px; vertical-align: middle;">\n <farris-combo-list [(ngModel)]="file.extensionDropListId" [data]="propertiesNames" [idField]="\'id\'" [textField]="\'name\'" (selectChange)="typeChange($event,file)" [enableClear]="false">\n \x3c!-- <ng-template #itemTemp let-item>\n <div class="combo-list">\n <span [class]="\'combo-list-circle combo-list-\'+item.state"></span>\n <span class="combo-list-label">{{item.label}}</span>\n </div>\n </ng-template> --\x3e\n </farris-combo-list>\n </td>\n <td *ngIf="!file.isUploading" style="text-align: center; width: 140px; vertical-align: middle;">\n \x3c!-- <button *ngIf="file.uploadResult" class="btn-link btn ng-star-inserted" (click)="retryUploadFile(file.name)">重试</button> --\x3e\n <button class="btn-link btn ng-star-inserted" style="margin: 0 auto" (click)="listDeleteFile(file)">{{\'delete\' | locale}}</button>\n </td>\n\n </tr>\n </table>\n </div>\n </div>\n</div>\n\n<div *ngIf="!hasSelectedFile" class=\'home_page\'>\n <img [src]="uploadIconAddress">\n <div>\n <span class="btn btn-primary btn-lg">上传文件 </span>\n <input type="file" (change)="fileSelected($event)" id="file" multiple="multiple" title="" [accept]="fileType">\n </div>\n</div>',styles:[".home_page{text-align:center}.home_page img{position:absolute;top:180px;margin-left:-35px;width:70px;height:56px}.home_page div{position:absolute;left:50%;top:255px;margin-left:-75px;width:150px;height:32px;overflow:hidden}.home_page div span{width:150px;height:32px;position:absolute;z-index:10;left:0}.home_page div input{position:absolute;left:0;top:0;opacity:0;filter:'alpha(opacity=0)';z-index:11}.upload_button{width:110px;height:32px;overflow:hidden}.upload_button span{position:relative;right:-4px;top:4px;width:56px;height:22px;font-size:14px}.upload_button input{height:32px;width:110px;position:absolute;left:22px;top:12px;opacity:0;filter:'alpha(opacity=0)';overflow:hidden}.upload_button img{position:relative;left:-6px;top:3px;width:14px;height:14px}.button_group_upload{position:absolute;right:18px;top:12px;height:26px;width:53px}.button_group_upload button{height:26px;width:26px}.fileinput-button{position:absolute;right:60px;bottom:40px;overflow:hidden;width:24px;height:24px;border-radius:12px;transform:scale(2.5);-ms-transform:scale(2.5);-moz-transform:scale(2.5);-webkit-transform:scale(2.5);-o-transform:scale(2.5);color:#0686fd}.fileinput-button input{position:absolute;left:0;top:0;opacity:0;filter:'alpha(opacity=0)'}.pic-droplist{height:24px;color:#e0e1e2;background-color:#e0e1e2}.pic-droplist input-group{display:table-cell;width:100px;text-align:center;border:0}.pic-droplist input-group div{border:0}.pic-droplist input-group div div,.pic-droplist input-group div input{background-color:#e0e1e2}.pic_list{padding:0;height:420px;overflow-y:auto;overflow-x:hidden}.pic_list ul{padding:0;list-style:none;width:100%;margin:20px 0 0 20px}.pic_list ul li{height:180px;width:135px;margin:8px 0 8px 12px;float:left;overflow:hidden;align-items:center;position:relative}.pic_list ul li div{width:135px;height:160px;margin:auto;display:table-cell;vertical-align:middle;text-align:center;position:relative}.pic_list ul li div img{max-width:120px;max-height:118px;align-items:center;margin:auto;vertical-align:middle;text-align:center}.pic_list ul li span.filename{width:100px;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.queue_list{display:block;height:420px;overflow-y:auto}.file_list{list-style:none;margin:0;padding:0;overflow-x:hidden;overflow-y:auto}.file_list li{height:50px;line-height:35px;font-size:16px;position:relative}.file_list li button{float:right;top:6px;right:10px;width:20px}.file_list li p.title{padding:0 0 0 6px;margin:0 210px 0 0}.file_list li p.size{position:absolute;width:100px;top:0;right:100px}"]}]}],e.ctorParameters=function(){return[{type:a.MessagerService},{type:U},{type:r.LoadingService},{type:h.Injector}]},e.propDecorators={formId:[{type:h.Input}],rootId:[{type:h.Input}],fileType:[{type:h.Input}],fileCount:[{type:h.Input}],oldIdList:[{type:h.Input}],opCell:[{type:h.ViewChild,args:["opCell"]}]},e}(),O=function(){function e(){}return e.prototype.getDownloadUrl=function(e,t){return"/api/runtime/dfs/v1.0/doc/filecontent?metadataid="+e+"&rootid="+t+"&token="+this.getToken(this.mergeString(e,t))},e.prototype.getMultipleDownloadUrl=function(e,t){var i=JSON.parse(e);return"/api/runtime/dfs/v1.0/doc/multiple/download?metadataidlist="+e+"&rootid="+t+"&token="+this.getToken(this.mergeString(i[0],t))},e.prototype.getMultipleDownloadUrlWithName=function(e,t,i){var o=JSON.parse(e);return null!=i&&""!=i||(i="unifile.zip"),i.endsWith(".zip")||(i+=".zip"),"/api/runtime/dfs/v1.0/doc/compress/download?metadataidlist="+e+"&rootid="+t+"&token="+this.getToken(this.mergeString(o[0],t))+"&zipName="+encodeURIComponent(i)},e.prototype.getHistoryDownloadUrl=function(e,t,i){return"/api/runtime/dfs/v1.0/doc/historycontent?metadataid="+e+"&rootid="+t+"&version="+i+"&token="+this.getToken(this.mergeString(e,t))},e.prototype.mergeString=function(e,t){var i=e.length<t.length?e.length:t.length,o="",l=0;for(l=0;l<i;l++)o+=e.substring(l,l+1),o+=t.substring(l,l+1);return o+=e.length<t.length?t.substring(l):e.substring(l)},e.prototype.getToken=function(e){var t=[1,2,3];24<e.length&&(e=e.substring(0,24));var i=Math.floor(e.length/3),o=e.substring(0,i),l=e.substring(i,2*i),n=e.substring(2*i,3*i),s=[],a=Math.ceil(3*Math.random());s.push(t[a-1]),t.splice(a-1,1),a=Math.ceil(2*Math.random()),s.push(t[a-1]),t.splice(a-1,1),s.push(t[0]);var r=Math.round((new Date).getTime()/1e3)+"";return r.substring(0,5)+"times"+s[0]+s[1]+s[2]+this.switchStr(o,l,n,s[0])+this.switchStr(o,l,n,s[1])+this.switchStr(o,l,n,s[2])+"times"+r.substring(5)},e.prototype.switchStr=function(e,t,i,o){switch(o){case 1:return e;case 2:return t;case 3:return i}},e.decorators=[{type:h.Injectable}],e.ctorParameters=function(){return[]},e}(),z={"zh-CHS":{uploadFile:"上传文件",uploading:"正在上传文件……",selectedCount:"已选择文件数量:",limitCount:"超出系统限制数量:",rechooseFile:",重新选择上传文件。",save:"保存",cancel:"取消",haveSameName:"已上传过同名文件: ",rename:"重命名",replace:"替换",sizeZero:"文件大小为0",uploadFailure:"上传失败",uploadSucceed:"上传成功",wait:"等一下,文档正在上传。",saveTo:"正在将文件保存到","delete":"删除",selectAll:"全选",selectNull:"全不选",detail:"详情",fileName:"文件名",state:"状态",operation:"操作",size:"大小",close:"关闭",loading:"拼命加载中"},"en-US":{uploadFile:"Upload File",uploading:"File Uploading……",selectedCount:"Selected files count:",limitCount:"System limit count:",rechooseFile:",Reselect upload file.",save:"Save",cancel:"Cancel",haveSameName:"A file with the same name has been uploaded: ",rename:"Rename",replace:"Replace",sizeZero:"File size is 0",uploadFailure:"Upload failed",uploadSucceed:"Upload successfully",wait:"Wait a minute, the file is uploading.",saveTo:"Saving file to","delete":"Delete",selectAll:"Select all",selectNull:"Not at all",detail:"Details",fileName:"Filename",state:"State",operation:"Operation",size:"Size",close:"Close",loading:"Loading"},en:{uploadFile:"Upload File",uploading:"File Uploading……",selectedCount:"Selected files count:",limitCount:"System limit count:",rechooseFile:",Reselect upload file.",save:"Save",cancel:"Cancel",haveSameName:"A file with the same name has been uploaded: ",rename:"Rename",replace:"Replace",sizeZero:"File size is 0",uploadFailure:"Upload failed",uploadSucceed:"Upload successfully",wait:"Wait a minute, the file is uploading.",saveTo:"Saving file to","delete":"Delete",selectAll:"Select all",selectNull:"Not at all",detail:"Details",fileName:"Filename",state:"State",operation:"Operation",size:"Size",close:"Close",loading:"Loading"},"zh-CHT":{uploadFile:"上傳文件",uploading:"正在上傳文件……",selectedCount:"已選擇文件數量:",limitCount:"超出系統限制數量:",rechooseFile:",重新選擇上傳文件。",save:"保存",cancel:"取消",haveSameName:"已上傳過同名文件: ",rename:"重命名",replace:"替換",sizeZero:"文件大小為0",uploadFailure:"上傳失敗",uploadSucceed:"上傳成功",wait:"等一下,文件正在上傳。",saveTo:"正在將文件保存到","delete":"删除",selectAll:"全選",selectNull:"全不選",detail:"詳情",fileName:"文件名",state:"狀態",operation:"操作",size:"大小",close:"關閉",loading:"拼命加載中"}},A=function(){function e(e){this.defaultLang="zh-CHS",this.langCode=localStorage.getItem("languageCode")||e||this.defaultLang,this.lang=z[this.langCode]||z[this.defaultLang]}return e.prototype.transform=function(e){return this.lang[e]||e},e.decorators=[{type:h.Pipe,args:[{name:"locale"}]}],e.ctorParameters=function(){return[{type:String,decorators:[{type:h.Inject,args:[h.LOCALE_ID]}]}]},e}(),_=localStorage.getItem("languageCode")||"zh-CHS",R=function(){function e(){}return e.decorators=[{type:h.NgModule,args:[{declarations:[E,A],imports:[i.CommonModule,n.ButtonsModule,v.NotifyModule,a.MessagerModule.forRoot(),r.LoadingModule.forRoot(),p.ProgressModule,c.FormsModule,u.ComboListModule],exports:[E],entryComponents:[E],providers:[U,O,f.LanguageService,{provide:h.LOCALE_ID,useValue:_}]}]}],e}(),q=R,j=function(){function e(e){this.modalService=e,this.metadataIdList=[]}return e.prototype.ngOnInit=function(){},e.prototype.showDialog=function(){var e=this;this.dlg=this.modalService.show(E,{title:"选择文件",width:800,height:500,buttons:[{text:"上传",cls:"k-button k-button-icontext k-primary",iconCls:"k-icon k-i-check",handle:function(){e.fileUpload.upload(),e.dlg.close()}},{text:"关闭",cls:"k-button k-button-icontext",iconCls:"k-icon k-i-close",handle:function(){e.fileUpload.cancel(),e.dlg.close()}}],showButtons:!0}),this.dlg.content.formId=this.formId},e.decorators=[{type:h.Component,args:[{selector:"app-uploaddialog",template:"\n",styles:[""]}]}],e.ctorParameters=function(){return[{type:g.BsModalService}]},e.propDecorators={formId:[{type:h.Input}],fileUpload:[{type:h.ViewChild,args:[E]}]},e}(),B=function(){function e(e,t,i){this.modalService=e,this.componentFactoryResolver=t,this.injector=i,this.fileInfoList=[],this.injector&&(this.modalService=this.injector.get(g.BsModalService),this.localeid=localStorage.getItem("languageCode")||this.injector.get(h.LOCALE_ID),this.localpipe=new A(this.localeid))}return e.prototype.showDialog=function(i,o){var l=this,n=0;return new Promise(function(t){var e=l.componentFactoryResolver.resolveComponentFactory(E).create(l.injector);e.instance.rootId=o,e.instance.formId=i,l.dlg=l.modalService.show(e,{title:l.localpipe.transform("uploadFile"),width:950,height:570,buttons:[{text:l.localpipe.transform("save"),cls:"k-button k-button-icontext k-primary",handle:function(){l.dlg.content.upload().subscribe(function(e){e&&(t(e),n=1,l.dlg.close())})}},{text:l.localpipe.transform("close"),cls:"k-button k-button-icontext",handle:function(){l.dlg.close()}}],showButtons:!0,showMaxButton:!1,beforeClose:function(){return 0==n&&l.dlg.content.cancel(),m.of(!0)}})})},e.prototype.uploadFile=function(e,t,i){return void 0===i&&(i=[]),this.uploadFileWithLimit(e,t,null,i)},e.prototype.uploadFileWithLimit=function(i,o,l,n){var s=this;void 0===n&&(n=[]);var a=0;return new Promise(function(t){var e=s.componentFactoryResolver.resolveComponentFactory(E).create(s.injector);null!=l&&(e.instance.fileCount=l.fileCount,null!=l.fileType&&""!=l.fileType&&(e.instance.fileType=l.fileType)),e.instance.rootId=o,e.instance.formId=i,e.instance.oldIdList=n,s.dlg=s.modalService.show(e,{title:s.localpipe.transform("uploadFile"),width:950,height:570,buttons:[{text:s.localpipe.transform("save"),cls:"k-button k-button-icontext k-primary",handle:function(){s.dlg.content.upload().subscribe(function(e){e&&(t(e),a=1,s.dlg.close())})}},{text:s.localpipe.transform("close"),cls:"k-button k-button-icontext",handle:function(){s.dlg.close()}}],showButtons:!0,showMaxButton:!1,beforeClose:function(){return 0==a&&s.dlg.content.cancel(),m.of(!0)}})})},e.decorators=[{type:h.Injectable}],e.ctorParameters=function(){return[{type:g.BsModalService},{type:h.ComponentFactoryResolver},{type:h.Injector}]},e}(),W=function(){function e(){}return e.decorators=[{type:h.NgModule,args:[{declarations:[j],imports:[i.CommonModule,t.FarrisDialogModule,a.MessagerModule.forRoot(),R,n.ButtonsModule,v.NotifyModule.forRoot(),x.HttpClientModule],exports:[j,E],entryComponents:[j,E],providers:[g.BsModalService,f.HttpService,B,U]}]}],e}(),G=function te(){this.fileType="*",this.fileCount=0},H=function ie(){},V=function oe(){},Z=function le(){};e.FormdocUploadService=y,e.FormdocUploadComponent=b,e.FormdocUploadModule=F,e.UploadDialogMoudle=W,e.UploadDialogComponent=j,e.UploadDialogService=B,e.UploadService=U,e.DownloadService=O,e.FileUploadComponent=E,e.UploadFileInfo=M,e.UploadModule=R,e.ɵa=q,e.UploadLimit=G,e.GspFormDocOperateEntity=C,e.GspFormRemoveListEntity=k,e.GspFormUploadListEntity=H,e.GspFormDocInfo=S,e.GspDocMetaProperty=V,e.GspFormUploadEntity=T,e.FileInfo=Z,e.OperatingModes=L,e.FileState=P,e.ɵb=A,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
2
2
|
//# sourceMappingURL=gsp-svc-formdoc-upload.umd.min.js.map
|