AnalysisTableWidget.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #ifndef ANALYSISTABLEWIDGET_H
  2. #define ANALYSISTABLEWIDGET_H
  3. #include <QStandardItemModel>
  4. #include <QTableView>
  5. #include <qvector.h>
  6. #include <dbService/ClassSet.h>
  7. struct AnalysisDataSource
  8. {
  9. QString node; //节点
  10. QString abscissa; //横坐标
  11. QString ordinate; //纵坐标
  12. QString nodeValue; //节点值
  13. int row = -1;
  14. int col = -1;
  15. bool changed = false;
  16. };
  17. class AnalysisTableWidget : public QTableView
  18. {
  19. Q_OBJECT
  20. public:
  21. enum IndexType
  22. {
  23. IndexTech = 1, //技术措施指标体系
  24. TechMessaure, //技术措施
  25. SchemaEval //方案评估指标体系
  26. };
  27. explicit AnalysisTableWidget(QWidget *parent = nullptr);
  28. ~AnalysisTableWidget();
  29. void addRowNode(QString node, QString name, QString remark);
  30. void addColNode(QString node, QString name, QString remark);
  31. QList<AnalysisDataSource> getSource() const;
  32. bool isDataReady() const;
  33. void paintMatrixTable(QList<NodeMatrixInfo *> nodeValueInfoList, int type);
  34. void paintCompositeMatrixTable(QList<NodeMatrixInfo *> nodeValueInfoList, int type);
  35. void paintSecondMatrixTable(QList<NodeMatrixInfo *> nodeValueInfoList, int page, int type, int index);
  36. void setTableWeight(QList<DemandWeight *> firstWeight, QList<DemandWeight *> secondWeight);
  37. void setTableIndexAndTableMsg(int index, int engineerId, QString expertId, QString tableMsg);
  38. void setTableMethod(QString method);
  39. signals:
  40. void dataReady(bool status);
  41. void returnModel(QStandardItemModel *item);
  42. private slots:
  43. void nodeValueChanged(QStandardItem *item);
  44. private:
  45. struct MatrixNode
  46. {
  47. MatrixNode(QString no, QString na, QString re)
  48. {
  49. node = no;
  50. name = na;
  51. remark = re;
  52. }
  53. QString node;
  54. QString name;
  55. QString remark;
  56. };
  57. bool paintDone = false;
  58. QList<MatrixNode> matrixRows;
  59. QList<MatrixNode> matrixCols;
  60. QList<AnalysisDataSource> dataSource;
  61. QStandardItemModel *model;
  62. QList<DemandWeight *> m_firstTableWeight;
  63. QList<DemandWeight *> m_secondTableWeight;
  64. int m_tableIndex = 0;
  65. int m_engineerId; // 工程id
  66. QString m_expertId; // 专家id
  67. QString m_engineer_name;
  68. QString m_expert_name;
  69. QString m_table_msg;
  70. QString m_resultMethod;
  71. };
  72. #endif // ANALYSISTABLEWIDGET_H