@gsp-svc/formdoc-upload 0.2.20 → 1.1.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 (127) hide show
  1. package/bundles/gsp-svc-formdoc-upload.umd.js +2743 -2632
  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/gsp-svc-formdoc-upload.js +9 -9
  6. package/esm2015/lib/formdoc-upload.component.js +21 -21
  7. package/esm2015/lib/formdoc-upload.module.js +23 -23
  8. package/esm2015/lib/formdoc-upload.service.js +17 -17
  9. package/esm2015/lib/i18n/language.resource.js +156 -148
  10. package/esm2015/lib/local.pipe.js +48 -48
  11. package/esm2015/lib/upload/download.service.js +153 -153
  12. package/esm2015/lib/upload/entity/changeinstancerequest.js +13 -13
  13. package/esm2015/lib/upload/entity/completemultiuploadrequest.js +21 -21
  14. package/esm2015/lib/upload/entity/copyfilerequest.js +15 -15
  15. package/esm2015/lib/upload/entity/doctype.js +25 -23
  16. package/esm2015/lib/upload/entity/droplistentity.js +13 -13
  17. package/esm2015/lib/upload/entity/expropertyrequest.js +15 -15
  18. package/esm2015/lib/upload/entity/extensionstoragefileinfo.js +13 -13
  19. package/esm2015/lib/upload/entity/fileinfo.js +49 -47
  20. package/esm2015/lib/upload/entity/filestate.js +13 -13
  21. package/esm2015/lib/upload/entity/gspdocmetaproperty.js +19 -19
  22. package/esm2015/lib/upload/entity/gspdocsecuritybaseinfo.js +15 -15
  23. package/esm2015/lib/upload/entity/gspformdocinfo.js +25 -25
  24. package/esm2015/lib/upload/entity/gspformdocoperateentity.js +13 -13
  25. package/esm2015/lib/upload/entity/gspformremovelistentity.js +15 -15
  26. package/esm2015/lib/upload/entity/gspformstreamentity.js +25 -25
  27. package/esm2015/lib/upload/entity/gspformuploadentity.js +17 -17
  28. package/esm2015/lib/upload/entity/gspformuploadlistentity.js +17 -17
  29. package/esm2015/lib/upload/entity/initmultiuploadrequest.js +19 -19
  30. package/esm2015/lib/upload/entity/multiuploadrequest.js +21 -21
  31. package/esm2015/lib/upload/entity/multiuploadresult.js +13 -13
  32. package/esm2015/lib/upload/entity/operatingmodes.js +13 -13
  33. package/esm2015/lib/upload/entity/securityentity.js +17 -17
  34. package/esm2015/lib/upload/entity/storageextension.js +17 -17
  35. package/esm2015/lib/upload/entity/uploadfileinfo.js +21 -19
  36. package/esm2015/lib/upload/entity/uploadlimit.js +23 -23
  37. package/esm2015/lib/upload/file-upload/file-upload.component.js +1508 -1402
  38. package/esm2015/lib/upload/upload.module.js +50 -48
  39. package/esm2015/lib/upload/upload.service.js +341 -341
  40. package/esm2015/lib/uploaddialog/uploaddialog/uploaddialog.component.js +82 -82
  41. package/esm2015/lib/uploaddialog/uploaddialog.module.js +35 -35
  42. package/esm2015/lib/uploaddialog.service.js +207 -207
  43. package/esm2015/public-api.js +32 -32
  44. package/esm5/gsp-svc-formdoc-upload.js +9 -9
  45. package/esm5/lib/formdoc-upload.component.js +27 -27
  46. package/esm5/lib/formdoc-upload.module.js +27 -27
  47. package/esm5/lib/formdoc-upload.service.js +20 -20
  48. package/esm5/lib/i18n/language.resource.js +156 -148
  49. package/esm5/lib/local.pipe.js +51 -51
  50. package/esm5/lib/upload/download.service.js +202 -202
  51. package/esm5/lib/upload/entity/changeinstancerequest.js +17 -17
  52. package/esm5/lib/upload/entity/completemultiuploadrequest.js +25 -25
  53. package/esm5/lib/upload/entity/copyfilerequest.js +19 -19
  54. package/esm5/lib/upload/entity/doctype.js +25 -23
  55. package/esm5/lib/upload/entity/droplistentity.js +17 -17
  56. package/esm5/lib/upload/entity/expropertyrequest.js +19 -19
  57. package/esm5/lib/upload/entity/extensionstoragefileinfo.js +17 -17
  58. package/esm5/lib/upload/entity/fileinfo.js +53 -51
  59. package/esm5/lib/upload/entity/filestate.js +13 -13
  60. package/esm5/lib/upload/entity/gspdocmetaproperty.js +23 -23
  61. package/esm5/lib/upload/entity/gspdocsecuritybaseinfo.js +19 -19
  62. package/esm5/lib/upload/entity/gspformdocinfo.js +29 -29
  63. package/esm5/lib/upload/entity/gspformdocoperateentity.js +17 -17
  64. package/esm5/lib/upload/entity/gspformremovelistentity.js +19 -19
  65. package/esm5/lib/upload/entity/gspformstreamentity.js +29 -29
  66. package/esm5/lib/upload/entity/gspformuploadentity.js +21 -21
  67. package/esm5/lib/upload/entity/gspformuploadlistentity.js +21 -21
  68. package/esm5/lib/upload/entity/initmultiuploadrequest.js +23 -23
  69. package/esm5/lib/upload/entity/multiuploadrequest.js +25 -25
  70. package/esm5/lib/upload/entity/multiuploadresult.js +17 -17
  71. package/esm5/lib/upload/entity/operatingmodes.js +13 -13
  72. package/esm5/lib/upload/entity/securityentity.js +21 -21
  73. package/esm5/lib/upload/entity/storageextension.js +21 -21
  74. package/esm5/lib/upload/entity/uploadfileinfo.js +25 -23
  75. package/esm5/lib/upload/entity/uploadlimit.js +25 -25
  76. package/esm5/lib/upload/file-upload/file-upload.component.js +1657 -1544
  77. package/esm5/lib/upload/upload.module.js +54 -52
  78. package/esm5/lib/upload/upload.service.js +404 -404
  79. package/esm5/lib/uploaddialog/uploaddialog/uploaddialog.component.js +88 -88
  80. package/esm5/lib/uploaddialog/uploaddialog.module.js +39 -39
  81. package/esm5/lib/uploaddialog.service.js +226 -226
  82. package/esm5/public-api.js +32 -32
  83. package/fesm2015/gsp-svc-formdoc-upload.js +2470 -2356
  84. package/fesm2015/gsp-svc-formdoc-upload.js.map +1 -1
  85. package/fesm5/gsp-svc-formdoc-upload.js +2820 -2699
  86. package/fesm5/gsp-svc-formdoc-upload.js.map +1 -1
  87. package/gsp-svc-formdoc-upload.d.ts +5 -5
  88. package/gsp-svc-formdoc-upload.metadata.json +1 -1
  89. package/lib/formdoc-upload.component.d.ts +5 -5
  90. package/lib/formdoc-upload.module.d.ts +2 -2
  91. package/lib/formdoc-upload.service.d.ts +3 -3
  92. package/lib/i18n/language.resource.d.ts +150 -142
  93. package/lib/local.pipe.d.ts +8 -8
  94. package/lib/upload/download.service.d.ts +11 -11
  95. package/lib/upload/entity/changeinstancerequest.d.ts +5 -5
  96. package/lib/upload/entity/completemultiuploadrequest.d.ts +9 -9
  97. package/lib/upload/entity/copyfilerequest.d.ts +5 -5
  98. package/lib/upload/entity/doctype.d.ts +10 -9
  99. package/lib/upload/entity/droplistentity.d.ts +4 -4
  100. package/lib/upload/entity/expropertyrequest.d.ts +5 -5
  101. package/lib/upload/entity/extensionstoragefileinfo.d.ts +4 -4
  102. package/lib/upload/entity/fileinfo.d.ts +23 -22
  103. package/lib/upload/entity/filestate.d.ts +4 -4
  104. package/lib/upload/entity/gspdocmetaproperty.d.ts +7 -7
  105. package/lib/upload/entity/gspdocsecuritybaseinfo.d.ts +5 -5
  106. package/lib/upload/entity/gspformdocinfo.d.ts +11 -11
  107. package/lib/upload/entity/gspformdocoperateentity.d.ts +4 -4
  108. package/lib/upload/entity/gspformremovelistentity.d.ts +6 -6
  109. package/lib/upload/entity/gspformstreamentity.d.ts +12 -12
  110. package/lib/upload/entity/gspformuploadentity.d.ts +8 -8
  111. package/lib/upload/entity/gspformuploadlistentity.d.ts +8 -8
  112. package/lib/upload/entity/initmultiuploadrequest.d.ts +7 -7
  113. package/lib/upload/entity/multiuploadrequest.d.ts +8 -8
  114. package/lib/upload/entity/multiuploadresult.d.ts +4 -4
  115. package/lib/upload/entity/operatingmodes.d.ts +4 -4
  116. package/lib/upload/entity/securityentity.d.ts +6 -6
  117. package/lib/upload/entity/storageextension.d.ts +6 -6
  118. package/lib/upload/entity/uploadfileinfo.d.ts +10 -9
  119. package/lib/upload/entity/uploadlimit.d.ts +7 -7
  120. package/lib/upload/file-upload/file-upload.component.d.ts +133 -129
  121. package/lib/upload/upload.module.d.ts +3 -3
  122. package/lib/upload/upload.service.d.ts +27 -27
  123. package/lib/uploaddialog/uploaddialog/uploaddialog.component.d.ts +13 -13
  124. package/lib/uploaddialog/uploaddialog.module.d.ts +2 -2
  125. package/lib/uploaddialog.service.d.ts +18 -18
  126. package/package.json +1 -1
  127. package/public-api.d.ts +25 -25
@@ -11,2440 +11,2554 @@ import { FormsModule } from '@angular/forms';
11
11
  import { ComboListModule } from '@farris/ui-combo-list';
12
12
  import { FarrisFormsModule } from '@farris/ui-forms';
13
13
  import { BasePathService, FarrisRTFModule } from '@farris/rtf';
14
+ import { DatalistModule } from '@farris/ui-datalist';
14
15
  import { CacheService, HttpService, LanguageService, SessionService } from '@ecp-caf/caf-common';
15
- import { Injectable, Pipe, Inject, LOCALE_ID, Component, Injector, ComponentFactoryResolver, NgModule, ViewChild, Input, defineInjectable } from '@angular/core';
16
+ import { Injectable, Pipe, Inject, LOCALE_ID, Component, NgModule, Input, ViewChild, Injector, ComponentFactoryResolver, defineInjectable } from '@angular/core';
16
17
  import { BsModalService } from '@farris/ui-modal';
17
18
  import { of as of$1 } from 'rxjs';
18
19
  import { HttpClientModule, HttpClient } from '@angular/common/http';
19
20
  import { NotifyModule } from '@farris/ui-notify';
20
21
 
21
- /**
22
- * @fileoverview added by tsickle
23
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
24
- */
25
- class FormdocUploadService {
26
- constructor() { }
27
- }
28
- FormdocUploadService.decorators = [
29
- { type: Injectable, args: [{
30
- providedIn: 'root'
31
- },] }
32
- ];
33
- /** @nocollapse */
34
- FormdocUploadService.ctorParameters = () => [];
22
+ /**
23
+ * @fileoverview added by tsickle
24
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
25
+ */
26
+ class FormdocUploadService {
27
+ constructor() { }
28
+ }
29
+ FormdocUploadService.decorators = [
30
+ { type: Injectable, args: [{
31
+ providedIn: 'root'
32
+ },] }
33
+ ];
34
+ /** @nocollapse */
35
+ FormdocUploadService.ctorParameters = () => [];
35
36
  /** @nocollapse */ FormdocUploadService.ngInjectableDef = defineInjectable({ factory: function FormdocUploadService_Factory() { return new FormdocUploadService(); }, token: FormdocUploadService, providedIn: "root" });
36
37
 
37
- /**
38
- * @fileoverview added by tsickle
39
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
40
- */
41
- class FormdocUploadComponent {
42
- constructor() { }
43
- /**
44
- * @return {?}
45
- */
46
- ngOnInit() {
47
- }
48
- }
49
- FormdocUploadComponent.decorators = [
50
- { type: Component, args: [{
51
- selector: 'lib-formdoc-upload',
38
+ /**
39
+ * @fileoverview added by tsickle
40
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
41
+ */
42
+ class FormdocUploadComponent {
43
+ constructor() { }
44
+ /**
45
+ * @return {?}
46
+ */
47
+ ngOnInit() {
48
+ }
49
+ }
50
+ FormdocUploadComponent.decorators = [
51
+ { type: Component, args: [{
52
+ selector: 'lib-formdoc-upload',
52
53
  template: `
53
54
  <p>
54
55
  formdoc-upload works!
55
56
  </p>
56
- `
57
- }] }
58
- ];
59
- /** @nocollapse */
57
+ `
58
+ }] }
59
+ ];
60
+ /** @nocollapse */
60
61
  FormdocUploadComponent.ctorParameters = () => [];
61
62
 
62
- /**
63
- * @fileoverview added by tsickle
64
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
65
- */
66
- const ɵ0 = localStorage.getItem('languageCode') || 'zh-CHS';
67
- class FormdocUploadModule {
68
- }
69
- FormdocUploadModule.decorators = [
70
- { type: NgModule, args: [{
71
- declarations: [FormdocUploadComponent],
72
- imports: [
73
- HttpClientModule
74
- ],
75
- exports: [FormdocUploadComponent],
76
- providers: [LanguageService, HttpService, CacheService, SessionService,
77
- { provide: LOCALE_ID, useValue: ɵ0 },]
78
- },] }
63
+ /**
64
+ * @fileoverview added by tsickle
65
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
66
+ */
67
+ const ɵ0 = localStorage.getItem('languageCode') || 'zh-CHS';
68
+ class FormdocUploadModule {
69
+ }
70
+ FormdocUploadModule.decorators = [
71
+ { type: NgModule, args: [{
72
+ declarations: [FormdocUploadComponent],
73
+ imports: [
74
+ HttpClientModule
75
+ ],
76
+ exports: [FormdocUploadComponent],
77
+ providers: [LanguageService, HttpService, CacheService, SessionService,
78
+ { provide: LOCALE_ID, useValue: ɵ0 },]
79
+ },] }
79
80
  ];
80
81
 
81
- /**
82
- * @fileoverview added by tsickle
83
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
84
- */
85
- /** @enum {number} */
86
- const DocType = {
87
- Word: 0,
88
- Excel: 1,
89
- Powerpoint: 2,
90
- Pdf: 3,
91
- Txt: 4,
92
- Image: 5,
93
- Other: 6,
94
- };
95
- DocType[DocType.Word] = 'Word';
96
- DocType[DocType.Excel] = 'Excel';
97
- DocType[DocType.Powerpoint] = 'Powerpoint';
98
- DocType[DocType.Pdf] = 'Pdf';
99
- DocType[DocType.Txt] = 'Txt';
100
- DocType[DocType.Image] = 'Image';
82
+ /**
83
+ * @fileoverview added by tsickle
84
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
85
+ */
86
+ /** @enum {number} */
87
+ const DocType = {
88
+ Word: 0,
89
+ Excel: 1,
90
+ Powerpoint: 2,
91
+ Pdf: 3,
92
+ Txt: 4,
93
+ Image: 5,
94
+ Other: 6,
95
+ Zip: 7,
96
+ };
97
+ DocType[DocType.Word] = 'Word';
98
+ DocType[DocType.Excel] = 'Excel';
99
+ DocType[DocType.Powerpoint] = 'Powerpoint';
100
+ DocType[DocType.Pdf] = 'Pdf';
101
+ DocType[DocType.Txt] = 'Txt';
102
+ DocType[DocType.Image] = 'Image';
101
103
  DocType[DocType.Other] = 'Other';
104
+ DocType[DocType.Zip] = 'Zip';
102
105
 
103
- /**
104
- * @fileoverview added by tsickle
105
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
106
- */
107
- /** @enum {number} */
108
- const OperatingModes = {
109
- Formal: 0,
110
- Temp: 1,
111
- };
112
- OperatingModes[OperatingModes.Formal] = 'Formal';
106
+ /**
107
+ * @fileoverview added by tsickle
108
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
109
+ */
110
+ /** @enum {number} */
111
+ const OperatingModes = {
112
+ Formal: 0,
113
+ Temp: 1,
114
+ };
115
+ OperatingModes[OperatingModes.Formal] = 'Formal';
113
116
  OperatingModes[OperatingModes.Temp] = 'Temp';
114
117
 
115
- /**
116
- * @fileoverview added by tsickle
117
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
118
- */
119
- class GspFormRemoveListEntity {
118
+ /**
119
+ * @fileoverview added by tsickle
120
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
121
+ */
122
+ class GspFormRemoveListEntity {
120
123
  }
121
124
 
122
- /**
123
- * @fileoverview added by tsickle
124
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
125
- */
126
- class GspFormDocOperateEntity {
125
+ /**
126
+ * @fileoverview added by tsickle
127
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
128
+ */
129
+ class GspFormDocOperateEntity {
127
130
  }
128
131
 
129
- /**
130
- * @fileoverview added by tsickle
131
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
132
- */
133
- class ChangeInstanceRequest {
132
+ /**
133
+ * @fileoverview added by tsickle
134
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
135
+ */
136
+ class ChangeInstanceRequest {
134
137
  }
135
138
 
136
- /**
137
- * @fileoverview added by tsickle
138
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
139
- */
140
- class CopyFileRequest {
139
+ /**
140
+ * @fileoverview added by tsickle
141
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
142
+ */
143
+ class CopyFileRequest {
141
144
  }
142
145
 
143
- /**
144
- * @fileoverview added by tsickle
145
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
146
- */
147
- class UploadService {
148
- /**
149
- * @param {?} http
150
- * @param {?} httpclient
151
- */
152
- constructor(http, httpclient) {
153
- this.http = http;
154
- this.httpclient = httpclient;
155
- }
156
- /**
157
- * @param {?} docListInfo
158
- * @param {?} rootId
159
- * @return {?}
160
- */
161
- uploadList(docListInfo, rootId) {
162
- /** @type {?} */
163
- let url;
164
- docListInfo.rootId = rootId;
165
- url = "/api/runtime/dfs/v1.0/formdoc/list";
166
- //url = "/api/runtime/dfs/v1.0/formdoc/list";
167
- return this.http.post(url, docListInfo).pipe(tap((/**
168
- * @param {?} res
169
- * @return {?}
170
- */
171
- res => { })), catchError((/**
172
- * @param {?} error
173
- * @return {?}
174
- */
175
- (error) => {
176
- return of(error);
177
- })));
178
- }
179
- /**
180
- * @param {?} metadataIdList
181
- * @param {?} rootId
182
- * @return {?}
183
- */
184
- commit(metadataIdList, rootId) {
185
- /** @type {?} */
186
- let url;
187
- /** @type {?} */
188
- let entity = new GspFormDocOperateEntity;
189
- entity.metadataIdList = metadataIdList;
190
- entity.rootId = rootId;
191
- url = "/api/runtime/dfs/v1.0/formdoc/commit";
192
- //url = "http://localhost:5000/api/runtime/dfs/v1.0/formdoc/commit";
193
- return this.http.post(url, entity).pipe();
194
- }
195
- /**
196
- * @param {?} metadataIdList
197
- * @param {?} rootId
198
- * @return {?}
199
- */
200
- cancel(metadataIdList, rootId) {
201
- /** @type {?} */
202
- let url;
203
- /** @type {?} */
204
- let entity = new GspFormDocOperateEntity;
205
- entity.metadataIdList = metadataIdList;
206
- entity.rootId = rootId;
207
- url = "/api/runtime/dfs/v1.0/formdoc/cancel";
208
- //url = "http://localhost:5000/api/runtime/dfs/v1.0/formdoc/cancel";
209
- //localStorage.setItem("SessionId","huoliang");
210
- return this.http.put(url, entity).pipe();
211
- }
212
- /**
213
- * @param {?} idList
214
- * @param {?} rootId
215
- * @return {?}
216
- */
217
- removeList(idList, rootId) {
218
- /** @type {?} */
219
- let url;
220
- //url = "http://localhost:5000/api/runtime/dfs/v1.0/formdoc/list";
221
- url = "/api/runtime/dfs/v1.0/formdoc/list";
222
- /** @type {?} */
223
- var idListInfo = new GspFormRemoveListEntity;
224
- idListInfo.metadataIdList = idList;
225
- idListInfo.mode = OperatingModes.Temp;
226
- idListInfo.rootId = rootId;
227
- return this.http.delete(url, idListInfo).pipe();
228
- }
229
- /**
230
- * @param {?} metadataId
231
- * @param {?} rootId
232
- * @return {?}
233
- */
234
- getFile(metadataId, rootId) {
235
- /** @type {?} */
236
- let url;
237
- if (rootId == "")
238
- url = "/api/runtime/dfs/v1.0/formdoc/file/" + metadataId;
239
- else
240
- url = "/api/runtime/dfs/v1.0/formdoc/file/" + metadataId + "/" + rootId;
241
- return this.http.get(url).pipe(tap((/**
242
- * @param {?} res
243
- * @return {?}
244
- */
245
- res => { })), catchError((/**
246
- * @param {?} error
247
- * @return {?}
248
- */
249
- (error) => {
250
- return of(error);
251
- })));
252
- }
253
- /**
254
- * @param {?} docInfo
255
- * @return {?}
256
- */
257
- uploadFile(docInfo) {
258
- /** @type {?} */
259
- let url = "/api/runtime/dfs/v1.0/formdoc";
260
- //url = "/api/runtime/dfs/v1.0/formdoc/list";
261
- return this.http.post(url, docInfo).pipe(tap((/**
262
- * @param {?} res
263
- * @return {?}
264
- */
265
- res => { })), catchError((/**
266
- * @param {?} error
267
- * @return {?}
268
- */
269
- (error) => {
270
- return of(error);
271
- })));
272
- }
273
- /**
274
- * @param {?} formdata
275
- * @return {?}
276
- */
277
- uploadSliceFile(formdata) {
278
- /** @type {?} */
279
- let url = "/api/runtime/dfs/v1.0/formdoc/slice";
280
- //url = "/api/runtime/dfs/v1.0/formdoc/list";
281
- /** @type {?} */
282
- const baseUrl = BasePathService.convertPath(url);
283
- return this.httpclient.post(baseUrl, formdata).pipe(tap((/**
284
- * @param {?} res
285
- * @return {?}
286
- */
287
- res => { })), catchError((/**
288
- * @param {?} error
289
- * @return {?}
290
- */
291
- (error) => {
292
- return of(error);
293
- })));
294
- }
295
- /**
296
- * @return {?}
297
- */
298
- getStorageExtensionInfo() {
299
- /** @type {?} */
300
- let url = "/api/runtime/dfs/v1.0/storagestrategy/extension";
301
- //url = "/api/runtime/dfs/v1.0/formdoc/list";
302
- return this.http.get(url).pipe(tap((/**
303
- * @param {?} res
304
- * @return {?}
305
- */
306
- res => { })), catchError((/**
307
- * @param {?} error
308
- * @return {?}
309
- */
310
- (error) => {
311
- return of(error);
312
- })));
313
- }
314
- /**
315
- * @param {?} baseInfo
316
- * @return {?}
317
- */
318
- getSecurityInfoList(baseInfo) {
319
- /** @type {?} */
320
- let url = "/api/runtime/dfs/v1.0/storagestrategy/security";
321
- url = url + "?id=" + baseInfo.securityId + "&level=" + baseInfo.securityLevel;
322
- return this.http.get(url).pipe(tap((/**
323
- * @param {?} res
324
- * @return {?}
325
- */
326
- res => { })), catchError((/**
327
- * @param {?} error
328
- * @return {?}
329
- */
330
- (error) => {
331
- return of(error);
332
- })));
333
- }
334
- /**
335
- * @param {?} storageInfoList
336
- * @param {?} rootId
337
- * @return {?}
338
- */
339
- changeStorageInstance(storageInfoList, rootId) {
340
- /** @type {?} */
341
- let url = "/api/runtime/dfs/v1.0/formdoc/changeinstance";
342
- /** @type {?} */
343
- let request = new ChangeInstanceRequest;
344
- request.fileInfoList = storageInfoList;
345
- request.rootId = rootId;
346
- return this.http.post(url, request).pipe(tap((/**
347
- * @param {?} res
348
- * @return {?}
349
- */
350
- res => { })), catchError((/**
351
- * @param {?} error
352
- * @return {?}
353
- */
354
- (error) => {
355
- return of(error);
356
- })));
357
- }
358
- /**
359
- * @param {?} metadataId
360
- * @param {?} rootId
361
- * @param {?} path
362
- * @return {?}
363
- */
364
- copyFile(metadataId, rootId, path) {
365
- /** @type {?} */
366
- let url = "/api/runtime/dfs/v1.0/formdoc/copy";
367
- /** @type {?} */
368
- const baseUrl = BasePathService.convertPath(url);
369
- /** @type {?} */
370
- let request = new CopyFileRequest;
371
- request.metadataId = metadataId;
372
- request.rootId = rootId;
373
- request.path = path;
374
- return this.httpclient.post(baseUrl, request, { responseType: 'text' }).pipe(tap((/**
375
- * @param {?} res
376
- * @return {?}
377
- */
378
- res => { })));
379
- }
380
- /**
381
- * @param {?} uploadFileInfoList
382
- * @param {?} rootId
383
- * @return {?}
384
- */
385
- saveSecurityInfo(uploadFileInfoList, rootId) {
386
- /** @type {?} */
387
- let url = "/api/runtime/dfs/v1.0/doc/exproperty";
388
- /** @type {?} */
389
- let reqList = [];
390
- uploadFileInfoList.forEach((/**
391
- * @param {?} element
392
- * @return {?}
393
- */
394
- element => {
395
- /** @type {?} */
396
- let request = { id: element.metadataId, rootId: rootId, exProperty: JSON.stringify(element.securityInfo) };
397
- reqList.push(request);
398
- }));
399
- return this.http.post(url, reqList).pipe(tap((/**
400
- * @param {?} res
401
- * @return {?}
402
- */
403
- res => { })), catchError((/**
404
- * @param {?} error
405
- * @return {?}
406
- */
407
- (error) => {
408
- return of(error);
409
- })));
410
- }
411
- /**
412
- * @param {?} formId
413
- * @param {?} rootId
414
- * @return {?}
415
- */
416
- getUploadedFileInfoList(formId, rootId) {
417
- /** @type {?} */
418
- let url = "/api/runtime/dfs/v1.0/formdoc/uploadedfile/infolist" + "?formid=" + formId + "&rootid=" + rootId;
419
- //url = "/api/runtime/dfs/v1.0/formdoc/list";
420
- return this.http.get(url).pipe(tap((/**
421
- * @param {?} res
422
- * @return {?}
423
- */
424
- res => { })), catchError((/**
425
- * @param {?} error
426
- * @return {?}
427
- */
428
- (error) => {
429
- return of(error);
430
- })));
431
- }
432
- /**
433
- * @param {?} rootId
434
- * @return {?}
435
- */
436
- getUploadInfo(rootId) {
437
- /** @type {?} */
438
- let url = "/api/runtime/dfs/v1.0/rootsetting/info?id=" + rootId;
439
- return this.http.get(url).pipe(tap((/**
440
- * @param {?} res
441
- * @return {?}
442
- */
443
- res => { })), catchError((/**
444
- * @param {?} error
445
- * @return {?}
446
- */
447
- (error) => {
448
- return of(error);
449
- })));
450
- }
451
- }
452
- UploadService.decorators = [
453
- { type: Injectable }
454
- ];
455
- /** @nocollapse */
456
- UploadService.ctorParameters = () => [
457
- { type: HttpService },
458
- { type: HttpClient }
146
+ /**
147
+ * @fileoverview added by tsickle
148
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
149
+ */
150
+ class UploadService {
151
+ /**
152
+ * @param {?} http
153
+ * @param {?} httpclient
154
+ */
155
+ constructor(http, httpclient) {
156
+ this.http = http;
157
+ this.httpclient = httpclient;
158
+ }
159
+ /**
160
+ * @param {?} docListInfo
161
+ * @param {?} rootId
162
+ * @return {?}
163
+ */
164
+ uploadList(docListInfo, rootId) {
165
+ /** @type {?} */
166
+ let url;
167
+ docListInfo.rootId = rootId;
168
+ url = "/api/runtime/dfs/v1.0/formdoc/list";
169
+ //url = "/api/runtime/dfs/v1.0/formdoc/list";
170
+ return this.http.post(url, docListInfo).pipe(tap((/**
171
+ * @param {?} res
172
+ * @return {?}
173
+ */
174
+ res => { })), catchError((/**
175
+ * @param {?} error
176
+ * @return {?}
177
+ */
178
+ (error) => {
179
+ return of(error);
180
+ })));
181
+ }
182
+ /**
183
+ * @param {?} metadataIdList
184
+ * @param {?} rootId
185
+ * @return {?}
186
+ */
187
+ commit(metadataIdList, rootId) {
188
+ /** @type {?} */
189
+ let url;
190
+ /** @type {?} */
191
+ let entity = new GspFormDocOperateEntity;
192
+ entity.metadataIdList = metadataIdList;
193
+ entity.rootId = rootId;
194
+ url = "/api/runtime/dfs/v1.0/formdoc/commit";
195
+ //url = "http://localhost:5000/api/runtime/dfs/v1.0/formdoc/commit";
196
+ return this.http.post(url, entity).pipe();
197
+ }
198
+ /**
199
+ * @param {?} metadataIdList
200
+ * @param {?} rootId
201
+ * @return {?}
202
+ */
203
+ cancel(metadataIdList, rootId) {
204
+ /** @type {?} */
205
+ let url;
206
+ /** @type {?} */
207
+ let entity = new GspFormDocOperateEntity;
208
+ entity.metadataIdList = metadataIdList;
209
+ entity.rootId = rootId;
210
+ url = "/api/runtime/dfs/v1.0/formdoc/cancel";
211
+ //url = "http://localhost:5000/api/runtime/dfs/v1.0/formdoc/cancel";
212
+ //localStorage.setItem("SessionId","huoliang");
213
+ return this.http.put(url, entity).pipe();
214
+ }
215
+ /**
216
+ * @param {?} idList
217
+ * @param {?} rootId
218
+ * @return {?}
219
+ */
220
+ removeList(idList, rootId) {
221
+ /** @type {?} */
222
+ let url;
223
+ //url = "http://localhost:5000/api/runtime/dfs/v1.0/formdoc/list";
224
+ url = "/api/runtime/dfs/v1.0/formdoc/list";
225
+ /** @type {?} */
226
+ var idListInfo = new GspFormRemoveListEntity;
227
+ idListInfo.metadataIdList = idList;
228
+ idListInfo.mode = OperatingModes.Temp;
229
+ idListInfo.rootId = rootId;
230
+ return this.http.delete(url, idListInfo).pipe();
231
+ }
232
+ /**
233
+ * @param {?} metadataId
234
+ * @param {?} rootId
235
+ * @return {?}
236
+ */
237
+ getFile(metadataId, rootId) {
238
+ /** @type {?} */
239
+ let url;
240
+ if (rootId == "")
241
+ url = "/api/runtime/dfs/v1.0/formdoc/file/" + metadataId;
242
+ else
243
+ url = "/api/runtime/dfs/v1.0/formdoc/file/" + metadataId + "/" + rootId;
244
+ return this.http.get(url).pipe(tap((/**
245
+ * @param {?} res
246
+ * @return {?}
247
+ */
248
+ res => { })), catchError((/**
249
+ * @param {?} error
250
+ * @return {?}
251
+ */
252
+ (error) => {
253
+ return of(error);
254
+ })));
255
+ }
256
+ /**
257
+ * @param {?} docInfo
258
+ * @return {?}
259
+ */
260
+ uploadFile(docInfo) {
261
+ /** @type {?} */
262
+ let url = "/api/runtime/dfs/v1.0/formdoc";
263
+ //url = "/api/runtime/dfs/v1.0/formdoc/list";
264
+ return this.http.post(url, docInfo).pipe(tap((/**
265
+ * @param {?} res
266
+ * @return {?}
267
+ */
268
+ res => { })), catchError((/**
269
+ * @param {?} error
270
+ * @return {?}
271
+ */
272
+ (error) => {
273
+ return of(error);
274
+ })));
275
+ }
276
+ /**
277
+ * @param {?} formdata
278
+ * @return {?}
279
+ */
280
+ uploadSliceFile(formdata) {
281
+ /** @type {?} */
282
+ let url = "/api/runtime/dfs/v1.0/formdoc/slice";
283
+ //url = "/api/runtime/dfs/v1.0/formdoc/list";
284
+ /** @type {?} */
285
+ const baseUrl = BasePathService.convertPath(url);
286
+ return this.httpclient.post(baseUrl, formdata).pipe(tap((/**
287
+ * @param {?} res
288
+ * @return {?}
289
+ */
290
+ res => { })), catchError((/**
291
+ * @param {?} error
292
+ * @return {?}
293
+ */
294
+ (error) => {
295
+ return of(error);
296
+ })));
297
+ }
298
+ /**
299
+ * @return {?}
300
+ */
301
+ getStorageExtensionInfo() {
302
+ /** @type {?} */
303
+ let url = "/api/runtime/dfs/v1.0/storagestrategy/extension";
304
+ //url = "/api/runtime/dfs/v1.0/formdoc/list";
305
+ return this.http.get(url).pipe(tap((/**
306
+ * @param {?} res
307
+ * @return {?}
308
+ */
309
+ res => { })), catchError((/**
310
+ * @param {?} error
311
+ * @return {?}
312
+ */
313
+ (error) => {
314
+ return of(error);
315
+ })));
316
+ }
317
+ /**
318
+ * @param {?} baseInfo
319
+ * @return {?}
320
+ */
321
+ getSecurityInfoList(baseInfo) {
322
+ /** @type {?} */
323
+ let url = "/api/runtime/dfs/v1.0/storagestrategy/security";
324
+ url = url + "?id=" + baseInfo.securityId + "&level=" + baseInfo.securityLevel;
325
+ return this.http.get(url).pipe(tap((/**
326
+ * @param {?} res
327
+ * @return {?}
328
+ */
329
+ res => { })), catchError((/**
330
+ * @param {?} error
331
+ * @return {?}
332
+ */
333
+ (error) => {
334
+ return of(error);
335
+ })));
336
+ }
337
+ /**
338
+ * @param {?} storageInfoList
339
+ * @param {?} rootId
340
+ * @return {?}
341
+ */
342
+ changeStorageInstance(storageInfoList, rootId) {
343
+ /** @type {?} */
344
+ let url = "/api/runtime/dfs/v1.0/formdoc/changeinstance";
345
+ /** @type {?} */
346
+ let request = new ChangeInstanceRequest;
347
+ request.fileInfoList = storageInfoList;
348
+ request.rootId = rootId;
349
+ return this.http.post(url, request).pipe(tap((/**
350
+ * @param {?} res
351
+ * @return {?}
352
+ */
353
+ res => { })), catchError((/**
354
+ * @param {?} error
355
+ * @return {?}
356
+ */
357
+ (error) => {
358
+ return of(error);
359
+ })));
360
+ }
361
+ /**
362
+ * @param {?} metadataId
363
+ * @param {?} rootId
364
+ * @param {?} path
365
+ * @return {?}
366
+ */
367
+ copyFile(metadataId, rootId, path) {
368
+ /** @type {?} */
369
+ let url = "/api/runtime/dfs/v1.0/formdoc/copy";
370
+ /** @type {?} */
371
+ const baseUrl = BasePathService.convertPath(url);
372
+ /** @type {?} */
373
+ let request = new CopyFileRequest;
374
+ request.metadataId = metadataId;
375
+ request.rootId = rootId;
376
+ request.path = path;
377
+ return this.httpclient.post(baseUrl, request, { responseType: 'text' }).pipe(tap((/**
378
+ * @param {?} res
379
+ * @return {?}
380
+ */
381
+ res => { })));
382
+ }
383
+ /**
384
+ * @param {?} uploadFileInfoList
385
+ * @param {?} rootId
386
+ * @return {?}
387
+ */
388
+ saveSecurityInfo(uploadFileInfoList, rootId) {
389
+ /** @type {?} */
390
+ let url = "/api/runtime/dfs/v1.0/doc/exproperty";
391
+ /** @type {?} */
392
+ let reqList = [];
393
+ uploadFileInfoList.forEach((/**
394
+ * @param {?} element
395
+ * @return {?}
396
+ */
397
+ element => {
398
+ /** @type {?} */
399
+ let request = { id: element.metadataId, rootId: rootId, exProperty: JSON.stringify(element.securityInfo) };
400
+ reqList.push(request);
401
+ }));
402
+ return this.http.post(url, reqList).pipe(tap((/**
403
+ * @param {?} res
404
+ * @return {?}
405
+ */
406
+ res => { })), catchError((/**
407
+ * @param {?} error
408
+ * @return {?}
409
+ */
410
+ (error) => {
411
+ return of(error);
412
+ })));
413
+ }
414
+ /**
415
+ * @param {?} formId
416
+ * @param {?} rootId
417
+ * @return {?}
418
+ */
419
+ getUploadedFileInfoList(formId, rootId) {
420
+ /** @type {?} */
421
+ let url = "/api/runtime/dfs/v1.0/formdoc/uploadedfile/infolist" + "?formid=" + formId + "&rootid=" + rootId;
422
+ //url = "/api/runtime/dfs/v1.0/formdoc/list";
423
+ return this.http.get(url).pipe(tap((/**
424
+ * @param {?} res
425
+ * @return {?}
426
+ */
427
+ res => { })), catchError((/**
428
+ * @param {?} error
429
+ * @return {?}
430
+ */
431
+ (error) => {
432
+ return of(error);
433
+ })));
434
+ }
435
+ /**
436
+ * @param {?} rootId
437
+ * @return {?}
438
+ */
439
+ getUploadInfo(rootId) {
440
+ /** @type {?} */
441
+ let url = "/api/runtime/dfs/v1.0/rootsetting/info?id=" + rootId;
442
+ return this.http.get(url).pipe(tap((/**
443
+ * @param {?} res
444
+ * @return {?}
445
+ */
446
+ res => { })), catchError((/**
447
+ * @param {?} error
448
+ * @return {?}
449
+ */
450
+ (error) => {
451
+ return of(error);
452
+ })));
453
+ }
454
+ }
455
+ UploadService.decorators = [
456
+ { type: Injectable }
457
+ ];
458
+ /** @nocollapse */
459
+ UploadService.ctorParameters = () => [
460
+ { type: HttpService },
461
+ { type: HttpClient }
459
462
  ];
460
463
 
461
- /**
462
- * @fileoverview added by tsickle
463
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
464
- */
465
- class UploadFileInfo {
464
+ /**
465
+ * @fileoverview added by tsickle
466
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
467
+ */
468
+ class UploadFileInfo {
466
469
  }
467
470
 
468
- /**
469
- * @fileoverview added by tsickle
470
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
471
- */
472
- class ExStorageFileInfo {
471
+ /**
472
+ * @fileoverview added by tsickle
473
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
474
+ */
475
+ class ExStorageFileInfo {
473
476
  }
474
477
 
475
- /**
476
- * @fileoverview added by tsickle
477
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
478
- */
479
- /** @enum {number} */
480
- const FileState = {
481
- New: 0,
482
- Update: 1,
483
- };
484
- FileState[FileState.New] = 'New';
478
+ /**
479
+ * @fileoverview added by tsickle
480
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
481
+ */
482
+ /** @enum {number} */
483
+ const FileState = {
484
+ New: 0,
485
+ Update: 1,
486
+ };
487
+ FileState[FileState.New] = 'New';
485
488
  FileState[FileState.Update] = 'Update';
486
489
 
487
- /**
488
- * @fileoverview added by tsickle
489
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
490
- */
491
- /** @type {?} */
492
- const LANG_RESOURCES = {
493
- 'zh-CHS': {
494
- 'uploadFile': '上传文件',
495
- 'uploading': '正在上传文件……',
496
- 'selectedCount': '已选择文件数量:',
497
- 'limitCount': '超出系统限制数量:',
498
- 'rechooseFile': ',请重新选择上传文件。',
499
- 'save': '保存',
500
- 'cancel': '取消',
501
- 'haveSameName': '已上传过同名文件: ',
502
- 'rename': '重命名',
503
- 'replace': '替换',
504
- 'sizeZero': '文件大小为0',
505
- 'sizeMax': '文件大小超出限制',
506
- 'uploadFailure': '上传失败',
507
- 'uploadSucceed': '上传成功',
508
- 'wait': '等一下,文档正在上传。',
509
- 'saveTo': '正在将文件保存到',
510
- 'delete': '删除',
511
- 'selectAll': '全选',
512
- 'selectNull': '全不选',
513
- 'detail': '详情',
514
- 'fileName': '文件名',
515
- 'state': '状态',
516
- 'operation': '操作',
517
- 'size': '大小',
518
- 'close': '关闭',
519
- 'loading': '拼命加载中',
520
- 'mismatchChunkSize': '文档分片上传部分丢失,请重新上传,如果多次上传失败,请联系管理员。',
521
- 'invalidCharacters': '文件名包含特殊字符',
522
- 'invalidExtNames': '文档类型不允许上传',
523
- 'whiteExtNames': '。允许上传的文件类型为:',
524
- 'blackExtNames': '。不允许上传的文件类型为:',
525
- 'UnrecognizedFileType': '无法确定文件类型',
526
- 'fileNameOverSize': '文件名超出长度限制,最长允许'
527
- },
528
- 'en-US': {
529
- 'uploadFile': 'Upload File',
530
- 'uploading': 'File Uploading……',
531
- 'selectedCount': 'Selected files count:',
532
- 'limitCount': 'System limit count:',
533
- 'rechooseFile': ',Reselect upload file.',
534
- 'save': 'Save',
535
- 'cancel': 'Cancel',
536
- 'haveSameName': 'A file with the same name has been uploaded: ',
537
- 'rename': 'Rename',
538
- 'replace': 'Replace',
539
- 'sizeZero': 'File size is 0',
540
- 'sizeMax': 'File size beyond limit',
541
- 'uploadFailure': 'Upload failed',
542
- 'uploadSucceed': 'Upload successfully',
543
- 'wait': 'Wait a minute, the file is uploading.',
544
- 'saveTo': 'Saving file to',
545
- 'delete': 'Delete',
546
- 'selectAll': 'Select all',
547
- 'selectNull': 'Not at all',
548
- 'detail': 'Details',
549
- 'fileName': 'Filename',
550
- 'state': 'State',
551
- 'operation': 'Operation',
552
- 'size': 'Size',
553
- 'close': 'Close',
554
- 'loading': 'Loading',
555
- 'mismatchChunkSize': 'The partial upload of document shards is missing. Please upload again. If multiple uploads fail, please contact the administrator.',
556
- 'invalidCharacters': 'The file name contains special characters',
557
- 'invalidExtNames': 'Document type does not allow uploading',
558
- 'whiteExtNames': '.The file types allowed for uploading are:',
559
- 'blackExtNames': '.The file types that are not allowed to be uploaded are:',
560
- 'UnrecognizedFileType': 'Unrecognized file type',
561
- 'fileNameOverSize': 'fileName oversize,the lengthest is'
562
- },
563
- 'en': {
564
- 'uploadFile': 'Upload File',
565
- 'uploading': 'File Uploading……',
566
- 'selectedCount': 'Selected files count:',
567
- 'limitCount': 'System limit count:',
568
- 'rechooseFile': ',Reselect upload file.',
569
- 'save': 'Save',
570
- 'cancel': 'Cancel',
571
- 'haveSameName': 'A file with the same name has been uploaded: ',
572
- 'rename': 'Rename',
573
- 'replace': 'Replace',
574
- 'sizeZero': 'File size is 0',
575
- 'sizeMax': 'File size beyond limit',
576
- 'uploadFailure': 'Upload failed',
577
- 'uploadSucceed': 'Upload successfully',
578
- 'wait': 'Wait a minute, the file is uploading.',
579
- 'saveTo': 'Saving file to',
580
- 'delete': 'Delete',
581
- 'selectAll': 'Select all',
582
- 'selectNull': 'Not at all',
583
- 'detail': 'Details',
584
- 'fileName': 'Filename',
585
- 'state': 'State',
586
- 'operation': 'Operation',
587
- 'size': 'Size',
588
- 'close': 'Close',
589
- 'loading': 'Loading',
590
- 'mismatchChunkSize': 'The partial upload of document shards is missing. Please upload again. If multiple uploads fail, please contact the administrator.',
591
- 'invalidCharacters': 'The file name contains special characters',
592
- 'invalidExtNames': 'Document type does not allow uploading',
593
- 'whiteExtNames': '.The file types allowed for uploading are:',
594
- 'blackExtNames': '.The file types that are not allowed to be uploaded are:',
595
- 'UnrecognizedFileType': 'Unrecognized file type',
596
- 'fileNameOverSize': 'fileName oversize,the lengthest is'
597
- },
598
- 'zh-CHT': {
599
- 'uploadFile': '上傳文件',
600
- 'uploading': '正在上傳文件……',
601
- 'selectedCount': '已選擇文件數量:',
602
- 'limitCount': '超出系統限制數量:',
603
- 'rechooseFile': ',重新選擇上傳文件。',
604
- 'save': '保存',
605
- 'cancel': '取消',
606
- 'haveSameName': '已上傳過同名文件: ',
607
- 'rename': '重命名',
608
- 'replace': '替換',
609
- 'sizeZero': '文件大小為0',
610
- 'sizeMax': '文件大小超出限制',
611
- 'uploadFailure': '上傳失敗',
612
- 'uploadSucceed': '上傳成功',
613
- 'wait': '等一下,文件正在上傳。',
614
- 'saveTo': '正在將文件保存到',
615
- 'delete': '删除',
616
- 'selectAll': '全選',
617
- 'selectNull': '全不選',
618
- 'detail': '詳情',
619
- 'fileName': '文件名',
620
- 'state': '狀態',
621
- 'operation': '操作',
622
- 'size': '大小',
623
- 'close': '關閉',
624
- 'loading': '拼命加載中',
625
- 'mismatchChunkSize': '文檔分片上傳部分遺失,請重新上傳,如果多次上傳失敗,請聯系管理員。',
626
- 'invalidCharacters': '文件名包含特殊字符',
627
- 'invalidExtNames': '文檔類型不允許上傳',
628
- 'whiteExtNames': '。允許上傳的文件類型為:',
629
- 'blackExtNames': '。不允許上傳的文件類型為:',
630
- 'UnrecognizedFileType': '無法確定文件類型',
631
- 'fileNameOverSize': '文件名超出长度限制,最长允许'
632
- },
490
+ /**
491
+ * @fileoverview added by tsickle
492
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
493
+ */
494
+ /** @type {?} */
495
+ const LANG_RESOURCES = {
496
+ 'zh-CHS': {
497
+ 'uploadFile': '上传文件',
498
+ 'uploading': '正在上传文件……',
499
+ 'selectedCount': '已选择文件数量:',
500
+ 'limitCount': '超出系统限制数量:',
501
+ 'rechooseFile': ',请重新选择上传文件。',
502
+ 'save': '保存',
503
+ 'cancel': '取消',
504
+ 'haveSameName': '已上传过同名文件: ',
505
+ 'rename': '重命名',
506
+ 'replace': '替换',
507
+ 'sizeZero': '文件大小为0',
508
+ 'sizeMax': '文件大小超出限制',
509
+ 'uploadFailure': '上传失败',
510
+ 'uploadFailurej': '上传失败, ',
511
+ 'uploadSucceed': '上传成功',
512
+ 'wait': '等一下,文档正在上传。',
513
+ 'saveTo': '正在将文件保存到',
514
+ 'delete': '删除',
515
+ 'selectAll': '全选',
516
+ 'selectNull': '全不选',
517
+ 'detail': '详情',
518
+ 'fileName': '文件名',
519
+ 'state': '状态',
520
+ 'operation': '操作',
521
+ 'size': '大小',
522
+ 'close': '关闭',
523
+ 'loading': '拼命加载中',
524
+ 'mismatchChunkSize': '文档分片上传部分丢失,请重新上传,如果多次上传失败,请联系管理员。',
525
+ 'invalidCharacters': '文件名包含特殊字符',
526
+ 'invalidExtNames': '文档类型不允许上传',
527
+ 'whiteExtNames': '。允许上传的文件类型为:',
528
+ 'blackExtNames': '。不允许上传的文件类型为:',
529
+ 'UnrecognizedFileType': '无法确定文件类型',
530
+ 'fileNameOverSize': '文件名超出长度限制,最长允许',
531
+ 'fileCount': "文件个数:"
532
+ },
533
+ 'en-US': {
534
+ 'uploadFile': 'Upload File',
535
+ 'uploading': 'File Uploading……',
536
+ 'selectedCount': 'Selected files count:',
537
+ 'limitCount': 'System limit count:',
538
+ 'rechooseFile': ',Reselect upload file.',
539
+ 'save': 'Save',
540
+ 'cancel': 'Cancel',
541
+ 'haveSameName': 'A file with the same name has been uploaded: ',
542
+ 'rename': 'Rename',
543
+ 'replace': 'Replace',
544
+ 'sizeZero': 'File size is 0.',
545
+ 'sizeMax': 'File size beyond limit.',
546
+ 'uploadFailure': 'Upload Failed',
547
+ 'uploadFailurej': 'Upload failed, ',
548
+ 'uploadSucceed': 'Upload Successfully',
549
+ 'wait': 'Wait a minute, the file is uploading.',
550
+ 'saveTo': 'Saving file to',
551
+ 'delete': 'Delete',
552
+ 'selectAll': 'Select All',
553
+ 'selectNull': 'Not At All',
554
+ 'detail': 'Details',
555
+ 'fileName': 'Filename',
556
+ 'state': 'State',
557
+ 'operation': 'Operation',
558
+ 'size': 'Size',
559
+ 'close': 'Close',
560
+ 'loading': 'Loading',
561
+ 'mismatchChunkSize': 'The partial upload of document shards is missing. Please upload again. If multiple uploads fail, please contact the administrator.',
562
+ 'invalidCharacters': 'The file name contains special characters.',
563
+ 'invalidExtNames': 'Document type does not allow uploading.',
564
+ 'whiteExtNames': '.The file types allowed for uploading are:',
565
+ 'blackExtNames': '.The file types that are not allowed to be uploaded are:',
566
+ 'UnrecognizedFileType': 'Unrecognized file type',
567
+ 'fileNameOverSize': 'fileName oversize,the lengthest is',
568
+ 'fileCount': "File Count:"
569
+ },
570
+ 'en': {
571
+ 'uploadFile': 'Upload File',
572
+ 'uploading': 'File Uploading……',
573
+ 'selectedCount': 'Selected files count:',
574
+ 'limitCount': 'System limit count:',
575
+ 'rechooseFile': ',Reselect upload file.',
576
+ 'save': 'Save',
577
+ 'cancel': 'Cancel',
578
+ 'haveSameName': 'A file with the same name has been uploaded: ',
579
+ 'rename': 'Rename',
580
+ 'replace': 'Replace',
581
+ 'sizeZero': 'File size is 0.',
582
+ 'sizeMax': 'File size beyond limit.',
583
+ 'uploadFailure': 'Upload Failed',
584
+ 'uploadFailurej': 'Upload failed, ',
585
+ 'uploadSucceed': 'Upload Successfully',
586
+ 'wait': 'Wait a minute, the file is uploading.',
587
+ 'saveTo': 'Saving file to',
588
+ 'delete': 'Delete',
589
+ 'selectAll': 'Select All',
590
+ 'selectNull': 'Not At All',
591
+ 'detail': 'Details',
592
+ 'fileName': 'Filename',
593
+ 'state': 'State',
594
+ 'operation': 'Operation',
595
+ 'size': 'Size',
596
+ 'close': 'Close',
597
+ 'loading': 'Loading',
598
+ 'mismatchChunkSize': 'The partial upload of document shards is missing. Please upload again. If multiple uploads fail, please contact the administrator.',
599
+ 'invalidCharacters': 'The file name contains special characters.',
600
+ 'invalidExtNames': 'Document type does not allow uploading.',
601
+ 'whiteExtNames': '.The file types allowed for uploading are:',
602
+ 'blackExtNames': '.The file types that are not allowed to be uploaded are:',
603
+ 'UnrecognizedFileType': 'Unrecognized file type',
604
+ 'fileNameOverSize': 'fileName oversize,the lengthest is',
605
+ 'fileCount': "File Count:"
606
+ },
607
+ 'zh-CHT': {
608
+ 'uploadFile': '上傳文件',
609
+ 'uploading': '正在上傳文件……',
610
+ 'selectedCount': '已選擇文件數量:',
611
+ 'limitCount': '超出系統限制數量:',
612
+ 'rechooseFile': ',重新選擇上傳文件。',
613
+ 'save': '保存',
614
+ 'cancel': '取消',
615
+ 'haveSameName': '已上傳過同名文件: ',
616
+ 'rename': '重命名',
617
+ 'replace': '替換',
618
+ 'sizeZero': '文件大小為0',
619
+ 'sizeMax': '文件大小超出限制',
620
+ 'uploadFailure': '上傳失敗',
621
+ 'uploadFailurej': '上傳失敗, ',
622
+ 'uploadSucceed': '上傳成功',
623
+ 'wait': '等一下,文件正在上傳。',
624
+ 'saveTo': '正在將文件保存到',
625
+ 'delete': '删除',
626
+ 'selectAll': '全選',
627
+ 'selectNull': '全不選',
628
+ 'detail': '詳情',
629
+ 'fileName': '文件名',
630
+ 'state': '狀態',
631
+ 'operation': '操作',
632
+ 'size': '大小',
633
+ 'close': '關閉',
634
+ 'loading': '拼命加載中',
635
+ 'mismatchChunkSize': '文檔分片上傳部分遺失,請重新上傳,如果多次上傳失敗,請聯系管理員。',
636
+ 'invalidCharacters': '文件名包含特殊字符',
637
+ 'invalidExtNames': '文檔類型不允許上傳',
638
+ 'whiteExtNames': '。允許上傳的文件類型為:',
639
+ 'blackExtNames': '。不允許上傳的文件類型為:',
640
+ 'UnrecognizedFileType': '無法確定文件類型',
641
+ 'fileNameOverSize': '文件名超出长度限制,最长允许',
642
+ 'fileCount': "文件個數:"
643
+ },
633
644
  };
634
645
 
635
- /**
636
- * @fileoverview added by tsickle
637
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
638
- */
639
- class LocalLangPipe {
640
- /**
641
- * @param {?} localeId
642
- */
643
- constructor(localeId) {
644
- this.defaultLang = "zh-CHS";
645
- this.langCode = localStorage.getItem("languageCode") || localeId || this.defaultLang;
646
- this.lang = LANG_RESOURCES[this.langCode] || LANG_RESOURCES[this.defaultLang];
647
- }
648
- /**
649
- * @param {?} name
650
- * @return {?}
651
- */
652
- transform(name) {
653
- return this.lang[name] || name;
654
- }
655
- }
656
- LocalLangPipe.decorators = [
657
- { type: Pipe, args: [{ name: 'locale' },] }
658
- ];
659
- /** @nocollapse */
660
- LocalLangPipe.ctorParameters = () => [
661
- { type: String, decorators: [{ type: Inject, args: [LOCALE_ID,] }] }
646
+ /**
647
+ * @fileoverview added by tsickle
648
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
649
+ */
650
+ class LocalLangPipe {
651
+ /**
652
+ * @param {?} localeId
653
+ */
654
+ constructor(localeId) {
655
+ this.defaultLang = "zh-CHS";
656
+ this.langCode = localStorage.getItem("languageCode") || localeId || this.defaultLang;
657
+ this.lang = LANG_RESOURCES[this.langCode] || LANG_RESOURCES[this.defaultLang];
658
+ }
659
+ /**
660
+ * @param {?} name
661
+ * @return {?}
662
+ */
663
+ transform(name) {
664
+ return this.lang[name] || name;
665
+ }
666
+ }
667
+ LocalLangPipe.decorators = [
668
+ { type: Pipe, args: [{ name: 'locale' },] }
669
+ ];
670
+ /** @nocollapse */
671
+ LocalLangPipe.ctorParameters = () => [
672
+ { type: String, decorators: [{ type: Inject, args: [LOCALE_ID,] }] }
662
673
  ];
663
674
 
664
- /**
665
- * @fileoverview added by tsickle
666
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
667
- */
668
- class GspDocSecurityBaseInfo {
675
+ /**
676
+ * @fileoverview added by tsickle
677
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
678
+ */
679
+ class GspDocSecurityBaseInfo {
669
680
  }
670
681
 
671
- /**
672
- * @fileoverview added by tsickle
673
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
674
- */
675
- class InitMultiUploadRequest {
682
+ /**
683
+ * @fileoverview added by tsickle
684
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
685
+ */
686
+ class InitMultiUploadRequest {
676
687
  }
677
688
 
678
- /**
679
- * @fileoverview added by tsickle
680
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
681
- */
682
- class CompleteMultiUploadRequest {
689
+ /**
690
+ * @fileoverview added by tsickle
691
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
692
+ */
693
+ class CompleteMultiUploadRequest {
683
694
  }
684
695
 
685
- /**
686
- * @fileoverview added by tsickle
687
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
688
- */
689
- class GspFormStreamEntity {
696
+ /**
697
+ * @fileoverview added by tsickle
698
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
699
+ */
700
+ class GspFormStreamEntity {
690
701
  }
691
702
 
692
- /**
693
- * @fileoverview added by tsickle
694
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
695
- */
696
- class MultiUploadRequest {
703
+ /**
704
+ * @fileoverview added by tsickle
705
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
706
+ */
707
+ class MultiUploadRequest {
697
708
  }
698
709
 
699
- /**
700
- * @fileoverview added by tsickle
701
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
702
- */
703
- class FileUploadComponent {
704
- /**
705
- * @param {?} msgService
706
- * @param {?} uploadService
707
- * @param {?} loadService
708
- * @param {?=} injector
709
- */
710
- constructor(msgService, uploadService, loadService, injector) {
711
- this.msgService = msgService;
712
- this.uploadService = uploadService;
713
- this.loadService = loadService;
714
- this.injector = injector;
715
- this.files = [];
716
- this.metadataIdList = [];
717
- this.uploadFileInfoList = [];
718
- this.errFileList = [];
719
- this.errTypeList = [];
720
- this.nullFileList = [];
721
- this.beyondFileList = [];
722
- this.fileNameOversizeList = [];
723
- this.invalidCharactersFileList = [];
724
- this.invalidExtNamesFileList = [];
725
- this.unrecognizedTypeFileList = [];
726
- this.invalidCharacters = '';
727
- this.invalidExtNames = '';
728
- this.showType = 0;
729
- this.mouseOn = false;
730
- this.isWhiteList = false;
731
- this.bufferSize = 5 * 1024 * 1024;
732
- this.selectedFileCount = 0;
733
- this.uploadIconAddress = this.createBaseUrl('/platform/runtime/dfs/images/upload.svg');
734
- this.uploadLittleIconAddress = this.createBaseUrl('/platform/runtime/dfs/images/uploadIcon.svg');
735
- this.hasSelectedFile = false;
736
- this.fileAllSelected = false;
737
- this.uploadProcess = { width: '0%' };
738
- this.fileTotalChunk = {};
739
- this.requestArray = new Array;
740
- this.requestBodyArray = new Array;
741
- this.uploadedChunk = {};
742
- this.uploadedProcess = {};
743
- this.defaultPropertyName = "";
744
- this.propertiesNames = [];
745
- this.securityInfoList = [];
746
- this.queueListStyle = { width: '480px' };
747
- this.dropListValue = "";
748
- this.uploadedFileTotal = 0;
749
- this.haveExtensionProperty = false;
750
- this.haveSecurityInfo = false;
751
- this.uploadedFileInfoList = [];
752
- this.oldUploadedFileList = [];
753
- //uploadedNameList = [];
754
- this.sameNameAllowed = true;
755
- this.maxFileSize = 0;
756
- this.checkboxPos = { top: '0px' };
757
- this.fileType = "*";
758
- this.fileCount = 0;
759
- this.oldIdList = [];
760
- this.securityInfo = null;
761
- this.fileNameLength = 0;
762
- this.totalLoad = null;
763
- this.exStorageFileList = [];
764
- if (this.injector) {
765
- this.httpclient = this.injector.get(HttpClient);
766
- this.localeid = localStorage.getItem("languageCode") || this.injector.get(LOCALE_ID);
767
- this.localepipe = new LocalLangPipe(this.localeid);
768
- }
769
- }
770
- ;
771
- /**
772
- * @return {?}
773
- */
774
- ngOnInit() {
775
- if (navigator.userAgent.indexOf('Firefox') >= 0)
776
- this.checkboxPos.top = '14px';
777
- //if (this.storageService != null) {
778
- if (this.securityInfo != null) {
779
- this.uploadService.getSecurityInfoList(this.securityInfo).subscribe((/**
780
- * @param {?} res
781
- * @return {?}
782
- */
783
- res => {
784
- this.haveSecurityInfo = true;
785
- /** @type {?} */
786
- let i = 0;
787
- res.forEach((/**
788
- * @param {?} element
789
- * @return {?}
790
- */
791
- element => {
792
- this.securityInfoList.push({ id: i.toString(), securityId: element.securityId, securityLevel: element.securityLevel, name: element.name });
793
- i++;
794
- }));
795
- }));
796
- }
797
- this.uploadService.getStorageExtensionInfo().subscribe((/**
798
- * @param {?} res
799
- * @return {?}
800
- */
801
- res => {
802
- if (res != null && res.error == null) {
803
- this.storageExtension = res;
804
- this.defaultPropertyName = this.storageExtension.defaultPropertyName;
805
- this.propertiesNames.push({ id: "0", name: this.storageExtension.defaultPropertyName });
806
- /** @type {?} */
807
- let i = 0;
808
- // this.propertiesNames.push(...(this.storageExtension.extensionPropertyNameList));
809
- this.storageExtension.extensionPropertyNameList.forEach((/**
810
- * @param {?} element
811
- * @return {?}
812
- */
813
- element => {
814
- this.propertiesNames.push({ id: (++i).toString(), name: element });
815
- }));
816
- this.queueListStyle.width = '380px';
817
- this.haveExtensionProperty = true;
818
- }
819
- }));
820
- this.uploadService.getUploadInfo(this.rootId).subscribe((/**
821
- * @param {?} res
822
- * @return {?}
823
- */
824
- res => {
825
- if (res != null && res.error == null) {
826
- this.sameNameAllowed = res.sameNameAllowed;
827
- this.maxFileSize = parseInt(JSON.parse(res.validateConfiguration).maxFileSize);
828
- this.isWhiteList = JSON.parse(res.validateConfiguration).whiteList;
829
- this.invalidCharacters = JSON.parse(res.validateConfiguration).invalidCharacters;
830
- this.invalidExtNames = JSON.parse(res.validateConfiguration).invalidExtNames.toLowerCase();
831
- this.allowedMultiUpload = res.allowedMultiUpload;
832
- if (!this.sameNameAllowed) {
833
- this.uploadService.getUploadedFileInfoList(this.formId, this.rootId).subscribe((/**
834
- * @param {?} res
835
- * @return {?}
836
- */
837
- res => {
838
- if (res != null && res.error == null) {
839
- this.uploadedFileInfoList = res;
840
- this.oldUploadedFileList = JSON.parse(JSON.stringify(res));
841
- }
842
- }));
843
- }
844
- }
845
- }));
846
- if (this.oldIdList != null && this.oldIdList.length > 0) ;
847
- this.radioButtonGroupValue = 'showByGroup';
848
- }
849
- /**
850
- * @return {?}
851
- */
852
- showLoading() {
853
- this.hasSelectedFile = true;
854
- // if (this.totalLoad == null)
855
- // this.totalLoad = this.loadService.show({
856
- // message: this.localepipe.transform('uploading')
857
- // });
858
- }
859
- /**
860
- * @param {?} name
861
- * @return {?}
862
- */
863
- findInvalidCharacter(name) {
864
- /** @type {?} */
865
- let charList = [];
866
- this.invalidCharacters.split('|').forEach((/**
867
- * @param {?} element
868
- * @return {?}
869
- */
870
- element => {
871
- if (name.indexOf(element) >= 0)
872
- charList.push(element);
873
- }));
874
- return charList;
875
- }
876
- /**
877
- * @param {?} file
878
- * @return {?}
879
- */
880
- hasFileType(file) {
881
- return file.name.includes('.');
882
- }
883
- /**
884
- * @param {?} $event
885
- * @return {?}
886
- */
887
- fileSelected($event) {
888
- this.hasSelectedFile = true;
889
- this.selectedFiles = document.querySelector('#file');
890
- if (this.fileCount > 0) {
891
- if (this.selectedFiles.files.length + this.files.length > this.fileCount) {
892
- /** @type {?} */
893
- let selectedNum = ((/** @type {?} */ (this.selectedFiles.files.length))) + this.files.length;
894
- this.msgService.warning(this.localepipe.transform('selectedCount') + selectedNum + this.localepipe.transform('limitCount') + this.fileCount + this.localepipe.transform('rechooseFile'));
895
- return;
896
- }
897
- }
898
- //this.flag = 0;
899
- for (let i = 0; i < this.selectedFiles.files.length; i++) {
900
- /** @type {?} */
901
- let selectedFile = this.selectedFiles.files[i];
902
- selectedFile.isAllowedUpload = true;
903
- //selectedFile.slice
904
- /** @type {?} */
905
- let uuid = UUID.UUID();
906
- if (selectedFile.size == 0) {
907
- this.nullFileList.push(selectedFile.name);
908
- continue;
909
- }
910
- if (this.fileNameLength > 0 && selectedFile.name.length > this.fileNameLength) {
911
- this.fileNameOversizeList.push(selectedFile.name);
912
- continue;
913
- }
914
- if (this.maxFileSize != null && this.maxFileSize > 0) {
915
- if (selectedFile.size > this.maxFileSize * 1000) {
916
- this.beyondFileList.push(selectedFile.name);
917
- continue;
918
- }
919
- }
920
- /** @type {?} */
921
- let invalidCharList = this.findInvalidCharacter(selectedFile.name);
922
- /** @type {?} */
923
- let errorMessage = "";
924
- if (invalidCharList.length > 0) {
925
- invalidCharList.forEach((/**
926
- * @param {?} element
927
- * @param {?} index
928
- * @return {?}
929
- */
930
- (element, index) => {
931
- errorMessage += "\"";
932
- errorMessage += element;
933
- errorMessage += "\"";
934
- errorMessage += (index === invalidCharList.length - 1) ? "" : ",";
935
- }));
936
- if (this.selectedFiles.files.length === 1) {
937
- selectedFile.isAllowedUpload = false;
938
- this.msgService.warning(this.localepipe.transform('invalidCharacters') + errorMessage + this.localepipe.transform('rechooseFile'));
939
- return;
940
- }
941
- if (this.selectedFiles.files.length > 1) {
942
- selectedFile.isAllowedUpload = false;
943
- this.invalidCharactersFileList.push(selectedFile.name);
944
- continue;
945
- }
946
- }
947
- if (!this.hasFileType(selectedFile)) {
948
- if (this.selectedFiles.files.length === 1) {
949
- selectedFile.isAllowedUpload = false;
950
- this.msgService.warning(selectedFile.name + this.localepipe.transform('UnrecognizedFileType') + this.localepipe.transform('rechooseFile'));
951
- return;
952
- }
953
- if (this.selectedFiles.files.length > 1) {
954
- selectedFile.isAllowedUpload = false;
955
- this.unrecognizedTypeFileList.push(selectedFile.name);
956
- continue;
957
- }
958
- }
959
- // let curFileSuffix = selectedFile.name.split('.')[1];
960
- /** @type {?} */
961
- let curFileSuffix = selectedFile.name.substr(selectedFile.name.lastIndexOf('.') + 1).toLowerCase();
962
- /** @type {?} */
963
- const extNames = this.listToString(this.invalidExtNames.split('|'));
964
- /** @type {?} */
965
- const extNamesAry = this.invalidExtNames.split('|');
966
- if (!this.isWhiteList && extNamesAry.includes(curFileSuffix)) {
967
- if (this.selectedFiles.files.length === 1) {
968
- selectedFile.isAllowedUpload = false;
969
- this.msgService.warning(selectedFile.name + this.localepipe.transform('invalidExtNames') + this.localepipe.transform('blackExtNames') + extNames + this.localepipe.transform('rechooseFile'));
970
- return;
971
- }
972
- if (this.selectedFiles.files.length > 1) {
973
- selectedFile.isAllowedUpload = false;
974
- this.invalidExtNamesFileList.push(selectedFile.name);
975
- continue;
976
- }
977
- }
978
- if (this.isWhiteList && !extNamesAry.includes(curFileSuffix)) {
979
- if (this.selectedFiles.files.length === 1) {
980
- selectedFile.isAllowedUpload = false;
981
- this.msgService.warning(selectedFile.name + this.localepipe.transform('invalidExtNames') + this.localepipe.transform('whiteExtNames') + extNames + this.localepipe.transform('rechooseFile'));
982
- return;
983
- }
984
- if (this.selectedFiles.files.length > 1) {
985
- selectedFile.isAllowedUpload = false;
986
- this.invalidExtNamesFileList.push(selectedFile.name);
987
- continue;
988
- }
989
- }
990
- if (!this.sameNameAllowed) {
991
- if (this.uploadedFileInfoList.find((/**
992
- * @param {?} x
993
- * @return {?}
994
- */
995
- x => x.fileName == selectedFile.name)) != null) {
996
- /** @type {?} */
997
- const msg = this.msgService.show('warning', this.localepipe.transform('haveSameName') + selectedFile.name, {
998
- initialState: {
999
- buttons: [
1000
- {
1001
- text: this.localepipe.transform('rename'),
1002
- cls: 'btn btn-secondary',
1003
- handle: (/**
1004
- * @return {?}
1005
- */
1006
- () => {
1007
- /** @type {?} */
1008
- let oldName = selectedFile.name;
1009
- /** @type {?} */
1010
- let newName;
1011
- /** @type {?} */
1012
- let flag = true;
1013
- /** @type {?} */
1014
- let i = 1;
1015
- while (flag) {
1016
- newName = oldName.substring(0, oldName.lastIndexOf('.')) + '(' + i + ')' + oldName.substring(oldName.lastIndexOf('.'));
1017
- if (this.uploadedFileInfoList.find((/**
1018
- * @param {?} x
1019
- * @return {?}
1020
- */
1021
- x => x.fileName == newName)) != null) {
1022
- i++;
1023
- }
1024
- else
1025
- flag = false;
1026
- }
1027
- this.uploadFile(uuid, selectedFile, newName);
1028
- msg.close();
1029
- })
1030
- },
1031
- {
1032
- text: this.localepipe.transform('replace'),
1033
- cls: 'btn btn-secondary',
1034
- handle: (/**
1035
- * @return {?}
1036
- */
1037
- () => {
1038
- uuid = this.uploadedFileInfoList.find((/**
1039
- * @param {?} x
1040
- * @return {?}
1041
- */
1042
- x => x.fileName == selectedFile.name)).metadataId;
1043
- this.uploadFile(uuid, selectedFile, selectedFile.name, FileState.Update);
1044
- this.uploadedFileTotal--;
1045
- if (this.oldUploadedFileList.find((/**
1046
- * @param {?} x
1047
- * @return {?}
1048
- */
1049
- x => x.fileName == selectedFile.name))) {
1050
- this.uploadedFileTotal++;
1051
- this.uploadedFileInfoList.splice(this.uploadedFileInfoList.indexOf(this.uploadedFileInfoList.filter((/**
1052
- * @param {?} x
1053
- * @return {?}
1054
- */
1055
- x => x.fileName == selectedFile.name))[0]), 1);
1056
- }
1057
- msg.close();
1058
- })
1059
- },
1060
- {
1061
- text: this.localepipe.transform('cancel'),
1062
- cls: 'btn btn-secondary',
1063
- handle: (/**
1064
- * @return {?}
1065
- */
1066
- () => {
1067
- msg.close();
1068
- })
1069
- }
1070
- ]
1071
- }
1072
- });
1073
- continue;
1074
- }
1075
- }
1076
- if (selectedFile.isAllowedUpload === true) {
1077
- this.uploadFile(uuid, selectedFile, selectedFile.name);
1078
- }
1079
- }
1080
- if (this.errFileList.length > 0) {
1081
- /** @type {?} */
1082
- let name = this.listToString(this.errFileList);
1083
- this.msgService.warning(this.localepipe.transform('haveSameName') + name + this.localepipe.transform('rechooseFile'));
1084
- this.errFileList = [];
1085
- }
1086
- if (this.nullFileList.length > 0) {
1087
- /** @type {?} */
1088
- let name = this.listToString(this.nullFileList);
1089
- this.msgService.warning(name + this.localepipe.transform('sizeZero') + this.localepipe.transform('rechooseFile'));
1090
- this.nullFileList = [];
1091
- }
1092
- if (this.fileNameOversizeList.length > 0) {
1093
- /** @type {?} */
1094
- let name = this.listToString(this.fileNameOversizeList);
1095
- this.msgService.warning(name + this.localepipe.transform('fileNameOverSize') + this.fileNameLength + this.localepipe.transform('rechooseFile'));
1096
- this.fileNameOversizeList = [];
1097
- }
1098
- if (this.beyondFileList.length > 0) {
1099
- /** @type {?} */
1100
- let name = this.listToString(this.beyondFileList);
1101
- this.msgService.warning(name + this.localepipe.transform('sizeMax') + this.maxFileSize + "KB" + this.localepipe.transform('rechooseFile'));
1102
- this.beyondFileList = [];
1103
- }
1104
- if (this.invalidCharactersFileList.length > 0) {
1105
- /** @type {?} */
1106
- let name = this.listToString(this.invalidCharactersFileList);
1107
- this.msgService.warning(name + this.localepipe.transform('invalidCharacters') + this.localepipe.transform('rechooseFile'));
1108
- this.invalidCharactersFileList = [];
1109
- }
1110
- if (this.invalidExtNamesFileList.length > 0) {
1111
- /** @type {?} */
1112
- let name = this.listToString(this.invalidExtNamesFileList);
1113
- this.msgService.warning(name + this.localepipe.transform('invalidExtNames') + this.localepipe.transform('rechooseFile'));
1114
- this.invalidExtNamesFileList = [];
1115
- }
1116
- if (this.unrecognizedTypeFileList.length > 0) {
1117
- /** @type {?} */
1118
- let name = this.listToString(this.unrecognizedTypeFileList);
1119
- this.msgService.warning(name + this.localepipe.transform('UnrecognizedFileType') + this.localepipe.transform('rechooseFile'));
1120
- this.unrecognizedTypeFileList = [];
1121
- }
1122
- this.files = this.files.slice();
1123
- this.fileAllSelected = false;
1124
- $event.target.value = '';
1125
- // loading.close();
1126
- }
1127
- /**
1128
- * @param {?} file
1129
- * @return {?}
1130
- */
1131
- showErrorMessage(file) {
1132
- this.msgService.error(this.localepipe.transform('uploadFailure') + file.errorMessage);
1133
- }
1134
- /**
1135
- * @param {?} uuid
1136
- * @param {?} selectedFile
1137
- * @param {?} fileName
1138
- * @return {?}
1139
- */
1140
- handleFileInfo(uuid, selectedFile, fileName) {
1141
- /** @type {?} */
1142
- let fileInfo;
1143
- fileInfo = {
1144
- id: uuid,
1145
- name: fileName,
1146
- type: selectedFile.type,
1147
- source: "",
1148
- size: this.getFileSize(selectedFile.size),
1149
- fileSize: selectedFile.size,
1150
- picListDisplayName: this.getPicListDisplayName(fileName),
1151
- queueListDisplayName: this.getQueueDisplayName(fileName),
1152
- //content: reader.result.toString(),
1153
- hasUploaded: false,
1154
- mouseOn: false,
1155
- selectd: false,
1156
- isUploading: true,
1157
- uploadResult: false,
1158
- uploadProcess: 0,
1159
- errorMessage: "",
1160
- extensionDropListId: 0,
1161
- extensionName: "",
1162
- securityDropListId: 0,
1163
- securityInfo: this.securityInfoList[0]
1164
- };
1165
- if (this.storageExtension != null)
1166
- fileInfo.extensionName = this.defaultPropertyName;
1167
- /** @type {?} */
1168
- let type = selectedFile.type;
1169
- if (type.includes("tiff")) {
1170
- this.addDocInfo(selectedFile, fileInfo, DocType.Other);
1171
- }
1172
- else if (type.includes("image")) {
1173
- this.addDocInfo(selectedFile, fileInfo, DocType.Image);
1174
- }
1175
- else if (type.includes("word")) {
1176
- this.addDocInfo(selectedFile, fileInfo, DocType.Word);
1177
- }
1178
- else if (type.includes("pdf")) {
1179
- this.addDocInfo(selectedFile, fileInfo, DocType.Pdf);
1180
- }
1181
- else if (type.includes("plain")) {
1182
- this.addDocInfo(selectedFile, fileInfo, DocType.Txt);
1183
- }
1184
- else if (type.includes("sheet") || type.includes("excel")) {
1185
- this.addDocInfo(selectedFile, fileInfo, DocType.Excel);
1186
- }
1187
- else if (type.includes("powerpoint") || type.includes("presentation")) {
1188
- this.addDocInfo(selectedFile, fileInfo, DocType.Powerpoint);
1189
- }
1190
- else {
1191
- this.addDocInfo(selectedFile, fileInfo, DocType.Other);
1192
- // let name: string = selectedFile.name;
1193
- // let errType = name.substring(selectedFile.name.lastIndexOf('.'));
1194
- // this.errTypeList.push(errType);
1195
- }
1196
- return fileInfo;
1197
- }
1198
- /**
1199
- * @param {?} uuid
1200
- * @param {?} selectedFile
1201
- * @param {?} fileName
1202
- * @param {?=} state
1203
- * @return {?}
1204
- */
1205
- uploadFile(uuid, selectedFile, fileName, state = FileState.New) {
1206
- /** @type {?} */
1207
- let fileInfo = this.handleFileInfo(uuid, selectedFile, fileName);
1208
- /** @type {?} */
1209
- let uploadFileInfo = new UploadFileInfo();
1210
- uploadFileInfo.metadataId = uuid;
1211
- uploadFileInfo.fileName = fileInfo.name;
1212
- uploadFileInfo.fileSize = fileInfo.size;
1213
- uploadFileInfo.state = state;
1214
- uploadFileInfo.securityInfo = this.securityInfoList[0];
1215
- //判断是否支持分片上传
1216
- if (this.allowedMultiUpload) {
1217
- //支持分片上传
1218
- /** @type {?} */
1219
- let initRequest = new InitMultiUploadRequest;
1220
- initRequest.path = this.formId;
1221
- initRequest.metadataId = uuid;
1222
- initRequest.rootId = this.rootId;
1223
- initRequest.size = fileInfo.fileSize;
1224
- initRequest.fileName = fileName;
1225
- //初始化分片
1226
- this.initMultiUpload(initRequest).subscribe((/**
1227
- * @param {?} res
1228
- * @return {?}
1229
- */
1230
- res => {
1231
- if (res.error != null) {
1232
- this.files[this.files.indexOf(fileInfo)].uploadResult = false;
1233
- this.files[this.files.indexOf(fileInfo)].isUploading = false;
1234
- this.files[this.files.indexOf(fileInfo)].errorMessage = res.error.Message;
1235
- }
1236
- else {
1237
- /** @type {?} */
1238
- let uploadId = res.uploadId;
1239
- /** @type {?} */
1240
- let chunkTotal = Math.ceil(selectedFile.size / this.bufferSize);
1241
- /** @type {?} */
1242
- let chunkIndex = 0;
1243
- /** @type {?} */
1244
- let multiResultList = [];
1245
- this.fileTotalChunk[uuid] = chunkTotal;
1246
- this.uploadedChunk[uuid] = 0;
1247
- while (chunkIndex < chunkTotal) {
1248
- /** @type {?} */
1249
- let nextSize = Math.min((chunkIndex + 1) * this.bufferSize, selectedFile.size);
1250
- /** @type {?} */
1251
- let fileData = selectedFile.slice(chunkIndex * this.bufferSize, nextSize);
1252
- /** @type {?} */
1253
- let multiRequest = new MultiUploadRequest;
1254
- multiRequest.metadataId = uuid;
1255
- multiRequest.rootId = this.rootId;
1256
- multiRequest.uploadId = uploadId;
1257
- multiRequest.index = chunkIndex;
1258
- multiRequest.total = chunkTotal;
1259
- multiRequest.size = fileData.size;
1260
- /** @type {?} */
1261
- let formData = new FormData();
1262
- formData.append('multiRequest', JSON.stringify(multiRequest));
1263
- formData.append('file', fileData);
1264
- this.multiUpload(formData).subscribe((/**
1265
- * @param {?} res
1266
- * @return {?}
1267
- */
1268
- res => {
1269
- if (res.error != null) {
1270
- this.files[this.files.indexOf(fileInfo)].uploadResult = false;
1271
- this.files[this.files.indexOf(fileInfo)].isUploading = false;
1272
- this.files[this.files.indexOf(fileInfo)].errorMessage = res.error.Message;
1273
- }
1274
- else {
1275
- multiResultList.push(res.result);
1276
- this.uploadedChunk[uuid]++;
1277
- this.files[this.files.indexOf(fileInfo)].uploadProcess = Number.parseInt((this.uploadedChunk[uuid] / this.fileTotalChunk[uuid] * 100).toFixed(0));
1278
- if (this.uploadedChunk[uuid] == this.fileTotalChunk[uuid]) {
1279
- if (multiResultList.length == this.fileTotalChunk[uuid]) {
1280
- /** @type {?} */
1281
- let completeMultiUploadRequest = new CompleteMultiUploadRequest;
1282
- completeMultiUploadRequest.metadataId = uuid;
1283
- completeMultiUploadRequest.partList = multiResultList;
1284
- completeMultiUploadRequest.rootId = this.rootId;
1285
- completeMultiUploadRequest.uploadId = uploadId;
1286
- completeMultiUploadRequest.size = fileInfo.fileSize;
1287
- if (this.haveExtensionProperty)
1288
- completeMultiUploadRequest.exPropertyName = this.defaultPropertyName;
1289
- this.completeMultiUpload(completeMultiUploadRequest).subscribe((/**
1290
- * @param {?} res
1291
- * @return {?}
1292
- */
1293
- res => {
1294
- if (res.status != 200) {
1295
- this.files[this.files.indexOf(fileInfo)].uploadResult = false;
1296
- this.files[this.files.indexOf(fileInfo)].isUploading = false;
1297
- this.files[this.files.indexOf(fileInfo)].errorMessage = res.error.Message;
1298
- }
1299
- else {
1300
- this.files[this.files.indexOf(fileInfo)].uploadResult = true;
1301
- this.files[this.files.indexOf(fileInfo)].isUploading = false;
1302
- this.uploadFileInfoList = this.uploadFileInfoList.concat(uploadFileInfo);
1303
- this.uploadedFileInfoList = this.uploadedFileInfoList.concat(uploadFileInfo);
1304
- this.uploadedFileTotal++;
1305
- }
1306
- }));
1307
- //后台异步拼接文档
1308
- }
1309
- else {
1310
- this.files[this.files.indexOf(fileInfo)].uploadResult = false;
1311
- this.files[this.files.indexOf(fileInfo)].isUploading = false;
1312
- this.files[this.files.indexOf(fileInfo)].errorMessage = this.localepipe.transform('mismatchChunkSize');
1313
- }
1314
- }
1315
- }
1316
- }));
1317
- chunkIndex = chunkIndex + 1;
1318
- }
1319
- }
1320
- }));
1321
- }
1322
- else {
1323
- /** @type {?} */
1324
- let entity = new GspFormStreamEntity;
1325
- entity.formId = this.formId;
1326
- entity.metadataId = uuid;
1327
- entity.mode = OperatingModes.Temp;
1328
- entity.rootId = this.rootId;
1329
- entity.size = selectedFile.size;
1330
- entity.fileName = fileName;
1331
- if (this.haveExtensionProperty)
1332
- entity.exPropertyName = this.defaultPropertyName;
1333
- /** @type {?} */
1334
- let formData = new FormData();
1335
- formData.append('uploadEntity', JSON.stringify(entity));
1336
- formData.append('file', selectedFile);
1337
- this.uploadSingleFile(formData).subscribe((/**
1338
- * @param {?} res
1339
- * @return {?}
1340
- */
1341
- res => {
1342
- if (res != null) {
1343
- this.files[this.files.indexOf(fileInfo)].uploadResult = false;
1344
- this.files[this.files.indexOf(fileInfo)].isUploading = false;
1345
- this.files[this.files.indexOf(fileInfo)].errorMessage = res.error.Message;
1346
- }
1347
- else {
1348
- this.files[this.files.indexOf(fileInfo)].uploadResult = true;
1349
- this.files[this.files.indexOf(fileInfo)].isUploading = false;
1350
- this.uploadFileInfoList = this.uploadFileInfoList.concat(uploadFileInfo);
1351
- this.uploadedFileInfoList = this.uploadedFileInfoList.concat(uploadFileInfo);
1352
- this.uploadedFileTotal++;
1353
- }
1354
- }));
1355
- }
1356
- /** @type {?} */
1357
- let index = -1;
1358
- this.files.forEach((/**
1359
- * @param {?} x
1360
- * @return {?}
1361
- */
1362
- x => {
1363
- if (x.name == fileInfo.name) {
1364
- if (index == -1)
1365
- index = this.files.indexOf(x);
1366
- }
1367
- }));
1368
- if (index != -1 && index != this.files.length - 1) {
1369
- this.files.splice(index, 1);
1370
- this.uploadFileInfoList.splice(index, 1);
1371
- this.uploadedFileInfoList.splice(index, 1);
1372
- //this.uploadedFileTotal--;
1373
- }
1374
- }
1375
- /**
1376
- * @param {?} formdata
1377
- * @return {?}
1378
- */
1379
- uploadSingleFile(formdata) {
1380
- /** @type {?} */
1381
- let url = "/api/runtime/dfs/v1.0/formdoc/single";
1382
- /** @type {?} */
1383
- const baseUrl = BasePathService.convertPath(url);
1384
- return this.httpclient.post(baseUrl, formdata).pipe(tap((/**
1385
- * @param {?} res
1386
- * @return {?}
1387
- */
1388
- res => { })), catchError((/**
1389
- * @param {?} error
1390
- * @return {?}
1391
- */
1392
- (error) => {
1393
- return of$1(error);
1394
- })));
1395
- }
1396
- /**
1397
- * @param {?} formdata
1398
- * @return {?}
1399
- */
1400
- uploadSliceFile(formdata) {
1401
- /** @type {?} */
1402
- let url = "/api/runtime/dfs/v1.0/formdoc/slice";
1403
- /** @type {?} */
1404
- const baseUrl = BasePathService.convertPath(url);
1405
- return this.httpclient.post(baseUrl, formdata).pipe(tap((/**
1406
- * @param {?} res
1407
- * @return {?}
1408
- */
1409
- res => { })), catchError((/**
1410
- * @param {?} error
1411
- * @return {?}
1412
- */
1413
- (error) => {
1414
- return of$1(error);
1415
- })));
1416
- }
1417
- /**
1418
- * @param {?} request
1419
- * @return {?}
1420
- */
1421
- initMultiUpload(request) {
1422
- /** @type {?} */
1423
- let url = "/api/runtime/dfs/v1.0/formdoc/multi/init";
1424
- /** @type {?} */
1425
- const baseUrl = BasePathService.convertPath(url);
1426
- return this.httpclient.post(baseUrl, request).pipe(tap((/**
1427
- * @param {?} res
1428
- * @return {?}
1429
- */
1430
- res => { })), catchError((/**
1431
- * @param {?} error
1432
- * @return {?}
1433
- */
1434
- (error) => {
1435
- return of$1(error);
1436
- })));
1437
- }
1438
- /**
1439
- * @param {?} formdata
1440
- * @return {?}
1441
- */
1442
- multiUpload(formdata) {
1443
- /** @type {?} */
1444
- let url = "/api/runtime/dfs/v1.0/formdoc/multi/upload";
1445
- /** @type {?} */
1446
- const baseUrl = BasePathService.convertPath(url);
1447
- return this.httpclient.post(baseUrl, formdata).pipe(tap((/**
1448
- * @param {?} res
1449
- * @return {?}
1450
- */
1451
- res => { })), catchError((/**
1452
- * @param {?} error
1453
- * @return {?}
1454
- */
1455
- (error) => {
1456
- return of$1(error);
1457
- })));
1458
- }
1459
- /**
1460
- * @param {?} request
1461
- * @return {?}
1462
- */
1463
- completeMultiUpload(request) {
1464
- /** @type {?} */
1465
- let url = "/api/runtime/dfs/v1.0/formdoc/multi/complete";
1466
- /** @type {?} */
1467
- const baseUrl = BasePathService.convertPath(url);
1468
- return this.httpclient.post(baseUrl, request).pipe(tap((/**
1469
- * @param {?} res
1470
- * @return {?}
1471
- */
1472
- res => { })), catchError((/**
1473
- * @param {?} error
1474
- * @return {?}
1475
- */
1476
- (error) => {
1477
- return of$1(error);
1478
- })));
1479
- }
1480
- /**
1481
- * @return {?}
1482
- */
1483
- selectAllFile() {
1484
- if (!this.fileAllSelected) {
1485
- this.files.forEach((/**
1486
- * @param {?} element
1487
- * @return {?}
1488
- */
1489
- element => {
1490
- element.selectd = true;
1491
- }));
1492
- this.fileAllSelected = true;
1493
- this.selectedFileCount = this.files.length;
1494
- }
1495
- else {
1496
- this.files.forEach((/**
1497
- * @param {?} element
1498
- * @return {?}
1499
- */
1500
- element => {
1501
- element.selectd = false;
1502
- }));
1503
- this.fileAllSelected = false;
1504
- this.selectedFileCount = 0;
1505
- }
1506
- }
1507
- /**
1508
- * @param {?} file
1509
- * @return {?}
1510
- */
1511
- checkoutSelectFile(file) {
1512
- // let obj: any = document.getElementById(fileName);
1513
- file.selectd = !file.selectd;
1514
- if (file.selectd)
1515
- this.selectedFileCount++;
1516
- else
1517
- this.selectedFileCount--;
1518
- if (this.selectedFileCount == this.files.length) {
1519
- this.fileAllSelected = true;
1520
- //this.isFileAllSelected();
1521
- }
1522
- else {
1523
- this.fileAllSelected = false;
1524
- //this.isFileAllSelected();
1525
- }
1526
- }
1527
- /**
1528
- * @param {?} fileInfo
1529
- * @return {?}
1530
- */
1531
- listDeleteFile(fileInfo) {
1532
- if (fileInfo.selectd)
1533
- this.selectedFileCount--;
1534
- //console.log(fileName);
1535
- this.files.splice(this.files.indexOf(fileInfo), 1);
1536
- if (fileInfo.uploadResult) {
1537
- /** @type {?} */
1538
- let idList = [];
1539
- idList.push(fileInfo.id);
1540
- this.uploadService.cancel(idList, this.rootId).subscribe();
1541
- this.uploadFileInfoList.splice(this.uploadFileInfoList.indexOf(this.uploadFileInfoList.filter((/**
1542
- * @param {?} x
1543
- * @return {?}
1544
- */
1545
- x => x.fileName == fileInfo.name))[0]), 1);
1546
- this.uploadedFileInfoList.splice(this.uploadedFileInfoList.indexOf(this.uploadedFileInfoList.filter((/**
1547
- * @param {?} x
1548
- * @return {?}
1549
- */
1550
- x => x.fileName == fileInfo.name))[0]), 1);
1551
- this.uploadedFileTotal--;
1552
- }
1553
- if (this.selectedFileCount == 0)
1554
- this.fileAllSelected = false;
1555
- }
1556
- /**
1557
- * @return {?}
1558
- */
1559
- listMultipleDeleteFile() {
1560
- /** @type {?} */
1561
- let selectedFile = [];
1562
- this.files.forEach((/**
1563
- * @param {?} element
1564
- * @return {?}
1565
- */
1566
- element => {
1567
- /** @type {?} */
1568
- let obj = document.getElementById(element.name);
1569
- if (obj.checked)
1570
- selectedFile.push(element);
1571
- }));
1572
- /** @type {?} */
1573
- let metadataList = [];
1574
- selectedFile.forEach((/**
1575
- * @param {?} element
1576
- * @return {?}
1577
- */
1578
- element => {
1579
- metadataList.push(element.id);
1580
- this.files.splice(this.files.indexOf(element), 1);
1581
- if (element.uploadResult) {
1582
- this.uploadFileInfoList.splice(this.uploadFileInfoList.indexOf(this.uploadFileInfoList.filter((/**
1583
- * @param {?} x
1584
- * @return {?}
1585
- */
1586
- x => x.fileName == element.name))[0]), 1);
1587
- this.uploadedFileInfoList.splice(this.uploadedFileInfoList.indexOf(this.uploadedFileInfoList.filter((/**
1588
- * @param {?} x
1589
- * @return {?}
1590
- */
1591
- x => x.fileName == element.name))[0]), 1);
1592
- this.uploadedFileTotal--;
1593
- }
1594
- }));
1595
- this.uploadService.cancel(metadataList, this.rootId).subscribe();
1596
- /** @type {?} */
1597
- let allBox = document.getElementById("allCheckBox");
1598
- if (allBox != null)
1599
- allBox.checked = false;
1600
- this.selectedFileCount = 0;
1601
- this.fileAllSelected = false;
1602
- }
1603
- /**
1604
- * @param {?} fileName
1605
- * @return {?}
1606
- */
1607
- getPicListDisplayName(fileName) {
1608
- if (fileName.length <= 10)
1609
- return fileName;
1610
- else {
1611
- /** @type {?} */
1612
- let headContent = fileName.substring(0, 2);
1613
- /** @type {?} */
1614
- let tailContent = fileName.substring(fileName.lastIndexOf('.') - 2);
1615
- return headContent + "…" + tailContent;
1616
- }
1617
- }
1618
- /**
1619
- * @param {?} fileName
1620
- * @return {?}
1621
- */
1622
- getQueueDisplayName(fileName) {
1623
- return fileName;
1624
- }
1625
- /**
1626
- * @param {?} selectdFile
1627
- * @param {?} fileInfo
1628
- * @param {?} docType
1629
- * @return {?}
1630
- */
1631
- addDocInfo(selectdFile, fileInfo, docType) {
1632
- switch (docType) {
1633
- case DocType.Word: {
1634
- fileInfo.source = this.createBaseUrl("/platform/runtime/dfs/images/word.png");
1635
- this.files.push(fileInfo);
1636
- break;
1637
- }
1638
- case DocType.Pdf: {
1639
- fileInfo.source = this.createBaseUrl("/platform/runtime/dfs/images/pdf.png");
1640
- this.files.push(fileInfo);
1641
- break;
1642
- }
1643
- case DocType.Excel: {
1644
- fileInfo.source = this.createBaseUrl("/platform/runtime/dfs/images/excel.png");
1645
- this.files.push(fileInfo);
1646
- break;
1647
- }
1648
- case DocType.Txt: {
1649
- fileInfo.source = this.createBaseUrl("/platform/runtime/dfs/images/txt.png");
1650
- this.files.push(fileInfo);
1651
- break;
1652
- }
1653
- case DocType.Powerpoint: {
1654
- fileInfo.source = this.createBaseUrl("/platform/runtime/dfs/images/ppt.png");
1655
- this.files.push(fileInfo);
1656
- break;
1657
- }
1658
- case DocType.Other: {
1659
- fileInfo.source = this.createBaseUrl("/platform/runtime/dfs/images/file.png");
1660
- this.files.push(fileInfo);
1661
- break;
1662
- }
1663
- case DocType.Image: {
1664
- /** @type {?} */
1665
- let reader = new FileReader();
1666
- reader.readAsDataURL(selectdFile);
1667
- reader.onload = (/**
1668
- * @param {?} _event
1669
- * @return {?}
1670
- */
1671
- (_event) => {
1672
- /** @type {?} */
1673
- let imgUrl = reader.result;
1674
- if (this.injector != null) {
1675
- /** @type {?} */
1676
- let sanitizer = this.injector.get(DomSanitizer);
1677
- imgUrl = sanitizer.bypassSecurityTrustResourceUrl(imgUrl);
1678
- }
1679
- fileInfo.source = imgUrl;
1680
- this.files.push(fileInfo);
1681
- //因为异步处理的差异,补偿一次删除
1682
- /** @type {?} */
1683
- let index = -1;
1684
- this.files.forEach((/**
1685
- * @param {?} x
1686
- * @return {?}
1687
- */
1688
- x => {
1689
- if (x.name == fileInfo.name) {
1690
- if (index == -1)
1691
- index = this.files.indexOf(x);
1692
- }
1693
- }));
1694
- if (index != -1 && index != this.files.length - 1) {
1695
- this.files.splice(index, 1);
1696
- this.uploadFileInfoList.splice(index, 1);
1697
- this.uploadedFileInfoList.splice(index, 1);
1698
- }
1699
- });
1700
- }
1701
- }
1702
- }
1703
- /**
1704
- * @param {?} strList
1705
- * @return {?}
1706
- */
1707
- listToString(strList) {
1708
- /** @type {?} */
1709
- const result = strList.filter((/**
1710
- * @param {?} item
1711
- * @return {?}
1712
- */
1713
- item => item.trim() !== ''));
1714
- /** @type {?} */
1715
- let name = "";
1716
- for (let i = 0; i < result.length; i++) {
1717
- name += result[i] + (i === result.length - 1 ? "" : ",");
1718
- }
1719
- return name;
1720
- }
1721
- /**
1722
- * @param {?} $event
1723
- * @param {?} file
1724
- * @return {?}
1725
- */
1726
- securityChange($event, file) {
1727
- file.securityInfo = $event.data;
1728
- /** @type {?} */
1729
- let uploadFile = this.uploadFileInfoList.filter((/**
1730
- * @param {?} x
1731
- * @return {?}
1732
- */
1733
- x => x.metadataId = file.id))[0];
1734
- uploadFile.securityInfo = $event.data;
1735
- }
1736
- /**
1737
- * @param {?} $event
1738
- * @param {?} file
1739
- * @return {?}
1740
- */
1741
- typeChange($event, file) {
1742
- file.extensionName = $event.data.name;
1743
- /** @type {?} */
1744
- let exStorageFileInfo = new ExStorageFileInfo;
1745
- if (file.extensionName == this.storageExtension.defaultPropertyName) {
1746
- if (this.exStorageFileList.filter((/**
1747
- * @param {?} x
1748
- * @return {?}
1749
- */
1750
- x => x.metadataId == file.id)).length > 0)
1751
- this.exStorageFileList.splice(this.exStorageFileList.findIndex((/**
1752
- * @param {?} x
1753
- * @return {?}
1754
- */
1755
- x => x.metadataId == file.id)), 1);
1756
- }
1757
- else {
1758
- if (this.exStorageFileList.filter((/**
1759
- * @param {?} x
1760
- * @return {?}
1761
- */
1762
- x => x.metadataId == file.id)).length > 0) {
1763
- exStorageFileInfo = this.exStorageFileList.filter((/**
1764
- * @param {?} x
1765
- * @return {?}
1766
- */
1767
- x => x.metadataId == file.id))[0];
1768
- exStorageFileInfo.exPropertyName = file.extensionName;
1769
- }
1770
- else {
1771
- exStorageFileInfo.metadataId = file.id;
1772
- exStorageFileInfo.exPropertyName = file.extensionName;
1773
- this.exStorageFileList.push(exStorageFileInfo);
1774
- }
1775
- }
1776
- }
1777
- /**
1778
- * @return {?}
1779
- */
1780
- upload() {
1781
- if (this.uploadedFileTotal != this.files.filter((/**
1782
- * @param {?} x
1783
- * @return {?}
1784
- */
1785
- x => x.isUploading || x.uploadResult)).length) {
1786
- this.msgService.warning(this.localepipe.transform('wait'));
1787
- return of$1(false);
1788
- }
1789
- if (this.haveSecurityInfo) {
1790
- this.uploadService.saveSecurityInfo(this.uploadFileInfoList, this.rootId).subscribe();
1791
- }
1792
- if (this.storageExtension == null)
1793
- return of$1(this.uploadFileInfoList);
1794
- else {
1795
- if (this.exStorageFileList.length == 0)
1796
- return of$1(this.uploadFileInfoList);
1797
- else {
1798
- /** @type {?} */
1799
- const loading = this.loadService.show({
1800
- message: this.localepipe.transform('saveTo') + this.storageExtension.extensionName
1801
- });
1802
- return this.uploadService.changeStorageInstance(this.exStorageFileList, this.rootId).pipe(map((/**
1803
- * @param {?} res
1804
- * @return {?}
1805
- */
1806
- res => {
1807
- // if (res != null)
1808
- // this.msgService.error('保存到' + this.storageExtension.extensionName + "失败,上传文件自动保存到" + this.storageExtension.defaultPropertyName + "存储。" + res.error.Message);
1809
- loading.close();
1810
- return this.uploadFileInfoList;
1811
- })));
1812
- }
1813
- }
1814
- }
1815
- /**
1816
- * @return {?}
1817
- */
1818
- cancel() {
1819
- if (this.uploadFileInfoList.length == 0)
1820
- return;
1821
- this.uploadFileInfoList.forEach((/**
1822
- * @param {?} element
1823
- * @return {?}
1824
- */
1825
- element => {
1826
- this.metadataIdList.push(element.metadataId);
1827
- }));
1828
- this.uploadService.cancel(this.metadataIdList, this.rootId).subscribe();
1829
- }
1830
- /**
1831
- * @return {?}
1832
- */
1833
- getUploadFileInfoList() {
1834
- return this.uploadFileInfoList;
1835
- }
1836
- /**
1837
- * @param {?} file
1838
- * @return {?}
1839
- */
1840
- delete(file) {
1841
- this.files.splice(this.files.indexOf(file), 1);
1842
- if (file.uploadResult)
1843
- this.uploadedFileTotal--;
1844
- if (this.exStorageFileList.filter((/**
1845
- * @param {?} x
1846
- * @return {?}
1847
- */
1848
- x => x.metadataId == file.id)).length > 0) {
1849
- this.exStorageFileList.splice(this.exStorageFileList.findIndex((/**
1850
- * @param {?} x
1851
- * @return {?}
1852
- */
1853
- x => x.metadataId == file.id)), 1);
1854
- }
1855
- }
1856
- /**
1857
- * @param {?} size
1858
- * @return {?}
1859
- */
1860
- getFileSize(size) {
1861
- if (size < 102400)
1862
- return (size / 1024).toFixed(1) + "K";
1863
- else if (size < 1024 * 1024)
1864
- return (size / 1024).toFixed(0) + "K";
1865
- else if (size < 100 * 1024 * 1024)
1866
- return (size / 1024 / 1024).toFixed(1) + "M";
1867
- else if (size < 1024 * 1024 * 1024)
1868
- return (size / 1024 / 1024).toFixed(0) + "M";
1869
- else
1870
- return (size / 1024 / 1024 / 1024).toFixed(1) + "G";
1871
- }
1872
- /**
1873
- * @return {?}
1874
- */
1875
- showByGroup() {
1876
- this.showType = 0;
1877
- // this.selectedFileCount = 0;
1878
- }
1879
- /**
1880
- * @return {?}
1881
- */
1882
- showByList() {
1883
- this.showType = 1;
1884
- // this.selectedFileCount = 0;
1885
- if (this.selectedFileCount != 0 && this.selectedFileCount == this.files.length) {
1886
- this.fileAllSelected = true;
1887
- }
1888
- }
1889
- /**
1890
- * @param {?} file
1891
- * @return {?}
1892
- */
1893
- mouseOver(file) {
1894
- file.mouseOn = true;
1895
- }
1896
- /**
1897
- * @param {?} file
1898
- * @return {?}
1899
- */
1900
- mouseOut(file) {
1901
- file.mouseOn = false;
1902
- }
1903
- /**
1904
- * @param {?} oldUrl
1905
- * @return {?}
1906
- */
1907
- createBaseUrl(oldUrl) {
1908
- /** @type {?} */
1909
- const baseUrl = BasePathService.convertPath(oldUrl);
1910
- return baseUrl;
1911
- }
1912
- }
1913
- FileUploadComponent.decorators = [
1914
- { type: Component, args: [{
1915
- selector: 'app-file-upload',
1916
- 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>",
1917
- 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}"]
1918
- }] }
1919
- ];
1920
- /** @nocollapse */
1921
- FileUploadComponent.ctorParameters = () => [
1922
- { type: MessagerService },
1923
- { type: UploadService },
1924
- { type: LoadingService },
1925
- { type: Injector }
1926
- ];
1927
- FileUploadComponent.propDecorators = {
1928
- formId: [{ type: Input }],
1929
- rootId: [{ type: Input }],
1930
- fileType: [{ type: Input }],
1931
- fileCount: [{ type: Input }],
1932
- oldIdList: [{ type: Input }],
1933
- securityInfo: [{ type: Input }],
1934
- fileNameLength: [{ type: Input }],
1935
- opCell: [{ type: ViewChild, args: ['opCell',] }]
710
+ /**
711
+ * @fileoverview added by tsickle
712
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
713
+ */
714
+ class FileUploadComponent {
715
+ /**
716
+ * @param {?} msgService
717
+ * @param {?} uploadService
718
+ * @param {?} loadService
719
+ * @param {?=} injector
720
+ */
721
+ constructor(msgService, uploadService, loadService, injector) {
722
+ this.msgService = msgService;
723
+ this.uploadService = uploadService;
724
+ this.loadService = loadService;
725
+ this.injector = injector;
726
+ this.files = [];
727
+ this.metadataIdList = [];
728
+ this.uploadFileInfoList = [];
729
+ this.errFileList = [];
730
+ this.errTypeList = [];
731
+ this.nullFileList = [];
732
+ this.beyondFileList = [];
733
+ this.fileNameOversizeList = [];
734
+ this.invalidCharactersFileList = [];
735
+ this.invalidExtNamesFileList = [];
736
+ this.unrecognizedTypeFileList = [];
737
+ this.invalidCharacters = '';
738
+ this.invalidExtNames = '';
739
+ this.showType = 0;
740
+ this.mouseOn = false;
741
+ this.isWhiteList = false;
742
+ this.bufferSize = 5 * 1024 * 1024;
743
+ this.selectedFileCount = 0;
744
+ this.uploadBtnDisabled = false;
745
+ this.uploadIconAddress = this.createBaseUrl('/platform/runtime/dfs/images/upload.svg');
746
+ this.uploadLittleIconAddress = this.createBaseUrl('/platform/runtime/dfs/images/uploadIcon.svg');
747
+ this.hasSelectedFile = false;
748
+ this.fileAllSelected = false;
749
+ this.uploadProcess = { width: '0%' };
750
+ this.fileTotalChunk = {};
751
+ this.requestArray = new Array;
752
+ this.requestBodyArray = new Array;
753
+ this.uploadedChunk = {};
754
+ this.uploadedProcess = {};
755
+ this.defaultPropertyName = "";
756
+ this.propertiesNames = [];
757
+ this.securityInfoList = [];
758
+ this.queueListStyle = { width: '480px' };
759
+ this.dropListValue = "";
760
+ this.uploadedFileTotal = 0;
761
+ this.haveExtensionProperty = false;
762
+ this.haveSecurityInfo = false;
763
+ this.uploadedFileInfoList = [];
764
+ this.oldUploadedFileList = [];
765
+ //uploadedNameList = [];
766
+ this.uploadInfoErrorMessage = "";
767
+ this.sameNameAllowed = true;
768
+ this.maxFileSize = 0;
769
+ this.checkboxPos = { top: '0px' };
770
+ this.fileType = "*";
771
+ this.fileCount = 0;
772
+ this.oldIdList = [];
773
+ this.securityInfo = null;
774
+ this.fileNameLength = 0;
775
+ this.totalLoad = null;
776
+ this.exStorageFileList = [];
777
+ if (this.injector) {
778
+ this.httpclient = this.injector.get(HttpClient);
779
+ this.localeid = localStorage.getItem("languageCode") || this.injector.get(LOCALE_ID);
780
+ this.localepipe = new LocalLangPipe(this.localeid);
781
+ }
782
+ }
783
+ ;
784
+ /**
785
+ * @return {?}
786
+ */
787
+ ngOnInit() {
788
+ if (navigator.userAgent.indexOf('Firefox') >= 0)
789
+ this.checkboxPos.top = '14px';
790
+ //if (this.storageService != null) {
791
+ if (this.securityInfo != null) {
792
+ this.uploadService.getSecurityInfoList(this.securityInfo).subscribe((/**
793
+ * @param {?} res
794
+ * @return {?}
795
+ */
796
+ res => {
797
+ this.haveSecurityInfo = true;
798
+ /** @type {?} */
799
+ let i = 0;
800
+ res.forEach((/**
801
+ * @param {?} element
802
+ * @return {?}
803
+ */
804
+ element => {
805
+ this.securityInfoList.push({ id: i.toString(), securityId: element.securityId, securityLevel: element.securityLevel, name: element.name });
806
+ i++;
807
+ }));
808
+ }));
809
+ }
810
+ this.uploadService.getStorageExtensionInfo().subscribe((/**
811
+ * @param {?} res
812
+ * @return {?}
813
+ */
814
+ res => {
815
+ if (res != null && res.error == null) {
816
+ this.storageExtension = res;
817
+ this.defaultPropertyName = this.storageExtension.defaultPropertyName;
818
+ this.propertiesNames.push({ id: "0", name: this.storageExtension.defaultPropertyName });
819
+ /** @type {?} */
820
+ let i = 0;
821
+ // this.propertiesNames.push(...(this.storageExtension.extensionPropertyNameList));
822
+ this.storageExtension.extensionPropertyNameList.forEach((/**
823
+ * @param {?} element
824
+ * @return {?}
825
+ */
826
+ element => {
827
+ this.propertiesNames.push({ id: (++i).toString(), name: element });
828
+ }));
829
+ this.queueListStyle.width = '380px';
830
+ this.haveExtensionProperty = true;
831
+ }
832
+ }));
833
+ this.uploadService.getUploadInfo(this.rootId).subscribe((/**
834
+ * @param {?} res
835
+ * @return {?}
836
+ */
837
+ res => {
838
+ if (res.error != null) {
839
+ this.uploadInfoErrorMessage = res.error.Message;
840
+ // console.log('获取上传信息报错,错误信息为:',errMsg);
841
+ return;
842
+ }
843
+ else {
844
+ this.uploadBtnDisabled = false;
845
+ this.sameNameAllowed = res.sameNameAllowed;
846
+ this.maxFileSize = parseInt(JSON.parse(res.validateConfiguration).maxFileSize);
847
+ this.isWhiteList = JSON.parse(res.validateConfiguration).whiteList;
848
+ this.invalidCharacters = JSON.parse(res.validateConfiguration).invalidCharacters;
849
+ this.invalidExtNames = JSON.parse(res.validateConfiguration).invalidExtNames.toLowerCase();
850
+ this.allowedMultiUpload = res.allowedMultiUpload;
851
+ if (!this.sameNameAllowed) {
852
+ this.uploadService.getUploadedFileInfoList(this.formId, this.rootId).subscribe((/**
853
+ * @param {?} res
854
+ * @return {?}
855
+ */
856
+ res => {
857
+ if (res != null && res.error == null) {
858
+ this.uploadedFileInfoList = res;
859
+ this.oldUploadedFileList = JSON.parse(JSON.stringify(res));
860
+ }
861
+ }));
862
+ }
863
+ }
864
+ }));
865
+ if (this.oldIdList != null && this.oldIdList.length > 0) ;
866
+ this.radioButtonGroupValue = 'showByGroup';
867
+ }
868
+ /**
869
+ * @return {?}
870
+ */
871
+ showLoading() {
872
+ this.hasSelectedFile = true;
873
+ // if (this.totalLoad == null)
874
+ // this.totalLoad = this.loadService.show({
875
+ // message: this.localepipe.transform('uploading')
876
+ // });
877
+ }
878
+ /**
879
+ * @return {?}
880
+ */
881
+ getRightClass() {
882
+ if (this.uploadBtnDisabled) {
883
+ return 'btn btn-primary btn-lg disabled';
884
+ }
885
+ else {
886
+ return 'btn btn-primary btn-lg';
887
+ }
888
+ }
889
+ /**
890
+ * @param {?} name
891
+ * @return {?}
892
+ */
893
+ findInvalidCharacter(name) {
894
+ /** @type {?} */
895
+ let charList = [];
896
+ this.invalidCharacters.split('|').forEach((/**
897
+ * @param {?} element
898
+ * @return {?}
899
+ */
900
+ element => {
901
+ if (name.indexOf(element) >= 0)
902
+ charList.push(element);
903
+ }));
904
+ return charList;
905
+ }
906
+ /**
907
+ * @param {?} file
908
+ * @return {?}
909
+ */
910
+ hasFileType(file) {
911
+ return file.name.includes('.');
912
+ }
913
+ /**
914
+ * @param {?} $event
915
+ * @return {?}
916
+ */
917
+ fileSelected($event) {
918
+ if (this.uploadInfoErrorMessage) {
919
+ this.msgService.error(this.uploadInfoErrorMessage);
920
+ this.uploadBtnDisabled = true;
921
+ return;
922
+ }
923
+ this.hasSelectedFile = true;
924
+ this.selectedFiles = document.querySelector('#file');
925
+ if (this.fileCount > 0) {
926
+ if (this.selectedFiles.files.length + this.files.length > this.fileCount) {
927
+ /** @type {?} */
928
+ let selectedNum = ((/** @type {?} */ (this.selectedFiles.files.length))) + this.files.length;
929
+ this.msgService.warning(this.localepipe.transform('selectedCount') + selectedNum + this.localepipe.transform('limitCount') + this.fileCount + this.localepipe.transform('rechooseFile'));
930
+ return;
931
+ }
932
+ }
933
+ //this.flag = 0;
934
+ for (let i = 0; i < this.selectedFiles.files.length; i++) {
935
+ /** @type {?} */
936
+ let selectedFile = this.selectedFiles.files[i];
937
+ selectedFile.isAllowedUpload = true;
938
+ //selectedFile.slice
939
+ /** @type {?} */
940
+ let uuid = UUID.UUID();
941
+ if (selectedFile.size == 0) {
942
+ this.nullFileList.push(selectedFile.name);
943
+ continue;
944
+ }
945
+ if (this.fileNameLength > 0 && selectedFile.name.length > this.fileNameLength) {
946
+ this.fileNameOversizeList.push(selectedFile.name);
947
+ continue;
948
+ }
949
+ if (this.maxFileSize != null && this.maxFileSize > 0) {
950
+ if (selectedFile.size > this.maxFileSize * 1000) {
951
+ this.beyondFileList.push(selectedFile.name);
952
+ continue;
953
+ }
954
+ }
955
+ /** @type {?} */
956
+ const invalidCharList = this.findInvalidCharacter(selectedFile.name);
957
+ /** @type {?} */
958
+ let invalidCharListFilter = invalidCharList.filter((/**
959
+ * @param {?} s
960
+ * @return {?}
961
+ */
962
+ (s) => {
963
+ return s && s.trim();
964
+ }));
965
+ /** @type {?} */
966
+ let errorMessage = "";
967
+ if (invalidCharListFilter.length > 0) {
968
+ invalidCharListFilter.forEach((/**
969
+ * @param {?} element
970
+ * @param {?} index
971
+ * @return {?}
972
+ */
973
+ (element, index) => {
974
+ errorMessage += "\"";
975
+ errorMessage += element;
976
+ errorMessage += "\"";
977
+ errorMessage += (index === invalidCharListFilter.length - 1) ? "" : ",";
978
+ }));
979
+ if (this.selectedFiles.files.length === 1) {
980
+ selectedFile.isAllowedUpload = false;
981
+ this.msgService.warning(this.localepipe.transform('invalidCharacters') + errorMessage + this.localepipe.transform('rechooseFile'));
982
+ return;
983
+ }
984
+ if (this.selectedFiles.files.length > 1) {
985
+ selectedFile.isAllowedUpload = false;
986
+ this.invalidCharactersFileList.push(selectedFile.name);
987
+ continue;
988
+ }
989
+ }
990
+ if (!this.hasFileType(selectedFile)) {
991
+ if (this.selectedFiles.files.length === 1) {
992
+ selectedFile.isAllowedUpload = false;
993
+ this.msgService.warning(selectedFile.name + this.localepipe.transform('UnrecognizedFileType') + this.localepipe.transform('rechooseFile'));
994
+ return;
995
+ }
996
+ if (this.selectedFiles.files.length > 1) {
997
+ selectedFile.isAllowedUpload = false;
998
+ this.unrecognizedTypeFileList.push(selectedFile.name);
999
+ continue;
1000
+ }
1001
+ }
1002
+ // let curFileSuffix = selectedFile.name.split('.')[1];
1003
+ /** @type {?} */
1004
+ let curFileSuffix = selectedFile.name.substr(selectedFile.name.lastIndexOf('.') + 1).toLowerCase();
1005
+ /** @type {?} */
1006
+ const extNames = this.listToString(this.invalidExtNames.split('|'));
1007
+ /** @type {?} */
1008
+ const extNamesAry = this.invalidExtNames.split('|');
1009
+ if (!this.isWhiteList && extNamesAry.includes(curFileSuffix)) {
1010
+ if (this.selectedFiles.files.length === 1) {
1011
+ selectedFile.isAllowedUpload = false;
1012
+ this.msgService.warning(selectedFile.name + this.localepipe.transform('invalidExtNames') + this.localepipe.transform('blackExtNames') + extNames + this.localepipe.transform('rechooseFile'));
1013
+ return;
1014
+ }
1015
+ if (this.selectedFiles.files.length > 1) {
1016
+ selectedFile.isAllowedUpload = false;
1017
+ this.invalidExtNamesFileList.push(selectedFile.name);
1018
+ continue;
1019
+ }
1020
+ }
1021
+ if (this.isWhiteList && !extNamesAry.includes(curFileSuffix)) {
1022
+ if (this.selectedFiles.files.length === 1) {
1023
+ selectedFile.isAllowedUpload = false;
1024
+ this.msgService.warning(selectedFile.name + this.localepipe.transform('invalidExtNames') + this.localepipe.transform('whiteExtNames') + extNames + this.localepipe.transform('rechooseFile'));
1025
+ return;
1026
+ }
1027
+ if (this.selectedFiles.files.length > 1) {
1028
+ selectedFile.isAllowedUpload = false;
1029
+ this.invalidExtNamesFileList.push(selectedFile.name);
1030
+ continue;
1031
+ }
1032
+ }
1033
+ if (!this.sameNameAllowed) {
1034
+ if (this.uploadedFileInfoList.find((/**
1035
+ * @param {?} x
1036
+ * @return {?}
1037
+ */
1038
+ x => x.fileName == selectedFile.name)) != null) {
1039
+ /** @type {?} */
1040
+ const msg = this.msgService.show('warning', this.localepipe.transform('haveSameName') + selectedFile.name, {
1041
+ initialState: {
1042
+ buttons: [
1043
+ {
1044
+ text: this.localepipe.transform('rename'),
1045
+ cls: 'btn btn-secondary',
1046
+ handle: (/**
1047
+ * @return {?}
1048
+ */
1049
+ () => {
1050
+ /** @type {?} */
1051
+ let oldName = selectedFile.name;
1052
+ /** @type {?} */
1053
+ let newName;
1054
+ /** @type {?} */
1055
+ let flag = true;
1056
+ /** @type {?} */
1057
+ let i = 1;
1058
+ while (flag) {
1059
+ newName = oldName.substring(0, oldName.lastIndexOf('.')) + '(' + i + ')' + oldName.substring(oldName.lastIndexOf('.'));
1060
+ if (this.uploadedFileInfoList.find((/**
1061
+ * @param {?} x
1062
+ * @return {?}
1063
+ */
1064
+ x => x.fileName == newName)) != null) {
1065
+ i++;
1066
+ }
1067
+ else
1068
+ flag = false;
1069
+ }
1070
+ this.uploadFile(uuid, selectedFile, newName);
1071
+ msg.close();
1072
+ })
1073
+ },
1074
+ {
1075
+ text: this.localepipe.transform('replace'),
1076
+ cls: 'btn btn-secondary',
1077
+ handle: (/**
1078
+ * @return {?}
1079
+ */
1080
+ () => {
1081
+ uuid = this.uploadedFileInfoList.find((/**
1082
+ * @param {?} x
1083
+ * @return {?}
1084
+ */
1085
+ x => x.fileName == selectedFile.name)).metadataId;
1086
+ this.uploadFile(uuid, selectedFile, selectedFile.name, FileState.Update);
1087
+ this.uploadedFileTotal--;
1088
+ if (this.oldUploadedFileList.find((/**
1089
+ * @param {?} x
1090
+ * @return {?}
1091
+ */
1092
+ x => x.fileName == selectedFile.name))) {
1093
+ this.uploadedFileTotal++;
1094
+ this.uploadedFileInfoList.splice(this.uploadedFileInfoList.indexOf(this.uploadedFileInfoList.filter((/**
1095
+ * @param {?} x
1096
+ * @return {?}
1097
+ */
1098
+ x => x.fileName == selectedFile.name))[0]), 1);
1099
+ }
1100
+ msg.close();
1101
+ })
1102
+ },
1103
+ {
1104
+ text: this.localepipe.transform('cancel'),
1105
+ cls: 'btn btn-secondary',
1106
+ handle: (/**
1107
+ * @return {?}
1108
+ */
1109
+ () => {
1110
+ msg.close();
1111
+ })
1112
+ }
1113
+ ]
1114
+ }
1115
+ });
1116
+ continue;
1117
+ }
1118
+ }
1119
+ if (selectedFile.isAllowedUpload === true) {
1120
+ this.uploadFile(uuid, selectedFile, selectedFile.name);
1121
+ }
1122
+ }
1123
+ if (this.errFileList.length > 0) {
1124
+ /** @type {?} */
1125
+ let name = this.listToString(this.errFileList);
1126
+ this.msgService.warning(this.localepipe.transform('haveSameName') + name + this.localepipe.transform('rechooseFile'));
1127
+ this.errFileList = [];
1128
+ }
1129
+ if (this.nullFileList.length > 0) {
1130
+ /** @type {?} */
1131
+ let name = this.listToString(this.nullFileList);
1132
+ this.msgService.warning(name + this.localepipe.transform('sizeZero') + this.localepipe.transform('rechooseFile'));
1133
+ this.nullFileList = [];
1134
+ }
1135
+ if (this.fileNameOversizeList.length > 0) {
1136
+ /** @type {?} */
1137
+ let name = this.listToString(this.fileNameOversizeList);
1138
+ this.msgService.warning(name + this.localepipe.transform('fileNameOverSize') + this.fileNameLength + this.localepipe.transform('rechooseFile'));
1139
+ this.fileNameOversizeList = [];
1140
+ }
1141
+ if (this.beyondFileList.length > 0) {
1142
+ /** @type {?} */
1143
+ let name = this.listToString(this.beyondFileList);
1144
+ this.msgService.warning(name + this.localepipe.transform('sizeMax') + this.maxFileSize + "KB" + this.localepipe.transform('rechooseFile'));
1145
+ this.beyondFileList = [];
1146
+ }
1147
+ if (this.invalidCharactersFileList.length > 0) {
1148
+ /** @type {?} */
1149
+ let name = this.listToString(this.invalidCharactersFileList);
1150
+ this.msgService.warning(name + this.localepipe.transform('invalidCharacters') + this.localepipe.transform('rechooseFile'));
1151
+ this.invalidCharactersFileList = [];
1152
+ }
1153
+ if (this.invalidExtNamesFileList.length > 0) {
1154
+ /** @type {?} */
1155
+ let name = this.listToString(this.invalidExtNamesFileList);
1156
+ this.msgService.warning(name + this.localepipe.transform('invalidExtNames') + this.localepipe.transform('rechooseFile'));
1157
+ this.invalidExtNamesFileList = [];
1158
+ }
1159
+ if (this.unrecognizedTypeFileList.length > 0) {
1160
+ /** @type {?} */
1161
+ let name = this.listToString(this.unrecognizedTypeFileList);
1162
+ this.msgService.warning(name + this.localepipe.transform('UnrecognizedFileType') + this.localepipe.transform('rechooseFile'));
1163
+ this.unrecognizedTypeFileList = [];
1164
+ }
1165
+ this.files = this.files.slice();
1166
+ this.fileAllSelected = false;
1167
+ $event.target.value = '';
1168
+ // loading.close();
1169
+ }
1170
+ /**
1171
+ * @param {?} file
1172
+ * @return {?}
1173
+ */
1174
+ showErrorMessage(file) {
1175
+ this.msgService.error(this.localepipe.transform('uploadFailurej') + file.errorMessage);
1176
+ }
1177
+ /**
1178
+ * @param {?} uuid
1179
+ * @param {?} selectedFile
1180
+ * @param {?} fileName
1181
+ * @return {?}
1182
+ */
1183
+ handleFileInfo(uuid, selectedFile, fileName) {
1184
+ /** @type {?} */
1185
+ let fileInfo;
1186
+ fileInfo = {
1187
+ id: uuid,
1188
+ name: fileName,
1189
+ type: selectedFile.type,
1190
+ source: "",
1191
+ size: this.getFileSize(selectedFile.size),
1192
+ fileSize: selectedFile.size,
1193
+ picListDisplayName: this.getPicListDisplayName(fileName),
1194
+ queueListDisplayName: this.getQueueDisplayName(fileName),
1195
+ //content: reader.result.toString(),
1196
+ hasUploaded: false,
1197
+ mouseOn: false,
1198
+ selectd: false,
1199
+ isUploading: true,
1200
+ uploadResult: false,
1201
+ uploadProcess: 0,
1202
+ errorMessage: "",
1203
+ extensionDropListId: 0,
1204
+ extensionName: "",
1205
+ securityDropListId: 0,
1206
+ securityInfo: this.securityInfoList[0],
1207
+ style: {}
1208
+ };
1209
+ if (this.storageExtension != null)
1210
+ fileInfo.extensionName = this.defaultPropertyName;
1211
+ /** @type {?} */
1212
+ let type = selectedFile.type;
1213
+ if (type.includes("tiff")) {
1214
+ this.addDocInfo(selectedFile, fileInfo, DocType.Other);
1215
+ }
1216
+ else if (type.includes("image")) {
1217
+ this.addDocInfo(selectedFile, fileInfo, DocType.Image);
1218
+ }
1219
+ else if (type.includes("word")) {
1220
+ this.addDocInfo(selectedFile, fileInfo, DocType.Word);
1221
+ }
1222
+ else if (type.includes("pdf")) {
1223
+ this.addDocInfo(selectedFile, fileInfo, DocType.Pdf);
1224
+ }
1225
+ else if (type.includes("plain")) {
1226
+ this.addDocInfo(selectedFile, fileInfo, DocType.Txt);
1227
+ }
1228
+ else if (type.includes("sheet") || type.includes("excel")) {
1229
+ this.addDocInfo(selectedFile, fileInfo, DocType.Excel);
1230
+ }
1231
+ else if (type.includes("powerpoint") || type.includes("presentation")) {
1232
+ this.addDocInfo(selectedFile, fileInfo, DocType.Powerpoint);
1233
+ }
1234
+ else if (type.includes("zip") || selectedFile.name.includes(".rar")) {
1235
+ this.addDocInfo(selectedFile, fileInfo, DocType.Zip);
1236
+ }
1237
+ else {
1238
+ this.addDocInfo(selectedFile, fileInfo, DocType.Other);
1239
+ // let name: string = selectedFile.name;
1240
+ // let errType = name.substring(selectedFile.name.lastIndexOf('.'));
1241
+ // this.errTypeList.push(errType);
1242
+ }
1243
+ return fileInfo;
1244
+ }
1245
+ /**
1246
+ * @param {?} uuid
1247
+ * @param {?} selectedFile
1248
+ * @param {?} fileName
1249
+ * @param {?=} state
1250
+ * @return {?}
1251
+ */
1252
+ uploadFile(uuid, selectedFile, fileName, state = FileState.New) {
1253
+ /** @type {?} */
1254
+ let fileInfo = this.handleFileInfo(uuid, selectedFile, fileName);
1255
+ /** @type {?} */
1256
+ let uploadFileInfo = new UploadFileInfo();
1257
+ uploadFileInfo.metadataId = uuid;
1258
+ uploadFileInfo.fileName = fileInfo.name;
1259
+ uploadFileInfo.fileSize = fileInfo.size;
1260
+ uploadFileInfo.originalSize = fileInfo.fileSize;
1261
+ uploadFileInfo.state = state;
1262
+ uploadFileInfo.securityInfo = this.securityInfoList[0];
1263
+ //判断是否支持分片上传
1264
+ if (this.allowedMultiUpload) {
1265
+ //支持分片上传
1266
+ /** @type {?} */
1267
+ let initRequest = new InitMultiUploadRequest;
1268
+ initRequest.path = this.formId;
1269
+ initRequest.metadataId = uuid;
1270
+ initRequest.rootId = this.rootId;
1271
+ initRequest.size = fileInfo.fileSize;
1272
+ initRequest.fileName = fileName;
1273
+ //初始化分片
1274
+ this.initMultiUpload(initRequest).subscribe((/**
1275
+ * @param {?} res
1276
+ * @return {?}
1277
+ */
1278
+ res => {
1279
+ if (res.error != null) {
1280
+ this.files[this.files.indexOf(fileInfo)].uploadResult = false;
1281
+ this.files[this.files.indexOf(fileInfo)].isUploading = false;
1282
+ this.files[this.files.indexOf(fileInfo)].errorMessage = res.error.Message;
1283
+ }
1284
+ else {
1285
+ /** @type {?} */
1286
+ let uploadId = res.uploadId;
1287
+ /** @type {?} */
1288
+ let chunkTotal = Math.ceil(selectedFile.size / this.bufferSize);
1289
+ /** @type {?} */
1290
+ let chunkIndex = 0;
1291
+ /** @type {?} */
1292
+ let multiResultList = [];
1293
+ this.fileTotalChunk[uuid] = chunkTotal;
1294
+ this.uploadedChunk[uuid] = 0;
1295
+ while (chunkIndex < chunkTotal) {
1296
+ /** @type {?} */
1297
+ let nextSize = Math.min((chunkIndex + 1) * this.bufferSize, selectedFile.size);
1298
+ /** @type {?} */
1299
+ let fileData = selectedFile.slice(chunkIndex * this.bufferSize, nextSize);
1300
+ /** @type {?} */
1301
+ let multiRequest = new MultiUploadRequest;
1302
+ multiRequest.metadataId = uuid;
1303
+ multiRequest.rootId = this.rootId;
1304
+ multiRequest.uploadId = uploadId;
1305
+ multiRequest.index = chunkIndex;
1306
+ multiRequest.total = chunkTotal;
1307
+ multiRequest.size = fileData.size;
1308
+ /** @type {?} */
1309
+ let formData = new FormData();
1310
+ formData.append('multiRequest', JSON.stringify(multiRequest));
1311
+ formData.append('file', fileData);
1312
+ this.multiUpload(formData).subscribe((/**
1313
+ * @param {?} res
1314
+ * @return {?}
1315
+ */
1316
+ res => {
1317
+ if (res.error != null) {
1318
+ this.files[this.files.indexOf(fileInfo)].uploadResult = false;
1319
+ this.files[this.files.indexOf(fileInfo)].isUploading = false;
1320
+ this.files[this.files.indexOf(fileInfo)].errorMessage = res.error.Message;
1321
+ }
1322
+ else {
1323
+ multiResultList.push(res.result);
1324
+ this.uploadedChunk[uuid]++;
1325
+ this.files[this.files.indexOf(fileInfo)].uploadProcess = Number.parseInt((this.uploadedChunk[uuid] / this.fileTotalChunk[uuid] * 100).toFixed(0));
1326
+ if (this.uploadedChunk[uuid] == this.fileTotalChunk[uuid]) {
1327
+ if (multiResultList.length == this.fileTotalChunk[uuid]) {
1328
+ /** @type {?} */
1329
+ let completeMultiUploadRequest = new CompleteMultiUploadRequest;
1330
+ completeMultiUploadRequest.metadataId = uuid;
1331
+ completeMultiUploadRequest.partList = multiResultList;
1332
+ completeMultiUploadRequest.rootId = this.rootId;
1333
+ completeMultiUploadRequest.uploadId = uploadId;
1334
+ completeMultiUploadRequest.size = fileInfo.fileSize;
1335
+ if (this.haveExtensionProperty)
1336
+ completeMultiUploadRequest.exPropertyName = this.defaultPropertyName;
1337
+ this.completeMultiUpload(completeMultiUploadRequest).subscribe((/**
1338
+ * @param {?} res
1339
+ * @return {?}
1340
+ */
1341
+ res => {
1342
+ if (res.status != 200) {
1343
+ this.files[this.files.indexOf(fileInfo)].uploadResult = false;
1344
+ this.files[this.files.indexOf(fileInfo)].isUploading = false;
1345
+ this.files[this.files.indexOf(fileInfo)].errorMessage = res.error.Message;
1346
+ }
1347
+ else {
1348
+ this.files[this.files.indexOf(fileInfo)].uploadResult = true;
1349
+ this.files[this.files.indexOf(fileInfo)].isUploading = false;
1350
+ this.uploadFileInfoList = this.uploadFileInfoList.concat(uploadFileInfo);
1351
+ this.uploadedFileInfoList = this.uploadedFileInfoList.concat(uploadFileInfo);
1352
+ this.uploadedFileTotal++;
1353
+ }
1354
+ }));
1355
+ //后台异步拼接文档
1356
+ }
1357
+ else {
1358
+ this.files[this.files.indexOf(fileInfo)].uploadResult = false;
1359
+ this.files[this.files.indexOf(fileInfo)].isUploading = false;
1360
+ this.files[this.files.indexOf(fileInfo)].errorMessage = this.localepipe.transform('mismatchChunkSize');
1361
+ }
1362
+ }
1363
+ }
1364
+ }));
1365
+ chunkIndex = chunkIndex + 1;
1366
+ }
1367
+ }
1368
+ }));
1369
+ }
1370
+ else {
1371
+ /** @type {?} */
1372
+ let entity = new GspFormStreamEntity;
1373
+ entity.formId = this.formId;
1374
+ entity.metadataId = uuid;
1375
+ entity.mode = OperatingModes.Temp;
1376
+ entity.rootId = this.rootId;
1377
+ entity.size = selectedFile.size;
1378
+ entity.fileName = fileName;
1379
+ if (this.haveExtensionProperty)
1380
+ entity.exPropertyName = this.defaultPropertyName;
1381
+ /** @type {?} */
1382
+ let formData = new FormData();
1383
+ formData.append('uploadEntity', JSON.stringify(entity));
1384
+ formData.append('file', selectedFile);
1385
+ /** @type {?} */
1386
+ let intervalId;
1387
+ this.uploadSingleFile(formData).subscribe((/**
1388
+ * @param {?} res
1389
+ * @return {?}
1390
+ */
1391
+ res => {
1392
+ if (res != null) {
1393
+ this.files[this.files.indexOf(fileInfo)].uploadResult = false;
1394
+ this.files[this.files.indexOf(fileInfo)].isUploading = false;
1395
+ this.files[this.files.indexOf(fileInfo)].errorMessage = res.error.Message;
1396
+ }
1397
+ else {
1398
+ this.files[this.files.indexOf(fileInfo)].uploadResult = true;
1399
+ this.files[this.files.indexOf(fileInfo)].isUploading = false;
1400
+ this.uploadFileInfoList = this.uploadFileInfoList.concat(uploadFileInfo);
1401
+ this.uploadedFileInfoList = this.uploadedFileInfoList.concat(uploadFileInfo);
1402
+ this.uploadedFileTotal++;
1403
+ }
1404
+ clearInterval(intervalId);
1405
+ }));
1406
+ /** @type {?} */
1407
+ let index = -1;
1408
+ this.files.forEach((/**
1409
+ * @param {?} x
1410
+ * @return {?}
1411
+ */
1412
+ x => {
1413
+ if (x.name == fileInfo.name) {
1414
+ if (index == -1)
1415
+ index = this.files.indexOf(x);
1416
+ }
1417
+ }));
1418
+ if (index != -1 && index != this.files.length - 1) {
1419
+ this.files.splice(index, 1);
1420
+ this.uploadFileInfoList.splice(this.uploadFileInfoList.findIndex((/**
1421
+ * @param {?} item
1422
+ * @return {?}
1423
+ */
1424
+ item => item.fileName === fileInfo.name)), 1);
1425
+ this.uploadedFileInfoList.splice(this.uploadedFileInfoList.findIndex((/**
1426
+ * @param {?} item
1427
+ * @return {?}
1428
+ */
1429
+ item => item.fileName === fileInfo.name)), 1);
1430
+ this.uploadedFileTotal--;
1431
+ }
1432
+ intervalId = setInterval((/**
1433
+ * @return {?}
1434
+ */
1435
+ () => {
1436
+ this.getUploadProcess(entity.metadataId).subscribe((/**
1437
+ * @param {?} res
1438
+ * @return {?}
1439
+ */
1440
+ res => {
1441
+ if (res.error != null)
1442
+ this.files[this.files.indexOf(fileInfo)].uploadProcess = 10;
1443
+ else {
1444
+ if (res < 10)
1445
+ res = 10;
1446
+ if (res > 90)
1447
+ res = 90;
1448
+ this.files[this.files.indexOf(fileInfo)].uploadProcess = res;
1449
+ }
1450
+ }));
1451
+ }), 200);
1452
+ }
1453
+ }
1454
+ /**
1455
+ * @param {?} metadataId
1456
+ * @return {?}
1457
+ */
1458
+ getUploadProcess(metadataId) {
1459
+ /** @type {?} */
1460
+ let url = "/api/runtime/dfs/v1.0/formdoc/upload/process?metadataid=" + metadataId;
1461
+ return this.httpclient.get(url).pipe(tap((/**
1462
+ * @param {?} res
1463
+ * @return {?}
1464
+ */
1465
+ res => { })), catchError((/**
1466
+ * @param {?} error
1467
+ * @return {?}
1468
+ */
1469
+ (error) => {
1470
+ return of$1(error);
1471
+ })));
1472
+ }
1473
+ /**
1474
+ * @param {?} formdata
1475
+ * @return {?}
1476
+ */
1477
+ uploadSingleFile(formdata) {
1478
+ /** @type {?} */
1479
+ let url = "/api/runtime/dfs/v1.0/formdoc/single";
1480
+ /** @type {?} */
1481
+ const baseUrl = BasePathService.convertPath(url);
1482
+ return this.httpclient.post(baseUrl, formdata).pipe(tap((/**
1483
+ * @param {?} res
1484
+ * @return {?}
1485
+ */
1486
+ res => { })), catchError((/**
1487
+ * @param {?} error
1488
+ * @return {?}
1489
+ */
1490
+ (error) => {
1491
+ return of$1(error);
1492
+ })));
1493
+ }
1494
+ /**
1495
+ * @param {?} formdata
1496
+ * @return {?}
1497
+ */
1498
+ uploadSliceFile(formdata) {
1499
+ /** @type {?} */
1500
+ let url = "/api/runtime/dfs/v1.0/formdoc/slice";
1501
+ /** @type {?} */
1502
+ const baseUrl = BasePathService.convertPath(url);
1503
+ return this.httpclient.post(baseUrl, formdata).pipe(tap((/**
1504
+ * @param {?} res
1505
+ * @return {?}
1506
+ */
1507
+ res => { })), catchError((/**
1508
+ * @param {?} error
1509
+ * @return {?}
1510
+ */
1511
+ (error) => {
1512
+ return of$1(error);
1513
+ })));
1514
+ }
1515
+ /**
1516
+ * @param {?} request
1517
+ * @return {?}
1518
+ */
1519
+ initMultiUpload(request) {
1520
+ /** @type {?} */
1521
+ let url = "/api/runtime/dfs/v1.0/formdoc/multi/init";
1522
+ /** @type {?} */
1523
+ const baseUrl = BasePathService.convertPath(url);
1524
+ return this.httpclient.post(baseUrl, request).pipe(tap((/**
1525
+ * @param {?} res
1526
+ * @return {?}
1527
+ */
1528
+ res => { })), catchError((/**
1529
+ * @param {?} error
1530
+ * @return {?}
1531
+ */
1532
+ (error) => {
1533
+ return of$1(error);
1534
+ })));
1535
+ }
1536
+ /**
1537
+ * @param {?} formdata
1538
+ * @return {?}
1539
+ */
1540
+ multiUpload(formdata) {
1541
+ /** @type {?} */
1542
+ let url = "/api/runtime/dfs/v1.0/formdoc/multi/upload";
1543
+ /** @type {?} */
1544
+ const baseUrl = BasePathService.convertPath(url);
1545
+ return this.httpclient.post(baseUrl, formdata).pipe(tap((/**
1546
+ * @param {?} res
1547
+ * @return {?}
1548
+ */
1549
+ res => { })), catchError((/**
1550
+ * @param {?} error
1551
+ * @return {?}
1552
+ */
1553
+ (error) => {
1554
+ return of$1(error);
1555
+ })));
1556
+ }
1557
+ /**
1558
+ * @param {?} request
1559
+ * @return {?}
1560
+ */
1561
+ completeMultiUpload(request) {
1562
+ /** @type {?} */
1563
+ let url = "/api/runtime/dfs/v1.0/formdoc/multi/complete";
1564
+ /** @type {?} */
1565
+ const baseUrl = BasePathService.convertPath(url);
1566
+ return this.httpclient.post(baseUrl, request).pipe(tap((/**
1567
+ * @param {?} res
1568
+ * @return {?}
1569
+ */
1570
+ res => { })), catchError((/**
1571
+ * @param {?} error
1572
+ * @return {?}
1573
+ */
1574
+ (error) => {
1575
+ return of$1(error);
1576
+ })));
1577
+ }
1578
+ /**
1579
+ * @return {?}
1580
+ */
1581
+ selectAllFile() {
1582
+ if (!this.fileAllSelected) {
1583
+ this.files.forEach((/**
1584
+ * @param {?} element
1585
+ * @return {?}
1586
+ */
1587
+ element => {
1588
+ element.selectd = true;
1589
+ }));
1590
+ this.fileAllSelected = true;
1591
+ this.selectedFileCount = this.files.length;
1592
+ }
1593
+ else {
1594
+ this.files.forEach((/**
1595
+ * @param {?} element
1596
+ * @return {?}
1597
+ */
1598
+ element => {
1599
+ element.selectd = false;
1600
+ }));
1601
+ this.fileAllSelected = false;
1602
+ this.selectedFileCount = 0;
1603
+ }
1604
+ }
1605
+ /**
1606
+ * @param {?} file
1607
+ * @return {?}
1608
+ */
1609
+ checkoutSelectFile(file) {
1610
+ // let obj: any = document.getElementById(fileName);
1611
+ file.selectd = !file.selectd;
1612
+ if (file.selectd)
1613
+ this.selectedFileCount++;
1614
+ else
1615
+ this.selectedFileCount--;
1616
+ if (this.selectedFileCount == this.files.length) {
1617
+ this.fileAllSelected = true;
1618
+ //this.isFileAllSelected();
1619
+ }
1620
+ else {
1621
+ this.fileAllSelected = false;
1622
+ //this.isFileAllSelected();
1623
+ }
1624
+ }
1625
+ /**
1626
+ * @param {?} fileInfo
1627
+ * @return {?}
1628
+ */
1629
+ listDeleteFile(fileInfo) {
1630
+ if (fileInfo.selectd)
1631
+ this.selectedFileCount--;
1632
+ //console.log(fileName);
1633
+ this.files.splice(this.files.indexOf(fileInfo), 1);
1634
+ if (fileInfo.uploadResult) {
1635
+ /** @type {?} */
1636
+ let idList = [];
1637
+ idList.push(fileInfo.id);
1638
+ this.uploadService.cancel(idList, this.rootId).subscribe();
1639
+ this.uploadFileInfoList.splice(this.uploadFileInfoList.indexOf(this.uploadFileInfoList.filter((/**
1640
+ * @param {?} x
1641
+ * @return {?}
1642
+ */
1643
+ x => x.fileName == fileInfo.name))[0]), 1);
1644
+ this.uploadedFileInfoList.splice(this.uploadedFileInfoList.indexOf(this.uploadedFileInfoList.filter((/**
1645
+ * @param {?} x
1646
+ * @return {?}
1647
+ */
1648
+ x => x.fileName == fileInfo.name))[0]), 1);
1649
+ this.uploadedFileTotal--;
1650
+ }
1651
+ if (this.selectedFileCount == 0)
1652
+ this.fileAllSelected = false;
1653
+ }
1654
+ /**
1655
+ * @return {?}
1656
+ */
1657
+ listMultipleDeleteFile() {
1658
+ /** @type {?} */
1659
+ let selectedFile = [];
1660
+ this.files.forEach((/**
1661
+ * @param {?} element
1662
+ * @return {?}
1663
+ */
1664
+ element => {
1665
+ /** @type {?} */
1666
+ let obj = document.getElementById(element.name);
1667
+ if (obj.checked)
1668
+ selectedFile.push(element);
1669
+ }));
1670
+ /** @type {?} */
1671
+ let metadataList = [];
1672
+ selectedFile.forEach((/**
1673
+ * @param {?} element
1674
+ * @return {?}
1675
+ */
1676
+ element => {
1677
+ metadataList.push(element.id);
1678
+ this.files.splice(this.files.indexOf(element), 1);
1679
+ if (element.uploadResult) {
1680
+ this.uploadFileInfoList.splice(this.uploadFileInfoList.indexOf(this.uploadFileInfoList.filter((/**
1681
+ * @param {?} x
1682
+ * @return {?}
1683
+ */
1684
+ x => x.fileName == element.name))[0]), 1);
1685
+ this.uploadedFileInfoList.splice(this.uploadedFileInfoList.indexOf(this.uploadedFileInfoList.filter((/**
1686
+ * @param {?} x
1687
+ * @return {?}
1688
+ */
1689
+ x => x.fileName == element.name))[0]), 1);
1690
+ this.uploadedFileTotal--;
1691
+ }
1692
+ }));
1693
+ this.uploadService.cancel(metadataList, this.rootId).subscribe();
1694
+ /** @type {?} */
1695
+ let allBox = document.getElementById("allCheckBox");
1696
+ if (allBox != null)
1697
+ allBox.checked = false;
1698
+ this.selectedFileCount = 0;
1699
+ this.fileAllSelected = false;
1700
+ }
1701
+ /**
1702
+ * @param {?} fileName
1703
+ * @return {?}
1704
+ */
1705
+ getPicListDisplayName(fileName) {
1706
+ if (fileName.length <= 10)
1707
+ return fileName;
1708
+ else {
1709
+ /** @type {?} */
1710
+ let headContent = fileName.substring(0, 2);
1711
+ /** @type {?} */
1712
+ let tailContent = fileName.substring(fileName.lastIndexOf('.') - 2);
1713
+ return headContent + "…" + tailContent;
1714
+ }
1715
+ }
1716
+ /**
1717
+ * @param {?} fileName
1718
+ * @return {?}
1719
+ */
1720
+ getQueueDisplayName(fileName) {
1721
+ return fileName;
1722
+ }
1723
+ /**
1724
+ * @param {?} selectdFile
1725
+ * @param {?} fileInfo
1726
+ * @param {?} docType
1727
+ * @return {?}
1728
+ */
1729
+ addDocInfo(selectdFile, fileInfo, docType) {
1730
+ switch (docType) {
1731
+ case DocType.Word: {
1732
+ fileInfo.source = this.createBaseUrl("/platform/runtime/dfs/images/word.png");
1733
+ this.files.push(fileInfo);
1734
+ break;
1735
+ }
1736
+ case DocType.Pdf: {
1737
+ fileInfo.source = this.createBaseUrl("/platform/runtime/dfs/images/pdf.png");
1738
+ this.files.push(fileInfo);
1739
+ break;
1740
+ }
1741
+ case DocType.Excel: {
1742
+ fileInfo.source = this.createBaseUrl("/platform/runtime/dfs/images/excel.png");
1743
+ this.files.push(fileInfo);
1744
+ break;
1745
+ }
1746
+ case DocType.Txt: {
1747
+ fileInfo.source = this.createBaseUrl("/platform/runtime/dfs/images/txt.png");
1748
+ this.files.push(fileInfo);
1749
+ break;
1750
+ }
1751
+ case DocType.Zip: {
1752
+ fileInfo.source = this.createBaseUrl("/platform/runtime/dfs/images/zip.png");
1753
+ this.files.push(fileInfo);
1754
+ break;
1755
+ }
1756
+ case DocType.Powerpoint: {
1757
+ fileInfo.source = this.createBaseUrl("/platform/runtime/dfs/images/ppt.png");
1758
+ this.files.push(fileInfo);
1759
+ break;
1760
+ }
1761
+ case DocType.Other: {
1762
+ fileInfo.source = this.createBaseUrl("/platform/runtime/dfs/images/file.png");
1763
+ this.files.push(fileInfo);
1764
+ break;
1765
+ }
1766
+ case DocType.Image: {
1767
+ /** @type {?} */
1768
+ let reader = new FileReader();
1769
+ reader.readAsDataURL(selectdFile);
1770
+ reader.onload = (/**
1771
+ * @param {?} _event
1772
+ * @return {?}
1773
+ */
1774
+ (_event) => {
1775
+ /** @type {?} */
1776
+ let imgUrl = reader.result;
1777
+ if (this.injector != null) {
1778
+ /** @type {?} */
1779
+ let sanitizer = this.injector.get(DomSanitizer);
1780
+ imgUrl = sanitizer.bypassSecurityTrustResourceUrl(imgUrl);
1781
+ }
1782
+ fileInfo.source = imgUrl;
1783
+ fileInfo.style = { "max-width": "120px", "max-height": "118px" };
1784
+ this.files.push(fileInfo);
1785
+ //因为异步处理的差异,补偿一次删除
1786
+ /** @type {?} */
1787
+ let index = -1;
1788
+ this.files.forEach((/**
1789
+ * @param {?} x
1790
+ * @return {?}
1791
+ */
1792
+ x => {
1793
+ if (x.name == fileInfo.name) {
1794
+ if (index == -1)
1795
+ index = this.files.indexOf(x);
1796
+ }
1797
+ }));
1798
+ if (index != -1 && index != this.files.length - 1) {
1799
+ this.files.splice(index, 1);
1800
+ this.uploadFileInfoList.splice(this.uploadFileInfoList.findIndex((/**
1801
+ * @param {?} item
1802
+ * @return {?}
1803
+ */
1804
+ item => item.fileName === fileInfo.name)), 1);
1805
+ this.uploadedFileInfoList.splice(this.uploadedFileInfoList.findIndex((/**
1806
+ * @param {?} item
1807
+ * @return {?}
1808
+ */
1809
+ item => item.fileName === fileInfo.name)), 1);
1810
+ this.uploadedFileTotal--;
1811
+ }
1812
+ });
1813
+ }
1814
+ }
1815
+ }
1816
+ /**
1817
+ * @param {?} strList
1818
+ * @return {?}
1819
+ */
1820
+ listToString(strList) {
1821
+ /** @type {?} */
1822
+ const result = strList.filter((/**
1823
+ * @param {?} item
1824
+ * @return {?}
1825
+ */
1826
+ item => item.trim() !== ''));
1827
+ /** @type {?} */
1828
+ let name = "";
1829
+ for (let i = 0; i < result.length; i++) {
1830
+ name += result[i] + (i === result.length - 1 ? "" : ",");
1831
+ }
1832
+ return name;
1833
+ }
1834
+ /**
1835
+ * @param {?} $event
1836
+ * @param {?} file
1837
+ * @return {?}
1838
+ */
1839
+ securityChange($event, file) {
1840
+ file.securityInfo = $event.selections[0];
1841
+ /** @type {?} */
1842
+ let uploadFile = this.uploadFileInfoList.filter((/**
1843
+ * @param {?} x
1844
+ * @return {?}
1845
+ */
1846
+ x => x.metadataId === file.id))[0];
1847
+ uploadFile.securityInfo = $event.selections[0];
1848
+ }
1849
+ /**
1850
+ * @param {?} $event
1851
+ * @param {?} file
1852
+ * @return {?}
1853
+ */
1854
+ typeChange($event, file) {
1855
+ file.extensionName = $event.selections[0].name;
1856
+ /** @type {?} */
1857
+ let exStorageFileInfo = new ExStorageFileInfo;
1858
+ if (file.extensionName == this.storageExtension.defaultPropertyName) {
1859
+ if (this.exStorageFileList.filter((/**
1860
+ * @param {?} x
1861
+ * @return {?}
1862
+ */
1863
+ x => x.metadataId == file.id)).length > 0)
1864
+ this.exStorageFileList.splice(this.exStorageFileList.findIndex((/**
1865
+ * @param {?} x
1866
+ * @return {?}
1867
+ */
1868
+ x => x.metadataId == file.id)), 1);
1869
+ }
1870
+ else {
1871
+ if (this.exStorageFileList.filter((/**
1872
+ * @param {?} x
1873
+ * @return {?}
1874
+ */
1875
+ x => x.metadataId == file.id)).length > 0) {
1876
+ exStorageFileInfo = this.exStorageFileList.filter((/**
1877
+ * @param {?} x
1878
+ * @return {?}
1879
+ */
1880
+ x => x.metadataId == file.id))[0];
1881
+ exStorageFileInfo.exPropertyName = file.extensionName;
1882
+ }
1883
+ else {
1884
+ exStorageFileInfo.metadataId = file.id;
1885
+ exStorageFileInfo.exPropertyName = file.extensionName;
1886
+ this.exStorageFileList.push(exStorageFileInfo);
1887
+ }
1888
+ }
1889
+ }
1890
+ /**
1891
+ * @return {?}
1892
+ */
1893
+ upload() {
1894
+ if (this.uploadFileInfoList.length != this.files.filter((/**
1895
+ * @param {?} x
1896
+ * @return {?}
1897
+ */
1898
+ x => x.isUploading || x.uploadResult)).length) {
1899
+ this.msgService.warning(this.localepipe.transform('wait'));
1900
+ return of$1(false);
1901
+ }
1902
+ if (this.haveSecurityInfo) {
1903
+ this.uploadService.saveSecurityInfo(this.uploadFileInfoList, this.rootId).subscribe();
1904
+ }
1905
+ if (this.storageExtension == null)
1906
+ return of$1(this.uploadFileInfoList);
1907
+ else {
1908
+ if (this.exStorageFileList.length == 0)
1909
+ return of$1(this.uploadFileInfoList);
1910
+ else {
1911
+ /** @type {?} */
1912
+ const loading = this.loadService.show({
1913
+ message: this.localepipe.transform('saveTo') + this.storageExtension.extensionName
1914
+ });
1915
+ return this.uploadService.changeStorageInstance(this.exStorageFileList, this.rootId).pipe(map((/**
1916
+ * @param {?} res
1917
+ * @return {?}
1918
+ */
1919
+ res => {
1920
+ // if (res != null)
1921
+ // this.msgService.error('保存到' + this.storageExtension.extensionName + "失败,上传文件自动保存到" + this.storageExtension.defaultPropertyName + "存储。" + res.error.Message);
1922
+ loading.close();
1923
+ return this.uploadFileInfoList;
1924
+ })));
1925
+ }
1926
+ }
1927
+ }
1928
+ /**
1929
+ * @return {?}
1930
+ */
1931
+ cancel() {
1932
+ if (this.uploadFileInfoList.length == 0)
1933
+ return;
1934
+ this.uploadFileInfoList.forEach((/**
1935
+ * @param {?} element
1936
+ * @return {?}
1937
+ */
1938
+ element => {
1939
+ this.metadataIdList.push(element.metadataId);
1940
+ }));
1941
+ this.uploadService.cancel(this.metadataIdList, this.rootId).subscribe();
1942
+ }
1943
+ /**
1944
+ * @return {?}
1945
+ */
1946
+ getUploadFileInfoList() {
1947
+ return this.uploadFileInfoList;
1948
+ }
1949
+ /**
1950
+ * @param {?} file
1951
+ * @return {?}
1952
+ */
1953
+ delete(file) {
1954
+ this.files.splice(this.files.indexOf(file), 1);
1955
+ if (file.uploadResult)
1956
+ this.uploadedFileTotal--;
1957
+ if (this.exStorageFileList.filter((/**
1958
+ * @param {?} x
1959
+ * @return {?}
1960
+ */
1961
+ x => x.metadataId == file.id)).length > 0) {
1962
+ this.exStorageFileList.splice(this.exStorageFileList.findIndex((/**
1963
+ * @param {?} x
1964
+ * @return {?}
1965
+ */
1966
+ x => x.metadataId == file.id)), 1);
1967
+ }
1968
+ }
1969
+ /**
1970
+ * @param {?} size
1971
+ * @return {?}
1972
+ */
1973
+ getFileSize(size) {
1974
+ if (size < 102400)
1975
+ return (size / 1024).toFixed(1) + "K";
1976
+ else if (size < 1024 * 1024)
1977
+ return (size / 1024).toFixed(0) + "K";
1978
+ else if (size < 100 * 1024 * 1024)
1979
+ return (size / 1024 / 1024).toFixed(1) + "M";
1980
+ else if (size < 1024 * 1024 * 1024)
1981
+ return (size / 1024 / 1024).toFixed(0) + "M";
1982
+ else
1983
+ return (size / 1024 / 1024 / 1024).toFixed(1) + "G";
1984
+ }
1985
+ /**
1986
+ * @return {?}
1987
+ */
1988
+ showByGroup() {
1989
+ this.showType = 0;
1990
+ // this.selectedFileCount = 0;
1991
+ }
1992
+ /**
1993
+ * @return {?}
1994
+ */
1995
+ showByList() {
1996
+ this.showType = 1;
1997
+ // this.selectedFileCount = 0;
1998
+ if (this.selectedFileCount != 0 && this.selectedFileCount == this.files.length) {
1999
+ this.fileAllSelected = true;
2000
+ }
2001
+ }
2002
+ /**
2003
+ * @param {?} file
2004
+ * @return {?}
2005
+ */
2006
+ mouseOver(file) {
2007
+ file.mouseOn = true;
2008
+ }
2009
+ /**
2010
+ * @param {?} file
2011
+ * @return {?}
2012
+ */
2013
+ mouseOut(file) {
2014
+ file.mouseOn = false;
2015
+ }
2016
+ /**
2017
+ * @param {?} oldUrl
2018
+ * @return {?}
2019
+ */
2020
+ createBaseUrl(oldUrl) {
2021
+ /** @type {?} */
2022
+ const baseUrl = BasePathService.convertPath(oldUrl);
2023
+ return baseUrl;
2024
+ }
2025
+ }
2026
+ FileUploadComponent.decorators = [
2027
+ { type: Component, args: [{
2028
+ selector: 'app-file-upload',
2029
+ 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\" [disabled]=\"uploadBtnDisabled\">\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 <span class=\"help_text\" *ngIf=\"files.length >0\">{{'fileCount' | locale}} {{files.length}}</span>\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\" class=\"loading_box\">\n <div><farris-progress [type]=\"'circle'\" [percent]=\"file.uploadProcess\" [strokeLinecap]=\"'square'\"\n [status]=\"'active'\"></farris-progress>\n </div>\n <div style=\"width: 120px; vertical-align: middle; text-align: center\" [title]=\"file.name\">\n {{ file.picListDisplayName }}\n </div>\n </div>\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' [ngStyle]=\"file.style\">\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'\" (valueChange)=\"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'\" (valueChange)=\"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=\"display:flex;\">\n <div style=\"vertical-align: middle;padding-left:45px\" [ngStyle]=\"queueListStyle\">{{ file.queueListDisplayName }}</div>\n <div style=\"width:40%\"><farris-progress [percent]=\"file.uploadProcess\" [status]=\"'active'\"></farris-progress></div>\n </div>\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'\" (valueChange)=\"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'\" (valueChange)=\"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]=\"getRightClass()\">{{'uploadFile' | locale}} </span>\n <input type=\"file\" style=\"height: 32px;\" (change)=\"fileSelected($event)\" id=\"file\" multiple=\"multiple\" title=\"\" [accept]=\"fileType\" [disabled]=\"uploadBtnDisabled\">\n <!-- <input type=\"file\" (focus)=\"showLoading()\" (change)=\"fileSelected($event)\" id=\"file\" multiple=\"multiple\" title=\"\" [accept]=\"fileType\"> -->\n </div>\n</div>\n",
2030
+ 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:400px;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 .loading_box{display:flex;flex-direction:column}.pic_list ul li div img{max-width:60px;max-height:60px;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}input#file:disabled{cursor:not-allowed}.help_text{color:rgba(0,0,0,.35);position:absolute;top:16px;right:120px}"]
2031
+ }] }
2032
+ ];
2033
+ /** @nocollapse */
2034
+ FileUploadComponent.ctorParameters = () => [
2035
+ { type: MessagerService },
2036
+ { type: UploadService },
2037
+ { type: LoadingService },
2038
+ { type: Injector }
2039
+ ];
2040
+ FileUploadComponent.propDecorators = {
2041
+ formId: [{ type: Input }],
2042
+ rootId: [{ type: Input }],
2043
+ fileType: [{ type: Input }],
2044
+ fileCount: [{ type: Input }],
2045
+ oldIdList: [{ type: Input }],
2046
+ securityInfo: [{ type: Input }],
2047
+ fileNameLength: [{ type: Input }],
2048
+ opCell: [{ type: ViewChild, args: ['opCell',] }]
1936
2049
  };
1937
2050
 
1938
- /**
1939
- * @fileoverview added by tsickle
1940
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1941
- */
1942
- class DownloadService {
1943
- constructor() { }
1944
- /**
1945
- * @param {?} metadataId
1946
- * @param {?} rootId
1947
- * @return {?}
1948
- */
1949
- getDownloadUrl(metadataId, rootId) {
1950
- /** @type {?} */
1951
- const url = "/api/runtime/dfs/v1.0/doc/filecontent?metadataid=" + metadataId + "&rootid=" + rootId + "&token=" + this.getToken(this.mergeString(metadataId, rootId));
1952
- /** @type {?} */
1953
- const baseUrl = BasePathService.convertPath(url);
1954
- return baseUrl;
1955
- }
1956
- /**
1957
- * @param {?} metadataId
1958
- * @param {?} rootId
1959
- * @return {?}
1960
- */
1961
- getStreamDownloadUrl(metadataId, rootId) {
1962
- /** @type {?} */
1963
- const url = "/api/runtime/dfs/v1.0/formdoc/stream?metadataid=" + metadataId + "&rootid=" + rootId + "&token=" + this.getToken(this.mergeString(metadataId, rootId));
1964
- /** @type {?} */
1965
- const baseUrl = BasePathService.convertPath(url);
1966
- return baseUrl;
1967
- }
1968
- /**
1969
- * @param {?} metadataIdList
1970
- * @param {?} rootId
1971
- * @return {?}
1972
- */
1973
- getMultipleDownloadUrl(metadataIdList, rootId) {
1974
- /** @type {?} */
1975
- let list = JSON.parse(metadataIdList);
1976
- /** @type {?} */
1977
- const url = "/api/runtime/dfs/v1.0/doc/multiple/download?metadataidlist=" + metadataIdList + "&rootid=" + rootId + "&token=" + this.getToken(this.mergeString(list[0], rootId));
1978
- /** @type {?} */
1979
- const baseUrl = BasePathService.convertPath(url);
1980
- return baseUrl;
1981
- }
1982
- /**
1983
- * @param {?} metadataIdList
1984
- * @param {?} rootId
1985
- * @param {?} zipName
1986
- * @return {?}
1987
- */
1988
- getMultipleDownloadUrlWithName(metadataIdList, rootId, zipName) {
1989
- /** @type {?} */
1990
- let list = JSON.parse(metadataIdList);
1991
- if (zipName == null || zipName == "")
1992
- zipName = 'unifile.zip';
1993
- if (!zipName.endsWith(".zip"))
1994
- zipName += '.zip';
1995
- /** @type {?} */
1996
- const url = "/api/runtime/dfs/v1.0/doc/compress/download?metadataidlist=" + metadataIdList + "&rootid=" + rootId + "&token=" + this.getToken(this.mergeString(list[0], rootId)) + "&zipName=" + encodeURIComponent(zipName);
1997
- /** @type {?} */
1998
- const baseUrl = BasePathService.convertPath(url);
1999
- return baseUrl;
2000
- }
2001
- /**
2002
- * @param {?} metadataId
2003
- * @param {?} rootId
2004
- * @param {?} version
2005
- * @return {?}
2006
- */
2007
- getHistoryDownloadUrl(metadataId, rootId, version) {
2008
- //let list:string[]=JSON.parse(metadataIdList);
2009
- /** @type {?} */
2010
- const url = "/api/runtime/dfs/v1.0/doc/historycontent?metadataid=" + metadataId + "&rootid=" + rootId + "&version=" + version + "&token=" + this.getToken(this.mergeString(metadataId, rootId));
2011
- /** @type {?} */
2012
- const baseUrl = BasePathService.convertPath(url);
2013
- return baseUrl;
2014
- }
2015
- /**
2016
- * @private
2017
- * @param {?} str
2018
- * @param {?} str1
2019
- * @return {?}
2020
- */
2021
- mergeString(str, str1) {
2022
- /** @type {?} */
2023
- let min = str.length < str1.length ? str.length : str1.length;
2024
- /** @type {?} */
2025
- let res = "";
2026
- /** @type {?} */
2027
- let i = 0;
2028
- for (i = 0; i < min; i++) {
2029
- res += str.substring(i, i + 1);
2030
- res += str1.substring(i, i + 1);
2031
- }
2032
- res += str.length < str1.length ? str1.substring(i) : str.substring(i);
2033
- return res;
2034
- }
2035
- /**
2036
- * @private
2037
- * @param {?} str
2038
- * @return {?}
2039
- */
2040
- getToken(str) {
2041
- /** @type {?} */
2042
- let array = [1, 2, 3];
2043
- if (str.length > 24)
2044
- str = str.substring(0, 24);
2045
- /** @type {?} */
2046
- let length = Math.floor(str.length / 3);
2047
- /** @type {?} */
2048
- let str1 = str.substring(0, length);
2049
- /** @type {?} */
2050
- let str2 = str.substring(length, 2 * length);
2051
- /** @type {?} */
2052
- let str3 = str.substring(2 * length, 3 * length);
2053
- /** @type {?} */
2054
- let randomArray = [];
2055
- /** @type {?} */
2056
- var random = Math.ceil(Math.random() * 3);
2057
- randomArray.push(array[random - 1]);
2058
- array.splice(random - 1, 1);
2059
- random = Math.ceil(Math.random() * 2);
2060
- randomArray.push(array[random - 1]);
2061
- array.splice(random - 1, 1);
2062
- randomArray.push(array[0]);
2063
- /** @type {?} */
2064
- let timeStamp = Math.round(new Date().getTime() / 1000) + "";
2065
- return timeStamp.substring(0, 5) + "times" + randomArray[0] + "" + randomArray[1] + "" + randomArray[2] + this.switchStr(str1, str2, str3, randomArray[0]) + this.switchStr(str1, str2, str3, randomArray[1]) + this.switchStr(str1, str2, str3, randomArray[2]) + "times" + timeStamp.substring(5);
2066
- }
2067
- /**
2068
- * @private
2069
- * @param {?} str1
2070
- * @param {?} str2
2071
- * @param {?} str3
2072
- * @param {?} i
2073
- * @return {?}
2074
- */
2075
- switchStr(str1, str2, str3, i) {
2076
- switch (i) {
2077
- case 1: return str1;
2078
- case 2: return str2;
2079
- case 3: return str3;
2080
- }
2081
- }
2082
- }
2083
- DownloadService.decorators = [
2084
- { type: Injectable }
2085
- ];
2086
- /** @nocollapse */
2051
+ /**
2052
+ * @fileoverview added by tsickle
2053
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2054
+ */
2055
+ class DownloadService {
2056
+ constructor() { }
2057
+ /**
2058
+ * @param {?} metadataId
2059
+ * @param {?} rootId
2060
+ * @return {?}
2061
+ */
2062
+ getDownloadUrl(metadataId, rootId) {
2063
+ /** @type {?} */
2064
+ const url = "/api/runtime/dfs/v1.0/doc/filecontent?metadataid=" + metadataId + "&rootid=" + rootId + "&token=" + this.getToken(this.mergeString(metadataId, rootId));
2065
+ /** @type {?} */
2066
+ const baseUrl = BasePathService.convertPath(url);
2067
+ return baseUrl;
2068
+ }
2069
+ /**
2070
+ * @param {?} metadataId
2071
+ * @param {?} rootId
2072
+ * @return {?}
2073
+ */
2074
+ getStreamDownloadUrl(metadataId, rootId) {
2075
+ /** @type {?} */
2076
+ const url = "/api/runtime/dfs/v1.0/formdoc/stream?metadataid=" + metadataId + "&rootid=" + rootId + "&token=" + this.getToken(this.mergeString(metadataId, rootId));
2077
+ /** @type {?} */
2078
+ const baseUrl = BasePathService.convertPath(url);
2079
+ return baseUrl;
2080
+ }
2081
+ /**
2082
+ * @param {?} metadataIdList
2083
+ * @param {?} rootId
2084
+ * @return {?}
2085
+ */
2086
+ getMultipleDownloadUrl(metadataIdList, rootId) {
2087
+ /** @type {?} */
2088
+ let list = JSON.parse(metadataIdList);
2089
+ /** @type {?} */
2090
+ const url = "/api/runtime/dfs/v1.0/doc/multiple/download?metadataidlist=" + metadataIdList + "&rootid=" + rootId + "&token=" + this.getToken(this.mergeString(list[0], rootId));
2091
+ /** @type {?} */
2092
+ const baseUrl = BasePathService.convertPath(url);
2093
+ return baseUrl;
2094
+ }
2095
+ /**
2096
+ * @param {?} metadataIdList
2097
+ * @param {?} rootId
2098
+ * @param {?} zipName
2099
+ * @return {?}
2100
+ */
2101
+ getMultipleDownloadUrlWithName(metadataIdList, rootId, zipName) {
2102
+ /** @type {?} */
2103
+ let list = JSON.parse(metadataIdList);
2104
+ if (zipName == null || zipName == "")
2105
+ zipName = 'unifile.zip';
2106
+ if (!zipName.endsWith(".zip"))
2107
+ zipName += '.zip';
2108
+ /** @type {?} */
2109
+ const url = "/api/runtime/dfs/v1.0/doc/compress/download?metadataidlist=" + metadataIdList + "&rootid=" + rootId + "&token=" + this.getToken(this.mergeString(list[0], rootId)) + "&zipName=" + encodeURIComponent(zipName);
2110
+ /** @type {?} */
2111
+ const baseUrl = BasePathService.convertPath(url);
2112
+ return baseUrl;
2113
+ }
2114
+ /**
2115
+ * @param {?} metadataId
2116
+ * @param {?} rootId
2117
+ * @param {?} version
2118
+ * @return {?}
2119
+ */
2120
+ getHistoryDownloadUrl(metadataId, rootId, version) {
2121
+ //let list:string[]=JSON.parse(metadataIdList);
2122
+ /** @type {?} */
2123
+ const url = "/api/runtime/dfs/v1.0/doc/historycontent?metadataid=" + metadataId + "&rootid=" + rootId + "&version=" + version + "&token=" + this.getToken(this.mergeString(metadataId, rootId));
2124
+ /** @type {?} */
2125
+ const baseUrl = BasePathService.convertPath(url);
2126
+ return baseUrl;
2127
+ }
2128
+ /**
2129
+ * @private
2130
+ * @param {?} str
2131
+ * @param {?} str1
2132
+ * @return {?}
2133
+ */
2134
+ mergeString(str, str1) {
2135
+ /** @type {?} */
2136
+ let min = str.length < str1.length ? str.length : str1.length;
2137
+ /** @type {?} */
2138
+ let res = "";
2139
+ /** @type {?} */
2140
+ let i = 0;
2141
+ for (i = 0; i < min; i++) {
2142
+ res += str.substring(i, i + 1);
2143
+ res += str1.substring(i, i + 1);
2144
+ }
2145
+ res += str.length < str1.length ? str1.substring(i) : str.substring(i);
2146
+ return res;
2147
+ }
2148
+ /**
2149
+ * @private
2150
+ * @param {?} str
2151
+ * @return {?}
2152
+ */
2153
+ getToken(str) {
2154
+ /** @type {?} */
2155
+ let array = [1, 2, 3];
2156
+ if (str.length > 24)
2157
+ str = str.substring(0, 24);
2158
+ /** @type {?} */
2159
+ let length = Math.floor(str.length / 3);
2160
+ /** @type {?} */
2161
+ let str1 = str.substring(0, length);
2162
+ /** @type {?} */
2163
+ let str2 = str.substring(length, 2 * length);
2164
+ /** @type {?} */
2165
+ let str3 = str.substring(2 * length, 3 * length);
2166
+ /** @type {?} */
2167
+ let randomArray = [];
2168
+ /** @type {?} */
2169
+ var random = Math.ceil(Math.random() * 3);
2170
+ randomArray.push(array[random - 1]);
2171
+ array.splice(random - 1, 1);
2172
+ random = Math.ceil(Math.random() * 2);
2173
+ randomArray.push(array[random - 1]);
2174
+ array.splice(random - 1, 1);
2175
+ randomArray.push(array[0]);
2176
+ /** @type {?} */
2177
+ let timeStamp = Math.round(new Date().getTime() / 1000) + "";
2178
+ return timeStamp.substring(0, 5) + "times" + randomArray[0] + "" + randomArray[1] + "" + randomArray[2] + this.switchStr(str1, str2, str3, randomArray[0]) + this.switchStr(str1, str2, str3, randomArray[1]) + this.switchStr(str1, str2, str3, randomArray[2]) + "times" + timeStamp.substring(5);
2179
+ }
2180
+ /**
2181
+ * @private
2182
+ * @param {?} str1
2183
+ * @param {?} str2
2184
+ * @param {?} str3
2185
+ * @param {?} i
2186
+ * @return {?}
2187
+ */
2188
+ switchStr(str1, str2, str3, i) {
2189
+ switch (i) {
2190
+ case 1: return str1;
2191
+ case 2: return str2;
2192
+ case 3: return str3;
2193
+ }
2194
+ }
2195
+ }
2196
+ DownloadService.decorators = [
2197
+ { type: Injectable }
2198
+ ];
2199
+ /** @nocollapse */
2087
2200
  DownloadService.ctorParameters = () => [];
2088
2201
 
2089
- /**
2090
- * @fileoverview added by tsickle
2091
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2092
- */
2093
- const ɵ0$1 = localStorage.getItem('languageCode') || 'zh-CHS';
2094
- class UploadModule {
2095
- }
2096
- UploadModule.decorators = [
2097
- { type: NgModule, args: [{
2098
- declarations: [FileUploadComponent, LocalLangPipe],
2099
- imports: [
2100
- CommonModule,
2101
- FarrisRTFModule,
2102
- NotifyModule,
2103
- MessagerModule.forRoot(),
2104
- LoadingModule.forRoot(),
2105
- ProgressModule,
2106
- FormsModule,
2107
- FarrisFormsModule,
2108
- ComboListModule,
2109
- HttpClientModule
2110
- ],
2111
- exports: [FileUploadComponent],
2112
- entryComponents: [FileUploadComponent],
2113
- providers: [UploadService, DownloadService, LanguageService, HttpService, CacheService, SessionService,
2114
- { provide: LOCALE_ID, useValue: ɵ0$1 },]
2115
- },] }
2116
- ];
2117
- /** @type {?} */
2202
+ /**
2203
+ * @fileoverview added by tsickle
2204
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2205
+ */
2206
+ const ɵ0$1 = localStorage.getItem('languageCode') || 'zh-CHS';
2207
+ class UploadModule {
2208
+ }
2209
+ UploadModule.decorators = [
2210
+ { type: NgModule, args: [{
2211
+ declarations: [FileUploadComponent, LocalLangPipe],
2212
+ imports: [
2213
+ CommonModule,
2214
+ FarrisRTFModule,
2215
+ NotifyModule,
2216
+ MessagerModule.forRoot(),
2217
+ LoadingModule.forRoot(),
2218
+ ProgressModule,
2219
+ FormsModule,
2220
+ FarrisFormsModule,
2221
+ DatalistModule,
2222
+ ComboListModule,
2223
+ HttpClientModule
2224
+ ],
2225
+ exports: [FileUploadComponent],
2226
+ entryComponents: [FileUploadComponent],
2227
+ providers: [UploadService, DownloadService, LanguageService, HttpService, CacheService, SessionService,
2228
+ { provide: LOCALE_ID, useValue: ɵ0$1 },]
2229
+ },] }
2230
+ ];
2231
+ /** @type {?} */
2118
2232
  const ɵa = UploadModule;
2119
2233
 
2120
- /**
2121
- * @fileoverview added by tsickle
2122
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2123
- */
2124
- class UploadDialogComponent {
2125
- /**
2126
- * @param {?} modalService
2127
- */
2128
- constructor(modalService) {
2129
- this.modalService = modalService;
2130
- this.metadataIdList = [];
2131
- }
2132
- /**
2133
- * @return {?}
2134
- */
2135
- ngOnInit() {
2136
- }
2137
- /**
2138
- * @return {?}
2139
- */
2140
- showDialog() {
2141
- this.dlg = this.modalService.show(FileUploadComponent, {
2142
- title: '选择文件',
2143
- width: 800, height: 500,
2144
- buttons: [
2145
- {
2146
- text: '上传', cls: 'k-button k-button-icontext k-primary', iconCls: "k-icon k-i-check", handle: (/**
2147
- * @return {?}
2148
- */
2149
- () => {
2150
- this.fileUpload.upload();
2151
- this.dlg.close();
2152
- })
2153
- },
2154
- {
2155
- text: '关闭', cls: 'k-button k-button-icontext', iconCls: "k-icon k-i-close", handle: (/**
2156
- * @return {?}
2157
- */
2158
- () => {
2159
- this.fileUpload.cancel();
2160
- this.dlg.close();
2161
- })
2162
- }
2163
- ],
2164
- showButtons: true,
2165
- });
2166
- this.dlg.content.formId = this.formId;
2167
- }
2168
- }
2169
- UploadDialogComponent.decorators = [
2170
- { type: Component, args: [{
2171
- selector: 'app-uploaddialog',
2172
- template: "\n",
2173
- styles: [""]
2174
- }] }
2175
- ];
2176
- /** @nocollapse */
2177
- UploadDialogComponent.ctorParameters = () => [
2178
- { type: BsModalService }
2179
- ];
2180
- UploadDialogComponent.propDecorators = {
2181
- formId: [{ type: Input }],
2182
- fileUpload: [{ type: ViewChild, args: [FileUploadComponent,] }]
2234
+ /**
2235
+ * @fileoverview added by tsickle
2236
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2237
+ */
2238
+ class UploadDialogComponent {
2239
+ /**
2240
+ * @param {?} modalService
2241
+ */
2242
+ constructor(modalService) {
2243
+ this.modalService = modalService;
2244
+ this.metadataIdList = [];
2245
+ }
2246
+ /**
2247
+ * @return {?}
2248
+ */
2249
+ ngOnInit() {
2250
+ }
2251
+ /**
2252
+ * @return {?}
2253
+ */
2254
+ showDialog() {
2255
+ this.dlg = this.modalService.show(FileUploadComponent, {
2256
+ title: '选择文件',
2257
+ width: 800, height: 500,
2258
+ buttons: [
2259
+ {
2260
+ text: '上传', cls: 'k-button k-button-icontext k-primary', iconCls: "k-icon k-i-check", handle: (/**
2261
+ * @return {?}
2262
+ */
2263
+ () => {
2264
+ this.fileUpload.upload();
2265
+ this.dlg.close();
2266
+ })
2267
+ },
2268
+ {
2269
+ text: '关闭', cls: 'k-button k-button-icontext', iconCls: "k-icon k-i-close", handle: (/**
2270
+ * @return {?}
2271
+ */
2272
+ () => {
2273
+ this.fileUpload.cancel();
2274
+ this.dlg.close();
2275
+ })
2276
+ }
2277
+ ],
2278
+ showButtons: true,
2279
+ });
2280
+ this.dlg.content.formId = this.formId;
2281
+ }
2282
+ }
2283
+ UploadDialogComponent.decorators = [
2284
+ { type: Component, args: [{
2285
+ selector: 'app-uploaddialog',
2286
+ template: "\n",
2287
+ styles: [""]
2288
+ }] }
2289
+ ];
2290
+ /** @nocollapse */
2291
+ UploadDialogComponent.ctorParameters = () => [
2292
+ { type: BsModalService }
2293
+ ];
2294
+ UploadDialogComponent.propDecorators = {
2295
+ formId: [{ type: Input }],
2296
+ fileUpload: [{ type: ViewChild, args: [FileUploadComponent,] }]
2183
2297
  };
2184
2298
 
2185
- /**
2186
- * @fileoverview added by tsickle
2187
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2188
- */
2189
- class UploadDialogService {
2190
- /**
2191
- * @param {?} modalService
2192
- * @param {?} componentFactoryResolver
2193
- * @param {?} injector
2194
- */
2195
- constructor(modalService, componentFactoryResolver, injector) {
2196
- this.modalService = modalService;
2197
- this.componentFactoryResolver = componentFactoryResolver;
2198
- this.injector = injector;
2199
- this.fileInfoList = [];
2200
- if (this.injector) {
2201
- this.modalService = this.injector.get(BsModalService);
2202
- this.localeid = localStorage.getItem("languageCode") || this.injector.get(LOCALE_ID);
2203
- this.localpipe = new LocalLangPipe(this.localeid);
2204
- }
2205
- }
2206
- /**
2207
- * @param {?} formId
2208
- * @param {?} rootId
2209
- * @return {?}
2210
- */
2211
- showDialog(formId, rootId) {
2212
- /** @type {?} */
2213
- let flag = 0;
2214
- return new Promise((/**
2215
- * @param {?} resolve
2216
- * @return {?}
2217
- */
2218
- resolve => {
2219
- /** @type {?} */
2220
- var viewerFactory = this.componentFactoryResolver.resolveComponentFactory(FileUploadComponent);
2221
- /** @type {?} */
2222
- var viewerRef = viewerFactory.create(this.injector);
2223
- viewerRef.instance.rootId = rootId;
2224
- viewerRef.instance.formId = formId;
2225
- this.dlg = this.modalService.show(viewerRef, {
2226
- title: this.localpipe.transform('uploadFile'),
2227
- width: 950, height: 570,
2228
- buttons: [
2229
- {
2230
- text: this.localpipe.transform('save'), cls: 'k-button k-button-icontext k-primary', handle: (/**
2231
- * @return {?}
2232
- */
2233
- () => {
2234
- this.dlg.content.upload().subscribe((/**
2235
- * @param {?} res
2236
- * @return {?}
2237
- */
2238
- res => {
2239
- if (res) {
2240
- resolve(res);
2241
- flag = 1;
2242
- this.dlg.close();
2243
- }
2244
- }));
2245
- })
2246
- },
2247
- {
2248
- text: this.localpipe.transform('close'), cls: 'k-button k-button-icontext', handle: (/**
2249
- * @return {?}
2250
- */
2251
- () => {
2252
- this.dlg.close();
2253
- })
2254
- }
2255
- ],
2256
- showButtons: true,
2257
- showMaxButton: false,
2258
- beforeClose: (/**
2259
- * @return {?}
2260
- */
2261
- () => {
2262
- if (flag == 0)
2263
- this.dlg.content.cancel();
2264
- return of$1(true);
2265
- })
2266
- });
2267
- }));
2268
- }
2269
- /**
2270
- * @param {?} formId
2271
- * @param {?} rootId
2272
- * @param {?=} oldIdList
2273
- * @return {?}
2274
- */
2275
- uploadFile(formId, rootId, oldIdList = []) {
2276
- return this.uploadFileWithLimit(formId, rootId, null, oldIdList);
2277
- }
2278
- /**
2279
- * @param {?} formId
2280
- * @param {?} rootId
2281
- * @param {?} limit
2282
- * @param {?=} oldIdList
2283
- * @return {?}
2284
- */
2285
- uploadFileWithLimit(formId, rootId, limit, oldIdList = []) {
2286
- /** @type {?} */
2287
- let flag = 0;
2288
- return new Promise((/**
2289
- * @param {?} resolve
2290
- * @return {?}
2291
- */
2292
- resolve => {
2293
- /** @type {?} */
2294
- var uploadFactory = this.componentFactoryResolver.resolveComponentFactory(FileUploadComponent);
2295
- /** @type {?} */
2296
- var uploadRef = uploadFactory.create(this.injector);
2297
- if (limit != null) {
2298
- uploadRef.instance.fileCount = limit.fileCount;
2299
- uploadRef.instance.securityInfo = limit.securityInfo;
2300
- uploadRef.instance.fileNameLength = limit.fileNameLength;
2301
- if (limit.fileType != null && limit.fileType != "")
2302
- uploadRef.instance.fileType = limit.fileType;
2303
- }
2304
- uploadRef.instance.rootId = rootId;
2305
- uploadRef.instance.formId = formId;
2306
- uploadRef.instance.oldIdList = oldIdList;
2307
- this.dlg = this.modalService.show(uploadRef, {
2308
- title: this.localpipe.transform('uploadFile'),
2309
- width: 950, height: 570,
2310
- buttons: [
2311
- {
2312
- text: this.localpipe.transform('save'), cls: 'k-button k-button-icontext k-primary', handle: (/**
2313
- * @return {?}
2314
- */
2315
- () => {
2316
- this.dlg.content.upload().subscribe((/**
2317
- * @param {?} res
2318
- * @return {?}
2319
- */
2320
- res => {
2321
- if (res) {
2322
- resolve(res);
2323
- flag = 1;
2324
- this.dlg.close();
2325
- }
2326
- }));
2327
- })
2328
- },
2329
- {
2330
- text: this.localpipe.transform('close'), cls: 'k-button k-button-icontext', handle: (/**
2331
- * @return {?}
2332
- */
2333
- () => {
2334
- this.dlg.close();
2335
- })
2336
- }
2337
- ],
2338
- showButtons: true,
2339
- showMaxButton: false,
2340
- beforeClose: (/**
2341
- * @return {?}
2342
- */
2343
- () => {
2344
- if (flag == 0)
2345
- this.dlg.content.cancel();
2346
- return of$1(true);
2347
- })
2348
- });
2349
- }));
2350
- }
2351
- }
2352
- UploadDialogService.decorators = [
2353
- { type: Injectable }
2354
- ];
2355
- /** @nocollapse */
2356
- UploadDialogService.ctorParameters = () => [
2357
- { type: BsModalService },
2358
- { type: ComponentFactoryResolver },
2359
- { type: Injector }
2299
+ /**
2300
+ * @fileoverview added by tsickle
2301
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2302
+ */
2303
+ class UploadDialogService {
2304
+ /**
2305
+ * @param {?} modalService
2306
+ * @param {?} componentFactoryResolver
2307
+ * @param {?} injector
2308
+ */
2309
+ constructor(modalService, componentFactoryResolver, injector) {
2310
+ this.modalService = modalService;
2311
+ this.componentFactoryResolver = componentFactoryResolver;
2312
+ this.injector = injector;
2313
+ this.fileInfoList = [];
2314
+ if (this.injector) {
2315
+ this.modalService = this.injector.get(BsModalService);
2316
+ this.localeid = localStorage.getItem("languageCode") || this.injector.get(LOCALE_ID);
2317
+ this.localpipe = new LocalLangPipe(this.localeid);
2318
+ }
2319
+ }
2320
+ /**
2321
+ * @param {?} formId
2322
+ * @param {?} rootId
2323
+ * @return {?}
2324
+ */
2325
+ showDialog(formId, rootId) {
2326
+ /** @type {?} */
2327
+ let flag = 0;
2328
+ return new Promise((/**
2329
+ * @param {?} resolve
2330
+ * @return {?}
2331
+ */
2332
+ resolve => {
2333
+ /** @type {?} */
2334
+ var viewerFactory = this.componentFactoryResolver.resolveComponentFactory(FileUploadComponent);
2335
+ /** @type {?} */
2336
+ var viewerRef = viewerFactory.create(this.injector);
2337
+ viewerRef.instance.rootId = rootId;
2338
+ viewerRef.instance.formId = formId;
2339
+ this.dlg = this.modalService.show(viewerRef, {
2340
+ title: this.localpipe.transform('uploadFile'),
2341
+ width: 950, height: 580,
2342
+ buttons: [
2343
+ {
2344
+ text: this.localpipe.transform('save'), cls: 'k-button k-button-icontext k-primary', handle: (/**
2345
+ * @return {?}
2346
+ */
2347
+ () => {
2348
+ this.dlg.content.upload().subscribe((/**
2349
+ * @param {?} res
2350
+ * @return {?}
2351
+ */
2352
+ res => {
2353
+ if (res) {
2354
+ resolve(res);
2355
+ flag = 1;
2356
+ this.dlg.close();
2357
+ }
2358
+ }));
2359
+ })
2360
+ },
2361
+ {
2362
+ text: this.localpipe.transform('close'), cls: 'k-button k-button-icontext', handle: (/**
2363
+ * @return {?}
2364
+ */
2365
+ () => {
2366
+ this.dlg.close();
2367
+ })
2368
+ }
2369
+ ],
2370
+ showButtons: true,
2371
+ showMaxButton: false,
2372
+ beforeClose: (/**
2373
+ * @return {?}
2374
+ */
2375
+ () => {
2376
+ if (flag == 0)
2377
+ this.dlg.content.cancel();
2378
+ return of$1(true);
2379
+ })
2380
+ });
2381
+ }));
2382
+ }
2383
+ /**
2384
+ * @param {?} formId
2385
+ * @param {?} rootId
2386
+ * @param {?=} oldIdList
2387
+ * @return {?}
2388
+ */
2389
+ uploadFile(formId, rootId, oldIdList = []) {
2390
+ return this.uploadFileWithLimit(formId, rootId, null, oldIdList);
2391
+ }
2392
+ /**
2393
+ * @param {?} formId
2394
+ * @param {?} rootId
2395
+ * @param {?} limit
2396
+ * @param {?=} oldIdList
2397
+ * @return {?}
2398
+ */
2399
+ uploadFileWithLimit(formId, rootId, limit, oldIdList = []) {
2400
+ /** @type {?} */
2401
+ let flag = 0;
2402
+ return new Promise((/**
2403
+ * @param {?} resolve
2404
+ * @return {?}
2405
+ */
2406
+ resolve => {
2407
+ /** @type {?} */
2408
+ var uploadFactory = this.componentFactoryResolver.resolveComponentFactory(FileUploadComponent);
2409
+ /** @type {?} */
2410
+ var uploadRef = uploadFactory.create(this.injector);
2411
+ if (limit != null) {
2412
+ uploadRef.instance.fileCount = limit.fileCount;
2413
+ uploadRef.instance.securityInfo = limit.securityInfo;
2414
+ uploadRef.instance.fileNameLength = limit.fileNameLength;
2415
+ if (limit.fileType != null && limit.fileType != "")
2416
+ uploadRef.instance.fileType = limit.fileType;
2417
+ }
2418
+ uploadRef.instance.rootId = rootId;
2419
+ uploadRef.instance.formId = formId;
2420
+ uploadRef.instance.oldIdList = oldIdList;
2421
+ this.dlg = this.modalService.show(uploadRef, {
2422
+ title: this.localpipe.transform('uploadFile'),
2423
+ width: 950, height: 580,
2424
+ buttons: [
2425
+ {
2426
+ text: this.localpipe.transform('save'), cls: 'k-button k-button-icontext k-primary', handle: (/**
2427
+ * @return {?}
2428
+ */
2429
+ () => {
2430
+ this.dlg.content.upload().subscribe((/**
2431
+ * @param {?} res
2432
+ * @return {?}
2433
+ */
2434
+ res => {
2435
+ if (res) {
2436
+ resolve(res);
2437
+ flag = 1;
2438
+ this.dlg.close();
2439
+ }
2440
+ }));
2441
+ })
2442
+ },
2443
+ {
2444
+ text: this.localpipe.transform('close'), cls: 'k-button k-button-icontext', handle: (/**
2445
+ * @return {?}
2446
+ */
2447
+ () => {
2448
+ this.dlg.close();
2449
+ })
2450
+ }
2451
+ ],
2452
+ showButtons: true,
2453
+ showMaxButton: false,
2454
+ beforeClose: (/**
2455
+ * @return {?}
2456
+ */
2457
+ () => {
2458
+ if (flag == 0)
2459
+ this.dlg.content.cancel();
2460
+ return of$1(true);
2461
+ })
2462
+ });
2463
+ }));
2464
+ }
2465
+ }
2466
+ UploadDialogService.decorators = [
2467
+ { type: Injectable }
2468
+ ];
2469
+ /** @nocollapse */
2470
+ UploadDialogService.ctorParameters = () => [
2471
+ { type: BsModalService },
2472
+ { type: ComponentFactoryResolver },
2473
+ { type: Injector }
2360
2474
  ];
2361
2475
 
2362
- /**
2363
- * @fileoverview added by tsickle
2364
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2365
- */
2366
- class UploadDialogMoudle {
2367
- }
2368
- UploadDialogMoudle.decorators = [
2369
- { type: NgModule, args: [{
2370
- declarations: [UploadDialogComponent],
2371
- imports: [
2372
- CommonModule,
2373
- FarrisDialogModule,
2374
- MessagerModule.forRoot(),
2375
- UploadModule,
2376
- NotifyModule.forRoot(),
2377
- HttpClientModule
2378
- ],
2379
- exports: [UploadDialogComponent, FileUploadComponent],
2380
- entryComponents: [UploadDialogComponent, FileUploadComponent],
2381
- providers: [BsModalService, HttpService, UploadDialogService, UploadService]
2382
- },] }
2476
+ /**
2477
+ * @fileoverview added by tsickle
2478
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2479
+ */
2480
+ class UploadDialogMoudle {
2481
+ }
2482
+ UploadDialogMoudle.decorators = [
2483
+ { type: NgModule, args: [{
2484
+ declarations: [UploadDialogComponent],
2485
+ imports: [
2486
+ CommonModule,
2487
+ FarrisDialogModule,
2488
+ MessagerModule.forRoot(),
2489
+ UploadModule,
2490
+ NotifyModule.forRoot(),
2491
+ HttpClientModule
2492
+ ],
2493
+ exports: [UploadDialogComponent, FileUploadComponent],
2494
+ entryComponents: [UploadDialogComponent, FileUploadComponent],
2495
+ providers: [BsModalService, HttpService, UploadDialogService, UploadService]
2496
+ },] }
2383
2497
  ];
2384
2498
 
2385
- /**
2386
- * @fileoverview added by tsickle
2387
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2388
- */
2389
- class UploadLimit {
2390
- constructor() {
2391
- this.fileType = "*";
2392
- this.fileCount = 0;
2393
- this.securityInfo = null;
2394
- this.fileNameLength = 0;
2395
- }
2499
+ /**
2500
+ * @fileoverview added by tsickle
2501
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2502
+ */
2503
+ class UploadLimit {
2504
+ constructor() {
2505
+ this.fileType = "*";
2506
+ this.fileCount = 0;
2507
+ this.securityInfo = null;
2508
+ this.fileNameLength = 0;
2509
+ }
2396
2510
  }
2397
2511
 
2398
- /**
2399
- * @fileoverview added by tsickle
2400
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2401
- */
2402
- class GspFormUploadListEntity {
2512
+ /**
2513
+ * @fileoverview added by tsickle
2514
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2515
+ */
2516
+ class GspFormUploadListEntity {
2403
2517
  }
2404
2518
 
2405
- /**
2406
- * @fileoverview added by tsickle
2407
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2408
- */
2409
- class GspFormDocInfo {
2519
+ /**
2520
+ * @fileoverview added by tsickle
2521
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2522
+ */
2523
+ class GspFormDocInfo {
2410
2524
  }
2411
2525
 
2412
- /**
2413
- * @fileoverview added by tsickle
2414
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2415
- */
2416
- class GspDocMetaProperty {
2526
+ /**
2527
+ * @fileoverview added by tsickle
2528
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2529
+ */
2530
+ class GspDocMetaProperty {
2417
2531
  }
2418
2532
 
2419
- /**
2420
- * @fileoverview added by tsickle
2421
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2422
- */
2423
- class GspFormUploadEntity {
2533
+ /**
2534
+ * @fileoverview added by tsickle
2535
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2536
+ */
2537
+ class GspFormUploadEntity {
2424
2538
  }
2425
2539
 
2426
- /**
2427
- * @fileoverview added by tsickle
2428
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2429
- */
2430
- class FileInfo {
2540
+ /**
2541
+ * @fileoverview added by tsickle
2542
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2543
+ */
2544
+ class FileInfo {
2431
2545
  }
2432
2546
 
2433
- /**
2434
- * @fileoverview added by tsickle
2435
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2436
- */
2437
- class SecurityEntity {
2547
+ /**
2548
+ * @fileoverview added by tsickle
2549
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2550
+ */
2551
+ class SecurityEntity {
2438
2552
  }
2439
2553
 
2440
- /**
2441
- * @fileoverview added by tsickle
2442
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2554
+ /**
2555
+ * @fileoverview added by tsickle
2556
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2443
2557
  */
2444
2558
 
2445
- /**
2446
- * @fileoverview added by tsickle
2447
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2559
+ /**
2560
+ * @fileoverview added by tsickle
2561
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2448
2562
  */
2449
2563
 
2450
2564
  export { FormdocUploadService, FormdocUploadComponent, FormdocUploadModule, UploadDialogMoudle, UploadDialogComponent, UploadDialogService, UploadService, DownloadService, FileUploadComponent, UploadFileInfo, UploadModule, ɵa, UploadLimit, GspFormDocOperateEntity, GspFormRemoveListEntity, GspFormUploadListEntity, GspFormDocInfo, GspDocMetaProperty, GspFormUploadEntity, FileInfo, OperatingModes, FileState, GspDocSecurityBaseInfo, SecurityEntity, ExStorageFileInfo, CopyFileRequest, LocalLangPipe as ɵb };