update 项目详情增加拖拽上传 剩余试验结果模块,需改写

This commit is contained in:
2026-02-04 17:34:51 +08:00
parent 363024309a
commit 4c542fdb43
5 changed files with 239 additions and 203 deletions

View File

@@ -1,41 +1,44 @@
<template>
<div class="task-performance-page">
<div class="task-img-box">
<BaseTable
tableName="TASK_IMAGE_FILE"
ref="baseTableRef"
:api="getSimulationTaskFilesApi"
:params="apiParam"
:show-checkbox="true"
:actionList="actionList"
:full-height="true"
>
<template v-if="showLeftOptions" #leftOptions>
<AddFile
:accept="accept"
:api="batchAddFileInfoForTaskApi"
:fileType="FILE_TYPE.PNG_FILE"
tableName="TASK_DETAIL_UPLOAD_FILE"
callbackFlag="COMMON_FILE_UPLOAD_FINISHED"
multiple
:data="{
dirId: nodeFIleId,
projectId: null,
uuid: taskId,
}"
@finished="uploadFinishedFun"
>
<el-button>上传文件</el-button>
</AddFile>
<el-button type="primary" class="ml12" @click="downLoadFun">下载文件</el-button>
</template>
<template #type="{ row }">
<span>{{ getfileType(row) }}</span>
</template>
<template #fileSize="{ row }">
<span>{{ row.formatFileSize }}</span>
</template>
</BaseTable>
<DragUploader @beforeUpload="beforeUploadFun">
<BaseTable
tableName="TASK_IMAGE_FILE"
ref="baseTableRef"
:api="getSimulationTaskFilesApi"
:params="apiParam"
:show-checkbox="true"
:actionList="actionList"
:full-height="true"
>
<template v-if="showLeftOptions" #leftOptions>
<AddFile
ref="AddFileRef"
:accept="accept"
:api="batchAddFileInfoForTaskApi"
:fileType="FILE_TYPE.PNG_FILE"
tableName="TASK_DETAIL_UPLOAD_FILE"
callbackFlag="RESULT_IMAGE_UPLOAD_FINISHED"
multiple
:data="{
dirId: nodeFIleId,
projectId: null,
uuid: taskId,
}"
@finished="uploadFinishedFun"
>
<el-button>上传文件</el-button>
</AddFile>
<el-button type="primary" class="ml12" @click="downLoadFun">下载文件</el-button>
</template>
<template #type="{ row }">
<span>{{ getfileType(row) }}</span>
</template>
<template #fileSize="{ row }">
<span>{{ row.formatFileSize }}</span>
</template>
</BaseTable>
</DragUploader>
</div>
<FilePreview v-model="previewVisible" :fileId="currentRow?.id" />
@@ -59,6 +62,7 @@ import FilePreview from '@/components/common/filePreview/index.vue';
import AddFile from '@/components/common/addFile/index.vue';
import { dataOverViewDeleteSimulationNodeFilesApi } from '@/api/data/dataOverView';
import { getSimulationTaskFilesApi } from '@/api/data/dataAnalysis';
import DragUploader from '@/components/common/dragUploader/index.vue';
const props = defineProps({
taskId: {
@@ -177,7 +181,7 @@ watch(
);
const uploadFinishedFun = (data: any) => {
if (data.callbackFlag === 'COMMON_FILE_UPLOAD_FINISHED') {
if (data.callbackFlag === 'RESULT_IMAGE_UPLOAD_FINISHED') {
baseTableRef.value.resetFun();
}
};
@@ -190,7 +194,10 @@ const downLoadFun = async () => {
}
}
};
const AddFileRef = ref<any>();
const beforeUploadFun = (file: any) => {
AddFileRef.value.addFileFun(file);
};
onMounted(async () => {
accept.value = await getFileUploadAcceptFun('PNG_FILE_FORMAT');
nodeFIleId.value = await queryFileIdByNodeIdFun(props.taskId);

View File

@@ -1,49 +1,51 @@
<template>
<div class="task-performance-page">
<BaseTable
tableName="TASK_MODEL_FILE"
ref="baseTableRef"
:api="getSimulationTaskFilesApi"
showCheckbox
:params="apiParam"
:actionList="actionList"
>
<template v-if="showLeftOptions" #leftOptions>
<AddFile
:accept="accept"
:api="batchAddFileInfoForTaskApi"
:fileType="FILE_TYPE.MODEL_3D_FILE"
tableName="TASK_DETAIL_UPLOAD_FILE"
callbackFlag="COMMON_FILE_UPLOAD_FINISHED"
multiple
:data="{
dirId: nodeFIleId,
projectId: null,
uuid: currentId,
}"
@finished="uploadFinishedFun"
>
<el-button>上传文件</el-button>
</AddFile>
<el-button class="ml12" type="primary" @click="downLoadFun">下载文件</el-button>
</template>
<template #type="{ row }">
<span>{{ getfileType(row) }}</span>
</template>
<template #fileSize="{ row }">
<span>{{ formatFileSize(row.fileSize) }}</span>
</template>
<template #operate="{ row }">
<el-button link type="primary">
<UploadFile v-model="row.id" :name="'下载'" />
</el-button>
</template>
<template #fileType="{ row }">
<fileTypeChange :id="row.id" v-model="row.fileType" :disabled="disabled"></fileTypeChange>
</template>
</BaseTable>
<DragUploader @beforeUpload="beforeUploadFun">
<BaseTable
tableName="TASK_MODEL_FILE"
ref="baseTableRef"
:api="getSimulationTaskFilesApi"
showCheckbox
:params="apiParam"
:actionList="actionList"
>
<template v-if="showLeftOptions" #leftOptions>
<AddFile
:accept="accept"
ref="AddFileRef"
:api="batchAddFileInfoForTaskApi"
:fileType="FILE_TYPE.MODEL_3D_FILE"
tableName="TASK_DETAIL_UPLOAD_FILE"
callbackFlag="TASK_3D_UPLOAD_FINISHED"
multiple
:data="{
dirId: nodeFIleId,
projectId: null,
uuid: currentId,
}"
@finished="uploadFinishedFun"
>
<el-button>上传文件</el-button>
</AddFile>
<el-button class="ml12" type="primary" @click="downLoadFun">下载文件</el-button>
</template>
<template #type="{ row }">
<span>{{ getfileType(row) }}</span>
</template>
<template #fileSize="{ row }">
<span>{{ formatFileSize(row.fileSize) }}</span>
</template>
<template #operate="{ row }">
<el-button link type="primary">
<UploadFile v-model="row.id" :name="'下载'" />
</el-button>
</template>
<template #fileType="{ row }">
<fileTypeChange :id="row.id" v-model="row.fileType" :disabled="disabled"></fileTypeChange>
</template>
</BaseTable>
</DragUploader>
<FilePreview v-model="previewVisible" :fileId="currentRow?.id" />
</div>
</template>
@@ -66,6 +68,7 @@ import { dataOverViewDeleteSimulationNodeFilesApi } from '@/api/data/dataOverVie
import fileTypeChange from '@/components/common/fileTable/fileTypeChange.vue';
import { getSimulationTaskFilesApi } from '@/api/data/dataAnalysis';
import { NODE_TYPE } from '@/utils/enum/node';
import DragUploader from '@/components/common/dragUploader/index.vue';
const props = defineProps({
taskId: {
@@ -158,7 +161,7 @@ const deleteFun = async (row: any) => {
};
const uploadFinishedFun = (data: any) => {
if (data.callbackFlag === 'COMMON_FILE_UPLOAD_FINISHED') {
if (data.callbackFlag === 'TASK_3D_UPLOAD_FINISHED') {
baseTableRef.value.resetFun();
}
};
@@ -173,7 +176,10 @@ const downLoadFun = async () => {
};
const apiParam = ref<any>({});
const AddFileRef = ref<any>();
const beforeUploadFun = (file: any) => {
AddFileRef.value.addFileFun(file);
};
watch(
() => props.taskId,
(newVal) => {

View File

@@ -1,45 +1,50 @@
<template>
<div class="task-performance-page">
<div class="task-curve-page-left">
<BaseTable
tableName="TASK_CANVAS_FILE"
ref="baseTableRef"
:api="getSimulationTaskFilesApi"
:params="apiParam"
:show-checkbox="true"
:full-height="true"
:actionList="actionList"
>
<template v-if="showLeftOptions" #leftOptions>
<AddFile
:accept="accept"
:api="batchAddFileInfoForTaskApi"
:fileType="FILE_TYPE.CANVAS_FILE"
tableName="TASK_DETAIL_UPLOAD_FILE"
callbackFlag="COMMON_FILE_UPLOAD_FINISHED"
multiple
:data="{
dirId: nodeFIleId,
projectId: null,
uuid: taskId,
}"
@finished="uploadFinishedFun"
>
<el-button>上传文件</el-button>
</AddFile>
<el-button class="ml12" type="primary" @click="showTableDataCurveFun">显示曲线</el-button>
<el-button type="primary" @click="downLoadFun">下载文件</el-button>
</template>
<template #type="{ row }">
<span>{{ getfileType(row) }}</span>
</template>
<template #fileSize="{ row }">
<span>{{ row.formatFileSize }}</span>
</template>
<!-- <template #num="{ row, column }">
<DragUploader @beforeUpload="beforeUploadFun">
<BaseTable
tableName="TASK_CANVAS_FILE"
ref="baseTableRef"
:api="getSimulationTaskFilesApi"
:params="apiParam"
:show-checkbox="true"
:full-height="true"
:actionList="actionList"
>
<template v-if="showLeftOptions" #leftOptions>
<AddFile
ref="AddFileRef"
:accept="accept"
:api="batchAddFileInfoForTaskApi"
:fileType="FILE_TYPE.CANVAS_FILE"
tableName="TASK_DETAIL_UPLOAD_FILE"
callbackFlag="TASK_CURVE_UPLOAD_FINISHED"
multiple
:data="{
dirId: nodeFIleId,
projectId: null,
uuid: taskId,
}"
@finished="uploadFinishedFun"
>
<el-button>上传文件</el-button>
</AddFile>
<el-button class="ml12" type="primary" @click="showTableDataCurveFun"
>显示曲线</el-button
>
<el-button type="primary" @click="downLoadFun">下载文件</el-button>
</template>
<template #type="{ row }">
<span>{{ getfileType(row) }}</span>
</template>
<template #fileSize="{ row }">
<span>{{ row.formatFileSize }}</span>
</template>
<!-- <template #num="{ row, column }">
<el-input class="w50" v-model="row[column.field]"></el-input>
</template> -->
</BaseTable>
</BaseTable>
</DragUploader>
</div>
<div class="task-curve-page-right" v-if="showCsv">
<div class="task-curve-right-operate">
@@ -89,6 +94,7 @@ import FilePreview from '@/components/common/filePreview/index.vue';
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';
const props = defineProps({
taskId: {
@@ -303,7 +309,7 @@ const getCsvFormatDataFun = (data: any, num: any) => {
};
const uploadFinishedFun = (data: any) => {
if (data.callbackFlag === 'COMMON_FILE_UPLOAD_FINISHED') {
if (data.callbackFlag === 'TASK_CURVE_UPLOAD_FINISHED') {
baseTableRef.value.resetFun();
}
};
@@ -337,6 +343,10 @@ watch(
deep: true,
}
);
const AddFileRef = ref<any>();
const beforeUploadFun = (file: any) => {
AddFileRef.value.addFileFun(file);
};
onMounted(async () => {
getTaskRunDataFun();

View File

@@ -1,45 +1,47 @@
<template>
<div class="task-performance-page">
<BaseTable
tableName="TASK_MODEL_FILE"
ref="baseTableRef"
:api="getSimulationTaskFilesApi"
showCheckbox
:params="apiParam"
:actionList="actionList"
>
<template v-if="showLeftOptions" #leftOptions>
<AddFile
:accept="accept"
:api="batchAddFileInfoForTaskApi"
:fileType="FILE_TYPE.CALCULATION_FILE"
tableName="TASK_DETAIL_UPLOAD_FILE"
callbackFlag="COMMON_FILE_UPLOAD_FINISHED"
multiple
:data="{
dirId: nodeFIleId,
projectId: null,
uuid: taskId,
}"
@finished="uploadFinishedFun"
>
<el-button>上传文件</el-button>
</AddFile>
<el-button class="ml12" type="primary" @click="downLoadFun">下载文件</el-button>
</template>
<template #type="{ row }">
<span>{{ getfileType(row) }}</span>
</template>
<template #fileSize="{ row }">
<span>{{ formatFileSize(row.fileSize) }}</span>
</template>
<template #operate="{ row }">
<el-button link type="primary">
<UploadFile v-model="row.id" :name="'下载'" />
</el-button>
</template>
</BaseTable>
<DragUploader @beforeUpload="beforeUploadFun">
<BaseTable
tableName="TASK_MODEL_FILE"
ref="baseTableRef"
:api="getSimulationTaskFilesApi"
showCheckbox
:params="apiParam"
:actionList="actionList"
>
<template v-if="showLeftOptions" #leftOptions>
<AddFile
ref="AddFileRef"
:accept="accept"
:api="batchAddFileInfoForTaskApi"
:fileType="FILE_TYPE.CALCULATION_FILE"
tableName="TASK_DETAIL_UPLOAD_FILE"
callbackFlag="TASK_MODEL_UPLOAD_FINISHED"
multiple
:data="{
dirId: nodeFIleId,
projectId: null,
uuid: taskId,
}"
@finished="uploadFinishedFun"
>
<el-button>上传文件</el-button>
</AddFile>
<el-button class="ml12" type="primary" @click="downLoadFun">下载文件</el-button>
</template>
<template #type="{ row }">
<span>{{ getfileType(row) }}</span>
</template>
<template #fileSize="{ row }">
<span>{{ formatFileSize(row.fileSize) }}</span>
</template>
<template #operate="{ row }">
<el-button link type="primary">
<UploadFile v-model="row.id" :name="'下载'" />
</el-button>
</template>
</BaseTable>
</DragUploader>
<FilePreview v-model="previewVisible" :fileId="currentRow?.id" />
</div>
</template>
@@ -61,6 +63,7 @@ import {
import { dataOverViewDeleteSimulationNodeFilesApi } from '@/api/data/dataOverView';
import { getSimulationTaskFilesApi } from '@/api/data/dataAnalysis';
import { NODE_TYPE } from '@/utils/enum/node';
import DragUploader from '@/components/common/dragUploader/index.vue';
const props = defineProps({
taskId: {
@@ -148,7 +151,7 @@ const deleteFun = async (row: any) => {
};
const uploadFinishedFun = (data: any) => {
if (data.callbackFlag === 'COMMON_FILE_UPLOAD_FINISHED') {
if (data.callbackFlag === 'TASK_MODEL_UPLOAD_FINISHED') {
baseTableRef.value.resetFun();
}
};
@@ -182,7 +185,10 @@ watch(
deep: true,
}
);
const AddFileRef = ref<any>();
const beforeUploadFun = (file: any) => {
AddFileRef.value.addFileFun(file);
};
onMounted(async () => {
getTaskRunInfoFun();
nodeFIleId.value = await queryFileIdByNodeIdFun(props.taskId);

View File

@@ -1,45 +1,47 @@
<template>
<div class="task-performance-page">
<BaseTable
tableName="TASK_REPORT"
:api="getSimulationTaskFilesApi"
:params="apiParam"
ref="baseTableRef"
:showCheckbox="true"
:actionList="actionList"
>
<template v-if="showLeftOptions" #leftOptions>
<AddFile
:accept="accept"
:api="batchAddFileInfoForTaskApi"
:fileType="FILE_TYPE.REPORT_FILE"
tableName="TASK_DETAIL_UPLOAD_FILE"
callbackFlag="COMMON_FILE_UPLOAD_FINISHED"
multiple
:data="{
dirId: nodeFIleId,
projectId: null,
uuid: taskId,
}"
@finished="uploadFinishedFun"
>
<el-button>上传文件</el-button>
</AddFile>
<el-button class="ml12" type="primary" @click="downLoadFun">下载文件</el-button>
</template>
<template #type="{ row }">
<span>{{ getfileType(row) }}</span>
</template>
<template #fileSize="{ row }">
<span>{{ formatFileSize(row.fileSize) }}</span>
</template>
<template #operate="{ row }">
<el-button link type="primary">
<UploadFile v-model="row.id" :name="'下载'" />
</el-button>
</template>
</BaseTable>
<DragUploader @beforeUpload="beforeUploadFun">
<BaseTable
tableName="TASK_REPORT"
:api="getSimulationTaskFilesApi"
:params="apiParam"
ref="baseTableRef"
:showCheckbox="true"
:actionList="actionList"
>
<template v-if="showLeftOptions" #leftOptions>
<AddFile
:accept="accept"
ref="AddFileRef"
:api="batchAddFileInfoForTaskApi"
:fileType="FILE_TYPE.REPORT_FILE"
tableName="TASK_DETAIL_UPLOAD_FILE"
callbackFlag="TASK_REPORT_UPLOAD_FINISHED"
multiple
:data="{
dirId: nodeFIleId,
projectId: null,
uuid: taskId,
}"
@finished="uploadFinishedFun"
>
<el-button>上传文件</el-button>
</AddFile>
<el-button class="ml12" type="primary" @click="downLoadFun">下载文件</el-button>
</template>
<template #type="{ row }">
<span>{{ getfileType(row) }}</span>
</template>
<template #fileSize="{ row }">
<span>{{ formatFileSize(row.fileSize) }}</span>
</template>
<template #operate="{ row }">
<el-button link type="primary">
<UploadFile v-model="row.id" :name="'下载'" />
</el-button>
</template>
</BaseTable>
</DragUploader>
<FilePreview v-model="previewVisible" :fileId="currentRow?.id" />
</div>
</template>
@@ -62,6 +64,7 @@ import { FILE_TYPE } from '@/utils/enum/file';
import { dataOverViewDeleteSimulationNodeFilesApi } from '@/api/data/dataOverView';
import { getSimulationTaskFilesApi } from '@/api/data/dataAnalysis';
import { NODE_TYPE } from '@/utils/enum/node';
import DragUploader from '@/components/common/dragUploader/index.vue';
const props = defineProps({
taskId: {
@@ -151,7 +154,7 @@ const deleteFun = async (row: any) => {
};
const uploadFinishedFun = (data: any) => {
if (data.callbackFlag === 'COMMON_FILE_UPLOAD_FINISHED') {
if (data.callbackFlag === 'TASK_REPORT_UPLOAD_FINISHED') {
baseTableRef.value.resetFun();
}
};
@@ -185,6 +188,10 @@ watch(
deep: true,
}
);
const AddFileRef = ref<any>();
const beforeUploadFun = (file: any) => {
AddFileRef.value.addFileFun(file);
};
onMounted(async () => {
getTaskRunInfoFun();