|
@@ -5,6 +5,8 @@
|
|
|
|
|
|
#include <dbService/ClassSet.h>
|
|
|
#include <dbService/SchemeProcessService.h>
|
|
|
+#include <dbService/NodeMatrixService.h>
|
|
|
+#include <dbService/UserConfigService.h>
|
|
|
|
|
|
#include <CSchemeView.h>
|
|
|
|
|
@@ -43,6 +45,7 @@ void SchemePlanWidget::setupUI()
|
|
|
// m_contentLayout->addWidget(m_description);
|
|
|
|
|
|
connect(m_export, &PushButton::clicked, this, &SchemePlanWidget::slotExportClicked);
|
|
|
+ connect(m_tab, &QTabWidget::currentChanged, this, &SchemePlanWidget::slotTabCurrentChanged);
|
|
|
}
|
|
|
|
|
|
QList<SchemePlanManager::SchemeProcessInfo> SchemePlanWidget::templateSchemes(int projId, int indexType)
|
|
@@ -101,6 +104,7 @@ void SchemePlanWidget::setupTabWidget()
|
|
|
|
|
|
for (int i : indexList()) {
|
|
|
SchemeFlowWidget *m = new SchemeFlowWidget(this);
|
|
|
+
|
|
|
connect(m, &SchemeFlowWidget::sigSchemeProcessEdited, this, &SchemePlanWidget::slotSchemeProcessEdited);
|
|
|
|
|
|
QList<SchemePlanManager::SchemeProcessInfo> schemes;
|
|
@@ -118,6 +122,30 @@ void SchemePlanWidget::setupTabWidget()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+bool SchemePlanWidget::hasData(QString indexName) const
|
|
|
+{
|
|
|
+ bool ret = NodeMatrixService().hasMeasureData(m_proj->id, indexName);
|
|
|
+
|
|
|
+ if (ret == true) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ QList<UserConfig *> cfgList;
|
|
|
+ ret = UserConfigService().QueryUserConfigListInfoByEngineerId(&cfgList, m_proj->id);
|
|
|
+ if (ret == false) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (UserConfig *cfg : cfgList) {
|
|
|
+ ret = NodeMatrixService().hasExpertData(m_proj->id, indexName, cfg->userId);
|
|
|
+ if (ret) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
void SchemePlanWidget::slotExportClicked()
|
|
|
{
|
|
|
|
|
@@ -132,3 +160,13 @@ void SchemePlanWidget::slotSchemeProcessEdited(const SchemePlanManager::SchemePr
|
|
|
qDebug() << __FUNCTION__ << __LINE__ << process.algorithm << endl;
|
|
|
SchemeProcessService().UpdateSchemeProcess(process);
|
|
|
}
|
|
|
+
|
|
|
+void SchemePlanWidget::slotTabCurrentChanged(int c)
|
|
|
+{
|
|
|
+ bool ret = hasData(m_tab->tabText(c));
|
|
|
+ SchemeFlowWidget *m = (SchemeFlowWidget *)m_tab->currentWidget();
|
|
|
+
|
|
|
+ if (m != nullptr) {
|
|
|
+ m->setAllowEdit(!ret);
|
|
|
+ }
|
|
|
+}
|