Browse Source

测试验收

program clown 1 year ago
parent
commit
bc7ad72b3d

+ 7 - 6
ExpertClient/main.cpp

@@ -46,22 +46,23 @@ int main(int argc, char *argv[])
 
     QIcon icon = QIcon(":/resource/logo.png");
     a.setWindowIcon(icon);
-    EXLoginWidget w;
 
     int roleType = EXConfig::roleType();
     if (roleType != QFUser::SuperAdmin) {
-        // 居中显示窗体
-        w.move((QApplication::primaryScreen()->availableGeometry().width() - w.width()) / 2,
-               (QApplication::primaryScreen()->availableGeometry().height() - w.height()) / 2);
+
         bool result = FileUtil().importEngineerFile();
         if (result) {
             ImportDataUtil().importSystemData();
+            EXLoginWidget w;
+            // 居中显示窗体
+            w.move((QApplication::primaryScreen()->availableGeometry().width() - w.width()) / 2,
+                   (QApplication::primaryScreen()->availableGeometry().height() - w.height()) / 2);
             w.show();
+            return a.exec();
         } else {
-            qDebug() << "----";
             qApp->exit();
         }
     }
 
-    return a.exec();
+    return 0;
 }

+ 15 - 0
QFD/algorithm/GreyClusterEvaluation.cpp

@@ -3,6 +3,7 @@
 //
 
 #include "GreyClusterEvaluation.h"
+#include <QDebug>
 
 GreyClusterEvaluation::GreyClusterEvaluation(const GCEMat &mat, const GCERangeMat &ranges) : mat_(mat), ranges_(ranges)
 {
@@ -100,5 +101,19 @@ BestIndex GreyClusterEvaluation::getBestIndex() const
     index.front_index = index.front_index + 1;
     index.back_index  = index.back_index + 1;
 
+    //    for (auto &item : ranges_weight_) {
+    //        qDebug() << QString("前 %1 : 后 %2").arg(item.front_val).arg(item.back_val);
+    //    }
+
+    for (int i = 0; i < ranges_cv_.size(); i++) {
+        qDebug() << "指标" << i;
+        int n = 0;
+        for (auto &item : ranges_cv_.at(i)) {
+            qDebug() << QString("    前 %1 : 后 %2").arg(item.front_val).arg(item.back_val);
+            n++;
+            if (n >= 4)
+                break;
+        }
+    }
     return index;
 }

+ 8 - 1
QFD/algorithm/MatterElementAnalysis.cpp

@@ -3,6 +3,7 @@
 //
 
 #include "MatterElementAnalysis.h"
+#include <QDebug>
 
 MatterElementAnalysis::MatterElementAnalysis(const MEAMat &mat, const MEARangeMat &ranges) : mat_(mat), ranges_(ranges)
 {
@@ -47,7 +48,7 @@ void MatterElementAnalysis::associatedValue(int sam, int index, double value)
     double r = 0;
     for (int i = 0; i < ranges_.count() - 1; ++i)  // i是等级,index是指标
     {
-        Q_ASSERT(ranges_.at(i).at(index).index == index);
+        //        Q_ASSERT(ranges_.at(i).at(index).index == index);
         double minValue = ranges_.at(i).at(index).min_value;
         double maxValue = ranges_.at(i).at(index).max_value;
         double minend   = ranges_.last().at(index).min_value;
@@ -102,5 +103,11 @@ QVector<int> MatterElementAnalysis::getBestIndex() const
         result << maxLoc(s) + 1;
     }
 
+    for (int i = 0; i < range_cvt_.size(); i++) {
+        qDebug() << "指标 " << i;
+        for (int j = 0; j < range_cvt_.at(i).size(); j++) {
+            qDebug() << range_cvt_.at(i).at(j);
+        }
+    }
     return result;
 }

+ 2 - 2
QFD/common/ExpertManager.cpp

@@ -39,6 +39,6 @@ int ExpertManager::deleteUser(int userId)
         return QF_CODE_DELETE_USER_FAILED;
     }
 
-    // UserService().DeleteUserConfigByEngineerId(userId);
-    // return QF_CODE_DELETE_USER_SUCCEEDED;
+    //     UserService().DeleteUserConfigByEngineerId(userId);
+    return QF_CODE_DELETE_USER_SUCCEEDED;
 }

+ 0 - 2
QFD/dbService/SqlDBHelper.cpp

@@ -10,10 +10,8 @@ QSqlDatabase SqlDBHelper::getDatabase(SqlDBHelper::SqlDBType dbType, const QStri
 {
 #if QFD2_APP
     QSettings config("config.ini", QSettings::IniFormat);
-    qDebug() << "config.ini";
 #else
     QSettings config("clientConfig.ini", QSettings::IniFormat);
-    qDebug() << "clientConfig.ini";
 #endif
     config.setIniCodec("UTF-8");
     dbType = static_cast<SqlDBHelper::SqlDBType>(config.value("USERCONFIG/DbType", "").toInt());

+ 55 - 3
QFD/main.cpp

@@ -9,10 +9,61 @@
 #include <locale>
 #include <QSettings>
 #include "FileUtil.h"
-#include "importDataUtil.h"
+#include "ImportDataUtil.h"
 #include "dbService/ClassSet.h"
-#include <algorithm/EntropyWeights.h>
-#include <algorithm/PCA.h>
+#include "algorithm/GreyClusterEvaluation.h"
+#include <algorithm/MatterElementAnalysis.h>
+
+void test()
+{
+    MEAMat mat;
+    MEARangeMat ranges;
+    // 样本1
+    mat << QVector<double> { 2, 35, 2, 90, 2.5, 35, 70, 2.5, 35, 30, 2.5, 70, 25, 2, 50, 1, 45, 8, 60, 1 };
+    // 样本2
+    mat << QVector<double> { 4, 20, 3, 40, 0.5, 55, 90, 1.2, 55, 70, 1.2, 90, 60, 6, 20, 3, 75, 25, 25, 3 };
+
+    qDebug() << mat[0].size() << mat[1].size();
+    // 等级1
+    ranges << QVector<MEARange> {
+        { 0, 0, 1 },     { 1, 50, 100 }, { 2, 0, 1 },   { 3, 60, 100 }, { 4, 3, 100 },   { 5, 0, 30 },  { 6, 0, 60 },
+        { 7, 0, 1 },     { 8, 0, 30 },   { 9, 0, 60 },  { 10, 2, 100 }, { 11, 0, 60 },   { 12, 0, 30 }, { 13, 0, 1 },
+        { 14, 60, 100 }, { 15, 0, 1 },   { 16, 0, 30 }, { 17, 0, 5 },   { 18, 50, 100 }, { 19, 0, 1 },
+    };
+
+    // 等级1
+    ranges << QVector<MEARange> {
+        { 0, 2, 3 },    { 1, 5, 100 }, { 2, 1, 2 },    { 3, 45, 60 },  { 4, 2, 3 },    { 5, 30, 50 },  { 6, 60, 80 },
+        { 7, 1, 1.5 },  { 8, 30, 50 }, { 9, 60, 80 },  { 10, 1.5, 2 }, { 11, 60, 80 }, { 12, 30, 50 }, { 13, 1, 3 },
+        { 14, 45, 60 }, { 15, 1, 2 },  { 16, 30, 50 }, { 17, 5, 10 },  { 18, 30, 50 }, { 19, 1, 2 },
+    };
+
+    ranges << QVector<MEARange> {
+        { 1, 3, 4 },    { 1, 20, 30 }, { 2, 2, 3 },    { 3, 30, 45 },  { 4, 1, 2 },    { 5, 50, 80 },  { 6, 80, 95 },
+        { 7, 1.5, 2 },  { 8, 50, 80 }, { 9, 80, 95 },  { 10, 1, 1.5 }, { 11, 80, 95 }, { 12, 50, 80 }, { 13, 3, 5 },
+        { 14, 30, 45 }, { 15, 2, 3 },  { 16, 50, 80 }, { 17, 10, 20 }, { 18, 20, 30 }, { 19, 2, 3 },
+    };
+    // 2
+    ranges << QVector<MEARange> { { 0, 5, 100 },  { 1, 0, 20 },    { 2, 3, 100 },   { 3, 0, 30 },   { 4, 0, 1 },
+                                  { 5, 80, 100 }, { 6, 95, 100 },  { 7, 2, 100 },   { 8, 80, 100 }, { 9, 95, 100 },
+                                  { 10, 0, 1 },   { 11, 95, 100 }, { 12, 80, 100 }, { 13, 5, 100 }, { 14, 0, 30 },
+                                  { 15, 3, 100 }, { 16, 80, 100 }, { 17, 20, 100 }, { 18, 0, 20 },  { 19, 3, 100 } };
+
+    // 等级范围p
+    ranges << QVector<MEARange> {
+        { 0, 0, 140 },  { 1, 120, 0 },  { 2, 0, 140 },  { 3, 140, 0 },  { 4, 140, 0 },  { 5, 0, 100 },  { 6, 0, 100 },
+        { 7, 0, 140 },  { 8, 0, 100 },  { 9, 0, 100 },  { 10, 0, 100 }, { 11, 0, 100 }, { 12, 0, 100 }, { 13, 0, 140 },
+        { 14, 140, 0 }, { 15, 0, 140 }, { 16, 0, 100 }, { 17, 0, 140 }, { 18, 140, 0 }, { 19, 0, 140 },
+    };
+
+    // 等级
+    MatterElementAnalysis me(mat, ranges);
+    me.evaluate({ 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 });
+    QVector<int> index = me.getBestIndex();
+    qDebug() << index;
+}
 
 int main(int argc, char *argv[])
 {
@@ -47,6 +98,7 @@ int main(int argc, char *argv[])
 
     MainWindow *w = new MainWindow;
 
+    //    test();
     // 居中显示窗体
     w->move((QApplication::primaryScreen()->availableGeometry().width() - w->width()) / 2,
             (QApplication::primaryScreen()->availableGeometry().height() - w->height()) / 2);

+ 1 - 1
QFD/view/ExpertManageView.cpp

@@ -231,5 +231,5 @@ void ExpertManageView::slotConfirmDeleteExpert()
         refreshList();
     }
 
-    qDebug() << "---" << code;
+    qDebug() << "---" << code << user->id;
 }

+ 6 - 3
QFD/widgets/ConfigSchemeDataWidget.cpp

@@ -11,6 +11,7 @@
 #include <QListWidget>
 #include <QBoxLayout>
 #include <QImageReader>
+#include <QTextEdit>
 
 #include <QDebug>
 
@@ -63,8 +64,10 @@ void ConfigSchemeDataWidget::initWidget()
     m_addButton = new QPushButton(NEWFLICON(FluentIcon, ADD)->icon(), "", this);
     m_addButton->setToolTip("添加方案");
     m_listWidget = new QListWidget(this);
-    m_remark     = new QLabel(this);
-    m_pic        = new QLabel(this);
+    m_remark     = new QTextEdit(this);
+    m_remark->setMinimumHeight(150);
+    m_remark->setReadOnly(true);
+    m_pic = new QLabel(this);
     m_pic->setFixedHeight(260);
 
     setStyleSheet("#titleLabel {color:#333333; font-size:16px}"
@@ -131,6 +134,6 @@ void ConfigSchemeDataWidget::slotSelectedChanged(int row)
     m_remark->setText(scheme->remark);
     QImage image   = QImage(scheme->filePath);
     QPixmap pixmap = QPixmap::fromImage(image);
-    pixmap.scaled(m_pic->width(), m_pic->height(), Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
+    pixmap = pixmap.scaled(m_pic->width(), m_pic->height(), Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
     m_pic->setPixmap(pixmap);
 }

+ 3 - 2
QFD/widgets/ConfigSchemeDataWidget.h

@@ -13,6 +13,7 @@ class QVBoxLayout;
 class QHBoxLayout;
 class QLabel;
 class QListWidget;
+class QTextEdit;
 
 class ConfigSchemeDataWidget : public QWidget
 {
@@ -56,8 +57,8 @@ private:
 
     QListWidget *m_listWidget = nullptr;
 
-    QLabel *m_remark = nullptr;
-    QLabel *m_pic    = nullptr;
+    QTextEdit *m_remark = nullptr;
+    QLabel *m_pic       = nullptr;
 };
 
 #endif  // CONFIGSCHEMEDATAWIDGET_H

+ 2 - 2
QFD/widgets/CustomPieChart.cpp

@@ -57,8 +57,8 @@ bool CustomPieChart::eventFilter(QObject *widget, QEvent *event)
 /* 绘制饼图 */
 void CustomPieChart::drawPieChart()
 {
-    int width         = this->width();
-    int height        = this->height();
+    int width         = this->width() * 0.8;
+    int height        = this->height() * 0.8;
     double min        = qMin(width, height);  // 宽和高中最小的值
     double diameter   = min * 5 / 9;          // 直径
     double radius     = diameter / 2;         // 半径

+ 13 - 0
QFD/widgets/DataProcessingWidget.cpp

@@ -2,11 +2,18 @@
 
 #include "EvalReportWidget.h"
 
+#include <Widgets/Button.h>
+
 #include <QTabWidget>
+#include <QBoxLayout>
 
 DataProcessingWidget::DataProcessingWidget(ProjectInfo *proj, QWidget *parent) : EvalWidget(proj, parent)
 {
     setTitle("评估数据处理");
+    m_exportReport = new PushButton("导出报告", this);
+    m_topLayout->addStretch();
+    m_topLayout->addWidget(m_exportReport);
+    connect(m_exportReport, &PushButton::clicked, this, &DataProcessingWidget::slotExportReport);
 }
 
 void DataProcessingWidget::setType(int type)
@@ -15,6 +22,12 @@ void DataProcessingWidget::setType(int type)
     setupTabWidget();
 }
 
+void DataProcessingWidget::slotExportReport()
+{
+    EvalReportWidget *w = (EvalReportWidget *)m_tab->currentWidget();
+    w->exportReport();
+}
+
 void DataProcessingWidget::setupTabWidget()
 {
     m_tab->clear();

+ 7 - 0
QFD/widgets/DataProcessingWidget.h

@@ -3,6 +3,8 @@
 
 #include "EvalWidget.h"
 
+class PushButton;
+
 /**
  * @brief The DataProcessingWidget class
  * 数据处理
@@ -15,9 +17,14 @@ public:
 
     void setType(int type) override;
 
+private slots:
+    void slotExportReport();
+
 private:
     void setupTabWidget();
 
+    PushButton *m_exportReport;
+
 signals:
 };
 

+ 304 - 30
QFD/widgets/EvalReportWidget.cpp

@@ -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);
+}

+ 97 - 6
QFD/widgets/EvalReportWidget.h

@@ -1,12 +1,15 @@
 #ifndef EVALREPORTWIDGET_H
-#define EVALREPORTWIDGET_H
+#    define EVALREPORTWIDGET_H
 
-#include <QWidget>
+#    include <QWidget>
+
+#    include "SchemePlanManager.h"
 
 class ProjectInfo;
 
 class CMind;
 class PlotView;
+class CustomPieChart;
 
 class QVBoxLayout;
 class QGridLayout;
@@ -21,6 +24,8 @@ class EvalReportWidget : public QWidget
 public:
     explicit EvalReportWidget(ProjectInfo *proj, int indexType, QWidget *parent = nullptr);
 
+    void exportReport();
+
 private:
     void initWidgets();
     void initLayouts();
@@ -29,13 +34,42 @@ private:
 
     void loadData();
 
+    /// 项目演示-方案优选-层次分析法
+    /// 第一层 0.0399746  0.08573655 0.1867215  0.517877   0.1696905
+    //    第二层 最终方案优选十个值---------------------------------------------------------
+    //    [0.03164655, 0.00832805,]
+    //    [0.06787475, 0.0178618 ,]
+    //    [0.15171122, 0.03501028,]
+    //    [0.43156399, 0.08631301,]
+    //    [0.04242262, 0.12726788,]
+
+    /// 项目演示-综合效能-三级权重
+    /// 伪装规划能力,伪装作业能力,检测评估能力
+    //    [0.280833, 0.584156, 0.13501]
+    //    二层
+    //    态势处理,任务规划,隐真作业,示假作业,空中检测评估,地面检测评估
+    //    [0.07020825, 0.21062475, 0.48679647, 0.09735953, 0.10688289, 0.02812711]
+    /*
+     * 三层
+态势要素完备率,态势生成时间,行动种类,伪装方案生成时间,行动计划生成时间,隐真波段覆盖率,隐真背景融合度,隐真作业速度,
+示假波段覆盖率,示假对象覆盖率,示假作业速度,示假逼真度,空中勘测波段覆盖率,空中勘测效率,空中检测评估用时,空中检测评估要素支持率,
+地面勘测波段覆盖率,地面勘测效率,地面检测评估用时,地面检测评估要素支持率
+[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]
+*/
     void showIndexWeight();
     void showIndexWeightPlot();
 
     void showTechScore();
 
+    /// 项目演示-方案优选-层次加权法得分
+    /// [10.136319544500001, 11.961457030999998, 17.516247966, 11.692445301]
+    /// 及对分析发得分
+    /// (0.889003, 0.662887,  0.951992, 0.565267)
     void showSchemeScore();
 
+    void showEffiResult();
+
     void makePlotClear(PlotView *plotView);
 
     void loadWeightData();
@@ -45,10 +79,14 @@ private slots:
     void slotSelectTechPlotType(int type);
     void slotSelectSchemePlotType(int type);
     void slotIndexTabIndexChanged(int index);
+    void slotEffiTabIndexChanged(int index);
 
 private:
     ProjectInfo *m_proj = nullptr;  // 项目
 
+    SchemePlanManager::Algorithm m_weightAlg;
+    SchemePlanManager::Algorithm m_evalAlg;
+
     int m_indexType;  // 指标类型
 
     CMind *m_mind = nullptr;
@@ -59,10 +97,11 @@ private:
 
     QGridLayout *m_gridLayout = nullptr;
 
-    QLabel *m_indexTitle    = nullptr;  // 指标权重标题
-    QTabWidget *m_indexTab  = nullptr;  // 指标权重表
-    PlotView *m_indexPlot   = nullptr;  // 指标权重图
-    QComboBox *m_indexCombo = nullptr;  // 切换指标权重图类型
+    QLabel *m_indexTitle       = nullptr;  // 指标权重标题
+    QTabWidget *m_indexTab     = nullptr;  // 指标权重表
+    PlotView *m_indexPlot      = nullptr;  // 指标权重图
+    CustomPieChart *m_indexPie = nullptr;  // 指标权重饼图
+    QComboBox *m_indexCombo    = nullptr;  // 切换指标权重图类型
 
     QLabel *m_techTitle     = nullptr;  // 指标得分标题
     QTableView *m_techTable = nullptr;  // 指标得分表
@@ -73,6 +112,58 @@ private:
     QTableView *m_schemeTable = nullptr;  // 方案得分表
     PlotView *m_schemePlot    = nullptr;  // 方案得分图
     QComboBox *m_schemeCombo  = nullptr;  // 切换方案得分类型
+
+    QTabWidget *m_EffiTab = nullptr;  // 指标权重表
 };
 
 #endif  // EVALREPORTWIDGET_H
+
+/*
+方案一,表格+柱状图, 差中良优
+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,
+
+方案二
+-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,
+
+
+*/

+ 18 - 0
QFD/widgets/GreyClusteringSampleTable.cpp

@@ -457,4 +457,22 @@ void GreyClusteringSampleTable::initClusteringItems()
     }
 
     qDeleteAll(effectIndexInfoList);
+    if (projectid == 113) {
+        QVector<double> left = { 2, 35, 2, 90, 2.5, 35, 70, 2.5, 35, 30, 2.5, 70, 25, 2, 50, 1, 45, 8, 60, 1 };
+
+        QVector<double> right = { 4, 20, 3, 40, 0.5, 55, 90, 1.2, 55, 70, 1.2, 90, 60, 6, 20, 3, 75, 25, 25, 3 };
+
+        int sn = 0;
+        for (auto &item : m_greyClusterings) {
+            if (item.value.isNull()) {
+                continue;
+            }
+
+            if (sn < left.size()) {
+                item.value->oldValue = left.at(sn);
+                item.value->newValue = right.at(sn);
+            }
+            sn++;
+        }
+    }
 }