接口错误信息提示文案调整,下载预览接口错误消息文案调整
This commit is contained in:
parent
c985ffa6f3
commit
b841f8cf6a
|
@ -14,7 +14,7 @@
|
|||
</span>
|
||||
<!-- </a> -->
|
||||
</div>
|
||||
<div class="right-btn" @click="downloadFile(fileSrc)">
|
||||
<div class="right-btn" @click="downloadFile">
|
||||
<!-- <a :href="fileSrc" :download="type"> -->
|
||||
<img class="icon-download" src="../../assets/images/web-statistics/download.png" alt="">
|
||||
<span style="margin-left: 10px;">
|
||||
|
@ -584,7 +584,6 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
getFildBlob() {
|
||||
console.log("afsdfasdfasdfasdfasdf");
|
||||
let _this = this
|
||||
let params = {
|
||||
sampleId: this.sampleId,
|
||||
|
@ -592,39 +591,45 @@ export default {
|
|||
}
|
||||
let url = "/webStatistics/radionuclideFile"
|
||||
getAction(url, params).then((res) => {
|
||||
const blob = new Blob([res], { type: 'text/plain' })
|
||||
const blobZip = new Blob([res], { type: 'application/zip' })
|
||||
_this.fileSrc = window.URL.createObjectURL(blob)
|
||||
_this.zipSrc = window.URL.createObjectURL(blobZip)
|
||||
if (res.code&&res.code==500) {
|
||||
_this.fileSrc = ""
|
||||
} else {
|
||||
const blob = new Blob([res], { type: 'text/plain' })
|
||||
_this.fileSrc = window.URL.createObjectURL(blob)
|
||||
}
|
||||
})
|
||||
},
|
||||
downloadFile(src) {
|
||||
if (src) {
|
||||
downloadFile() {
|
||||
if (this.fileSrc) {
|
||||
let link = document.createElement('a')
|
||||
link.href = src
|
||||
link.href = this.fileSrc
|
||||
link.target = '_blank'
|
||||
link.download = this.type
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
} else {
|
||||
this.$message.info("File download failed")
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
},
|
||||
downloadZip() {
|
||||
getAction('/webStatistics/radionuclideFile',{
|
||||
sampleId: this.sampleId,
|
||||
}).then(async res =>{
|
||||
const arrayBufferView = new Uint8Array(res)
|
||||
const zip = new JSZip()
|
||||
const blob = new Blob([res], { type: 'text/plain' })
|
||||
// saveAs(blob, 'files.txt');
|
||||
// 将文件添加到ZIP中
|
||||
zip.file(`${this.type}.txt`, blob, { binary: true });
|
||||
// 生成ZIP文件
|
||||
const zipContent = await zip.generateAsync({ type: 'blob' });
|
||||
// 保存ZIP文件
|
||||
saveAs(zipContent, this.type);
|
||||
}).then(async res => {
|
||||
if (res.code&&res.code==500) {
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
} else {
|
||||
const arrayBufferView = new Uint8Array(res)
|
||||
const zip = new JSZip()
|
||||
const blob = new Blob([res], { type: 'text/plain' })
|
||||
// saveAs(blob, 'files.txt');
|
||||
// 将文件添加到ZIP中
|
||||
zip.file(`${this.type}.txt`, blob, { binary: true });
|
||||
// 生成ZIP文件
|
||||
const zipContent = await zip.generateAsync({ type: 'blob' });
|
||||
// 保存ZIP文件
|
||||
saveAs(zipContent, this.type);
|
||||
}
|
||||
})
|
||||
},
|
||||
viewFile() {
|
||||
|
|
|
@ -71,13 +71,17 @@ export default {
|
|||
let url = this.type === "soh" ? "/webStatistics/sohFile" : "/webStatistics/arFile"
|
||||
let params = this.type === "soh" ? paramsSoh : paramsRr
|
||||
getAction(url, params).then((res) => {
|
||||
const blob = new Blob([res], { type: 'text/plain' })
|
||||
_this.fileSrc = window.URL.createObjectURL(blob)
|
||||
var reader = new FileReader();
|
||||
reader.readAsText(blob);
|
||||
reader.onload = function(){
|
||||
//读取完毕后输出结果
|
||||
_this.fileText = reader.result
|
||||
if (res.code && res.code==500) {
|
||||
_this.fileSrc = ""
|
||||
} else {
|
||||
const blob = new Blob([res], { type: 'text/plain' })
|
||||
_this.fileSrc = window.URL.createObjectURL(blob)
|
||||
var reader = new FileReader();
|
||||
reader.readAsText(blob);
|
||||
reader.onload = function(){
|
||||
//读取完毕后输出结果
|
||||
_this.fileText = reader.result
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -91,7 +95,7 @@ export default {
|
|||
link.click()
|
||||
document.body.removeChild(link)
|
||||
} else {
|
||||
this.$message.info("File download failed")
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
},
|
||||
viewFile() {
|
||||
|
|
|
@ -138,7 +138,7 @@ export default {
|
|||
this.ipagination.total = res.result.total
|
||||
this.dataSource = res.result.records
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
|
|
@ -89,7 +89,7 @@ export default {
|
|||
this.stationList=[]
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
|
||||
})
|
||||
|
|
|
@ -84,7 +84,7 @@ export default {
|
|||
this.stationList=[]
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -84,7 +84,7 @@ export default {
|
|||
this.stationList=[]
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -85,7 +85,7 @@ export default {
|
|||
this.stationList=[]
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -85,7 +85,7 @@ export default {
|
|||
this.stationList=[]
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -89,7 +89,7 @@ export default {
|
|||
this.stationList=[]
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -84,7 +84,7 @@ export default {
|
|||
this.stationList=[]
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -84,7 +84,7 @@ export default {
|
|||
this.stationList=[]
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -85,7 +85,7 @@ export default {
|
|||
this.stationList=[]
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -85,7 +85,7 @@ export default {
|
|||
this.stationList=[]
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -152,7 +152,7 @@ export default {
|
|||
this.ipagination.total = res.result.total
|
||||
this.dataSource = res.result.records
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -164,7 +164,7 @@ export default {
|
|||
this.detailJson = JSON.parse(JSON.stringify(this.detailJson))
|
||||
this.isDetail = true
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -180,7 +180,7 @@ export default {
|
|||
this.stationList=[]
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -89,7 +89,7 @@ export default {
|
|||
this.stationList=[]
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -84,7 +84,7 @@ export default {
|
|||
this.stationList=[]
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -84,7 +84,7 @@ export default {
|
|||
this.stationList=[]
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -85,7 +85,7 @@ export default {
|
|||
this.stationList=[]
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -85,7 +85,7 @@ export default {
|
|||
this.stationList=[]
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -127,7 +127,7 @@ export default {
|
|||
this.ipagination.total = res.result.total
|
||||
this.dataSource = res.result.records
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
@ -143,7 +143,7 @@ export default {
|
|||
this.stationList=[]
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -138,7 +138,7 @@ export default {
|
|||
this.ipagination.total = res.result.total
|
||||
this.dataSource = res.result.records
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
@ -154,7 +154,7 @@ export default {
|
|||
this.stationList=[]
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -138,7 +138,7 @@ export default {
|
|||
this.ipagination.total = res.result.total
|
||||
this.dataSource = res.result.records
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
@ -158,7 +158,7 @@ export default {
|
|||
this.stationList=[]
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -138,7 +138,7 @@ export default {
|
|||
this.ipagination.total = res.result.total
|
||||
this.dataSource = res.result.records
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
@ -158,7 +158,7 @@ export default {
|
|||
this.stationList=[]
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user