<template>
	<view class="content">
		<web-view :src="src"></web-view>
	</view>
</template>


<script>
	export default {
		data() {
			return {
				id: null,
				title: null,
				option: {},
				show: false,
				page: 1,
				limit: 10,
				recordList: [],
				src: null
			}
		},
		onLoad(options) {
			this.id = options.id
			this.title = options.title
			const randomId=this.GetQueryString('randomId')
			const printArea=this.GetQueryString('printArea')
			const printAreaValue=this.GetQueryString('printAreaValue')
			
			this.src = `/static/webview/report-wv.html?id=${this.id}&randomId=${randomId}&printArea=${printArea}&printAreaValue=${printAreaValue}`
			// this.getReportTable()
		},
		onReady() {
			setTimeout(() => {
				uni.setNavigationBarTitle({
					title: this.title
				});
			}, 500)
		},
		methods: {
			//返回按钮
			handelBack() {
				uni.switchTab({
					url: '/pages/reportForm/index'
				});
			},
			//报表详情
			getReportTable() {
				uni.$http.get('/reportTable/getReportTableById', {
					id: this.id
				}).then(res => {
					console.log(res, 'res');
					if (res.data.code === 200) {
						// this.title=res.data.data.reportTableName
					}
				})
			},
			GetQueryString(name) {
				var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
				var r = window.location.search.substr(1).match(reg); //获取url中"?"符后的字符串并正则匹配
				var context = "";
				if (r != null)
					context = decodeURIComponent(r[2]);
				reg = null;
				r = null;
				return context == null || context == "" || context == "undefined" ? "" : context;
			}
		}
	}
</script>

<style lang="scss" scoped>
	::v-deep .luckysheet_info_detail_back {
		display: none !important;
	}

	::v-deep .u-button {
		width: 160rpx;
		height: 60rpx
	}

	.btn {
		position: absolute;
		left: 50%;
		bottom: 2%;
		margin-left: -80rpx;
	}

	.uni-td {
		width: 600rpx;
		overflow: hidden;
		text-overflow: ellipsis;
	}
</style>