<template>
  <div class="subsystem-iframe-container">
    <iframe-com-ins ref="subsystemIframeContainer" :iframeStyles="urlQueryParams.iframeStyles" :styles="urlQueryParams.styles"
      :url="urlQueryParams.url"></iframe-com-ins>
  </div>
</template>
<script>
import IframeComIns from "./components/IframeComIns";
import IframeTools from "@/utils/iframeTools";
export default {
  name: "subsystemIframeContainer",
  components: {
    IframeComIns
  },
  data() {
    return {
      urlQueryParams: {},
      iframeToolsIns: {}
    };
  },
  //可访问data属性
  created() {
    this.Init();
  },
  beforeDestroy() {
    if (this.iframeToolsIns) {
      this.iframeToolsIns.clearRefreshTimer ? this.iframeToolsIns.clearRefreshTimer() : null;
    }
  },
  //计算集
  computed: {

  },
  //方法集
  methods: {
    async Init() {
      await this.$nextTick();
      const dom = this.$refs["subsystemIframeContainer"].$el.querySelector("iframe");
      const iframeTools = new IframeTools(dom);
      this.iframeToolsIns = iframeTools;
      this.urlQueryParams = iframeTools.queryParams;
      console.log(this.urlQueryParams);
    }
  },
}
</script>
<style lang="scss" scoped>
.subsystem-iframe-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}
</style>
