feat : 新增需求征集删除功能和文件下载功能

This commit is contained in:
2024-05-17 20:53:49 +08:00
parent 573fff84e4
commit 9754b62038
4 changed files with 52 additions and 4 deletions

View File

@@ -77,7 +77,7 @@
import OperationRender from '@/views/workflow/common/OperationRender.vue'
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue'
import {useProcessStore} from '@/stores/processStore.js';
import {getInfo, agreeTask, rejectTask} from "@/api/project-demand/index.js";
import {getInfo, agreeTask, rejectTask,downloadFile} from "@/api/project-demand/index.js";
import {getSubCompOpt} from '@/api/user/user.js'
import {ElMessage} from "element-plus";
import {useRouter} from "vue-router";
@@ -129,7 +129,9 @@ const tableConfig = reactive({
label: '操作',
align: 'center',
currentRender: ({row, index}) => {
return (<a style="cursor: pointer;font-size: 14px;color: #2a99ff;" href={row.url}>下载</a>)
return (
<el-button type="primary" link onClick={() => handleDownload(row)}>下载</el-button>
)
}
}
]
@@ -200,6 +202,16 @@ const getDataSourceOptionItem = (val) => {
}
return companyNameArray.value.join('');
}
const handleDownload = (row) => {
downloadFile(row.fileId).then(res => {
const blob = new Blob([res])
let a = document.createElement('a')
a.href=URL.createObjectURL(blob)
a.download = row.originalFileName
a.click()
})
}
const init = async () => {
if (!route.query.id) return;
await getCompanyOption()