<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 === 'xinzuo') {
                                this.url =
                                    'http://172.16.12.101:8083/rbi/ebibase/showreport.do?resid=EANA$2$2$1$bd71f31ba69443b5b3f3997965927c41$be0f8f75df7543978e9ddff5f7576a2b&id=admin&pw=admin'
                            } else if (route.query.name === 'jiliangshan') {
                                this.url =
                                    'http://172.16.12.101:8083/rbi/ebibase/showreport.do?resid=EANA$2$2$1$bd71f31ba69443b5b3f3997965927c41$d24a18e0985a46e5895573738a5cc384&id=admin&pw=admin'
                            } else if (route.query.name === 'fanshigou') {
                                this.url =
                                    'http://172.16.12.101:8083/rbi/ebibase/showreport.do?resid=EANA$2$2$1$bd71f31ba69443b5b3f3997965927c41$ff22bb1d24bc416e9185a1e40be6976b&id=admin&pw=admin'
                            } else if (route.query.name === 'caoshanliang') {
                                this.url =
                                    'http://172.16.12.101:8083/rbi/ebibase/showreport.do?resid=EANA$2$2$1$bd71f31ba69443b5b3f3997965927c41$a946d1d7e6f242d7a1fdbaa32fd1601c&id=admin&pw=admin'
                            } else if (route.query.name === 'leijiashan') {
                                this.url =
                                    'http://172.16.12.101:8083/rbi/ebibase/showreport.do?resid=EANA$2$2$1$bd71f31ba69443b5b3f3997965927c41$8e0637d590ce4fa2b3a26455a81895b2&id=admin&pw=admin'
                            }
                        } else {
                            if (route.query.name === 'xinzuo') {
                                this.url =
                                    'http://123.60.219.66:8083/bi/ebibase/showreport.do?resid=EANA$2$2$1$041302f30436412d9ba78f161a6575f0$be0f8f75df7543978e9ddff5f7576a2b&id=admin&pw=admin'
                            } else if (route.query.name === 'jiliangshan') {
                                this.url =
                                    'http://123.60.219.66:8083/bi/ebibase/showreport.do?resid=EANA$2$2$1$041302f30436412d9ba78f161a6575f0$d24a18e0985a46e5895573738a5cc384&id=admin&pw=admin'
                            } else if (route.query.name === 'fanshigou') {
                                this.url =
                                    'http://123.60.219.66:8083/bi/ebibase/showreport.do?resid=EANA$2$2$1$041302f30436412d9ba78f161a6575f0$ff22bb1d24bc416e9185a1e40be6976b&id=admin&pw=admin'
                            } else if (route.query.name === 'caoshanliang') {
                                this.url =
                                    'http://123.60.219.66:8083/bi/ebibase/showreport.do?resid=EANA$2$2$1$041302f30436412d9ba78f161a6575f0$a946d1d7e6f242d7a1fdbaa32fd1601c&id=admin&pw=admin'
                            } else if (route.query.name === 'leijiashan') {
                                this.url =
                                    'http://123.60.219.66:8083/bi/ebibase/showreport.do?resid=EANA$2$2$1$041302f30436412d9ba78f161a6575f0$8e0637d590ce4fa2b3a26455a81895b2&id=admin&pw=admin'
                            }
                        }
                    }
                },
                immediate: true
            }
        }
    };
</script>