#ifndef EXDATATABLEVIEW_H #define EXDATATABLEVIEW_H #include #include "SchemePlanManager.h" #include "CNode.h" #include #include #include class QFUser; class CMind; class ProjectInfo; class PushButton; class QLabel; class QTabWidget; class QVBoxLayout; class QHBoxLayout; class EXDataTableComboDelegate; class QStandardItemModel; class EXDataItemModel : public QStandardItemModel { public: explicit EXDataItemModel(QObject *parent = nullptr); QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; }; /** * @brief The DataTableWidget class * 数据表, 整体上是包含多个 QTableView 的 QTabWidget * 显示以下数据: * 能力重要度评估, 技术措施重要度, 方案优选评估: 权重分析数据和评估数据 * 综合效能评估: 权重分析数据 * 综合效能评估-物元分析法: 评估数据 */ class EXDataTableView : public QWidget { Q_OBJECT public: explicit EXDataTableView(SchemePlanManager::SchemeProcessInfo process, QWidget *parent = nullptr); SchemePlanManager::SchemeProcessInfo process() const; void setProjectInfo(ProjectInfo *proj); void initWidget(); void initLayout(); void connectSignalsAndSlots(); void setupModels(); void setupTabWidget(); int currentPage() const; void setCurrentPage(int p); CMind *mind1() const; CMind *mind2() const; bool checkDataComplete() const; void exportData(const QString &path); signals: void signalItemEdited(); private: void editItemData(const QModelIndex &index, const QString &val); void updateModel(EXDataItemModel *model, QList &hHeaders, QList &vHeaders); private slots: void slotPrevious(); void slotNext(); void slotTabCurrentChanged(int c); void slotItemClicked(const QModelIndex &index); void slotSave(); void itemChanged(QStandardItem *item); private: SchemePlanManager::SchemeProcessInfo m_process; QMap> m_models; QXlsx::Document *m_export; ProjectInfo *m_proj = nullptr; QFUser *m_user; 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; EXDataTableComboDelegate *m_comboDelegate; PushButton *m_save = nullptr; }; #endif // EXDATATABLEVIEW_H