This commit is contained in:
weibl
2025-11-26 10:18:55 +08:00
20 changed files with 440 additions and 83 deletions

View File

@@ -83,3 +83,32 @@ export const getTaskRunVersionApi = (params: any) => {
export const getRunVersionApi = (params: any) => {
return post(`${PREFIX}run/getRunVersion`, params);
};
/**
*算例录入关键结果
* @param params
* @returns
*/
export const addSimulationKeyResultApi = (params: any) => {
return upload(`${PREFIX}run/addSimulationKeyResult`, params);
};
/**
* 查询算例关键结果列表
* @param params runId keyResultType size current
* @returns
*/
export const listSimulationKeyResult = (params: any) => {
return post(`${PREFIX}run/listSimulationKeyResult`, params);
};
/**
*删除算例关键结果列表
* @param params
* @returns
*/
export const deleteSimulationKeyResultApi = (params: any) => {
return post(`${PREFIX}run/deleteSimulationKeyResult`, params);
};

View File

@@ -54,3 +54,8 @@ export const batchAddTaskPerformanceApi = (params: any) => {
export const batchDeleteTaskPerformanceApi = (params: any) => {
return post(`${PREFIX}taskPerformance/batchDeleteTaskPerformance`, params);
};
export const getRunPerformanceApi = (params: any) => {
return get(`${PREFIX}taskPerformance/getRunPerformance`, params);
};

View File

@@ -4,6 +4,7 @@
:title="diaTitle"
@open="openFun"
draggable
appendToBody
v-bind="$attrs"
>
<template v-for="(name) in Object.keys($slots)" :key="name" #[name]="scope">

View File

@@ -10,14 +10,22 @@
@change="onChange"
/>
<div v-else class="plain-label">
<!-- <el-icon class="view" @click="previewFlowFun">
<View />
</el-icon> -->
{{ selectedLabel }}
</div>
<flowViewDialog
v-model:showDialog="flowVisible"
:flowTemplateCode="selected"
></flowViewDialog>
</div>
</template>
<script setup lang="ts">
import { ref, watch, computed } from 'vue';
import { useTaskStore } from '@/stores/taskPool';
import flowViewDialog from '@/components/common/flow/flowViewDialog.vue';
interface Props {
modelValue?: any;
@@ -57,21 +65,33 @@ const onChange = (val: any) => {
emits('change', val);
};
const flowVisible = ref(false);
const previewFlowFun = () => {
flowVisible.value = true;
};
</script>
<style scoped lang="scss">
.full {
width: 100%;
}
.plain-label {
display: inline-block;
width: 100%;
line-height: 32px;
color: #303133;
padding: 0 8px;
box-sizing: border-box;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: inline-flex;
align-items: center;
gap: 6px;
vertical-align: middle;
line-height: 1;
.view {
display: inline-flex;
align-items: center;
justify-content: center;
width: 20px;
height: 20px;
cursor: pointer;
color: var(--el-color-primary);
margin-right: 0;
}
}
</style>

View File

@@ -13,15 +13,20 @@
placeholder="请选择"
/>
<span v-else class="plain-label">
<el-icon class="view" @click="previewFileFun">
<View />
</el-icon>
{{ modelName || displayValue }}
</span>
<FilePreview v-if="currentFileId" v-model="previewVisible" :fileId="currentFileId" />
</template>
<script setup lang="ts">
import { onMounted, ref, watch, nextTick } from 'vue';
import { onMounted, ref, watch, nextTick, computed } from 'vue';
import { dataListDirApi, dataQueryDirApi } from '@/api/data/data';
import { cloneDeep } from 'lodash-es';
import type { CascaderProps } from 'element-plus';
import FilePreview from '@/components/common/filePreview/index.vue';
interface Props {
modelValue?: any;
@@ -42,7 +47,7 @@ const emit = defineEmits(['update:modelValue', 'update:modelName']);
const selected = ref<string[]>(props.modelValue ? String(props.modelValue).split(',') : []);
const optionsKey = ref<number>(0);
const onCascaderChange = (val: any ) => {
const onCascaderChange = (val: any) => {
const ids = Array.isArray(val) ? val.map(String) : [];
emit('update:modelValue', ids.join(','));
selected.value = ids;
@@ -150,6 +155,18 @@ async function buildOptionsFromIds(ids: string[]) {
return;
}
const currentFileId = computed(() => {
const ids = selected.value;
if (ids.length > 0) {
return Number(ids[ids.length - 1]);
}
return null;
});
const previewVisible = ref(false);
const previewFileFun = () => {
previewVisible.value = true;
};
// async function loadDisplayNames(ids: string[]) {
// if (!ids || ids.length === 0) {
// displayValue.value = '';
@@ -230,4 +247,21 @@ onMounted(() => {
:deep(.full) {
width: 100%;
}
.plain-label {
display: inline-flex;
align-items: center;
gap: 6px;
vertical-align: middle;
line-height: 1;
.view {
display: inline-flex;
align-items: center;
justify-content: center;
width: 20px;
height: 20px;
cursor: pointer;
color: var(--el-color-primary);
margin-right: 0;
}
}
</style>

View File

@@ -1,6 +1,6 @@
<template>
<div class="comp-upload-list">
<div class="btn" @click="listVisible = true"><el-icon :size="22"><Upload /></el-icon></div>
<div ref="dragRef" class="btn" @click="openFun" @mousedown="startDragFun"><el-icon :size="22"><Upload /></el-icon></div>
<el-drawer
title="上传列表"
v-model="listVisible"
@@ -63,6 +63,12 @@ const UPLOAD_FILE_STATUS: any = { // TODO
'2': '上传完成',
};
const dragRef = ref<any>();
let isDragging = false;
let isDragged = false;
let offsetX = 0;
let offsetY = 0;
emitter.on('ADD_UPLOAD_FILE', (addData: any) => {
const data = addData.data;
data.status = '0'; // 默认状态
@@ -159,9 +165,66 @@ const uploadFun = async(params: any) => {
return data;
};
const openFun = () => {
if (isDragged) {
isDragged = false;
return;
}
listVisible.value = true;
};
const removeFun = (index: any) => {
listData.value.splice(index, 1);
};
const startDragFun = (e: any) => {
isDragging = true;
const rect = dragRef.value.getBoundingClientRect();
offsetX = e.clientX - rect.left;
offsetY = e.clientY - rect.top;
document.addEventListener('mousemove', onDragFun);
document.addEventListener('mouseup', stopDragFun);
};
const onDragFun = (e: any) => {
if (!isDragging) {
return;
}
const el = dragRef.value;
const width = el.offsetWidth;
const height = el.offsetHeight;
let x = e.clientX - offsetX;
let y = e.clientY - offsetY;
isDragged = true;
const maxX = window.innerWidth - width;
const maxY = window.innerHeight - height;
x = Math.max(0, Math.min(x, maxX));
y = Math.max(0, Math.min(y, maxY));
if (x <= 0) {
x = 0;
isDragging = false;
}
if (x >= maxX) {
x = maxX;
isDragging = false;
}
if (y <= 0) {
y = 0;
isDragging = false;
}
if (y >= maxY) {
y = maxY;
isDragging = false;
}
el.style.left = x + 'px';
el.style.top = y + 'px';
};
const stopDragFun = () => {
setTimeout(() => {
isDragging = false;
}, 200);
document.removeEventListener('mousemove', onDragFun);
document.removeEventListener('mouseup', stopDragFun);
};
</script>
<style lang="scss" scoped>
@@ -178,9 +241,10 @@ const removeFun = (index: any) => {
background-color: var(--el-color-primary);
box-shadow: 0 0 10px var(--el-text-color-primary);
border-radius: 50%;
z-index: 999;
z-index: 9999;
color: var(--el-bg-color);
cursor: pointer;
user-select: none;
}
.content {
height: 100%;

View File

@@ -60,7 +60,7 @@ const getTaskResultImageDataFn = async () => {
const res: any = await getSimulationTaskFilesApi({
taskId: props.taskId,
fileType: 1,
fileBizType: 1,
fileName: '',
startTime: '',
endTime: '',
@@ -69,7 +69,7 @@ const getTaskResultImageDataFn = async () => {
});
if (res && res.code === 200) {
exampleImglist.value = res.data.data.map((item: any) => {
exampleImglist.value = res.data?.data?.map((item: any) => {
return {
...item,
url: `${env.VITE_API_IMAGE_PREVIEW_URL}/data/previewImage?fileId=${item.id}`,

View File

@@ -121,7 +121,7 @@ const getCheckedNodesCurveFn = async () => {
const res: any = await getSimulationTaskFilesApi({
taskId: props.taskId,
fileType: 5,
fileBizType: 5,
fileName: '',
startTime: '',
endTime: '',

View File

@@ -7,7 +7,7 @@
showCheckbox
:params="{
taskId: taskId,
fileType: 3,
fileBizType: 3,
fileName: '',
startTime: '',
endTime: ''

View File

@@ -8,7 +8,7 @@
showCheckbox
:params="{
taskId: taskId,
fileType: 1,
fileBizType: 1,
fileName: '',
startTime: '',
endTime: ''

View File

@@ -1,6 +1,6 @@
<template>
<div class="task-performance-page">
<BaseTable tableName="TASK_PERFORMANCE" ref="baseTableRef" showCheckbox hidePagination>
<BaseTable tableName="TASK_PERFORMANCE" ref="baseTableRef" showCheckbox hidePagination :actionList="actionList">
<template #leftOptions>
<div class="operate-box">
<el-upload
@@ -16,6 +16,7 @@
</el-upload>
<el-button icon="" @click="exportFileFn">导出Excel</el-button>
<el-button type="primary" @click="openAddPerformanceWindFn">新增</el-button>
<el-button v-if="showSaveButton" type="primary" @click="saveFn">保存</el-button>
</div>
</template>
@@ -42,15 +43,32 @@
import { ref, onMounted } from 'vue';
import BaseTable from '@/components/common/table/baseTable.vue';
import { ElMessage } from 'element-plus';
import { getTaskPerformanceApi, batchAddTaskPerformanceApi, batchDeleteTaskPerformanceApi } from '@/api/task/taskpool';
import { getTaskPerformanceApi, batchAddTaskPerformanceApi, batchDeleteTaskPerformanceApi, getRunPerformanceApi } from '@/api/task/taskpool';
import { cloneDeep } from 'lodash-es';
import { FileUtil } from '@/utils/file';
import addTaskPerformance from './addTaskPerformance.vue';
const props = defineProps({
taskId: {
type: Number,
default: 100,
},
runInfo: {
type: Object,
default: () => {},
},
taskInfo: {
type: Object,
default: () => {},
},
showSaveButton: {
type: Boolean,
default: false,
},
paramType: {
type: String,
default: 'task',
},
});
const baseTableRef = ref();
const performanceVisible = ref(false);
@@ -58,7 +76,8 @@ const performanceVisible = ref(false);
const performanceData = ref<any>([]);
const getTaskPerformanceDataFn = async () => {
console.log(props.taskId);
const res: any = await getTaskPerformanceApi({ taskId: props.taskId });
console.log(props.runInfo);
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;
@@ -83,7 +102,7 @@ const addPerformanceFn = async (data: any) => {
const { fullData, visibleData, tableData, footerData } = baseTableRef.value.tableRef.getTableData();
const existPerformance = fullData.find((item: any) => {
return item.performanceName === data.performanceName;
return item.nodeName === data.nodeName;
}) || null;
if (existPerformance) {
@@ -116,13 +135,13 @@ const batchAddTaskPerformanceFn = async () => {
const list = baseTableRef.value.tableRef.getInsertRecords();
console.log(list, 'list');
console.log(props.paramType, 'paramType');
const performanceList: any = [];
for (let i = 0; i < list.length; i++) {
const obj = {
const obj :any = {
uuid: '',
taskId: props.taskId,
nodeId: '',
performanceName: list[i].performanceName,
nodeName: list[i].nodeName,
@@ -143,15 +162,38 @@ const batchAddTaskPerformanceFn = async () => {
pid: 0,
};
if (props.paramType === 'task') {
obj.taskId = props.taskInfo?.uuid;
}
if (props.paramType === 'run') {
obj.runId = props.runInfo.uuid;
obj.taskId = props.runInfo.taskId;
}
console.log(obj, 'objobjobj');
performanceList.push(obj);
}
if (!list.length) {
return;
}
const res: any = await batchAddTaskPerformanceApi({
taskId: props.taskId,
const param:any = {
performanceList: performanceList,
});
};
if (props.paramType === 'task') {
param.taskId = props.taskInfo?.uuid;
}
if (props.paramType === 'run') {
param.taskId = props.runInfo.taskId;
param.runId = props.runInfo.uuid;
}
const res: any = await batchAddTaskPerformanceApi(param);
if (res && res.code === 200) {
// ElMessage.success('新增成功!');
} else {
@@ -396,6 +438,18 @@ defineExpose({
saveFn,
});
const actionList = ref([
{
title: '删除',
type: 'danger',
needConfirm: true,
confirmTip: '确认删除吗?',
click: (row:any) => {
delPerformance(row);
},
},
]);
onMounted(async () => {
// props.taskId = props.taskId;

View File

@@ -5,7 +5,7 @@
:api="getSimulationTaskFilesApi"
:params="{
taskId: currentId,
fileType: 2,
fileBizType: 2,
fileName: '',
startTime: '',
endTime: ''

View File

@@ -11,16 +11,20 @@
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { ref, onMounted, watch } from 'vue';
import { getAllDictDataFun } from '@/utils/common';
import UploadList from '@/components/common/uploadList/index.vue';
import { useRoute } from 'vue-router';
const w: any = window;
const $wujie: any = w.$wujie;
const previewMode = $wujie?.props?.VIEW_MODE || '';
const route = useRoute();
const previewMode = ref<any>(false);
const loading = ref(true);
watch(() => route.path, () => {
previewMode.value = route.path.indexOf('/approvalPreview') > -1;
}, { deep: true, immediate: true });
onMounted(async() => {
await getAllDictDataFun();
loading.value = false;

View File

@@ -358,7 +358,7 @@ const getFileInfo = async (data: any, fileType: any) => {
const res: any = await getSimulationTaskFileApi({
taskId: '',
runId: data.uuid,
fileType: fileType,
fileBizType: fileType,
fileName: '',
startTime: '',
endTime: '',

View File

@@ -80,8 +80,8 @@
ref="tableRef"
:searchItems="searchItems"
:searchParams="{model:'模型文件'}"
:params="{ fileType:1}"
:api="getSimulationTaskFileApi"
:params="{ fileBizType:1}"
:api="getSimulationTaskFileFn"
:searchLimitNum="3"
tableName="RESULT_MODEL"
showIndex
@@ -110,8 +110,8 @@
ref="tableRef"
:searchItems="searchItems"
:searchParams="{model:'仿真报告'}"
:params="{ fileType:2}"
:api="getSimulationTaskFileApi"
:params="{ fileBizType:2}"
:api="getSimulationTaskFileFn"
:searchLimitNum="3"
tableName="RESULT_REPORT"
showIndex
@@ -140,8 +140,8 @@
ref="tableRef"
:searchItems="searchItems"
:searchParams="{model:'计算文件'}"
:params="{ fileType:3}"
:api="getSimulationTaskFileApi"
:params="{ fileBizType:3}"
:api="getSimulationTaskFileFn"
:searchLimitNum="3"
tableName="RESULT_FILE"
showIndex
@@ -169,8 +169,8 @@
ref="tableRef"
:searchItems="searchItems"
:searchParams="{model:'结果曲线'}"
:params="{ fileType:4}"
:api="getSimulationTaskFileApi"
:params="{ fileBizType:4}"
:api="getSimulationTaskFileFn"
:searchLimitNum="3"
tableName="RESULT_CURVE"
showIndex
@@ -199,8 +199,8 @@
ref="tableRef"
:searchItems="searchItems"
:searchParams="{model:'结果云图'}"
:params="{ fileType:5}"
:api="getSimulationTaskFileApi"
:params="{ fileBizType:5}"
:api="getSimulationTaskFileFn"
:searchLimitNum="3"
tableName="RESULT_PNG"
showIndex
@@ -440,7 +440,7 @@ const searchItems = [
title: '阶段', key: 'phase', type: 'select', inputMode: 'select', clearable: true, options: [],
},
{
title: '学科', key: 'taskId', type: 'select', inputMode: 'select', clearable: true, options: [],
title: '学科', key: 'discipline', type: 'select', inputMode: 'select', clearable: true, options: [],
},
{ title: '名称', key: 'name', clearable: true, type: 'input', inputMode: 'input' },
{ title: '时间范围', key: 'dateRange', clearable: true, inputMode: 'daterange' },
@@ -454,7 +454,8 @@ const getProjectOptionsFun = () => {
projectOptions.value = res.data.data.map((item: any) => {
return {
label: item.nodeName,
value: item.id,
value: item.uuid,
uuid: item.uuid,
};
});
tableRef.value?.setOptionsFun( NODE_TYPE.PROJECT, projectOptions.value );
@@ -467,10 +468,11 @@ const getPhaseOptionsFun = () => {
getChildrenNodeListApi({ current: 1, size: 999, nodeType: NODE_TYPE.PHASE, nodeId: projectId }).then((res: any) => {
console.log(res);
if (res.code === 200) {
phaseOptions.value = res.data?.data?.map((item: any) => {
phaseOptions.value = res.data?.map((item: any) => {
return {
label: item.nodeName,
value: item.id,
value: item.uuid,
uuid: item.uuid,
};
});
tableRef.value?.setOptionsFun( NODE_TYPE.PHASE, phaseOptions.value );
@@ -485,7 +487,8 @@ const getDisciplineOptionsFun = () => {
disciplineOptions.value = res.data.data.map((item: any) => {
return {
label: item.nodeName,
value: item.id,
value: item.uuid,
uuid: item.uuid,
};
});
tableRef.value?.setOptionsFun( 'discipline', disciplineOptions.value );
@@ -793,6 +796,36 @@ const deleteCompareDataFn = (data:any) => {
});
};
const getSimulationTaskFileFn = async (param:any) => {
const params:any = {
...param,
};
if (params?.project) {
params.uuid = projectOptions.value.find((item:any) => {
return item.value === params.project;
})?.uuid;
}
if (params?.phase) {
params.uuid = phaseOptions.value.find((item:any) => {
return item.value === params.phase;
})?.uuid;
}
if (params?.discipline) {
params.uuid = disciplineOptions.value.find((item:any) => {
return item.value === params.discipline;
})?.uuid;
}
const res:any = await getSimulationTaskFileApi(params);
if (res && res.code === 200) {
return res;
}
};
onMounted(() => {
getProjectOptionsFun();
});

View File

@@ -159,7 +159,7 @@ const getProjectListFn = async (val?: any) => {
if (val) {
filterFormData.projectName = val;
} else {
filterFormData.projectName = projectList.value[0].uuid;
filterFormData.projectName = projectList.value[0].id;
}
}
} else {

View File

@@ -312,9 +312,13 @@ const getTaskRunTreeDataFn = async (data: any) => {
* 点击选中的节点数据
*/
const currentNodeInfo = ref<any>(null);
const nodeChangeClickFn = (data: any) => {
const nodeChangeClickFn = (data: any, node:any) => {
clearTreeMenuFn();
currentNodeInfo.value = data;
if (node.data.nodeType === NODE_TYPE.RUN) {
currentNodeInfo.value.runTaskId = node.parent.data.id;
}
defaultExpandKeys.value = [data.id];
localStorage.setItem('CURRENT_TASK_RUN_INFO', JSON.stringify(data));
emits('nodeClickFn', { node: currentNodeInfo.value });

View File

@@ -106,7 +106,7 @@
<div class="tabs-info-content">
<resultData v-if="taskActiveName === 'result'" :current-run-ifno="runInfo"></resultData>
<jobList v-if="taskActiveName === 'job-list'"></jobList>
<taskPerformance v-if="taskActiveName === 'performance'" :task-id="runInfo.id"></taskPerformance>
<taskPerformance v-if="taskActiveName === 'performance'" :param-type="'run'" :run-info="runInfo" :show-save-button="true"></taskPerformance>
<runLogs v-if="taskActiveName === 'job-log'"></runLogs>
<ModelReview v-if="taskActiveName === '3D-model'"></ModelReview>
<runVersionTree v-if="taskActiveName === 'associated-run'" :current-task-info="runInfo"></runVersionTree>
@@ -300,6 +300,7 @@ watch(() => props.runInfo, (newVal) => {
width: 100%;
height: calc(100% - 40px);
padding: 10px;
overflow: auto;
}
}

View File

@@ -3,7 +3,7 @@
<template>
<div class="result-page">
<div class="tab-title-box">
<el-radio-group v-model="currentDirName" >
<el-radio-group v-model="currentDirName" @change="runResultDirChangeFn">
<el-radio v-for="item in runDirNameList" :key="item.id" :value="item.id">{{ item.name }}</el-radio>
</el-radio-group>
</div>
@@ -11,28 +11,43 @@
<BaseTable
showIndex
ref="baseTableRef"
tableName="RUN_RESULT_FILE_TABLE"
:tableName="tableName"
:api="queryDirDataFn"
:params="{
fileId: currentDirName,
keyResultType,
runId:runInfo.uuid
}"
:action-list="actionList"
>
<template #leftOptions>
<el-upload :show-file-list="false" :before-upload="beforeUploadFun">
<el-button @click="openFn">上传文件</el-button>
<!-- <el-upload :show-file-list="false" :before-upload="beforeUploadFun">
<el-button>上传文件</el-button>
</el-upload>
</el-upload> -->
</template>
</BaseTable>
</div>
</div>
<el-drawer v-model="visible" :title="`文件上传`" :size="500" :close-on-click-modal="false" @close="closeFun">
<TableForm ref="tableFormRef" :tableName="tableName" />
<template #footer>
<div>
<el-button @click="closeFun">关闭</el-button>
<el-button type="primary" @click="submitFun">确定</el-button>
</div>
</template>
</el-drawer>
</template>
<script setup lang="ts">
import { queryRunDirApi, uploadRunFilesApi } from '@/api/project/run';
import { queryRunDirApi, listSimulationKeyResult, addSimulationKeyResultApi, deleteSimulationKeyResultApi } from '@/api/project/run';
import { ref, defineProps, watch, nextTick, onMounted } from 'vue';
import BaseTable from '@/components/common/table/baseTable.vue';
import { ElMessage } from 'element-plus';
import { UPLOAD_RUN_FILE_TYPE } from '@/utils/enum/file';
import TableForm from '@/components/common/table/tableForm.vue';
const env = import.meta.env;
const props = defineProps({
currentRunIfno: {
@@ -44,7 +59,8 @@ const props = defineProps({
});
const baseTableRef = ref();
const tableFormRef = ref();
const visible = ref(false);
const runInfo = ref<any>({});
const currentDirName = ref<any>();
@@ -61,7 +77,9 @@ const getRunInfoDirsFn = async () => {
});
if (res && res.code === 200) {
runDirs.value = res.data?.data || [];
runDirs.value = res.data?.data.filter((item:any) => {
return item.dataType === 1;
}) || [];
runDirNameList.value = runDirs.value.map((item: any) => {
return { name: item.originalName, id: item.id };
}) || [];
@@ -77,7 +95,7 @@ const getRunInfoDirsFn = async () => {
};
const queryDirDataFn = async (param: any) => {
const res: any = await queryRunDirApi({
const res: any = await listSimulationKeyResult({
...param,
});
if (res && res.code === 200) {
@@ -86,31 +104,35 @@ const queryDirDataFn = async (param: any) => {
}
};
const beforeUploadFun = (file: any) => {
if (!currentDirName.value) {
ElMessage.warning('请选择一个目录');
return;
}
const { name } = file;
const params = {
fileName: name,
dirId: currentDirName.value,
file: file,
fileType: getFileType(),
};
uploadRunFilesApi(params).then((res: any) => {
if (res.code === 200) {
ElMessage.success('上传成功');
reloadFun();
}
});
return false;
};
const keyResultType = ref('1');
const reloadFun = () => {
if (baseTableRef.value) {
baseTableRef.value.resetFun();
}
};
const tableName = ref('RUN_RESULT_IMAGE_TABLE');
const runResultDirChangeFn = () => {
const name = runDirNameList.value.find((item:any) => {
return item.id === currentDirName.value;
})?.name;
if (name === '图片结果') {
tableName.value = 'RUN_RESULT_IMAGE_TABLE';
keyResultType.value = '1';
}
if (name === '曲线结果') {
tableName.value = 'RUN_RESULT_CANVAS_TABLE';
keyResultType.value = '2';
}
if (name === '报告结果') {
tableName.value = 'RUN_RESULT_REPORT_TABLE';
keyResultType.value = '3';
}
};
watch(() => props.currentRunIfno, async (newVal) => {
@@ -150,6 +172,92 @@ const getFileType = () => {
};
const closeFun = () => {
visible.value = false;
};
const openFn = () => {
visible.value = true;
nextTick(() => {
tableFormRef.value.resetFun();
});
};
const submitFun = async () => {
const valid = await tableFormRef.value.validateFun();
if (valid) {
const fromData = tableFormRef.value.getFormDataFun();
const file = fromData.uploadFile[0].raw;
const name = file.name;
const paramData:any = {};
for (const key in fromData) {
if (key != 'extras' && key != 'uploadFile') {
paramData[key] = fromData[key];
}
}
const params = {
fileName: name,
name: name,
dirId: currentDirName.value,
file: file,
fileType: getFileType(),
keyResultType: keyResultType.value,
runId: runInfo.value.uuid,
...paramData,
};
await addSimulationKeyResultApi(params).then((res: any) => {
if (res.code === 200) {
ElMessage.success('上传成功');
reloadFun();
}
});
visible.value = false;
console.log(fromData, 'fromData');
}
};
const deleteFile = async (data:any) => {
const res:any = await deleteSimulationKeyResultApi({
uuid: data.uuid,
fileId: data.fileId,
});
if (res && res.code === 200) {
ElMessage.success('删除成功');
} else {
ElMessage.error('删除失败');
}
};
const actionList = ref([
{
title: '下载',
type: 'primary',
click: (row:any) => {
const downloadUrl = `${env.VITE_API_FILE_URL}/data/downloadFile?fileId=${row.fileId}`;
window.open(downloadUrl, '_blank');
},
},
{
title: '删除',
type: 'danger',
needConfirm: true,
confirmTip: '确认删除吗?',
click: (row:any) => {
deleteFile(row);
},
},
]);
onMounted(() => {
});

View File

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