From 2d31607c1139a40cf1098d03ec28f9eae00394c2 Mon Sep 17 00:00:00 2001
From: lijing1
Date: Tue, 10 Feb 2026 14:35:16 +0800
Subject: [PATCH] =?UTF-8?q?update:=E4=BB=BB=E5=8A=A1=E8=AF=A6=E6=83=85?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BC=96=E8=BE=91=E6=8A=A5=E5=91=8A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../common/report/reportInputDialog.vue | 46 ++++++++++++++++---
src/components/taskDetail/taskReport.vue | 6 ++-
.../components/leftTaskTree/index.vue | 2 +-
3 files changed, 46 insertions(+), 8 deletions(-)
diff --git a/src/components/common/report/reportInputDialog.vue b/src/components/common/report/reportInputDialog.vue
index 1d1919d..2f23ec5 100644
--- a/src/components/common/report/reportInputDialog.vue
+++ b/src/components/common/report/reportInputDialog.vue
@@ -46,17 +46,20 @@ import { ref, watch, nextTick } from 'vue';
import Dialog from '@/components/common/dialog/index.vue';
import { queryReportTemplateApi } from '@/api/capability/report';
import { editReportApi, editReportAndDownloadApi, queryTaskRunApi } from '@/api/project/run';
+import { getTaskDetailApi } from '@/api/project/task';
import ReportEdit from '@/components/common/report/reportEdit/index.vue';
import { ElMessage } from 'element-plus';
interface Props {
modelValue: boolean;
- data: any;
+ taskId?: any;
+ runId?: any;
}
const props = withDefaults(defineProps(), {
modelValue: false,
- data: {},
+ taskId: '',
+ runId: '',
});
watch(
@@ -92,7 +95,33 @@ const getReportListFun = () => {
queryReportTemplateApi(params).then((res: any) => {
if (res.code === 200) {
reportList.value = res.data.data;
- getRunDetailFun();
+ if (props.taskId) {
+ getTaskDetailFun();
+ }
+ if (props.runId) {
+ getRunDetailFun();
+ }
+ }
+ });
+};
+
+const getTaskDetailFun = () => {
+ const params = {
+ relatedResourceUuid: props.taskId,
+ };
+ getTaskDetailApi(params).then((res: any) => {
+ if (res.code === 200) {
+ // 编辑过算例报告的获取historyData
+ historyData.value = JSON.parse(res.data.reportContent);
+ if (historyData.value) {
+ // 匹配对应的报告模版数据data
+ const data = reportList.value.find((i: any) => i.uuid === res.data.reportTemplate);
+ if (!data) {
+ return;
+ }
+ reportData.value = data;
+ setReportDataFun(data);
+ }
}
});
};
@@ -100,7 +129,7 @@ const getReportListFun = () => {
const historyData = ref([]);
const getRunDetailFun = () => {
const params = {
- runId: props.data.uuid,
+ runId: props.runId,
};
queryTaskRunApi(params).then((res: any) => {
if (res.code === 200) {
@@ -133,12 +162,17 @@ const ReportEditRef = ref();
const saveFun = (download: boolean) => {
const fileName = reportData.value.templateName + '.docx';
const data = ReportEditRef.value?.getFormatDataFun();
- const params = {
- runId: props.data.uuid,
+ const params: any = {
reportTemplate: reportDataId.value,
reportContent: JSON.stringify(data),
fileName,
};
+ if (props.taskId) {
+ params.taskId = props.taskId;
+ }
+ if (props.runId) {
+ params.runId = props.runId;
+ }
let api: any = editReportApi;
if (download) {
api = editReportAndDownloadApi;
diff --git a/src/components/taskDetail/taskReport.vue b/src/components/taskDetail/taskReport.vue
index 944df97..ed5973b 100644
--- a/src/components/taskDetail/taskReport.vue
+++ b/src/components/taskDetail/taskReport.vue
@@ -10,6 +10,7 @@
:actionList="actionList"
>
+ 编辑报告
- 上传文件
+ 上传文件
下载文件
@@ -44,6 +45,7 @@
+
@@ -66,6 +68,7 @@ import { dataOverViewDeleteSimulationNodeFilesApi } from '@/api/data/dataOverVie
import { getSimulationTaskFilesApi } from '@/api/data/dataAnalysis';
import { NODE_TYPE } from '@/utils/enum/node';
import DragUploader from '@/components/common/dragUploader/index.vue';
+import ReportInputDialog from '@/components/common/report/reportInputDialog.vue';
const props = defineProps({
taskId: {
@@ -90,6 +93,7 @@ const currentId = ref(props.taskId);
const taskRunList = ref([]);
const nodeFIleId = ref('');
const accept = ref('');
+const reportInpDiaShow = ref(false);
// const env = import.meta.env;
// 获取任务下指标信息
diff --git a/src/views/task/execution/components/leftTaskTree/index.vue b/src/views/task/execution/components/leftTaskTree/index.vue
index 3f604dd..7382f02 100644
--- a/src/views/task/execution/components/leftTaskTree/index.vue
+++ b/src/views/task/execution/components/leftTaskTree/index.vue
@@ -201,7 +201,7 @@
-
+