刘光辉
9 小时以前 0dfe84494048ce27ba8449831782128412d3eb13
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
export type ReportViewTabKey = 'attachments' | 'customPrint' | 'formDetail';
export type NormalizedReportViewTab = ReportViewTab & { internalKey: string };
 
export interface ReportViewConfig {
  actions?: ReportViewAction[];
  activeKey?: ReportViewTabKey | string;
  onClose?: () => void;
  tabs: ReportViewTab[];
  title?: string;
}
 
export type ReportViewTab = AttachmentsTab | CustomPrintTab | FormDetailTab;
 
export interface FormDetailTab {
  id: string;
  key: 'formDetail';
  menuId?: string;
  modelId: string;
  propsValue?: string;
  title?: string;
}
 
export interface CustomPrintTab {
  key: 'customPrint';
  print: ReportViewCustomPrintConfig;
  title?: string;
}
 
export interface ReportViewCustomPrintConfig {
  data: any;
  showPdfBtn?: boolean;
  template: string;
  title?: string;
}
 
export interface AttachmentsTab {
  key: 'attachments';
  title?: string;
}
 
export interface ReportViewAction {
  confirmText?: string;
  danger?: boolean;
  disabled?: boolean;
  key: string;
  label: string;
  onClick: () => Promise<void> | void;
  type?: 'default' | 'primary';
}
 
export interface NormalizedReportViewConfig extends Omit<ReportViewConfig, 'activeKey' | 'tabs'> {
  activeKey?: string;
  tabs: NormalizedReportViewTab[];
  title: string;
}