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;
|
}
|