mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
[WEB]1.修改首页场站图标显示颜色不正确的问题,2.修改运行监控页面储能系统的运行模式和预制舱参数在页面切换时数据不显示问题
This commit is contained in:
@@ -38,24 +38,13 @@ QWMonitor::QWMonitor(QWidget* parent) : MyWidget(parent)
|
||||
});
|
||||
}
|
||||
|
||||
table = std::make_shared<QTableWidget>(this);
|
||||
table->setGeometry(10, y += 50, 700, 800);
|
||||
table->setStyleSheet(QSS_TABLE.c_str());
|
||||
table->horizontalHeader()->setStretchLastSection(true); // 最后一列占满
|
||||
table->verticalHeader()->setVisible(false); // 不显示垂直表头
|
||||
table->setEditTriggers(QAbstractItemView::NoEditTriggers); // 单元格不可编辑
|
||||
table->setSelectionMode(QAbstractItemView::SingleSelection); // 设置为单选模式
|
||||
table->setSelectionBehavior(QAbstractItemView::SelectRows); // 设置为整行选中
|
||||
table->horizontalHeader()->setFixedHeight(50);
|
||||
table->horizontalHeader()->setDefaultSectionSize(60);
|
||||
|
||||
QTableWidgetItem* headerItem;
|
||||
QStringList headerText_Row, headerText_Col;
|
||||
headerText_Row << "ID" << "类型ID" << "类型名称" << "设备名称" << "编号" << "状态" << "通讯\n状态" << "工作\n状态" << "故障\n状态";
|
||||
QStringList headerTextList;
|
||||
headerTextList << "ID" << "类型ID" << "类型名称" << "设备名称" << "编号" << "状态" << "通讯\n状态" << "工作\n状态" << "故障\n状态";
|
||||
|
||||
table = MyQUI::TableWidget(this, 10, y += 50, 700, 800);
|
||||
// 设置为水平表头
|
||||
table->setColumnCount(headerText_Row.size());
|
||||
table->setHorizontalHeaderLabels(headerText_Row);
|
||||
table->setColumnCount(headerTextList.size());
|
||||
table->setHorizontalHeaderLabels(headerTextList);
|
||||
table->setColumnWidth(0, 50);
|
||||
table->setColumnWidth(1, 60);
|
||||
table->setColumnWidth(2, 120);
|
||||
@@ -163,7 +152,8 @@ void QWMonitor::onCurrentCellChanged(int row, int col, int oldRow, int oldCol)
|
||||
curDevice = station->getDevice(deviceId);
|
||||
if (curDevice)
|
||||
{
|
||||
string info = curDevice->name;
|
||||
string info = curDevice->name + " ";
|
||||
info += (curDevice->ts > 0) ? Utils::timeStr(curDevice->ts) : "--";
|
||||
labDeviceInfo->setText(info.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user