<template>
  <i-frame :src="url"/>
</template>

<script>
import {getToken} from '@/utils/auth'
import iFrame from '@/components/iFrame/index.vue'
import {getCurrentDeptTree} from "@/api/business/unit";

export default {
  name: "orderInfo",
  components: {
    iFrame
  },
  data() {
    return {
      url: ''
    }
  },
  created() {
    this.init()
  },
  methods: {
    init() {
      getCurrentDeptTree().then(response => {
        let deptIds = response.data.map((item) => {
          return item.deptId
        })
        console.log('deptIds',deptIds.join(','))
        this.url = `http://${window.location.hostname}:8099/jmreport/view/1174586035611238400?deptId=${this.$store.state.user.userInfo.deptId}&deptIds=${deptIds.join(',')}&token=Bearer `+ getToken()
        console.log('url', this.url)
      });
    },
  }
}
</script>
