init reportSheet
This commit is contained in:
70
src/views/modules/monitoring/reportPreview.vue
Normal file
70
src/views/modules/monitoring/reportPreview.vue
Normal file
@@ -0,0 +1,70 @@
|
||||
<!--
|
||||
* @Author: gtz
|
||||
* @Date: 2021-03-07 18:39:03
|
||||
* @LastEditors: gtz
|
||||
* @LastEditTime: 2022-02-24 16:35:51
|
||||
* @Description: file content
|
||||
-->
|
||||
<template>
|
||||
<div v-loading="loading" :class="$style.container">
|
||||
<h1 >{{ $route.query.name }}</h1>
|
||||
|
||||
<iframe id="reportView" :class="$style.mainIframe" name="mainIframe" :src="url" frameborder="0" scrolling="auto" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
components: {},
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
// url: process.env.VUE_APP_REPORT_VIEW_URL
|
||||
url: window.SITE_CONFIG['apiURL'] + '/yd-monitor/ureport/preview'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
const vm = this
|
||||
console.log(this.$route.query)
|
||||
this.url += '?_u=db:' + this.$route.query.name + '.ureport.xml'
|
||||
// if (this.$route.query.params) {
|
||||
// const params = JSON.parse(this.$route.query.params)
|
||||
// params.map(item => {
|
||||
// this.url += '&' + item.key + '=' + item.value
|
||||
// })
|
||||
// }
|
||||
if (this.$route.query.substrateId) {
|
||||
this.url += '&substrateId=' + this.$route.query.substrateId
|
||||
}
|
||||
if (this.$route.query.equipmentId) {
|
||||
this.url += '&equipmentId=' + this.$route.query.equipmentId
|
||||
}
|
||||
if (this.$route.query.dataId) {
|
||||
this.url += '&dataId=' + this.$route.query.dataId
|
||||
}
|
||||
if (this.$route.query.workOrderNo) {
|
||||
this.url += '&workOrderNo=' + this.$route.query.workOrderNo
|
||||
}
|
||||
if (this.$route.query.id) {
|
||||
this.url += '&id=' + this.$route.query.id
|
||||
}
|
||||
const ifream = document.getElementById('reportView')
|
||||
ifream.onload = function() {
|
||||
console.log('加载完成')
|
||||
vm.loading = false
|
||||
}
|
||||
},
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" module>
|
||||
.container {
|
||||
margin: 0px 16px 0 8px;
|
||||
width: 98.5%;
|
||||
height: calc(100vh - 180px);
|
||||
.mainIframe {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user