<template>
    <div :style="pageHeight">
        <iframe :src="url" width="100%" height="100%" frameborder="0" scrolling="auto"></iframe>
    </div>
</template>
<script>
    export default {
        data() {
            return {
                url: null,
            };
        },
        computed: {
            pageHeight() {
                return {
                    'height': document.documentElement.clientHeight - 80 + 'px'
                }
            },
        },
        watch: {
            $route: {
                handler: function (route) {
                    this.url = null
                    if (route.query.name) {
                        if (window.location.origin.indexOf('172.16.12.101') != -1) {
                            if (route.query.name === 'zuozhuangyiqi') {
                                this.url =
                                    'http://172.16.12.101:8083/rbi/ebibase/showreport.do?resid=EANA$2$2$1$bd71f31ba69443b5b3f3997965927c41$6cfd3bcb6b85450dbcf396a816439c9f&id=admin&pw=admin'
                            } else if (route.query.name === 'zuozhuangerqi') {
                                this.url =
                                    'http://172.16.12.101:8083/rbi/ebibase/showreport.do?resid=EANA$2$2$1$bd71f31ba69443b5b3f3997965927c41$cc08c68dc9e34d15951f73dad8fbdbd7&id=admin&pw=admin'
                            } else if (route.query.name === 'xinzhuangyiqi') {
                                this.url =
                                    'http://172.16.12.101:8083/rbi/ebibase/showreport.do?resid=EANA$2$2$1$bd71f31ba69443b5b3f3997965927c41$05d0dbf32f7645179e12ffe21f064fd9&id=admin&pw=admin'
                            } else if (route.query.name === 'xinzhuangerqi') {
                                this.url =
                                    'http://172.16.12.101:8083/rbi/ebibase/showreport.do?resid=EANA$2$2$1$bd71f31ba69443b5b3f3997965927c41$19d79cef51114028a3f1dd1c06b08ea8&id=admin&pw=admin'
                            }
                        } else {
                            if (route.query.name === 'zuozhuangyiqi') {
                                this.url =
                                    'http://123.60.219.66:8083/bi/ebibase/showreport.do?resid=EANA$2$2$1$041302f30436412d9ba78f161a6575f0$6cfd3bcb6b85450dbcf396a816439c9f&id=admin&pw=admin'
                            } else if (route.query.name === 'zuozhuangerqi') {
                                this.url =
                                    'http://123.60.219.66:8083/bi/ebibase/showreport.do?resid=EANA$2$2$1$041302f30436412d9ba78f161a6575f0$cc08c68dc9e34d15951f73dad8fbdbd7&id=admin&pw=admin'
                            } else if (route.query.name === 'xinzhuangyiqi') {
                                this.url =
                                    'http://123.60.219.66:8083/bi/ebibase/showreport.do?resid=EANA$2$2$1$041302f30436412d9ba78f161a6575f0$05d0dbf32f7645179e12ffe21f064fd9&id=admin&pw=admin'
                            } else if (route.query.name === 'xinzhuangerqi') {
                                this.url =
                                    'http://123.60.219.66:8083/bi/ebibase/showreport.do?resid=EANA$2$2$1$041302f30436412d9ba78f161a6575f0$19d79cef51114028a3f1dd1c06b08ea8&id=admin&pw=admin'
                            }
                        }
                    }
                },
                immediate: true
            }
        }
    };
</script>