This commit is contained in:
2026-02-11 10:16:54 +08:00
5 changed files with 242 additions and 0 deletions

View File

@@ -0,0 +1,216 @@
<template>
<div class="task-performance-page">
<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.REVIEW_FILE"
tableName="TASK_DETAIL_UPLOAD_FILE"
callbackFlag="TASK_REPORT_UPLOAD_FINISHED"
multiple
:discipline="taskData?.discipline"
: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>
<script setup lang="ts">
import { ref, onMounted, watch } from 'vue';
import BaseTable from '@/components/common/table/baseTable.vue';
import { batchAddFileInfoForTaskApi } from '@/api/project/run';
import {
downloadFileById,
downloadFileByStream,
formatFileSize,
queryFileIdByNodeIdFun,
} from '@/utils/file';
import UploadFile from '@/components/common/uploadFile/index.vue';
import FilePreview from '@/components/common/filePreview/index.vue';
import AddFile from '@/components/common/addFile/index.vue';
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: {
type: String,
default: '',
},
showFilter: {
type: Boolean,
default: true,
},
showLeftOptions: {
type: Boolean,
default: true,
},
taskData: {
type: Object,
default: () => ({}),
},
});
const baseTableRef = ref();
const currentId = ref<any>(props.taskId);
const taskRunList = ref<any>([]);
const nodeFIleId = ref<any>('');
const accept = ref<any>('');
// const env = import.meta.env;
// 获取任务下指标信息
const getTaskRunInfoFun = async () => {
taskRunList.value = [
{
name: '当前任务',
id: props.taskId,
},
];
currentId.value = taskRunList.value[0].id;
};
const getfileType = (data: any) => {
const fileType = data.originalName.split('.').pop();
return fileType;
};
const currentRow = ref();
const previewVisible = ref(false);
const previewFileFun = (row: any) => {
currentRow.value = row;
previewVisible.value = true;
};
const actionList = ref([
{
title: '下载',
type: 'primary',
click: (row: any) => {
downloadFileById(row.id);
},
},
{
title: '预览',
type: 'primary',
click: (row: any) => {
previewFileFun(row);
},
},
{
title: '删除',
type: 'danger',
needConfirm: true,
confirmTip: '删除后不可恢复,确认删除吗?',
click: (row: any) => {
deleteFun(row);
},
hide: () => {
return !props.showLeftOptions;
},
},
]);
const deleteFun = async (row: any) => {
const param = {
deleteId: row.id,
dataType: 2,
};
try {
const res: any = await dataOverViewDeleteSimulationNodeFilesApi(param);
if (res && res.code === 200) {
baseTableRef.value.resetFun();
}
} catch {}
};
const uploadFinishedFun = (data: any) => {
if (data.callbackFlag === 'TASK_REPORT_UPLOAD_FINISHED') {
baseTableRef.value.resetFun();
}
};
const downLoadFun = async () => {
const data: any = baseTableRef.value.tableRef.getCheckboxRecords() || [];
if (data.length) {
for (let i = 0; i < data.length; i++) {
downloadFileByStream(data[i].id);
}
}
};
const apiParam = ref<any>({});
watch(
() => props.taskId,
(newVal) => {
if (newVal) {
apiParam.value = {
uuid: currentId,
fileBizType: FILE_TYPE.REVIEW_FILE,
fileName: '',
startTime: '',
endTime: '',
level: NODE_TYPE.TASK,
};
}
},
{
immediate: true,
deep: true,
}
);
const AddFileRef = ref<any>();
const beforeUploadFun = (file: any) => {
AddFileRef.value.addFileFun(file);
};
onMounted(async () => {
getTaskRunInfoFun();
// accept.value = await getFileUploadAcceptFun('REPORT_FILE_FORMAT');
nodeFIleId.value = await queryFileIdByNodeIdFun(props.taskId);
});
</script>
<style lang="scss" scoped>
.task-performance-page {
width: 100%;
height: 100%;
.ml12 {
margin-left: 12px;
}
}
</style>

View File

@@ -40,6 +40,7 @@ const props = defineProps({
default: '机器人',
},
});
const env = import.meta.env;
// 机器人 动画 有限元 工业设计 公差
// 1正常 2标红 3缩进
@@ -252,6 +253,9 @@ const getPageValue = (str: string) => {
const downLoadFileFun = (name: any) => {
console.log(name, 'name');
ElMessage.success('文件下载中请稍后!');
const url = `${env.VITE_API_STATIC_FILE}/${name.replace('《', '').replace('》', '')}.docx`;
// const url = `${env.VITE_API_STATIC_FILE}/测试word.docx`;
window.open(url);
};
</script>

View File

@@ -844,6 +844,7 @@ const getSubmitParamFun = async (appPath: any) => {
const creatorId = getUserId().toString();
const subRunId = flowNodeData.value.nodeId;
const asyncTaskId = flowNodeData.value.nodeDetailInfo?.asyncTaskId;
const outputFormat = flowNodeParamData.value.outputFormat;
return {
runId,
runName,
@@ -867,6 +868,7 @@ const getSubmitParamFun = async (appPath: any) => {
creatorId,
subRunId,
asyncTaskId,
outputFormat,
};
};

View File

@@ -10,6 +10,7 @@
<el-tab-pane label="曲线文件" name="canvas"></el-tab-pane>
<el-tab-pane label="视频文件" name="video"></el-tab-pane>
<el-tab-pane label="试验结果" name="experiment"></el-tab-pane>
<el-tab-pane label="复盘数据" name="review-data"></el-tab-pane>
<el-tab-pane label="任务信息" name="taskInfo" v-if="showTaskInfo"></el-tab-pane>
<!-- <el-tab-pane label="交付物" name="deliverable"></el-tab-pane> -->
@@ -88,6 +89,12 @@
:disabled="!showLeftOptions"
></taskInfoPage>
</div>
<div class="tabs-component" v-if="activeName === 'review-data'">
<reviewData
:task-id="currentTaskInfo?.uuid"
:show-left-options="showLeftOptions"
></reviewData>
</div>
</div>
<Dialog
@@ -148,6 +155,7 @@ import task3DModel from '@/components/taskDetail/task3DModel.vue';
import taskInfoPage from '@/components/taskDetail/taskInfo.vue';
import { getSimulationTaskFilesApi } from '@/api/data/dataAnalysis';
import videoFile from '@/components/taskDetail/videoFile.vue';
import reviewData from '@/components/taskDetail/reviewData.vue';
const props = defineProps({
taskInfo: {

View File

@@ -124,6 +124,17 @@
></taskDemand>
</div>
</el-tab-pane>
<el-tab-pane label="复盘数据" name="review-data">
<div class="task-tab-content">
<reviewData
v-if="activeTab === 'review-data'"
:task-id="currentTaskInfo?.uuid"
:taskData="currentTaskInfo"
:show-left-options="showLeftOptions"
></reviewData>
</div>
</el-tab-pane>
<!-- <el-tab-pane label="交付物" name="deliverables">
<div class="task-tab-content">
<taskDeliverable
@@ -195,6 +206,7 @@ import runVersionTree from '@/views/task/execution/components/runDetailPage/runP
import taskDemand from '@/components/taskDetail/taskDemand.vue';
import { getSimulationTaskFilesApi } from '@/api/data/dataAnalysis';
import videoFile from '@/components/taskDetail/videoFile.vue';
import reviewData from '@/components/taskDetail/reviewData.vue';
const emits = defineEmits(['closeFn', 'updateFn']);
const props = defineProps({