浏览代码

文件加载校验

zhuliu 1 年之前
父节点
当前提交
aa8d94d1b6

+ 1 - 1
src/utils/model/iframe/index.vue

@@ -38,7 +38,7 @@ export default {
             a.onload = function() {
                 that.loadLoading = false
             };
-            if(a.contentDocument.readyState == 'complete'){
+            if(a.contentDocument && a.contentDocument.readyState && a.contentDocument.readyState == 'complete'){
                 that.loadLoading = false
             }
         })

+ 1 - 1
src/views/components/view/checkFile.vue

@@ -50,7 +50,7 @@ export default {
                 a.onload = function() {
                     that.loadLoading = false
                 };
-                if(a.contentDocument.readyState == 'complete'){
+                if(a.contentDocument && a.contentDocument.readyState && a.contentDocument.readyState == 'complete'){
                     that.loadLoading = false
                 }
             })

+ 10 - 5
src/views/project/patentDetails/components/notPatentDetails.vue

@@ -3,8 +3,9 @@
     <el-container>
         <el-header style="height: auto;">
         <div style="width:100%">
-          <div>
-            <div style="text-align: start;padding-left: 10px;position: relative;">
+          <div style="display:flex;justify-content: space-between;">
+            <div>
+              <div style="text-align: start;padding-left: 10px;position: relative;">
                 <img src="@/assets/visual/fixed.png" width="20px" height="20px" v-if="fix === true && value == true" @click="qx" style="" />
                 <img src="@/assets/visual/unfixed.png" width="20px" height="20px" v-if="fix === false && value == true"  @click="gd" style="" />
             </div>
@@ -13,6 +14,8 @@
                     {{ evidence.name }}
                 </span>
             </div>
+            </div>
+            
             <div>
                 <div v-if="reportType == 1 || reportType == 2">
                     <el-button type="primary" size="small" @click="addContrast">添加对比记录</el-button>
@@ -73,8 +76,10 @@ export default {
   },
   methods: {
     getUrl(){
-        var guid = this.evidence.literatureNo
-        this.url = this.$commonJS.checkGuid(guid,this.evidence.systemFile.type)
+        if(Object.keys(this.evidence).length>0){
+          var guid = this.evidence.literatureNo
+          this.url = this.$commonJS.checkGuid(guid,this.evidence.systemFile.type)
+        }
     },
     load(){
         var that = this
@@ -83,7 +88,7 @@ export default {
             a.onload = function() {
                 that.loading = true
             };
-            if(a.contentDocument.readyState == 'complete'){
+            if(a.contentDocument && a.contentDocument.readyState &&a.contentDocument.readyState == 'complete'){
                 that.loading = false
             }
         })