|
|
@ -555,9 +555,35 @@ function exportProject(id, url) { |
|
|
|
showCancel: true, |
|
|
|
success: async ({ confirm }) => { |
|
|
|
if (confirm) { |
|
|
|
const data = await uni.$u.post(`${url}/tall/project/exportWbs`, { projectId: id }); |
|
|
|
// console.log('data', data); |
|
|
|
window.location.href = data.url; |
|
|
|
const data = await uni.$u.post(`${url}/tall/project/exportWbs`, { projectId: id }); |
|
|
|
// #ifdef H5 |
|
|
|
window.location.href = data.url; |
|
|
|
// #endif |
|
|
|
|
|
|
|
// #ifdef APP-PLUS |
|
|
|
uni.downloadFile({ |
|
|
|
url: data.url, //仅为示例,并非真实的资源 |
|
|
|
success: ({statusCode, tempFilePath}) => { |
|
|
|
if (statusCode === 200) { |
|
|
|
console.log('下载成功', tempFilePath); |
|
|
|
|
|
|
|
uni.saveFile({ |
|
|
|
tempFilePath, |
|
|
|
success:(res)=>{ |
|
|
|
uni.$ui.showToast('文件保存路径:' + res.savedFilePath); |
|
|
|
//res.savedFilePath文件的保存路径 |
|
|
|
//保存成功并打开文件 |
|
|
|
// uni.openDocument({ |
|
|
|
// filePath: res.savedFilePath, |
|
|
|
// success:(res)=>console.log('成功打开文档') |
|
|
|
// }) |
|
|
|
}, |
|
|
|
fail:()=>console.log('下载失败') |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
// #endif |
|
|
|
} |
|
|
|
}, |
|
|
|
}); |
|
|
|