¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div ref="container" class="w-full h-[calc(100vh-88px)]"> |
| | | <iframe ref="iframe" :src="iframeUrl" frameborder="0" height="100%" style="height: 100%; width: inherit"></iframe> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="WarmFlow"> |
| | | const { proxy } = getCurrentInstance(); |
| | | import { onMounted } from 'vue'; |
| | | import { getToken } from '@/utils/auth'; |
| | | |
| | | // definitionId为éè¦æ¥è¯¢çæµç¨å®ä¹idï¼ |
| | | // disabled为æ¯å¦å¯ç¼è¾, ä¾å¦ï¼æ¥ççæ¶åä¸å¯ç¼è¾ï¼ä¸å¯ä¿å |
| | | const iframeUrl = ref(''); |
| | | const baseUrl = import.meta.env.VITE_APP_BASE_API; |
| | | const iframeLoaded = () => { |
| | | // iframeçå¬ç»ä»¶å
设计å¨ä¿åäºä»¶ |
| | | window.onmessage = (event) => { |
| | | switch (event.data.method) { |
| | | case 'close': |
| | | close(); |
| | | break; |
| | | } |
| | | }; |
| | | }; |
| | | const open = async (definitionId, disabled) => { |
| | | let url = baseUrl + `/warm-flow-ui/index.html?id=${definitionId}&disabled=${disabled}`; |
| | | iframeUrl.value = url + '&Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID; |
| | | }; |
| | | /** å
³éæé® */ |
| | | function close() { |
| | | const obj = { path: '/workflow/processDefinition' }; |
| | | proxy.$tab.closeOpenPage(obj); |
| | | } |
| | | |
| | | onMounted(() => { |
| | | iframeLoaded(); |
| | | open(proxy.$route.query.definitionId, proxy.$route.query.disabled); |
| | | }); |
| | | /** |
| | | * 坹夿´é²åç»ä»¶æ¹æ³ |
| | | */ |
| | | defineExpose({ |
| | | open |
| | | }); |
| | | </script> |