|
@@ -23,6 +23,7 @@
|
|
|
#include <QDebug>
|
|
|
|
|
|
static const char *kDataTabName = "tabName";
|
|
|
+static const char *kUUIDName = "uuidName";
|
|
|
|
|
|
DataTableItemModel::DataTableItemModel(QObject *parent) : QStandardItemModel(parent) { }
|
|
|
|
|
@@ -190,6 +191,12 @@ void DataTableWidget::setupModels()
|
|
|
m_models[i] = modelList;
|
|
|
}
|
|
|
|
|
|
+ for (auto modelList : m_models.values()) {
|
|
|
+ for (auto model : modelList) {
|
|
|
+ connect(model, &QStandardItemModel::itemChanged, this, &DataTableWidget::itemChanged);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
setCurrentPage(1);
|
|
|
|
|
|
addTestMesureData();
|
|
@@ -423,7 +430,15 @@ CMind *DataTableWidget::mind2() const
|
|
|
|
|
|
void DataTableWidget::setNodeMatrixData(QList<NodeMatrixInfo *> data, bool isExpertData)
|
|
|
{
|
|
|
- m_data = data;
|
|
|
+ if (data.size() <= 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ isFillingData = true;
|
|
|
+
|
|
|
+ m_data = data;
|
|
|
+ m_uuidStr = data.first()->strUuid;
|
|
|
+
|
|
|
// 加载来自专家的权重分析数据
|
|
|
if (m_process.type == SchemePlanManager::ImportWeightData) {
|
|
|
if (m_process.dSource == SchemePlanManager::FromExpert) {
|
|
@@ -483,6 +498,8 @@ void DataTableWidget::setNodeMatrixData(QList<NodeMatrixInfo *> data, bool isExp
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ isFillingData = false;
|
|
|
}
|
|
|
|
|
|
void DataTableWidget::addTestMesureData()
|
|
@@ -545,3 +562,41 @@ void DataTableWidget::slotTabCurrentChanged(int c)
|
|
|
Q_UNUSED(c)
|
|
|
updateCurrentTable();
|
|
|
}
|
|
|
+
|
|
|
+void DataTableWidget::itemChanged(QStandardItem *item)
|
|
|
+{
|
|
|
+ if (isFillingData == true) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ bool weightData = m_process.type == SchemePlanManager::ImportWeightData
|
|
|
+ && m_process.dSource == SchemePlanManager::FromMeasurement;
|
|
|
+ bool evalData = m_process.type == SchemePlanManager::ImportEvalData
|
|
|
+ && m_process.dSource == SchemePlanManager::FromMeasurement
|
|
|
+ && m_process.indexType == ProjectManager::TechIndex;
|
|
|
+
|
|
|
+ if (!weightData && !evalData) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ QString indexName = ProjectManager::nameOfIndexType((ProjectManager::IndexType)m_process.indexType);
|
|
|
+ NodeMatrixInfo info;
|
|
|
+ info.nodeValue = item->text();
|
|
|
+ info.engineerId = m_process.projectId;
|
|
|
+ info.tableMsg = indexName;
|
|
|
+ info.strUuid = m_uuidStr;
|
|
|
+
|
|
|
+ QStandardItem *hHeader = item->model()->horizontalHeaderItem(item->column());
|
|
|
+ info.abscissa = hHeader->text();
|
|
|
+
|
|
|
+ if (evalData) {
|
|
|
+ QStandardItem *vHeader = item->model()->verticalHeaderItem(item->row());
|
|
|
+ info.ordinate = vHeader->text();
|
|
|
+ }
|
|
|
+
|
|
|
+ bool ret = NodeMatrixService().UpdateMeasureData(info);
|
|
|
+ qDebug() << __FUNCTION__ << __LINE__ << ret << endl;
|
|
|
+ if (ret) {
|
|
|
+ emit sigMeasureDataEdited(&info);
|
|
|
+ }
|
|
|
+}
|