接口错误信息提示文案调整,下载预览接口错误消息文案调整

This commit is contained in:
renpy 2023-07-14 16:52:18 +08:00 committed by orgin
parent 98179100dd
commit c9676af104
23 changed files with 65 additions and 56 deletions

View File

@ -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() {

View File

@ -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() {

View File

@ -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 {

View File

@ -89,7 +89,7 @@ export default {
this.stationList=[]
}
} else {
this.$message.warning(res.message)
this.$message.warning("This operation fails. Contact your system administrator")
}
})

View File

@ -84,7 +84,7 @@ export default {
this.stationList=[]
}
} else {
this.$message.warning(res.message)
this.$message.warning("This operation fails. Contact your system administrator")
}
})
},

View File

@ -84,7 +84,7 @@ export default {
this.stationList=[]
}
} else {
this.$message.warning(res.message)
this.$message.warning("This operation fails. Contact your system administrator")
}
})
},

View File

@ -85,7 +85,7 @@ export default {
this.stationList=[]
}
} else {
this.$message.warning(res.message)
this.$message.warning("This operation fails. Contact your system administrator")
}
})
},

View File

@ -85,7 +85,7 @@ export default {
this.stationList=[]
}
} else {
this.$message.warning(res.message)
this.$message.warning("This operation fails. Contact your system administrator")
}
})
},

View File

@ -89,7 +89,7 @@ export default {
this.stationList=[]
}
} else {
this.$message.warning(res.message)
this.$message.warning("This operation fails. Contact your system administrator")
}
})
},

View File

@ -84,7 +84,7 @@ export default {
this.stationList=[]
}
} else {
this.$message.warning(res.message)
this.$message.warning("This operation fails. Contact your system administrator")
}
})
},

View File

@ -84,7 +84,7 @@ export default {
this.stationList=[]
}
} else {
this.$message.warning(res.message)
this.$message.warning("This operation fails. Contact your system administrator")
}
})
},

View File

@ -85,7 +85,7 @@ export default {
this.stationList=[]
}
} else {
this.$message.warning(res.message)
this.$message.warning("This operation fails. Contact your system administrator")
}
})
},

View File

@ -85,7 +85,7 @@ export default {
this.stationList=[]
}
} else {
this.$message.warning(res.message)
this.$message.warning("This operation fails. Contact your system administrator")
}
})
},

View File

@ -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")
}
})
},

View File

@ -89,7 +89,7 @@ export default {
this.stationList=[]
}
} else {
this.$message.warning(res.message)
this.$message.warning("This operation fails. Contact your system administrator")
}
})
},

View File

@ -84,7 +84,7 @@ export default {
this.stationList=[]
}
} else {
this.$message.warning(res.message)
this.$message.warning("This operation fails. Contact your system administrator")
}
})
},

View File

@ -84,7 +84,7 @@ export default {
this.stationList=[]
}
} else {
this.$message.warning(res.message)
this.$message.warning("This operation fails. Contact your system administrator")
}
})
},

View File

@ -85,7 +85,7 @@ export default {
this.stationList=[]
}
} else {
this.$message.warning(res.message)
this.$message.warning("This operation fails. Contact your system administrator")
}
})
},

View File

@ -85,7 +85,7 @@ export default {
this.stationList=[]
}
} else {
this.$message.warning(res.message)
this.$message.warning("This operation fails. Contact your system administrator")
}
})
},

View File

@ -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")
}
})
},

View File

@ -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")
}
})
},

View File

@ -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")
}
})
},

View File

@ -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")
}
})
},