From 5c01ebbfddb6b8674430b47c22977bea2e350084 Mon Sep 17 00:00:00 2001
From: Li Jun <buli@deloitte.com.cn>
Date: 星期三, 13 四月 2022 10:58:46 +0800
Subject: [PATCH] BackupPIPLFunction0413

---
 force-app/main/default/pages/CM_SearchContactService.page |   75 +++++++++++++++++++++++++++----------
 1 files changed, 54 insertions(+), 21 deletions(-)

diff --git a/force-app/main/default/pages/CM_SearchContactService.page b/force-app/main/default/pages/CM_SearchContactService.page
index b902684..6f99f37 100644
--- a/force-app/main/default/pages/CM_SearchContactService.page
+++ b/force-app/main/default/pages/CM_SearchContactService.page
@@ -6,6 +6,16 @@
     <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
     <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
     <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
+    <style>
+        .decrypt{position: absolute;
+        		top: 0;
+        		left: 100%;
+        		display: none;
+        		text-align: left;
+    			padding-left: 5px;
+        }
+		a:hover .decrypt{display: block;width: 150px}
+    </style>
     <script type="text/javascript">
 
         // 2022/02/15 寮犲崕寤� 鏀归�燩I start
@@ -16,6 +26,18 @@
         var now_edit_id = '';
         var aws_result = {};
         searchContactAll();
+    	function Foo(){
+        	j$('[aws-id]').each(function(i,e){
+                let awsDataId = j$(e).attr('aws-id');
+                if (contact.hasOwnProperty(awsDataId)) {
+                    let piInformation = '濮撳悕:'+contact[awsDataId].lastName +'<br/>' +'鎵嬫満鍙�:'+ (contact[awsDataId].mobilePhone ? contact[awsDataId].mobilePhone :'');
+            	    j$(e).find('.decrypt').html(piInformation);
+                }else{
+                    console.log(awsDataId+' not in contact');
+                }
+                
+            });
+        }
 
         function preparePayloadForSearchContact(){
             let searchPayload = new Object();
@@ -34,11 +56,12 @@
                 for(var i=0;i<contacts.length;i++){
                     let temp = {}
                     temp.lastName = contacts[i].lastName;
-                    temp.phone = contacts[i].phone;
+                    temp.mobilePhone = contacts[i].mobilePhone;
 
                     contact[contacts[i].dataId] = temp;
                 }
                 console.log(JSON.stringify(contact));
+                Foo();
             };
             AWSService.search(staticResources.searchUrl,data,searchCallBack,staticResources.token);
         }
@@ -112,25 +135,29 @@
             window.close();
         }
 
-        function showPIDiv(awsDataId){
-            console.log('awsDataId Value:'+awsDataId);
-            let parentNode = document.getElementById(awsDataId);
-            let createDiv = document.createElement("div");  
-            createDiv.id = awsDataId+"_PI";  
-            let piInformation = 'Name:'+contact[awsDataId].lastName +'\n' +'Phone:'+contact[awsDataId].phone
-            //let piInformation = 'Name:'+contact['943114607025717249'].lastName +'\n' +'Phone:'+contact['943114607025717249'].phone
-            createDiv.innerText = piInformation;
-            let x=window.event.x;
-            let y=window.event.y; 
-            createDiv.style.left=x;  
-            createDiv.style.top=y;  
-            createDiv.style.background="#dddddd";
-            createDiv.style.position = "absolute";
-            parentNode.appendChild(createDiv);  
+        function showPIDiv(dataId,awsDataId){
+            // console.log('awsDataId Value:'+awsDataId);
+            // let parentNode = document.getElementById(awsDataId);
+            // let createDiv = document.createElement("div");  
+            // createDiv.id = awsDataId+"_PI";  
+            // let piInformation = 'Name:'+contact[awsDataId].lastName +'\n' +'Phone:'+contact[awsDataId].phone
+            // //let piInformation = 'Name:'+contact['943114607025717249'].lastName +'\n' +'Phone:'+contact['943114607025717249'].phone
+            // createDiv.innerText = piInformation;
+            // let x=window.event.x;
+            // let y=window.event.y; 
+            // createDiv.style.left=x;  
+            // createDiv.style.top=y;  
+            // createDiv.style.background="#dddddd";
+            // createDiv.style.position = "absolute";
+            // parentNode.appendChild(createDiv);  
+            console.log('dataId:'+dataId+'awsDataId Value:'+awsDataId);
+            let piInformation = '濮撳悕:'+contact[awsDataId].lastName +'\n' +'鐢佃瘽:'+ (contact[awsDataId].mobilePhone?contact[awsDataId].mobilePhone:'');
+            document.getElementById(dataId+'_'+awsDataId).innerText = piInformation;
         }
 
-        function hidePIDiv(awsDataId){
-            document.getElementById(awsDataId+'_PI').remove();
+        function hidePIDiv(dataId,awsDataId){
+            // document.getElementById(awsDataId+'_PI').remove();
+            document.getElementById(dataId+'_'+awsDataId).innerText = '';
         }
 
         // 2022骞�2鏈�15鏃� PI鏀归�� 寰愪寒 start
@@ -206,7 +233,7 @@
     </script>
 
     <apex:form id="allForm">
-        <apex:actionFunction name="searchContact" action="{!searchContact}" rerender="allForm,allPanel" onComplete="unblockUI();">
+        <apex:actionFunction name="searchContact" action="{!searchContact}" rerender="allForm,allPanel" onComplete="unblockUI();Foo()">
             <apex:param name="awsDataIdArray" assignTo="{!awsDataIdArray}" value="" />
         </apex:actionFunction>
         <apex:actionFunction name="editContact" action="{!editContact}" rerender="allForm,allPanel" onComplete="assignUnencrypted();">
@@ -247,7 +274,7 @@
                 <table class="edittable" border="0" style="border-collapse: collapse;width:580px;table-layout:fixed;">
                     <colgroup>
                         <col width="50px" />
-                        <col width="100px" />
+                        <col width="200px" />
                         <col width="380px" />
                         <col width="50px" />
                     </colgroup>
@@ -270,7 +297,13 @@
                         </td>
                         <!-- <td><a href="#" onclick="setContact('{!lineinfo.lineNo}');" id="943114607025717249" onmouseover="showPIDiv('943114607025717249')" onmouseout="hidePIDiv('943114607025717249')">{!lineinfo.con.Name}</a></td> -->
                         <!-- 2022/02/15 寮犲崕寤� 瑙e瘑淇℃伅 start -->
-                        <td><a href="#" onclick="setContact('{!lineinfo.lineNo}','{!lineinfo.con.AWS_Data_Id__c}');" id="{!lineinfo.con.AWS_Data_Id__c}" onmouseover="showPIDiv('{!lineinfo.con.AWS_Data_Id__c}')" onmouseout="hidePIDiv('{!lineinfo.con.AWS_Data_Id__c}')">{!lineinfo.con.Name}</a></td>
+                        <td>
+                            <a target="_blank" onclick="setContact('{!lineinfo.lineNo}','{!lineinfo.con.AWS_Data_Id__c}');" aws-id="{!lineinfo.con.AWS_Data_Id__c}" style="position:relative">
+                                <span class="encrypt">{!lineinfo.con.Name}</span>
+                                <span class="decrypt"></span>
+                            </a>
+                            
+                        </td>
                         <!-- 2022/02/15 寮犲崕寤� 瑙e瘑淇℃伅 end -->
                         <td>{!lineinfo.con.AccountName__c}</td>
                         <td><input style="width:90%;" type="button" value="缂栬緫" onclick="editContactJs('{!lineinfo.con.Id}'); return null;" /></td>

--
Gitblit v1.9.1