刘光辉
5 小时以前 cf11e63b659afcc9792ab3e395f1b45d844431a8
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
66
67
68
69
70
71
72
73
74
import type { PrintAuditOptions } from '#/api/x/lims/printAudit';
import type { PrintAuditTargetMapping } from '#/utils/printAudit';
 
export type ReportViewTabKey = 'attachments' | 'customPrint' | 'elnRecords' | '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 | ElnRecordsTab | FormDetailTab;
 
export interface ElnRecordsTab {
  key: 'elnRecords';
  qingyandanId: string;
  title?: string;
}
 
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 {
  audit?:
    | false
    | (PrintAuditTargetMapping & {
        bizType?: string;
        printName?: string;
        recordTitle?: string;
        targets?: PrintAuditOptions['targets'];
        targetTable?: string;
        templateId?: string;
      });
  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;
}