|
@@ -10,6 +10,8 @@
|
|
|
#include <dbService/ClassSet.h>
|
|
|
#include <dbService/SchemeInfoService.h>
|
|
|
#include <dbService/SchemeProcessService.h>
|
|
|
+#include <dbService/MindWeightService.h>
|
|
|
+#include <dbService/MindScoreService.h>
|
|
|
|
|
|
#include <QLabel>
|
|
|
#include <QBoxLayout>
|
|
@@ -91,7 +93,7 @@ void EvalReportWidget::initWidgets()
|
|
|
m_indexCombo->setCurrentIndex(2);
|
|
|
connect(m_indexCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(slotSelectIndexPlotType(int)));
|
|
|
|
|
|
- plots = QStringList { "竖向柱状图" };
|
|
|
+ // plots = QStringList { "竖向柱状图" };
|
|
|
m_techCombo = new QComboBox(this);
|
|
|
m_techCombo->setFixedSize(QSize(150, 35));
|
|
|
m_techCombo->addItems(plots);
|
|
@@ -206,19 +208,28 @@ void EvalReportWidget::showIndexWeight()
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- /// 项目演示-方案优选-层级分析法
|
|
|
- QMap<int, QList<double>> optiCC;
|
|
|
- optiCC[2] = { 0.0399746, 0.08573655, 0.1867215, 0.517877, 0.1696905 };
|
|
|
- optiCC[3] = { 0.03164655, 0.00832805, 0.06787475, 0.0178618, 0.15171122,
|
|
|
- 0.03501028, 0.43156399, 0.08631301, 0.04242262, 0.12726788 };
|
|
|
+ MindWeightInfo info;
|
|
|
+ int indexType = m_indexType;
|
|
|
+ if (indexType == ProjectManager::TechIndex) {
|
|
|
+ indexType = ProjectManager::AbilityIndex;
|
|
|
+ }
|
|
|
+ bool ret = MindWeightService().queryWeightData(&info, m_proj->id, indexType);
|
|
|
+ if (ret == false) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- /// 项目演示-效能评估
|
|
|
- QMap<int, QList<double>> effi;
|
|
|
- effi[2] = { 0.280833, 0.584156, 0.13501 };
|
|
|
- effi[3] = { 0.07020825, 0.21062475, 0.48679647, 0.09735953, 0.10688289, 0.02812711 };
|
|
|
- effi[4] = { 0.05558152, 0.01462673, 0.12860136, 0.0567758, 0.02524748, 0.05098171, 0.31008254,
|
|
|
- 0.12573223, 0.01327194, 0.01461917, 0.01931854, 0.05014989, 0.06026197, 0.01258931,
|
|
|
- 0.0281506, 0.00588096, 0.01585843, 0.00331298, 0.00740806, 0.00154762 };
|
|
|
+ if (info.id < 0) {
|
|
|
+ qDebug() << __FUNCTION__ << __LINE__ << "未找到指标权重数据" << endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ QMap<QString, double> weightData;
|
|
|
+ QStringList weightList = info.weight.split(";");
|
|
|
+ for (QString keyValueStr : weightList) {
|
|
|
+ QStringList keyValue = keyValueStr.split(":");
|
|
|
+ if (keyValue.size() == 2) {
|
|
|
+ weightData[keyValue.first()] = keyValue.last().toDouble();
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
for (int i = 2; i <= levels; i++) {
|
|
|
QTableView *t = new QTableView();
|
|
@@ -240,14 +251,9 @@ void EvalReportWidget::showIndexWeight()
|
|
|
QStandardItem *vHeader = new QStandardItem(node.name);
|
|
|
model->setVerticalHeaderItem(j, vHeader);
|
|
|
|
|
|
- QStandardItem *item = new QStandardItem("0.5");
|
|
|
- if (m_proj->id == kDemoProjId1) {
|
|
|
- if (m_indexType == ProjectManager::OptimalIndex) {
|
|
|
- item->setText(QString("%1").arg(optiCC[i][j]));
|
|
|
- } else if (m_indexType == ProjectManager::EfficiencyIndex) {
|
|
|
- item->setText(QString("%1").arg(effi[i][j]));
|
|
|
- }
|
|
|
- }
|
|
|
+ QStandardItem *item = new QStandardItem();
|
|
|
+ item->setText(QString("%1").arg(weightData[node.name]));
|
|
|
+
|
|
|
item->setEditable(false);
|
|
|
model->setItem(j, 0, item);
|
|
|
}
|
|
@@ -295,18 +301,12 @@ void EvalReportWidget::showIndexWeightPlot()
|
|
|
} else {
|
|
|
|
|
|
QStringList tagList;
|
|
|
- QList<int> dataList;
|
|
|
+ QList<double> dataList;
|
|
|
QList<QColor> colorList;
|
|
|
|
|
|
- int sum = 0;
|
|
|
for (int i = 0; i < values.size(); i++) {
|
|
|
tagList.append("");
|
|
|
- int t = values[i].value * 100;
|
|
|
- if (i < values.size() - 1) {
|
|
|
- sum += t;
|
|
|
- } else {
|
|
|
- t = 100 - sum;
|
|
|
- }
|
|
|
+ double t = values[i].value;
|
|
|
dataList.append(t);
|
|
|
QColor color(20 + 200 / values.size() * i, 70 * (1.6 - i / values.size()), 150, 255);
|
|
|
colorList.append(color);
|
|
@@ -329,6 +329,21 @@ void EvalReportWidget::showTechScore()
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ MindScoreInfo info;
|
|
|
+ bool ret = MindScoreService().queryScoreData(&info, m_proj->id);
|
|
|
+ if (ret == false || info.id < 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ QMap<QString, QString> scoreData;
|
|
|
+ QStringList keyValueStringList = info.score.split(";");
|
|
|
+ for (QString keyValueString : keyValueStringList) {
|
|
|
+ QStringList keyValue = keyValueString.split(":");
|
|
|
+ if (keyValue.size() == 2) {
|
|
|
+ scoreData[keyValue.first()] = keyValue.last();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
QStandardItem *hHeader = new QStandardItem("得分");
|
|
|
model->setHorizontalHeaderItem(0, hHeader);
|
|
|
|
|
@@ -340,7 +355,8 @@ void EvalReportWidget::showTechScore()
|
|
|
QStandardItem *vHeader = new QStandardItem(node.name);
|
|
|
model->setVerticalHeaderItem(j, vHeader);
|
|
|
|
|
|
- QStandardItem *item = new QStandardItem("0.5");
|
|
|
+ QStandardItem *item = new QStandardItem();
|
|
|
+ item->setText(scoreData[node.name]);
|
|
|
|
|
|
item->setEditable(false);
|
|
|
model->setItem(j, 0, item);
|
|
@@ -352,6 +368,58 @@ void EvalReportWidget::showTechScore()
|
|
|
m_techPlot->updateData(values);
|
|
|
}
|
|
|
|
|
|
+void EvalReportWidget::showTechScorePlot()
|
|
|
+{
|
|
|
+ DataTableItemModel *model = (DataTableItemModel *)m_techTable->model();
|
|
|
+ if (model == nullptr) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ QVector<PlotView::Data> values;
|
|
|
+ for (int i = 0; i < model->rowCount(); i++) {
|
|
|
+ QStandardItem *header = model->verticalHeaderItem(i);
|
|
|
+ QStandardItem *item = model->item(i, 0);
|
|
|
+ PlotView::Data data { header->text(), item->text().toDouble() };
|
|
|
+ values.append(data);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (m_techPlot != nullptr) {
|
|
|
+ m_gridLayout->removeWidget(m_techPlot);
|
|
|
+ m_techPlot->deleteLater();
|
|
|
+ m_techPlot = nullptr;
|
|
|
+ }
|
|
|
+ if (m_techPie != nullptr) {
|
|
|
+ m_gridLayout->removeWidget(m_techPie);
|
|
|
+ m_techPie->deleteLater();
|
|
|
+ m_techPie = nullptr;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (m_techCombo->currentIndex() < 5) {
|
|
|
+ PlotView::PlotType type = (PlotView::PlotType)m_techCombo->currentIndex();
|
|
|
+ m_techPlot = new PlotView(type, values, "", this);
|
|
|
+ m_techPlot->setFixedSize(600, 600);
|
|
|
+ m_techPlot->plot();
|
|
|
+ m_gridLayout->addWidget(m_techPlot, 1, 1);
|
|
|
+ } else {
|
|
|
+
|
|
|
+ QStringList tagList;
|
|
|
+ QList<double> dataList;
|
|
|
+ QList<QColor> colorList;
|
|
|
+
|
|
|
+ for (int i = 0; i < values.size(); i++) {
|
|
|
+ tagList.append("");
|
|
|
+ double t = values[i].value;
|
|
|
+ dataList.append(t);
|
|
|
+ QColor color(20 + 200 / values.size() * i, 70 * (1.6 - i / values.size()), 150, 255);
|
|
|
+ colorList.append(color);
|
|
|
+ }
|
|
|
+
|
|
|
+ m_techPie = new CustomPieChart("", tagList, dataList, colorList);
|
|
|
+ m_techPie->setFixedSize(600, 600);
|
|
|
+ m_gridLayout->addWidget(m_techPie, 1, 1);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
void EvalReportWidget::showSchemeScore()
|
|
|
{
|
|
|
int levels = m_mind->levels();
|
|
@@ -376,13 +444,6 @@ void EvalReportWidget::showSchemeScore()
|
|
|
QStandardItem *hHeader = new QStandardItem("得分");
|
|
|
model->setHorizontalHeaderItem(0, hHeader);
|
|
|
|
|
|
- /// 项目演示-方案优选-层次加权法得分
|
|
|
- QList<double> scoreList = { 10.136319544500001, 11.961457030999998, 17.516247966, 11.692445301 };
|
|
|
- /// 项目演示-方案优选-集对分析法得分
|
|
|
- if (m_evalAlg == SchemePlanManager::SPA) {
|
|
|
- scoreList = { 0.889003, 0.662887, 0.951992, 0.565267 };
|
|
|
- }
|
|
|
-
|
|
|
for (int i = 0; i < schemeList.size(); i++) {
|
|
|
SchemaEval *scheme = schemeList[i];
|
|
|
QStandardItem *vHeader = new QStandardItem(scheme->name);
|
|
@@ -392,11 +453,6 @@ void EvalReportWidget::showSchemeScore()
|
|
|
item->setEditable(false);
|
|
|
PlotView::Data data { vHeader->text(), scheme->score };
|
|
|
|
|
|
- if (m_proj->id == kDemoProjId1 && m_indexType == ProjectManager::OptimalIndex) {
|
|
|
- item->setText(QString("%1").arg(scoreList[i]));
|
|
|
- data.value = scoreList[i];
|
|
|
- }
|
|
|
-
|
|
|
model->setItem(i, 0, item);
|
|
|
values.append(data);
|
|
|
}
|
|
@@ -406,9 +462,60 @@ void EvalReportWidget::showSchemeScore()
|
|
|
m_schemePlot->updateData(values);
|
|
|
}
|
|
|
|
|
|
-void EvalReportWidget::showEffiResult()
|
|
|
+void EvalReportWidget::showSchemeScorePlot()
|
|
|
{
|
|
|
+ DataTableItemModel *model = (DataTableItemModel *)m_schemeTable->model();
|
|
|
+ if (model == nullptr) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
+ QVector<PlotView::Data> values;
|
|
|
+ for (int i = 0; i < model->rowCount(); i++) {
|
|
|
+ QStandardItem *header = model->verticalHeaderItem(i);
|
|
|
+ QStandardItem *item = model->item(i, 0);
|
|
|
+ PlotView::Data data { header->text(), item->text().toDouble() };
|
|
|
+ values.append(data);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (m_schemePlot != nullptr) {
|
|
|
+ m_gridLayout->removeWidget(m_schemePlot);
|
|
|
+ m_schemePlot->deleteLater();
|
|
|
+ m_schemePlot = nullptr;
|
|
|
+ }
|
|
|
+ if (m_schemePie != nullptr) {
|
|
|
+ m_gridLayout->removeWidget(m_schemePie);
|
|
|
+ m_schemePie->deleteLater();
|
|
|
+ m_schemePie = nullptr;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (m_schemeCombo->currentIndex() < 5) {
|
|
|
+ PlotView::PlotType type = (PlotView::PlotType)m_schemeCombo->currentIndex();
|
|
|
+ m_schemePlot = new PlotView(type, values, "", this);
|
|
|
+ m_schemePlot->setFixedSize(600, 600);
|
|
|
+ m_schemePlot->plot();
|
|
|
+ m_gridLayout->addWidget(m_schemePlot, 3, 1);
|
|
|
+ } else {
|
|
|
+
|
|
|
+ QStringList tagList;
|
|
|
+ QList<double> dataList;
|
|
|
+ QList<QColor> colorList;
|
|
|
+
|
|
|
+ for (int i = 0; i < values.size(); i++) {
|
|
|
+ tagList.append("");
|
|
|
+ double t = values[i].value;
|
|
|
+ dataList.append(t);
|
|
|
+ QColor color(20 + 200 / values.size() * i, 70 * (1.6 - i / values.size()), 150, 255);
|
|
|
+ colorList.append(color);
|
|
|
+ }
|
|
|
+
|
|
|
+ m_schemePie = new CustomPieChart("", tagList, dataList, colorList);
|
|
|
+ m_schemePie->setFixedSize(600, 600);
|
|
|
+ m_gridLayout->addWidget(m_schemePie, 3, 1);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void EvalReportWidget::showEffiResult()
|
|
|
+{
|
|
|
m_EffiTab->clear();
|
|
|
|
|
|
QList<QString> tabList = { "建设前", "建设后" };
|
|
@@ -492,16 +599,16 @@ void EvalReportWidget::slotSelectIndexPlotType(int)
|
|
|
showIndexWeightPlot();
|
|
|
}
|
|
|
|
|
|
-void EvalReportWidget::slotSelectTechPlotType(int type)
|
|
|
+void EvalReportWidget::slotSelectTechPlotType(int)
|
|
|
{
|
|
|
- makePlotClear(m_techPlot);
|
|
|
- m_techPlot->updateType(PlotView::PlotType(type));
|
|
|
+ showTechScorePlot();
|
|
|
}
|
|
|
|
|
|
-void EvalReportWidget::slotSelectSchemePlotType(int type)
|
|
|
+void EvalReportWidget::slotSelectSchemePlotType(int)
|
|
|
{
|
|
|
- makePlotClear(m_schemePlot);
|
|
|
- m_schemePlot->updateType(PlotView::PlotType(type));
|
|
|
+ showSchemeScorePlot();
|
|
|
+ // makePlotClear(m_schemePlot);
|
|
|
+ // m_schemePlot->updateType(PlotView::PlotType(type));
|
|
|
}
|
|
|
|
|
|
void EvalReportWidget::slotIndexTabIndexChanged(int)
|