From 956483cc94495d6b7e3778e6beb51a74ddd43b8b Mon Sep 17 00:00:00 2001 From: duanshengchao <519970194@qq.com> Date: Thu, 18 Sep 2025 15:50:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E6=8A=A5=E8=AD=A6?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=AE=9E=E7=8E=B0=E6=A1=86=E6=9E=B6=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 8 + include/alarmEventDataView.h | 21 + include/alarmEventGlobal.h | 24 + include/alarmEventMainDialog.h | 31 + include/customLineEdit.h | 26 + resource/PowerMaster.qrc | 9 + resource/images/icon_checked.png | Bin 0 -> 281 bytes resource/images/icon_first.png | Bin 0 -> 237 bytes resource/images/icon_last.png | Bin 0 -> 234 bytes resource/images/icon_next.png | Bin 0 -> 273 bytes resource/images/icon_previous.png | Bin 0 -> 267 bytes source/alarmEventDataView.cpp | 23 + source/alarmEventMainDialog.cpp | 26 + source/customLineEdit.cpp | 14 + source/dashboardFrame.cpp | 4 +- ui/alarmEventMainDialog.ui | 944 ++++++++++++++++++++++++++++++ ui/dashboardFrame.ui | 38 +- ui/dashboardNamingDialog.ui | 2 +- 18 files changed, 1157 insertions(+), 13 deletions(-) create mode 100644 include/alarmEventDataView.h create mode 100644 include/alarmEventGlobal.h create mode 100644 include/alarmEventMainDialog.h create mode 100644 include/customLineEdit.h create mode 100644 resource/images/icon_checked.png create mode 100644 resource/images/icon_first.png create mode 100644 resource/images/icon_last.png create mode 100644 resource/images/icon_next.png create mode 100644 resource/images/icon_previous.png create mode 100644 source/alarmEventDataView.cpp create mode 100644 source/alarmEventMainDialog.cpp create mode 100644 source/customLineEdit.cpp create mode 100644 ui/alarmEventMainDialog.ui 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 0000000000000000000000000000000000000000..914e9b6c90bd15039568f79525eca767207c9071 GIT binary patch literal 281 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-#c59$ z$B>FSZ>I$E9a0c*+1cWjzvP}vf42Rf>)umt9x=?mwM1#@>1pTv4!K9qIL;UCbR$Gr za3@0rW5U@E!*5DOVf>S-8LsOrm{@6Ev->H-ebm^K_fBz#)jQb_ zNPUiCsOR5uIlb0iZU^Urw`O`(q~6mmNoe7JHGUcxU!%6lHGG} z@06afa>)%{JqISuZHuHAT=FQ|=p&k3vzt+D?WzT$3x4f7_P^pB(-;3MoY`kwpQLD& c2TOcm^a?+|wBxK}2+&&$p00i_>zopr02KIeZ~y=R literal 0 HcmV?d00001 diff --git a/resource/images/icon_first.png b/resource/images/icon_first.png new file mode 100644 index 0000000000000000000000000000000000000000..788d07bc11f5b6180cf914bf93d0c80a39588fd2 GIT binary patch literal 237 zcmeAS@N?(olHy`uVBq!ia0vp^QXtI11|(N{`J4k%oCO|{#S9GG!XV7ZFl&wkP;kDd zi(^Q|oVQaQxegf!xE^P&;C&x-LHcTH{^j6^nBA{5nSRz!i+#}{=E$^kt6E{A+!-xq zeaSR6rPf0-4Chqd>h4+@6S~$T&O`2LFw;rnLo&v<%>#efzw^^NyHcr_H5%wt22WQ%mvv4FO#o%BRj~j7 literal 0 HcmV?d00001 diff --git a/resource/images/icon_last.png b/resource/images/icon_last.png new file mode 100644 index 0000000000000000000000000000000000000000..69c927b5b34af264a6ea960f94de0805120e2c03 GIT binary patch literal 234 zcmeAS@N?(olHy`uVBq!ia0vp^QXtI11|(N{`J4k%oCO|{#S9GG!XV7ZFl&wkP;ic? zi(^Q|oVQaAxtI(ETp#o9X;gTe~DWM4fACg)E literal 0 HcmV?d00001 diff --git a/resource/images/icon_next.png b/resource/images/icon_next.png new file mode 100644 index 0000000000000000000000000000000000000000..08399cd4549141f445863e2a6bc7598c469d8557 GIT binary patch literal 273 zcmeAS@N?(olHy`uVBq!ia0vp^QXtI11|(N{`J4k%oCO|{#S9GG!XV7ZFl&wkQ1Gy) zi(^Q|oVQbbxegf!xGfeBSiexcaP>X6qrK*<7F2Lv|H}7v_OVdbUJ-4Pg`O|^cbsUB zw4I^fa?)j`!va3Ro1G_APj9Lee$QJVF34=-l9Jma8S&@Y?do8Ym0|*n$=&uLwT~BU zikzcz^30?4^7pk?=$+al|>e>wsQzopr0AEjUCjbBd literal 0 HcmV?d00001 diff --git a/resource/images/icon_previous.png b/resource/images/icon_previous.png new file mode 100644 index 0000000000000000000000000000000000000000..da5d3eb6a9d8d660c3bed4b91eb8aa5dccd42cd6 GIT binary patch literal 267 zcmeAS@N?(olHy`uVBq!ia0vp^QXtI11|(N{`J4k%oCO|{#S9GG!XV7ZFl&wkP;jrO zi(^Q|oVQaAxtt6ITo!K?`!7%>eo=bm+~XU?KMI&tbxcS~^X85f6m^;O=jrOqGtFz+ z(mcvG7p@C>+0^0V@y=6k_lvbFvihGe9hkX<$-?zZrI)#&lfO!MJ0Ik6i7ES2qPF@izFLI}oME-tgAk zDZ}F8x{!e2C$GAAom2LF-274RU&31LW7YOQDp*BhSGn%*JXK%7y0_9j{=%B?wLp(B Nc)I$ztaD0e0sv7|W=jA7 literal 0 HcmV?d00001 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); }