12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #include "EXIndexView.h"
- #include "dbService/ClassSet.h"
- #include "dbService/CNodeDataService.h"
- #include <CMindView.h>
- #include <QTabWidget>
- #include <QDebug>
- EXIndexView::EXIndexView(ProjectInfo *proj, QWidget *parent) : EXEvalView(proj, parent)
- {
- setTitle("指标体系");
- }
- void EXIndexView::setType(int type)
- {
- EXEvalView::setType(type);
- setupTabWidget();
- }
- void EXIndexView::setupTabWidget()
- {
- m_tab->clear();
- for (int i : indexList()) {
- CMindView *m = new CMindView(this);
- m->setAllowEdit(false);
- ProjectManager::IndexType t = (ProjectManager::IndexType)i;
- QString s = ProjectManager::nameOfIndexType(t);
- m_tab->addTab(m, s);
- QList<CNodeData> list;
- bool ret = CNodeDataService().QueryAll(list, proj()->id, t);
- if (ret) {
- m->setNodeList(list);
- }
- CMind *mind = m->mind();
- for (int i = 1; i < mind->levels(); i++) {
- QList<CNodeData> nodes = mind->nodesInLevel(i);
- for (CNodeData node : nodes) {
- qDebug() << __FUNCTION__ << __LINE__ << "第" << i << "级节点" << node.name << endl;
- qDebug() << __FUNCTION__ << __LINE__ << "子节点:" << endl;
- QList<CNodeData> list = mind->subNodes(node);
- for (CNodeData subNode : list) {
- qDebug() << __FUNCTION__ << __LINE__ << subNode.name << endl;
- }
- }
- }
- }
- }
|