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