@@ -150,10 +150,80 @@ public partial class CardUpload<TValue>
150150 [ Parameter ]
151151 public List < string > ? AllowExtensions { get ; set ; }
152152
153+ /// <summary>
154+ /// 获得/设置 Excel 类型文件图标
155+ /// </summary>
156+ [ Parameter ]
157+ public string ? FileIconExcel { get ; set ; }
158+
159+ /// <summary>
160+ /// 获得/设置 Docx 类型文件图标
161+ /// </summary>
162+ [ Parameter ]
163+ public string ? FileIconDocx { get ; set ; }
164+
165+ /// <summary>
166+ /// 获得/设置 PPT 类型文件图标
167+ /// </summary>
168+ [ Parameter ]
169+ public string ? FileIconPPT { get ; set ; }
170+
171+ /// <summary>
172+ /// 获得/设置 Audio 类型文件图标
173+ /// </summary>
174+ [ Parameter ]
175+ public string ? FileIconAudio { get ; set ; }
176+
177+ /// <summary>
178+ /// 获得/设置 Video 类型文件图标
179+ /// </summary>
180+ [ Parameter ]
181+ public string ? FileIconVideo { get ; set ; }
182+
183+ /// <summary>
184+ /// 获得/设置 File 类型文件图标
185+ /// </summary>
186+ [ Parameter ]
187+ public string ? FileIconCode { get ; set ; }
188+
189+ /// <summary>
190+ /// 获得/设置 Pdf 类型文件图标
191+ /// </summary>
192+ [ Parameter ]
193+ public string ? FileIconPdf { get ; set ; }
194+
195+ /// <summary>
196+ /// 获得/设置 Zip 类型文件图标
197+ /// </summary>
198+ [ Parameter ]
199+ public string ? FileIconZip { get ; set ; }
200+
201+ /// <summary>
202+ /// 获得/设置 Archive 类型文件图标
203+ /// </summary>
204+ [ Parameter ]
205+ public string ? FileIconArchive { get ; set ; }
206+
207+ /// <summary>
208+ /// 获得/设置 Image 类型文件图标
209+ /// </summary>
210+ [ Parameter ]
211+ public string ? FileIconImage { get ; set ; }
212+
213+ /// <summary>
214+ /// 获得/设置 File 类型文件图标
215+ /// </summary>
216+ [ Parameter ]
217+ public string ? FileIconFile { get ; set ; }
218+
153219 [ Inject ]
154220 [ NotNull ]
155221 private IIconTheme ? IconTheme { get ; set ; }
156222
223+ private string ? ActionClassString => CssBuilder . Default ( "upload-item-actions" )
224+ . AddClass ( "btn-browser" , IsDisabled == false )
225+ . Build ( ) ;
226+
157227 /// <summary>
158228 /// <inheritdoc/>
159229 /// </summary>
@@ -167,22 +237,19 @@ protected override void OnParametersSet()
167237 RemoveIcon ??= IconTheme . GetIconByKey ( ComponentIcons . CardUploadRemoveIcon ) ;
168238 DownloadIcon ??= IconTheme . GetIconByKey ( ComponentIcons . CardUploadDownloadIcon ) ;
169239 ZoomIcon ??= IconTheme . GetIconByKey ( ComponentIcons . CardUploadZoomIcon ) ;
170- }
171-
172- /// <summary>
173- /// <inheritdoc/>
174- /// </summary>
175- /// <returns></returns>
176- protected override bool CheckCanUpload ( )
177- {
178- // 允许多上传
179- if ( IsMultiple )
180- {
181- return true ;
182- }
183240
184- // 只允许单个上传
185- return UploadFiles . Count == 0 ;
241+ CancelIcon ??= IconTheme . GetIconByKey ( ComponentIcons . UploadCancelIcon ) ;
242+ FileIconExcel ??= IconTheme . GetIconByKey ( ComponentIcons . FileIconExcel ) ;
243+ FileIconDocx ??= IconTheme . GetIconByKey ( ComponentIcons . FileIconDocx ) ;
244+ FileIconPPT ??= IconTheme . GetIconByKey ( ComponentIcons . FileIconPPT ) ;
245+ FileIconAudio ??= IconTheme . GetIconByKey ( ComponentIcons . FileIconAudio ) ;
246+ FileIconVideo ??= IconTheme . GetIconByKey ( ComponentIcons . FileIconVideo ) ;
247+ FileIconCode ??= IconTheme . GetIconByKey ( ComponentIcons . FileIconCode ) ;
248+ FileIconPdf ??= IconTheme . GetIconByKey ( ComponentIcons . FileIconPdf ) ;
249+ FileIconZip ??= IconTheme . GetIconByKey ( ComponentIcons . FileIconZip ) ;
250+ FileIconArchive ??= IconTheme . GetIconByKey ( ComponentIcons . FileIconArchive ) ;
251+ FileIconImage ??= IconTheme . GetIconByKey ( ComponentIcons . FileIconImage ) ;
252+ FileIconFile ??= IconTheme . GetIconByKey ( ComponentIcons . FileIconFile ) ;
186253 }
187254
188255 private async Task OnCardFileDelete ( UploadFile item )
0 commit comments