fix:bug修复

This commit is contained in:
2026-02-26 14:32:19 +08:00
parent 5e54f0c652
commit 2672558a02
2 changed files with 101 additions and 91 deletions

View File

@@ -47,33 +47,43 @@
</BaseTable>
</DragUploader>
</div>
<div class="task-curve-page-right" v-if="showCsv">
<div class="task-curve-right-operate">
<span>列数</span>
<el-input
class="input-style"
size="small"
v-model="filterForm.lineNum"
@change="handleChangeNumFun"
/>
</div>
<div class="task-curve-right-content">
<div
class="img-item"
:style="{
width: `calc((100% / ${filterForm.lineNum}) - 20px)`,
height: `calc((100% / ${filterForm.lineNum}) - 20px)`,
}"
v-for="item in curveNumData"
:key="item"
>
<!-- <img class="task-img" :src="item.url" alt=""> -->
<div class="task-img" :id="'chart_' + item"></div>
<div class="img-title">{{ '图' + item }}</div>
<Dialog
v-model="showCsv"
diaTitle="曲线显示"
:width="'80%'"
:height="'80%'"
@close="handleCloseFun"
>
<div class="task-curve-page-right">
<div class="task-curve-right-operate">
<span>列数</span>
<el-input
class="input-style"
size="small"
v-model="filterForm.lineNum"
@change="handleChangeNumFun"
/>
</div>
<div class="task-curve-right-content" v-if="showCsvData">
<div
class="img-item"
:style="{
width: `calc((100% / ${filterForm.lineNum}) - 20px)`,
height: `calc((100% / ${filterForm.lineNum}) - 20px)`,
}"
v-for="item in curveNumData"
:key="item"
>
<!-- <img class="task-img" :src="item.url" alt=""> -->
<div class="task-img" :id="'chart_' + item"></div>
<div class="img-title">{{ '图' + item }}</div>
</div>
</div>
</div>
</div>
</Dialog>
<FilePreview v-model="previewVisible" :fileId="currentRow?.id" />
</div>
</template>
@@ -96,6 +106,8 @@ import AddFile from '@/components/common/addFile/index.vue';
import { getCSVDataApi, getSimulationTaskFilesApi } from '@/api/data/dataAnalysis';
import { NODE_TYPE } from '@/utils/enum/node';
import DragUploader from '@/components/common/dragUploader/index.vue';
import Dialog from '@/components/common/dialog/index.vue';
import { ElMessage } from 'element-plus';
const props = defineProps({
taskId: {
@@ -188,11 +200,17 @@ const deleteFun = async (row: any) => {
}
} catch {}
};
const showCsvData = ref(false);
const showTableDataCurveFun = () => {
showCsv.value = false;
const { tableData } = baseTableRef.value.tableRef.getTableData();
showCsvData.value = false;
curveNumData.value = [];
const tableData = baseTableRef.value.tableRef.getCheckboxRecords();
if (!tableData?.length) {
ElMessage.warning('请选择曲线后展示');
return;
}
curveList.value = tableData.map((item: any, index: any) => {
return {
...item,
@@ -206,9 +224,14 @@ const showTableDataCurveFun = () => {
if (curveList.value.length) {
showCsv.value = true;
showCsvData.value = true;
const list = curveList.value.map((item: any) => item.num);
curveNumData.value = Array.from(new Set(list));
getCommonNumCurveFun();
} else {
curveNumData.value = [];
showCsvData.value = false;
}
};
@@ -353,6 +376,9 @@ const beforeUploadFun = (file: any) => {
AddFileRef.value.addFileFun(file);
};
const handleCloseFun = () => {
showCsv.value = false;
};
onMounted(async () => {
getTaskRunDataFun();
accept.value = await getFileUploadAcceptFun('CANVAS_FILE_FORMAT');
@@ -416,55 +442,6 @@ onMounted(async () => {
}
}
.task-curve-page-right {
// width: calc(65% - 10px);
width: 100%;
height: 100%;
padding-left: 20px;
.task-curve-right-operate {
width: 100%;
height: 40px;
display: flex;
align-items: center;
}
.task-curve-right-content {
width: 100%;
height: calc(100% - 50px);
display: flex;
flex-wrap: wrap;
overflow: auto;
.img-item {
margin-right: 10px;
margin-bottom: 10px;
min-height: 100px;
.task-img {
width: 100%;
height: 100%;
border: 1px solid #ddd;
}
.img-title {
width: 100%;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
}
}
}
}
.input-style {
width: 50px;
margin-left: 5px;
margin-right: 10px;
}
.w50 {
width: 50px;
}
@@ -473,4 +450,53 @@ onMounted(async () => {
margin-left: 12px;
}
}
.task-curve-page-right {
// width: calc(65% - 10px);
width: 100%;
height: 100%;
padding-left: 20px;
.task-curve-right-operate {
width: 100%;
height: 40px;
display: flex;
align-items: center;
}
.task-curve-right-content {
width: 100%;
height: calc(100% - 50px);
display: flex;
flex-wrap: wrap;
overflow: auto;
.img-item {
margin-right: 10px;
margin-bottom: 10px;
min-height: 100px;
.task-img {
width: 100%;
height: 100%;
border: 1px solid #ddd;
}
.img-title {
width: 100%;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
}
}
}
}
.input-style {
width: 50px;
margin-left: 5px;
margin-right: 10px;
}
</style>

View File

@@ -1,6 +1,4 @@
<template>
<approvalTypeHeader :data="data" />
<div class="approvel-page">
<div class="approval-operate">
<el-form>
@@ -30,7 +28,6 @@
<script setup lang="ts">
import { nextTick, onMounted, ref, watch } from 'vue';
import approvalTypeHeader from './approvalTypeHeader.vue';
import { getDictionaryDataApi } from '@/api/system/systemData';
import { editTaskApi, getTaskDetailApi } from '@/api/project/task';
import { ElMessage } from 'element-plus';
@@ -47,19 +44,6 @@ const baseTableRef = ref<any>(null);
const taskId = ref<any>('');
const taskInfo = ref<any>({});
const difficult = ref<any>('1');
// watchEffect(async () => {
// if (props.data) {
// const approveContents = JSON.parse(props.data?.approveContents || '{}');
// taskId.value = approveContents?.taskId;
// taskInfo.value = await getTaskInfo(approveContents?.taskId);
// difficult.value = approveContents?.difficult.toString();
// if (taskId.value) {
// nextTick(() => {
// baseTableRef.value.resetFun();
// });
// }
// }
// });
const getTaskInfo = async (uuid: any) => {
const param = {