flowChart.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <div>
  3. <div :style="'height:' + height" class="iframe-wrapper">
  4. <iframe :src="iframeUrl" style="width: 100%; height: 100%" frameborder="0" scrolling="no" class="custom-iframe" />
  5. </div>
  6. </div>
  7. </template>
  8. <script setup lang="ts">
  9. import '@logicflow/core/lib/style/index.css';
  10. import { getToken } from '@/utils/auth';
  11. // Props 定义方式变化
  12. const props = defineProps({
  13. insId: {
  14. type: [String, Number],
  15. default: null
  16. }
  17. });
  18. const height = document.documentElement.clientHeight - 94.5 + 'px';
  19. const iframeUrl = ref('');
  20. const baseUrl = import.meta.env.VITE_APP_BASE_API;
  21. onMounted(async () => {
  22. const url = baseUrl + `/warm-flow-ui/index.html?id=${props.insId}&type=FlowChart`;
  23. iframeUrl.value = url + '&Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID;
  24. });
  25. </script>
  26. <style scoped>
  27. .iframe-wrapper {
  28. border-radius: 12px;
  29. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  30. overflow: hidden; /* 关键隐藏内部溢出 */
  31. }
  32. .custom-iframe {
  33. width: 100%;
  34. height: 600px;
  35. border: none;
  36. background: transparent;
  37. }
  38. </style>