fat-design 0.0.2-beta.20251111003037 → 0.0.2-beta.20251124221954

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.
@@ -3,11 +3,13 @@ import './renderFileImage.scss';
3
3
  interface IRenderProps {
4
4
  value: any;
5
5
  prefix?: string;
6
+ isList?: boolean;
6
7
  }
7
8
  interface IRenderCfg {
8
9
  deep: number;
9
10
  index: number;
10
11
  prefix: string;
12
+ isList?: boolean;
11
13
  }
12
14
  interface IRenderLinkFnProps extends IRenderCfg {
13
15
  downloadURL: string;
@@ -263,6 +263,84 @@ export interface IShowBatchInputCfg extends QuickShowConfig {
263
263
  topTips?: any;
264
264
  }
265
265
 
266
+
267
+ export interface IShowImportFieldMapping {
268
+ source: string, // Excel字段名
269
+ target: string, // 映射成json的字段名
270
+ type: 'string'| 'date' | 'origin', // 数据类型
271
+ }
272
+
273
+
274
+ export interface IBatchProcessElementResultList {
275
+ element: any;
276
+ index: number;
277
+ result?: any;
278
+ errorMsg?: string;
279
+ }
280
+
281
+ // onBatchProcessDone({errorCount, successCount, elementResultList }
282
+
283
+ export interface ITypeOnBatchProcessDoneParam {
284
+ errorCount?: number;
285
+ successCount?: number;
286
+ elementResultList: IBatchProcessElementResultList[]
287
+ }
288
+
289
+ export interface IHandleProcessElementResult {
290
+ success: boolean;
291
+ message?: string; // 错误时的错误信息。
292
+ }
293
+
294
+ /**
295
+ * 函数:批量导入完成事件
296
+ */
297
+ export type TypeOnBatchProcessDone = (param: ITypeOnBatchProcessDoneParam)=> Promise<void>;
298
+
299
+ /**
300
+ * 函数:执行单个导入
301
+ */
302
+ export type TypeHandleProcessElement = (elementObj: any)=> Promise<IHandleProcessElementResult>;
303
+
304
+
305
+ /**
306
+ * Excel导入对话框的配置
307
+ */
308
+ export interface IShowBatchByExcelCfg extends QuickShowConfig {
309
+ excelTemplateName: string, //字符串:excel导入模板的模板名称。 不能为空
310
+ excelTemplateUrl: string, //字符串:excel导入模板的模板的下载地址URL。 不能为空
311
+ fieldMappingList: IShowImportFieldMapping[], // 字段映射:表格中的表头和我们需要的结构化字段的映射关系
312
+
313
+ loadExcelScript: ()=> Promise<void>, //函数:加载window.XLSX使用的脚本文件, 不能为空
314
+ preprocessTableData: (tableData: any[])=> Promise<void>, //函数:导入前校验数据完整性,也可以对数据设置一些字段
315
+
316
+ onBatchProcessDone?: TypeOnBatchProcessDone, // 函数:批量处理完成事件
317
+ handleProcessElement: TypeHandleProcessElement, // 函数:执行单个数据处理
318
+ notifyOnError?: boolean, // 出现错误时,是否使用Notification.error直接显示出来。默认为false
319
+ elementDisplayKey?: string, // 出现错误时,用于标识某一条数据的key
320
+ }
321
+
322
+ /**
323
+ * 批处理的一些文案
324
+ */
325
+ export interface IShowBatchProcessMsgCfg {
326
+ confirmMsg?: string; // 确认提示文案。
327
+ processMsg?: string; // 处理中的提示文案
328
+ }
329
+
330
+ /**
331
+ * 批量数据数对话框的配置
332
+ */
333
+ export interface IShowBatchProcessCfg extends QuickShowConfig {
334
+ elementList: any[], // 需要被处理的元素列表
335
+ msgCfg?: IShowBatchProcessMsgCfg,
336
+
337
+ onBatchProcessDone?: TypeOnBatchProcessDone, // 函数:批量导入完成事件
338
+ handleProcessElement: TypeHandleProcessElement, // 函数:执行单个导入
339
+ notifyOnError?: boolean, // 出现错误时,是否使用Notification.error直接显示出来。默认为false
340
+ elementDisplayKey?: string, // 出现错误时,用于标识某一条数据的key
341
+ }
342
+
343
+
266
344
  export interface IShowCompCfg extends QuickShowConfig {
267
345
  component: any,
268
346
  xProps: any,
@@ -323,6 +401,8 @@ export default class Dialog extends React.Component<DialogProps, any> {
323
401
  static showAudit(config: IShowInputCfg): QuickShowRet;
324
402
  static showTable(config: IShowTableCfg): QuickShowRet;
325
403
  static showBatchInput(config: IShowBatchInputCfg): QuickShowRet;
404
+ static showBatchByExcel(config: IShowBatchByExcelCfg): QuickShowRet;
405
+ static showBatchProcess(config: IShowBatchProcessCfg): QuickShowRet;
326
406
  static confirmPromise(config: QuickShowConfig): Promise<boolean>;
327
407
  static show(config: QuickShowConfig): QuickShowRet;
328
408
  static alert(config: QuickShowConfig): QuickShowRet;
@@ -82,7 +82,14 @@ export interface ObjectFile extends CommonModifiedFile {
82
82
  alt?: string;
83
83
  }
84
84
 
85
-
85
+ export interface IFileValueObject {
86
+ name?: string;
87
+ state?: string;
88
+ url?: string;
89
+ downloadURL?: string;
90
+ imgURL?: string;
91
+ size?: number;
92
+ }
86
93
 
87
94
  export interface CardProps extends HTMLAttributesWeak, CommonProps {
88
95
  /**
@@ -336,10 +343,16 @@ export interface SimpleJSONUploadProps extends UploadProps, CardProps {
336
343
  * 在Preview模式下,如何显示 预览效果
337
344
  * 默认:default
338
345
  */
339
- previewMode?: 'default' | 'auto' | 'image' | 'download' | 'weboffice';
346
+ previewMode?: 'default' | 'auto' | 'image' | 'download' | 'weboffice' | 'auto-list';
347
+
348
+ /**
349
+ * 可以是标准的value数组,也可以是字符串
350
+ */
351
+ value?: IFileValueObject | IFileValueObject[] | string;
340
352
  }
341
353
 
342
354
 
355
+
343
356
  export class SimpleJSONUpload extends React.Component<SimpleJSONUploadProps, any> {} {
344
357
 
345
358
  }
@@ -541,12 +554,12 @@ export interface UploadProps extends HTMLAttributesWeak, CommonProps {
541
554
  /**
542
555
  * 文件列表
543
556
  */
544
- value?: Array<any>;
557
+ value?: IFileValueObject[];
545
558
 
546
559
  /**
547
560
  * 默认文件列表
548
561
  */
549
- defaultValue?: Array<any>;
562
+ defaultValue?: IFileValueObject[];
550
563
 
551
564
  /**
552
565
  * 上传按钮形状