Commit f1d7fed2 authored by shuaiqiang's avatar shuaiqiang 🇨🇳

fix:去除空格

parent 62b7f597
...@@ -74,26 +74,26 @@ export default { ...@@ -74,26 +74,26 @@ export default {
formData.append('file', e.raw) formData.append('file', e.raw)
}) })
const res = await fetchCnToCpc(this.baseUrl, formData) const res = await fetchCnToCpc(this.baseUrl, formData)
if (res.status === 200) { if (res.status === 200) {
this.fileList = [] this.fileList = []
this.$refs.upload.clearFiles() this.$refs.upload.clearFiles()
const excelFileName = res.data const excelFileName = res.data
const response = await fetchDownloadFile(this.baseUrl,{fileName: excelFileName}) const response = await fetchDownloadFile(this.baseUrl,{fileName: excelFileName})
const blob = new Blob([response]) const blob = new Blob([response])
const downloadElement = document.createElement('a') const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob) const href = window.URL.createObjectURL(blob)
downloadElement.href = href downloadElement.href = href
downloadElement.download = excelFileName.split('/')[1] downloadElement.download = excelFileName.split('/')[1]
document.body.appendChild(downloadElement) document.body.appendChild(downloadElement)
downloadElement.click() downloadElement.click()
document.body.removeChild(downloadElement) document.body.removeChild(downloadElement)
window.URL.revokeObjectURL(href) window.URL.revokeObjectURL(href)
// }) // })
} else { } else {
this.$refs.upload.abort() this.$refs.upload.abort()
this.$message.error('下载档案失败!') this.$message.error('下载档案失败!')
} }
console.log(res.data) console.log(res.data)
}, },
// 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用 // 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用
handelFileChange(file, fileList) { handelFileChange(file, fileList) {
......
...@@ -78,25 +78,25 @@ export default { ...@@ -78,25 +78,25 @@ export default {
formData.append('file', e.raw) formData.append('file', e.raw)
}) })
const res = await fetchCntToPct(this.baseUrl,formData) const res = await fetchCntToPct(this.baseUrl,formData)
if (res.status === 200) { if (res.status === 200) {
this.fileList = [] this.fileList = []
this.$refs.upload.clearFiles() this.$refs.upload.clearFiles()
const excelFileName = res.data const excelFileName = res.data
const response = await fetchDownloadFile(this.baseUrl,{fileName: excelFileName}) const response = await fetchDownloadFile(this.baseUrl,{fileName: excelFileName})
const blob = new Blob([response]) const blob = new Blob([response])
const downloadElement = document.createElement('a') const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob) const href = window.URL.createObjectURL(blob)
downloadElement.href = href downloadElement.href = href
downloadElement.download = excelFileName.split('/')[1] downloadElement.download = excelFileName.split('/')[1]
document.body.appendChild(downloadElement) document.body.appendChild(downloadElement)
downloadElement.click() downloadElement.click()
document.body.removeChild(downloadElement) document.body.removeChild(downloadElement)
window.URL.revokeObjectURL(href) window.URL.revokeObjectURL(href)
} else { } else {
this.$refs.upload.abort() this.$refs.upload.abort()
this.$message.error('下载档案失败!') this.$message.error('下载档案失败!')
} }
console.log(res.data) console.log(res.data)
}, },
// 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用 // 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用
handelFileChange(file, fileList) { handelFileChange(file, fileList) {
......
...@@ -74,25 +74,25 @@ export default { ...@@ -74,25 +74,25 @@ export default {
formData.append('file', e.raw) formData.append('file', e.raw)
}) })
const res = await fetchPctToCn(this.baseUrl,formData) const res = await fetchPctToCn(this.baseUrl,formData)
if (res.status === 200) { if (res.status === 200) {
this.fileList = [] this.fileList = []
this.$refs.upload.clearFiles() this.$refs.upload.clearFiles()
const excelFileName = res.data const excelFileName = res.data
const response = await fetchDownloadFile(this.baseUrl,{fileName: excelFileName}) const response = await fetchDownloadFile(this.baseUrl,{fileName: excelFileName})
const blob = new Blob([response]) const blob = new Blob([response])
const downloadElement = document.createElement('a') const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob) const href = window.URL.createObjectURL(blob)
downloadElement.href = href downloadElement.href = href
downloadElement.download = excelFileName.split('/')[1] downloadElement.download = excelFileName.split('/')[1]
document.body.appendChild(downloadElement) document.body.appendChild(downloadElement)
downloadElement.click() downloadElement.click()
document.body.removeChild(downloadElement) document.body.removeChild(downloadElement)
window.URL.revokeObjectURL(href) window.URL.revokeObjectURL(href)
} else { } else {
this.$refs.upload.abort() this.$refs.upload.abort()
this.$message.error('下载档案失败!') this.$message.error('下载档案失败!')
} }
console.log(res.data) console.log(res.data)
}, },
// 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用 // 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用
handelFileChange(file, fileList) { handelFileChange(file, fileList) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment