update:bug修复,新增任务执行界面归档输入输出数据
This commit is contained in:
@@ -96,7 +96,7 @@ import {
|
||||
} from '@/api/system/application';
|
||||
import appNameBg from '@/views/task/appCenter/components/appNameBg.vue';
|
||||
import { getDictionaryDataApi } from '@/api/system/systemData';
|
||||
import { getUserId } from '@/utils/user';
|
||||
import { getUserData, getUserId } from '@/utils/user';
|
||||
import appUseChart from './components/appUseChart.vue';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
|
||||
@@ -304,6 +304,7 @@ const updateAppInfoFun = async (data: any) => {
|
||||
machineCode: localStorage.getItem('USER_UUID'),
|
||||
comment: data.comment || '',
|
||||
creator: getUserId() || '',
|
||||
creatorName: getUserData()?.nickname || '',
|
||||
};
|
||||
|
||||
const res: any = await addApplicationApi(param);
|
||||
|
||||
@@ -126,7 +126,7 @@ const tableData = ref<any>({
|
||||
type: 'table',
|
||||
key: '数值结果表',
|
||||
value: [],
|
||||
head: ['序号', '指标名称', '指标编号', '分析值', '达标方式', '目标值', '单位'],
|
||||
head: ['序号', '指标名称', '指标编号', '分析值', '达成状态', '达标方式', '目标值', '单位'],
|
||||
});
|
||||
const tableData2 = ref<any>({
|
||||
type: 'table',
|
||||
@@ -216,9 +216,10 @@ const tableDataFun = (list: any) => {
|
||||
index: i + 1,
|
||||
nodeName: perofrmances[i].nodeName,
|
||||
nodeCode: perofrmances[i].nodeCode,
|
||||
targetValue: perofrmances[i].targetValue,
|
||||
resultValue: perofrmances[i].resultValue,
|
||||
completeStatus: getCompleteStatusNameFun(perofrmances[i].completeStatus),
|
||||
method: perofrmances[i].method,
|
||||
highValue: perofrmances[i].highValue,
|
||||
targetValue: perofrmances[i].targetValue,
|
||||
unit: perofrmances[i].unit,
|
||||
};
|
||||
tableData.value.value.push(obj);
|
||||
@@ -389,6 +390,11 @@ const updatePngFun = async (id: any) => {
|
||||
}
|
||||
};
|
||||
|
||||
const getCompleteStatusNameFun = (status: any) => {
|
||||
const names = ['未分析', '合格', '不合格'];
|
||||
return names[status] || names[0];
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.runIfno,
|
||||
async (newVal) => {
|
||||
|
||||
@@ -891,7 +891,7 @@ const getNodeFileIdAndNames = async () => {
|
||||
const dirId = flowNodeData.value.userParams.inputDirId;
|
||||
const fileIds: any = [];
|
||||
const fileNames: any = [];
|
||||
let taskCmdParam: any = {};
|
||||
const taskCmdParam: any = {};
|
||||
|
||||
// 本地应用执行的脚本也需要下载下来
|
||||
if (flowNodeParamData.value?.postScripts?.length) {
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
:show-setting="false"
|
||||
></taskPerformance>
|
||||
</div>
|
||||
<div class="dir-content" v-else-if="runDirNameList.length && currentDirName != 'performance'">
|
||||
<div class="dir-content" v-else>
|
||||
<div class="table-box">
|
||||
<BaseTable
|
||||
v-if="tableShow"
|
||||
|
||||
@@ -22,8 +22,9 @@
|
||||
:show-setting="false"
|
||||
>
|
||||
<template #leftOptions>
|
||||
<el-button type="" @click="asyncFileFun">归档</el-button>
|
||||
<el-upload :show-file-list="false" :before-upload="beforeUploadFun">
|
||||
<el-button>上传</el-button>
|
||||
<el-button class="ml10" type="primary">上传</el-button>
|
||||
</el-upload>
|
||||
<el-button type="primary" class="ml10" @click="downLoadFileFun">下载</el-button>
|
||||
<el-button type="danger" @click="deleteFileFun">删除</el-button>
|
||||
@@ -42,19 +43,47 @@
|
||||
</div> -->
|
||||
|
||||
<FilePreview v-model="previewVisible" :fileId="currentRow?.id" />
|
||||
<Dialog
|
||||
v-model="showSyncFileTypeSelectFlag"
|
||||
diaTitle="文件归档"
|
||||
:width="'20%'"
|
||||
:height="'30%'"
|
||||
:confirm-closable="false"
|
||||
>
|
||||
<div class="form-content">
|
||||
<el-form :model="formData">
|
||||
<el-form-item label="文件类型">
|
||||
<el-select v-model="formData.fileType">
|
||||
<el-option
|
||||
v-for="item in fileTypeList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button @click="cancalFun">取消</el-button>
|
||||
<el-button @click="submitFun" type="primary">确定</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue';
|
||||
import { reactive, ref, watch } from 'vue';
|
||||
import BaseTable from '@/components/common/table/baseTable.vue';
|
||||
import { queryRunDirApi, uploadRunFilesApi } from '@/api/project/run';
|
||||
import { queryRunDirApi, syncKeyResultToTaskApi, uploadRunFilesApi } from '@/api/project/run';
|
||||
import { downloadFileById, downloadFileByStream, fileUploadAllocationTypeFun } from '@/utils/file';
|
||||
import FilePreview from '@/components/common/filePreview/index.vue';
|
||||
import { formatFileSize } from '@/utils/file';
|
||||
import emitter from '@/utils/eventBus';
|
||||
import { dataDelFileApi } from '@/api/data/data';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import Dialog from '@/components/common/dialog/index.vue';
|
||||
import { useDict } from '@/utils/useDict';
|
||||
|
||||
const props = defineProps({
|
||||
nodeInfo: {
|
||||
@@ -67,6 +96,12 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
const baseTableRef = ref();
|
||||
const showSyncFileTypeSelectFlag = ref(false);
|
||||
const formData = reactive<any>({
|
||||
fileType: '',
|
||||
});
|
||||
const { ALL_FILE_TYPE }: any = useDict('ALL_FILE_TYPE');
|
||||
const fileTypeList = ref<any>(ALL_FILE_TYPE.value['A']);
|
||||
const beforeUploadFun = async (file: any) => {
|
||||
if (!props.fileId) {
|
||||
return;
|
||||
@@ -185,6 +220,46 @@ const actionList = ref([
|
||||
},
|
||||
]);
|
||||
|
||||
// 归档算例下文件到工况下
|
||||
const syncFiles = ref<any>([]);
|
||||
const asyncFileFun = () => {
|
||||
syncFiles.value = baseTableRef.value.tableRef.getCheckboxRecords() || [];
|
||||
formData.fileType = '';
|
||||
if (syncFiles.value?.length) {
|
||||
showSyncFileTypeSelectFlag.value = true;
|
||||
} else {
|
||||
ElMessage.warning('请选择文件进行归档');
|
||||
}
|
||||
};
|
||||
|
||||
const cancalFun = () => {
|
||||
showSyncFileTypeSelectFlag.value = false;
|
||||
};
|
||||
|
||||
const submitFun = async () => {
|
||||
if (!formData.fileType) {
|
||||
ElMessage.warning('请选择归档文件类型');
|
||||
return;
|
||||
}
|
||||
|
||||
const fileIds = syncFiles.value.map((item: any) => {
|
||||
return item.id;
|
||||
});
|
||||
const param = {
|
||||
fileIds,
|
||||
fileType: formData.fileType,
|
||||
runId: props.nodeInfo.runId,
|
||||
};
|
||||
|
||||
try {
|
||||
const res: any = await syncKeyResultToTaskApi(param);
|
||||
if (res && res.code == 200) {
|
||||
ElMessage.success('归档成功');
|
||||
showSyncFileTypeSelectFlag.value = false;
|
||||
}
|
||||
} catch {}
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.nodeInfo,
|
||||
(newVal) => {
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
:api="listExperimentResultApi"
|
||||
:show-overflow="false"
|
||||
:params="tableParams"
|
||||
:full-height="true"
|
||||
>
|
||||
<template v-if="showLeftOptions" #leftOptions>
|
||||
<el-button type="primary" @click="uploadResultFun">上传结果</el-button>
|
||||
@@ -159,7 +160,7 @@ import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import FilePreview from '@/components/common/filePreview/index.vue';
|
||||
import { getFileBaseInfoApi } from '@/api/data/data';
|
||||
import Dialog from '@/components/common/dialog/index.vue';
|
||||
import { downloadFileById, fileUploadAllocationIconFun, formatFileSize } from '@/utils/file';
|
||||
import { downloadFileById, fileUploadAllocationIconFun, fileUploadAllocationTypeFun, formatFileSize } from '@/utils/file';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { updateTaskStatusApi } from '@/api/project/task';
|
||||
import { FILE_TYPE } from '@/utils/enum/file';
|
||||
@@ -389,8 +390,8 @@ const submitFun = async () => {
|
||||
return {
|
||||
fileName: item.name,
|
||||
fileSize: item.size,
|
||||
// fileType: fileUploadAllocationTypeFun(item.name),
|
||||
fileType: formData.value.fileTypeDictValue,
|
||||
fileType: fileUploadAllocationTypeFun(item.name),
|
||||
// fileType: formData.value.fileTypeDictValue,
|
||||
};
|
||||
});
|
||||
} else {
|
||||
@@ -398,8 +399,8 @@ const submitFun = async () => {
|
||||
return {
|
||||
fileName: item.name,
|
||||
fileSize: item.size,
|
||||
// fileType: fileUploadAllocationTypeFun(item.name),
|
||||
fileType: formData.value.fileTypeDictValue,
|
||||
fileType: fileUploadAllocationTypeFun(item.name),
|
||||
// fileType: formData.value.fileTypeDictValue,
|
||||
};
|
||||
});
|
||||
}
|
||||
@@ -410,15 +411,15 @@ const submitFun = async () => {
|
||||
obj.addImageInfo = {
|
||||
fileName: imageFileList.value[0].name,
|
||||
fileSize: imageFileList.value[0].size,
|
||||
// fileType: fileUploadAllocationTypeFun(imageFileList.value[0].name),
|
||||
fileType: formData.value.fileTypeDictValue,
|
||||
fileType: fileUploadAllocationTypeFun(imageFileList.value[0].name),
|
||||
// fileType: formData.value.fileTypeDictValue,
|
||||
};
|
||||
} else {
|
||||
obj.imageFileInfo = {
|
||||
fileName: imageFileList.value[0].name,
|
||||
fileSize: imageFileList.value[0].size,
|
||||
// fileType: fileUploadAllocationTypeFun(imageFileList.value[0].name),
|
||||
fileType: formData.value.fileTypeDictValue,
|
||||
fileType: fileUploadAllocationTypeFun(imageFileList.value[0].name),
|
||||
// fileType: formData.value.fileTypeDictValue,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user