import { request } from './request' /** 近 6 个月趋势点(绩效按台账归属月,回款按到账月) */ export interface TrendPoint { month: string performance_total: string | null receipt_total: string | null } export interface SettlementBrief { exists: boolean status: number | null total_performance: string | null total_payable: string | null locked_at: string | null } export interface OverviewBlock { month: string performance_total: string | null payable_total: string | null person_count: number team_count: number settlement: SettlementBrief trend: TrendPoint[] note: string } export interface ApprovalTodoItem { order_id: number order_no: string order_type: number submitter_name: string | null create_time: string } export interface ReceiptTodoItem { receipt_id: number receipt_batch_no: string business_id: number business_no: string | null amount: string receipt_date: string } export interface TodoBlock { pending_approval_total: number pending_approvals: ApprovalTodoItem[] unassigned_receipt_total: number unassigned_receipts: ReceiptTodoItem[] sync_available: boolean sync_failure_total: number } export interface WarningItem { code: string level: 'warning' | 'danger' object_type: string object_id: number title: string detail: string suggest: string link: string | null } export interface WarningBlock { enabled: boolean receipt_overdue_days: number approval_timeout_days: number items: WarningItem[] receipt_overdue_total: number approval_timeout_total: number sync_available: boolean } export interface ActivityItem { id: number module: string action: string summary: string username: string | null success: number create_time: string } export interface DashboardData { month: string overview: OverviewBlock todos: TodoBlock warnings: WarningBlock activities: ActivityItem[] } export function getDashboard(params: { month?: string }): Promise { return request({ url: '/v1/dashboard', method: 'get', params }) }