fix: 3.1.0. 工作流页面新增加载效果

This commit is contained in:
xlsea 2024-03-04 17:34:18 +08:00
parent 9ed6756548
commit b7d50f2945

View File

@ -1,4 +1,6 @@
<template> <template>
<a-spin :spinning="spinning" tip=" 工作流正在加载中">
<a-icon slot="indicator" type="loading" style="font-size: 58px; top: 39%" spin />
<iframe <iframe
ref="iframe" ref="iframe"
:src="`${mode === 'production' ? baseUrl : ''}/lib/index.html?id=${id}&mode=${mode}&x1c2Hdd6=${value}`" :src="`${mode === 'production' ? baseUrl : ''}/lib/index.html?id=${id}&mode=${mode}&x1c2Hdd6=${value}`"
@ -6,6 +8,7 @@
frameborder="no" frameborder="no"
:style="`width: 100%;height:calc(99vh - 60px)`" :style="`width: 100%;height:calc(99vh - 60px)`"
/> />
</a-spin>
</template> </template>
<script> <script>
@ -21,11 +24,14 @@ export default {
data () { data () {
return { return {
id: '', id: '',
spinning: true,
mode: process.env.NODE_ENV, mode: process.env.NODE_ENV,
baseUrl: process.env.VUE_APP_API_BASE_URL baseUrl: process.env.VUE_APP_API_BASE_URL,
indicator: <a-icon type="loading" style="font-size: 36px" spin />
} }
}, },
mounted () { mounted () {
this.iframeLoad()
this.id = this.$route.query.id this.id = this.$route.query.id
}, },
created () { created () {
@ -58,6 +64,22 @@ export default {
this.update() this.update()
} }
} }
},
iframeLoad () {
const that = this
const iframe = this.$refs.iframe
// IE
if (iframe.attachEvent) {
iframe.attachEvent('onload', function () {
// iframe
that.spinning = false
})
} else {
iframe.onload = function () {
// iframe
that.spinning = false
}
}
} }
} }
} }
@ -71,4 +93,12 @@ export default {
.ant-layout-footer { .ant-layout-footer {
display: none; display: none;
} }
.ant-spin-text {
font-size: 20px;
}
.ant-spin-nested-loading > div > .ant-spin {
top: 23%;
}
</style> </style>