<template>
	<view class="container">
		<web-view :src="pdfUrl"></web-view>
		<!-- <iframe :src="pdfUrl" class="iframe-area" frameborder="0"></iframe> -->
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue'

	import {
		onLoad,
	} from "@dcloudio/uni-app"

	import config from '@/config.js';

	let pdfUrl = ref(null);

	const setUrl = params => {
		const serverAddress = uni.getStorageSync('serverAddress')
		const baseUrlIp = serverAddress ? serverAddress : config.baseUrl;
		let userToken = uni.getStorageSync('App-Token');
		pdfUrl.value =
			`${baseUrlIp}/projects/outApi/projects/statics/yearReport?year=${params.year}&containHide=${params.containHide}&hyfl=${params.hyfl ?? ""}&token=${params.token}`
	}

	onLoad((Option) => {
		setUrl(Option)
	})
</script>

<style lang="scss" scoped>
	page {
		height: 100%;
		background-color: #EAF0FA;
	}

	.container {
		width: 100%;
		height: 100%;
		margin: 0 auto;
		background: linear-gradient(180deg, #1869F6 0%, #EAF0FA 64%, #EAF0FA 100%);

		.iframe-area {
			// margin-top: 10%;
			width: 100%;
			height: 100%;
		}
	}
</style>