diff --git a/CMakeLists.txt b/CMakeLists.txt index 6eba719..9edc705 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,7 @@ set(H_HEADER_FILES include/global.h include/mainWindow.h include/customBorderContainer.h + include/customLineEdit.h include/customMenu.h include/customTab.h include/customTabBar.h @@ -47,6 +48,9 @@ set(H_HEADER_FILES include/customCalendarWidget.h include/dateTimeSelectionPanel.h include/httpRequestManager.h + include/alarmEventGlobal.h + include/alarmEventMainDialog.h + include/alarmEventDataView.h ) set(CPP_SOURCE_FILES @@ -54,6 +58,7 @@ set(CPP_SOURCE_FILES source/main.cpp source/mainWindow.cpp source/customBorderContainer.cpp + source/customLineEdit.cpp source/customMenu.cpp source/customTab.cpp source/customTabBar.cpp @@ -76,6 +81,8 @@ set(CPP_SOURCE_FILES source/customCalendarWidget.cpp source/dateTimeSelectionPanel.cpp source/httpRequestManager.cpp + source/alarmEventMainDialog.cpp + source/alarmEventDataView.cpp ) set(UI_FILES @@ -94,6 +101,7 @@ set(UI_FILES ui/dateTimeWidget.ui ui/dateTimeSelectionPanel.ui ui/dpConfigurationDialog.ui + ui/alarmEventMainDialog.ui ) set(UTIL_FILES diff --git a/include/alarmEventDataView.h b/include/alarmEventDataView.h new file mode 100644 index 0000000..ab57a9e --- /dev/null +++ b/include/alarmEventDataView.h @@ -0,0 +1,21 @@ +#ifndef ALARMEVENTDATAVIEW_H +#define ALARMEVENTDATAVIEW_H + +#include + +class QTableView; +class QVBoxLayout; +class AlarmEventDataView : public QWidget +{ + Q_OBJECT + +public: + AlarmEventDataView(QWidget* parent = nullptr); + ~AlarmEventDataView(); + +private: + QTableView* m_tableView; + QVBoxLayout* m_vLayout; +}; + +#endif diff --git a/include/alarmEventGlobal.h b/include/alarmEventGlobal.h new file mode 100644 index 0000000..ef6ba8f --- /dev/null +++ b/include/alarmEventGlobal.h @@ -0,0 +1,24 @@ +#ifndef ALARMEVENTGLOBAL_H +#define ALARMEVENTGLOBAL_H + +#include +#include + +enum MainDialogType +{ + RealTime = 0, + Historical +}; + +struct EventData +{ + QString id; + QString stationName; + QString bayName; + QString description; + bool confirmed; + QDateTime recivingTime; + QDateTime SOETime; +}; + +#endif diff --git a/include/alarmEventMainDialog.h b/include/alarmEventMainDialog.h new file mode 100644 index 0000000..318630c --- /dev/null +++ b/include/alarmEventMainDialog.h @@ -0,0 +1,31 @@ +#ifndef ALARMEVENTMAINDIALOG_H +#define ALARMEVENTMAINDIALOG_H + +#include +#include "alarmEventGlobal.h" + +QT_BEGIN_NAMESPACE +namespace Ui { +class alarmEventMainDialog; +} +QT_END_NAMESPACE + +class AlarmEventMainDialog : public QDialog +{ + Q_OBJECT + +public: + AlarmEventMainDialog(MainDialogType type, QWidget *parent = nullptr); + ~AlarmEventMainDialog(); + +signals: + void sgl_hide(); + +public slots: + void onBtnClicked_close(); + +private: + Ui::alarmEventMainDialog* ui; +}; + +#endif diff --git a/include/customLineEdit.h b/include/customLineEdit.h new file mode 100644 index 0000000..cbfd515 --- /dev/null +++ b/include/customLineEdit.h @@ -0,0 +1,26 @@ +/** + *\brief 用来实现QLineEdit的点击响应 + * + *\author dsc + */ + +#ifndef CUSTOMLINEEDIT_H +#define CUSTOMLINEEDIT_H + +#include + +class CustomLineEdit : public QLineEdit +{ + Q_OBJECT + +public: + explicit CustomLineEdit(QWidget* parent = nullptr); + +signals: + void clicked(); + +protected: + void mousePressEvent(QMouseEvent* event) override; +}; + +#endif diff --git a/resource/PowerMaster.qrc b/resource/PowerMaster.qrc index 276c479..5dbb656 100644 --- a/resource/PowerMaster.qrc +++ b/resource/PowerMaster.qrc @@ -1,5 +1,14 @@ + images/icon_first.png + images/icon_last.png + images/icon_next.png + images/icon_previous.png + images/icon_first.png + images/icon_last.png + images/icon_next.png + images/icon_previous.png + images/icon_checked.png images/ico_switch_off.png images/ico_switch_on.png images/down-arrow.png diff --git a/resource/images/icon_checked.png b/resource/images/icon_checked.png new file mode 100644 index 0000000..914e9b6 Binary files /dev/null and b/resource/images/icon_checked.png differ diff --git a/resource/images/icon_first.png b/resource/images/icon_first.png new file mode 100644 index 0000000..788d07b Binary files /dev/null and b/resource/images/icon_first.png differ diff --git a/resource/images/icon_last.png b/resource/images/icon_last.png new file mode 100644 index 0000000..69c927b Binary files /dev/null and b/resource/images/icon_last.png differ diff --git a/resource/images/icon_next.png b/resource/images/icon_next.png new file mode 100644 index 0000000..08399cd Binary files /dev/null and b/resource/images/icon_next.png differ diff --git a/resource/images/icon_previous.png b/resource/images/icon_previous.png new file mode 100644 index 0000000..da5d3eb Binary files /dev/null and b/resource/images/icon_previous.png differ diff --git a/source/alarmEventDataView.cpp b/source/alarmEventDataView.cpp new file mode 100644 index 0000000..2add960 --- /dev/null +++ b/source/alarmEventDataView.cpp @@ -0,0 +1,23 @@ +#include "alarmEventDataView.h" +#include +#include +#include + +AlarmEventDataView::AlarmEventDataView(QWidget* parent) + : QWidget(parent) +{ + m_tableView = new QTableView(this); + m_tableView->verticalHeader()->setVisible(false); + m_tableView->setEditTriggers(QAbstractItemView::NoEditTriggers); + m_tableView->setShowGrid(false); + //m_tableView->setStyleSheet("QHeaderView{background-color: rgb(40, 40, 40);} QHeaderView::section{background-color:transparent;}"); + + m_vLayout = new QVBoxLayout(this); + m_vLayout->setSpacing(0); + m_vLayout->setContentsMargins(0, 0, 0, 0); + m_vLayout->addWidget(m_tableView); + this->setLayout(m_vLayout); +} + +AlarmEventDataView::~AlarmEventDataView() +{} diff --git a/source/alarmEventMainDialog.cpp b/source/alarmEventMainDialog.cpp new file mode 100644 index 0000000..7b6623f --- /dev/null +++ b/source/alarmEventMainDialog.cpp @@ -0,0 +1,26 @@ +#include "alarmEventMainDialog.h" +#include "ui_alarmEventMainDialog.h" + +AlarmEventMainDialog::AlarmEventMainDialog(MainDialogType type, QWidget *parent) + : QDialog(parent) + , ui(new Ui::alarmEventMainDialog) +{ + ui->setupUi(this); + + if(type == RealTime) + ui->dataFilteringPanel->setVisible(false); + else + ui->dataFilteringPanel->setVisible(true); +} + +AlarmEventMainDialog::~AlarmEventMainDialog() +{ + delete ui; +} + +void AlarmEventMainDialog::onBtnClicked_close() +{ + //reject(); + hide(); + emit sgl_hide(); +} diff --git a/source/customLineEdit.cpp b/source/customLineEdit.cpp new file mode 100644 index 0000000..3b527b5 --- /dev/null +++ b/source/customLineEdit.cpp @@ -0,0 +1,14 @@ +#include "customLineEdit.h" +#include + +CustomLineEdit::CustomLineEdit(QWidget* parent) + : QLineEdit(parent) +{} + +void CustomLineEdit::mousePressEvent(QMouseEvent* event) +{ + if(event->button() == Qt::LeftButton) + emit clicked(); + + QLineEdit::mousePressEvent(event); +} diff --git a/source/dashboardFrame.cpp b/source/dashboardFrame.cpp index e92aefb..232c8f4 100644 --- a/source/dashboardFrame.cpp +++ b/source/dashboardFrame.cpp @@ -43,8 +43,8 @@ DashboardFrame::DashboardFrame(const QString& strName, dashboardFrame::frameType m_type = fType; if(m_type == dashboardFrame::ft_secondary) //只有主window具有报警提示 { - ui->btnEventNotication->setVisible(false); - ui->btnAlarmNoticatio->setVisible(false); + ui->btnAllEvent->setVisible(false); + ui->btnAlarm->setVisible(false); } initializeGlobalVariable(); diff --git a/ui/alarmEventMainDialog.ui b/ui/alarmEventMainDialog.ui new file mode 100644 index 0000000..538ec51 --- /dev/null +++ b/ui/alarmEventMainDialog.ui @@ -0,0 +1,944 @@ + + + alarmEventMainDialog + + + + 0 + 0 + 1496 + 1006 + + + + Dialog + + + QDialog +{ +background-color:rgba(36,43,50,250); +} + +QPushButton +{ +color: rgb(250, 250, 250); +font: 700 10pt "微软雅黑"; +border:1px solid rgb(67,160,249); +border-radius:2px; +background-color:rgb(24,32,38); +} +QPushButton:hover +{ +background-color:rgb(8,11,13); +} +QPushButton:pressed +{ +background-color:rgb(24,32,38); +} + +QLabel +{ +font: 12pt "黑体"; +color: rgb(250, 250, 250); +} + +QLineEdit +{ +font: 12pt "黑体"; +color: rgb(250, 250, 250); +padding-left:10px; +border:1px solid rgb(200,200,200); +background-color: rgb(24, 32, 38); +} +QLineEdit:focus +{ +border:1px solid rgb(67,160,249); +} + +QComboBox +{ +font: 12pt "黑体"; +color: rgb(250, 250, 250); +padding-left:10px; +background-color: rgb(54, 62, 74); +border: 0px; +border-radius: 0px; +} +QComboBox:hover +{ +background-color: rgb(72, 83, 99); +} +QComboBox::drop-down +{ +border:0px; +} +QComboBox::down-arrow +{ +margin-right:10px; +width:14px; +border-image: url(:/images/down-arrow.png); +} +QComboBox QAbstractItemView +{ +outline: 0px; /*去除选中虚线框 */ +border:0px; +background-color:rgba(25,25,25,220); +} +QComboBox QAbstractItemView::item:hover +{ +background-color: rgb(43, 102, 158); +} +QComboBox QAbstractItemView::item:selected +{ +color: rgb(250, 250, 250); +background-color: rgba(43, 102, 158, 80); +} + + + + 5 + + + 30 + + + 7 + + + 7 + + + 5 + + + + + 0 + + + 0 + + + + + + 0 + 60 + + + + + 16777215 + 60 + + + + QWidget #topPanel +{ +border:1px solid rgb(67,160,249); +border-left:0px; +border-top:0px; +border-right:0px; +} + + + + + + 0 + + + + + color: rgb(250, 250, 250); +font: 700 18pt "微软雅黑"; + + + + 历史事件 + + + + + + + + 261 + 0 + + + + + 261 + 16777215 + + + + + + 40 + 10 + 101 + 31 + + + + QPushButton +{ +icon-size:20px; +icon: url(:/images/icon_checked.png); +} + + + 全部确认 + + + + + + 170 + 10 + 81 + 31 + + + + QPushButton +{ +icon-size:20px; +icon: url(:/images/icon_configuration.png); +} + + + 设置 + + + + + + + + + + + + 0 + 96 + + + + + 16777215 + 96 + + + + QWidget #dataFilteringPanel +{ + +} + + + + + + 35 + + + 8 + + + 10 + + + 8 + + + 10 + + + + + 3 + + + 5 + + + + + + 81 + 31 + + + + + 81 + 31 + + + + 厂站名称: + + + + + + + + 0 + 31 + + + + + 16777215 + 31 + + + + + 请选择 + + + + + + + + + 81 + 31 + + + + + 81 + 31 + + + + 间隔名称: + + + + + + + + 0 + 31 + + + + + 16777215 + 31 + + + + + 请选择 + + + + + + + + + + 3 + + + 5 + + + + + + 81 + 31 + + + + + 81 + 31 + + + + 告警类型: + + + + + + + + 0 + 31 + + + + + 16777215 + 31 + + + + + 请选择 + + + + + + + + + 81 + 31 + + + + + 81 + 31 + + + + 告警等级: + + + + + + + + 0 + 31 + + + + + 16777215 + 31 + + + + + 请选择 + + + + + + + + + + 3 + + + 5 + + + + + + 81 + 31 + + + + + 81 + 31 + + + + 确认状态: + + + + + + + + 0 + 31 + + + + + 16777215 + 31 + + + + + 请选择 + + + + + + + + + 81 + 31 + + + + + 81 + 31 + + + + 告警信息: + + + + + + + + 0 + 31 + + + + + 16777215 + 31 + + + + + + + + + + 3 + + + 5 + + + + + + 81 + 31 + + + + + 81 + 31 + + + + 最早时间: + + + + + + + + 0 + 31 + + + + + 16777215 + 31 + + + + 2025/09/16 10:06:12 + + + true + + + + + + + + 81 + 31 + + + + + 81 + 31 + + + + 最后时间: + + + + + + + + 0 + 31 + + + + + 16777215 + 31 + + + + 2025/09/16 10:07:12 + + + true + + + + + + + + + + + + QWidget #tableView +{ + background-color: rgba(54, 62, 74,100); +} + + + + + + + + 0 + 31 + + + + + 16777215 + 31 + + + + QPushButton +{ +border:1px solid rgb(100,100,100); +} +QPushButton:hover +{ +border:1px solid rgb(67,160,249); +} +QPushButton:pressed +{ +border:1px solid rgb(100,100,100); +} + + + + true + + + + 0 + 8 + 21 + 21 + + + + + 21 + 21 + + + + + 21 + 21 + + + + 第一页 + + + + + + + + + + :/images/icon_first.png:/images/icon_first.png + + + + 16 + 16 + + + + + + + 170 + 8 + 131 + 21 + + + + font: 11pt "黑体"; + + + 共100条记录 + + + Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter + + + + + true + + + + 30 + 8 + 21 + 21 + + + + + 21 + 21 + + + + + 21 + 21 + + + + 第一页 + + + + + + + + + + :/images/icon_previous.png:/images/icon_previous.png + + + + 16 + 16 + + + + + + true + + + + 105 + 8 + 21 + 21 + + + + + 21 + 21 + + + + + 21 + 21 + + + + 第一页 + + + + + + + + + + :/images/icon_next.png:/images/icon_next.png + + + + 16 + 16 + + + + + + true + + + + 135 + 8 + 21 + 21 + + + + + 21 + 21 + + + + + 21 + 21 + + + + 第一页 + + + + + + + + + + :/images/icon_last.png:/images/icon_last.png + + + + 16 + 16 + + + + + + + 60 + 9 + 36 + 20 + + + + font: 11pt "黑体"; +border:0px; +padding:0px; + + + 1 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + + + + + + 24 + 24 + + + + + 24 + 24 + + + + QPushButton +{ + background-color:transparent; + border-image: url(:/images/btn_close_default.png); +} +QPushButton:hover +{ + border-image: url(:/images/btn_close_hover.png); +} +QPushButton:pressed +{ + border-image: url(:/images/btn_close_default.png); +} + + + + + + true + + + + + + + Qt::Orientation::Vertical + + + + 20 + 40 + + + + + + + + + + + CustomLineEdit + QLineEdit +
customLineEdit.h
+
+
+ + + + +
diff --git a/ui/dashboardFrame.ui b/ui/dashboardFrame.ui index 6edfe32..62691fd 100644 --- a/ui/dashboardFrame.ui +++ b/ui/dashboardFrame.ui @@ -122,7 +122,7 @@ - + 165 @@ -141,23 +141,23 @@ font: 700 12pt "微软雅黑"; color:rgb(250,250,250); text-align:right; -padding-right:40px; -background-color: rgb(200, 68, 56); +padding-right:35px; +background-color: rgb(67,160,249); icon-size:20px; icon: url(:/images/icon_event.png); } QPushButton:hover { -background-color: rgb(166, 56, 46); +background-color: rgb(55,131,204); } QPushButton:pressed { -background-color: rgb(128, 43, 36); +background-color: rgb(67,160,249); } - 事件(0) + 事件查看 false @@ -208,7 +208,7 @@ background-color: rgb(39, 102, 59); - + 165 @@ -227,7 +227,7 @@ background-color: rgb(39, 102, 59); font: 700 12pt "微软雅黑"; color:rgb(250,250,250); text-align:right; -padding-right:20px; +padding-right:30px; background-color: rgb(200, 68, 56); icon-size:20px; icon: url(:/images/icon_alarm.png); @@ -243,7 +243,7 @@ background-color: rgb(128, 43, 36); - 报警(10+) + 报警(0条) @@ -562,7 +562,25 @@ QPushButton:pressed - + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + diff --git a/ui/dashboardNamingDialog.ui b/ui/dashboardNamingDialog.ui index 4c4d193..6752d84 100644 --- a/ui/dashboardNamingDialog.ui +++ b/ui/dashboardNamingDialog.ui @@ -146,7 +146,7 @@ border:1px solid rgb(67,160,249); { color: rgb(250, 250, 250); font: 700 12pt "微软雅黑"; -border:1px solid rgb(67,160,249); +border:1px solid rgb(200,200,200); border-radius:2px; background-color:rgb(24,32,38); }