<template>
	<view :class="['content',{'gray':store.isgray==1}]" >
		<iframe id="bdIframe"  :src="fileUrl" ref="bdIframe" style="border: none;" class="iframe"/>
	</view>
</template>

<script setup>
	import {
		useStore
	} from '@/store';
	import {
		onLoad
	} from '@dcloudio/uni-app';
	import Base64 from '@/utils/code.js';
	const requestUrl = import.meta.env.VITE_REQUEST_BASE_URL;
	const baseUrl = 'https://10.75.166.6/jeecg-boot/sys/common/static/';
	const store = useStore();
	
	var fileUrl = "";
	
	onLoad((options) => {
		let base64 = new Base64();
		var url= JSON.parse(options.data)
		url = baseUrl + url;
		console.log(url)
		fileUrl =requestUrl+ '/preview/onlinePreview' + '?url=' + encodeURIComponent(base64.encode(url))
		console.log(fileUrl)
	})
</script>

<style>
	.container {
		position: relative;
		width: 100%;
		height: 100vh;
		
	}
	#bdIframe {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		
		
	}
</style>