<!--<template>
  <div>-->
    <!--    <iframe :src="ReportUrl1" id="mobsf" frameborder="0" style="position:absolute;"></iframe>-->
   <!-- <iframe :src="ReportUrl1" style="width: 100%;height: 100%;min-height: 600px"></iframe>
  </div>
</template>
<script>

import Report from "@/api/common/hrcloudCommon";
export default {
  name: "Report",
  data() {
    return {
      ReportUrl1: "",
    };
  },
  mounted() {
    this.showReport();
    /**
     * iframe-宽高自适应显示
     */
    function changeMobsfIframe() {
      const mobsf = document.getElementById("mobsf");
      const deviceWidth = document.body.clientWidth;
      const deviceHeight = document.body.clientHeight;
      mobsf.style.width = Number(deviceWidth) - 220 + "px"; //数字是页面布局宽度差值
      mobsf.style.height = Number(deviceHeight) - 80 + "px"; //数字是页面布局高度差
    }
    changeMobsfIframe();
    window.onresize = function () {
      changeMobsfIframe();
    };
  },
  methods: {
    showReport() {
      let ReportUrl = Report.Report_Cli_URL + "reportTools/cusMain";
      // let ReportUrl = Report.Report_Cli_URL
      console.log("ReportUrl", ReportUrl);
      // let ReportUrl = 'http://192.168.251.62:9093'
      let HRUrl = Report.HRCLOUD_URL;
      this.ReportUrl1 = ReportUrl;
      //console.log("ReportUrl",ReportUrl)
      //alert("1")
    },
    //通过id进行拼接
    showReport2() {
      let ReportId = "4417";
      let ReportUrl =
        Report.Report_Cli_URL + "reportTools/newreportList/" + ReportId;
      console.log("ReportUrl", ReportUrl);
      this.ReportUrl1 = ReportUrl;
    },
    //通过id进行拼接。通过session获取id
    showReport() {
      let ReportId = sessionStorage.getItem("cusId");
      console.log("ReportId", ReportId);
      let ReportUrl =
        Report.Report_Cli_URL + "reportTools/newreportList/" + ReportId;
      console.log("ReportUrl", ReportUrl);
      this.ReportUrl1 = ReportUrl;
      if (ReportId != "") {
        Message.success("查询成功");
      } else {
        Message.warning("暂无数据");
      }
    },
  },
};
</script>
<style scoped>
</style>
