<template>
	<div v-loading="loading" :class="$style.container">
		<iframe id="zgboke" :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_DESIGN_URL
			// url: window.SITE_CONFIG['apiURL'] + this.$http.adornUrl('/ureport/designer')
			// url: this.$http.adornUrl('/ureport/designer')
			url: (process.env.NODE_ENV === 'production' ? '/api' : '/yd-monitor') + '/ureport/designer'
		}
	},
	mounted() {
		const vm = this
		console.log(this.$route.query)
		const { name } = this.$route.query
		this.url += name ? '?_u=db:' + this.$route.query.name : ''
		const ifream = document.getElementById('zgboke')

		ifream.onload = function() {
			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>
