<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 === 'xinzhuang') {
                                this.url =
                                    'http://172.16.12.101:8083/rbi/ebibase/showreport.do?resid=EANA$2$2$1$bd71f31ba69443b5b3f3997965927c41$3341eda2eca447c380bb06e6e481d844&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$760bad3725d94777a74528c8ac9b26b9&id=admin&pw=admin'
                            } else if (route.query.name === 'zuozhuang') {
                                this.url =
                                    'http://172.16.12.101:8083/rbi/ebibase/showreport.do?resid=EANA$2$2$1$bd71f31ba69443b5b3f3997965927c41$1879c56390294d648d20717f0810bdd8&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$d0cec38cba1f43128d9aa5d348198c6e&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$0fea3b9cf19e49708fed7916a6efffc2&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$17d1c65d3389444bb804864268aa032b&id=admin&pw=admin'
                            }
                        } else {
                            if (route.query.name === 'xinzhuang') {
                                this.url =
                                    'http://123.60.219.66:8083/bi/ebibase/showreport.do?resid=EANA$2$2$1$041302f30436412d9ba78f161a6575f0$3341eda2eca447c380bb06e6e481d844&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$760bad3725d94777a74528c8ac9b26b9&id=admin&pw=admin'
                            } else if (route.query.name === 'zuozhuang') {
                                this.url =
                                    'http://123.60.219.66:8083/bi/ebibase/showreport.do?resid=EANA$2$2$1$041302f30436412d9ba78f161a6575f0$1879c56390294d648d20717f0810bdd8&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$d0cec38cba1f43128d9aa5d348198c6e&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$0fea3b9cf19e49708fed7916a6efffc2&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$17d1c65d3389444bb804864268aa032b&id=admin&pw=admin'
                            }
                        }
                    }
                },
                immediate: true
            }
        }
    };
</script>