|
|
@ -1,10 +1,11 @@ |
|
|
|
<template> |
|
|
|
<div v-loading="loading" :style="'height:'+ height"> |
|
|
|
<div v-if="!isMaintenance" class="maintenance-message"> |
|
|
|
<!-- v-loading="loading" --> |
|
|
|
<div :style="'height:'+ height"> |
|
|
|
<!-- <div v-if="!isMaintenance" class="maintenance-message"> |
|
|
|
<img style="display: block; width: 500px;" src="~@/assets/images/4011.png"> |
|
|
|
<p>页面正在维护中...</p> |
|
|
|
</div> |
|
|
|
<iframe v-else ref="myIframe" :src="url" frameborder="no" style="width: 100%;height: 100%" scrolling="auto" /> |
|
|
|
</div> --> |
|
|
|
<iframe ref="myIframe" :src="url" frameborder="no" style="width: 100%;height: 100%" scrolling="auto" /> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
@ -26,40 +27,40 @@ export default { |
|
|
|
const linkSrc = process.env.NODE_ENV === 'production' ? window.g.ApiUrl : process.env.VUE_APP_BASE_API |
|
|
|
this.url = linkSrc + '/ureport/designer' |
|
|
|
|
|
|
|
fetch(this.url) |
|
|
|
.then(response => { |
|
|
|
if (response.ok) { |
|
|
|
const that = this |
|
|
|
this.isMaintenance = true |
|
|
|
console.log('地址能正常运行') |
|
|
|
this.$nextTick(() => { |
|
|
|
const iframe = this.$refs.myIframe |
|
|
|
iframe.addEventListener('load', () => { |
|
|
|
if (iframe.contentWindow) { |
|
|
|
console.log('iframe内容已加载完成') |
|
|
|
this.loading = false |
|
|
|
} else { |
|
|
|
console.log('iframe内容加载出现错误') |
|
|
|
this.loading = false |
|
|
|
} |
|
|
|
}) |
|
|
|
window.onresize = function temp() { |
|
|
|
that.height = document.documentElement.clientHeight - 94.5 + 'px;' |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.isMaintenance = false |
|
|
|
console.log('地址无法正常运行,状态码:', response.status) |
|
|
|
} |
|
|
|
setTimeout(() => { |
|
|
|
this.loading = false |
|
|
|
}, 230) |
|
|
|
}) |
|
|
|
.catch(error => { |
|
|
|
console.log('地址无法正常运行,错误信息:', error) |
|
|
|
this.isMaintenance = false |
|
|
|
this.loading = false |
|
|
|
}) |
|
|
|
// fetch(this.url) |
|
|
|
// .then(response => { |
|
|
|
// if (response.ok) { |
|
|
|
// const that = this |
|
|
|
// this.isMaintenance = true |
|
|
|
// console.log('地址能正常运行') |
|
|
|
// this.$nextTick(() => { |
|
|
|
// const iframe = this.$refs.myIframe |
|
|
|
// iframe.addEventListener('load', () => { |
|
|
|
// if (iframe.contentWindow) { |
|
|
|
// console.log('iframe内容已加载完成') |
|
|
|
// this.loading = false |
|
|
|
// } else { |
|
|
|
// console.log('iframe内容加载出现错误') |
|
|
|
// this.loading = false |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// window.onresize = function temp() { |
|
|
|
// that.height = document.documentElement.clientHeight - 94.5 + 'px;' |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// } else { |
|
|
|
// this.isMaintenance = false |
|
|
|
// console.log('地址无法正常运行,状态码:', response.status) |
|
|
|
// } |
|
|
|
// setTimeout(() => { |
|
|
|
// this.loading = false |
|
|
|
// }, 230) |
|
|
|
// }) |
|
|
|
// .catch(error => { |
|
|
|
// console.log('地址无法正常运行,错误信息:', error) |
|
|
|
// this.isMaintenance = false |
|
|
|
// this.loading = false |
|
|
|
// }) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|