@gsp-svc/formdoc-upload 0.1.39 → 0.2.1

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.
Files changed (52) hide show
  1. package/bundles/gsp-svc-formdoc-upload.umd.js +315 -188
  2. package/bundles/gsp-svc-formdoc-upload.umd.js.map +1 -1
  3. package/bundles/gsp-svc-formdoc-upload.umd.min.js +1 -1
  4. package/bundles/gsp-svc-formdoc-upload.umd.min.js.map +1 -1
  5. package/esm2015/lib/i18n/language.resource.js +9 -5
  6. package/esm2015/lib/upload/download.service.js +9 -1
  7. package/esm2015/lib/upload/entity/completemultiuploadrequest.js +21 -0
  8. package/esm2015/lib/upload/entity/{gspdocsecuritynaseinfo.js → gspdocsecuritybaseinfo.js} +1 -1
  9. package/esm2015/lib/upload/entity/gspformstreamentity.js +25 -0
  10. package/esm2015/lib/upload/entity/gspformuploadentity.js +1 -1
  11. package/esm2015/lib/upload/entity/initmultiuploadrequest.js +19 -0
  12. package/esm2015/lib/upload/entity/multiuploadrequest.js +21 -0
  13. package/esm2015/lib/upload/entity/multiuploadresult.js +13 -0
  14. package/esm2015/lib/upload/entity/uploadlimit.js +1 -1
  15. package/esm2015/lib/upload/file-upload/file-upload.component.js +234 -129
  16. package/esm2015/lib/upload/upload.module.js +3 -3
  17. package/esm2015/lib/upload/upload.service.js +3 -22
  18. package/esm2015/lib/uploaddialog/uploaddialog.module.js +1 -3
  19. package/esm2015/public-api.js +2 -2
  20. package/esm5/lib/i18n/language.resource.js +9 -5
  21. package/esm5/lib/upload/download.service.js +14 -1
  22. package/esm5/lib/upload/entity/completemultiuploadrequest.js +25 -0
  23. package/esm5/lib/upload/entity/{gspdocsecuritynaseinfo.js → gspdocsecuritybaseinfo.js} +1 -1
  24. package/esm5/lib/upload/entity/gspformstreamentity.js +29 -0
  25. package/esm5/lib/upload/entity/gspformuploadentity.js +1 -1
  26. package/esm5/lib/upload/entity/initmultiuploadrequest.js +23 -0
  27. package/esm5/lib/upload/entity/multiuploadrequest.js +25 -0
  28. package/esm5/lib/upload/entity/multiuploadresult.js +17 -0
  29. package/esm5/lib/upload/entity/uploadlimit.js +1 -1
  30. package/esm5/lib/upload/file-upload/file-upload.component.js +248 -139
  31. package/esm5/lib/upload/upload.module.js +3 -3
  32. package/esm5/lib/upload/upload.service.js +3 -26
  33. package/esm5/lib/uploaddialog/uploaddialog.module.js +1 -3
  34. package/esm5/public-api.js +2 -2
  35. package/fesm2015/gsp-svc-formdoc-upload.js +287 -168
  36. package/fesm2015/gsp-svc-formdoc-upload.js.map +1 -1
  37. package/fesm5/gsp-svc-formdoc-upload.js +325 -189
  38. package/fesm5/gsp-svc-formdoc-upload.js.map +1 -1
  39. package/gsp-svc-formdoc-upload.metadata.json +1 -1
  40. package/lib/i18n/language.resource.d.ts +4 -0
  41. package/lib/upload/download.service.d.ts +1 -0
  42. package/lib/upload/entity/completemultiuploadrequest.d.ts +9 -0
  43. package/lib/upload/entity/gspformstreamentity.d.ts +12 -0
  44. package/lib/upload/entity/initmultiuploadrequest.d.ts +7 -0
  45. package/lib/upload/entity/multiuploadrequest.d.ts +8 -0
  46. package/lib/upload/entity/multiuploadresult.d.ts +4 -0
  47. package/lib/upload/entity/uploadlimit.d.ts +1 -1
  48. package/lib/upload/file-upload/file-upload.component.d.ts +9 -4
  49. package/lib/upload/upload.service.d.ts +2 -3
  50. package/package.json +1 -1
  51. package/public-api.d.ts +1 -1
  52. /package/lib/upload/entity/{gspdocsecuritynaseinfo.d.ts → gspdocsecuritybaseinfo.d.ts} +0 -0
@@ -4,12 +4,12 @@ import { of } from 'rxjs/observable/of';
4
4
  import { catchError, tap, map } from 'rxjs/operators';
5
5
  import { UUID } from 'angular2-uuid';
6
6
  import { DomSanitizer } from '@angular/platform-browser';
7
- import { ButtonsModule } from '@progress/kendo-angular-buttons';
8
7
  import { MessagerService, MessagerModule } from '@farris/ui-messager';
9
8
  import { LoadingService, LoadingModule } from '@farris/ui-loading';
10
9
  import { ProgressModule } from '@farris/ui-progress';
11
10
  import { FormsModule } from '@angular/forms';
12
11
  import { ComboListModule } from '@farris/ui-combo-list';
12
+ import { FarrisFormsModule } from '@farris/ui-forms';
13
13
  import { CacheService, HttpService, LanguageService, SessionService } from '@ecp-caf/caf-common';
14
14
  import { Injectable, Pipe, Inject, LOCALE_ID, Component, Injector, ComponentFactoryResolver, ViewChild, Input, NgModule, defineInjectable } from '@angular/core';
15
15
  import { BsModalService } from '@farris/ui-modal';
@@ -99,13 +99,6 @@ DocType[DocType.Txt] = 'Txt';
99
99
  DocType[DocType.Image] = 'Image';
100
100
  DocType[DocType.Other] = 'Other';
101
101
 
102
- /**
103
- * @fileoverview added by tsickle
104
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
105
- */
106
- class GspFormDocInfo {
107
- }
108
-
109
102
  /**
110
103
  * @fileoverview added by tsickle
111
104
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -435,28 +428,9 @@ class UploadService {
435
428
  * @param {?} rootId
436
429
  * @return {?}
437
430
  */
438
- getRootSetting(rootId) {
439
- /** @type {?} */
440
- let url = "/api/runtime/dfs/v1.0/rootsetting/" + rootId;
441
- return this.http.get(url).pipe(tap((/**
442
- * @param {?} res
443
- * @return {?}
444
- */
445
- res => { })), catchError((/**
446
- * @param {?} error
447
- * @return {?}
448
- */
449
- (error) => {
450
- return of(error);
451
- })));
452
- }
453
- /**
454
- * @param {?} id
455
- * @return {?}
456
- */
457
- getValidation(id) {
431
+ getUploadInfo(rootId) {
458
432
  /** @type {?} */
459
- let url = "/api/runtime/dfs/v1.0/validation/" + id;
433
+ let url = "/api/runtime/dfs/v1.0/rootsetting/info?id=" + rootId;
460
434
  return this.http.get(url).pipe(tap((/**
461
435
  * @param {?} res
462
436
  * @return {?}
@@ -486,13 +460,6 @@ UploadService.ctorParameters = () => [
486
460
  class UploadFileInfo {
487
461
  }
488
462
 
489
- /**
490
- * @fileoverview added by tsickle
491
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
492
- */
493
- class GspFormUploadEntity {
494
- }
495
-
496
463
  /**
497
464
  * @fileoverview added by tsickle
498
465
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -544,7 +511,8 @@ const LANG_RESOURCES = {
544
511
  'operation': '操作',
545
512
  'size': '大小',
546
513
  'close': '关闭',
547
- 'loading': '拼命加载中'
514
+ 'loading': '拼命加载中',
515
+ 'mismatchChunkSize': '文档分片上传部分丢失,请重新上传,如果多次上传失败,请联系管理员。'
548
516
  },
549
517
  'en-US': {
550
518
  'uploadFile': 'Upload File',
@@ -572,7 +540,8 @@ const LANG_RESOURCES = {
572
540
  'operation': 'Operation',
573
541
  'size': 'Size',
574
542
  'close': 'Close',
575
- 'loading': 'Loading'
543
+ 'loading': 'Loading',
544
+ 'mismatchChunkSize': 'The partial upload of document shards is missing. Please upload again. If multiple uploads fail, please contact the administrator.'
576
545
  },
577
546
  'en': {
578
547
  'uploadFile': 'Upload File',
@@ -600,7 +569,8 @@ const LANG_RESOURCES = {
600
569
  'operation': 'Operation',
601
570
  'size': 'Size',
602
571
  'close': 'Close',
603
- 'loading': 'Loading'
572
+ 'loading': 'Loading',
573
+ 'mismatchChunkSize': 'The partial upload of document shards is missing. Please upload again. If multiple uploads fail, please contact the administrator.'
604
574
  },
605
575
  'zh-CHT': {
606
576
  'uploadFile': '上傳文件',
@@ -628,7 +598,8 @@ const LANG_RESOURCES = {
628
598
  'operation': '操作',
629
599
  'size': '大小',
630
600
  'close': '關閉',
631
- 'loading': '拼命加載中'
601
+ 'loading': '拼命加載中',
602
+ 'mismatchChunkSize': '文檔分片上傳部分遺失,請重新上傳,如果多次上傳失敗,請聯系管理員。'
632
603
  },
633
604
  };
634
605
 
@@ -668,6 +639,34 @@ LocalLangPipe.ctorParameters = () => [
668
639
  class GspDocSecurityBaseInfo {
669
640
  }
670
641
 
642
+ /**
643
+ * @fileoverview added by tsickle
644
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
645
+ */
646
+ class InitMultiUploadRequest {
647
+ }
648
+
649
+ /**
650
+ * @fileoverview added by tsickle
651
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
652
+ */
653
+ class CompleteMultiUploadRequest {
654
+ }
655
+
656
+ /**
657
+ * @fileoverview added by tsickle
658
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
659
+ */
660
+ class GspFormStreamEntity {
661
+ }
662
+
663
+ /**
664
+ * @fileoverview added by tsickle
665
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
666
+ */
667
+ class MultiUploadRequest {
668
+ }
669
+
671
670
  /**
672
671
  * @fileoverview added by tsickle
673
672
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -693,7 +692,7 @@ class FileUploadComponent {
693
692
  this.beyondFileList = [];
694
693
  this.showType = 0;
695
694
  this.mouseOn = false;
696
- this.bufferSize = 10 * 1024 * 1024;
695
+ this.bufferSize = 5 * 1024 * 1024;
697
696
  this.selectedFileCount = 0;
698
697
  this.uploadIconAddress = '/platform/runtime/dfs/images/upload.svg';
699
698
  this.uploadLittleIconAddress = '/platform/runtime/dfs/images/uploadIcon.svg';
@@ -701,8 +700,6 @@ class FileUploadComponent {
701
700
  this.fileAllSelected = false;
702
701
  this.uploadProcess = { width: '0%' };
703
702
  this.fileTotalChunk = {};
704
- //fileUploadState: { [key: string]: boolean } = {};
705
- //flag: number = 0;
706
703
  this.requestArray = new Array;
707
704
  this.requestBodyArray = new Array;
708
705
  this.uploadedChunk = {};
@@ -783,14 +780,15 @@ class FileUploadComponent {
783
780
  this.haveExtensionProperty = true;
784
781
  }
785
782
  }));
786
- this.uploadService.getRootSetting(this.rootId).subscribe((/**
783
+ this.uploadService.getUploadInfo(this.rootId).subscribe((/**
787
784
  * @param {?} res
788
785
  * @return {?}
789
786
  */
790
787
  res => {
791
788
  if (res != null && res.error == null) {
792
789
  this.sameNameAllowed = res.sameNameAllowed;
793
- this.validationId = res.validationId;
790
+ this.maxFileSize = parseInt(JSON.parse(res.validateConfiguration).maxFileSize);
791
+ this.allowedMultiUpload = res.allowedMultiUpload;
794
792
  if (!this.sameNameAllowed) {
795
793
  this.uploadService.getUploadedFileInfoList(this.formId, this.rootId).subscribe((/**
796
794
  * @param {?} res
@@ -803,18 +801,10 @@ class FileUploadComponent {
803
801
  }
804
802
  }));
805
803
  }
806
- this.uploadService.getValidation(this.validationId).subscribe((/**
807
- * @param {?} res
808
- * @return {?}
809
- */
810
- res => {
811
- this.maxFileSize = parseInt(JSON.parse(res.configuration).maxFileSize);
812
- }));
813
804
  }
814
805
  }));
815
- if (this.oldIdList != null && this.oldIdList.length > 0) {
816
- this.uploadService.cancel(this.oldIdList, this.rootId).subscribe();
817
- }
806
+ if (this.oldIdList != null && this.oldIdList.length > 0) ;
807
+ this.radioButtonGroupValue = 'showByGroup';
818
808
  }
819
809
  /**
820
810
  * @return {?}
@@ -831,11 +821,6 @@ class FileUploadComponent {
831
821
  * @return {?}
832
822
  */
833
823
  fileSelected($event) {
834
- // const loading = this.loadService.show({
835
- // message: this.localepipe.transform('uploading')
836
- // });
837
- // this.totalLoad.close();
838
- // this.totalLoad = null;
839
824
  this.hasSelectedFile = true;
840
825
  this.selectedFiles = document.querySelector('#file');
841
826
  if (this.fileCount > 0) {
@@ -869,11 +854,6 @@ class FileUploadComponent {
869
854
  * @return {?}
870
855
  */
871
856
  x => x.fileName == selectedFile.name)) != null) {
872
- // this.uploadedNameList.push(selectedFile.name);
873
- // this.msgService.question('之前已上传过同名文件: ' + selectedFile.name + ',需要替换么?', () => {
874
- // uuid = this.uploadedFileInfoList.find(x => x.fileName == selectedFile.name).metadataId;
875
- // this.uploadFile(uuid, selectedFile);
876
- // })
877
857
  /** @type {?} */
878
858
  const msg = this.msgService.show('warning', this.localepipe.transform('haveSameName') + selectedFile.name, {
879
859
  initialState: {
@@ -956,11 +936,6 @@ class FileUploadComponent {
956
936
  }
957
937
  this.uploadFile(uuid, selectedFile, selectedFile.name);
958
938
  }
959
- // if (this.uploadedNameList.length > 0) {
960
- // let name: string = this.listToString(this.uploadedNameList);
961
- // this.msgService.warning('之前已上传过同名文件: ' + name + '请重新选择上传文件。');
962
- // this.uploadedNameList = [];
963
- // }
964
939
  if (this.errFileList.length > 0) {
965
940
  /** @type {?} */
966
941
  let name = this.listToString(this.errFileList);
@@ -981,11 +956,6 @@ class FileUploadComponent {
981
956
  this.msgService.warning(name + this.localepipe.transform('sizeMax') + this.maxFileSize + "KB" + this.localepipe.transform('rechooseFile'));
982
957
  this.beyondFileList = [];
983
958
  }
984
- // if (this.errTypeList.length > 0) {
985
- // let type: string = this.listToString(this.errTypeList);
986
- // this.msgService.warning('不支持上传类型为 ' + type + '的文件请重新选择上传文件。');
987
- // this.errTypeList = [];
988
- // }
989
959
  this.files = this.files.slice();
990
960
  this.fileAllSelected = false;
991
961
  $event.target.value = '';
@@ -1073,60 +1043,145 @@ class FileUploadComponent {
1073
1043
  /** @type {?} */
1074
1044
  let fileInfo = this.handleFileInfo(uuid, selectedFile, fileName);
1075
1045
  /** @type {?} */
1076
- let chunkTotal = Math.ceil(selectedFile.size / this.bufferSize);
1077
- /** @type {?} */
1078
- let chunkIndex = 0;
1079
- this.fileTotalChunk[uuid] = chunkTotal;
1080
- /** @type {?} */
1081
1046
  let uploadFileInfo = new UploadFileInfo();
1082
1047
  uploadFileInfo.metadataId = uuid;
1083
1048
  uploadFileInfo.fileName = fileInfo.name;
1084
- uploadFileInfo.fileSize = fileInfo.size;
1049
+ uploadFileInfo.fileSize = fileInfo.fileSize;
1085
1050
  uploadFileInfo.state = state;
1086
1051
  uploadFileInfo.securityInfo = this.securityInfoList[0];
1087
- while (chunkIndex < chunkTotal) {
1088
- /** @type {?} */
1089
- let uploadInfo = new GspFormUploadEntity;
1090
- uploadInfo.formId = this.formId;
1091
- uploadInfo.mode = OperatingModes.Temp;
1092
- uploadInfo.rootId = this.rootId;
1093
- /** @type {?} */
1094
- let docInfo = new GspFormDocInfo;
1095
- docInfo.fileName = fileName;
1096
- docInfo.metadataId = uuid;
1097
- docInfo.total = chunkTotal;
1098
- this.uploadedChunk[docInfo.metadataId] = 0;
1099
- /** @type {?} */
1100
- let nextSize = Math.min((chunkIndex + 1) * this.bufferSize, selectedFile.size);
1052
+ //判断是否支持分片上传
1053
+ if (this.allowedMultiUpload) {
1054
+ //支持分片上传
1101
1055
  /** @type {?} */
1102
- let fileData = selectedFile.slice(chunkIndex * this.bufferSize, nextSize);
1103
- // let reader = new FileReader();
1104
- // reader.readAsBinaryString(fileData);
1056
+ let initRequest = new InitMultiUploadRequest;
1057
+ initRequest.path = this.formId;
1058
+ initRequest.metadataId = uuid;
1059
+ initRequest.rootId = this.rootId;
1060
+ initRequest.size = fileInfo.fileSize;
1061
+ initRequest.fileName = fileName;
1062
+ //初始化分片
1063
+ this.initMultiUpload(initRequest).subscribe((/**
1064
+ * @param {?} res
1065
+ * @return {?}
1066
+ */
1067
+ res => {
1068
+ if (res.error != null) {
1069
+ this.files[this.files.indexOf(fileInfo)].uploadResult = false;
1070
+ this.files[this.files.indexOf(fileInfo)].isUploading = false;
1071
+ this.files[this.files.indexOf(fileInfo)].errorMessage = res.error.Message;
1072
+ }
1073
+ else {
1074
+ /** @type {?} */
1075
+ let uploadId = res.uploadId;
1076
+ /** @type {?} */
1077
+ let chunkTotal = Math.ceil(selectedFile.size / this.bufferSize);
1078
+ /** @type {?} */
1079
+ let chunkIndex = 0;
1080
+ /** @type {?} */
1081
+ let multiResultList = [];
1082
+ this.fileTotalChunk[uuid] = chunkTotal;
1083
+ this.uploadedChunk[uuid] = 0;
1084
+ while (chunkIndex < chunkTotal) {
1085
+ /** @type {?} */
1086
+ let nextSize = Math.min((chunkIndex + 1) * this.bufferSize, selectedFile.size);
1087
+ /** @type {?} */
1088
+ let fileData = selectedFile.slice(chunkIndex * this.bufferSize, nextSize);
1089
+ /** @type {?} */
1090
+ let multiRequest = new MultiUploadRequest;
1091
+ multiRequest.metadataId = uuid;
1092
+ multiRequest.rootId = this.rootId;
1093
+ multiRequest.uploadId = uploadId;
1094
+ multiRequest.index = chunkIndex;
1095
+ multiRequest.total = chunkTotal;
1096
+ multiRequest.size = fileData.size;
1097
+ /** @type {?} */
1098
+ let formData = new FormData();
1099
+ formData.append('multiRequest', JSON.stringify(multiRequest));
1100
+ formData.append('file', fileData);
1101
+ this.multiUpload(formData).subscribe((/**
1102
+ * @param {?} res
1103
+ * @return {?}
1104
+ */
1105
+ res => {
1106
+ if (res.error != null) {
1107
+ this.files[this.files.indexOf(fileInfo)].uploadResult = false;
1108
+ this.files[this.files.indexOf(fileInfo)].isUploading = false;
1109
+ this.files[this.files.indexOf(fileInfo)].errorMessage = res.error.Message;
1110
+ }
1111
+ else {
1112
+ multiResultList.push(res.result);
1113
+ this.uploadedChunk[uuid]++;
1114
+ this.files[this.files.indexOf(fileInfo)].uploadProcess = Number.parseInt((this.uploadedChunk[uuid] / this.fileTotalChunk[uuid] * 100).toFixed(0));
1115
+ if (this.uploadedChunk[uuid] == this.fileTotalChunk[uuid]) {
1116
+ if (multiResultList.length == this.fileTotalChunk[uuid]) {
1117
+ this.files[this.files.indexOf(fileInfo)].uploadResult = true;
1118
+ this.files[this.files.indexOf(fileInfo)].isUploading = false;
1119
+ this.uploadFileInfoList = this.uploadFileInfoList.concat(uploadFileInfo);
1120
+ this.uploadedFileInfoList = this.uploadedFileInfoList.concat(uploadFileInfo);
1121
+ this.uploadedFileTotal++;
1122
+ /** @type {?} */
1123
+ let completeMultiUploadRequest = new CompleteMultiUploadRequest;
1124
+ completeMultiUploadRequest.metadataId = uuid;
1125
+ completeMultiUploadRequest.partList = multiResultList;
1126
+ completeMultiUploadRequest.rootId = this.rootId;
1127
+ completeMultiUploadRequest.uploadId = uploadId;
1128
+ completeMultiUploadRequest.size = fileInfo.fileSize;
1129
+ if (this.haveExtensionProperty)
1130
+ completeMultiUploadRequest.exPropertyName = this.defaultPropertyName;
1131
+ this.completeMultiUpload(completeMultiUploadRequest).subscribe((/**
1132
+ * @param {?} res
1133
+ * @return {?}
1134
+ */
1135
+ res => {
1136
+ }));
1137
+ //后台异步拼接文档
1138
+ }
1139
+ else {
1140
+ this.files[this.files.indexOf(fileInfo)].uploadResult = false;
1141
+ this.files[this.files.indexOf(fileInfo)].isUploading = false;
1142
+ this.files[this.files.indexOf(fileInfo)].errorMessage = this.localepipe.transform('mismatchChunkSize');
1143
+ }
1144
+ }
1145
+ }
1146
+ }));
1147
+ chunkIndex = chunkIndex + 1;
1148
+ }
1149
+ }
1150
+ }));
1151
+ }
1152
+ else {
1105
1153
  /** @type {?} */
1106
- let innerIndex = chunkIndex;
1107
- // reader.onload = () => {
1108
- // docInfo.fileContent = btoa(reader.result.toString());
1109
- docInfo.size = selectedFile.size;
1110
- docInfo.index = innerIndex;
1111
- docInfo.fileContent = "";
1112
- //chunkIndex++;
1154
+ let entity = new GspFormStreamEntity;
1155
+ entity.formId = this.formId;
1156
+ entity.metadataId = uuid;
1157
+ entity.mode = OperatingModes.Temp;
1158
+ entity.rootId = this.rootId;
1159
+ entity.size = selectedFile.size;
1160
+ entity.fileName = fileName;
1113
1161
  if (this.haveExtensionProperty)
1114
- docInfo.exPropertyName = this.defaultPropertyName;
1115
- //docInfo.isLast = true;
1116
- uploadInfo.docInfo = docInfo;
1117
- // let info = uploadInfo;
1118
- // this.requestArray.push(this.uploadService.uploadFile(uploadInfo));
1119
- // this.requestBodyArray.push(info);
1120
- //封装请求formdata
1162
+ entity.exPropertyName = this.defaultPropertyName;
1121
1163
  /** @type {?} */
1122
1164
  let formData = new FormData();
1123
- formData.append('uploadInfo', JSON.stringify(uploadInfo));
1124
- formData.append('docInfo', JSON.stringify(docInfo));
1125
- formData.append('file', fileData);
1126
- this.sendUploadRequest(formData, fileInfo, docInfo, uploadFileInfo);
1127
- // }
1128
- //console.log(chunkIndex + 1);
1129
- chunkIndex = chunkIndex + 1;
1165
+ formData.append('uploadEntity', JSON.stringify(entity));
1166
+ formData.append('file', selectedFile);
1167
+ this.uploadSingleFile(formData).subscribe((/**
1168
+ * @param {?} res
1169
+ * @return {?}
1170
+ */
1171
+ res => {
1172
+ if (res != null) {
1173
+ this.files[this.files.indexOf(fileInfo)].uploadResult = false;
1174
+ this.files[this.files.indexOf(fileInfo)].isUploading = false;
1175
+ this.files[this.files.indexOf(fileInfo)].errorMessage = res.error.Message;
1176
+ }
1177
+ else {
1178
+ this.files[this.files.indexOf(fileInfo)].uploadResult = true;
1179
+ this.files[this.files.indexOf(fileInfo)].isUploading = false;
1180
+ this.uploadFileInfoList = this.uploadFileInfoList.concat(uploadFileInfo);
1181
+ this.uploadedFileInfoList = this.uploadedFileInfoList.concat(uploadFileInfo);
1182
+ this.uploadedFileTotal++;
1183
+ }
1184
+ }));
1130
1185
  }
1131
1186
  /** @type {?} */
1132
1187
  let index = -1;
@@ -1144,39 +1199,27 @@ class FileUploadComponent {
1144
1199
  this.files.splice(index, 1);
1145
1200
  this.uploadFileInfoList.splice(index, 1);
1146
1201
  this.uploadedFileInfoList.splice(index, 1);
1147
- this.uploadedFileTotal--;
1202
+ //this.uploadedFileTotal--;
1148
1203
  }
1149
1204
  }
1150
1205
  /**
1151
- * @param {?} formData
1152
- * @param {?} fileInfo
1153
- * @param {?} docInfo
1154
- * @param {?} uploadFileInfo
1206
+ * @param {?} formdata
1155
1207
  * @return {?}
1156
1208
  */
1157
- sendUploadRequest(formData, fileInfo, docInfo, uploadFileInfo) {
1158
- this.uploadSliceFile(formData).subscribe((/**
1209
+ uploadSingleFile(formdata) {
1210
+ /** @type {?} */
1211
+ let url = "/api/runtime/dfs/v1.0/formdoc/single";
1212
+ return this.httpclient.post(url, formdata).pipe(tap((/**
1159
1213
  * @param {?} res
1160
1214
  * @return {?}
1161
1215
  */
1162
- res => {
1163
- if (res != null) {
1164
- this.files[this.files.indexOf(fileInfo)].uploadResult = false;
1165
- this.files[this.files.indexOf(fileInfo)].isUploading = false;
1166
- this.files[this.files.indexOf(fileInfo)].errorMessage = res.error.Message;
1167
- }
1168
- else {
1169
- this.uploadedChunk[docInfo.metadataId]++;
1170
- this.files[this.files.indexOf(fileInfo)].uploadProcess = Number.parseInt((this.uploadedChunk[docInfo.metadataId] / this.fileTotalChunk[docInfo.metadataId] * 100).toFixed(0));
1171
- if (this.uploadedChunk[docInfo.metadataId] == this.fileTotalChunk[docInfo.metadataId]) {
1172
- this.files[this.files.indexOf(fileInfo)].uploadResult = true;
1173
- this.files[this.files.indexOf(fileInfo)].isUploading = false;
1174
- this.uploadFileInfoList = this.uploadFileInfoList.concat(uploadFileInfo);
1175
- this.uploadedFileInfoList = this.uploadedFileInfoList.concat(uploadFileInfo);
1176
- this.uploadedFileTotal++;
1177
- }
1178
- }
1179
- }));
1216
+ res => { })), catchError((/**
1217
+ * @param {?} error
1218
+ * @return {?}
1219
+ */
1220
+ (error) => {
1221
+ return of$1(error);
1222
+ })));
1180
1223
  }
1181
1224
  /**
1182
1225
  * @param {?} formdata
@@ -1185,7 +1228,6 @@ class FileUploadComponent {
1185
1228
  uploadSliceFile(formdata) {
1186
1229
  /** @type {?} */
1187
1230
  let url = "/api/runtime/dfs/v1.0/formdoc/slice";
1188
- //url = "/api/runtime/dfs/v1.0/formdoc/list";
1189
1231
  return this.httpclient.post(url, formdata).pipe(tap((/**
1190
1232
  * @param {?} res
1191
1233
  * @return {?}
@@ -1198,6 +1240,63 @@ class FileUploadComponent {
1198
1240
  return of$1(error);
1199
1241
  })));
1200
1242
  }
1243
+ /**
1244
+ * @param {?} request
1245
+ * @return {?}
1246
+ */
1247
+ initMultiUpload(request) {
1248
+ /** @type {?} */
1249
+ let url = "/api/runtime/dfs/v1.0/formdoc/multi/init";
1250
+ return this.httpclient.post(url, request).pipe(tap((/**
1251
+ * @param {?} res
1252
+ * @return {?}
1253
+ */
1254
+ res => { })), catchError((/**
1255
+ * @param {?} error
1256
+ * @return {?}
1257
+ */
1258
+ (error) => {
1259
+ return of$1(error);
1260
+ })));
1261
+ }
1262
+ /**
1263
+ * @param {?} formdata
1264
+ * @return {?}
1265
+ */
1266
+ multiUpload(formdata) {
1267
+ /** @type {?} */
1268
+ let url = "/api/runtime/dfs/v1.0/formdoc/multi/upload";
1269
+ return this.httpclient.post(url, formdata).pipe(tap((/**
1270
+ * @param {?} res
1271
+ * @return {?}
1272
+ */
1273
+ res => { })), catchError((/**
1274
+ * @param {?} error
1275
+ * @return {?}
1276
+ */
1277
+ (error) => {
1278
+ return of$1(error);
1279
+ })));
1280
+ }
1281
+ /**
1282
+ * @param {?} request
1283
+ * @return {?}
1284
+ */
1285
+ completeMultiUpload(request) {
1286
+ /** @type {?} */
1287
+ let url = "/api/runtime/dfs/v1.0/formdoc/multi/complete";
1288
+ return this.httpclient.post(url, request).pipe(tap((/**
1289
+ * @param {?} res
1290
+ * @return {?}
1291
+ */
1292
+ res => { })), catchError((/**
1293
+ * @param {?} error
1294
+ * @return {?}
1295
+ */
1296
+ (error) => {
1297
+ return of$1(error);
1298
+ })));
1299
+ }
1201
1300
  /**
1202
1301
  * @return {?}
1203
1302
  */
@@ -1208,8 +1307,6 @@ class FileUploadComponent {
1208
1307
  * @return {?}
1209
1308
  */
1210
1309
  element => {
1211
- // let obj: any = document.getElementById(element.name);
1212
- // obj.checked = true;
1213
1310
  element.selectd = true;
1214
1311
  }));
1215
1312
  this.fileAllSelected = true;
@@ -1221,8 +1318,6 @@ class FileUploadComponent {
1221
1318
  * @return {?}
1222
1319
  */
1223
1320
  element => {
1224
- // let obj: any = document.getElementById(element.name);
1225
- // obj.checked = false;
1226
1321
  element.selectd = false;
1227
1322
  }));
1228
1323
  this.fileAllSelected = false;
@@ -1304,9 +1399,6 @@ class FileUploadComponent {
1304
1399
  metadataList.push(element.id);
1305
1400
  this.files.splice(this.files.indexOf(element), 1);
1306
1401
  if (element.uploadResult) {
1307
- // let idList: string[] = [];
1308
- // idList.push(fileInfo.id);
1309
- // this.uploadService.cancel(idList, this.rootId).subscribe();
1310
1402
  this.uploadFileInfoList.splice(this.uploadFileInfoList.indexOf(this.uploadFileInfoList.filter((/**
1311
1403
  * @param {?} x
1312
1404
  * @return {?}
@@ -1406,16 +1498,28 @@ class FileUploadComponent {
1406
1498
  }
1407
1499
  fileInfo.source = imgUrl;
1408
1500
  this.files.push(fileInfo);
1501
+ //因为异步处理的差异,补偿一次删除
1502
+ /** @type {?} */
1503
+ let index = -1;
1504
+ this.files.forEach((/**
1505
+ * @param {?} x
1506
+ * @return {?}
1507
+ */
1508
+ x => {
1509
+ if (x.name == fileInfo.name) {
1510
+ if (index == -1)
1511
+ index = this.files.indexOf(x);
1512
+ }
1513
+ }));
1514
+ if (index != -1 && index != this.files.length - 1) {
1515
+ this.files.splice(index, 1);
1516
+ this.uploadFileInfoList.splice(index, 1);
1517
+ this.uploadedFileInfoList.splice(index, 1);
1518
+ }
1409
1519
  });
1410
1520
  }
1411
1521
  }
1412
1522
  }
1413
- /**
1414
- * @param {?} selectdFile
1415
- * @return {?}
1416
- */
1417
- getImageUrl(selectdFile) {
1418
- }
1419
1523
  /**
1420
1524
  * @param {?} strList
1421
1525
  * @return {?}
@@ -1493,9 +1597,6 @@ class FileUploadComponent {
1493
1597
  * @return {?}
1494
1598
  */
1495
1599
  x => x.isUploading || x.uploadResult)).length) {
1496
- // this.notifyService.success(<NotifyOptions>{
1497
- // msg: '保存成功!', timeout: 3000
1498
- // });
1499
1600
  this.msgService.warning(this.localepipe.transform('wait'));
1500
1601
  return of$1(false);
1501
1602
  }
@@ -1565,9 +1666,6 @@ class FileUploadComponent {
1565
1666
  */
1566
1667
  x => x.metadataId == file.id)), 1);
1567
1668
  }
1568
- // var obj:any = document.querySelector('#file');
1569
- // obj.files.remove();
1570
- //obj.value='';
1571
1669
  }
1572
1670
  /**
1573
1671
  * @param {?} size
@@ -1620,8 +1718,8 @@ class FileUploadComponent {
1620
1718
  FileUploadComponent.decorators = [
1621
1719
  { type: Component, args: [{
1622
1720
  selector: 'app-file-upload',
1623
- 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\" (focus)=\"showLoading()\" (change)=\"fileSelected($event)\" id=\"file\" multiple=\"multiple\"\n title=\"\" [accept]=\"fileType\">\n </div>\n\n\n <button *ngIf=\"showType==0 && !fileAllSelected && files.length >0 \" style=\"padding-left: 20px\"\n 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\"\n class=\"btn-link btn ng-star-inserted\" (click)=\"selectAllFile()\">{{'selectNull' | locale}}</button>\n <button *ngIf=\"showType==0 && selectedFileCount>0\" style=\"padding-left: 20px\"\n class=\"btn-link btn ng-star-inserted\" (click)=\"listMultipleDeleteFile()\">{{'delete' | locale}}</button>\n\n <button *ngIf=\"showType==1 && selectedFileCount>0\" style=\"padding-left: 20px\"\n class=\"btn-link btn ng-star-inserted\" (click)=\"listMultipleDeleteFile()\">{{'delete' | locale}}</button>\n\n <kendo-buttongroup [selection]=\"'single'\" class=\"button_group_upload \"\n style=\"background-color: #ffffff; color: #388FFF;border: 1px solid #ddd;\" look=\"flat\">\n <button kendoButton [selected]=\"true\" [toggleable]=\"true\"\n [imageUrl]=\"'/platform/runtime/dfs/images/piclist.png'\" (click)=\"showByGroup()\"></button>\n <button kendoButton [toggleable]=\"true\" [imageUrl]=\"'/platform/runtime/dfs/images/queuelist.png'\"\n (click)=\"showByList()\"></button>\n </kendo-buttongroup>\n\n\n </div>\n\n <!-- <div class=\"progress\" style=\"height: 12px;\">\n <div class=\"progress-bar\" role=\"progressbar\" [ngStyle]=\"uploadProcess\"></div>\n </div> -->\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'\"\n [status]=\"'active'\"></farris-progress>\n </div>\n\n <table *ngIf=\"!file.uploadResult && !file.isUploading\"\n 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-warn\"></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; \"\n class=\"btn-link btn ng-star-inserted\" (click)=\"showErrorMessage(file)\">{{'detail' |\n 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\"\n 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\"\n [idField]=\"'id'\" [textField]=\"'name'\" (selectChange)=\"typeChange($event,file)\"\n [enableClear]=\"false\">\n <!-- <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> -->\n </farris-combo-list>\n </div>\n </div>\n <div *ngIf=\"haveSecurityInfo\"\n 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]=\"securityInfoList\"\n [idField]=\"'id'\" [textField]=\"'name'\" (selectChange)=\"securityChange($event,file)\"\n [enableClear]=\"false\">\n <!-- <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> -->\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 <!-- <input type=\"checkbox\" [id]=\"file.name\" (click)=\"checkoutSelectFile(file.name)\"> -->\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 [ngStyle]=\"checkboxPos\">\n <input class=\"custom-control-input\" type=\"checkbox\" [id]=\"file.name\"\n [(ngModel)]=\"file.selectd\">\n <label class=\"custom-control-label\"\n 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 <!-- <span>{{file.picListDisplayName}}</span> -->\n <!-- <p class=\"filename\">{{file.picListDisplayName}}</p> -->\n <button *ngIf=\"!file.isUploading && file.mouseOn\"\n style=\"position: absolute; top: 0; right: 0px; width: 24px; height: 24px;\" kendoButton\n [icon]=\"'delete'\" (click)=\"listDeleteFile(file)\"></button>\n <!-- <button *ngIf=\"file.hasUploaded\" class=\"k-primary\" kendoButton [icon]=\"'check'\" [disabled]=\"true\"></button> -->\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 <!-- <input type=\"checkbox\" id=\"allCheckBox\" (click)=\"selectAllFile()\"> -->\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\"\n [(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 <!-- <div style=\"width:100%; display: table-cell; vertical-align: middle; text-align: center; \"> -->\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 <!-- <input type=\"checkbox\" [id]=\"file.name\" (click)=\"checkoutSelectFile(file.name)\"> -->\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\"\n [(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\"\n (click)=\"showErrorMessage(file)\">{{'detail' | locale}}</button></td>\n </tr>\n </table>\n <!-- <span *ngIf=\"!file.uploadResult\"><span class=\"f-icon f-icon-error\"></span> \u4E0A\u4F20\u5931\u8D25 <button\n class=\"btn-link btn ng-star-inserted\" (click)=\"showErrorMessage(file)\">\u8BE6\u60C5</button></span> -->\n <span *ngIf=\"file.uploadResult\"><span class=\"f-icon f-icon-success\"></span> {{'uploadSucceed' |\n locale}}</span>\n </td>\n <td *ngIf=\"!file.isUploading&&haveExtensionProperty\"\n style=\"text-align: center; width: 100px; vertical-align: middle;\">\n <farris-combo-list [(ngModel)]=\"file.extensionDropListId\" [data]=\"propertiesNames\"\n [idField]=\"'id'\" [textField]=\"'name'\" (selectChange)=\"typeChange($event,file)\"\n [enableClear]=\"false\">\n <!-- <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> -->\n </farris-combo-list>\n </td>\n <td *ngIf=\"!file.isUploading&&haveSecurityInfo\"\n style=\"text-align: center; width: 100px; vertical-align: middle;\">\n <farris-combo-list [(ngModel)]=\"file.extensionDropListId\" [data]=\"securityInfoList\"\n [idField]=\"'id'\" [textField]=\"'name'\" (selectChange)=\"securityChange($event,file)\"\n [enableClear]=\"false\">\n <!-- <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> -->\n </farris-combo-list>\n </td>\n\n <td *ngIf=\"!file.isUploading\" style=\"text-align: center; width: 140px; vertical-align: middle;\">\n <!-- <button *ngIf=\"file.uploadResult\" class=\"btn-link btn ng-star-inserted\" (click)=\"retryUploadFile(file.name)\">\u91CD\u8BD5</button> -->\n <button class=\"btn-link btn ng-star-inserted\" style=\"margin: 0 auto\"\n (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\">{{'uploadFile' | locale}} </span>\n <input type=\"file\" (change)=\"fileSelected($event)\" id=\"file\" multiple=\"multiple\" title=\"\" [accept]=\"fileType\">\n <!-- <input type=\"file\" (focus)=\"showLoading()\" (change)=\"fileSelected($event)\" id=\"file\" multiple=\"multiple\" title=\"\" [accept]=\"fileType\"> -->\n </div>\n</div>",
1624
- 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:415px;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:179px;width:135px;margin:8px 0 8px 12px;float:left;overflow:hidden;align-items:center;position:relative}.pic_list ul li div{width:135px;height:159px;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}"]
1721
+ 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\" (focus)=\"showLoading()\" (change)=\"fileSelected($event)\" id=\"file\" multiple=\"multiple\"\n title=\"\" [accept]=\"fileType\">\n </div>\n\n\n <button *ngIf=\"showType==0 && !fileAllSelected && files.length >0 \" style=\"padding-left: 20px\"\n 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\"\n class=\"btn-link btn ng-star-inserted\" (click)=\"selectAllFile()\">{{'selectNull' | locale}}</button>\n <button *ngIf=\"showType==0 && selectedFileCount>0\" style=\"padding-left: 20px\"\n class=\"btn-link btn ng-star-inserted\" (click)=\"listMultipleDeleteFile()\">{{'delete' | locale}}</button>\n\n <button *ngIf=\"showType==1 && selectedFileCount>0\" style=\"padding-left: 20px\"\n class=\"btn-link btn ng-star-inserted\" (click)=\"listMultipleDeleteFile()\">{{'delete' | locale}}</button>\n\n <farris-radio-group class=\"button_group_upload\" [(model)]=\"radioButtonGroupValue\" [horizontal]=\"false\">\n <farris-radio-button [label]=\"'showByGroup'\" (click)=\"showByGroup()\">\n <span class=\"f-icon f-icon-sudoku-new\"> </span>\n </farris-radio-button>\n <farris-radio-button [label]=\"'showByList'\" (click)=\"showByList()\">\n <span class=\"f-icon f-icon-page-title-define\"> </span>\n </farris-radio-button>\n\n </farris-radio-group>\n\n <!-- <kendo-buttongroup [selection]=\"'single'\" class=\"button_group_upload \"\n style=\"background-color: #ffffff; color: #388FFF;border: 1px solid #ddd;\" look=\"flat\">\n <button kendoButton [selected]=\"true\" [toggleable]=\"true\"\n [imageUrl]=\"'/platform/runtime/dfs/images/piclist.png'\" (click)=\"showByGroup()\"></button>\n <button kendoButton [toggleable]=\"true\" [imageUrl]=\"'/platform/runtime/dfs/images/queuelist.png'\"\n (click)=\"showByList()\"></button>\n </kendo-buttongroup> -->\n\n\n </div>\n\n <!-- <div class=\"progress\" style=\"height: 12px;\">\n <div class=\"progress-bar\" role=\"progressbar\" [ngStyle]=\"uploadProcess\"></div>\n </div> -->\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'\"\n [status]=\"'active'\"></farris-progress>\n </div>\n\n <table *ngIf=\"!file.uploadResult && !file.isUploading\"\n 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-warn\"></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; \"\n class=\"btn-link btn ng-star-inserted\" (click)=\"showErrorMessage(file)\">{{'detail' |\n 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\"\n 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\"\n [idField]=\"'id'\" [textField]=\"'name'\" (selectChange)=\"typeChange($event,file)\"\n [enableClear]=\"false\">\n <!-- <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> -->\n </farris-combo-list>\n </div>\n </div>\n <div *ngIf=\"haveSecurityInfo\"\n 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]=\"securityInfoList\"\n [idField]=\"'id'\" [textField]=\"'name'\" (selectChange)=\"securityChange($event,file)\"\n [enableClear]=\"false\">\n <!-- <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> -->\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 <!-- <input type=\"checkbox\" [id]=\"file.name\" (click)=\"checkoutSelectFile(file.name)\"> -->\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 [ngStyle]=\"checkboxPos\">\n <input class=\"custom-control-input\" type=\"checkbox\" [id]=\"file.name\"\n [(ngModel)]=\"file.selectd\">\n <label class=\"custom-control-label\"\n 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 <!-- <span>{{file.picListDisplayName}}</span> -->\n <!-- <p class=\"filename\">{{file.picListDisplayName}}</p> -->\n <button *ngIf=\"!file.isUploading && file.mouseOn\"\n style=\"position: absolute; top: 0; right: 0px; width: 24px; height: 24px; border: none;\"\n (click)=\"listDeleteFile(file)\">\n <span style=\"position: relative; right: 2px; \" class=\"f-icon f-icon-delete\"> </span>\n </button>\n <!-- <button *ngIf=\"file.hasUploaded\" class=\"k-primary\" kendoButton [icon]=\"'check'\" [disabled]=\"true\"></button> -->\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 <!-- <input type=\"checkbox\" id=\"allCheckBox\" (click)=\"selectAllFile()\"> -->\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\"\n [(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 <!-- <div style=\"width:100%; display: table-cell; vertical-align: middle; text-align: center; \"> -->\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 <!-- <input type=\"checkbox\" [id]=\"file.name\" (click)=\"checkoutSelectFile(file.name)\"> -->\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\"\n [(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\"\n (click)=\"showErrorMessage(file)\">{{'detail' | locale}}</button></td>\n </tr>\n </table>\n <!-- <span *ngIf=\"!file.uploadResult\"><span class=\"f-icon f-icon-error\"></span> \u4E0A\u4F20\u5931\u8D25 <button\n class=\"btn-link btn ng-star-inserted\" (click)=\"showErrorMessage(file)\">\u8BE6\u60C5</button></span> -->\n <span *ngIf=\"file.uploadResult\"><span class=\"f-icon f-icon-success\"></span> {{'uploadSucceed' |\n locale}}</span>\n </td>\n <td *ngIf=\"!file.isUploading&&haveExtensionProperty\"\n style=\"text-align: center; width: 100px; vertical-align: middle;\">\n <farris-combo-list [(ngModel)]=\"file.extensionDropListId\" [data]=\"propertiesNames\"\n [idField]=\"'id'\" [textField]=\"'name'\" (selectChange)=\"typeChange($event,file)\"\n [enableClear]=\"false\">\n <!-- <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> -->\n </farris-combo-list>\n </td>\n <td *ngIf=\"!file.isUploading&&haveSecurityInfo\"\n style=\"text-align: center; width: 100px; vertical-align: middle;\">\n <farris-combo-list [(ngModel)]=\"file.extensionDropListId\" [data]=\"securityInfoList\"\n [idField]=\"'id'\" [textField]=\"'name'\" (selectChange)=\"securityChange($event,file)\"\n [enableClear]=\"false\">\n <!-- <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> -->\n </farris-combo-list>\n </td>\n\n <td *ngIf=\"!file.isUploading\" style=\"text-align: center; width: 140px; vertical-align: middle;\">\n <!-- <button *ngIf=\"file.uploadResult\" class=\"btn-link btn ng-star-inserted\" (click)=\"retryUploadFile(file.name)\">\u91CD\u8BD5</button> -->\n <button class=\"btn-link btn ng-star-inserted\" style=\"margin: 0 auto\"\n (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\">{{'uploadFile' | locale}} </span>\n <input type=\"file\" (change)=\"fileSelected($event)\" id=\"file\" multiple=\"multiple\" title=\"\" [accept]=\"fileType\">\n <!-- <input type=\"file\" (focus)=\"showLoading()\" (change)=\"fileSelected($event)\" id=\"file\" multiple=\"multiple\" title=\"\" [accept]=\"fileType\"> -->\n </div>\n</div>",
1722
+ 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:90px}.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:415px;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:179px;width:135px;margin:8px 0 8px 12px;float:left;overflow:hidden;align-items:center;position:relative}.pic_list ul li div{width:135px;height:159px;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}"]
1625
1723
  }] }
1626
1724
  ];
1627
1725
  /** @nocollapse */
@@ -1655,6 +1753,14 @@ class DownloadService {
1655
1753
  getDownloadUrl(metadataId, rootId) {
1656
1754
  return "/api/runtime/dfs/v1.0/doc/filecontent?metadataid=" + metadataId + "&rootid=" + rootId + "&token=" + this.getToken(this.mergeString(metadataId, rootId));
1657
1755
  }
1756
+ /**
1757
+ * @param {?} metadataId
1758
+ * @param {?} rootId
1759
+ * @return {?}
1760
+ */
1761
+ getStreamDownloadUrl(metadataId, rootId) {
1762
+ return "/api/runtime/dfs/v1.0/formdoc/stream?metadataid=" + metadataId + "&rootid=" + rootId + "&token=" + this.getToken(this.mergeString(metadataId, rootId));
1763
+ }
1658
1764
  /**
1659
1765
  * @param {?} metadataIdList
1660
1766
  * @param {?} rootId
@@ -1776,12 +1882,12 @@ UploadModule.decorators = [
1776
1882
  declarations: [FileUploadComponent, LocalLangPipe],
1777
1883
  imports: [
1778
1884
  CommonModule,
1779
- ButtonsModule,
1780
1885
  NotifyModule,
1781
1886
  MessagerModule.forRoot(),
1782
1887
  LoadingModule.forRoot(),
1783
1888
  ProgressModule,
1784
1889
  FormsModule,
1890
+ FarrisFormsModule,
1785
1891
  ComboListModule,
1786
1892
  HttpClientModule
1787
1893
  ],
@@ -2049,7 +2155,6 @@ UploadDialogMoudle.decorators = [
2049
2155
  FarrisDialogModule,
2050
2156
  MessagerModule.forRoot(),
2051
2157
  UploadModule,
2052
- ButtonsModule,
2053
2158
  NotifyModule.forRoot(),
2054
2159
  HttpClientModule
2055
2160
  ],
@@ -2078,6 +2183,13 @@ class UploadLimit {
2078
2183
  class GspFormUploadListEntity {
2079
2184
  }
2080
2185
 
2186
+ /**
2187
+ * @fileoverview added by tsickle
2188
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2189
+ */
2190
+ class GspFormDocInfo {
2191
+ }
2192
+
2081
2193
  /**
2082
2194
  * @fileoverview added by tsickle
2083
2195
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -2085,6 +2197,13 @@ class GspFormUploadListEntity {
2085
2197
  class GspDocMetaProperty {
2086
2198
  }
2087
2199
 
2200
+ /**
2201
+ * @fileoverview added by tsickle
2202
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2203
+ */
2204
+ class GspFormUploadEntity {
2205
+ }
2206
+
2088
2207
  /**
2089
2208
  * @fileoverview added by tsickle
2090
2209
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc