zhuliu 1 năm trước cách đây
mục cha
commit
b8affc2b35

+ 34 - 6
src/views/project/patentDetails/components/patentMessage/PatentRight.vue

@@ -17,13 +17,16 @@
         </div>
       </el-header>
       <el-main style="overflow: auto;">
-        <div class="height_100 claim" v-loading="loading" v-if="!checkedRightTree"  :style="setStyle()" >
+        <div class="height_100" v-loading="loading" v-if="!checkedRightTree"  :style="setStyle()" >
           <template v-if="name != 2">
             <div  class="height_100" v-html="getViewDom(this[tabItem.field], '权利要求'+tabItem.label, 'column')" :data-type="name == 2?'权利要求原文':'权利要求'+tabItem.label" ></div>
           </template>
           <template v-else>
-            <div v-equal_heights="'yiwen'" class="height_100" v-html="getViewDom(this[tabItem.field], '权利要求'+tabItem.label, 'column')" :data-type="name == 2?'权利要求原文':'权利要求'+tabItem.label" ref="yuanwen"></div>
-            <div class="height_100" v-html="getViewDom(contentOut, '权利要求译文', 'column')" :data-type="'权利要求译文'" ref="yiwen"></div>
+            <div class="height_100 claim">
+              <div v-equal_heights="'yiwen'" class="height_100" v-html="getViewDom(this[tabItem.field], '权利要求'+tabItem.label, 'column')" :data-type="name == 2?'权利要求原文':'权利要求'+tabItem.label" ref="yuanwen"></div>
+              <div class="height_100" v-html="getViewDom(contentOut, '权利要求译文', 'column')" :data-type="'权利要求译文'" ref="yiwen"></div> 
+            </div>
+            
           </template>
           
         </div>
@@ -69,17 +72,29 @@ export default {
         var that = vnode.context
         // 获取另一个容器的引用  
         const otherContainerSelector = binding.value;  
-        
+       
          that.$nextTick(()=>{
           const otherContainer = that.$refs[otherContainerSelector]; 
           if (!otherContainer) {  
             console.error('Unable to find the other container');  
             return;  
           }  
-    
+         
+          window.addEventListener("resize",that.$commonJS.debounce(()=>{
+            const children = el.children;  
+            const otherChildren = otherContainer.children; 
+            for (let i = 0; i < children.length && i < otherChildren.length; i++) {  
+              children[i].style.height = 'auto';  
+              otherChildren[i].style.height = 'auto'; 
+              const maxHeight = Math.max(children[i].offsetHeight, otherChildren[i].offsetHeight);  
+              children[i].style.height = maxHeight + 'px';  
+              otherChildren[i].style.height = maxHeight + 'px';  
+              otherChildren[i].style.background = '#f3f4f8';  
+            } 
+          },500))
           // 遍历当前容器和另一个容器的子div,并设置对应索引的高度  
           const children = el.children;  
-          const otherChildren = otherContainer.children;  
+          const otherChildren = otherContainer.children; 
           for (let i = 0; i < children.length && i < otherChildren.length; i++) {  
             const maxHeight = Math.max(children[i].offsetHeight, otherChildren[i].offsetHeight);  
             children[i].style.height = maxHeight + 'px';  
@@ -92,6 +107,17 @@ export default {
       componentUpdated(el, binding) {  
         // 这里可能需要额外的逻辑来处理更新后的高度同步  
       },  
+      unbind(el) {
+        var eventListener = window.eventListeners_
+        if(!eventListener){
+          return false
+        }
+        const listeners = eventListener.resize
+        if(listeners){
+          window.removeEventListener("resize");
+        }
+        
+      },
     },  
   }, 
   data() {
@@ -792,6 +818,8 @@ export default {
     // overflow: auto;
     padding: 0 5px;
   }
+  
 }
 
+
 </style>