|
@@ -117,31 +117,52 @@ void DataTableWidget::updateCurrentTable()
|
|
|
|
|
|
QStandardItemModel *model = (QStandardItemModel *)table->model();
|
|
|
|
|
|
- // 设置顶部水平方向标题
|
|
|
+ /// 设置顶部水平方向标题
|
|
|
int hIndex = 0;
|
|
|
- // 技术措施重要度评估数据表, 增加一列指标权重
|
|
|
- if (m_process.indexType == ProjectManager::TechIndex) {
|
|
|
+ // 导入评估数据时, 增加一列指标权重
|
|
|
+ if (m_process.type == SchemePlanManager::ImportEvalData) {
|
|
|
QStandardItem *item = new QStandardItem("指标权重");
|
|
|
model->setHorizontalHeaderItem(hIndex++, item);
|
|
|
}
|
|
|
// 指标
|
|
|
CNodeData n = m_mind1->nodesInLevel(m_currentPage)[c];
|
|
|
QList<CNodeData> hList = m_mind1->subNodes(n);
|
|
|
- for (int i = 0; i < hList.count(); i++) {
|
|
|
- CNodeData node = hList[i];
|
|
|
- QStandardItem *item = new QStandardItem(node.name);
|
|
|
- item->setToolTip(node.remark);
|
|
|
- model->setHorizontalHeaderItem(i + hIndex, item);
|
|
|
+ // 以下情况需要显示指标
|
|
|
+ // 导入权重分析数据
|
|
|
+ // 导入需求分析评估的评估数据
|
|
|
+ if (m_process.type == SchemePlanManager::ImportWeightData || m_process.indexType == ProjectManager::TechIndex) {
|
|
|
+ for (CNodeData node : hList) {
|
|
|
+ QStandardItem *item = new QStandardItem(node.name);
|
|
|
+ item->setToolTip(node.remark);
|
|
|
+ model->setHorizontalHeaderItem(hIndex++, item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 导入方案优选评估或效能评估的评估数据时, 需要显示量纲
|
|
|
+ if (m_process.type == SchemePlanManager::ImportEvalData
|
|
|
+ && (m_process.indexType == ProjectManager::OptimalIndex
|
|
|
+ || m_process.indexType == ProjectManager::EfficiencyIndex)) {
|
|
|
+ QStandardItem *item = new QStandardItem("指标量纲");
|
|
|
+ model->setHorizontalHeaderItem(hIndex++, item);
|
|
|
+ }
|
|
|
+ // 导入方案优选评估的评估数据时, 需要显示指标类型
|
|
|
+ if (m_process.type == SchemePlanManager::ImportEvalData && m_process.indexType == ProjectManager::OptimalIndex) {
|
|
|
+ QStandardItem *item = new QStandardItem("指标类型");
|
|
|
+ model->setHorizontalHeaderItem(hIndex++, item);
|
|
|
}
|
|
|
|
|
|
- // 设置左侧垂直方向标题
|
|
|
+ /// 设置左侧垂直方向标题
|
|
|
QList<CNodeData> vList;
|
|
|
- if (m_process.indexType == ProjectManager::AbilityIndex && m_process.dSource == SchemePlanManager::FromExpert) {
|
|
|
+ // 导入权重分析的专家数据时, 显示指标
|
|
|
+ if (m_process.type == SchemePlanManager::ImportWeightData && m_process.dSource == SchemePlanManager::FromExpert) {
|
|
|
vList = hList;
|
|
|
}
|
|
|
-
|
|
|
- if (m_process.indexType == ProjectManager::TechIndex) {
|
|
|
- vList = m_mind2->leaves();
|
|
|
+ // 导入评估数据时, 显示最后一级指标
|
|
|
+ if (m_process.type == SchemePlanManager::ImportEvalData) {
|
|
|
+ if (m_process.indexType == ProjectManager::TechIndex) {
|
|
|
+ vList = m_mind2->leaves();
|
|
|
+ } else {
|
|
|
+ vList = m_mind1->leaves();
|
|
|
+ }
|
|
|
}
|
|
|
for (int i = 0; i < vList.count(); i++) {
|
|
|
CNodeData node = vList[i];
|
|
@@ -153,7 +174,7 @@ void DataTableWidget::updateCurrentTable()
|
|
|
|
|
|
return;
|
|
|
|
|
|
- // 填充单元格
|
|
|
+ /// 填充单元格
|
|
|
for (int i = 0; i < vList.count(); i++) {
|
|
|
for (int j = 0; j < hList.count(); j++) {
|
|
|
QStandardItem *item = new QStandardItem();
|