merge
This commit is contained in:
@@ -55,8 +55,8 @@ export const dataFileSearchApi = (params: any) => {
|
||||
export const dataDelFileApi = (params: any) => {
|
||||
return post(`${PREFIX}data/delFile`, params);
|
||||
};
|
||||
export const dataExportFileApi = (params: any) => {
|
||||
return download(`${PREFIX}data/exportFile`, params);
|
||||
export const dataExportKnowledgeListApi = (params: any, filename: string) => {
|
||||
return download(`${PREFIX}data/exportKnowledgeList`, params, filename);
|
||||
};
|
||||
export const dataDownloadFileApi = (params: any) => {
|
||||
return get(`${PREFIX}data/downloadFile`, params);
|
||||
@@ -229,3 +229,12 @@ export const batchAddFileInfoApi = (params: any) => {
|
||||
export const callBackknowledgeFileApi = (params: any) => {
|
||||
return post(`${PREFIX}data/callBackknowledgeFile`, params);
|
||||
};
|
||||
|
||||
/**
|
||||
* 知识库多文件上传成功回调接口
|
||||
* @param params uploadTaskId succBusinessIds failBusinessIds isApprove
|
||||
* @returns
|
||||
*/
|
||||
export const chunkUploadCallbackApi = (params: any) => {
|
||||
return post(`${PREFIX}data/chunkUploadCallback`, params);
|
||||
};
|
||||
|
||||
@@ -9,8 +9,8 @@ export const getModelTrainingListApi = (params: any) => {
|
||||
return post(`${PREFIX}modelTraining/getModelList`, params);
|
||||
};
|
||||
// 导出模型列表
|
||||
export const exportTrainingListApi = (params: any) => {
|
||||
return download(`${PREFIX}modelTraining/exportModelList`, params);
|
||||
export const exportTrainingListApi = (params: any, fileName: string) => {
|
||||
return download(`${PREFIX}modelTraining/exportModelList`, params, fileName);
|
||||
};
|
||||
// 获取模型详情
|
||||
export const getModelDetailApi = (params: any) => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { post, upload } from '@/api/request';
|
||||
import { download, post, upload } from '@/api/request';
|
||||
|
||||
const env = import.meta.env;
|
||||
const PREFIX = env.VITE_API_PREFIX_PROJECT;
|
||||
@@ -119,5 +119,24 @@ export const deleteSimulationKeyResultApi = (params: any) => {
|
||||
* @returns
|
||||
*/
|
||||
export const generateReportApi = (params: any) => {
|
||||
return post(`${PREFIX}run/generateReport`, params);
|
||||
return download(`${PREFIX}run/generateReport`, params, params.fileName);
|
||||
};
|
||||
|
||||
/**
|
||||
* 上传交付物第一步 keyResultList uploadTaskId runId templateId templateName type 0
|
||||
* @param params
|
||||
*/
|
||||
export const batchAddSimulationKeyResultApi = (params: any) => {
|
||||
return post(`${PREFIX}run/batchAddSimulationKeyResult`, params);
|
||||
};
|
||||
|
||||
/**
|
||||
* 根据交付物文件id查询相关属性和任务信息
|
||||
* @param params fileId 文件id
|
||||
* @returns
|
||||
*/
|
||||
export const queryKeyResultAndTaskInfoApi = (params: any) => {
|
||||
return post(`${PREFIX}run/queryKeyResultAndTaskInfo`, params);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -84,25 +84,52 @@ const download = (url: string, params = {}, filename = 'download') => {
|
||||
let fileName = filename;
|
||||
|
||||
if (contentDisposition) {
|
||||
const regex = /(filename\*?)\s*=\s*(?:UTF-8'')?["']?([^;"']+)["']?/ig;
|
||||
let match: RegExpExecArray | null = null;
|
||||
while ((match = regex.exec(contentDisposition)) !== null) {
|
||||
const key = match[1];
|
||||
const val = match[2];
|
||||
if (!val) continue;
|
||||
if (key.endsWith('*')) {
|
||||
if (val.toLowerCase() === 'utf-8') {
|
||||
continue;
|
||||
}
|
||||
const parts = contentDisposition.split(';').map((p: string) => p.trim()).filter(Boolean);
|
||||
const paramsMap: Record<string, string> = {};
|
||||
parts.forEach((part: string) => {
|
||||
const idx = part.indexOf('=');
|
||||
if (idx === -1) return;
|
||||
const key = part.slice(0, idx).trim().toLowerCase();
|
||||
let val = part.slice(idx + 1).trim();
|
||||
if (val.startsWith('"') && val.endsWith('"')) {
|
||||
val = val.slice(1, -1);
|
||||
}
|
||||
paramsMap[key] = val;
|
||||
});
|
||||
|
||||
if (paramsMap['filename*']) {
|
||||
const val = paramsMap['filename*'];
|
||||
const rfcMatch = val.match(/^([^']*)''(.*)$/);
|
||||
if (rfcMatch) {
|
||||
const encoded = rfcMatch[2];
|
||||
try {
|
||||
fileName = decodeURIComponent(val);
|
||||
fileName = decodeURIComponent(encoded);
|
||||
} catch {
|
||||
fileName = val;
|
||||
fileName = encoded;
|
||||
}
|
||||
} else {
|
||||
fileName = val.replace(/^["']|["']$/g, '');
|
||||
if (/^utf-?8$/i.test(val) && paramsMap['filename']) {
|
||||
const candidate = paramsMap['filename'];
|
||||
try {
|
||||
fileName = candidate.includes('%') ? decodeURIComponent(candidate) : candidate;
|
||||
} catch {
|
||||
fileName = candidate;
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
fileName = val.includes('%') ? decodeURIComponent(val) : val;
|
||||
} catch {
|
||||
fileName = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (paramsMap['filename']) {
|
||||
const candidate = paramsMap['filename'];
|
||||
try {
|
||||
fileName = candidate.includes('%') ? decodeURIComponent(candidate) : candidate;
|
||||
} catch {
|
||||
fileName = candidate;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,8 +39,8 @@ export const getTaskPoolPerformanceApi = (params: any) => {
|
||||
return get(`${PREFIX}taskpool/getTaskPoolPerformance`, params);
|
||||
};
|
||||
|
||||
export const exportTaskPoolPerformanceApi = (params: any) => {
|
||||
return download(`${PREFIX}taskPerformance/exportTaskPoolPerformance`, params);
|
||||
export const exportTaskPoolPerformanceApi = (params: any, filename: string) => {
|
||||
return download(`${PREFIX}taskPerformance/exportTaskPoolPerformance`, params, filename);
|
||||
};
|
||||
|
||||
export const getTaskPerformanceApi = (params: any) => {
|
||||
|
||||
@@ -49,7 +49,7 @@ import { ref } from 'vue';
|
||||
import { Upload, Delete } from '@element-plus/icons-vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { formatFileSize } from '@/utils/file';
|
||||
import { chunkUploadToMinioApi, callBackknowledgeFileApi } from '@/api/data/data';
|
||||
import { chunkUploadToMinioApi, callBackknowledgeFileApi, chunkUploadCallbackApi } from '@/api/data/data';
|
||||
import emitter from '@/utils/eventBus';
|
||||
|
||||
const taskStatusObj: any = {}; // 更具uploadTaskId和businessId记录所以任务文件的上传状态
|
||||
@@ -154,6 +154,7 @@ const callBackFun = (data: any) => {
|
||||
};
|
||||
const apiObj: any = {
|
||||
2: callBackknowledgeFileApi, // 知识库后处理
|
||||
4: chunkUploadCallbackApi,
|
||||
};
|
||||
apiObj[taskType](params);
|
||||
}
|
||||
|
||||
@@ -7,14 +7,16 @@
|
||||
showCheckbox
|
||||
:params="{
|
||||
taskId: taskId,
|
||||
fileBizType: 3,
|
||||
fileBizType: 8,
|
||||
fileName: '',
|
||||
startTime: '',
|
||||
endTime: ''
|
||||
}"
|
||||
:actionList="actionList"
|
||||
>
|
||||
|
||||
<template #leftOptions>
|
||||
<el-button type="primary" @click="uploadDeliverFileFun">上传交付物</el-button>
|
||||
<div v-if="showFilter">
|
||||
<el-select v-model="currentId" class="select-style">
|
||||
<el-option v-for="item in taskRunList" :label="item.name" :value="item.id" :key="item.id"></el-option>
|
||||
@@ -28,12 +30,11 @@
|
||||
<template #fileSize="{ row }">
|
||||
<span>{{ formatFileSize(row.fileSize) }}</span>
|
||||
</template>
|
||||
<template #operate="{ row }">
|
||||
<el-button link type="primary">
|
||||
<UploadFile v-model="row.id" :name="'下载'" />
|
||||
</el-button>
|
||||
</template>
|
||||
</BaseTable>
|
||||
|
||||
<FilePreview v-model="previewVisible" :fileId="currentRow?.id" />
|
||||
|
||||
<uploadDeliverableFilePage v-if="uploadFileVisible" :curentTaskInfo="taskInfo" @close="uploadFileVisible = false" @update="updateTableDataFun"></uploadDeliverableFilePage>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -42,20 +43,28 @@ import { ref, onMounted } from 'vue';
|
||||
import BaseTable from '@/components/common/table/baseTable.vue';
|
||||
import { getSimulationTaskFilesApi } from '@/api/data/data';
|
||||
import { formatFileSize } from '@/utils/file';
|
||||
import UploadFile from '@/components/common/uploadFile/index.vue';
|
||||
import FilePreview from '@/components/common/filePreview/index.vue';
|
||||
import uploadDeliverableFilePage from './uploadDeliverableFilePage.vue';
|
||||
|
||||
const props = defineProps({
|
||||
taskId: {
|
||||
type: Number,
|
||||
default: 100,
|
||||
},
|
||||
taskInfo: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
showFilter: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
const env = import.meta.env;
|
||||
|
||||
const baseTableRef = ref();
|
||||
const currentId = ref<any>(props.taskId);
|
||||
const uploadFileVisible = ref(false);
|
||||
const taskRunList = ref<any>([]);
|
||||
const getTaskRunInfoFun = () => {
|
||||
console.log(props.taskId);
|
||||
@@ -73,6 +82,38 @@ const getfileType = (data: any) => {
|
||||
return fileType;
|
||||
|
||||
};
|
||||
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) => {
|
||||
const downloadUrl = `${env.VITE_API_FILE_URL}/data/downloadFile?fileId=${row.fileId}`;
|
||||
window.open(downloadUrl, '_blank');
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '预览',
|
||||
type: 'primary',
|
||||
click: (row:any) => {
|
||||
previewFileFun(row);
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
const uploadDeliverFileFun = () => {
|
||||
uploadFileVisible.value = true;
|
||||
};
|
||||
|
||||
const updateTableDataFun = () => {
|
||||
uploadFileVisible.value = false;
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getTaskRunInfoFun();
|
||||
|
||||
258
src/components/taskDetail/uploadDeliverableFilePage.vue
Normal file
258
src/components/taskDetail/uploadDeliverableFilePage.vue
Normal file
@@ -0,0 +1,258 @@
|
||||
<template>
|
||||
|
||||
<Dialog
|
||||
v-model="visible"
|
||||
diaTitle="上传交付物"
|
||||
:width="'70%'"
|
||||
:height="'70%'"
|
||||
:zIndex="100"
|
||||
@close="handleCloseFun"
|
||||
show-footer
|
||||
>
|
||||
<div class="page-content">
|
||||
|
||||
<div class="table-box">
|
||||
<BaseTable
|
||||
tableName="TASK_DELIVERABLE"
|
||||
ref="baseTableRef"
|
||||
showCheckbox
|
||||
:actionList="actionList"
|
||||
:hide-pagination="true"
|
||||
>
|
||||
<template #leftOptions>
|
||||
<el-form :model="templateFormData" inline>
|
||||
<el-form-item label="审核模版:">
|
||||
<el-select v-model="templateFormData.templateId" class="mw200">
|
||||
<el-option v-for="item in templateList" :key="item.id" :label="item.templateName" :value="item.templateId"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="uploadFileFun('RUN_RESULT_IMAGE_TABLE')">上传图片文件</el-button>
|
||||
<el-button type="primary" @click="uploadFileFun('RUN_RESULT_CANVAS_TABLE')">上传曲线文件</el-button>
|
||||
<el-button type="primary" @click="uploadFileFun('RUN_RESULT_REPORT_TABLE')">上传报告文件</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
<template #status="{row,cloumn}">
|
||||
<el-tag type="info"> 待审批</el-tag>
|
||||
</template>
|
||||
|
||||
</BaseTable>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="handleCloseFun">取消</el-button>
|
||||
<el-button type="primary" @click="createSuccessFun">提交评审</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</Dialog>
|
||||
|
||||
<el-drawer v-model="uploadFileVisible" :title="`文件上传`" :size="500" :close-on-click-modal="false" @close="closeFun">
|
||||
<TableForm ref="tableFormRef" :tableName="tableName" />
|
||||
<template #footer>
|
||||
<div>
|
||||
<el-button @click="uploadFileVisible = false">关闭</el-button>
|
||||
<el-button type="primary" @click="submitFun">确定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, defineProps, defineEmits, onMounted, reactive, nextTick } from 'vue';
|
||||
import Dialog from '@/components/common/dialog/index.vue';
|
||||
import { systemApproveQueryApproveFlowTempalteApi } from '@/api/system/systemApprove';
|
||||
import BaseTable from '@/components/common/table/baseTable.vue';
|
||||
import TableForm from '@/components/common/table/tableForm.vue';
|
||||
import { batchAddSimulationKeyResultApi } from '@/api/project/run';
|
||||
import emitter from '@/utils/eventBus';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
const props = defineProps({
|
||||
curentTaskInfo: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
});
|
||||
const emits = defineEmits(['close', 'update']);
|
||||
|
||||
const visible = ref(true);
|
||||
const uploadFileVisible = ref(false);
|
||||
const tableFormRef = ref();
|
||||
const baseTableRef = ref();
|
||||
const tableName = ref('RUN_RESULT_IMAGE_TABLE');
|
||||
const templateList = ref<any>([]);
|
||||
const keyResultType = ref('1');
|
||||
const tableData = ref<any>([]);
|
||||
|
||||
const templateFormData = reactive<any>({
|
||||
templateId: '',
|
||||
});
|
||||
|
||||
const handleCloseFun = () => {
|
||||
emits('close');
|
||||
};
|
||||
|
||||
const createSuccessFun = async () => {
|
||||
console.log(tableData.value, 'tableData.value');
|
||||
console.log(props.curentTaskInfo, 'curentTaskInfo.curentTaskInfo');
|
||||
|
||||
if (!templateFormData.templateId.length) {
|
||||
ElMessage.warning('未选择审批模板,无法发起流程!');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!tableData.value.length) {
|
||||
ElMessage.warning('未选择交付物文件上传,无法发起流程!');
|
||||
return;
|
||||
}
|
||||
|
||||
const uploadFileList:any = [];
|
||||
const templateName = templateList.value.find((item:any) => {
|
||||
return item.templateId === templateFormData.templateId;
|
||||
})?.templateName;
|
||||
const param:any = {
|
||||
keyResultList: [],
|
||||
uploadTaskId: new Date().getTime(),
|
||||
taskId: props.curentTaskInfo?.uuid,
|
||||
templateId: templateFormData.templateId,
|
||||
templateName,
|
||||
};
|
||||
|
||||
for (let i = 0;i < tableData.value.length;i++) {
|
||||
param.keyResultList.push({
|
||||
fileName: tableData.value[i].fileName,
|
||||
fileSize: tableData.value[i].fileSize,
|
||||
fileType: tableData.value[i].fileType,
|
||||
keyResultType: tableData.value[i].keyResultType,
|
||||
name: tableData.value[i].name,
|
||||
quantityType: tableData.value[i].quantityType,
|
||||
units: tableData.value[i].units,
|
||||
max: tableData.value[i].max,
|
||||
min: tableData.value[i].min,
|
||||
description: tableData.value[i].description,
|
||||
xQuantityType: tableData.value[i].xQuantityType,
|
||||
xUnits: tableData.value[i].xUnits,
|
||||
yQuantityType: tableData.value[i].yQuantityType,
|
||||
yUnits: tableData.value[i].yUnits,
|
||||
});
|
||||
}
|
||||
|
||||
const res:any = await batchAddSimulationKeyResultApi(param);
|
||||
if (res && res.code === 200) {
|
||||
|
||||
console.log(uploadFileList, 'uploadFileList');
|
||||
console.log(res.data, 'res.data');
|
||||
|
||||
res.data.forEach((item:any, index:any) => {
|
||||
|
||||
emitter.emit('ADD_UPLOAD_FILE', {
|
||||
file: tableData.value[index].uploadFile[0].raw,
|
||||
data: { // 接口返回的文件目录信息,包括配置信息
|
||||
...item,
|
||||
isApprove: 1, // 0否 1是
|
||||
taskType: 4, // 4交付物
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (res.code === 200) {
|
||||
|
||||
emits('update');
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
const systemApproveQueryApproveFlowTempalteFun = async () => {
|
||||
const res:any = await systemApproveQueryApproveFlowTempalteApi({});
|
||||
|
||||
if (res && res.code === 200) {
|
||||
templateList.value = res.data;
|
||||
} else {
|
||||
templateList.value = [];
|
||||
}
|
||||
};
|
||||
|
||||
const uploadFileFun = (flag:string) => {
|
||||
tableName.value = flag;
|
||||
|
||||
if ( tableName.value === 'RUN_RESULT_IMAGE_TABLE') {
|
||||
keyResultType.value = '1';
|
||||
}
|
||||
if (tableName.value === 'RUN_RESULT_CANVAS_TABLE') {
|
||||
keyResultType.value = '2';
|
||||
}
|
||||
if (tableName.value === 'RUN_RESULT_REPORT_TABLE') {
|
||||
keyResultType.value = '3';
|
||||
}
|
||||
|
||||
uploadFileVisible.value = true;
|
||||
nextTick(() => {
|
||||
tableFormRef.value.resetFun();
|
||||
});
|
||||
};
|
||||
|
||||
const actionList = ref([
|
||||
{
|
||||
title: '删除',
|
||||
type: 'danger',
|
||||
click: (row:any) => {
|
||||
tableData.value = tableData.value.filter((item:any) => {
|
||||
return item.uploadId != row.uploadId;
|
||||
});
|
||||
|
||||
baseTableRef.value.setDataFun(tableData.value);
|
||||
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
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 = {};
|
||||
paramData.originalName = name;
|
||||
paramData.fileName = name;
|
||||
paramData.name = name;
|
||||
paramData.fileSize = file.size;
|
||||
paramData.uploadId = new Date().getTime();
|
||||
for (const key in fromData) {
|
||||
paramData[key] = fromData[key];
|
||||
}
|
||||
paramData.keyResultType = keyResultType.value;
|
||||
paramData.fileType = '8';
|
||||
tableData.value.push(paramData);
|
||||
baseTableRef.value.setDataFun(tableData.value);
|
||||
uploadFileVisible.value = false;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
|
||||
await systemApproveQueryApproveFlowTempalteFun();
|
||||
console.log(props.curentTaskInfo, 'curentTaskInfo');
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.page-content{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-height: 500px;
|
||||
|
||||
.mw200{
|
||||
width: 200px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -201,30 +201,3 @@ export const exportFile = (api: any, tableName: string, fileName: string, params
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 导出文件
|
||||
* @param content
|
||||
* @param filename
|
||||
* @param contentType
|
||||
*/
|
||||
export function downloadFile(content: any, filename: any, contentType: any) {
|
||||
// 创建一个 Blob 对象
|
||||
const blob = new Blob([content], { type: contentType });
|
||||
|
||||
// 创建一个指向该 Blob 的 URL
|
||||
const url = URL.createObjectURL(blob);
|
||||
|
||||
// 创建一个临时的 <a> 元素来触发下载
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.setAttribute('download', filename); // 设置下载的文件名
|
||||
|
||||
// 模拟点击 <a> 元素来触发下载
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
|
||||
// 释放 URL 对象
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,8 +29,9 @@
|
||||
.flex-end {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
z-index: 99;
|
||||
top: 20px;
|
||||
.space {
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,6 +88,7 @@
|
||||
.pool-select {
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
min-width: 535px;
|
||||
|
||||
.el-select {
|
||||
width: 180px;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="loadcase">
|
||||
<div class="contain" v-if=" pageType === 'loadcase'">
|
||||
<div class="flex-end">
|
||||
<el-space>
|
||||
<el-space class="space">
|
||||
<template v-if="pageType === 'loadcase'">
|
||||
<el-button @click="addPoolFun">
|
||||
<el-icon class="mr5">
|
||||
@@ -41,7 +41,6 @@
|
||||
<el-form :inline="true">
|
||||
<el-form-item :label="$t('工况库.工况清单库')" :label-width="100">
|
||||
<el-select
|
||||
:teleported="false"
|
||||
v-model="currentPoolBrief"
|
||||
:props="{ label: 'poolName', value: 'value' }"
|
||||
value-key="poolName"
|
||||
@@ -58,7 +57,6 @@
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('工况库.版本')" :label-width="40">
|
||||
<el-select
|
||||
:teleported="false"
|
||||
v-model="currentPoolBriefVersion"
|
||||
:props="{ label: 'poolVersion', value: 'value' }"
|
||||
value-key="poolVersion"
|
||||
@@ -129,7 +127,6 @@
|
||||
<el-form :inline="true">
|
||||
<el-form-item :label="$t('工况库.工况清单库')" :label-width="100">
|
||||
<el-select
|
||||
:teleported="false"
|
||||
v-model="currentPoolBrief"
|
||||
:props="{ label: 'poolName', value: 'value' }"
|
||||
value-key="poolName"
|
||||
@@ -146,7 +143,6 @@
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('工况库.版本')" :label-width="40">
|
||||
<el-select
|
||||
:teleported="false"
|
||||
v-model="currentPoolBriefVersion"
|
||||
:props="{ label: 'poolVersion', value: 'value' }"
|
||||
value-key="poolVersion"
|
||||
|
||||
@@ -58,11 +58,15 @@
|
||||
:actionsWidth="200"
|
||||
:actionList="actionList"
|
||||
@cell-dblclick="onCellDblclickFun"
|
||||
:exportApi="dataExportFileApi"
|
||||
:exportApi="dataExportKnowledgeListApi"
|
||||
:exportFileName="$t('知识库.知识库列表')"
|
||||
:exportDict="{
|
||||
approvalStatus: 'KNOWLEDGE_APPROVE_STATUS'
|
||||
}"
|
||||
:exportParams="{
|
||||
...searchParams,
|
||||
parentDirId: currentFolder?.id || ''
|
||||
}"
|
||||
>
|
||||
<template #leftOptions>
|
||||
<div>
|
||||
@@ -128,7 +132,7 @@ import BaseTable from '@/components/common/table/baseTable.vue';
|
||||
import FileTree from '@/components/common/fileTree/index.vue';
|
||||
import knowledgeDetailModal from './components/knowledgeDetailModal.vue';
|
||||
import folderModal from './components/folderDetailModal.vue';
|
||||
import { dataCreateDirApi, dataListDirApi, dataRenameDirApi, dataUploadFilesApi, dataDelDirApi, dataQueryDirApi, dataFileSearchApi, dataDelFileApi, dataUpdateFileApi, batchAddFileInfoApi, dataExportFileApi } from '@/api/data/data';
|
||||
import { dataCreateDirApi, dataListDirApi, dataRenameDirApi, dataUploadFilesApi, dataDelDirApi, dataQueryDirApi, dataFileSearchApi, dataDelFileApi, dataUpdateFileApi, batchAddFileInfoApi, dataExportKnowledgeListApi } from '@/api/data/data';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import type { RenderContentContext } from 'element-plus';
|
||||
import { formatFileSize } from '@/utils/file';
|
||||
|
||||
115
src/views/index/approvalPreview/components/deliverableFile.vue
Normal file
115
src/views/index/approvalPreview/components/deliverableFile.vue
Normal file
@@ -0,0 +1,115 @@
|
||||
<template>
|
||||
<div class="header">
|
||||
<div class="label">审批类型</div>
|
||||
<div class="content">
|
||||
<el-tag :type="tagTypeMap[approveAction]" size="small">{{ contents }}</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
<BaseTable
|
||||
ref="baseTableRef"
|
||||
tableName="TASK_DELIVERABLE"
|
||||
showIndex
|
||||
:actionsWidth="200"
|
||||
:actionList="actionList"
|
||||
>
|
||||
<template #originalName="{ row }">
|
||||
<el-icon v-if="row.dataType === 1">
|
||||
<Folder />
|
||||
</el-icon>
|
||||
<el-icon v-else>
|
||||
<Document />
|
||||
</el-icon>
|
||||
{{ row.originalName }}
|
||||
</template>
|
||||
<template #fileSize="{ row }">
|
||||
{{ formatFileSize(row.fileSize) }}
|
||||
</template>
|
||||
</BaseTable>
|
||||
<FilePreview v-model="previewVisible" :fileId="currentRow?.id" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, watchEffect } from 'vue';
|
||||
import BaseTable from '@/components/common/table/baseTable.vue';
|
||||
import i18n from '@/utils/i18n';
|
||||
import { formatFileSize } from '@/utils/file';
|
||||
import FilePreview from '@/components/common/filePreview/index.vue';
|
||||
|
||||
interface Props {
|
||||
data: any;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
data: {},
|
||||
});
|
||||
const env = import.meta.env;
|
||||
const knowledgeList = ref<any[]>([]);
|
||||
const contents = ref<string>('');
|
||||
const approveAction = ref<any>();
|
||||
const tagTypeMap:any = {
|
||||
1: 'success',
|
||||
2: 'primary',
|
||||
3: 'danger',
|
||||
};
|
||||
const baseTableRef = ref<any>(null);
|
||||
watchEffect(() => {
|
||||
if (props.data) {
|
||||
const approveContents = JSON.parse(props.data?.approveContents || '{}');
|
||||
knowledgeList.value = approveContents.afterData || approveContents.beforeData || null;
|
||||
contents.value = approveContents.contents || '';
|
||||
approveAction.value = props.data?.approveAction || '';
|
||||
if (baseTableRef.value && knowledgeList.value) {
|
||||
baseTableRef.value?.setDataFun(knowledgeList.value);
|
||||
}
|
||||
}
|
||||
});
|
||||
const currentRow = ref<any>(null);
|
||||
const previewVisible = ref<boolean>(false);
|
||||
const previewFileFun = (row: any) => {
|
||||
currentRow.value = row;
|
||||
previewVisible.value = true;
|
||||
};
|
||||
const downloadFileFun = (row: any) => {
|
||||
const downloadUrl = `${env.VITE_API_FILE_URL}/data/downloadFile?fileId=${row.id}`;
|
||||
window.open(downloadUrl, '_blank');
|
||||
};
|
||||
const actionList = computed(() => {
|
||||
return [
|
||||
{
|
||||
title: i18n?.global?.t('通用.预览'),
|
||||
type: 'primary',
|
||||
click: (row: any) => {
|
||||
previewFileFun(row);
|
||||
},
|
||||
hide: (row: any) => {
|
||||
return row.dataType !== 2;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: i18n?.global?.t('通用.下载'),
|
||||
type: 'primary',
|
||||
click: (row: any) => {
|
||||
downloadFileFun(row);
|
||||
},
|
||||
hide: (row: any) => {
|
||||
return row.dataType !== 2;
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.header {
|
||||
margin-bottom: 24px;
|
||||
display: flex;
|
||||
}
|
||||
.label {
|
||||
font-weight: 600;
|
||||
margin-right: 16px;
|
||||
}
|
||||
.content {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -8,12 +8,19 @@
|
||||
<span size="large" type="success" v-if="isCreatePool"> {{ poolName }}</span>
|
||||
<span size="large" type="primary" v-else> {{ poolName }}</span>
|
||||
</div>
|
||||
<div class="tip">
|
||||
<el-tooltip :content="$t('工况库.审批预览提示')">
|
||||
<el-icon>
|
||||
<QuestionFilled />
|
||||
</el-icon>
|
||||
</el-tooltip>
|
||||
<div class="legend-tooltip">
|
||||
<div class="legend-item">
|
||||
<span class="legend-color added"></span>
|
||||
<span class="legend-label">{{ $t('通用.新增') }}</span>
|
||||
</div>
|
||||
<div class="legend-item">
|
||||
<span class="legend-color updated"></span>
|
||||
<span class="legend-label">{{ $t('通用.编辑') }}</span>
|
||||
</div>
|
||||
<div class="legend-item">
|
||||
<span class="legend-color deleted"></span>
|
||||
<span class="legend-label">{{ $t('通用.删除') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="body">
|
||||
@@ -26,7 +33,8 @@
|
||||
:hasOperationColumn="false"
|
||||
:showCheckBox="false"
|
||||
:rowClassName="rowClassName"
|
||||
> </loadCaseTable>
|
||||
>
|
||||
</loadCaseTable>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -252,6 +260,8 @@ watchEffect(() => {
|
||||
.header {
|
||||
height: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
|
||||
.label {
|
||||
font-weight: 600;
|
||||
@@ -293,4 +303,45 @@ ul>li {
|
||||
:deep(.preview-deleted) {
|
||||
background-color: var(--el-color-danger-light-7);
|
||||
}
|
||||
|
||||
.legend-tooltip {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 20px;
|
||||
padding: 6px 8px;
|
||||
flex: 1;
|
||||
margin-left: auto;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.legend-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.legend-color {
|
||||
width: 24px;
|
||||
height: 12px;
|
||||
border-radius: 2px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.legend-color.added {
|
||||
background-color: var(--el-color-success-light-7);
|
||||
}
|
||||
|
||||
.legend-color.updated {
|
||||
background-color: var(--el-color-primary-light-7);
|
||||
}
|
||||
|
||||
.legend-color.deleted {
|
||||
background-color: var(--el-color-danger-light-7);
|
||||
}
|
||||
|
||||
.legend-label {
|
||||
font-size: 12px;
|
||||
color: var(--el-text-color-secondary);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<TaskPool v-if="data.approveType === 1" :data="data" />
|
||||
<Knowledge v-else-if="data.approveType === 2" :data="data" />
|
||||
<FlowView type="approve" v-else-if="data.approveType === 3" :data="data" />
|
||||
<DeliverableFile v-else-if="data.approveType === 4" :data="data" />
|
||||
<div v-else>其他审核预览{{ data.cidFlowId }}</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -16,6 +17,7 @@ import { systemQueryApproveInstanceApi } from '@/api/system/systemApprove';
|
||||
import TaskPool from './components/taskPool.vue';
|
||||
import Knowledge from './components/knowledge.vue';
|
||||
import FlowView from '@/components/common/flow/flowView.vue';
|
||||
import DeliverableFile from './components/deliverableFile.vue';
|
||||
|
||||
const w: any = window;
|
||||
const $wujie: any = w.$wujie;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="task-tree-content" @contextmenu.prevent="">
|
||||
<div class="filter-content">
|
||||
<filterProject @filter-param-change-fn="filterParamChangeFun" @expand-tree="changeExpendTypeFun"></filterProject>
|
||||
<filterProject @filter-param-change-fun="filterParamChangeFun" @expand-tree="changeExpendTypeFun"></filterProject>
|
||||
</div>
|
||||
<div class="tree-content">
|
||||
<el-tree
|
||||
@@ -229,9 +229,18 @@ const setExpandElementFun = (list:any, flag:any = 'all') => {
|
||||
// 过滤数内容
|
||||
const filterParamChangeFun = async (data: any) => {
|
||||
// currentNodeInfo.value = {};
|
||||
emits('nodeClickFn', { node: currentNodeInfo.value });
|
||||
|
||||
console.log(data, 'data');
|
||||
|
||||
await getTaskRunTreeDataFun(data);
|
||||
|
||||
if (dataSource.value.length) {
|
||||
emits('nodeClickFn', { node: currentNodeInfo.value });
|
||||
} else {
|
||||
emits('nodeClickFn', { node: {} });
|
||||
|
||||
}
|
||||
|
||||
console.log(defaultExpandKeys.value, 'defaultExpandKeys.value');
|
||||
|
||||
};
|
||||
@@ -568,7 +577,7 @@ const deleteTaskRunFun = async () => {
|
||||
|
||||
if (rightClickNode.value.id === currentNodeInfo.value.id ) {
|
||||
currentNodeInfo.value = {};
|
||||
emits('nodeClickFn', { node: currentNodeInfo.value });
|
||||
emits('nodeClickFn', { node: {} });
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,22 +106,13 @@ const createSuccessFun = async () => {
|
||||
}
|
||||
delete taskInfo.children;
|
||||
const parentNodeInfoList = [taskInfo];
|
||||
|
||||
try {
|
||||
const res:any = await generateReportApi({
|
||||
performanceList,
|
||||
imageFileIdList,
|
||||
parentNodeInfoList,
|
||||
});
|
||||
|
||||
if (res) {
|
||||
const file = res;
|
||||
downloadFile(file, reportFormData.reportName + '.docx', '');
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
|
||||
}
|
||||
const fileName = reportFormData.reportName + '.docx';
|
||||
await generateReportApi({
|
||||
performanceList,
|
||||
imageFileIdList,
|
||||
parentNodeInfoList,
|
||||
fileName,
|
||||
} );
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
</div>
|
||||
<div class="tabs-component" v-if="activeName === 'deliverable'">
|
||||
<taskDeliverable :task-id="currentTaskInfo?.id"></taskDeliverable>
|
||||
<taskDeliverable :task-info="currentTaskInfo" :task-id="currentTaskInfo?.id"></taskDeliverable>
|
||||
|
||||
</div>
|
||||
<div class="tabs-component" v-if="activeName === 'model'">
|
||||
|
||||
Reference in New Issue
Block a user