<template>
  <div class="flow-chart">
    <div class="iframe-wrapper">
      <iframe
        :src="workflowUrl"
        class="workflow-iframe"
        frameborder="0"
        scrolling="auto"
        allowfullscreen
        allow="fullscreen"
      />
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, inject, computed } from 'vue'
import type { WorkflowParams } from '@/types/workflow'

const workflowParams = inject<WorkflowParams>('workflowParams')
const workflowUrl = ref<any>('')
workflowUrl.value = `${import.meta.env.VITE_WORKFLOW_ADDR}` + '/workflow/module/designer/index.html?workid=' + `${workflowParams?.workId}`
             + '&showtype=2&dataid=' + `${workflowParams?.workId}`
</script>

<style lang="scss" scoped>
.flow-chart {
  width: 100%;
  height: calc(100vh - 0px);
}

.iframe-wrapper {
  width: 100%;
  height: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.workflow-iframe {
  width: 1200px;
  height: 100%;
  border: none;
}
</style> 