优化加载条
(cherry picked from commit 4698a690b2f9d79f4586b2959d466fcc89046760)
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
:right-text="isChinese ? $t('chinese') : $t('english')"
|
||||
@click-left="handleBack"
|
||||
@click-right="handleChangeLang"
|
||||
:z-index="2"
|
||||
/>
|
||||
<div class="scroll-box" :class="{'no-nav-bar': !hasNavBar}">
|
||||
<router-view @titleChange="titleChange" />
|
||||
@@ -22,6 +23,7 @@ import Vue from 'vue'
|
||||
import { Locale } from 'vant'
|
||||
import zhCN from 'vant/es/locale/lang/zh-CN'
|
||||
import enUS from 'vant/es/locale/lang/en-US'
|
||||
// eslint-disable-next-line camelcase
|
||||
import zh_CN from 'ant-design-vue/lib/locale-provider/zh_CN'
|
||||
import * as dd from 'dingtalk-jsapi' // 解决document.title
|
||||
|
||||
|
||||
@@ -1,29 +1,40 @@
|
||||
<template>
|
||||
<!-- <div class="iframe-container">-->
|
||||
<iframe :src="previewUrl" class="responsive-iframe"></iframe>
|
||||
<!-- </div>-->
|
||||
<div class="iframe-container">
|
||||
<van-overlay :show="loading">
|
||||
<van-loading type="spinner" class="center-flex"/>
|
||||
</van-overlay>
|
||||
<iframe :src="previewUrl" class="responsive-iframe" @load="onIframeLoad"></iframe>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
previewUrl: ''
|
||||
previewUrl: '',
|
||||
loading: true
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.previewUrl = this.$route.params.previewUrl
|
||||
console.log('file preview mounted', this.previewUrl)
|
||||
},
|
||||
methods: {
|
||||
onIframeLoad () {
|
||||
console.log('iframe加载完成')
|
||||
this.loading = false
|
||||
// 在这里可以执行iframe加载完成后的操作
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.iframe-container {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
/*position: fixed;*/
|
||||
/*top: 0;*/
|
||||
/*left: 0;*/
|
||||
/*width: 100%;*/
|
||||
height: calc(100vh - 0.88rem);
|
||||
-webkit-overflow-scrolling: touch; /* 当手指从触摸屏上移开,会保持一段时间的滚动 */
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
@@ -167,6 +167,7 @@ import {
|
||||
isCanLookDetail
|
||||
} from '@/api/enterpriseStandardLibraryApi'
|
||||
import Vue from 'vue'
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import { previewPdf } from '@/utils/previewPdf'
|
||||
import { dealUrl } from '@/utils/kkFilePreview'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
@@ -601,12 +602,14 @@ export default {
|
||||
*/
|
||||
async filePreview13 (record) {
|
||||
console.log('filePreview', record)
|
||||
this.loading = true
|
||||
// 获取并处理过程稿件数据
|
||||
let res = await this.getFormFunc({ type: 1 })
|
||||
if (!res.success) {
|
||||
// this.$message.warn(res.message)
|
||||
Toast(res.message)
|
||||
console.log('getFormFunc error:', res)
|
||||
this.loading = false
|
||||
return
|
||||
}
|
||||
console.log('res.result', res.result)
|
||||
@@ -628,6 +631,7 @@ export default {
|
||||
// this.$message.warn(res.message)
|
||||
console.log('getDocumentInfoFunc error:', res)
|
||||
Toast('找不到该数据的文件信息')
|
||||
this.loading = false
|
||||
return
|
||||
}
|
||||
const detailData = Object.assign({}, res.result || {})
|
||||
@@ -676,6 +680,7 @@ export default {
|
||||
console.log('没有找到符合要求的文件!')
|
||||
// this.$message.error('该标准暂无预览文件,请联系标准管理员。')
|
||||
Toast('该标准暂无预览文件,请联系标准管理员。')
|
||||
this.loading = false
|
||||
return
|
||||
}
|
||||
console.log('seletedFile', file)
|
||||
@@ -696,6 +701,7 @@ export default {
|
||||
url = dealUrl(fileFullUrl)
|
||||
// }
|
||||
console.log('url', url)
|
||||
this.loading = false
|
||||
// window.open(url)
|
||||
this.$router.push({ name: 'filePreview', params: { previewUrl: url } })
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user