update:任务执行界面功能优化,界面操作优化

This commit is contained in:
2025-12-16 11:19:40 +08:00
parent 499304ed44
commit b38e95f631
6 changed files with 123 additions and 42 deletions

View File

@@ -12,6 +12,7 @@
startTime: '',
endTime: '',
}"
:full-height="true"
:actionList="actionList"
>
<template #leftOptions v-if="taskInfo.status != 3">

View File

@@ -9,6 +9,7 @@
hidePagination
:actionList="actionList"
:export-params="excelParams"
:full-height="fullHeight"
>
<template #leftOptions>
<div class="operate-box">
@@ -54,7 +55,12 @@
import { ref, onMounted, nextTick } from 'vue';
import BaseTable from '@/components/common/table/baseTable.vue';
import { ElMessage } from 'element-plus';
import { getTaskPerformanceApi, batchAddTaskPerformanceApi, batchDeleteTaskPerformanceApi, getRunPerformanceApi } from '@/api/task/taskpool';
import {
getTaskPerformanceApi,
batchAddTaskPerformanceApi,
batchDeleteTaskPerformanceApi,
getRunPerformanceApi,
} from '@/api/task/taskpool';
import { FileUtil } from '@/utils/file';
import addTaskPerformance from './addTaskPerformance.vue';
import { editPerformanceApi, exportPerformanceApi } from '@/api/task/taskPerformance';
@@ -68,11 +74,11 @@ const props = defineProps({
},
runInfo: {
type: Object,
default: () => { },
default: () => {},
},
taskInfo: {
type: Object,
default: () => { },
default: () => {},
},
showSaveButton: {
type: Boolean,
@@ -82,6 +88,10 @@ const props = defineProps({
type: String,
default: 'task',
},
fullHeight: {
type: Boolean,
default: false,
},
});
const baseTableRef = ref();
const performanceVisible = ref(false);
@@ -91,7 +101,10 @@ const performanceData = ref<any>([]);
const getTaskPerformanceDataFun = async () => {
console.log(props.taskId);
console.log(props.runInfo);
const res: any = props.paramType === 'task' ? await getTaskPerformanceApi({ taskId: props.taskInfo?.id }) : await getRunPerformanceApi({ runId: props.runInfo?.uuid });
const res: any =
props.paramType === 'task'
? await getTaskPerformanceApi({ taskId: props.taskInfo?.id })
: await getRunPerformanceApi({ runId: props.runInfo?.uuid });
if (res && res.code === 200) {
performanceData.value = res.data;
@@ -99,10 +112,8 @@ const getTaskPerformanceDataFun = async () => {
if (baseTableRef.value) {
baseTableRef.value.setDataFun(performanceData.value);
}
}
// ElMessage.success('获取任务性能指标数据' + props.taskId);
};
const openAddPerformanceWindFun = () => {
@@ -110,20 +121,20 @@ const openAddPerformanceWindFun = () => {
};
const addPerformanceFun = async (data: any) => {
console.log(data, 'data');
data.flag = 'add';
const { fullData, visibleData, tableData, footerData } = baseTableRef.value.tableRef.getTableData();
const { fullData, visibleData, tableData, footerData } =
baseTableRef.value.tableRef.getTableData();
const existPerformance = fullData.find((item: any) => {
return item.nodeName === data.nodeName;
}) || null;
const existPerformance =
fullData.find((item: any) => {
return item.nodeName === data.nodeName;
}) || null;
if (existPerformance) {
ElMessage.warning('已存在该指标,无法新增!');
} else {
baseTableRef.value.tableRef.insertAt(data, -1);
}
console.log(fullData, 'fullData');
@@ -132,7 +143,6 @@ const addPerformanceFun = async (data: any) => {
console.log(footerData, 'footerData');
performanceVisible.value = false;
};
const deletePerformanceList = ref<any>([]);
@@ -141,11 +151,9 @@ const delPerformance = (row: any) => {
if (row.flag != 'add') {
deletePerformanceList.value.push(row);
}
};
const batchAddTaskPerformanceFun = async () => {
const list = baseTableRef.value.tableRef.getInsertRecords();
console.log(list, 'list');
@@ -183,7 +191,6 @@ const batchAddTaskPerformanceFun = async () => {
if (props.paramType === 'run') {
obj.runId = props.runInfo.uuid;
obj.taskId = props.runInfo.taskId;
}
console.log(obj, 'objobjobj');
@@ -211,9 +218,7 @@ const batchAddTaskPerformanceFun = async () => {
if (res && res.code === 200) {
// ElMessage.success('新增成功!');
} else {
}
};
const batchDeleteTaskPerformanceFun = async () => {
@@ -226,17 +231,13 @@ const batchDeleteTaskPerformanceFun = async () => {
}
const res: any = await batchDeleteTaskPerformanceApi(ids);
if (res && res.code === 200) {
} else {
}
};
const saveFun = async () => {
await batchAddTaskPerformanceFun();
await batchDeleteTaskPerformanceFun();
};
const uploadLocalFileFun = async (File: any) => {
@@ -323,7 +324,6 @@ const performanceInfoList = [
chineseName: 'uuid',
englishName: 'uuid',
},
];
const performanceFile = ref<any>({});
@@ -368,7 +368,6 @@ const handleLocalChangeExcelFun = async (uploadFile: any, uploadFiles: any) => {
}
for (let i = 0; i < newList.length; i++) {
if (!commonNameList.includes(newList[i].performanceName)) {
baseTableRef.value.tableRef.insertAt(newList[i]);
}
}
@@ -432,7 +431,6 @@ const getFormConfigureFun = async () => {
taskId: props.taskInfo.id,
};
}
}
};
@@ -471,11 +469,9 @@ const updatePerformanceFun = async (data: any) => {
const res: any = await editPerformanceApi(data);
if (res && res.code === 200) {
ElMessage.success('操作成功');
}
await baseTableRef.value.resetFun();
await baseTableRef.value.resetFun();
};
onMounted(async () => {

View File

@@ -1,6 +1,6 @@
<template>
<div class="run-detail-page">
<div class="run-title-box">
<div class="run-title-box" v-show="!leftFullScreen && !rightFullScreen">
<div class="task-info">
<div class="task-name">{{ currentRunNodeInfo?.runName }}</div>
<!-- <div class="task-executor">
@@ -18,11 +18,7 @@
<!-- <el-icon class="info" title="未开始" v-if="!runFlowPocesInfo?.status">
<InfoFilled />
</el-icon> -->
<el-icon
class="upload"
title="运行中"
v-if="runFlowPocesInfo?.status === 'running'"
>
<el-icon class="upload" title="运行中" v-if="runFlowPocesInfo?.status === 'running'">
<HelpFilled />
</el-icon>
<el-icon
@@ -68,7 +64,7 @@
</div>
</div>
<div class="run-flow-box">
<div class="run-flow-box" v-show="!leftFullScreen && !rightFullScreen">
<runFlowPage
v-if="runInfo.flowTemplate && showPage"
:run-info="runInfo"
@@ -77,11 +73,21 @@
</runFlowPage>
</div>
<div class="run-info-box">
<div class="info-box-left">
<div :class="leftFullScreen || rightFullScreen ? 'run-info-box is-all-page' : 'run-info-box'">
<div v-if="!rightFullScreen" :class="leftFullScreen ? 'info-box-left allpage ' : 'info-box-left'">
<div class="bottom-title">
<div class="title-name">节点详情</div>
<div class="title-operate"></div>
<div class="title-operate">
<el-icon
v-if="!leftFullScreen"
@click="leftFullScreen = !leftFullScreen"
class="icon-style"
><FullScreen
/></el-icon>
<el-icon v-else @click="leftFullScreen = !leftFullScreen" class="icon-style"
><Close
/></el-icon>
</div>
</div>
<div class="bottom-info-content">
@@ -112,10 +118,20 @@
</div>
</div>
</div>
<div class="info-box-right">
<div v-if="!leftFullScreen" :class="rightFullScreen ? 'info-box-right allpage ' : 'info-box-right'">
<div class="bottom-title">
<div class="title-name">作业相关</div>
<div class="title-operate"></div>
<div class="title-operate">
<el-icon
v-if="!rightFullScreen"
class="icon-style"
@click="rightFullScreen = !rightFullScreen"
><FullScreen
/></el-icon>
<el-icon v-else class="icon-style" @click="rightFullScreen = !rightFullScreen"
><Close
/></el-icon>
</div>
</div>
<div class="bottom-info-content">
<div class="tabs-box">
@@ -137,6 +153,7 @@
:param-type="'run'"
:run-info="runInfo"
:show-save-button="true"
:full-height="true"
></taskPerformance>
<runLogs v-if="taskActiveName === 'job-log'"></runLogs>
<ModelReview v-if="taskActiveName === '3D-model'"></ModelReview>
@@ -182,6 +199,9 @@ const statusList = ref(['未开始', '进行中', '已完成', '回传中', '异
const visible = ref(false);
const nodeActiveName = ref('param');
const taskActiveName = ref('job-list');
const leftFullScreen = ref(false);
const rightFullScreen = ref(false);
const showPage = ref(true);
const handleLeftClickFun = () => {};
@@ -304,6 +324,7 @@ watch(
.run-detail-page {
width: 100%;
height: 100%;
position: relative;
.run-title-box {
width: 100%;
@@ -410,6 +431,13 @@ watch(
display: flex;
align-items: center;
justify-content: flex-end;
padding-right: 10px;
.icon-style {
font-size: 16px;
color: var(--el-color-primary);
cursor: pointer;
}
}
}
@@ -431,6 +459,20 @@ watch(
}
}
}
.allpage {
width: 100%;
height: 100%;
}
}
.is-all-page {
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 20;
position: absolute;
}
.blue {
@@ -450,7 +492,7 @@ watch(
}
.success {
color: #67c23a;
color: #67c23a;
}
.error {

View File

@@ -19,6 +19,7 @@
keyResultType,
runId: runInfo.uuid,
}"
:full-height="true"
:action-list="actionList"
>
<template #leftOptions>
@@ -556,5 +557,10 @@ onMounted(async () => {
align-items: center;
justify-content: flex-end;
}
.dir-content{
width: 100%;
height: calc(100% - 50px);
}
}
</style>

View File

@@ -13,6 +13,7 @@
// uuid:nodeInfo.uuid
}"
:show-checkbox="true"
:action-list="actionList"
>
<template #leftOptions>
<el-upload :show-file-list="false" :before-upload="beforeUploadFun">
@@ -20,7 +21,13 @@
</el-upload>
<el-button type="primary" class="ml10" @click="downLoadFileFun">下载文件</el-button>
</template>
<template #fileSize="{ row }">
<span>{{ formatFileSize(row.fileSize) }}</span>
</template>
</BaseTable>
<FilePreview v-model="previewVisible" :fileId="currentRow?.id" />
</div>
</template>
@@ -29,6 +36,9 @@ import { ref, watch } from 'vue';
import BaseTable from '@/components/common/table/baseTable.vue';
import { queryRunDirApi, uploadRunFilesApi } from '@/api/project/run';
import { ElMessage } from 'element-plus';
import { downloadFileById } from '@/utils/file';
import FilePreview from '@/components/common/filePreview/index.vue';
import { formatFileSize } from '@/utils/file';
const env = import.meta.env;
@@ -89,6 +99,32 @@ const reloadFun = async () => {
}
};
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);
},
},
]);
watch(
() => props.nodeInfo,
(newVal) => {

View File

@@ -15,7 +15,7 @@
<div class="task-content">
<div class="tabs-component" v-if="activeName === 'performance'">
<taskPerformance :task-id="currentTaskInfo?.id" :show-save-button="true" :task-info="currentTaskInfo" ></taskPerformance>
<taskPerformance :task-id="currentTaskInfo?.id" :show-save-button="true" :task-info="currentTaskInfo" :full-height="true" ></taskPerformance>
</div>
<div class="tabs-component" v-if="activeName === 'picture'">
<resultImage :task-id="currentTaskInfo?.uuid"></resultImage>