flowChart.vue 961 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template>
  2. <div>
  3. <div style="height: 68vh" 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 { getToken } from '@/utils/auth';
  10. // Props 定义方式变化
  11. const props = defineProps({
  12. insId: {
  13. type: [String, Number],
  14. default: null
  15. }
  16. });
  17. const iframeUrl = ref('');
  18. const baseUrl = import.meta.env.VITE_APP_BASE_API;
  19. onMounted(async () => {
  20. const url = baseUrl + `/warm-flow-ui/index.html?id=${props.insId}&type=FlowChart&t=${Date.now()}`;
  21. iframeUrl.value = url + '&Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID;
  22. });
  23. </script>
  24. <style scoped>
  25. .iframe-wrapper {
  26. border-radius: 12px;
  27. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  28. overflow: hidden;
  29. }
  30. .custom-iframe {
  31. width: 100%;
  32. border: none;
  33. background: transparent;
  34. }
  35. </style>