123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- #ifndef EXDATATABLEVIEW_H
- #define EXDATATABLEVIEW_H
- #include <QWidget>
- #include "SchemePlanManager.h"
- #include "CNode.h"
- #include <dbService/ClassSet.h>
- #include <xlsxdocument.h>
- #include <QStandardItemModel>
- 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<CNodeData> &hHeaders, QList<CNodeData> &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<int, QList<EXDataItemModel *>> 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
|