<template>
  <div class="intelligent_details-container">
    <div class="apass_breadcrumb">
      <el-breadcrumb separator="/">
        <el-breadcrumb-item>在线组件工具</el-breadcrumb-item>
        <el-breadcrumb-item>智能制图</el-breadcrumb-item>
        <!-- <el-breadcrumb-item>资源详情</el-breadcrumb-item> -->
      </el-breadcrumb>
    </div>

    <div class="main-container">
      <iframe ref="intelligent_details_iframe" width="100%" height="100%" scrolling="no" :src='itemUrl' frameborder="0"></iframe>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      originUrl:'https://apaasgis.wodcloud.com/portal/apaasplat/viewer/item.html',
    };
  },
  computed:{
    itemUrl(){
      let _self = this;
      if(_self.$route.name == 'intelligent_details'){
        return `${_self.originUrl}?id=${_self.$route.query.id}&activeMenu=${_self.$route.query.activeMenu}`
      }
    }
  },
  mounted() {
    this.$nextTick(() => {
      window.addEventListener('message',event =>{
        let data = event.data;
        if (data.cmd == 'mapdetailtoview'){
          console.log(data);
          this.$store.commit("setZnztDetailsParams", data.params);
          this.$router.push('/intelligent_drawing')
        }
      })
    })
  },
  methods: {},
  destroyed () {
    // window.removeEventListener('message')
  }
};

</script>

<style scoped>
.intelligent_details-container {
  margin: -157px 40px 20px;
}
.intelligent_details-container .main-container {
  height: calc(100vh - 150px - 43px);
  border-radius: 12px;
  background-color: #fff;
  padding: 0px;
}
.intelligent_details-container .main-container iframe {
  border-radius: 12px;
}
</style>

<style>
.intelligent_details-container .apass_breadcrumb {
  padding: 0 20px;
}
.intelligent_details-container .apass_breadcrumb > .el-breadcrumb .el-breadcrumb__inner {
  color: #626de9;
}
.intelligent_details-container
  .apass_breadcrumb
  > .el-breadcrumb
  .el-breadcrumb__item:last-child
  .el-breadcrumb__inner {
  color: #b4c0f5;
}
</style>
