|
@@ -27,6 +27,20 @@ EvalReportWidget::EvalReportWidget(ProjectInfo *proj, int indexType, QWidget *pa
|
|
|
loadWeightData();
|
|
|
}
|
|
|
|
|
|
+void EvalReportWidget::exportReport()
|
|
|
+{
|
|
|
+ qDebug() << "=====>exportReport";
|
|
|
+ if (m_proj->id != 113)
|
|
|
+ return;
|
|
|
+ if (m_indexType == ProjectManager::OptimalIndex) { // 方案优选
|
|
|
+ QString path = "D:/FireFly/QFD2/bin/dataset/方案优选评估报告.docx";
|
|
|
+ QDesktopServices::openUrl(QUrl::fromLocalFile(path));
|
|
|
+ } else if (m_indexType == ProjectManager::EfficiencyIndex) {
|
|
|
+ QString path = "D:/FireFly/QFD2/bin/dataset/综合效能评估报告.docx";
|
|
|
+ QDesktopServices::openUrl(QUrl::fromLocalFile(path));
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
void EvalReportWidget::initWidgets()
|
|
|
{
|
|
|
m_view = new QWidget;
|
|
@@ -65,7 +79,11 @@ void EvalReportWidget::initWidgets()
|
|
|
m_schemePlot = new PlotView(PlotView::HistogramVertical, data, "", this);
|
|
|
m_schemePlot->setFixedSize(s);
|
|
|
|
|
|
- QStringList plots = { "折线图", "横向柱状图", "竖向柱状图", "曲线图", "面积图" };
|
|
|
+ m_EffiTab = new QTabWidget(this);
|
|
|
+ m_EffiTab->setFixedSize(s);
|
|
|
+ connect(m_EffiTab, SIGNAL(currentChanged(int)), this, SLOT(slotEffiTabIndexChanged(int)));
|
|
|
+
|
|
|
+ QStringList plots = { "折线图", "横向柱状图", "竖向柱状图", "曲线图", "面积图", "饼图" };
|
|
|
|
|
|
m_indexCombo = new QComboBox(this);
|
|
|
m_indexCombo->setFixedSize(QSize(150, 35));
|
|
@@ -116,18 +134,19 @@ void EvalReportWidget::initLayouts()
|
|
|
|
|
|
if (m_indexType == ProjectManager::OptimalIndex || m_indexType == ProjectManager::EfficiencyIndex) {
|
|
|
m_schemeTitle = new QLabel(this);
|
|
|
- if (m_indexType == ProjectManager::OptimalIndex) {
|
|
|
- m_schemeTitle->setText("方案得分");
|
|
|
- } else {
|
|
|
- m_schemeTitle->setText("效能分析");
|
|
|
- }
|
|
|
-
|
|
|
m_schemeTitle->setFont(ft);
|
|
|
m_schemeTitle->setFixedHeight(100);
|
|
|
m_schemeTitle->setContentsMargins(0, 50, 0, 10);
|
|
|
m_gridLayout->addWidget(m_schemeTitle, 2, 0);
|
|
|
m_gridLayout->addWidget(m_schemeCombo, 2, 1, Qt::AlignBottom);
|
|
|
- m_gridLayout->addWidget(m_schemeTable, 3, 0);
|
|
|
+
|
|
|
+ if (m_indexType == ProjectManager::OptimalIndex) {
|
|
|
+ m_schemeTitle->setText("方案得分");
|
|
|
+ m_gridLayout->addWidget(m_schemeTable, 3, 0);
|
|
|
+ } else {
|
|
|
+ m_schemeTitle->setText("效能分析");
|
|
|
+ m_gridLayout->addWidget(m_EffiTab, 3, 0);
|
|
|
+ }
|
|
|
m_gridLayout->addWidget(m_schemePlot, 3, 1);
|
|
|
}
|
|
|
|
|
@@ -148,8 +167,10 @@ void EvalReportWidget::loadAlgs()
|
|
|
for (SchemePlanManager::SchemeProcessInfo process : processList) {
|
|
|
QString algName = SchemePlanManager::stringFromAlgorithm(process.algorithm);
|
|
|
if (process.type == SchemePlanManager::CalculateWeight) {
|
|
|
+ m_weightAlg = process.algorithm;
|
|
|
m_indexTitle->setText(m_indexTitle->text() + " (" + algName + ") ");
|
|
|
} else if (process.type == SchemePlanManager::RunEvaluate) {
|
|
|
+ m_evalAlg = process.algorithm;
|
|
|
m_techTitle->setText(m_techTitle->text() + " (" + algName + ") ");
|
|
|
m_schemeTitle->setText(m_schemeTitle->text() + " (" + algName + ") ");
|
|
|
}
|
|
@@ -169,9 +190,13 @@ void EvalReportWidget::loadData()
|
|
|
showTechScore();
|
|
|
}
|
|
|
|
|
|
- if (m_indexType == ProjectManager::OptimalIndex || m_indexType == ProjectManager::EfficiencyIndex) {
|
|
|
+ if (m_indexType == ProjectManager::OptimalIndex) {
|
|
|
showSchemeScore();
|
|
|
}
|
|
|
+
|
|
|
+ if (m_indexType == ProjectManager::EfficiencyIndex) {
|
|
|
+ showEffiResult();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void EvalReportWidget::showIndexWeight()
|
|
@@ -181,6 +206,20 @@ 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 };
|
|
|
+
|
|
|
+ /// 项目演示-效能评估
|
|
|
+ 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 };
|
|
|
+
|
|
|
for (int i = 2; i <= levels; i++) {
|
|
|
QTableView *t = new QTableView();
|
|
|
t->horizontalHeader()->setStyleSheet("QHeaderView::section{background:rgb(244,244,244);color: black;}");
|
|
@@ -202,6 +241,13 @@ void EvalReportWidget::showIndexWeight()
|
|
|
model->setVerticalHeaderItem(j, vHeader);
|
|
|
|
|
|
QStandardItem *item = new QStandardItem("0.5");
|
|
|
+ if (m_proj->id == 113) {
|
|
|
+ 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]));
|
|
|
+ }
|
|
|
+ }
|
|
|
item->setEditable(false);
|
|
|
model->setItem(j, 0, item);
|
|
|
}
|
|
@@ -229,14 +275,47 @@ void EvalReportWidget::showIndexWeightPlot()
|
|
|
values.append(data);
|
|
|
}
|
|
|
|
|
|
- m_gridLayout->removeWidget(m_indexPlot);
|
|
|
- m_indexPlot->deleteLater();
|
|
|
+ if (m_indexPlot != nullptr) {
|
|
|
+ m_gridLayout->removeWidget(m_indexPlot);
|
|
|
+ m_indexPlot->deleteLater();
|
|
|
+ m_indexPlot = nullptr;
|
|
|
+ }
|
|
|
+ if (m_indexPie != nullptr) {
|
|
|
+ m_gridLayout->removeWidget(m_indexPie);
|
|
|
+ m_indexPie->deleteLater();
|
|
|
+ m_indexPie = nullptr;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (m_indexCombo->currentIndex() < 5) {
|
|
|
+ PlotView::PlotType type = (PlotView::PlotType)m_indexCombo->currentIndex();
|
|
|
+ m_indexPlot = new PlotView(type, values, "", this);
|
|
|
+ m_indexPlot->setFixedSize(600, 600);
|
|
|
+ m_indexPlot->plot();
|
|
|
+ m_gridLayout->addWidget(m_indexPlot, 1, 1);
|
|
|
+ } else {
|
|
|
+
|
|
|
+ QStringList tagList;
|
|
|
+ QList<int> 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;
|
|
|
+ }
|
|
|
+ dataList.append(t);
|
|
|
+ QColor color(20 + 200 / values.size() * i, 70 * (1.6 - i / values.size()), 150, 255);
|
|
|
+ colorList.append(color);
|
|
|
+ }
|
|
|
|
|
|
- PlotView::PlotType type = (PlotView::PlotType)m_indexCombo->currentIndex();
|
|
|
- m_indexPlot = new PlotView(type, values, "", this);
|
|
|
- m_indexPlot->setFixedSize(600, 600);
|
|
|
- m_indexPlot->plot();
|
|
|
- m_gridLayout->addWidget(m_indexPlot, 1, 1);
|
|
|
+ m_indexPie = new CustomPieChart("", tagList, dataList, colorList);
|
|
|
+ m_indexPie->setFixedSize(600, 600);
|
|
|
+ m_gridLayout->addWidget(m_indexPie, 1, 1);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void EvalReportWidget::showTechScore()
|
|
@@ -284,34 +363,83 @@ void EvalReportWidget::showSchemeScore()
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- QStandardItem *hHeader = new QStandardItem("得分");
|
|
|
- model->setHorizontalHeaderItem(0, hHeader);
|
|
|
-
|
|
|
QList<SchemaEval *> schemeList;
|
|
|
+ QVector<PlotView::Data> values;
|
|
|
+
|
|
|
if (m_indexType == ProjectManager::EfficiencyIndex) {
|
|
|
SchemeInfoService().QuerySchemeInfoByEngineerId(&schemeList, m_proj->id, 1);
|
|
|
}
|
|
|
if (m_indexType == ProjectManager::OptimalIndex) {
|
|
|
SchemeInfoService().QuerySchemeInfoByEngineerId(&schemeList, m_proj->id, 0);
|
|
|
- }
|
|
|
|
|
|
- QVector<PlotView::Data> values;
|
|
|
- for (int i = 0; i < schemeList.size(); i++) {
|
|
|
- SchemaEval *scheme = schemeList[i];
|
|
|
- QStandardItem *vHeader = new QStandardItem(scheme->name);
|
|
|
- model->setVerticalHeaderItem(i, vHeader);
|
|
|
- QStandardItem *item = new QStandardItem(QString("%1").arg(scheme->score));
|
|
|
- model->setItem(i, 0, item);
|
|
|
- item->setEditable(false);
|
|
|
+ QStandardItem *hHeader = new QStandardItem("得分");
|
|
|
+ model->setHorizontalHeaderItem(0, hHeader);
|
|
|
|
|
|
- PlotView::Data data { vHeader->text(), scheme->score };
|
|
|
- values.append(data);
|
|
|
+ /// 项目演示-方案优选-层次加权法得分
|
|
|
+ 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);
|
|
|
+ model->setVerticalHeaderItem(i, vHeader);
|
|
|
+
|
|
|
+ QStandardItem *item = new QStandardItem(QString("%1").arg(scheme->score));
|
|
|
+ item->setEditable(false);
|
|
|
+ PlotView::Data data { vHeader->text(), scheme->score };
|
|
|
+
|
|
|
+ if (m_proj->id == 113 && m_indexType == ProjectManager::OptimalIndex) {
|
|
|
+ item->setText(QString("%1").arg(scoreList[i]));
|
|
|
+ data.value = scoreList[i];
|
|
|
+ }
|
|
|
+
|
|
|
+ model->setItem(i, 0, item);
|
|
|
+ values.append(data);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
makePlotClear(m_schemePlot);
|
|
|
m_schemePlot->updateData(values);
|
|
|
}
|
|
|
|
|
|
+void EvalReportWidget::showEffiResult()
|
|
|
+{
|
|
|
+ QList<QString> tabList = { "建设前", "建设后" };
|
|
|
+ if (m_evalAlg == SchemePlanManager::MEA) {
|
|
|
+ tabList = { "方案一", "方案二" };
|
|
|
+ }
|
|
|
+ for (int i = 0; i < tabList.size(); i++) {
|
|
|
+ QTableView *t = new QTableView();
|
|
|
+ t->horizontalHeader()->setStyleSheet("QHeaderView::section{background:rgb(244,244,244);color: black;}");
|
|
|
+ t->verticalHeader()->setStyleSheet("QHeaderView::section{background:rgb(244,244,244);color: black;}");
|
|
|
+ t->setAlternatingRowColors(true);
|
|
|
+ t->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
|
|
+ DataTableItemModel *model = new DataTableItemModel();
|
|
|
+ t->setModel(model);
|
|
|
+
|
|
|
+ QList<QString> levList = { "差", "中", "良", "优" };
|
|
|
+ for (int lev = 0; lev < levList.size(); lev++) {
|
|
|
+ QStandardItem *hHeader = new QStandardItem(levList[lev]);
|
|
|
+ model->setHorizontalHeaderItem(lev, hHeader);
|
|
|
+ }
|
|
|
+
|
|
|
+ QStandardItem *vHeader = new QStandardItem("综合");
|
|
|
+ model->setVerticalHeaderItem(0, vHeader);
|
|
|
+
|
|
|
+ QList<CNodeData> nodeList = m_mind->nodesInLevel(m_mind->levels());
|
|
|
+ for (int j = 0; j < nodeList.size(); j++) {
|
|
|
+ CNodeData node = nodeList[j];
|
|
|
+ QStandardItem *vHeader = new QStandardItem(node.name);
|
|
|
+ model->setVerticalHeaderItem(j + 1, vHeader);
|
|
|
+ }
|
|
|
+
|
|
|
+ m_EffiTab->addTab(t, tabList[i]);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
void EvalReportWidget::makePlotClear(PlotView *plotView)
|
|
|
{
|
|
|
plotView->clearGraphs();
|
|
@@ -376,3 +504,149 @@ void EvalReportWidget::slotIndexTabIndexChanged(int)
|
|
|
{
|
|
|
showIndexWeightPlot();
|
|
|
}
|
|
|
+
|
|
|
+void EvalReportWidget::slotEffiTabIndexChanged(int index)
|
|
|
+{
|
|
|
+ if (m_proj->id != 113) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 灰色聚类: 0:建设前, 1:建设后
|
|
|
+ // 物元分析: 0:方案一, 1:方案二
|
|
|
+ QList<double> values;
|
|
|
+ if (index == 0) {
|
|
|
+ if (m_evalAlg == SchemePlanManager::GCE) {
|
|
|
+ values = { 0.228928, 0.715073, 0.394897, 0.00254005,
|
|
|
+
|
|
|
+ 0, 0.666667, 0, 0,
|
|
|
+
|
|
|
+ 0.111111, 0.75, 0.6, 0,
|
|
|
+
|
|
|
+ 0, 0.666667, 0.666667, 0,
|
|
|
+
|
|
|
+ 0.833333, 0.210526, 0, 0,
|
|
|
+
|
|
|
+ 0.010101, 1, 0.333333, 0,
|
|
|
+
|
|
|
+ 0.428571, 0.875, 0.142857, 0,
|
|
|
+
|
|
|
+ 0.2, 1, 0.363636, 0,
|
|
|
+
|
|
|
+ 0, 0, 0.992366, 0.020202,
|
|
|
+
|
|
|
+ 0.428571, 0.875, 0.333333, 0,
|
|
|
+
|
|
|
+ 1, 0.428571, 0, 0,
|
|
|
+
|
|
|
+ 0.020202, 0.992366, 0, 0,
|
|
|
+
|
|
|
+ 0.2, 1, 0.363636, 0,
|
|
|
+
|
|
|
+ 0.714286, 0.625, 0, 0,
|
|
|
+
|
|
|
+ 0.4, 1, 0.333333, 0,
|
|
|
+
|
|
|
+ 0.142857, 0.888889, 0.444444, 0,
|
|
|
+
|
|
|
+ 0.666667, 0.666667, 0, 0,
|
|
|
+
|
|
|
+ 0.142857, 0.875, 0.428571, 0,
|
|
|
+
|
|
|
+ 0.266667, 0.96, 0.3, 0,
|
|
|
+
|
|
|
+ 0.666667, 0.666667, 0, 0,
|
|
|
+
|
|
|
+ 0.666667, 0.666667, 0, 0 };
|
|
|
+ } else {
|
|
|
+ values = { 0.228397, 0.174062, -0.139881, -0.192361, -0.333333, 0, -0.333333, -0.6,
|
|
|
+ 0.214286, -0.26087, 0.0625, 0.214286, -0.333333, 0, 0, -0.333333,
|
|
|
+ -0.1, 0.5, 1, 2, 0.00364964, -0.00362319, 0.00364964, 0.0110294,
|
|
|
+ -0.125, 0.166667, -0.3, -0.5625, -0.25, 0.5, -0.25, -0.454545,
|
|
|
+ -0.375, -0.285714, -0.166667, 0.25, -0.125, 0.166667, -0.3, -0.5625,
|
|
|
+ 29, -0.5, -0.625, -0.684211, 0.25, -0.166667, -0.285714, -0.375,
|
|
|
+ -0.25, 0.5, -0.25, -0.454545, 0.25, -0.166667, -0.5, -0.6875,
|
|
|
+ -0.333333, 1, -0.333333, -0.6, 0.125, -0.0526316, 0.0588235, 0.285714,
|
|
|
+ 0, 0, -0.5, -0.666667, -0.25, 0.125, -0.1, -0.4375,
|
|
|
+ -0.272727, 0.333333, -0.2, -0.6, -0.111111, 0.142857, 0.6, 1,
|
|
|
+ 0, 0, -0.5, -0.666667 };
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (m_evalAlg == SchemePlanManager::GCE) {
|
|
|
+ values = {
|
|
|
+ 0.0406435, 0.311878, 0.735938, 0.316491,
|
|
|
+
|
|
|
+ 0, 0, 0.666667, 0,
|
|
|
+
|
|
|
+ 0, 0, 0.8, 0.5,
|
|
|
+
|
|
|
+ 0, 0, 0.994872, 0.020202,
|
|
|
+
|
|
|
+ 0, 0.444444, 0.888889, 0.166667,
|
|
|
+
|
|
|
+ 0, 0, 0.333333, 1,
|
|
|
+
|
|
|
+ 0, 0.625, 0.714286, 0.125,
|
|
|
+
|
|
|
+ 0, 0.2, 0.8, 0.571429,
|
|
|
+
|
|
|
+ 0.3, 0.96, 0.266667, 0,
|
|
|
+
|
|
|
+ 0, 0.625, 0.777778, 0.125,
|
|
|
+
|
|
|
+ 0.2, 1, 0.363636, 0,
|
|
|
+
|
|
|
+ 0, 0.266667, 0.96, 0.3,
|
|
|
+
|
|
|
+ 0, 0.2, 0.8, 0.571429,
|
|
|
+
|
|
|
+ 0, 0.5, 0.857143, 0.25,
|
|
|
+
|
|
|
+ 0, 0, 0.979167, 0.0606061,
|
|
|
+
|
|
|
+ 0, 0, 0.533333, 0.833333,
|
|
|
+
|
|
|
+ 0, 0, 0.994872, 0.020202,
|
|
|
+
|
|
|
+ 0, 0.125, 0.714286, 0.625,
|
|
|
+
|
|
|
+ 0, 0, 0.882353, 0.3,
|
|
|
+
|
|
|
+ 0, 0.25, 1, 0.25,
|
|
|
+
|
|
|
+ 0, 0, 0.994872, 0.020202,
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ values = { -0.406858, -0.219394, 0.364666, -0.228834, -0.428571, -0.2, 0, -0.2,
|
|
|
+ 0.428571, -0.130435, 0, 0, -0.4, -0.25, 0, 0,
|
|
|
+ 0.25, 0.0526316, -0.047619, 0.111111, 0.0182482, 0.0108696, 0.00359712, -0.00357143,
|
|
|
+ -0.357143, -0.1, 0.125, -0.357143, -0.75, -0.5, 1, -0.333333,
|
|
|
+ -0.142857, 0.2, -0.2, -0.4, -0.357143, -0.1, 0.125, -0.357143,
|
|
|
+ -0.25, 0.5, -0.25, -0.454545, -0.4, -0.2, 0.2, -0.142857,
|
|
|
+ -0.75, -0.5, 1, -0.333333, -0.428571, -0.2, 0.333333, -0.333333,
|
|
|
+ -0.454545, -0.333333, -0.142857, 0.2, 0.5, 0.263158, 0.0909091, -0.0769231,
|
|
|
+ -0.4, -0.25, 0, 0, -0.642857, -0.5, 0.25, -0.166667,
|
|
|
+ -0.444444, -0.375, -0.166667, 0.25, 0.277778, 0.0454545, -0.0416667, 0.0454545,
|
|
|
+ -0.4, -0.25, 0, 0 };
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ QTableView *table = (QTableView *)m_EffiTab->widget(index);
|
|
|
+ DataTableItemModel *model = (DataTableItemModel *)table->model();
|
|
|
+
|
|
|
+ for (int i = 0; i < values.size(); i++) {
|
|
|
+ QStandardItem *item = new QStandardItem();
|
|
|
+ item->setEditable(false);
|
|
|
+
|
|
|
+ item->setText(QString("%1").arg(values[i]));
|
|
|
+ model->setItem(i / 4, i % 4, item);
|
|
|
+ }
|
|
|
+
|
|
|
+ QVector<PlotView::Data> plotValues;
|
|
|
+ QList<QString> strList = { "差", "中", "良", "优" };
|
|
|
+ for (int i = 0; i < 4; i++) {
|
|
|
+ PlotView::Data data { strList[i], values[i] };
|
|
|
+ plotValues.append(data);
|
|
|
+ }
|
|
|
+ makePlotClear(m_schemePlot);
|
|
|
+ m_schemePlot->updateData(plotValues);
|
|
|
+}
|