|
|
@ -1,15 +1,15 @@ |
|
|
|
<template> |
|
|
|
<div v-loading="loading"> |
|
|
|
<div> |
|
|
|
<!-- v-loading="loading" --> |
|
|
|
<!-- http://192.168.99.84:8080/flowable-ui/modeler/#/processes --> |
|
|
|
<!-- :src="baseApi+'/flowable-ui/modeler'" --> |
|
|
|
<!-- src="http://192.168.99.67:11110/flowable-ui/modeler/" --> |
|
|
|
|
|
|
|
<div v-if="!isMaintenance" class="maintenance-message"> |
|
|
|
<!-- <div v-if="!isMaintenance" class="maintenance-message"> |
|
|
|
<img style="display: block; width: 500px;" src="~@/assets/images/4011.png"> |
|
|
|
<p>页面正在维护中...</p> |
|
|
|
</div> |
|
|
|
</div> --> |
|
|
|
<iframe |
|
|
|
v-else |
|
|
|
ref="myIframe" |
|
|
|
class="iframe" |
|
|
|
frameborder="0" |
|
|
@ -42,45 +42,46 @@ export default { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getIframeState() { |
|
|
|
const linkSrc = process.env.NODE_ENV === 'production' ? window.g.ApiUrl : process.env.VUE_APP_BASE_API |
|
|
|
// http://192.168.99.72:11200/flowable-ui/modeler/ |
|
|
|
const linkSrc = process.env.NODE_ENV === 'production' ? window.g.ProcessModelUrl : process.env.VUE_APP_PROCESSMODEL_API |
|
|
|
if (this.currentModelId) { |
|
|
|
this.url = linkSrc + '/flowable-ui/modeler/#/processes/' + this.currentModelId |
|
|
|
} else { |
|
|
|
this.url = linkSrc + '/flowable-ui/modeler' |
|
|
|
} |
|
|
|
|
|
|
|
fetch(this.url) |
|
|
|
.then(response => { |
|
|
|
console.log('response', response) |
|
|
|
if (response.ok) { |
|
|
|
this.isMaintenance = true |
|
|
|
console.log('地址能正常运行') |
|
|
|
this.$nextTick(() => { |
|
|
|
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 |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.isMaintenance = false |
|
|
|
console.log('地址无法正常运行,状态码:', response.status) |
|
|
|
} |
|
|
|
this.loading = false |
|
|
|
console.log('this.isMaintenance', this.isMaintenance) |
|
|
|
}) |
|
|
|
.catch(error => { |
|
|
|
console.log('地址无法正常运行,错误信息:', error) |
|
|
|
this.isMaintenance = false |
|
|
|
this.loading = false |
|
|
|
}) |
|
|
|
// fetch(this.url) |
|
|
|
// .then(response => { |
|
|
|
// console.log('response', response) |
|
|
|
// if (response.ok) { |
|
|
|
// this.isMaintenance = true |
|
|
|
// console.log('地址能正常运行') |
|
|
|
// this.$nextTick(() => { |
|
|
|
// 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 |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// }) |
|
|
|
// } else { |
|
|
|
// this.isMaintenance = false |
|
|
|
// console.log('地址无法正常运行,状态码:', response.status) |
|
|
|
// } |
|
|
|
// this.loading = false |
|
|
|
// console.log('this.isMaintenance', this.isMaintenance) |
|
|
|
// }) |
|
|
|
// .catch(error => { |
|
|
|
// console.log('地址无法正常运行,错误信息:', error) |
|
|
|
// this.isMaintenance = false |
|
|
|
// this.loading = false |
|
|
|
// }) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|