EXIndexView.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #include "EXIndexView.h"
  2. #include "dbService/ClassSet.h"
  3. #include "dbService/CNodeDataService.h"
  4. #include <CMindView.h>
  5. #include <QTabWidget>
  6. #include <QDebug>
  7. EXIndexView::EXIndexView(ProjectInfo *proj, QWidget *parent) : EXEvalView(proj, parent)
  8. {
  9. setTitle("指标体系");
  10. }
  11. void EXIndexView::setType(int type)
  12. {
  13. EXEvalView::setType(type);
  14. setupTabWidget();
  15. }
  16. void EXIndexView::setupTabWidget()
  17. {
  18. m_tab->clear();
  19. for (int i : indexList()) {
  20. CMindView *m = new CMindView(this);
  21. m->setAllowEdit(false);
  22. ProjectManager::IndexType t = (ProjectManager::IndexType)i;
  23. QString s = ProjectManager::nameOfIndexType(t);
  24. m_tab->addTab(m, s);
  25. QList<CNodeData> list;
  26. bool ret = CNodeDataService().QueryAll(list, proj()->id, t);
  27. if (ret) {
  28. m->setNodeList(list);
  29. }
  30. CMind *mind = m->mind();
  31. for (int i = 1; i < mind->levels(); i++) {
  32. QList<CNodeData> nodes = mind->nodesInLevel(i);
  33. for (CNodeData node : nodes) {
  34. qDebug() << __FUNCTION__ << __LINE__ << "第" << i << "级节点" << node.name << endl;
  35. qDebug() << __FUNCTION__ << __LINE__ << "子节点:" << endl;
  36. QList<CNodeData> list = mind->subNodes(node);
  37. for (CNodeData subNode : list) {
  38. qDebug() << __FUNCTION__ << __LINE__ << subNode.name << endl;
  39. }
  40. }
  41. }
  42. }
  43. }