From 1b8c8764c39fc546ca1b85ff1810ae51be74331c Mon Sep 17 00:00:00 2001
From: Li Jun <buli@deloitte.com.cn>
Date: 星期四, 31 三月 2022 18:39:23 +0800
Subject: [PATCH] PIPL0331V2Deploy
---
force-app/main/default/pages/ViewReportDecryptInfo.page | 58 ++++++++++++++++++++++++++++++++++++++++------------------
1 files changed, 40 insertions(+), 18 deletions(-)
diff --git a/force-app/main/default/pages/ViewReportDecryptInfo.page b/force-app/main/default/pages/ViewReportDecryptInfo.page
index fbcaf7a..b8a1ea6 100644
--- a/force-app/main/default/pages/ViewReportDecryptInfo.page
+++ b/force-app/main/default/pages/ViewReportDecryptInfo.page
@@ -1,37 +1,59 @@
<apex:page standardController="Report__c" extensions="NewAndEditReportController" id="page">
+ <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }"/>
<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="{!Report__c[encryptedAPI]}" />
+ <apex:repeat value="{!layoutEncryptedAPIList}" var="encryptedAPI">
+ <apex:outputField html-data-id="{!encryptedAPI}" title="{!ApiPrefix}{!encryptedAPI}" value="{!Report__c[encryptedAPI]}" />
</apex:repeat>
</apex:pageBlockSection>
<script>
var staticResources = JSON.parse('{!staticResource}');
+ var AWSToSobjectEncryptedMapJson = JSON.parse('{!AWSToSobjectEncryptedMapJson}');
+ var ApiPrefix = '{!ApiPrefix}';
function QueryLeadFromAWS() {
AWSService.query(staticResources.queryUrl, '{!AWSDataId}', queryBack, staticResources.token);
}
var queryBack = function queryBack(data) {
- document.querySelector("[data-id='VOC_Informer_Name__c']").innerHTML=data.object.vocInformerName!=null?data.object.vocInformerName.replace(/"/g,""):'';
- document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id1:1:j_id2']").innerHTML=data.object.callerPhone!=null?data.object.callerPhone.replace(/"/g,""):'';
- document.querySelector("[data-id='VOC_Informer_Contact__c']").innerHTML=data.object.vocInformerContact!=null?data.object.vocInformerContact.replace(/"/g,""):'';
- document.querySelector("[data-id='Person_In_Charge_Text__c']").innerHTML=data.object.personInChargeText!=null?data.object.personInChargeText.replace(/"/g,""):'';
- document.querySelector("[data-id='Professor_sigh_text__c']").innerHTML=data.object.professorSighText!=null?data.object.professorSighText.replace(/"/g,""):'';
- document.querySelector("[data-id='Staff_Info_Manual_c__c']").innerHTML=data.object.staffInfoManual!=null?data.object.staffInfoManual.replace(/"/g,""):'';
- document.querySelector("[data-id='Responsible_Person_HP_c__c']").innerHTML=data.object.responsiblePersonHP!=null?data.object.responsiblePersonHP.replace(/"/g,""):'';
- document.querySelector("[data-id='Practitioner1_Part__c']").innerHTML=data.object.practitioner1Part!=null?data.object.practitioner1Part.replace(/"/g,""):'';
- document.querySelector("[data-id='Practitioner2_Part__c']").innerHTML=data.object.practitioner2Part!=null?data.object.practitioner2Part.replace(/"/g,""):'';
- document.querySelector("[data-id='Practitioner3_Part__c']").innerHTML=data.object.practitioner3Part!=null?data.object.practitioner3Part.replace(/"/g,""):'';
- document.querySelector("[data-id='Practitioner4_Part__c']").innerHTML=data.object.practitioner4Part!=null?data.object.practitioner4Part.replace(/"/g,""):'';
- document.querySelector("[data-id='Practitioner5_Part__c']").innerHTML=data.object.practitioner5Part!=null?data.object.practitioner5Part.replace(/"/g,""):'';
- document.querySelector("[data-id='age__c']").innerHTML=data.object.age!=null?data.object.age.replace(/"/g,""):'';
- document.querySelector("[data-id='Medical_History__c']").innerHTML=data.object.medicalHistory!=null?data.object.medicalHistory.replace(/"/g,""):'';
- document.querySelector("[data-id='sex__c']").innerHTML=data.object.sex!=null?data.object.sex.replace(/"/g,""):'';
+ 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');
+ }
+
+ }
+ // document.querySelector("[data-id='VOC_Informer_Name__c']").innerText=data.object.vocInformerName
+ // document.querySelector("[id='page:form:pageBlock:pageBlockSection:j_id2:1:j_id3']").innerText=data.object.callerPhone
+ // document.querySelector("[data-id='VOC_Informer_Contact__c']").innerText=data.object.vocInformerContact
+ // document.querySelector("[data-id='Person_In_Charge_Text__c']").innerText=data.object.personInChargeText
+ // document.querySelector("[data-id='Professor_sigh_text__c']").innerText=data.object.professorSighText
+ // document.querySelector("[data-id='Staff_Info_Manual_c__c']").innerText=data.object.staffInfoManual
+ // document.querySelector("[data-id='Medical_History__c']").innerText = data.object.medicalHistory
+ // document.querySelector("[data-id='Responsible_Person_HP_c__c']").innerText=data.object.responsiblePersonHP
+ // document.querySelector("[data-id='Practitioner1_Part__c']").innerText=data.object.practitioner1Part
+ // document.getElementById('page:form:pageBlock:pageBlockSection:j_id2:8:j_id3').innerText=data.object.practitioner2Part
+ // document.getElementById('page:form:pageBlock:pageBlockSection:j_id2:9:j_id3').innerText=data.object.practitioner3Part
+ // document.getElementById('page:form:pageBlock:pageBlockSection:j_id2:10:j_id3').innerText=data.object.practitioner4Part
+ // document.getElementById('page:form:pageBlock:pageBlockSection:j_id2:11:j_id3').innerText=data.object.practitioner5Part
+ // document.querySelector("[data-id='age__c']").innerText=data.object.age
+ // document.querySelector("[data-id='sex__c']").innerText=data.object.sex
};
sfdcPage.appendToOnloadQueue(function () {
- console.log('awsDataId = '+'{!AWSDataId}')
QueryLeadFromAWS();
});
</script>
--
Gitblit v1.9.1