95 lines
2.2 KiB
C++
95 lines
2.2 KiB
C++
#ifndef DATAMANAGEMENTWIDGET_H
|
|
#define DATAMANAGEMENTWIDGET_H
|
|
|
|
#include <QWidget>
|
|
#include <QLabel>
|
|
#include <QPushButton>
|
|
#include <QTableWidget>
|
|
#include <QComboBox>
|
|
#include <QDateEdit>
|
|
#include <QLineEdit>
|
|
#include <QVBoxLayout>
|
|
#include <QHBoxLayout>
|
|
#include <QStackedWidget>
|
|
#include <QProgressBar>
|
|
#include <QCheckBox>
|
|
|
|
/**
|
|
* @brief 数据管理页面
|
|
* 提供校准记录、历史数据、数据导出等功能
|
|
*/
|
|
class DataManagementWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit DataManagementWidget(QWidget *parent = nullptr);
|
|
|
|
signals:
|
|
void backRequested();
|
|
|
|
private slots:
|
|
void onSearchClicked();
|
|
void onExportClicked();
|
|
void onDeleteClicked();
|
|
void onRefreshClicked();
|
|
void onSelectAllChanged(int state);
|
|
void onRecordDoubleClicked(int row, int column);
|
|
void onCategoryChanged(int index);
|
|
void onSyncClicked();
|
|
void onBackupClicked();
|
|
void onRestoreClicked();
|
|
void onClearHistoryClicked();
|
|
|
|
private:
|
|
void setupUI();
|
|
QWidget *createFilterPanel();
|
|
QWidget *createDataTable();
|
|
QWidget *createToolBar();
|
|
QWidget *createStorageInfoPanel();
|
|
void populateSampleData();
|
|
void updateStorageInfo();
|
|
QString formatFileSize(qint64 bytes);
|
|
void setupDateEditStyle(QDateEdit *dateEdit);
|
|
|
|
// 标题栏
|
|
QLabel *m_titleLabel;
|
|
QPushButton *m_backBtn;
|
|
|
|
// 筛选控件
|
|
QComboBox *m_categoryCombo;
|
|
QDateEdit *m_startDateEdit;
|
|
QDateEdit *m_endDateEdit;
|
|
QLineEdit *m_searchEdit;
|
|
QPushButton *m_searchBtn;
|
|
|
|
// 数据表格
|
|
QTableWidget *m_dataTable;
|
|
QCheckBox *m_selectAllCheck;
|
|
|
|
// 工具栏
|
|
QPushButton *m_exportBtn;
|
|
QPushButton *m_deleteBtn;
|
|
QPushButton *m_refreshBtn;
|
|
QPushButton *m_syncBtn;
|
|
QPushButton *m_backupBtn;
|
|
QPushButton *m_restoreBtn;
|
|
QPushButton *m_clearHistoryBtn;
|
|
|
|
// 存储信息
|
|
QLabel *m_storageUsedLabel;
|
|
QLabel *m_recordCountLabel;
|
|
QProgressBar *m_storageProgressBar;
|
|
|
|
// 样式常量
|
|
static const QString LABEL_STYLE;
|
|
static const QString BUTTON_STYLE;
|
|
static const QString PRIMARY_BUTTON_STYLE;
|
|
static const QString DANGER_BUTTON_STYLE;
|
|
static const QString INPUT_STYLE;
|
|
static const QString TABLE_STYLE;
|
|
static const QString GROUP_STYLE;
|
|
};
|
|
|
|
#endif // DATAMANAGEMENTWIDGET_H
|