2023-07-13 11:15:02 +08:00
|
|
|
<template>
|
|
|
|
<a-card :bordered="false" style="margin-left: 20px;height: 100%;">
|
|
|
|
<div class="detail-top">
|
|
|
|
<div class="top-back" @click="handleback">
|
2023-07-13 16:54:44 +08:00
|
|
|
<img class="icon-back" src="../../assets/images/web-statistics/return.png" alt="">
|
2023-07-13 11:15:02 +08:00
|
|
|
<span style="margin-left: 10px;">return</span>
|
|
|
|
</div>
|
|
|
|
<div class="top-actions">
|
|
|
|
<div class="right-btn">
|
2023-07-13 16:54:44 +08:00
|
|
|
<a :href="fileSrc" :download="type" target="_blank" rel="noopener noreferrer">
|
|
|
|
<img class="icon-download" src="../../assets/images/web-statistics/download.png" alt="">
|
|
|
|
<span style="margin-left: 10px;">
|
2023-07-13 11:15:02 +08:00
|
|
|
TXT
|
2023-07-13 16:54:44 +08:00
|
|
|
</span>
|
|
|
|
</a>
|
2023-07-13 11:15:02 +08:00
|
|
|
</div>
|
|
|
|
<div class="right-btn">
|
2023-07-13 16:54:44 +08:00
|
|
|
<a :href="fileSrc" target="_blank" rel="noopener noreferrer">
|
|
|
|
<img class="icon-view" src="../../assets/images/web-statistics/view.png" alt="">
|
|
|
|
<span style="margin-left: 10px;">
|
2023-07-13 11:15:02 +08:00
|
|
|
View Report
|
2023-07-13 16:54:44 +08:00
|
|
|
</span>
|
|
|
|
</a>
|
2023-07-13 11:15:02 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="file-content">
|
|
|
|
<pre>{{ fileText }}</pre>
|
|
|
|
</div>
|
|
|
|
</a-card>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2023-07-13 16:54:44 +08:00
|
|
|
import { getAction } from '../../api/manage'
|
2023-07-13 11:15:02 +08:00
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
type: {
|
|
|
|
type: String,
|
|
|
|
default:""
|
|
|
|
},
|
|
|
|
sampleId: {
|
|
|
|
type: String,
|
|
|
|
default:""
|
|
|
|
}
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
fileText: "",
|
|
|
|
fileSrc:""
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted () {
|
|
|
|
this.getFildBlob();
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
handleback() {
|
|
|
|
this.$emit("back",false)
|
|
|
|
},
|
|
|
|
getFildBlob() {
|
|
|
|
let _this = this
|
2023-07-13 16:54:44 +08:00
|
|
|
let paramsRr = {
|
2023-07-13 11:15:02 +08:00
|
|
|
type: this.type,
|
|
|
|
sampleId: this.sampleId,
|
|
|
|
// type: "rrr",
|
|
|
|
// sampleId:"1523651"
|
|
|
|
}
|
2023-07-13 16:54:44 +08:00
|
|
|
let paramsSoh = {
|
|
|
|
// sohId:"11"
|
|
|
|
sohId:this.sampleId
|
|
|
|
}
|
|
|
|
let url = this.type === "soh" ? "/webStatistics/sohFile" : "/webStatistics/arFile"
|
|
|
|
let params = this.type === "soh" ? paramsSoh : paramsRr
|
|
|
|
getAction(url, params).then((res) => {
|
2023-07-13 11:15:02 +08:00
|
|
|
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
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
.detail-top{
|
|
|
|
width: 100%;
|
|
|
|
height: 50px;
|
|
|
|
padding: 0 10px;
|
|
|
|
background-color: rgba(12, 235, 201, 0.05);
|
|
|
|
border-top: 1px solid rgba(12, 235, 201, 0.3);
|
|
|
|
border-bottom: 1px solid rgba(12, 235, 201, 0.3);
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
margin-bottom: 16px;
|
|
|
|
.top-back{
|
|
|
|
font-family: MicrosoftYaHei;
|
|
|
|
font-size: 16px;
|
|
|
|
font-weight: normal;
|
|
|
|
font-stretch: normal;
|
|
|
|
letter-spacing: 0px;
|
|
|
|
color: #69a19f;
|
|
|
|
cursor: pointer;
|
|
|
|
.icon-back{
|
|
|
|
width: 28px;
|
|
|
|
height: 24px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.top-actions{
|
|
|
|
.right-btn{
|
|
|
|
display: inline-block;
|
|
|
|
height: 32px;
|
|
|
|
line-height: 32px;
|
|
|
|
padding: 0 12px;
|
|
|
|
margin-left: 20px;
|
|
|
|
background-color: #1397a3;
|
|
|
|
.icon-download{
|
|
|
|
width: 16px;
|
|
|
|
height: 19px;
|
|
|
|
}
|
|
|
|
.icon-view{
|
|
|
|
width: 15px;
|
|
|
|
height: 16px;
|
|
|
|
}
|
|
|
|
a{
|
|
|
|
color: white;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.file-content{
|
|
|
|
height: calc(100% - 66px);
|
|
|
|
border: 1px solid #1397a3;
|
|
|
|
overflow: auto;
|
|
|
|
padding: 15px;
|
|
|
|
}
|
|
|
|
</style>
|