#ifndef STATISTICSDIALOG_H #define STATISTICSDIALOG_H #include #include #include #include #include #include #include #include "AttendanceRecord.h" /** * @brief 统计报表对话框 */ class StatisticsDialog : public QDialog { Q_OBJECT public: explicit StatisticsDialog(const QVector &records, QWidget *parent = nullptr); ~StatisticsDialog(); private slots: void onDateRangeChanged(); void onExportReport(); void onRefresh(); private: void setupUI(); void calculateStatistics(); void updateTable(); // 统计数据结构 struct StudentStats { QString studentId; QString name; int totalCount; // 总签到次数 int todayCount; // 今日签到次数 QDateTime lastCheckIn; // 最后签到时间 double avgConfidence; // 平均置信度 }; // UI组件 QDateEdit *m_startDateEdit; QDateEdit *m_endDateEdit; QComboBox *m_quickSelectCombo; QTableWidget *m_tableWidget; QPushButton *m_exportButton; QPushButton *m_refreshButton; QLabel *m_summaryLabel; // 数据 QVector m_records; QMap m_statsMap; }; #endif // STATISTICSDIALOG_H