fix : 修复项目归档五个附件上传功能、提示框、文件多选上传、详情驳回/同意路由跳转问题

This commit is contained in:
2024-06-01 18:30:11 +08:00
parent 04a7ba8802
commit dd046f645f
19 changed files with 659 additions and 88 deletions

View File

@@ -10,7 +10,7 @@
<el-button type="danger" link @click="deleteOtherFile(singleFile,1)">删除</el-button>
</template>
<template v-else-if="!preview||JSON.stringify(singleFile) === '{}'||singleFile==null">
<file-upload @getFile="getAttachment" :showFileList="showFileList" :maxSize="0" @delete="deleteAttachment"/>
<file-upload @getFile="getAttachment" :showFileList="showFileList" :multiple="false" :maxSize="1" :disabled="isSingleFile" @delete="deleteAttachment"/>
</template>
</el-form-item>
</el-col>
@@ -63,20 +63,21 @@ const tableConfig = reactive({
align: 'center',
currentRender: ({row, index}) => (parseInt(row.size / 1024) + 'KB')
},
// {
// prop: 'oper',
// label: '操作',
// align: 'center',
// showOverflowTooltip: false,
// currentRender: ({row, index}) => {
// return (
// <div>
// <el-button type="primary" link onClick={() => handleDownload(row)}>下载</el-button>
// <el-button type="primary" size="large" link onClick={() => deleteOtherFile(row)}>删除</el-button>
// </div>
// )
// }
// }
{
prop: 'oper',
label: '操作',
align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => {
return (
<div>
<el-button type="primary" link onClick={() => handleDownload(row)}>下载</el-button>
</div>
)
}
}
// <el-button type="primary" size="large" link onClick={() => deleteOtherFile(row)}>删除</el-button>
]
})
const rules = reactive({
@@ -84,6 +85,7 @@ const rules = reactive({
})
const applyForm = ref()
const singleFile = ref()
const isSingleFile = ref(false)
const allFileList = ref([])
const props = defineProps({
showFileList: {
@@ -110,12 +112,17 @@ watch(() => props.showTable, (newVal) => {
props.showTable = newVal
}, {deep: true})
watch(() => props.otherFileList, (newVal) => {
console.log('new',newVal)
// newVal?.forEach(item => {
console.log('newotherFileList',newVal)
if (props.preview) {
newVal?.forEach(item => {
allFileList.value.push(item)
})
}else {
allFileList.value=newVal
// })
}
}, {deep: true})
watch(() => props.formData.fileList, (newVal) => {
console.log('newVal-fileList',newVal)
if (props.preview) {
newVal?.forEach(item => {
allFileList.value.push(item)
@@ -127,6 +134,7 @@ watch(() => props.formData.singleFile, (newVal) => {
singleFile.value = newVal
}, {deep: true})
const getAttachment = (val) => {
isSingleFile.value=true
emit('getAttachment', val)
}
const getOtherFile = (val) => {
@@ -135,7 +143,12 @@ const getOtherFile = (val) => {
const deleteAttachment = (val) => {
deleteFile(val).then(res => {
if (res.code === 1000) {
ElMessage.success("删除成功");
ElNotification({
title: '提示',
message:"删除成功",
type:'success'
})
isSingleFile.value=false
}
});
}