feat : 项目实施-上传附件加上缓存
This commit is contained in:
@@ -41,7 +41,7 @@ import {useTagsView} from '@/stores/tagsview.js'
|
|||||||
import {uploadFileList} from "@/api/project-manage/attachment";
|
import {uploadFileList} from "@/api/project-manage/attachment";
|
||||||
import {computed, ref} from "vue";
|
import {computed, ref} from "vue";
|
||||||
import {getBaseInfoApi} from "@/components/steps/api";
|
import {getBaseInfoApi} from "@/components/steps/api";
|
||||||
import {downloadFile, deleteFile} from "@/api/project-demand";
|
import {deleteFile, downloadFile} from "@/api/project-demand";
|
||||||
|
|
||||||
import {useCacheStore} from '@/stores/cache.js'
|
import {useCacheStore} from '@/stores/cache.js'
|
||||||
|
|
||||||
@@ -338,6 +338,13 @@ const filePreviewParam = ref({
|
|||||||
fileType: 'pdf'
|
fileType: 'pdf'
|
||||||
})
|
})
|
||||||
const filePreviewShow = ref(false)
|
const filePreviewShow = ref(false)
|
||||||
|
if(localStorage.getItem('implementFile')){
|
||||||
|
fileList.value=JSON.parse(localStorage.getItem('implementFile'))
|
||||||
|
}
|
||||||
|
const changeImplementFile=()=>{
|
||||||
|
localStorage.setItem('implementFile', JSON.stringify(fileList.value))
|
||||||
|
}
|
||||||
|
|
||||||
const clickToPreview=(row)=>{
|
const clickToPreview=(row)=>{
|
||||||
filePreviewShow.value = false
|
filePreviewShow.value = false
|
||||||
filePreviewParam.value = {
|
filePreviewParam.value = {
|
||||||
@@ -392,6 +399,7 @@ const handleDelete = (row) => {
|
|||||||
})
|
})
|
||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
fileList.value.splice(fileList.value.findIndex((item) => item.fileId === row.fileId), 1);
|
fileList.value.splice(fileList.value.findIndex((item) => item.fileId === row.fileId), 1);
|
||||||
|
changeImplementFile()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -459,6 +467,7 @@ const getFile = (val) => {
|
|||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
showTable.value = true
|
showTable.value = true
|
||||||
})
|
})
|
||||||
|
changeImplementFile()
|
||||||
}
|
}
|
||||||
const handleSubmit = async (instance) => {
|
const handleSubmit = async (instance) => {
|
||||||
if (!instance) return
|
if (!instance) return
|
||||||
@@ -514,6 +523,7 @@ const handleSubmit = async (instance) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
localStorage.removeItem('implementFile')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user