update:数据查询界面,数据对比-指标数值对比功能更新
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, defineProps, watch, nextTick } from 'vue';
|
||||
import BaseTable from '@/components/common/table/baseTable.vue';
|
||||
import { objectTypeArrayRemovesDuplicates } from '@/components/loadCaseTable/utils/funTools';
|
||||
|
||||
const props = defineProps({
|
||||
checkTaskInfo: {
|
||||
@@ -41,19 +42,31 @@ const tableColumns = ref<any>([
|
||||
const modelAttribute = ref<any>([
|
||||
{
|
||||
name: '仿真指标1( > 20mm)',
|
||||
value: 'fileName',
|
||||
},
|
||||
{
|
||||
name: '仿真指标2( > 5m/s)',
|
||||
value: 'project',
|
||||
},
|
||||
{
|
||||
name: '仿真指标3( < 43 ℃)',
|
||||
value: 'project',
|
||||
},
|
||||
]);
|
||||
|
||||
const getTableColumnsFn = (data:any) => {
|
||||
|
||||
const performanceDatas = data || [];
|
||||
const taskNames = Array.from(new Set(performanceDatas?.map((item:any) => {
|
||||
return item.taskName;
|
||||
}))) ;
|
||||
modelAttribute.value = performanceDatas.map((item:any) => {
|
||||
const obj:any = {
|
||||
name: `${item.performanceName} (${item.method} ${item.targetValue} ${item.unit})`,
|
||||
value: item.nodeId,
|
||||
};
|
||||
|
||||
obj[item.nodeId] = item.highValue;
|
||||
return obj;
|
||||
});
|
||||
|
||||
const defaultColumns = [{
|
||||
title: '指标信息',
|
||||
key: 'performanceInfo',
|
||||
@@ -65,40 +78,36 @@ const getTableColumnsFn = (data:any) => {
|
||||
showTableContent.value = false;
|
||||
tableData.value = [];
|
||||
tableColumns.value = [];
|
||||
|
||||
const modelcolumns:any = [];
|
||||
|
||||
for (let i = 0;i < list.length;i++) {
|
||||
|
||||
for (let j = 0;j < 2;j++) {
|
||||
|
||||
const obj:any = {
|
||||
title: `${list[i].taskName}_算例_${j + 1}`,
|
||||
key: `${list[i].id}_key_${j + 1}`,
|
||||
isShow: true,
|
||||
};
|
||||
|
||||
modelcolumns.push(obj);
|
||||
let modelcolumns:any = [];
|
||||
for (let j = 0;j < taskNames.length;j++) {
|
||||
for (let i = 0;i < list.length;i++) {
|
||||
if (list[i].taskName === taskNames[j]) {
|
||||
const obj:any = {
|
||||
title: `${list[i].taskName}`,
|
||||
key: `${list[i].nodeId}`,
|
||||
isShow: true,
|
||||
};
|
||||
modelcolumns.push(obj);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
modelcolumns = objectTypeArrayRemovesDuplicates(modelcolumns, 2);
|
||||
tableColumns.value = defaultColumns.concat(modelcolumns);
|
||||
|
||||
if (props.cloumnWidth) {
|
||||
for (let i = 0;i < tableColumns.value.length;i++) {
|
||||
tableColumns.value[i].width = props.cloumnWidth;
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0;i < modelAttribute.value.length;i++) {
|
||||
const obj:any = {
|
||||
|
||||
};
|
||||
for (let j = 0;j < tableColumns.value.length;j++) {
|
||||
if (tableColumns.value[j].key === 'performanceInfo') {
|
||||
obj[tableColumns.value[j].key] = modelAttribute.value[i].name;
|
||||
} else {
|
||||
obj[tableColumns.value[j].key] = modelAttribute.value[i][tableColumns.value[j].key];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +115,6 @@ const getTableColumnsFn = (data:any) => {
|
||||
}
|
||||
|
||||
showTableContent.value = true;
|
||||
|
||||
nextTick(() => {
|
||||
performanceTableRef.value.setDataFun(tableData.value);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user