Эх сурвалжийг харах

feat:加载交互loading优化

zhangsiya 11 сар өмнө
parent
commit
8cf7f5d963

+ 11 - 2
jydocs-pc/src/views/Content.vue

@@ -1,7 +1,7 @@
 <template>
 <template>
-  <div class="detail-main" v-loading="loading">
+  <div class="detail-main">
     <div class="c-details">
     <div class="c-details">
-      <div class="d-left">
+      <div class="d-left"  v-loading="loading">
         <div class="tops">
         <div class="tops">
           <h1>
           <h1>
             <div>
             <div>
@@ -538,9 +538,11 @@ export default {
           this.config.PAGE_TO_VIEW++
           this.config.PAGE_TO_VIEW++
           this.renders(type)
           this.renders(type)
         }
         }
+        this.loading = false
       }).catch((e) => {
       }).catch((e) => {
         console.log('-------加载错误了------')
         console.log('-------加载错误了------')
         console.warn(e)
         console.warn(e)
+        this.loading = false
         // 文档加载失败
         // 文档加载失败
         if (this.datas.source === 2) {
         if (this.datas.source === 2) {
           this.ddErrorPreview()
           this.ddErrorPreview()
@@ -559,6 +561,7 @@ export default {
       }
       }
     },
     },
     buyShow (type) {
     buyShow (type) {
+      this.loading = true
       getShow({ docId: this.docIds }).then(res => {
       getShow({ docId: this.docIds }).then(res => {
         if (res.data.error_code === 0) {
         if (res.data.error_code === 0) {
           this.conts = res.data
           this.conts = res.data
@@ -571,6 +574,9 @@ export default {
           })
           })
 
 
           this.fileTypeThis = fileExtensions[FileIndex]
           this.fileTypeThis = fileExtensions[FileIndex]
+          if (fileExtensions[FileIndex] === 'docx' || fileExtensions[FileIndex] === 'xlsx' || fileExtensions[FileIndex] === 'xls') {
+            this.loading = false
+          }
           switch (fileExtensions[FileIndex]) {
           switch (fileExtensions[FileIndex]) {
             case 'docx':
             case 'docx':
               this.fileSrc.docSrc = res.data.data
               this.fileSrc.docSrc = res.data.data
@@ -587,11 +593,14 @@ export default {
               break
               break
           }
           }
         } else {
         } else {
+          this.loading = false
           Message({
           Message({
             message: res.data.error_msg,
             message: res.data.error_msg,
             type: 'warning'
             type: 'warning'
           })
           })
         }
         }
+      }).catch(() => {
+        this.loading = false
       })
       })
     },
     },
     coined () {
     coined () {