ny
昨天 282fbc6488f4e8ceb5fda759f963ee88fbf7b999
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
export interface imgItem {
  fileId: string;
  name: string;
  thumbUrl: string;
  url: string;
}
export interface fileItem extends imgItem {
  fileExtension?: string;
  fileSize: number | string;
  fileVersionId?: string;
}
 
export const units = {
  GB: 1024 * 1024 * 1024,
  KB: 1024,
  MB: 1024 * 1024,
};
const uploadBaseProps = {
  detailed: { default: false, type: Boolean },
  disabled: { default: false, type: Boolean },
  fileSize: { default: 10, type: Number },
  folder: { default: '', type: String },
  limit: { default: 0, type: Number },
  pathType: { default: 'defaultPath', type: String },
  showTip: { default: false, type: Boolean },
  showUploadList: { default: true, type: Boolean },
  simple: { default: false, type: Boolean },
  sizeUnit: { default: 'MB', type: String },
  sortRule: { default: () => [], type: Object },
  timeFormat: { default: 'YYYY', type: String },
  tipText: { default: '', type: String },
};
 
export const uploadImgProps = {
  ...uploadBaseProps,
  accept: { default: 'image/*', type: String },
  buttonText: { default: '', type: String },
  // card,button,dragger
  showType: { default: 'card', type: String },
  type: { default: 'annexpic', type: String },
  value: { type: Array as PropType<imgItem[]> },
};
export const uploadFileProps = {
  ...uploadBaseProps,
  accept: { default: '*', type: String },
  buttonText: { default: '点击上传', type: String },
  showDownload: { default: true, type: Boolean },
  showAllDownload: { default: true, type: Boolean },
  showIcon: { default: true, type: Boolean },
  showView: { default: true, type: Boolean },
  type: { default: 'annex', type: String },
  value: { default: [], type: Array as PropType<fileItem[]> },
};
export const uploadImgSingleProps = {
  accept: { default: 'image/*', type: String },
  action: { default: '', type: String },
  actionPrefix: { default: '', type: String },
  disabled: { default: false, type: Boolean },
  fileSize: { default: 10, type: Number },
  sizeUnit: { default: 'MB', type: String },
  subTipText: { default: '', type: String },
  tipText: { default: '', type: String },
  type: { default: 'annexpic', type: String },
  value: { default: '', type: String },
};