EXDataView.cpp 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. #include "EXDataView.h"
  2. #include "EXDataTableView.h"
  3. #include "dbService/SchemeProcessService.h"
  4. #include "dbService/ClassSet.h"
  5. #include "dbService/CNodeDataService.h"
  6. #include <CNode.h>
  7. #include <Widgets/Button.h>
  8. #include <QTabWidget>
  9. #include <QBoxLayout>
  10. #include <QMap>
  11. #include <QDebug>
  12. EXDataView::EXDataView(ProjectInfo *proj, QWidget *parent) : EXEvalView(proj, parent)
  13. {
  14. setTitle("数据采集");
  15. connect(m_tab, &QTabWidget::currentChanged, this, &EXDataView::slotTabCurrentChanged);
  16. }
  17. void EXDataView::setType(int type)
  18. {
  19. EXEvalView::setType(type);
  20. setupTabWidget();
  21. }
  22. ///
  23. /// \brief EXDataView::setupTabWidget
  24. /// 根据评估类型, 评估方案, 评估算法, 加载合适的数据导入界面
  25. void EXDataView::setupTabWidget()
  26. {
  27. m_tab->clear();
  28. QMap<int, QList<CNodeData>> nodeListMap;
  29. for (int i : indexList()) {
  30. // 获取指标体系数据
  31. QList<CNodeData> nodeList;
  32. bool ret = CNodeDataService().QueryAll(nodeList, m_proj->id, i);
  33. if (ret) {
  34. nodeListMap[i] = nodeList;
  35. } else {
  36. return;
  37. }
  38. // 获取方案规划数据
  39. QList<SchemePlanManager::SchemeProcessInfo> processList;
  40. ret = SchemeProcessService().QueryAllByProjectIdAndIndexType(processList, m_proj->id, i);
  41. if (ret == false) {
  42. return;
  43. }
  44. ProjectManager::IndexType t = (ProjectManager::IndexType)i;
  45. QString indexName = ProjectManager::nameOfIndexType(t);
  46. // 效能评估方案中导入评估数据的步骤, 选择物元分析法时使用
  47. SchemePlanManager::SchemeProcessInfo importEffiEvalDataProcess;
  48. for (SchemePlanManager::SchemeProcessInfo process : processList) {
  49. // // 综合效能评估 - 灰色聚类法: 效能等级配置页面, 导入评估数据页面
  50. // if (process.algorithm == SchemePlanManager::GCE && process.indexType ==
  51. // ProjectManager::EfficiencyIndex) {
  52. // GreyClusteringConfigWidget *gc = new GreyClusteringConfigWidget(process.efficiencyGrades);
  53. // m_tab->addTab(gc, indexName + " - " + "灰色聚类法效能等级配置");
  54. // QVector<GreyClusteringItem> items;
  55. // GreyClusteringSampleTable *gs = new GreyClusteringSampleTable(items, 2, 10);
  56. // m_tab->addTab(gs, indexName + " - " + "收集效能评估数据");
  57. // }
  58. // // 综合效能评估 - 物元分析法: 效能等级配置页面, 导入评估数据页面
  59. // if (process.algorithm == SchemePlanManager::MEA && process.indexType ==
  60. // ProjectManager::EfficiencyIndex) {
  61. // QList<MEConfigItem> items;
  62. // CMind *mind = new CMind();
  63. // mind->setNodeList(nodeListMap[i]);
  64. // MatterElementConfigWidget *mec = new MatterElementConfigWidget(mind,
  65. // process.efficiencyGrades); m_tab->addTab(mec, indexName + "-" + "物元分析法效能等级配置");
  66. // DataTableWidget *table = new DataTableWidget(importEffiEvalDataProcess, this);
  67. // table->mind1()->setNodeList(nodeListMap[i]);
  68. // table->setCurrentPage(1);
  69. // m_tab->addTab(table, indexName + " - " + "收集效能评估数据");
  70. // }
  71. // 导入效能评估的权重分析数据
  72. // 导入其他评估的权重分析数据和评估数据
  73. if (process.dSource == SchemePlanManager::FromExpert) {
  74. if (process.type == SchemePlanManager::ImportEvalData
  75. && process.indexType == ProjectManager::EfficiencyIndex) {
  76. importEffiEvalDataProcess = process;
  77. continue;
  78. }
  79. EXDataTableView *table = new EXDataTableView(process, this);
  80. table->mind1()->setNodeList(nodeListMap[i]);
  81. if (i == ProjectManager::TechIndex) {
  82. table->mind2()->setNodeList(nodeListMap[ProjectManager::AbilityIndex]);
  83. }
  84. table->setCurrentPage(1);
  85. QString processName = SchemePlanManager::processName(process);
  86. m_tab->addTab(table, indexName + " - " + processName);
  87. }
  88. }
  89. }
  90. }
  91. void EXDataView::slotTabCurrentChanged(int index) { }