<template>
    <div :style="pageHeight">
        <iframe :src="url" width="100%" height="100%" frameborder="0" scrolling="auto"></iframe>
    </div>
</template>
<script>
    export default {
        data() {
            return {
                url: ""
            };
        },
        watch: {
            $route: {
                handler: function (route) {
                    this.url = null
                    if (route.query.name) {
                        if (window.location.origin.indexOf('172.16.12.101') != -1) {
                            this.url =
                                "http://172.16.12.101:8083/rbi/ebipro/easyolap.do?action=edit&resid=EANA$2$8$1$bd71f31ba69443b5b3f3997965927c41$f5c25912e8aa49d78e33f070bf944858&id=admin&pw=admin"
                        } else {
                            this.url =
                                "http://123.60.219.66:8083/bi/ebipro/easyolap.do?action=edit&resid=EANA$2$8$1$041302f30436412d9ba78f161a6575f0$f5c25912e8aa49d78e33f070bf944858&id=admin&pw=admin"
                        }
                    }
                },
                immediate: true
            }
        },
        // mounted() {
        //     if (window.location.origin.indexOf('172.16.12.101') != -1) {
        //         this.url =
        //             "http://172.16.12.101:8083/rbi/ebipro/easyolap.do?action=edit&resid=EANA$2$8$1$bd71f31ba69443b5b3f3997965927c41$f5c25912e8aa49d78e33f070bf944858&id=admin&pw=admin"
        //     } else {
        //         this.url =
        //             "http://123.60.219.66:8083/bi/ebipro/easyolap.do?action=edit&resid=EANA$2$8$1$041302f30436412d9ba78f161a6575f0$f5c25912e8aa49d78e33f070bf944858&id=admin&pw=admin"
        //     }
        // },
        computed: {
            pageHeight() {
                return {
                    'height': document.documentElement.clientHeight - 80 + 'px'
                }
            },
        }
    };
</script>