完成各个模块的下载,预览,zip下载功能
This commit is contained in:
parent
b6684d16e1
commit
464b5ff3af
|
@ -7,13 +7,28 @@
|
|||
</div>
|
||||
<div class="top-actions">
|
||||
<div class="right-btn">
|
||||
<img class="icon-download" src="../../assets/images/web-statistics/download.png" alt=""><span style="margin-left: 10px;">ZIP</span>
|
||||
<a :href="zipSrc" :download="type" target="_blank" rel="noopener noreferrer">
|
||||
<img class="icon-download" src="../../assets/images/web-statistics/download.png" alt="">
|
||||
<span style="margin-left: 10px;">
|
||||
ZIP
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="right-btn">
|
||||
<img class="icon-download" src="../../assets/images/web-statistics/download.png" alt=""><span style="margin-left: 10px;">TXT</span>
|
||||
<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;">
|
||||
TXT
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="right-btn">
|
||||
<img class="icon-view" src="../../assets/images/web-statistics/view.png" alt=""><span style="margin-left: 10px;">View Report</span>
|
||||
<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;">
|
||||
View Report
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -249,6 +264,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getAction } from '../../api/manage'
|
||||
const colorList=["#0D5fff","#287D3C","#DF1512","#F3BF24","#D3D4DE","#000000"]
|
||||
import * as echarts from 'echarts'
|
||||
export default {
|
||||
|
@ -257,6 +273,14 @@ export default {
|
|||
type: Object,
|
||||
default: ()=>{}
|
||||
},
|
||||
sampleId: {
|
||||
type: String,
|
||||
default:""
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default:""
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
allData: {
|
||||
|
@ -517,6 +541,8 @@ export default {
|
|||
level_5:[],
|
||||
level_6:[]
|
||||
},
|
||||
fileSrc: "",
|
||||
zipSrc:""
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
|
@ -552,9 +578,24 @@ export default {
|
|||
this.dataSourceHistogray.level_6.push(item)
|
||||
}
|
||||
});
|
||||
this.dataSourceCertificate = this.allData.certificateBlock?this.allData.certificateBlock.certificateSubBlock:[]
|
||||
this.dataSourceCertificate = this.allData.certificateBlock ? this.allData.certificateBlock.certificateSubBlock : []
|
||||
this.getFildBlob()
|
||||
},
|
||||
methods: {
|
||||
getFildBlob() {
|
||||
let _this = this
|
||||
let params = {
|
||||
// sampleId: this.sampleId,
|
||||
sampleId:"1523651"
|
||||
}
|
||||
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)
|
||||
})
|
||||
},
|
||||
getUid() {
|
||||
return (Math.random()+new Date().getTime()).toString(32).slice(0,8)
|
||||
},
|
||||
|
@ -791,6 +832,9 @@ export default {
|
|||
width: 15px;
|
||||
height: 16px;
|
||||
}
|
||||
a{
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,25 +2,25 @@
|
|||
<a-card :bordered="false" style="margin-left: 20px;height: 100%;">
|
||||
<div class="detail-top">
|
||||
<div class="top-back" @click="handleback">
|
||||
<img class="icon-back" src="../../../assets/images/web-statistics/return.png" alt="">
|
||||
<img class="icon-back" src="../../assets/images/web-statistics/return.png" alt="">
|
||||
<span style="margin-left: 10px;">return</span>
|
||||
</div>
|
||||
<div class="top-actions">
|
||||
<div class="right-btn">
|
||||
<img class="icon-download" src="../../../assets/images/web-statistics/download.png" alt="">
|
||||
<span style="margin-left: 10px;">
|
||||
<a :href="fileSrc" :download="type" target="_blank" rel="noopener noreferrer">
|
||||
<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;">
|
||||
TXT
|
||||
</a>
|
||||
</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="right-btn">
|
||||
<img class="icon-view" src="../../../assets/images/web-statistics/view.png" alt="">
|
||||
<span style="margin-left: 10px;">
|
||||
<a :href="fileSrc" target="_blank" rel="noopener noreferrer">
|
||||
<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;">
|
||||
View Report
|
||||
</a>
|
||||
</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -31,7 +31,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getAction } from '../../../api/manage'
|
||||
import { getAction } from '../../api/manage'
|
||||
export default {
|
||||
props: {
|
||||
type: {
|
||||
|
@ -58,13 +58,19 @@ export default {
|
|||
},
|
||||
getFildBlob() {
|
||||
let _this = this
|
||||
let params = {
|
||||
let paramsRr = {
|
||||
type: this.type,
|
||||
sampleId: this.sampleId,
|
||||
// type: "rrr",
|
||||
// sampleId:"1523651"
|
||||
}
|
||||
getAction("/radionuclide/reportContent", params).then((res) => {
|
||||
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) => {
|
||||
const blob = new Blob([res], { type: 'text/plain' })
|
||||
_this.fileSrc = window.URL.createObjectURL(blob)
|
||||
var reader = new FileReader();
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div style="height: 100%;">
|
||||
<List :stationList="stationList" :columns="columns" :dataType="dataType"></List>
|
||||
<List :stationList="stationList" :columns="columns" :dataType="dataType" fileName="CALIBPHD"></List>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div style="height: 100%;">
|
||||
<List :stationList="stationList" :columns="columns" :dataType="dataType"></List>
|
||||
<List :stationList="stationList" :columns="columns" :dataType="dataType" fileName="DETBKPHD"></List>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div style="height: 100%;">
|
||||
<List :stationList="stationList" :columns="columns" :dataType="dataType"></List>
|
||||
<List :stationList="stationList" :columns="columns" :dataType="dataType" fileName="QCPHD"></List>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div style="height: 100%;">
|
||||
<List :stationList="stationList" :spectralQualifie="spectralQualifie" :columns="columns" :dataType="dataType"></List>
|
||||
<List :stationList="stationList" :spectralQualifie="spectralQualifie" :columns="columns" :dataType="dataType" fileName="SPHDF"></List>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div style="height: 100%;">
|
||||
<List :stationList="stationList" :spectralQualifie="spectralQualifie" :columns="columns" :dataType="dataType"></List>
|
||||
<List :stationList="stationList" :spectralQualifie="spectralQualifie" :columns="columns" :dataType="dataType" fileName="SPHDP"></List>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div style="height: 100%;">
|
||||
<List :stationList="stationList" :columns="columns" :dataType="dataType"></List>
|
||||
<List :stationList="stationList" :columns="columns" :dataType="dataType" fileName="CALIBPHD"></List>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div style="height: 100%;">
|
||||
<List :stationList="stationList" :columns="columns" :dataType="dataType"></List>
|
||||
<List :stationList="stationList" :columns="columns" :dataType="dataType" fileName="DETBKPHD"></List>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div style="height: 100%;">
|
||||
<List :stationList="stationList" :columns="columns" :dataType="dataType"></List>
|
||||
<List :stationList="stationList" :columns="columns" :dataType="dataType" fileName="QCPHD"></List>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div style="height: 100%;">
|
||||
<List :stationList="stationList" :spectralQualifie="spectralQualifie" :columns="columns" :dataType="dataType"></List>
|
||||
<List :stationList="stationList" :spectralQualifie="spectralQualifie" :columns="columns" :dataType="dataType" fileName="SPHDF"></List>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div style="height: 100%;">
|
||||
<List :stationList="stationList" :spectralQualifie="spectralQualifie" :columns="columns" :dataType="dataType"></List>
|
||||
<List :stationList="stationList" :spectralQualifie="spectralQualifie" :columns="columns" :dataType="dataType" fileName="SPHDP"></List>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
</template>
|
||||
</custom-table>
|
||||
</a-card>
|
||||
<Detail v-if="isDetail" :allData="detailJson" @back="handleBack"></Detail>
|
||||
<Detail v-if="isDetail" type="BLANKPHD" :sampleId="currSampleId" :allData="detailJson" @back="handleBack"></Detail>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -110,7 +110,8 @@ export default {
|
|||
dataSource: [],
|
||||
detailJson: {},
|
||||
strIds: "",
|
||||
allChecked:false
|
||||
allChecked: false,
|
||||
currSampleId:""
|
||||
}
|
||||
},
|
||||
// mounted() {
|
||||
|
@ -156,6 +157,7 @@ export default {
|
|||
})
|
||||
},
|
||||
handleDetail(record) {
|
||||
this.currSampleId = record.sampleId
|
||||
getAction("webStatistics/findGeneratedReport", { sampleId: record.sampleId }).then(res => {
|
||||
if (res.success) {
|
||||
this.detailJson = res.result
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div style="height: 100%;">
|
||||
<List :stationList="stationList" :columns="columns" :dataType="dataType"></List>
|
||||
<List :stationList="stationList" :columns="columns" :dataType="dataType" fileName="CALIBPHD"></List>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div style="height: 100%;">
|
||||
<List :stationList="stationList" :columns="columns" :dataType="dataType"></List>
|
||||
<List :stationList="stationList" :columns="columns" :dataType="dataType" fileName="DETBKPHD"></List>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div style="height: 100%;">
|
||||
<List :stationList="stationList" :columns="columns" :dataType="dataType"></List>
|
||||
<List :stationList="stationList" :columns="columns" :dataType="dataType" fileName="QCPHD"></List>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div style="height: 100%;">
|
||||
<List :stationList="stationList" :spectralQualifie="spectralQualifie" :columns="columns" :dataType="dataType"></List>
|
||||
<List :stationList="stationList" :spectralQualifie="spectralQualifie" :columns="columns" :dataType="dataType" fileName="SPHDF"></List>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div style="height: 100%;">
|
||||
<List :stationList="stationList" :spectralQualifie="spectralQualifie" :columns="columns" :dataType="dataType"></List>
|
||||
<List :stationList="stationList" :spectralQualifie="spectralQualifie" :columns="columns" :dataType="dataType" fileName="SPHDP"></List>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div style="height: 100%;">
|
||||
<a-card :bordered="false" style="margin-left: 20px">
|
||||
<a-card v-if="!isFileDetail" :bordered="false" style="margin-left: 20px">
|
||||
<search-form :items="formItems" v-model="queryParam" @search="searchQueryData">
|
||||
<a-space style="float: right" class="btn-group" slot="additional">
|
||||
<a-button @click="handleEdit" type="primary">
|
||||
|
@ -18,12 +18,14 @@
|
|||
:loading="loading"
|
||||
:canSelect="false"
|
||||
@change="handleTableChange"
|
||||
@detail="handleDetail"
|
||||
>
|
||||
<template slot="index" slot-scope="{ index }">
|
||||
{{ index + 1 }}
|
||||
</template>
|
||||
</custom-table>
|
||||
</a-card>
|
||||
<FileDetail v-if="isFileDetail" type="soh" :sampleId="currSampleId" @back="handleBack"></FileDetail>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -74,9 +76,13 @@ import { compareDate } from "../../commom"
|
|||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import { getAction } from '../../../../api/manage'
|
||||
import dateFormat from '../../../../components/jeecg/JEasyCron/format-date'
|
||||
import FileDetail from "../../fileDetail.vue"
|
||||
export default {
|
||||
name: 'menuTree',
|
||||
mixins: [JeecgListMixin],
|
||||
components: {
|
||||
FileDetail,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isImmediate:true,
|
||||
|
@ -95,13 +101,22 @@ export default {
|
|||
stationList: [],
|
||||
dataSource: [],
|
||||
strIds: "",
|
||||
allChecked:false
|
||||
allChecked: false,
|
||||
isFileDetail: false,
|
||||
currSampleId:""
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.findStationList()
|
||||
},
|
||||
methods: {
|
||||
handleBack(flag) {
|
||||
this.isFileDetail = flag
|
||||
},
|
||||
handleDetail(record) {
|
||||
this.currSampleId = record.sohId
|
||||
this.isFileDetail = true
|
||||
},
|
||||
searchQueryData() {
|
||||
let days = compareDate(this.queryParam.startTime, this.queryParam.endTime)
|
||||
if (days <= 10) {
|
||||
|
|
|
@ -75,7 +75,7 @@ import { compareDate } from "../../commom"
|
|||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import { getAction } from '../../../../api/manage'
|
||||
import dateFormat from '../../../../components/jeecg/JEasyCron/format-date'
|
||||
import FileDetail from "../fileDetail.vue"
|
||||
import FileDetail from "../../fileDetail.vue"
|
||||
export default {
|
||||
name: 'menuTree',
|
||||
mixins: [JeecgListMixin],
|
||||
|
|
|
@ -75,7 +75,7 @@ import { compareDate } from "../../commom"
|
|||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import { getAction } from '../../../../api/manage'
|
||||
import dateFormat from '../../../../components/jeecg/JEasyCron/format-date'
|
||||
import FileDetail from "../fileDetail.vue"
|
||||
import FileDetail from "../../fileDetail.vue"
|
||||
export default {
|
||||
name: 'menuTree',
|
||||
mixins: [JeecgListMixin],
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
</template>
|
||||
</custom-table>
|
||||
</a-card>
|
||||
<Detail v-if="isDetail" :allData="detailJson" @back="handleBack"></Detail>
|
||||
<Detail v-if="isDetail" :type="fileName" :sampleId="currSampleId" :allData="detailJson" @back="handleBack"></Detail>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -49,6 +49,10 @@ export default {
|
|||
type: String,
|
||||
default:""
|
||||
},
|
||||
fileName: {
|
||||
type: String,
|
||||
default:""
|
||||
},
|
||||
spectralQualifie: {
|
||||
type: String,
|
||||
default:""
|
||||
|
@ -77,7 +81,8 @@ export default {
|
|||
},
|
||||
dataSource: [],
|
||||
detailJson: {},
|
||||
allChecked:false
|
||||
allChecked: false,
|
||||
currSampleId:""
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -106,7 +111,7 @@ export default {
|
|||
})
|
||||
},
|
||||
handleDetail(record) {
|
||||
// 测试接口数据 record.sampleId
|
||||
this.currSampleId = record.sampleId
|
||||
getAction("webStatistics/findGeneratedReport", { sampleId: record.sampleId }).then(res => {
|
||||
// getAction("webStatistics/findGeneratedReport", { sampleId: "1523651" }).then(res => {
|
||||
if (res.success){
|
||||
|
|
Loading…
Reference in New Issue
Block a user