文件上传

This commit is contained in:
zhujiyan
2024-09-02 18:19:47 +08:00
parent 5183bacc19
commit 40c909ea61
2 changed files with 122 additions and 33 deletions

View File

@@ -39,15 +39,15 @@ const handleClose = () => {
}
//文件信息
const fileData: any = ref({})
const open = (row: any, id: any) => {
const open = async (row: any, id: any) => {
dialogVisible.value = true
loading.value = true
const obj = {
nDid: id,
name: row.prjDataPath,
type: row.type
}
loading.value = true
getFileServiceFileOrDir(obj).then(res => {
await getFileServiceFileOrDir(obj).then(res => {
if (res.code == 'A0000') {
fileData.value = res.data[0]
fileData.value.nDid = id
@@ -63,16 +63,18 @@ const handleDownLoad = () => {
fileCheck: fileData.value.fileCheck
}
downLoading.value = true
downLoadDeviceFile(obj).then(res => {
if (res.code == 'A0000') {
window.open(res.data, '_blank')
downLoading.value = false
}
}).catch((e)=>{
if(e){
downLoading.value=false;
}
})
downLoadDeviceFile(obj)
.then(res => {
if (res.code == 'A0000') {
window.open(res.data, '_blank')
downLoading.value = false
}
})
.catch(e => {
if (e) {
downLoading.value = false
}
})
}
onMounted(() => {})
onUnmounted(() => {})