|
@@ -18,16 +18,19 @@
|
|
|
|
|
|
#include <QDebug>
|
|
|
|
|
|
-DataTableWidget::DataTableWidget(ProjectInfo *proj, int indexType, QWidget *parent)
|
|
|
- : QWidget(parent), m_proj(proj), m_indexType(indexType)
|
|
|
+DataTableWidget::DataTableWidget(SchemePlanManager::SchemeProcessInfo process, QWidget *parent)
|
|
|
+ : QWidget(parent), m_process(process)
|
|
|
{
|
|
|
m_mind1 = new CMind(this);
|
|
|
m_mind2 = new CMind(this);
|
|
|
initWidget();
|
|
|
initLayout();
|
|
|
connectSignalsAndSlots();
|
|
|
- setupMind();
|
|
|
- setCurrentPage(1);
|
|
|
+}
|
|
|
+
|
|
|
+SchemePlanManager::SchemeProcessInfo DataTableWidget::process() const
|
|
|
+{
|
|
|
+ return m_process;
|
|
|
}
|
|
|
|
|
|
void DataTableWidget::initWidget()
|
|
@@ -61,23 +64,6 @@ void DataTableWidget::connectSignalsAndSlots()
|
|
|
connect(m_dataTab, &QTabWidget::currentChanged, this, &DataTableWidget::slotTabCurrentChanged);
|
|
|
}
|
|
|
|
|
|
-void DataTableWidget::setupMind()
|
|
|
-{
|
|
|
- QList<CNodeData> list;
|
|
|
- bool ret = CNodeDataService().QueryAll(list, m_proj->id, m_indexType);
|
|
|
- if (ret) {
|
|
|
- m_mind1->setNodeList(list);
|
|
|
- }
|
|
|
-
|
|
|
- if (m_indexType == ProjectManager::TechIndex) {
|
|
|
- QList<CNodeData> list;
|
|
|
- bool ret = CNodeDataService().QueryAll(list, m_proj->id, ProjectManager::AbilityIndex);
|
|
|
- if (ret) {
|
|
|
- m_mind2->setNodeList(list);
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
void DataTableWidget::setupTabWidget()
|
|
|
{
|
|
|
/// 创建 tableView 并添加进 tabWidget
|
|
@@ -87,7 +73,7 @@ void DataTableWidget::setupTabWidget()
|
|
|
m_dataTab->clear();
|
|
|
for (CNodeData n : m_mind1->nodesInLevel(m_currentPage)) {
|
|
|
QTableView *t = new QTableView(m_dataTab);
|
|
|
- t->setAlternatingRowColors(m_indexType == ProjectManager::TechIndex);
|
|
|
+ t->setAlternatingRowColors(m_mind2->nodeList().count() > 0);
|
|
|
t->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
|
|
t->horizontalHeader()->setStyleSheet("QHeaderView::section{background:rgb(244,244,244);color: black;}");
|
|
|
t->verticalHeader()->setStyleSheet("QHeaderView::section{background:rgb(244,244,244);color: black;}");
|
|
@@ -141,7 +127,7 @@ void DataTableWidget::updateCurrentTable()
|
|
|
}
|
|
|
|
|
|
QList<CNodeData> vList = hList;
|
|
|
- if (m_indexType == ProjectManager::TechIndex) {
|
|
|
+ if (m_mind2->nodeList().count() > 0) {
|
|
|
vList = m_mind2->nodesInFinalLevel();
|
|
|
}
|
|
|
|
|
@@ -156,7 +142,7 @@ void DataTableWidget::updateCurrentTable()
|
|
|
for (int j = 0; j < hList.count(); j++) {
|
|
|
QStandardItem *item = new QStandardItem();
|
|
|
item->setEditable(false);
|
|
|
- if (m_indexType != ProjectManager::TechIndex) {
|
|
|
+ if (m_mind2->nodeList().count() <= 0) {
|
|
|
if (i == j) {
|
|
|
item->setText("1"); // 对角线
|
|
|
}
|
|
@@ -172,6 +158,16 @@ void DataTableWidget::updateCurrentTable()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+CMind *DataTableWidget::mind1() const
|
|
|
+{
|
|
|
+ return m_mind1;
|
|
|
+}
|
|
|
+
|
|
|
+CMind *DataTableWidget::mind2() const
|
|
|
+{
|
|
|
+ return m_mind2;
|
|
|
+}
|
|
|
+
|
|
|
void DataTableWidget::slotPrevious()
|
|
|
{
|
|
|
setCurrentPage(m_currentPage - 1);
|