123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- #ifndef MATRIXPANELWIDGET_H
- #define MATRIXPANELWIDGET_H
- #include <QGridLayout>
- #include <QStandardItemModel>
- #include <QTabWidget>
- #include <QWidget>
- #include "dbService/ClassSet.h"
- namespace Ui {
- class MatrixPanelWidget;
- }
- struct ProfessorInfo
- {
- int id = -1;
- QString name;
- QString job;
- QString major;
- QString department;
- QString education;
- QString phone;
- QDateTime createDataTime;
- QString remark;
- QString tableMsg;
- EngineerInfo engineer; // 当前的工程
- };
- class MindNodeManager
- {
- public:
- struct NodeMessage
- {
- QString node;
- QString name;
- QString remark;
- };
- explicit MindNodeManager() { }
- void pushNewMind(NodeMessage node) { mindNodes << node; }
- QList<NodeMessage> getMindNodes() const { return mindNodes; }
- void clear() { mindNodes.clear(); };
- QString getMindName() const { return mindName; }
- void setMindName(QString name) { mindName = name; }
- private:
- QString mindName;
- QList<NodeMessage> mindNodes;
- };
- class MatrixPanelWidget : public QWidget
- {
- Q_OBJECT
- public:
- explicit MatrixPanelWidget(QWidget *parent = nullptr);
- explicit MatrixPanelWidget(QWidget *parent, ProfessorInfo professor);
- void setTableMsg(QString tableMsg);
- ~MatrixPanelWidget();
- /**
- * @brief 绘制脑图
- * @param 横坐标参考脑图节点
- * @param 纵坐标参考脑图节点
- */
- void init(const QStringList indexsRef, const QStringList indexs);
- void initImportData(const QStringList indexsRef, const QStringList indexs,
- QList<NodeMatrixInfo *> nodeValueInfoList);
- void saveNodes();
- private slots:
- void on_prePageBtn_clicked();
- void on_nextPageBtn_clicked();
- void on_saveBtn_clicked();
- void oneTableDataReady(bool status);
- void oneTechMeasureTableDataReady(bool status);
- void oneTableDataSave();
- void getTableModel(QStandardItemModel *item);
- void getTableModelName(QString itemName);
- void on_importBtn_clicked();
- public slots:
- void on_exportBtn_clicked();
- private:
- Ui::MatrixPanelWidget *ui;
- ProfessorInfo m_professor;
- QGridLayout *firstLayout = nullptr;
- QWidget *firstPlainWidget = nullptr;
- QGridLayout *secondLayout = nullptr;
- QWidget *secondPlainWidget = nullptr;
- MindNodeManager *currentMindNodes = nullptr;
- QList<QList<MindNodeManager::NodeMessage>> *classifiedNodes = nullptr;
- QList<QList<MindNodeManager::NodeMessage>> *indexsRefClassifiedNodes = nullptr; // 是否参考指标体系
- QList<MindNodeManager::NodeMessage> technicalCols;
- int currentPage = 0;
- bool isAutoSave = false;
- QString currentTab = "";
- QString m_table_msg;
- QList<QTabWidget *> tabWidgets;
- QList<QStandardItemModel *> modelList; // 存储专家tab数据
- QList<QString> modelName; // 存储专家tab名称
- void sortMindNodes(const MindNodeManager &manager, QList<QList<MindNodeManager::NodeMessage>> *classify);
- void getMindNodes(MindNodeManager *manager, QStringList listNodes);
- QStringList getFirstIndexNodes(const MindNodeManager &manager);
- QStringList getLastIndexNodes(const MindNodeManager &manager);
- int getPages();
- void setPage(int page);
- void initPlainWidget(QList<NodeMatrixInfo *> nodeValueInfoList);
- void initPlainTechMeasuresWidget(QList<NodeMatrixInfo *> nodeValueInfoList);
- void paintPlainWidget();
- bool checkTableDateReady();
- signals:
- void importData(QList<NodeMatrixInfo *> nodeValueInfoList);
- };
- #endif // MATRIXPANELWIDGET_H
|