Blame view

Yi.Vben5.Vue3/apps/web-antd/src/views/workflow/components/flow-preview.vue 833 Bytes
515fceeb   “wangming”   框架初始化
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  <script setup lang="ts">
  import { useAppConfig } from '@vben/hooks';
  import { stringify } from '@vben/request';
  import { useAccessStore } from '@vben/stores';
  
  import { useWarmflowIframe } from './hook';
  
  defineOptions({ name: 'FlowPreview' });
  
  const props = defineProps<{ instanceId: string }>();
  
  const { clientId } = useAppConfig(import.meta.env, import.meta.env.PROD);
  
  const accessStore = useAccessStore();
  const params = {
    Authorization: `Bearer ${accessStore.accessToken}`,
    id: props.instanceId,
    clientid: clientId,
    type: 'FlowChart',
  };
  
  /**
   * iframe地址
   */
  const url = `${import.meta.env.VITE_GLOB_API_URL}/warm-flow-ui/index.html?${stringify(params)}`;
  
  const { iframeRef } = useWarmflowIframe();
  </script>
  
  <template>
    <iframe ref="iframeRef" :src="url" class="h-[500px] w-full border"></iframe>
  </template>