#ifndef MATRIXPANELWIDGET_H #define MATRIXPANELWIDGET_H #include #include #include #include #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 getMindNodes() const { return mindNodes; } void clear() { mindNodes.clear(); }; QString getMindName() const { return mindName; } void setMindName(QString name) { mindName = name; } private: QString mindName; QList 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 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> *classifiedNodes = nullptr; QList> *indexsRefClassifiedNodes = nullptr; // 是否参考指标体系 QList technicalCols; int currentPage = 0; bool isAutoSave = false; QString currentTab = ""; QString m_table_msg; QList tabWidgets; QList modelList; // 存储专家tab数据 QList modelName; // 存储专家tab名称 void sortMindNodes(const MindNodeManager &manager, QList> *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 nodeValueInfoList); void initPlainTechMeasuresWidget(QList nodeValueInfoList); void paintPlainWidget(); bool checkTableDateReady(); signals: void importData(QList nodeValueInfoList); }; #endif // MATRIXPANELWIDGET_H