From 01f207d979d6be17c8cdec293feab48828c0ec3e Mon Sep 17 00:00:00 2001
From: 黄千龙 <huangqianlong@prec-tech.com>
Date: 星期五, 08 四月 2022 14:22:52 +0800
Subject: [PATCH] Merge branch 'master' of http://47.92.229.245:8089/r/OlyMEBG

---
 force-app/main/default/pages/ViewRentalApplyDecrypt.page |   37 +++++++++++++++++++++++++++++++++----
 1 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/force-app/main/default/pages/ViewRentalApplyDecrypt.page b/force-app/main/default/pages/ViewRentalApplyDecrypt.page
index bbb06d8..ea1dc27 100644
--- a/force-app/main/default/pages/ViewRentalApplyDecrypt.page
+++ b/force-app/main/default/pages/ViewRentalApplyDecrypt.page
@@ -2,7 +2,7 @@
   @description       : 
   @author            : ChangeMeIn@UserSettingsUnder.SFDoc
   @group             : 
-  @last modified on  : 03-17-2022
+  @last modified on  : 03-29-2022
   @last modified by  : ChangeMeIn@UserSettingsUnder.SFDoc
 -->
 <apex:page standardController="Rental_Apply__c" extensions="RentalApplyController" id="page">
@@ -10,20 +10,49 @@
     <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
     <apex:form id="form">
         <apex:pageblock id="pageBlock">
+            <!-- <apex:pageBlockSection showHeader="false" title="" collapsible="true" columns="2" id="pageBlockSection">
+                <!--Each section has layoutFields, let's iterate them as well-->
+                <!-- <apex:repeat value="{!encryptedAPIList}" var="encryptedAPI">
+                    <apex:outputField html-data-id="{!encryptedAPI}" value="{!Rental_Apply__c[encryptedAPI]}" />
+                </apex:repeat>
+            </apex:pageBlockSection> -->
+
             <apex:pageBlockSection showHeader="false" title="" collapsible="true" columns="2" id="pageBlockSection">
                 <!--Each section has layoutFields, let's iterate them as well-->
                 <apex:repeat value="{!encryptedAPIList}" var="encryptedAPI">
-                    <apex:outputField html-data-id="{!encryptedAPI}" value="{!Rental_Apply__c[encryptedAPI]}" />
+                    <apex:outputField html-data-id="{!encryptedAPI}" title="{!ApiPrefix}{!encryptedAPI}" value="{!Rental_Apply__c[encryptedAPI]}" />
                 </apex:repeat>
             </apex:pageBlockSection>
             <script>
                 var staticResources = JSON.parse('{!staticResource}');
+                var AWSToSobjectEncryptedMapJson = JSON.parse('{!AWSToSobjectEncryptedMapJson}');
+                var ApiPrefix = '{!ApiPrefix}';
                 function QueryConsumApplyFromAWS() {
                     AWSService.query(staticResources.queryUrl, '{!AWSDataId}', queryBack, staticResources.token);
                 }
                 var queryBack = function queryBack(data) {
-                    document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id2:1:j_id3']").innerHTML = data.object.phoneNumber;
-                    document.querySelector("[data-id='direct_shippment_address__c']").innerHTML = data.object.directShippmentAddress;
+                    // document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id2:0:j_id3']").innerText = data.object.phoneNumber;
+                    // document.querySelector("[data-id='direct_shippment_address__c']").innerText = data.object.directShippmentAddress;
+                    if(!data.object){
+                        console.log('data.object is ' + data.object);
+                        return;
+                    }
+                    for(let f in AWSToSobjectEncryptedMapJson){
+                        let t = "[title='"+ApiPrefix+AWSToSobjectEncryptedMapJson[f]+"']";
+                        let ele = document.querySelector(t);
+                        if(ele){
+                            ele.title = '';
+                            if(data.object.hasOwnProperty(f)){
+                                ele.innerHTML = data.object[f];
+                            }
+                            else{
+                                console.log(f + 'is not in data.object');
+                            }
+                        }else{
+                            console.log('selector='+t+' not found');
+                        }
+                        
+                    }
                 };
                 sfdcPage.appendToOnloadQueue(function () {
                     console.log('sfdcPage.appendToOnloadQueue');

--
Gitblit v1.9.1