<template>
  <div class="app-container">
    <iframe :src="strucUrl" scrolling="no" frameborder="0" :style="{ width: '100%', height: strucHeight + 'px' }" v-if="strucUrl"></iframe>
  </div>
</template>

<script>
import { getToken } from '@/utils/auth'
import md5 from 'js-md5'
export default {
  name: 'Structure',
  data() {
    return {
      BASE_LT: 'https://b-plugin.qixin.com/third-login?tenant=dsk&returnUrl=/standalone-charts',
      eid: '',
      strucHeight: 0,
      strucUrl: '',
      token: getToken()
    }
  },
  created() {
    if(this.$route.query.eid){
      if(this.$route.query.typeId==5){
        this.strucUrl = this.BASE_LT+'/structure?eid='+this.$route.query.eid+'&name='+this.token+'&pas='+md5(this.token)
      }else if(this.$route.query.typeId==6){
        this.strucUrl = this.BASE_LT+'/relationship?eid='+this.$route.query.eid+'&name='+this.token+'&pas='+md5(this.token)
      }
    }
  },
  mounted(){
    this.getIframeHeight()
  },
  methods: {
    //iframe高度
    getIframeHeight(){
      this.strucHeight = document.body.clientHeight
    },
  }
}
</script>

<style lang="scss" scoped>

</style>
