初始化
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
#ifndef STATISTICSDIALOG_H
|
||||
#define STATISTICSDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QTableWidget>
|
||||
#include <QPushButton>
|
||||
#include <QLabel>
|
||||
#include <QDateEdit>
|
||||
#include <QComboBox>
|
||||
#include <QMap>
|
||||
#include "AttendanceRecord.h"
|
||||
|
||||
/**
|
||||
* @brief 统计报表对话框
|
||||
*/
|
||||
class StatisticsDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit StatisticsDialog(const QVector<AttendanceRecord> &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<AttendanceRecord> m_records;
|
||||
QMap<QString, StudentStats> m_statsMap;
|
||||
};
|
||||
|
||||
#endif // STATISTICSDIALOG_H
|
||||
Reference in New Issue
Block a user