Explorar el Código

调大默认字体;
增加选取指标功能(可以将节点设为无效);
调整指标体系页面右键菜单;
指标属性增加成本效益型;
修改编辑节点视图;
方案数据操作接口;

chengxr hace 1 año
padre
commit
fee413924f

+ 15 - 0
QFD/CCanvas/CMind.cpp

@@ -142,6 +142,21 @@ bool CMind::hasAncestor(int childNumber, int ancestorNumber) const
     return false;
 }
 
+bool CMind::isInvalidated(int number) const
+{
+    CNodeData c = node(number);
+
+    if (c.isEffective) {
+        return true;
+    }
+
+    if (c.hasParent()) {
+        return isInvalidated(c.pNumber);
+    }
+
+    return false;
+}
+
 QList<int> CMind::numberList() const
 {
     QList<int> l;

+ 5 - 0
QFD/CCanvas/CMind.h

@@ -37,6 +37,11 @@ public:
 
     bool hasAncestor(int childNumber, int ancestorNumber) const;
 
+    /// 节点是否被设置为无效
+    /// 节点被设置为无效时, 其后代节点也被视为无效
+    ///
+    bool isInvalidated(int number) const;
+
     // 最大的节点编号, 创建节点时, 编号递增
     int maxNumber() const;
     // 最小的节点编号, 由于创建节点时编号递增, 所以此为根节点

+ 2 - 0
QFD/CCanvas/CMindView.cpp

@@ -180,6 +180,8 @@ void CMindView::refreshNodeGeometry(CNodeItem *node, QPointF topLeft)
         subNode->lineItem()->setStartPos(node->rectItem()->centerRight());
         subNode->lineItem()->setEndPos(subNode->rectItem()->centerLeft());
     }
+
+    node->rectItem()->setHighlighted(m_mind->isInvalidated(node->data().number));
 }
 
 void CMindView::mousePressEvent(QMouseEvent *event)

+ 2 - 2
QFD/CCanvas/CNode.h

@@ -7,14 +7,14 @@ struct CNodeData
 {
     int id         = -1;  // 节点 id, 对应数据库节点表中的 id, 数据库自动生成
     int projectId  = -1;  // 项目 id, 对应数据库项目表中的 id, 为脑图所属项目, 数据库自动生成
-    int indexType  = 0;   // 指标类型
+    int indexType  = 0;   // 指标体系类型: 能力重要度/技术重要度/方案优选/综合效能
     int number     = -1;  // 节点编号, 作用域为当前脑图, 0 为根节点
     int pNumber    = -1;  // 父节点编号
     QString name   = "新节点";  // 名称
     QString remark = "";        // 备注
     QString dimension = "";     //量纲
     int type          = 0;      //指标类型0效益型1成本型
-    int isEffective   = 1;      //是否有效1有效0无
+    int isEffective   = 0;      //是否有效, 0:有效, 1:无效, 默认有
 
     CNodeData(int projId = -1, int indexType = 0, int number = -1, int pNumber = -1, int id = -1);
 

+ 6 - 2
QFD/CCanvas/CNodeItem.cpp

@@ -253,8 +253,12 @@ qreal CNodeItem::textHeight() const
 
 qreal CNodeItem::borderWidth() const
 {
-    return 150;
-    return std::max(textWidth() + m_xMargin * 2, m_minWidth);
+    return m_minWidth;
+    QFont font = m_textItem->font();
+    QFontMetrics fm(font);
+    int w = fm.width(m_textItem->toPlainText());
+
+    return std::max(w + m_xMargin * 2, m_minWidth);
 }
 
 qreal CNodeItem::borderHeight() const

+ 2 - 2
QFD/CCanvas/CNodeItem.h

@@ -122,8 +122,8 @@ private:
     qreal m_xMargin = 10;
     qreal m_yMargin = 5;
 
-    qreal m_minWidth  = 150;
-    qreal m_maxWidth  = 200;
+    qreal m_minWidth  = 200;
+    qreal m_maxWidth  = 300;
     qreal m_minHeight = 30;
 
     qreal m_hNodeSpace = 80;

+ 1 - 1
QFD/CCanvas/CPathItem.h

@@ -35,7 +35,7 @@ protected:
     int m_lineWidth = 1;
 
     QColor m_normalLineColor    = Qt::gray;
-    QColor m_highlightLineColor = Qt::blue;
+    QColor m_highlightLineColor = Qt::gray;
 
     QColor m_normalFillColor    = Qt::white;
     QColor m_highlightFillColor = Qt::lightGray;

+ 1 - 1
QFD/CCanvas/CRectItem.cpp

@@ -24,7 +24,7 @@ CRectItem::CRectItem(const QRectF &rect, QGraphicsItem *parent) : CPathItem(pare
 
     m_menu->addAction(m_edit);
     m_menu->addAction(m_subNode);
-    m_menu->addAction(m_select);
+    //    m_menu->addAction(m_select);
     m_menu->addAction(m_remove);
 }
 

+ 3 - 1
QFD/common/SchemePlanManager.h

@@ -77,10 +77,12 @@ public:
 
     enum IndexCostType
     {
-        IndexCostTypeCost,     // 成本型
         IndexCostTypeBenefit,  // 效益型
+        IndexCostTypeCost,     // 成本型
     };
 
+    Q_ENUM(IndexCostType)
+
     static QString stringFromIndexCostType(IndexCostType t);
 
     /**

+ 31 - 0
QFD/dbService/SchemeInfoService.cpp

@@ -86,4 +86,35 @@ bool SchemeInfoService::UpdateValueStrById(int id, QString valueStr)
     }
     return ret;
 }
+
+bool SchemeInfoService::addScheme(const SchemaEval &scheme)
+{
+    bool ret = false;
+    try {
+        Transaction t(SqlDBHelper::getDatabase());
+        InsertQuery q = t.insertInto("t_scheme_info (project_id,name,remark,value_str,score,file_path,type)");
+        q.values(scheme.engineerId, scheme.name, scheme.remark, scheme.valueStr, scheme.score, scheme.filePath,
+                 scheme.type)
+                .exec();
+        t.commit();
+        ret = true;
+    } catch (const DBException &ex) {
+        qDebug() << ex.lastError.text();
+    }
+    return ret;
+}
+
+bool SchemeInfoService::updateSchemeScore(const int &id, const double &score)
+{
+    bool ret = false;
+    try {
+        Transaction t(SqlDBHelper::getDatabase());
+        t.update("t_scheme_info").set("score", score).where("id = ?", id);
+        t.commit();
+        ret = true;
+    } catch (const DBException &ex) {
+        qDebug() << ex.lastError.text();
+    }
+    return ret;
+}
 ///////////////////////common-end/////////////////////

+ 3 - 0
QFD/dbService/SchemeInfoService.h

@@ -11,6 +11,9 @@ public:
     bool DeleteSchemeByEngineerId(int engineerId);
     bool QuerySchemeInfoByEngineerId(QList<SchemaEval *> *schemeList, int engineerId, int type);
     bool UpdateValueStrById(int id, QString valueStr);
+
+    bool addScheme(const SchemaEval &scheme);
+    bool updateSchemeScore(const int &id, const double &score);
 };
 
 #endif  // SCHEMEINFOSERVICE_H

+ 4 - 0
QFD/main.cpp

@@ -123,6 +123,10 @@ int main(int argc, char *argv[])
     }
     // w.show();
 
+    QFont font;
+    font.setPointSize(14);
+    a.setFont(font);
+
     int ret = a.exec();
     delete w;
     return ret;

+ 49 - 9
QFD/widgets/EditNodeWidget.cpp

@@ -1,11 +1,17 @@
 #include "EditNodeWidget.h"
 
+#include "SchemePlanManager.h"
+
 #include <Widgets/LineEdit.h>
 #include <Widgets/Button.h>
+#include <Widgets/CheckBox.h>
 
 #include <QLabel>
 #include <QBoxLayout>
 #include <QGridLayout>
+#include <QComboBox>
+#include <QCheckBox>
+#include <QMetaEnum>
 
 #include <QDebug>
 
@@ -24,10 +30,13 @@ CNodeData EditNodeWidget::node() const
 
 void EditNodeWidget::setNode(CNodeData n)
 {
+    qDebug() << __FUNCTION__ << __LINE__ << n.type << n.isEffective << endl;
     m_node = n;
     m_name->setText(n.name);
     m_remark->setText(n.remark);
     m_dimen->setText(n.dimension);
+    m_costComboBox->setCurrentIndex(n.type);
+    m_validCheckBox->setChecked(!n.isEffective);
     m_confirm->setEnabled(false);
 }
 
@@ -40,7 +49,7 @@ void EditNodeWidget::initWindow()
     setModal(true);
     setWindowFlags(Qt::Dialog);
     setWindowFlag(Qt::WindowContextHelpButtonHint, false);
-    setFixedSize(350, 250);
+    setFixedSize(400, 350);
 }
 
 void EditNodeWidget::initWidgets()
@@ -49,11 +58,17 @@ void EditNodeWidget::initWidgets()
     m_name        = new LineEdit(this);
     m_remarkLabel = new QLabel("内涵:", this);
     m_remarkLabel->setContentsMargins(0, 10, 0, 10);
-    m_remark     = new TextEdit(this);
-    m_dimen      = new LineEdit(this);
-    m_dimenLabel = new QLabel("量纲:", this);
-    m_confirm    = new PushButton("保存", this);
-    m_cancel     = new PushButton("取消", this);
+    m_remark       = new TextEdit(this);
+    m_dimen        = new LineEdit(this);
+    m_dimenLabel   = new QLabel("量纲:", this);
+    m_costLabel    = new QLabel("类型:", this);
+    m_costComboBox = new QComboBox(this);
+    setUpCostTypes();
+    m_validLabel    = new QLabel("生效:", this);
+    m_validCheckBox = new CheckBox("", this);
+    m_validCheckBox->setChecked(true);
+    m_confirm = new PushButton("保存", this);
+    m_cancel  = new PushButton("取消", this);
 }
 
 void EditNodeWidget::initLayout()
@@ -77,6 +92,10 @@ void EditNodeWidget::initLayout()
     m_gridLayout->addWidget(m_remark, 1, 1, 1, 1, Qt::AlignLeft);
     m_gridLayout->addWidget(m_dimenLabel, 2, 0, 1, 1, Qt::AlignRight);
     m_gridLayout->addWidget(m_dimen, 2, 1, 1, 1, Qt::AlignLeft);
+    m_gridLayout->addWidget(m_costLabel, 3, 0, 1, 1, Qt::AlignRight);
+    m_gridLayout->addWidget(m_costComboBox, 3, 1, 1, 1, Qt::AlignLeft);
+    m_gridLayout->addWidget(m_validLabel, 4, 0, 1, 1, Qt::AlignRight);
+    m_gridLayout->addWidget(m_validCheckBox, 4, 1, 1, 1, Qt::AlignLeft);
 
     m_btnLayout->addStretch();
     m_btnLayout->addWidget(m_confirm);
@@ -89,16 +108,26 @@ void EditNodeWidget::connectSignalsAndSlots()
     connect(m_name, &LineEdit::textChanged, this, &EditNodeWidget::slotEditChanged);
     connect(m_remark, &TextEdit::textChanged, this, &EditNodeWidget::slotEditChanged);
     connect(m_dimen, &LineEdit::textChanged, this, &EditNodeWidget::slotEditChanged);
+    connect(m_costComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(slotCostComboChanged(int)));
+    connect(m_validCheckBox, &QCheckBox::stateChanged, this, &EditNodeWidget::slotEditChanged);
     connect(m_confirm, &PushButton::clicked, this, &EditNodeWidget::slotConfirmCLicked);
     connect(m_cancel, &PushButton::clicked, this, &EditNodeWidget::slotConcelClicked);
 }
 
 void EditNodeWidget::slotEditChanged()
 {
+    qDebug() << __FUNCTION__ << __LINE__ << endl;
     m_confirm->setEnabled(true);
-    m_node.name      = m_name->text();
-    m_node.remark    = m_remark->toPlainText();
-    m_node.dimension = m_dimen->text();
+    m_node.name        = m_name->text();
+    m_node.remark      = m_remark->toPlainText();
+    m_node.dimension   = m_dimen->text();
+    m_node.type        = m_costComboBox->currentIndex();
+    m_node.isEffective = !m_validCheckBox->isChecked();
+}
+
+void EditNodeWidget::slotCostComboChanged(int)
+{
+    slotEditChanged();
 }
 
 void EditNodeWidget::slotConfirmCLicked()
@@ -111,3 +140,14 @@ void EditNodeWidget::slotConcelClicked()
 {
     close();
 }
+
+void EditNodeWidget::setUpCostTypes()
+{
+    QMetaEnum metaEnum = QMetaEnum::fromType<SchemePlanManager::IndexCostType>();
+    for (int i = 0; i < metaEnum.keyCount(); i++) {
+        SchemePlanManager::IndexCostType value = (SchemePlanManager::IndexCostType)metaEnum.value(i);
+        QString str                            = SchemePlanManager::stringFromIndexCostType(value);
+        m_costComboBox->addItem(str);
+    }
+    m_costComboBox->setCurrentIndex(0);
+}

+ 17 - 0
QFD/widgets/EditNodeWidget.h

@@ -13,6 +13,8 @@ class QLabel;
 class QVBoxLayout;
 class QHBoxLayout;
 class QGridLayout;
+class QComboBox;
+class CheckBox;
 
 /**
  * @brief The EditNodeWidget class
@@ -39,24 +41,39 @@ public:
 public slots:
 
     void slotEditChanged();
+    void slotCostComboChanged(int);
     void slotConfirmCLicked();
     void slotConcelClicked();
 
 signals:
     void sigSaveNode(CNodeData n);
 
+private:
+    void setUpCostTypes();
+
 private:
     CNodeData m_node;
 
+    /// 名称
     QLabel *m_nameLabel = nullptr;
     LineEdit *m_name    = nullptr;
 
+    /// 内涵
     QLabel *m_remarkLabel = nullptr;
     TextEdit *m_remark    = nullptr;
 
+    /// 量纲
     QLabel *m_dimenLabel = nullptr;
     LineEdit *m_dimen    = nullptr;
 
+    /// 成本效益类型
+    QLabel *m_costLabel       = nullptr;
+    QComboBox *m_costComboBox = nullptr;
+
+    /// 是否生效
+    QLabel *m_validLabel      = nullptr;
+    CheckBox *m_validCheckBox = nullptr;
+
     PushButton *m_confirm = nullptr;
     PushButton *m_cancel  = nullptr;
 

+ 4 - 0
QFD/widgets/EvalReportWidget.cpp

@@ -341,6 +341,7 @@ void EvalReportWidget::showTechScore()
         model->setVerticalHeaderItem(j, vHeader);
 
         QStandardItem *item = new QStandardItem("0.5");
+
         item->setEditable(false);
         model->setItem(j, 0, item);
         PlotView::Data data { vHeader->text(), item->text().toDouble() };
@@ -407,6 +408,9 @@ void EvalReportWidget::showSchemeScore()
 
 void EvalReportWidget::showEffiResult()
 {
+
+    m_EffiTab->clear();
+
     QList<QString> tabList = { "建设前", "建设后" };
     if (m_evalAlg == SchemePlanManager::MEA) {
         tabList = { "方案一", "方案二" };

+ 80 - 81
QFD/widgets/EvalReportWidget.h

@@ -34,29 +34,6 @@ 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();
 
@@ -97,73 +74,95 @@ private:
 
     QGridLayout *m_gridLayout = 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;  // 指标得分表
-    PlotView *m_techPlot    = nullptr;  // 指标得分图
-    QComboBox *m_techCombo  = nullptr;  // 切换指标得分图类型
-
-    QLabel *m_schemeTitle     = nullptr;  // 方案得分标题
-    QTableView *m_schemeTable = nullptr;  // 方案得分表
-    PlotView *m_schemePlot    = nullptr;  // 方案得分图
-    QComboBox *m_schemeCombo  = nullptr;  // 切换方案得分类型
-
-    QTabWidget *m_EffiTab = nullptr;  // 指标权重表
+    /// 指标得分
+    QLabel *m_techTitle       = nullptr;  // 指标得分标题
+    QTableView *m_techTable   = nullptr;  // 指标得分表
+    PlotView *m_techPlot      = nullptr;  // 指标得分图
+    CustomPieChart *m_techPie = nullptr;  // 指标得分饼图
+    QComboBox *m_techCombo    = nullptr;  // 切换指标得分图类型
+
+    /// 方案得分和效能评估
+    QLabel *m_schemeTitle       = nullptr;  // 方案得分标题
+    QTableView *m_schemeTable   = nullptr;  // 方案得分表
+    QTabWidget *m_EffiTab       = nullptr;  // 指标权重表
+    PlotView *m_schemePlot      = nullptr;  // 方案得分图
+    CustomPieChart *m_schemePie = nullptr;  // 方案得分饼图
+    QComboBox *m_schemeCombo    = 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,
-
-
+样例数据
+
+项目演示-方案优选-指标权重(层次分析法)
+{ 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 };
+
+项目演示-效能评估-效能分析(灰色聚类)-建设前
+{ 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 }
+
+项目演示-效能评估-效能分析(灰色聚类)-建设后
+{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}
+
+项目演示-效能评估-效能分析(物元分析)-方案一
+{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 }
 */

+ 6 - 4
QFD/widgets/IndexSystemWidget.cpp

@@ -43,12 +43,14 @@ void IndexSystemWidget::contextMenuEvent(QContextMenuEvent *event)
         menu->addAction(act3);
         connect(act3, &QAction::triggered, this, &IndexSystemWidget::slotCreateRootNode);
     } else {
-        QAction *act2 = new QAction("清空");
-        menu->addAction(act2);
-        connect(act2, &QAction::triggered, this, &IndexSystemWidget::slotClearAllNodes);
+        //        QAction *act2 = new QAction("清空");
+        //        menu->addAction(act2);
+        //        connect(act2, &QAction::triggered, this, &IndexSystemWidget::slotClearAllNodes);
     }
 
-    menu->exec(event->globalPos() + QPoint(-40, -20));
+    if (menu->actions().size() > 0) {
+        menu->exec(event->globalPos() + QPoint(-40, -20));
+    }
 
     QWidget::contextMenuEvent(event);
 }