[ref]同步711

This commit is contained in:
shi_jq 2025-03-13 15:07:31 +08:00
parent 6ce9a4aa71
commit 6177da452c
12 changed files with 152 additions and 94 deletions

View File

@ -3,15 +3,20 @@
#include "QMessageBox"
#include <QDebug>
#include "dbms/db_sysinfo_api/CDbSysInfo.h"
#include "pub_widget/MessageBox.h"
QString CCheckUser::m_userName ="";
CCheckUser::CCheckUser(QWidget *parent) :
m_ptrPermMngApi(NULL),
QDialog(parent),
CustomUiDialog(parent),
m_pReadDb(Q_NULLPTR),
ui(new Ui::CCheckUser)
{
ui->setupUi(this);
init();
setResizeable(false);
CustomUiDialog::setAutoLayout(true);
}
CCheckUser::~CCheckUser()
@ -63,8 +68,8 @@ void CCheckUser::initVariable()
void CCheckUser::initVeiw()
{
ui->lineEdit_password->setEchoMode(QLineEdit::EchoMode::Password);
this->setFixedSize(204,150);
this->setWindowTitle(tr(""));
// this->setFixedSize(204,150);
this->setWindowTitle(tr(""));
}
void CCheckUser::initSignalSlot()
@ -100,8 +105,7 @@ void CCheckUser::slot_check()
m_userName = userName;
if(m_ptrPermMngApi->SysLogin(userName.toStdString(), password.toStdString(), usergId, 12*60*60, "hmi") != 0)
{
QMessageBox::about(this,"提示","登陆失败!");
reject();
N_MessageBox::about(this,"提示","登陆失败!");
return;
}
accept();

View File

@ -1,14 +1,15 @@
#ifndef CCHECKUSER_H
#define CCHECKUSER_H
#include <QDialog>
#include "perm_mng_api/PermMngApi.h"
#include "db_api_ex/CDbApi.h"
#include "pub_widget/CustomDialog.h"
namespace Ui {
class CCheckUser;
}
class CCheckUser : public QDialog
class CCheckUser : public CustomUiDialog
{
Q_OBJECT

View File

@ -13,70 +13,64 @@
<property name="windowTitle">
<string>Dialog</string>
</property>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>180</width>
<height>136</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>用户名</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBox_userg"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>密码</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="lineEdit_password"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>用户组</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBox_user"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="pushButton_ckeck">
<property name="text">
<string>验证</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_cancel">
<property name="text">
<string>取消</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>用户名</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBox_userg"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>密码</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="lineEdit_password"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>用户组</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBox_user"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="pushButton_ckeck">
<property name="text">
<string>验证</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_cancel">
<property name="text">
<string>取消</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>

View File

@ -5,7 +5,18 @@
#include "dbms/db_sysinfo_api/CDbSysInfo.h"
#include "perm_mng_api/PermMngApi.h"
//< 屏蔽xml_parser编译告警
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-copy"
#endif
#include "boost/property_tree/xml_parser.hpp"
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#include "boost/typeof/typeof.hpp"
#include "boost/filesystem.hpp"
#include "Common.h"

View File

@ -4,15 +4,19 @@
#include "public/pub_sysinfo_api/SysInfoApi.h"
CEventFilterDialog::CEventFilterDialog(QWidget *parent) :
QDialog(parent),
CustomUiDialog(parent),
ui(new Ui::CEventFilterDialog),
m_rtdbAccess(Q_NULLPTR)
{
setWindowTitle(tr("过滤条件"));
ui->setupUi(this);
setObjectName("event_dialog");
ui->subSystem->setView(new QListView());
ui->deviceType->setView(new QListView());
initialize();
setAutoLayout(true);
}
CEventFilterDialog::~CEventFilterDialog()

View File

@ -1,15 +1,15 @@
#ifndef CEVENTFILTERDIALOG_H
#define CEVENTFILTERDIALOG_H
#include <QDialog>
#include <QDateTime>
#include "dbms/rdb_api/CRdbAccess.h"
#include "pub_widget/CustomDialog.h"
namespace Ui {
class CEventFilterDialog;
}
class CEventFilterDialog : public QDialog
class CEventFilterDialog : public CustomUiDialog
{
Q_OBJECT

View File

@ -26,6 +26,9 @@
<string>过滤</string>
</property>
<layout class="QGridLayout" name="gridLayout_13">
<property name="topMargin">
<number>10</number>
</property>
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">

View File

@ -21,10 +21,12 @@
using namespace iot_public;
CEventForm::CEventForm(QWidget *parent) :
QWidget(parent),
CustomUiDialog(parent),
m_pHistoryModel(NULL),
ui(new Ui::CEventForm)
{
setWindowTitle(tr("事件管理工具"));
qRegisterMetaType<CEventMsgInfo>("CEventMsgInfo");
qRegisterMetaType<EventMsgPtr>("EventMsgPtr");
qRegisterMetaType<uint64>("uint64");
@ -47,8 +49,11 @@ CEventForm::CEventForm(QWidget *parent) :
m_pListWidget2 = new CMyListWidget(this);
m_pListWidget3 = new CMyListWidget(this);
m_pLineEdit1 = new QLineEdit(this);
m_pLineEdit1->setObjectName("priority");
m_pLineEdit2 = new QLineEdit(this);
m_pLineEdit2->setObjectName("location");
m_pLineEdit3 = new QLineEdit(this);
m_pLineEdit3->setObjectName("event_status");
initFilter();
slotUpdateModel();
ui->eventView->setColumnWidth(0, 250);
@ -88,6 +93,8 @@ CEventForm::CEventForm(QWidget *parent) :
connect(m_influxdbThread, &QThread::finished, m_influxdbOpt, &QObject::deleteLater, Qt::QueuedConnection);
connect(this, &CEventForm::delInfluxdbOneEvent, m_influxdbOpt, &CInfluxdbOpt::delInfluxdbOneEvent, Qt::QueuedConnection);
m_influxdbThread->start();
setAutoLayout(true);
}
CEventForm::~CEventForm()
@ -108,7 +115,7 @@ void CEventForm::initilize()
{
//< lingdaoyaoqiu
{
QSettings columFlags2("KBD_HIS_EVENT_DEL", "eventHis config");
QSettings columFlags2("IOT_HIS_EVENT_DEL", "eventHis config");
if(!columFlags2.contains(QString("eventHis/colum_0")))
{
columFlags2.setValue(QString("eventHis/colum_0"), false); //< 时间
@ -145,6 +152,7 @@ void CEventForm::initFilter()
m_strText1 = tr("请选择优先级");
m_pLineEdit1->setText(tr("请选择优先级"));
m_pLineEdit1->setReadOnly(true);
connect(m_pLineEdit1, SIGNAL(textChanged(const QString &)), this, SLOT(textChanged1(const QString &)));
for(QMap<int, QString>::iterator it2 = location.begin();it2 != location.end();++it2)
{
@ -336,7 +344,7 @@ void CEventForm::slotUpdateModel()
connect(m_pHistoryModel, &CEventHistoryModel::sigHISRecordOutOfRangeTips, this, &CEventForm::slotHISRecordOutOfRangeTips);
}
ui->eventView->setModel(m_pHistoryModel);
QSettings columFlags2("KBD_HIS_EVENT_DEL", "eventHis config");
QSettings columFlags2("IOT_HIS_EVENT_DEL", "eventHis config");
for(int nColumnIndex(0); nColumnIndex < m_pHistoryModel->columnCount(); nColumnIndex++)
{
bool visible = columFlags2.value(QString("eventHis/colum_%1").arg(nColumnIndex)).toBool();
@ -684,7 +692,7 @@ void CEventForm::contextMenuEvent(QContextMenuEvent *event)
action->setChecked(!ui->eventView->isColumnHidden(nColumnIndex));
connect(action, &QAction::triggered, [=](){
ui->eventView->setColumnHidden(nColumnIndex, !action->isChecked());
QSettings columFlags2("KBD_HIS_EVENT_DEL", "eventHis config");
QSettings columFlags2("IOT_HIS_EVENT_DEL", "eventHis config");
columFlags2.setValue(QString("eventHis/colum_%1").arg(nColumnIndex), !action->isChecked());
});
}

View File

@ -10,6 +10,8 @@
#include <QThread>
#include "CInfluxdbOpt.h"
#include "common/DataType.h"
#include "pub_widget/CustomDialog.h"
namespace Ui {
class CEventForm;
}
@ -21,7 +23,7 @@ class QAbstractTableModel;
typedef QList<QModelIndex> QModelIndexList;
class CEventForm : public QWidget
class CEventForm : public CustomUiDialog
{
Q_OBJECT

View File

@ -15,16 +15,16 @@
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="leftMargin">
<number>0</number>
<number>10</number>
</property>
<property name="topMargin">
<number>0</number>
<number>10</number>
</property>
<property name="rightMargin">
<number>0</number>
<number>10</number>
</property>
<property name="bottomMargin">
<number>0</number>
<number>10</number>
</property>
<property name="spacing">
<number>0</number>
@ -32,7 +32,7 @@
<item row="0" column="0">
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
@ -80,13 +80,13 @@
<widget class="QComboBox" name="comboBox_3">
<property name="minimumSize">
<size>
<width>120</width>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<width>180</width>
<height>26</height>
</size>
</property>
@ -173,13 +173,13 @@
<widget class="QLabel" name="label">
<property name="minimumSize">
<size>
<width>40</width>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>40</width>
<width>50</width>
<height>26</height>
</size>
</property>
@ -192,13 +192,13 @@
<widget class="QComboBox" name="comboBox">
<property name="minimumSize">
<size>
<width>100</width>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<width>150</width>
<height>26</height>
</size>
</property>
@ -208,13 +208,13 @@
<widget class="QComboBox" name="comboBox_2">
<property name="minimumSize">
<size>
<width>100</width>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<width>200</width>
<height>26</height>
</size>
</property>
@ -249,7 +249,7 @@
</property>
<property name="maximumSize">
<size>
<width>170</width>
<width>250</width>
<height>26</height>
</size>
</property>

View File

@ -42,7 +42,7 @@ FORMS += \
RESOURCES += \
resource.qrc
LIBS += -llog4cplus -lboost_system -lboost_chrono -lpub_utility_api -lrdb_api -ldb_base_api -ldb_api_ex -lperm_mng_api -lpub_sysinfo_api -ltsdb_api -ldb_his_query_api
LIBS += -llog4cplus -lboost_system -lboost_chrono -lpub_utility_api -lrdb_api -ldb_base_api -ldb_api_ex -lperm_mng_api -lpub_sysinfo_api -ltsdb_api -ldb_his_query_api -lpub_widget
include($$PWD/../../idl_files/idl_files.pri)

View File

@ -5,12 +5,43 @@
#include "CEventForm.h"
#include "CDbOpt.h"
#include "CCheckUser.h"
#include "pub_utility_api/FileStyle.h"
void loadStyle()
{
QString qss = QString();
std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("public.qss","zh","light");
QFile qssfile1(QString::fromStdString(strFullPath));
qssfile1.open(QFile::ReadOnly);
if (qssfile1.isOpen())
{
qss += QLatin1String(qssfile1.readAll());
qssfile1.close();
}
strFullPath = iot_public::CFileStyle::getPathOfStyleFile("his_event_del.qss","zh","light");
QFile qssfile2(QString::fromStdString(strFullPath));
qssfile2.open(QFile::ReadOnly);
if (qssfile2.isOpen())
{
qss += QLatin1String(qssfile2.readAll());
qssfile2.close();
}
if (!qss.isEmpty())
{
qApp->setStyleSheet(qss);
}
}
int main(int argc, char *argv[])
{
iot_common::doQtAppGlobalSet();
QApplication app(argc, argv);
loadStyle();
CCheckUser objCheckUser;
if(objCheckUser.exec())
{