<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$53bbf921f227409f9b6554d94f85cb2b&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$d71943fd4d0746638cc32a82f8370cdc&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$0f0aac32858d463b818a4a4279e6aeea&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$446bd6a7efee40b49a6dba26cb21757b&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$16557a9ade704425b842e5d6725f3eef&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$30558a58dd3a48b7b755ee65d2a94690&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$53bbf921f227409f9b6554d94f85cb2b&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$d71943fd4d0746638cc32a82f8370cdc&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$0f0aac32858d463b818a4a4279e6aeea&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$446bd6a7efee40b49a6dba26cb21757b&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$16557a9ade704425b842e5d6725f3eef&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$30558a58dd3a48b7b755ee65d2a94690&id=admin&pw=admin'
                            }
                        }
                    }
                },
                immediate: true
            }
        }
    };
</script>