|
@ -1,44 +1,56 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div> |
|
|
|
|
|
|
|
|
<div v-loading="loading"> |
|
|
<!-- http://192.168.99.84:8080/flowable-ui/modeler/#/processes --> |
|
|
<!-- http://192.168.99.84:8080/flowable-ui/modeler/#/processes --> |
|
|
<!-- :src="baseApi+'/flowable-ui/modeler'" --> |
|
|
<!-- :src="baseApi+'/flowable-ui/modeler'" --> |
|
|
<!-- src="http://192.168.99.67:11110/flowable-ui/modeler/" --> |
|
|
<!-- src="http://192.168.99.67:11110/flowable-ui/modeler/" --> |
|
|
<iframe |
|
|
<iframe |
|
|
ref="iframe" |
|
|
|
|
|
class="iframe_box" |
|
|
|
|
|
src="http://192.168.99.67:11110/flowable-ui/modeler/" |
|
|
|
|
|
|
|
|
ref="myIframe" |
|
|
|
|
|
class="iframe" |
|
|
frameborder="0" |
|
|
frameborder="0" |
|
|
scrolling="no" |
|
|
scrolling="no" |
|
|
|
|
|
:src="url" |
|
|
|
|
|
sandbox="allow-scripts allow-same-origin allow-downloads" |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { mapGetters } from 'vuex' |
|
|
|
|
|
export default { |
|
|
export default { |
|
|
|
|
|
props: { |
|
|
|
|
|
currentModelId: { |
|
|
|
|
|
type: String, |
|
|
|
|
|
default: '' |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
|
|
|
loading: true, |
|
|
url: '' |
|
|
url: '' |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
|
|
|
...mapGetters([ |
|
|
|
|
|
'baseApi' |
|
|
|
|
|
]) |
|
|
|
|
|
}, |
|
|
|
|
|
created() { |
|
|
created() { |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
|
const iframeElement = this.$refs.iframe |
|
|
|
|
|
console.log('iframeElement', iframeElement) |
|
|
|
|
|
const iframeWindow = iframeElement.contentWindow |
|
|
|
|
|
console.log('iframeWindow', iframeWindow) |
|
|
|
|
|
const iframeDocument = iframeWindow.document |
|
|
|
|
|
console.log('iframeDocument', iframeDocument) |
|
|
|
|
|
// 通过iframe文档对象获取元素 |
|
|
|
|
|
const iframeInnerElement = iframeDocument.querySelector('.login-button') |
|
|
|
|
|
// 在这里可以对获取到的元素进行进一步的操作 |
|
|
|
|
|
console.log('iframeInnerElement', iframeInnerElement) |
|
|
|
|
|
|
|
|
if (this.currentModelId) { |
|
|
|
|
|
this.url = 'http://192.168.99.67:11110/flowable-ui/modeler/#/processes/' + this.currentModelId |
|
|
|
|
|
} else { |
|
|
|
|
|
this.url = 'http://192.168.99.67:11110/flowable-ui/modeler' |
|
|
|
|
|
} |
|
|
|
|
|
const iframe = this.$refs.myIframe |
|
|
|
|
|
iframe.addEventListener('load', () => { |
|
|
|
|
|
if (iframe.contentWindow) { |
|
|
|
|
|
// iframe内容已加载完成 |
|
|
|
|
|
console.log('iframe内容已加载完成') |
|
|
|
|
|
this.loading = false |
|
|
|
|
|
} else { |
|
|
|
|
|
// iframe内容加载出现错误 |
|
|
|
|
|
console.log('iframe内容加载出现错误') |
|
|
|
|
|
this.loading = false |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
// const iframeWindow = iframeElement.contentWindow |
|
|
|
|
|
// const iframeDocument = iframeWindow.document |
|
|
|
|
|
// const iframeInnerElement = iframeDocument.querySelector('.login-button') |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
} |
|
|
} |
|
@ -46,4 +58,8 @@ export default { |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style lang='scss' scoped> |
|
|
<style lang='scss' scoped> |
|
|
|
|
|
.iframe { |
|
|
|
|
|
width: 100%; |
|
|
|
|
|
height: calc(100vh - 215px); |
|
|
|
|
|
} |
|
|
</style> |
|
|
</style> |