|
@@ -12,13 +12,6 @@
|
|
|
|
|
|
#include <QDebug>
|
|
|
|
|
|
-int ProjectStateWidget::rowCount(ProjectInfo *proj)
|
|
|
-{
|
|
|
- int evalCount = ProjectManager::evalTypeList(ProjectManager::evalFlags(*proj)).count();
|
|
|
-
|
|
|
- return evalCount;
|
|
|
-}
|
|
|
-
|
|
|
ProjectStateWidget::ProjectStateWidget(QWidget *parent) : QWidget(parent)
|
|
|
{
|
|
|
initialize();
|
|
@@ -40,20 +33,22 @@ void ProjectStateWidget::showProjects(QList<ProjectInfo *> proList)
|
|
|
ProjectInfo *proj = proList[i];
|
|
|
QTableWidgetItem *item = new QTableWidgetItem(proj->projectName);
|
|
|
setItem(row, 0, item, color);
|
|
|
- int rowProj = rowCount(proj);
|
|
|
- if (rowProj > 1) {
|
|
|
- m_projTableWidget->setSpan(row, 0, rowProj, 1);
|
|
|
+
|
|
|
+ QList<ProjectManager::EvalType> typeList = ProjectManager::evalTypeList(*proj);
|
|
|
+
|
|
|
+ if (typeList.count() > 1) {
|
|
|
+ m_projTableWidget->setSpan(row, 0, typeList.count(), 1);
|
|
|
}
|
|
|
|
|
|
// 指标体系,第1列
|
|
|
- for (int j = 0; j < rowCount(proj); j++) {
|
|
|
- ProjectManager::EvalType indexType = ProjectManager::evalTypeList(ProjectManager::evalFlags(*proj))[j];
|
|
|
- QString indexName = ProjectManager::nameOfEvalType(indexType);
|
|
|
- QTableWidgetItem *item = new QTableWidgetItem(indexName);
|
|
|
- setItem(row, 1, item, color);
|
|
|
+ for (int j = 0; j < typeList.count(); j++) {
|
|
|
+ ProjectManager::EvalType indexType = typeList[j];
|
|
|
+ QString typeName = ProjectManager::nameOfEvalType(indexType);
|
|
|
+ QTableWidgetItem *item = new QTableWidgetItem(typeName);
|
|
|
+ setItem(row + j, 1, item, color);
|
|
|
}
|
|
|
|
|
|
- row += rowCount(proj);
|
|
|
+ row += typeList.count();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -67,7 +62,7 @@ void ProjectStateWidget::initialize()
|
|
|
m_projTableWidget->setSelectionMode(QAbstractItemView::NoSelection);
|
|
|
m_projTableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
|
|
m_projTableWidget->verticalHeader()->setVisible(false);
|
|
|
- const QStringList headers = { "工程名", "工程类型", "专家信息", "评估状态" };
|
|
|
+ const QStringList headers = { "项目名", "项目类型" };
|
|
|
m_projTableWidget->setColumnCount(headers.count());
|
|
|
m_projTableWidget->setHorizontalHeaderLabels(headers);
|
|
|
// m_projTableWidget->setAlternatingRowColors(true);
|
|
@@ -95,8 +90,7 @@ void ProjectStateWidget::setRowCount(QList<ProjectInfo *> list)
|
|
|
{
|
|
|
int count = 0;
|
|
|
for (ProjectInfo *proj : list) {
|
|
|
- int rowProj = rowCount(proj);
|
|
|
- count += rowProj;
|
|
|
+ count += ProjectManager::evalTypeList(*proj).count();
|
|
|
}
|
|
|
|
|
|
m_projTableWidget->setRowCount(count);
|