123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- #ifndef DATATABLEWIDGET_H
- #define DATATABLEWIDGET_H
- #include <QWidget>
- #include "SchemePlanManager.h"
- #include <CNode.h>
- #include <dbService/ClassSet.h>
- #include <QStandardItemModel>
- class DataTableComboDelegate;
- class CMind;
- class ProjectInfo;
- class PushButton;
- class QLabel;
- class QTabWidget;
- class QVBoxLayout;
- class QHBoxLayout;
- class DataTableItemModel : public QStandardItemModel
- {
- public:
- explicit DataTableItemModel(QObject *parent = nullptr);
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
- };
- /**
- * @brief The DataTableWidget class
- * 数据表, 整体上是包含多个 QTableView 的 QTabWidget
- * 显示以下数据:
- * 能力重要度评估, 技术措施重要度, 方案优选评估: 权重分析数据和评估数据
- * 综合效能评估: 权重分析数据
- * 综合效能评估-物元分析法: 评估数据
- */
- class DataTableWidget : public QWidget
- {
- Q_OBJECT
- public:
- explicit DataTableWidget(SchemePlanManager::SchemeProcessInfo process, QWidget *parent = nullptr);
- SchemePlanManager::SchemeProcessInfo process() const;
- void initWidget();
- void initLayout();
- void connectSignalsAndSlots();
- void setupModels();
- void setupTabWidget();
- int currentPage() const;
- void setCurrentPage(int p);
- void updateCurrentTable();
- void setSchemeList(const QList<SchemaEval *> &list);
- void addScheme(SchemaEval *scheme);
- QTabWidget *tabWidget() const;
- CMind *mind1() const;
- CMind *mind2() const;
- void setNodeMatrixData(QList<NodeMatrixInfo *> data, bool isExpertData);
- signals:
- void sigMeasureDataEdited(NodeMatrixInfo *info);
- private:
- void updateModel(DataTableItemModel *model, QList<CNodeData> &hHeaders, QList<CNodeData> &vHeaders, int hStart = 0,
- int vStart = 0);
- public slots:
- void slotPrevious();
- void slotNext();
- void slotTabCurrentChanged(int c);
- void itemChanged(QStandardItem *item);
- private:
- SchemePlanManager::SchemeProcessInfo m_process;
- QMap<int, QList<DataTableItemModel *>> m_models;
- int m_currentPage = 0;
- CMind *m_mind1 = nullptr;
- CMind *m_mind2 = nullptr;
- QTabWidget *m_dataTab = nullptr;
- QLabel *m_pageLab = nullptr; // 共4页, 当前第2页
- PushButton *m_previous = nullptr; // 上一级指标
- PushButton *m_next = nullptr; // 下一级指标
- QVBoxLayout *m_layout = nullptr;
- QHBoxLayout *m_pageLayout = nullptr;
- bool m_isSettingTable = false;
- DataTableComboDelegate *m_comboDelegate = nullptr;
- QList<NodeMatrixInfo *> m_data;
- QString m_uuidStr;
- bool m_isFillingData = false;
- int m_schemeStartIndex = -1; // 方案数据开始列
- QList<SchemaEval *> m_schemeList;
- };
- #endif // DATATABLEWIDGET_H
|