2025-10-31 09:41:30 +08:00
|
|
|
<template>
|
|
|
|
|
<Dialog v-model="diaVisible" diaTitle="数据分析" width="90%" height="90%" @close="closeFun">
|
2025-11-05 14:39:02 +08:00
|
|
|
<div class="content">
|
2025-12-09 19:01:15 +08:00
|
|
|
<div class="filter-analysis-content" v-if="getcheckListLength()">
|
|
|
|
|
<el-checkbox
|
|
|
|
|
class="check-all"
|
|
|
|
|
v-model="checkAll"
|
|
|
|
|
label="全选"
|
|
|
|
|
value="all"
|
|
|
|
|
@change="checkAllChangeFun"
|
|
|
|
|
/>
|
2025-11-03 15:32:34 +08:00
|
|
|
<el-checkbox-group class="check-all" v-model="checkAnalysisList">
|
2025-10-31 09:41:30 +08:00
|
|
|
<template v-for="item in analysisTypeList" :key="item.value">
|
|
|
|
|
<el-checkbox
|
|
|
|
|
v-show="item.includes.includes(analysisType)"
|
|
|
|
|
:label="item.name"
|
|
|
|
|
:value="item.value"
|
2025-11-26 18:49:29 +08:00
|
|
|
@change="checkChangeFun(item.value)"
|
2025-10-31 09:41:30 +08:00
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-checkbox-group>
|
2025-11-26 18:49:29 +08:00
|
|
|
<el-button @click="exportPdfFun">导出PDF</el-button>
|
2025-10-31 09:41:30 +08:00
|
|
|
</div>
|
2025-12-09 19:01:15 +08:00
|
|
|
<div
|
|
|
|
|
class="check-table-content"
|
|
|
|
|
id="compare-content"
|
|
|
|
|
ref="contentToConvertRef"
|
|
|
|
|
v-loading="isLoading"
|
|
|
|
|
>
|
2025-10-31 09:41:30 +08:00
|
|
|
<div class="loadcase-table-content">
|
|
|
|
|
<BaseTable
|
|
|
|
|
v-if="checkTableName"
|
2025-11-26 18:49:29 +08:00
|
|
|
@checkbox-all="changeChceckFun"
|
|
|
|
|
@checkbox-change="changeChceckFun"
|
2025-10-31 09:41:30 +08:00
|
|
|
ref="checkTableRef"
|
|
|
|
|
:tableName="checkTableName"
|
|
|
|
|
showCheckbox
|
|
|
|
|
hidePagination
|
|
|
|
|
></BaseTable>
|
|
|
|
|
</div>
|
|
|
|
|
<template v-for="item in analysisTypeList" :key="item.value">
|
|
|
|
|
<div class="analysis-type-content" v-show="checkAnalysisList.includes(item.value)">
|
|
|
|
|
<div class="analysis-type-content-title">
|
2025-11-26 18:49:29 +08:00
|
|
|
<div class="title-item">{{ getTitleFun(item.value) }}</div>
|
2025-10-31 09:41:30 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="analysis-type-content-item" v-if="checktableData.length">
|
|
|
|
|
<template v-if="item.value === 'model'">
|
2025-12-09 19:01:15 +08:00
|
|
|
<modelFileResult
|
|
|
|
|
v-if="showComponents"
|
|
|
|
|
:check-task-info="modelData"
|
|
|
|
|
:cloumn-width="cloumnWidth"
|
|
|
|
|
>
|
2025-10-31 09:41:30 +08:00
|
|
|
</modelFileResult>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="item.value === 'calculationFile'">
|
|
|
|
|
<calculationFileResult
|
|
|
|
|
v-if="showComponents"
|
2025-11-05 14:39:02 +08:00
|
|
|
:check-task-info="calculationFileData"
|
2025-10-31 09:41:30 +08:00
|
|
|
:cloumn-width="cloumnWidth"
|
|
|
|
|
></calculationFileResult>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="item.value === 'numericalResult'">
|
|
|
|
|
<performanceAnalysis
|
|
|
|
|
v-if="showComponents"
|
2025-11-05 14:39:02 +08:00
|
|
|
:check-task-info="performanceData"
|
2025-10-31 09:41:30 +08:00
|
|
|
:cloumn-width="cloumnWidth"
|
|
|
|
|
></performanceAnalysis>
|
|
|
|
|
</template>
|
2025-11-03 15:32:34 +08:00
|
|
|
<template v-if="item.value === 'result'">
|
2025-12-09 19:01:15 +08:00
|
|
|
<cloudImage
|
|
|
|
|
v-if="showComponents"
|
|
|
|
|
:check-task-info="resultData"
|
|
|
|
|
:cloumn-width="cloumnWidth"
|
|
|
|
|
>
|
2025-11-05 14:39:02 +08:00
|
|
|
</cloudImage>
|
2025-11-03 15:32:34 +08:00
|
|
|
</template>
|
|
|
|
|
<template v-if="item.value === 'curve'">
|
2025-12-09 19:01:15 +08:00
|
|
|
<curveResult
|
|
|
|
|
v-if="showComponents"
|
|
|
|
|
:check-task-info="curveData"
|
|
|
|
|
:cloumn-width="cloumnWidth"
|
|
|
|
|
>
|
2025-11-05 14:39:02 +08:00
|
|
|
</curveResult>
|
2025-11-03 15:32:34 +08:00
|
|
|
</template>
|
|
|
|
|
<template v-if="item.value === 'report'">
|
2025-12-09 19:01:15 +08:00
|
|
|
<reportComparison
|
|
|
|
|
v-if="showComponents"
|
|
|
|
|
:check-task-info="reportData"
|
|
|
|
|
:cloumn-width="cloumnWidth"
|
|
|
|
|
>
|
2025-11-05 14:39:02 +08:00
|
|
|
</reportComparison>
|
2025-11-03 15:32:34 +08:00
|
|
|
</template>
|
2025-10-31 09:41:30 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-11-04 09:56:26 +08:00
|
|
|
<template #footer>
|
|
|
|
|
<div>
|
|
|
|
|
<el-button @click="closeFun">关闭</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
2025-10-31 09:41:30 +08:00
|
|
|
</Dialog>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2025-11-13 18:12:35 +08:00
|
|
|
import { ref, watch } from 'vue';
|
2025-10-31 09:41:30 +08:00
|
|
|
import Dialog from '@/components/common/dialog/index.vue';
|
|
|
|
|
import BaseTable from '@/components/common/table/baseTable.vue';
|
|
|
|
|
import modelFileResult from './modelFileResult.vue';
|
|
|
|
|
import calculationFileResult from './calculationFileResult.vue';
|
|
|
|
|
import performanceAnalysis from './performanceAnalysis.vue';
|
2025-11-03 15:32:34 +08:00
|
|
|
import cloudImage from './cloudImage.vue';
|
|
|
|
|
import curveResult from './curveResult.vue';
|
|
|
|
|
import reportComparison from './reportComparison.vue';
|
|
|
|
|
import jsPDF from 'jspdf';
|
|
|
|
|
import html2canvas from 'html2canvas';
|
2025-11-14 16:01:14 +08:00
|
|
|
import dayjs from 'dayjs';
|
2025-11-05 14:39:02 +08:00
|
|
|
import { ElMessage } from 'element-plus';
|
|
|
|
|
import { getAllRunResultByTaskIdApi } from '@/api/project/analysis';
|
|
|
|
|
import { getSimulationTaskFileApi } from '@/api/data/dataAnalysis';
|
2025-11-28 17:32:29 +08:00
|
|
|
import { getRunPerformanceApi } from '@/api/task/taskpool';
|
2025-10-31 09:41:30 +08:00
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
analysisData: {
|
|
|
|
|
type: Object,
|
2025-12-09 19:01:15 +08:00
|
|
|
default: () => {},
|
2025-10-31 09:41:30 +08:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2025-11-03 15:32:34 +08:00
|
|
|
const cloumnWidth = ref('200');
|
2025-10-31 09:41:30 +08:00
|
|
|
|
|
|
|
|
const checkTableRef = ref();
|
|
|
|
|
|
|
|
|
|
const diaVisible = ref(true);
|
|
|
|
|
|
|
|
|
|
const checkAnalysisList = ref<any>([]);
|
2025-11-05 14:39:02 +08:00
|
|
|
const checktableData = ref<any>([]);
|
2025-10-31 09:41:30 +08:00
|
|
|
|
|
|
|
|
const emits = defineEmits(['close']);
|
|
|
|
|
|
|
|
|
|
const closeFun = () => {
|
|
|
|
|
emits('close');
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const analysisType = ref<any>('');
|
|
|
|
|
const analysisTableData = ref<any>([]);
|
|
|
|
|
const showComponents = ref(true);
|
2025-11-05 14:39:02 +08:00
|
|
|
const performanceData = ref<any>([]);
|
|
|
|
|
const modelData = ref<any>([]);
|
|
|
|
|
const calculationFileData = ref<any>([]);
|
|
|
|
|
const resultData = ref<any>([]);
|
|
|
|
|
const curveData = ref<any>([]);
|
|
|
|
|
const reportData = ref<any>([]);
|
|
|
|
|
const isLoading = ref(false);
|
2025-11-26 18:49:29 +08:00
|
|
|
const changeChceckFun = async () => {
|
2025-11-05 14:39:02 +08:00
|
|
|
isLoading.value = true;
|
2025-12-15 11:09:46 +08:00
|
|
|
// showComponents.value = false;
|
2025-11-05 14:39:02 +08:00
|
|
|
checktableData.value = checkTableRef.value.tableRef.getCheckboxRecords();
|
|
|
|
|
console.log(checktableData.value);
|
|
|
|
|
|
|
|
|
|
const fileType = analysisType.value;
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < checkAnalysisList.value.length; i++) {
|
|
|
|
|
await getConvertData(checkAnalysisList.value[i], fileType);
|
2025-10-31 09:41:30 +08:00
|
|
|
}
|
2025-11-05 14:39:02 +08:00
|
|
|
isLoading.value = false;
|
2025-10-31 09:41:30 +08:00
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
showComponents.value = true;
|
|
|
|
|
}, 50);
|
2025-11-05 14:39:02 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const getConvertData = async (flag: any, type: any) => {
|
|
|
|
|
let data: any = [];
|
|
|
|
|
// const tasklist = [
|
|
|
|
|
// {
|
|
|
|
|
// id: 'simu_dc3a8eeb-9108-4058-b9a8-eb8427fb175a13657',
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// id: 'simu_a308aaba-db9e-40fd-9870-062a177f6faf78765',
|
|
|
|
|
// },
|
|
|
|
|
// ];
|
|
|
|
|
|
|
|
|
|
const tasklist = checktableData.value;
|
|
|
|
|
|
|
|
|
|
if (flag === 'numericalResult') {
|
|
|
|
|
if (type === '仿真工况' || type === '仿真算例') {
|
|
|
|
|
if (type === '仿真工况') {
|
|
|
|
|
for (let i = 0; i < tasklist.length; i++) {
|
2025-11-26 18:49:29 +08:00
|
|
|
const list = (await getAllRunResultByTaskIdFun(tasklist[i].uuid))?.performances;
|
2025-11-05 14:39:02 +08:00
|
|
|
data = data.concat(list);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2025-11-28 17:32:29 +08:00
|
|
|
for (let i = 0; i < tasklist.length; i++) {
|
2025-12-09 19:01:15 +08:00
|
|
|
const list = await getRunPerformanceFn(tasklist[i]);
|
2025-11-28 17:32:29 +08:00
|
|
|
data = data.concat(list);
|
|
|
|
|
}
|
2025-11-05 14:39:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
performanceData.value = data;
|
|
|
|
|
} else {
|
|
|
|
|
performanceData.value = checktableData.value;
|
|
|
|
|
}
|
|
|
|
|
} else if (flag === 'model') {
|
|
|
|
|
modelData.value = [];
|
|
|
|
|
if (type === '仿真工况' || type === '仿真算例') {
|
|
|
|
|
if (type === '仿真工况') {
|
|
|
|
|
for (let i = 0; i < tasklist.length; i++) {
|
2025-11-26 18:49:29 +08:00
|
|
|
const list = (await getAllRunResultByTaskIdFun(tasklist[i].uuid))?.runs;
|
2025-11-05 14:39:02 +08:00
|
|
|
data = data.concat(list);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
data = checktableData.value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const runs = data || [];
|
2025-11-28 17:32:29 +08:00
|
|
|
|
|
|
|
|
console.log(runs, 'runsruns');
|
|
|
|
|
|
|
|
|
|
if (runs.length) {
|
|
|
|
|
for (let i = 0; i < runs.length; i++) {
|
|
|
|
|
const datas = await getFileInfo(runs[i], 1);
|
|
|
|
|
modelData.value = modelData.value.concat(datas);
|
|
|
|
|
}
|
2025-11-05 14:39:02 +08:00
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
modelData.value = checktableData.value;
|
|
|
|
|
}
|
|
|
|
|
} else if (flag === 'calculationFile') {
|
|
|
|
|
calculationFileData.value = [];
|
|
|
|
|
if (type === '仿真工况' || type === '仿真算例') {
|
|
|
|
|
if (type === '仿真工况') {
|
|
|
|
|
for (let i = 0; i < tasklist.length; i++) {
|
2025-11-26 18:49:29 +08:00
|
|
|
const list = (await getAllRunResultByTaskIdFun(tasklist[i].uuid))?.runs;
|
2025-11-05 14:39:02 +08:00
|
|
|
data = data.concat(list);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
data = checktableData.value;
|
|
|
|
|
}
|
|
|
|
|
const runs = data || [];
|
2025-11-28 17:32:29 +08:00
|
|
|
if (runs.length) {
|
|
|
|
|
for (let i = 0; i < runs.length; i++) {
|
|
|
|
|
const datas = await getFileInfo(runs[i], 3);
|
|
|
|
|
calculationFileData.value = calculationFileData.value.concat(datas);
|
|
|
|
|
}
|
2025-11-05 14:39:02 +08:00
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
calculationFileData.value = checktableData.value;
|
|
|
|
|
}
|
|
|
|
|
} else if (flag === 'result') {
|
|
|
|
|
resultData.value = [];
|
|
|
|
|
|
|
|
|
|
if (type === '仿真工况' || type === '仿真算例') {
|
|
|
|
|
if (type === '仿真工况') {
|
|
|
|
|
for (let i = 0; i < tasklist.length; i++) {
|
2025-11-26 18:49:29 +08:00
|
|
|
const list = (await getAllRunResultByTaskIdFun(tasklist[i].uuid))?.runs;
|
2025-11-05 14:39:02 +08:00
|
|
|
data = data.concat(list);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
data = checktableData.value;
|
|
|
|
|
}
|
|
|
|
|
const runs = data || [];
|
2025-11-28 17:32:29 +08:00
|
|
|
if (runs.length) {
|
|
|
|
|
for (let i = 0; i < runs.length; i++) {
|
|
|
|
|
const datas = await getFileInfo(runs[i], 5);
|
|
|
|
|
resultData.value = resultData.value.concat(datas);
|
|
|
|
|
}
|
2025-11-05 14:39:02 +08:00
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
resultData.value = checktableData.value;
|
|
|
|
|
}
|
|
|
|
|
} else if (flag === 'curve') {
|
|
|
|
|
curveData.value = [];
|
|
|
|
|
if (type === '仿真工况' || type === '仿真算例') {
|
|
|
|
|
if (type === '仿真工况') {
|
|
|
|
|
for (let i = 0; i < tasklist.length; i++) {
|
2025-11-26 18:49:29 +08:00
|
|
|
const list = (await getAllRunResultByTaskIdFun(tasklist[i].uuid))?.runs;
|
2025-11-05 14:39:02 +08:00
|
|
|
data = data.concat(list);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
data = checktableData.value;
|
|
|
|
|
}
|
|
|
|
|
const runs = data || [];
|
2025-11-28 17:32:29 +08:00
|
|
|
if (runs.length) {
|
|
|
|
|
for (let i = 0; i < runs.length; i++) {
|
|
|
|
|
const datas = await getFileInfo(runs[i], 4);
|
|
|
|
|
curveData.value = curveData.value.concat(datas);
|
|
|
|
|
}
|
2025-11-05 14:39:02 +08:00
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
curveData.value = checktableData.value;
|
|
|
|
|
}
|
|
|
|
|
} else if (flag === 'report') {
|
|
|
|
|
reportData.value = [];
|
|
|
|
|
if (type === '仿真工况' || type === '仿真算例') {
|
|
|
|
|
if (type === '仿真工况') {
|
|
|
|
|
for (let i = 0; i < tasklist.length; i++) {
|
2025-11-26 18:49:29 +08:00
|
|
|
const list = (await getAllRunResultByTaskIdFun(tasklist[i].uuid))?.runs;
|
2025-11-05 14:39:02 +08:00
|
|
|
data = data.concat(list);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
data = checktableData.value;
|
|
|
|
|
}
|
|
|
|
|
const runs = data || [];
|
2025-11-28 17:32:29 +08:00
|
|
|
if (runs.length) {
|
|
|
|
|
for (let i = 0; i < runs.length; i++) {
|
|
|
|
|
const datas = await getFileInfo(runs[i], 2);
|
|
|
|
|
reportData.value = reportData.value.concat(datas);
|
|
|
|
|
}
|
2025-11-05 14:39:02 +08:00
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
reportData.value = checktableData.value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return data || [];
|
|
|
|
|
};
|
|
|
|
|
|
2025-11-26 18:49:29 +08:00
|
|
|
const getAllRunResultByTaskIdFun = async (id: any) => {
|
2025-11-05 14:39:02 +08:00
|
|
|
const param = {
|
|
|
|
|
taskId: id,
|
|
|
|
|
};
|
|
|
|
|
try {
|
|
|
|
|
const res: any = await getAllRunResultByTaskIdApi(param);
|
|
|
|
|
if (res && res.code === 200) {
|
|
|
|
|
let performanceList: any = [];
|
|
|
|
|
|
|
|
|
|
const runs: any = [];
|
2025-11-28 17:32:29 +08:00
|
|
|
if (res.data?.runResultResp?.length) {
|
|
|
|
|
for (let i = 0; i < res.data?.runResultResp.length; i++) {
|
|
|
|
|
performanceList = performanceList.concat(res.data.runResultResp[i].simulationPerformance);
|
2025-11-05 14:39:02 +08:00
|
|
|
|
2025-11-28 17:32:29 +08:00
|
|
|
const obj: any = {
|
|
|
|
|
...res.data.runResultResp[i].simulationRun,
|
|
|
|
|
taskName: res.data.runResultResp[i]?.simulationPerformance[0]?.taskName,
|
|
|
|
|
};
|
2025-11-05 14:39:02 +08:00
|
|
|
|
2025-11-28 17:32:29 +08:00
|
|
|
runs.push(obj);
|
|
|
|
|
}
|
2025-11-05 14:39:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
performances: performanceList,
|
|
|
|
|
runs,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.log(error);
|
|
|
|
|
}
|
2025-10-31 09:41:30 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const analysisTypeList = ref<any>([
|
|
|
|
|
{
|
|
|
|
|
value: 'model',
|
|
|
|
|
name: '模型文件',
|
2025-11-03 15:32:34 +08:00
|
|
|
includes: ['仿真工况', '仿真算例', '模型文件'],
|
2025-10-31 09:41:30 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 'calculationFile',
|
|
|
|
|
name: '计算文件',
|
2025-11-03 15:32:34 +08:00
|
|
|
includes: ['仿真工况', '仿真算例', '计算文件'],
|
2025-10-31 09:41:30 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 'numericalResult',
|
|
|
|
|
name: '数值结果',
|
2025-11-03 15:32:34 +08:00
|
|
|
includes: ['仿真工况', '仿真算例', '数据指标'],
|
2025-10-31 09:41:30 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 'result',
|
|
|
|
|
name: '云图结果',
|
2025-11-03 15:32:34 +08:00
|
|
|
includes: ['仿真工况', '仿真算例', '结果云图'],
|
2025-10-31 09:41:30 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 'curve',
|
|
|
|
|
name: '曲线结果',
|
2025-11-03 15:32:34 +08:00
|
|
|
includes: ['仿真工况', '仿真算例', '结果曲线'],
|
2025-10-31 09:41:30 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 'report',
|
|
|
|
|
name: '仿真报告',
|
2025-11-03 15:32:34 +08:00
|
|
|
includes: ['仿真工况', '仿真算例', '仿真报告'],
|
2025-10-31 09:41:30 +08:00
|
|
|
},
|
|
|
|
|
]);
|
|
|
|
|
|
2025-12-09 19:01:15 +08:00
|
|
|
const getcheckListLength = () => {
|
|
|
|
|
const list = analysisTypeList.value.filter((item: any) => {
|
|
|
|
|
return item.includes.includes(analysisType.value);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (list.length > 1) {
|
|
|
|
|
return true;
|
|
|
|
|
} else {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2025-10-31 09:41:30 +08:00
|
|
|
const checkTableName = ref<any>('');
|
|
|
|
|
|
2025-11-05 14:39:02 +08:00
|
|
|
const getFileInfo = async (data: any, fileType: any) => {
|
2025-11-28 17:32:29 +08:00
|
|
|
console.log(data, 'datadatadata');
|
|
|
|
|
|
2025-11-05 14:39:02 +08:00
|
|
|
const res: any = await getSimulationTaskFileApi({
|
|
|
|
|
taskId: '',
|
2025-12-03 16:04:19 +08:00
|
|
|
uuid: data.uuid,
|
2025-11-25 17:37:02 +08:00
|
|
|
fileBizType: fileType,
|
2025-11-05 14:39:02 +08:00
|
|
|
fileName: '',
|
|
|
|
|
startTime: '',
|
|
|
|
|
endTime: '',
|
|
|
|
|
current: 1,
|
|
|
|
|
size: 1000,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (res && res.code === 200) {
|
2025-11-28 17:32:29 +08:00
|
|
|
let list = [];
|
|
|
|
|
if (res?.data?.data?.length) {
|
|
|
|
|
list = res.data.data.map((item: any) => {
|
|
|
|
|
return {
|
|
|
|
|
...item,
|
|
|
|
|
runName: data.runName,
|
|
|
|
|
taskName: data.taskName,
|
|
|
|
|
taskId: data.taskId,
|
|
|
|
|
uuid: data.uuid,
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
}
|
2025-11-05 14:39:02 +08:00
|
|
|
|
|
|
|
|
return list;
|
|
|
|
|
} else {
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
};
|
2025-10-31 09:41:30 +08:00
|
|
|
|
2025-12-09 19:01:15 +08:00
|
|
|
const getRunPerformanceFn = async (data: any) => {
|
|
|
|
|
const res: any = await getRunPerformanceApi({
|
2025-11-28 17:32:29 +08:00
|
|
|
runId: data.uuid,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (res && res.code === 200) {
|
|
|
|
|
const list = res.data;
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2025-12-09 19:01:15 +08:00
|
|
|
watch(
|
|
|
|
|
() => props.analysisData,
|
|
|
|
|
async (newVal) => {
|
|
|
|
|
if (newVal) {
|
|
|
|
|
analysisType.value = newVal.flag;
|
|
|
|
|
analysisTableData.value = newVal.data;
|
2025-10-31 09:41:30 +08:00
|
|
|
|
2025-12-09 19:01:15 +08:00
|
|
|
checkTableName.value = newVal.tableName;
|
|
|
|
|
const list = analysisTypeList.value.filter((item: any) => {
|
|
|
|
|
return item.includes.includes(analysisType.value);
|
|
|
|
|
});
|
2025-10-31 09:41:30 +08:00
|
|
|
|
2025-12-09 19:01:15 +08:00
|
|
|
checkAnalysisList.value = list.map((item: any) => {
|
|
|
|
|
return item.value;
|
|
|
|
|
});
|
2025-10-31 09:41:30 +08:00
|
|
|
|
2025-12-09 19:01:15 +08:00
|
|
|
setTimeout(async () => {
|
|
|
|
|
checkTableRef.value?.setDataFun(analysisTableData.value);
|
|
|
|
|
}, 1000);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
deep: true,
|
|
|
|
|
immediate: true,
|
2025-10-31 09:41:30 +08:00
|
|
|
}
|
2025-12-09 19:01:15 +08:00
|
|
|
);
|
2025-10-31 09:41:30 +08:00
|
|
|
|
2025-11-26 18:49:29 +08:00
|
|
|
const checkChangeFun = (flag: any) => {
|
2025-10-31 09:41:30 +08:00
|
|
|
console.log(flag, 'flag');
|
|
|
|
|
console.log(checkAnalysisList.value, 'checkAnalysisList');
|
|
|
|
|
|
|
|
|
|
const list = analysisTypeList.value.filter((item: any) => {
|
|
|
|
|
return item.includes.includes(analysisType.value);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (checkAnalysisList.value.length === list.length) {
|
|
|
|
|
checkAll.value = true;
|
|
|
|
|
} else {
|
|
|
|
|
checkAll.value = false;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const checkAll = ref(true);
|
2025-11-26 18:49:29 +08:00
|
|
|
const checkAllChangeFun = () => {
|
2025-10-31 09:41:30 +08:00
|
|
|
const list = analysisTypeList.value.filter((item: any) => {
|
|
|
|
|
return item.includes.includes(analysisType.value);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (checkAll.value) {
|
|
|
|
|
checkAnalysisList.value = list.map((item: any) => {
|
|
|
|
|
return item.value;
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
checkAnalysisList.value = [];
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2025-11-26 18:49:29 +08:00
|
|
|
const getTitleFun = (flag: any) => {
|
2025-10-31 09:41:30 +08:00
|
|
|
const name = analysisTypeList.value.find((item: any) => {
|
|
|
|
|
return item.value === flag;
|
|
|
|
|
})?.name;
|
|
|
|
|
|
|
|
|
|
return name + '对比';
|
|
|
|
|
};
|
|
|
|
|
|
2025-11-03 15:32:34 +08:00
|
|
|
const contentToConvertRef = ref();
|
2025-11-26 18:49:29 +08:00
|
|
|
const exportPdfFun = async () => {
|
2025-11-05 14:39:02 +08:00
|
|
|
ElMessage.success('文件正在导出,请稍后');
|
2025-11-03 15:32:34 +08:00
|
|
|
const content = contentToConvertRef.value;
|
|
|
|
|
const canvas = await html2canvas(content);
|
|
|
|
|
const imgData = canvas.toDataURL('image/png');
|
|
|
|
|
const pdf = new jsPDF('p', 'mm', 'a4');
|
|
|
|
|
const imgWidth = pdf.internal.pageSize.getWidth();
|
|
|
|
|
const imgHeight = (canvas.height * imgWidth) / canvas.width;
|
|
|
|
|
pdf.addImage(imgData, 'PNG', 0, 0, imgWidth, imgHeight);
|
2025-11-14 16:01:14 +08:00
|
|
|
pdf.save(`分析报告_${dayjs().format('YYYYMMDDHHmm')}.pdf`); // 保存PDF文件
|
2025-11-03 15:32:34 +08:00
|
|
|
};
|
2025-10-31 09:41:30 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.content {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
overflow: auto;
|
|
|
|
|
|
|
|
|
|
.filter-analysis-content {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 40px;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
|
|
|
|
|
.check-all {
|
|
|
|
|
margin-right: 30px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.check-table-content {
|
|
|
|
|
width: 100%;
|
2025-12-09 19:01:15 +08:00
|
|
|
padding: 20px;
|
2025-10-31 09:41:30 +08:00
|
|
|
|
|
|
|
|
.loadcase-table-content {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.analysis-type-content {
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
|
|
.analysis-type-content-title {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 50px;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
.title-item {
|
|
|
|
|
border-left: 4px solid #409eff;
|
|
|
|
|
padding-left: 10px;
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.analysis-type-content-item {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|