From b51b57a619d3f0075ccaa13303c99c9e849bf23a Mon Sep 17 00:00:00 2001
From: chenjingwu <chenjingwu@prec-tech.com>
Date: 星期二, 23 四月 2024 18:13:54 +0800
Subject: [PATCH] 123

---
 force-app/main/default/pages/InventoryIframe.page |   82 ++++++++++++++++++++++++++++++-----------
 1 files changed, 60 insertions(+), 22 deletions(-)

diff --git a/force-app/main/default/pages/InventoryIframe.page b/force-app/main/default/pages/InventoryIframe.page
index e002315..b49acb4 100644
--- a/force-app/main/default/pages/InventoryIframe.page
+++ b/force-app/main/default/pages/InventoryIframe.page
@@ -1,4 +1,4 @@
-<apex:page lightningStylesheets="true">
+<apex:page lightningStylesheets="true" title="鐩樼偣鐩稿叧">
 <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
 <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
 <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
@@ -7,44 +7,82 @@
             flex: 2;
             padding: 20px;
         }
+        .highlight {
+        background-color: yellow;
+        /* 娣诲姞浠讳綍鍏朵粬绐佸嚭鏄剧ず鏍峰紡 */
+    }
+   
+
+    .you-button {
+            background-color: #d9d8d8 !important; 
+            box-shadow: 0px 7px 2px 0px #aeacac !important;
+            transition: all .5s !important;
+            }
+
+            /* .you-button:hover {
+                background-color: #fcdc5e !important;
+            } */
+
+        .you-button:active {
+            transform: translate(0,4px) !important;
+            text-shadow: -2px 2px 2px rgb(209 132 0),
+                    -2px 2px 2px rgb(209 132 0),
+                    -2px 2px 2px rgb(209 132 0),
+                    -2px 2px 2px rgb(209 132 0),
+                    -2px 2px 2px rgb(209 132 0),
+                    -2px 2px 2px rgb(209 132 0) !important;
+            box-shadow: 0px 1px 0px 0px #aeacac !important;
+        }
+
     </style>
 <apex:form >
     <apex:actionFunction action="{!loadPage}" name="cancel" rerender="allForm" oncomplete="unblockUI();"/>
     <div class="vf-container">
         <div style="width:9%;float:left;">
             <div>
-                <apex:commandButton style="width: 99%" value="鐩樼偣" onclick="loadPage('/apex/InventoryResultRecord'); return false"/>
+                <apex:commandButton styleClass="my-button you-button" style="width: 99%" value="鐩樼偣" onclick="loadPage('/apex/InventoryResultRecord'); return false"/>
             </div>
-            <div>
-                <apex:commandButton style="width: 99%" value="澶囧搧鐩樼偣鎶ュ憡" onclick="loadPage('/apex/InventoryReport'); return false"/>
+            <div style="margin-top:10px;">
+                <apex:commandButton styleClass="my-button" style="width: 99%" value="澶囧搧鐩樼偣鎶ュ憡" onclick="loadPage('/apex/InventoryReport'); return false"/>
             </div>
-            <div>
-                <apex:commandButton style="width: 99%" value="鑰楁潗鐩樼偣鎶ュ憡" onclick="loadPage('/apex/InventoryReport?isConsum=true'); return false"/> 
+            <div style="margin-top:10px;">
+                <apex:commandButton styleClass="my-button" style="width: 99%" value="鑰楁潗鐩樼偣鎶ュ憡" onclick="loadPage('/apex/InventoryReport?isConsum=true'); return false"/> 
             </div>
-            <div>
-                <apex:commandButton style="width: 99%" value="鐩樼偣琛ㄥご" onclick="location.href = '/a3H/o'; return false"/> 
+            <div style="margin-top:10px;">
+                <apex:commandButton styleClass="my-button" style="width: 99%" value="娓╂箍搴︾洏鐐�" onclick="loadPage('/apex/InventoryTemperatureHumidity'); return false"/> 
+            </div>
+            <div style="margin-top:10px;">
+                <apex:commandButton styleClass="my-button" style="width: 99%" value="鐩樼偣琛ㄥご" onclick="window.open('/lightning/o/Inventory_Header__c/list?filterName=Recent'); return false"/> 
             </div>
         </div>
-        <div style="width:91%;float:right;" id="vf-content">
+        <!-- <div style="width:90%;float:right;margin-left:5px;" id="vf-content"> -->
             <!-- VF 椤甸潰鍐呭灏嗗湪姝ゅ鏄剧ず -->
-        </div>
+        <!-- </div> -->
+        <iframe src="/apex/InventoryResultRecord" id="iframepage" width="90%" style="margin-left:3px;" scrolling="auto" onload="changeFrameHeight()" frameborder="0"></iframe>
     </div>
 </apex:form>
     
 
     <script>
-        function loadPage(pageUrl) {
-
-            var vfContent = "<iframe src='" + pageUrl + "' style='width: 100%; height: 1000px; border: none;'></iframe>";
-            document.getElementById("vf-content").innerHTML = vfContent;
-            
+        function changeFrameHeight(){
+            var ifm= document.getElementById("iframepage");
+            ifm.height=document.documentElement.clientHeight-30;
         }
-
-        window.addEventListener('load', function () {
-            blockme();
-            var vfContent = "<iframe src='/apex/InventoryResultRecord' style='width: 100%; height: 1000px; border: none;'></iframe>";
-            document.getElementById("vf-content").innerHTML = vfContent;
-            unblockUI();
-        });
+        window.onresize=function(){
+            changeFrameHeight();
+        }
+        function loadPage(pageUrl) {
+            var buttons = document.getElementsByClassName("my-button");
+            console.log(buttons);
+            for (let i = 0; i < buttons.length; i++) {
+                // buttons[i].style.backgroundColor = "white";
+                buttons[i].classList.remove('you-button');
+            }
+            var clickedButton = event.target || event.srcElement; // 鑾峰彇琚偣鍑荤殑鎸夐挳
+            // clickedButton.style.backgroundColor = "silver"; // 娣诲姞绐佸嚭鏄剧ず鐨勮儗鏅鑹�
+            clickedButton.classList.add('you-button');
+            // 娣诲姞鍏朵粬绐佸嚭鏄剧ず鏍峰紡
+            document.getElementById("iframepage").src = pageUrl;   
+        }
     </script>
 </apex:page>
\ No newline at end of file

--
Gitblit v1.9.1