<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 (route.query.name === 'xinzhuang') {
                            this.url =
                                'http://172.16.12.101:8083/rbi/ebibase/showreport.do?resid=EANA$2$2$1$bd71f31ba69443b5b3f3997965927c41$4a71c6bc1fd34da7843c6eb2a7b3aee3&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$621b7c14e4aa4a0483a8e577d8dc4cff&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$36292212f28b4702af2c4aa01a62bdc1&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$2320f3ed77e740d6bb1b66b1f7062ad1&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$3dc29db548d54d289e58bf4a30dfb026&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$5ebbf0905b22448cbd9834ec6560fd26&id=admin&pw=admin'
                        }
                    } else {
                        let str = ''
                        if (window.location.origin.indexOf('172.16.12.101') != -1) {
                            str =
                                'http://172.16.12.101:8083/rbi/ebibase/showreport.do?resid=EANA$2$2$1$bd71f31ba69443b5b3f3997965927c41$c61354961de740f1acec8fc664034f81&id=admin&pw=admin'
                        } else {
                            str =
                                'http://123.60.219.66:8083/bi/ebibase/showreport.do?resid=EANA$2$2$1$041302f30436412d9ba78f161a6575f0$e97782eaa9444e11aa1b33c78d9dca1f&id=admin&pw=admin'
                        }
                        this.url = str
                    }
                },
                immediate: true
            }
        }
    };
</script>