<template>
  <iframe :src="iframeURL"
    frameborder="0"
    width="100%"
    height="800px"></iframe>
</template>

<script setup>
import { useRoute } from 'vue-router'
import { getTicketId } from '@/api'
import { onMounted } from 'vue'
const route = useRoute()
const ticket = ref('')
const iframeURL = ref('')
onMounted(() => {
  getTicketId({
    pageId: route.query.id
  }).then(response => {
    ticket.value = response.data.accessTicket
    iframeURL.value = `https://bi.aliyun.com/token3rd/dashboard/view/pc.htm?pageId=${route.query.id}&embedDisplayParam=%7B%22showTitle%22%3Afalse%7D&accessTicket=${ticket.value}`
  })
})
</script>
<style scoped></style>
