From 9f5874fcd8657ade15b4fc73c924813684f3a9a8 Mon Sep 17 00:00:00 2001
From: LiJinHuan <lijinhuan@prec-tech.com>
Date: 星期二, 08 八月 2023 19:19:35 +0800
Subject: [PATCH] 备品最近优化代码

---
 force-app/main/default/components/RelationListPagingCmp.component |   36 ++++++++++++++++++++----------------
 1 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/force-app/main/default/components/RelationListPagingCmp.component b/force-app/main/default/components/RelationListPagingCmp.component
index fe2b49f..49b6327 100644
--- a/force-app/main/default/components/RelationListPagingCmp.component
+++ b/force-app/main/default/components/RelationListPagingCmp.component
@@ -379,24 +379,19 @@
         sbwidth = scrollbarWidth();
         i++;
         tableWidth = j$('body .pbBody table#tableHeader').width();
-        // var widthTemp = 0;
-        j$('body .pbBody table#tableHeader tr.headerRow td').each(function() {
-            var colClass = getColClassName(this);
-            if (colClass != 'col_Scroll') {
-                var temp = j$('body .pbBody table.list tr.headerRow td.' + colClass).width();
-                listColClassWidthMap[colClass] = temp;
-                //widthTemp += temp;
-            }
-        });
-        var blockWidthNew = j$(escapeVfId('allPage:allForm:searchBlock')).width() - j$('div#out_Div_L').width()-sbwidth;
-        // console.log(widthTemp+'~'+blockWidthNew+'~'+tableWidth);
+        // var blockWidth = j$(escapeVfId('allPage:allForm:searchBlock')).width() - j$('div#out_Div_L').width()-sbwidth;
+        var blockWidth = j$(escapeVfId('allPage:allForm:searchBlock')).width() - j$('div#out_Div_L').width() - widthAjustment - sbwidth - 20;
         var tableHeader_L =  j$(escapeVfId('tableHeader_L')).width();
+        console.log('~'+tableHeader_L);
         j$('div#in_Div_L').css('width', tableHeader_L+ 'px'); 
         j$('table#tableData_L').css('width', tableHeader_L + 'px');
-        // j$('table#tableHeader').css('width', (tableWidth + 2) + 'px');
-        if(tableWidth > blockWidthNew){
-            j$('div#in_Div').css('width', blockWidthNew + 'px'); // 20230519 ljh 
-            j$('div#out_Div').css('width', blockWidthNew + 'px'); // 20230519 ljh
+        console.log('tableWidth:'+tableWidth+'blockWidth:'+blockWidth);
+        if(tableWidth > blockWidth){
+            console.log('111');
+            j$('div#in_Div').css('width', blockWidth+ 'px'); // 20230519 ljh +20
+            j$('div#out_Div').css('width', blockWidth + 'px'); // 20230519 ljh 
+            j$('table#tableHeader').css('width', tableWidth + 'px'); // 20230725 ljh
+            j$('table#tableData').css('width', tableWidth + 'px'); // 20230725 ljh 
         }
         j$('div#in_Div').scroll(function() {
             j$('div#out_Div').scrollLeft(j$(this).scrollLeft());
@@ -407,6 +402,15 @@
         });
         j$('div#in_Div_L').scroll(function() {
             j$('div#in_Div').scrollTop(j$(this).scrollTop());
+        });
+
+        j$('body .pbBody table#tableHeader tr.headerRow td').each(function() {
+            var colClass = getColClassName(this);
+            if (colClass != 'col_Scroll') {
+                var temp = j$('body .pbBody table.list tr.headerRow td.' + colClass).width();
+                console.log('colClass'+temp);
+                listColClassWidthMap[colClass] = temp;
+            }
         });
        
     }
@@ -480,4 +484,4 @@
 </script>
         </apex:outputPanel>
     <!-- </apex:form> -->
-</apex:component>
+</apex:component>
\ No newline at end of file

--
Gitblit v1.9.1