Merge branch 'main' of http://192.168.65.198:3000/Front_Team/SPDM
This commit is contained in:
@@ -82,4 +82,33 @@ export const getTaskRunVersionApi = (params: any) => {
|
|||||||
*/
|
*/
|
||||||
export const getRunVersionApi = (params: any) => {
|
export const getRunVersionApi = (params: any) => {
|
||||||
return post(`${PREFIX}run/getRunVersion`, params);
|
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);
|
||||||
|
|
||||||
|
};
|
||||||
|
|||||||
@@ -54,3 +54,8 @@ export const batchAddTaskPerformanceApi = (params: any) => {
|
|||||||
export const batchDeleteTaskPerformanceApi = (params: any) => {
|
export const batchDeleteTaskPerformanceApi = (params: any) => {
|
||||||
return post(`${PREFIX}taskPerformance/batchDeleteTaskPerformance`, params);
|
return post(`${PREFIX}taskPerformance/batchDeleteTaskPerformance`, params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getRunPerformanceApi = (params: any) => {
|
||||||
|
return get(`${PREFIX}taskPerformance/getRunPerformance`, params);
|
||||||
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
:title="diaTitle"
|
:title="diaTitle"
|
||||||
@open="openFun"
|
@open="openFun"
|
||||||
draggable
|
draggable
|
||||||
|
appendToBody
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
>
|
>
|
||||||
<template v-for="(name) in Object.keys($slots)" :key="name" #[name]="scope">
|
<template v-for="(name) in Object.keys($slots)" :key="name" #[name]="scope">
|
||||||
|
|||||||
@@ -10,20 +10,28 @@
|
|||||||
@change="onChange"
|
@change="onChange"
|
||||||
/>
|
/>
|
||||||
<div v-else class="plain-label">
|
<div v-else class="plain-label">
|
||||||
|
<!-- <el-icon class="view" @click="previewFlowFun">
|
||||||
|
<View />
|
||||||
|
</el-icon> -->
|
||||||
{{ selectedLabel }}
|
{{ selectedLabel }}
|
||||||
</div>
|
</div>
|
||||||
|
<flowViewDialog
|
||||||
|
v-model:showDialog="flowVisible"
|
||||||
|
:flowTemplateCode="selected"
|
||||||
|
></flowViewDialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch, computed } from 'vue';
|
import { ref, watch, computed } from 'vue';
|
||||||
import { useTaskStore } from '@/stores/taskPool';
|
import { useTaskStore } from '@/stores/taskPool';
|
||||||
|
import flowViewDialog from '@/components/common/flow/flowViewDialog.vue';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
modelValue?: any;
|
modelValue?: any;
|
||||||
clearable?: boolean;
|
clearable?: boolean;
|
||||||
editable?: boolean;
|
editable?: boolean;
|
||||||
size?: '' | 'large' | 'default' | 'small'
|
size?: '' | 'large' | 'default' | 'small'
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
@@ -57,21 +65,33 @@ const onChange = (val: any) => {
|
|||||||
emits('change', val);
|
emits('change', val);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const flowVisible = ref(false);
|
||||||
|
const previewFlowFun = () => {
|
||||||
|
flowVisible.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.full {
|
.full {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.plain-label {
|
.plain-label {
|
||||||
display: inline-block;
|
display: inline-flex;
|
||||||
width: 100%;
|
align-items: center;
|
||||||
line-height: 32px;
|
gap: 6px;
|
||||||
color: #303133;
|
vertical-align: middle;
|
||||||
padding: 0 8px;
|
line-height: 1;
|
||||||
box-sizing: border-box;
|
.view {
|
||||||
white-space: nowrap;
|
display: inline-flex;
|
||||||
overflow: hidden;
|
align-items: center;
|
||||||
text-overflow: ellipsis;
|
justify-content: center;
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
cursor: pointer;
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -13,15 +13,20 @@
|
|||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
/>
|
/>
|
||||||
<span v-else class="plain-label">
|
<span v-else class="plain-label">
|
||||||
|
<el-icon class="view" @click="previewFileFun">
|
||||||
|
<View />
|
||||||
|
</el-icon>
|
||||||
{{ modelName || displayValue }}
|
{{ modelName || displayValue }}
|
||||||
</span>
|
</span>
|
||||||
|
<FilePreview v-if="currentFileId" v-model="previewVisible" :fileId="currentFileId" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<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 { dataListDirApi, dataQueryDirApi } from '@/api/data/data';
|
||||||
import { cloneDeep } from 'lodash-es';
|
import { cloneDeep } from 'lodash-es';
|
||||||
import type { CascaderProps } from 'element-plus';
|
import type { CascaderProps } from 'element-plus';
|
||||||
|
import FilePreview from '@/components/common/filePreview/index.vue';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
modelValue?: any;
|
modelValue?: any;
|
||||||
@@ -42,7 +47,7 @@ const emit = defineEmits(['update:modelValue', 'update:modelName']);
|
|||||||
const selected = ref<string[]>(props.modelValue ? String(props.modelValue).split(',') : []);
|
const selected = ref<string[]>(props.modelValue ? String(props.modelValue).split(',') : []);
|
||||||
const optionsKey = ref<number>(0);
|
const optionsKey = ref<number>(0);
|
||||||
|
|
||||||
const onCascaderChange = (val: any ) => {
|
const onCascaderChange = (val: any) => {
|
||||||
const ids = Array.isArray(val) ? val.map(String) : [];
|
const ids = Array.isArray(val) ? val.map(String) : [];
|
||||||
emit('update:modelValue', ids.join(','));
|
emit('update:modelValue', ids.join(','));
|
||||||
selected.value = ids;
|
selected.value = ids;
|
||||||
@@ -150,6 +155,18 @@ async function buildOptionsFromIds(ids: string[]) {
|
|||||||
return;
|
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[]) {
|
// async function loadDisplayNames(ids: string[]) {
|
||||||
// if (!ids || ids.length === 0) {
|
// if (!ids || ids.length === 0) {
|
||||||
// displayValue.value = '';
|
// displayValue.value = '';
|
||||||
@@ -230,4 +247,21 @@ onMounted(() => {
|
|||||||
:deep(.full) {
|
:deep(.full) {
|
||||||
width: 100%;
|
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>
|
</style>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="comp-upload-list">
|
<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
|
<el-drawer
|
||||||
title="上传列表"
|
title="上传列表"
|
||||||
v-model="listVisible"
|
v-model="listVisible"
|
||||||
@@ -63,6 +63,12 @@ const UPLOAD_FILE_STATUS: any = { // TODO
|
|||||||
'2': '上传完成',
|
'2': '上传完成',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const dragRef = ref<any>();
|
||||||
|
let isDragging = false;
|
||||||
|
let isDragged = false;
|
||||||
|
let offsetX = 0;
|
||||||
|
let offsetY = 0;
|
||||||
|
|
||||||
emitter.on('ADD_UPLOAD_FILE', (addData: any) => {
|
emitter.on('ADD_UPLOAD_FILE', (addData: any) => {
|
||||||
const data = addData.data;
|
const data = addData.data;
|
||||||
data.status = '0'; // 默认状态
|
data.status = '0'; // 默认状态
|
||||||
@@ -159,9 +165,66 @@ const uploadFun = async(params: any) => {
|
|||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const openFun = () => {
|
||||||
|
if (isDragged) {
|
||||||
|
isDragged = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
listVisible.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
const removeFun = (index: any) => {
|
const removeFun = (index: any) => {
|
||||||
listData.value.splice(index, 1);
|
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>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@@ -178,9 +241,10 @@ const removeFun = (index: any) => {
|
|||||||
background-color: var(--el-color-primary);
|
background-color: var(--el-color-primary);
|
||||||
box-shadow: 0 0 10px var(--el-text-color-primary);
|
box-shadow: 0 0 10px var(--el-text-color-primary);
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
z-index: 999;
|
z-index: 9999;
|
||||||
color: var(--el-bg-color);
|
color: var(--el-bg-color);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
user-select: none;
|
||||||
}
|
}
|
||||||
.content {
|
.content {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ const getTaskResultImageDataFn = async () => {
|
|||||||
|
|
||||||
const res: any = await getSimulationTaskFilesApi({
|
const res: any = await getSimulationTaskFilesApi({
|
||||||
taskId: props.taskId,
|
taskId: props.taskId,
|
||||||
fileType: 1,
|
fileBizType: 1,
|
||||||
fileName: '',
|
fileName: '',
|
||||||
startTime: '',
|
startTime: '',
|
||||||
endTime: '',
|
endTime: '',
|
||||||
@@ -69,7 +69,7 @@ const getTaskResultImageDataFn = async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (res && res.code === 200) {
|
if (res && res.code === 200) {
|
||||||
exampleImglist.value = res.data.data.map((item: any) => {
|
exampleImglist.value = res.data?.data?.map((item: any) => {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
url: `${env.VITE_API_IMAGE_PREVIEW_URL}/data/previewImage?fileId=${item.id}`,
|
url: `${env.VITE_API_IMAGE_PREVIEW_URL}/data/previewImage?fileId=${item.id}`,
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ const getCheckedNodesCurveFn = async () => {
|
|||||||
|
|
||||||
const res: any = await getSimulationTaskFilesApi({
|
const res: any = await getSimulationTaskFilesApi({
|
||||||
taskId: props.taskId,
|
taskId: props.taskId,
|
||||||
fileType: 5,
|
fileBizType: 5,
|
||||||
fileName: '',
|
fileName: '',
|
||||||
startTime: '',
|
startTime: '',
|
||||||
endTime: '',
|
endTime: '',
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
showCheckbox
|
showCheckbox
|
||||||
:params="{
|
:params="{
|
||||||
taskId: taskId,
|
taskId: taskId,
|
||||||
fileType: 3,
|
fileBizType: 3,
|
||||||
fileName: '',
|
fileName: '',
|
||||||
startTime: '',
|
startTime: '',
|
||||||
endTime: ''
|
endTime: ''
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
showCheckbox
|
showCheckbox
|
||||||
:params="{
|
:params="{
|
||||||
taskId: taskId,
|
taskId: taskId,
|
||||||
fileType: 1,
|
fileBizType: 1,
|
||||||
fileName: '',
|
fileName: '',
|
||||||
startTime: '',
|
startTime: '',
|
||||||
endTime: ''
|
endTime: ''
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="task-performance-page">
|
<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>
|
<template #leftOptions>
|
||||||
<div class="operate-box">
|
<div class="operate-box">
|
||||||
<el-upload
|
<el-upload
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
</el-upload>
|
</el-upload>
|
||||||
<el-button icon="" @click="exportFileFn">导出Excel</el-button>
|
<el-button icon="" @click="exportFileFn">导出Excel</el-button>
|
||||||
<el-button type="primary" @click="openAddPerformanceWindFn">新增</el-button>
|
<el-button type="primary" @click="openAddPerformanceWindFn">新增</el-button>
|
||||||
|
<el-button v-if="showSaveButton" type="primary" @click="saveFn">保存</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
@@ -42,15 +43,32 @@
|
|||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
import BaseTable from '@/components/common/table/baseTable.vue';
|
import BaseTable from '@/components/common/table/baseTable.vue';
|
||||||
import { ElMessage } from 'element-plus';
|
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 { cloneDeep } from 'lodash-es';
|
||||||
import { FileUtil } from '@/utils/file';
|
import { FileUtil } from '@/utils/file';
|
||||||
|
import addTaskPerformance from './addTaskPerformance.vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
taskId: {
|
taskId: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 100,
|
default: 100,
|
||||||
},
|
},
|
||||||
|
runInfo: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {},
|
||||||
|
},
|
||||||
|
taskInfo: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {},
|
||||||
|
},
|
||||||
|
showSaveButton: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
paramType: {
|
||||||
|
type: String,
|
||||||
|
default: 'task',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const baseTableRef = ref();
|
const baseTableRef = ref();
|
||||||
const performanceVisible = ref(false);
|
const performanceVisible = ref(false);
|
||||||
@@ -58,7 +76,8 @@ const performanceVisible = ref(false);
|
|||||||
const performanceData = ref<any>([]);
|
const performanceData = ref<any>([]);
|
||||||
const getTaskPerformanceDataFn = async () => {
|
const getTaskPerformanceDataFn = async () => {
|
||||||
console.log(props.taskId);
|
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) {
|
if (res && res.code === 200) {
|
||||||
performanceData.value = res.data;
|
performanceData.value = res.data;
|
||||||
|
|
||||||
@@ -83,7 +102,7 @@ const addPerformanceFn = async (data: any) => {
|
|||||||
const { fullData, visibleData, tableData, footerData } = baseTableRef.value.tableRef.getTableData();
|
const { fullData, visibleData, tableData, footerData } = baseTableRef.value.tableRef.getTableData();
|
||||||
|
|
||||||
const existPerformance = fullData.find((item: any) => {
|
const existPerformance = fullData.find((item: any) => {
|
||||||
return item.performanceName === data.performanceName;
|
return item.nodeName === data.nodeName;
|
||||||
}) || null;
|
}) || null;
|
||||||
|
|
||||||
if (existPerformance) {
|
if (existPerformance) {
|
||||||
@@ -116,13 +135,13 @@ const batchAddTaskPerformanceFn = async () => {
|
|||||||
const list = baseTableRef.value.tableRef.getInsertRecords();
|
const list = baseTableRef.value.tableRef.getInsertRecords();
|
||||||
|
|
||||||
console.log(list, 'list');
|
console.log(list, 'list');
|
||||||
|
console.log(props.paramType, 'paramType');
|
||||||
|
|
||||||
const performanceList: any = [];
|
const performanceList: any = [];
|
||||||
|
|
||||||
for (let i = 0; i < list.length; i++) {
|
for (let i = 0; i < list.length; i++) {
|
||||||
const obj = {
|
const obj :any = {
|
||||||
uuid: '',
|
uuid: '',
|
||||||
taskId: props.taskId,
|
|
||||||
nodeId: '',
|
nodeId: '',
|
||||||
performanceName: list[i].performanceName,
|
performanceName: list[i].performanceName,
|
||||||
nodeName: list[i].nodeName,
|
nodeName: list[i].nodeName,
|
||||||
@@ -143,15 +162,38 @@ const batchAddTaskPerformanceFn = async () => {
|
|||||||
pid: 0,
|
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);
|
performanceList.push(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!list.length) {
|
if (!list.length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const res: any = await batchAddTaskPerformanceApi({
|
|
||||||
taskId: props.taskId,
|
const param:any = {
|
||||||
performanceList: performanceList,
|
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) {
|
if (res && res.code === 200) {
|
||||||
// ElMessage.success('新增成功!');
|
// ElMessage.success('新增成功!');
|
||||||
} else {
|
} else {
|
||||||
@@ -396,6 +438,18 @@ defineExpose({
|
|||||||
saveFn,
|
saveFn,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const actionList = ref([
|
||||||
|
{
|
||||||
|
title: '删除',
|
||||||
|
type: 'danger',
|
||||||
|
needConfirm: true,
|
||||||
|
confirmTip: '确认删除吗?',
|
||||||
|
click: (row:any) => {
|
||||||
|
delPerformance(row);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|
||||||
// props.taskId = props.taskId;
|
// props.taskId = props.taskId;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
:api="getSimulationTaskFilesApi"
|
:api="getSimulationTaskFilesApi"
|
||||||
:params="{
|
:params="{
|
||||||
taskId: currentId,
|
taskId: currentId,
|
||||||
fileType: 2,
|
fileBizType: 2,
|
||||||
fileName: '',
|
fileName: '',
|
||||||
startTime: '',
|
startTime: '',
|
||||||
endTime: ''
|
endTime: ''
|
||||||
|
|||||||
@@ -11,16 +11,20 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted, watch } from 'vue';
|
||||||
import { getAllDictDataFun } from '@/utils/common';
|
import { getAllDictDataFun } from '@/utils/common';
|
||||||
import UploadList from '@/components/common/uploadList/index.vue';
|
import UploadList from '@/components/common/uploadList/index.vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
const w: any = window;
|
const route = useRoute();
|
||||||
const $wujie: any = w.$wujie;
|
const previewMode = ref<any>(false);
|
||||||
const previewMode = $wujie?.props?.VIEW_MODE || '';
|
|
||||||
|
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
|
|
||||||
|
watch(() => route.path, () => {
|
||||||
|
previewMode.value = route.path.indexOf('/approvalPreview') > -1;
|
||||||
|
}, { deep: true, immediate: true });
|
||||||
|
|
||||||
onMounted(async() => {
|
onMounted(async() => {
|
||||||
await getAllDictDataFun();
|
await getAllDictDataFun();
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
|
|||||||
@@ -358,7 +358,7 @@ const getFileInfo = async (data: any, fileType: any) => {
|
|||||||
const res: any = await getSimulationTaskFileApi({
|
const res: any = await getSimulationTaskFileApi({
|
||||||
taskId: '',
|
taskId: '',
|
||||||
runId: data.uuid,
|
runId: data.uuid,
|
||||||
fileType: fileType,
|
fileBizType: fileType,
|
||||||
fileName: '',
|
fileName: '',
|
||||||
startTime: '',
|
startTime: '',
|
||||||
endTime: '',
|
endTime: '',
|
||||||
|
|||||||
@@ -80,8 +80,8 @@
|
|||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
:searchItems="searchItems"
|
:searchItems="searchItems"
|
||||||
:searchParams="{model:'模型文件'}"
|
:searchParams="{model:'模型文件'}"
|
||||||
:params="{ fileType:1}"
|
:params="{ fileBizType:1}"
|
||||||
:api="getSimulationTaskFileApi"
|
:api="getSimulationTaskFileFn"
|
||||||
:searchLimitNum="3"
|
:searchLimitNum="3"
|
||||||
tableName="RESULT_MODEL"
|
tableName="RESULT_MODEL"
|
||||||
showIndex
|
showIndex
|
||||||
@@ -110,8 +110,8 @@
|
|||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
:searchItems="searchItems"
|
:searchItems="searchItems"
|
||||||
:searchParams="{model:'仿真报告'}"
|
:searchParams="{model:'仿真报告'}"
|
||||||
:params="{ fileType:2}"
|
:params="{ fileBizType:2}"
|
||||||
:api="getSimulationTaskFileApi"
|
:api="getSimulationTaskFileFn"
|
||||||
:searchLimitNum="3"
|
:searchLimitNum="3"
|
||||||
tableName="RESULT_REPORT"
|
tableName="RESULT_REPORT"
|
||||||
showIndex
|
showIndex
|
||||||
@@ -140,8 +140,8 @@
|
|||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
:searchItems="searchItems"
|
:searchItems="searchItems"
|
||||||
:searchParams="{model:'计算文件'}"
|
:searchParams="{model:'计算文件'}"
|
||||||
:params="{ fileType:3}"
|
:params="{ fileBizType:3}"
|
||||||
:api="getSimulationTaskFileApi"
|
:api="getSimulationTaskFileFn"
|
||||||
:searchLimitNum="3"
|
:searchLimitNum="3"
|
||||||
tableName="RESULT_FILE"
|
tableName="RESULT_FILE"
|
||||||
showIndex
|
showIndex
|
||||||
@@ -169,8 +169,8 @@
|
|||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
:searchItems="searchItems"
|
:searchItems="searchItems"
|
||||||
:searchParams="{model:'结果曲线'}"
|
:searchParams="{model:'结果曲线'}"
|
||||||
:params="{ fileType:4}"
|
:params="{ fileBizType:4}"
|
||||||
:api="getSimulationTaskFileApi"
|
:api="getSimulationTaskFileFn"
|
||||||
:searchLimitNum="3"
|
:searchLimitNum="3"
|
||||||
tableName="RESULT_CURVE"
|
tableName="RESULT_CURVE"
|
||||||
showIndex
|
showIndex
|
||||||
@@ -199,8 +199,8 @@
|
|||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
:searchItems="searchItems"
|
:searchItems="searchItems"
|
||||||
:searchParams="{model:'结果云图'}"
|
:searchParams="{model:'结果云图'}"
|
||||||
:params="{ fileType:5}"
|
:params="{ fileBizType:5}"
|
||||||
:api="getSimulationTaskFileApi"
|
:api="getSimulationTaskFileFn"
|
||||||
:searchLimitNum="3"
|
:searchLimitNum="3"
|
||||||
tableName="RESULT_PNG"
|
tableName="RESULT_PNG"
|
||||||
showIndex
|
showIndex
|
||||||
@@ -440,7 +440,7 @@ const searchItems = [
|
|||||||
title: '阶段', key: 'phase', type: 'select', inputMode: 'select', clearable: true, options: [],
|
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: 'name', clearable: true, type: 'input', inputMode: 'input' },
|
||||||
{ title: '时间范围', key: 'dateRange', clearable: true, inputMode: 'daterange' },
|
{ title: '时间范围', key: 'dateRange', clearable: true, inputMode: 'daterange' },
|
||||||
@@ -454,7 +454,8 @@ const getProjectOptionsFun = () => {
|
|||||||
projectOptions.value = res.data.data.map((item: any) => {
|
projectOptions.value = res.data.data.map((item: any) => {
|
||||||
return {
|
return {
|
||||||
label: item.nodeName,
|
label: item.nodeName,
|
||||||
value: item.id,
|
value: item.uuid,
|
||||||
|
uuid: item.uuid,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
tableRef.value?.setOptionsFun( NODE_TYPE.PROJECT, projectOptions.value );
|
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) => {
|
getChildrenNodeListApi({ current: 1, size: 999, nodeType: NODE_TYPE.PHASE, nodeId: projectId }).then((res: any) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
phaseOptions.value = res.data?.data?.map((item: any) => {
|
phaseOptions.value = res.data?.map((item: any) => {
|
||||||
return {
|
return {
|
||||||
label: item.nodeName,
|
label: item.nodeName,
|
||||||
value: item.id,
|
value: item.uuid,
|
||||||
|
uuid: item.uuid,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
tableRef.value?.setOptionsFun( NODE_TYPE.PHASE, phaseOptions.value );
|
tableRef.value?.setOptionsFun( NODE_TYPE.PHASE, phaseOptions.value );
|
||||||
@@ -485,7 +487,8 @@ const getDisciplineOptionsFun = () => {
|
|||||||
disciplineOptions.value = res.data.data.map((item: any) => {
|
disciplineOptions.value = res.data.data.map((item: any) => {
|
||||||
return {
|
return {
|
||||||
label: item.nodeName,
|
label: item.nodeName,
|
||||||
value: item.id,
|
value: item.uuid,
|
||||||
|
uuid: item.uuid,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
tableRef.value?.setOptionsFun( 'discipline', disciplineOptions.value );
|
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(() => {
|
onMounted(() => {
|
||||||
getProjectOptionsFun();
|
getProjectOptionsFun();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ const getProjectListFn = async (val?: any) => {
|
|||||||
if (val) {
|
if (val) {
|
||||||
filterFormData.projectName = val;
|
filterFormData.projectName = val;
|
||||||
} else {
|
} else {
|
||||||
filterFormData.projectName = projectList.value[0].uuid;
|
filterFormData.projectName = projectList.value[0].id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -312,9 +312,13 @@ const getTaskRunTreeDataFn = async (data: any) => {
|
|||||||
* 点击选中的节点数据
|
* 点击选中的节点数据
|
||||||
*/
|
*/
|
||||||
const currentNodeInfo = ref<any>(null);
|
const currentNodeInfo = ref<any>(null);
|
||||||
const nodeChangeClickFn = (data: any) => {
|
const nodeChangeClickFn = (data: any, node:any) => {
|
||||||
clearTreeMenuFn();
|
clearTreeMenuFn();
|
||||||
currentNodeInfo.value = data;
|
currentNodeInfo.value = data;
|
||||||
|
|
||||||
|
if (node.data.nodeType === NODE_TYPE.RUN) {
|
||||||
|
currentNodeInfo.value.runTaskId = node.parent.data.id;
|
||||||
|
}
|
||||||
defaultExpandKeys.value = [data.id];
|
defaultExpandKeys.value = [data.id];
|
||||||
localStorage.setItem('CURRENT_TASK_RUN_INFO', JSON.stringify(data));
|
localStorage.setItem('CURRENT_TASK_RUN_INFO', JSON.stringify(data));
|
||||||
emits('nodeClickFn', { node: currentNodeInfo.value });
|
emits('nodeClickFn', { node: currentNodeInfo.value });
|
||||||
|
|||||||
@@ -106,7 +106,7 @@
|
|||||||
<div class="tabs-info-content">
|
<div class="tabs-info-content">
|
||||||
<resultData v-if="taskActiveName === 'result'" :current-run-ifno="runInfo"></resultData>
|
<resultData v-if="taskActiveName === 'result'" :current-run-ifno="runInfo"></resultData>
|
||||||
<jobList v-if="taskActiveName === 'job-list'"></jobList>
|
<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>
|
<runLogs v-if="taskActiveName === 'job-log'"></runLogs>
|
||||||
<ModelReview v-if="taskActiveName === '3D-model'"></ModelReview>
|
<ModelReview v-if="taskActiveName === '3D-model'"></ModelReview>
|
||||||
<runVersionTree v-if="taskActiveName === 'associated-run'" :current-task-info="runInfo"></runVersionTree>
|
<runVersionTree v-if="taskActiveName === 'associated-run'" :current-task-info="runInfo"></runVersionTree>
|
||||||
@@ -300,6 +300,7 @@ watch(() => props.runInfo, (newVal) => {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: calc(100% - 40px);
|
height: calc(100% - 40px);
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
overflow: auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="result-page">
|
<div class="result-page">
|
||||||
<div class="tab-title-box">
|
<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 v-for="item in runDirNameList" :key="item.id" :value="item.id">{{ item.name }}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</div>
|
</div>
|
||||||
@@ -11,28 +11,43 @@
|
|||||||
<BaseTable
|
<BaseTable
|
||||||
showIndex
|
showIndex
|
||||||
ref="baseTableRef"
|
ref="baseTableRef"
|
||||||
tableName="RUN_RESULT_FILE_TABLE"
|
:tableName="tableName"
|
||||||
:api="queryDirDataFn"
|
:api="queryDirDataFn"
|
||||||
:params="{
|
:params="{
|
||||||
fileId: currentDirName,
|
keyResultType,
|
||||||
|
runId:runInfo.uuid
|
||||||
}"
|
}"
|
||||||
|
:action-list="actionList"
|
||||||
>
|
>
|
||||||
<template #leftOptions>
|
<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-button>上传文件</el-button>
|
||||||
</el-upload>
|
</el-upload> -->
|
||||||
</template>
|
</template>
|
||||||
</BaseTable>
|
</BaseTable>
|
||||||
</div>
|
</div>
|
||||||
</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>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<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 { ref, defineProps, watch, nextTick, onMounted } from 'vue';
|
||||||
import BaseTable from '@/components/common/table/baseTable.vue';
|
import BaseTable from '@/components/common/table/baseTable.vue';
|
||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
import { UPLOAD_RUN_FILE_TYPE } from '@/utils/enum/file';
|
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({
|
const props = defineProps({
|
||||||
currentRunIfno: {
|
currentRunIfno: {
|
||||||
@@ -44,7 +59,8 @@ const props = defineProps({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const baseTableRef = ref();
|
const baseTableRef = ref();
|
||||||
|
const tableFormRef = ref();
|
||||||
|
const visible = ref(false);
|
||||||
const runInfo = ref<any>({});
|
const runInfo = ref<any>({});
|
||||||
const currentDirName = ref<any>();
|
const currentDirName = ref<any>();
|
||||||
|
|
||||||
@@ -61,7 +77,9 @@ const getRunInfoDirsFn = async () => {
|
|||||||
});
|
});
|
||||||
if (res && res.code === 200) {
|
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) => {
|
runDirNameList.value = runDirs.value.map((item: any) => {
|
||||||
return { name: item.originalName, id: item.id };
|
return { name: item.originalName, id: item.id };
|
||||||
}) || [];
|
}) || [];
|
||||||
@@ -77,7 +95,7 @@ const getRunInfoDirsFn = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const queryDirDataFn = async (param: any) => {
|
const queryDirDataFn = async (param: any) => {
|
||||||
const res: any = await queryRunDirApi({
|
const res: any = await listSimulationKeyResult({
|
||||||
...param,
|
...param,
|
||||||
});
|
});
|
||||||
if (res && res.code === 200) {
|
if (res && res.code === 200) {
|
||||||
@@ -86,31 +104,35 @@ const queryDirDataFn = async (param: any) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const beforeUploadFun = (file: any) => {
|
const keyResultType = ref('1');
|
||||||
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 reloadFun = () => {
|
const reloadFun = () => {
|
||||||
if (baseTableRef.value) {
|
if (baseTableRef.value) {
|
||||||
baseTableRef.value.resetFun();
|
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) => {
|
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(() => {
|
onMounted(() => {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<div class="task-content">
|
<div class="task-content">
|
||||||
|
|
||||||
<div class="tabs-component" v-if="activeName === 'performance'">
|
<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>
|
||||||
<div class="tabs-component" v-if="activeName === 'picture'">
|
<div class="tabs-component" v-if="activeName === 'picture'">
|
||||||
<resultImage :task-id="currentTaskInfo?.id"></resultImage>
|
<resultImage :task-id="currentTaskInfo?.id"></resultImage>
|
||||||
|
|||||||
Reference in New Issue
Block a user