From 4420517bbbffea48cabe7a7dcdf2e1c4b440fc85 Mon Sep 17 00:00:00 2001
From: GWY <guweiyi@prec-tech.com>
Date: 星期一, 30 五月 2022 16:15:26 +0800
Subject: [PATCH] 两个LS特殊条件在说明的增减
---
force-app/main/default/pages/SWOPageRead.page | 207 ++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 187 insertions(+), 20 deletions(-)
diff --git a/force-app/main/default/pages/SWOPageRead.page b/force-app/main/default/pages/SWOPageRead.page
index 7af0053..3f64b56 100644
--- a/force-app/main/default/pages/SWOPageRead.page
+++ b/force-app/main/default/pages/SWOPageRead.page
@@ -8,13 +8,14 @@
<!-- Update 20220315 By Chen Yanan -->
<apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" />
<script>
- // 20220315 PI鏀归�� by Chen Yanan start
- var staticResources = JSON.parse('{!staticResource}');
+ // 20220313 PI鏀归�� by Chen Yanan start
+ AWSService.sfSessionId = '{!GETSESSIONID()}';
+ var staticResources = JSON.parse('{!staticResource}');
var contactstaticResource = JSON.parse('{!contactstaticResource}');
var aws_data = {};
- console.log('AWS' + {!contactAWSDataId});
+ console.log('AWS' + '{!contactAWSDataId}');
- function Decrypt(r,dataIds,callback){
+ function Decrypt1(r,dataIds,callback){
if (!(dataIds && dataIds.length)) {
if(callback)callback();
return;
@@ -27,6 +28,7 @@
let $e =j$("[aws-id='"+d.dataId+ "']");
$e.each((i,e)=>{
j$(e).html(d[j$(e).attr("aws-api")]);
+ //j$(e).attr('value',d[j$(e).attr("aws-api")])
})
}
@@ -73,8 +75,7 @@
dataIds1.push(v);
}
});
- Decrypt(contactstaticResource,dataIds1,callback);
-
+ Decrypt1(contactstaticResource,dataIds1,callback);
}
@@ -86,14 +87,14 @@
dataIds2.push(v);
}
});
- Decrypt(staticResources,dataIds2,callback);
+ Decrypt1(staticResources,dataIds2,callback);
}
j$(function(){
DecryptSWOAll();
DecryptAll();
})
- // 20220315 PI鏀归�� by Chen Yanan end
+ // 20220313 PI鏀归�� by Chen Yanan end
j$(document).ready(function() {
var type = j$(escapeVfId("type")).value();
@@ -342,7 +343,11 @@
<td></td>
<!-- 20220315 PI鏀归�� by Chen Yanan start -->
<!-- <td colspan="2"><apex:outputField value="{!swo.CONTACT_NAME_HIDDEN__c}"/></td> -->
- <td colspan="2" align="left" ><apex:outputField html-aws-obj="SWO__C" html-aws-api="contactName" html-aws-id="{!swo.CONTACT_NAME_HIDDEN__c}" id="CONTACT_NAME_HIDDEN__c" value="{!swo.CONTACT_NAME_HIDDEN__c}"/></td>
+ <!-- <td colspan="2" align="left" ><apex:outputField html-aws-obj="SWO__C" html-aws-api="contactName" html-aws-id="{!swo.CONTACT_NAME_HIDDEN__c}" id="CONTACT_NAME_HIDDEN__c" value="{!swo.CONTACT_NAME_HIDDEN__c}"/></td> -->
+ <td colspan="2" align="left" >
+ <apex:inputHidden id="AWS_Data_Id__c" value="{!swo.AWS_Data_Id__c}"/>
+ <apex:outputField html-aws-obj="SWO__c" html-aws-api="contactNameHidden" html-aws-id="{!swo.AWS_Data_Id__c}" id="CONTACT_NAME_HIDDEN__c" value="{!swo.CONTACT_NAME_HIDDEN__c}"/>
+ </td>
<!-- 20220315 PI鏀归�� by Chen Yanan End -->
</tr>
@@ -542,18 +547,18 @@
<td>INTERNAL ONLY</td>
</tr>
<apex:repeat value="{!mailList}" var="mail" id="lines">
- <tr class="row">
+ <tr class="row" id="{!mail.mm.AWS_Data_Id__c}" onmouseover="showPI('{!mail.mm.AWS_Data_Id__c}')">
<td><apex:outputLink value="/apex/SendEmail?id={!mail.mm.ID}&type=SWO&typeid={!swoid}&openType=View">View</apex:outputLink> <apex:outputLink value="/apex/SendEmail?id={!mail.mm.ID}&type=SWO&typeid={!swoid}&openType=Reply">Reply</apex:outputLink></td>
- <td><apex:outputField value="{!mail.mm.DATE__c}" /></td>
- <td><apex:outputField value="{!mail.mm.FROM__c}" /></td>
- <td><apex:outputField value="{!mail.mm.MESSAGE__c}" /></td>
- <td><apex:outputText value="{!mail.mm.EMAIL_SENT__c}" /></td>
- <td><apex:outputField value="{!mail.mm.toName__c}" /></td>
- <td><apex:outputField value="{!mail.mm.ccName__c}" /></td>
+ <td><apex:outputField value="{!mail.mm.DATE__c}"/></td>
+ <td id="{!mail.mm.AWS_Data_Id__c}_FROM"><apex:outputField value="{!mail.mm.FROM__c}" /></td>
+ <td><apex:outputField value="{!mail.mm.MESSAGE__c}"/></td>
+ <td><apex:outputText value="{!mail.mm.EMAIL_SENT__c}"/></td>
+ <td id="{!mail.mm.AWS_Data_Id__c}_toName"><apex:outputField value="{!mail.mm.toName__c}"/></td>
+ <td id="{!mail.mm.AWS_Data_Id__c}_ccName"><apex:outputField value="{!mail.mm.ccName__c}"/></td>
<td><apex:outputText value="{!mail.haveAtt}" /></td>
<td>
<apex:repeat value="{!mail.attList}" var="att" id="lines">
- <apex:outputLink value="/{!att.Id}"><c:PDFWbr targetStr="{!att.Name}" /></apex:outputLink>
+ <apex:outputLink value="/{!att.Id}"><c:PDFWbr targetStr="{!att.FileName__c}" /></apex:outputLink>
<br/>
</apex:repeat>
</td>
@@ -767,7 +772,8 @@
<!-- 20220315 PI鏀归�� by Chen Yanan start -->
<!-- <td><apex:outputField value="{!swo.CONTACT__c}" ></apex:outputField></td> -->
<td colspan="2" align="left" >
- <a href="/{!swo.CONTACT__c}" aws-obj="Contact" aws-api="lastName" aws-id="{!contactAWSDataId}">{!swo.CONTACT__r.Name}</a>
+ <!-- <a href="/{!swo.CONTACT__c}" aws-obj="Contact" aws-api="lastName" aws-id="{!contactAWSDataId}">{!swo.CONTACT__r.Name}</a> -->
+ <a href="/{!swo.CONTACT__c}" aws-obj="Contact" aws-api="lastName" aws-id="{!contactAWSDataId}">{!contactName}</a>
</td>
<!-- 20220315 PI鏀归�� by Chen Yanan End -->
<td><apex:outputField value="{!swo.TRAN__c}"/></td>
@@ -1448,9 +1454,9 @@
<apex:repeat id="attachmentList" value="{!attachmentList}" var="attachment">
<tr style="text-align:center; vertical-align: middle;">
<!-- <td><output value="{!attachment.Name}" readonly="readonly" style="border:none;"/></td> -->
- <td><apex:outputLink value="/{!attachment.Id}">{!attachment.Name}</apex:outputLink></td>
+ <td><apex:outputLink value="/{!attachment.Id}">{!attachment.FileName__c}</apex:outputLink></td>
<td><apex:outputField value="{!attachment.CreatedDate}"/></td>
- <td><apex:outputField value="{!attachment.BodyLength}"/></td>
+ <!-- <td><apex:outputField value="{!attachment.BodyLength}"/></td> -->
</tr>
</apex:repeat>
</table>
@@ -1828,6 +1834,167 @@
<br/>
<br/>
<apex:commandButton action="{!edit}" value="EDIT" style="width: 5%;"/>
+ <script>
+
+ function stringbuilder() {
+ this.arr = new Array();
+ this.append = function (str) {
+ this.arr.push(str);
+ }
+ this.tostring = function () {
+ return this.arr.join('');
+ }
+ }
+
+ function toJSONString(s) {
+ var sb = new stringbuilder()
+ for (var i = 0; i < s.length; i++) {
+ var c = s[i];
+
+ switch (c) {
+
+ case '\"':
+
+ sb.append("\\\"");
+
+ break;
+
+ case '\\':
+
+ sb.append("\\\\");
+
+ break;
+
+ case '/':
+
+ sb.append("\\/");
+
+ break;
+
+ case '\b':
+
+ sb.append("\\b");
+
+ break;
+
+ case '\f':
+
+ sb.append("\\f");
+
+ break;
+
+ case '\n':
+
+ sb.append("\\n");
+
+ break;
+
+ case '\r':
+
+ sb.append("\\r");
+
+ break;
+
+ case '\t':
+
+ sb.append("\\t");
+
+ break;
+
+ case '=':
+
+ sb.append("锛�");
+
+ break;
+
+ case '&':
+
+ sb.append("锛�");
+
+ break;
+
+ case '?':
+
+ sb.append("?");
+
+ break;
+
+ case '%':
+
+ sb.append("锛�");
+
+ break;
+
+ default:
+
+ if ((c >= 0 && c <= 31) || c == 127)//鍦ˋSC鈪$爜涓紝绗�0锝�31鍙峰強绗�127鍙�(鍏�33涓�)鏄帶鍒跺瓧绗︽垨閫氳涓撶敤瀛楃
+
+ {
+
+ }
+
+ else {
+
+ sb.append(c);
+
+ }
+
+ break;
+
+ }
+ }
+
+ return sb.tostring()
+ }
+ console.log('{!mailListStr}'.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\s+/g,"").replace("\"/g","\\\""))
+ var mailListObj = JSON.parse('{!mailListStr}'.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\s+/g,""))
+ var staticResourceMailMerge = JSON.parse('{!staticResourceMailMerge}')
+ var mailList = []
+ var PIDataObjList = {}
+
+
+ function showPI(awsId){
+ if(awsId){
+ document.getElementById(awsId).children[2].children[0].children[0].innerText = PIDataObjList[awsId].author
+ document.getElementById(awsId).children[5].children[0].innerText = PIDataObjList[awsId].premaryRecipient
+ document.getElementById(awsId).children[6].children[0].innerText = PIDataObjList[awsId].cc
+ }
+ }
+
+
+
+
+ for(var i=0;i<mailListObj.length;i++){
+ mailList.push(mailListObj[i].mm.AWS_Data_Id__c)
+ }
+ var queryBack = function queryBack(data){
+ console.log(data)
+ if (data.object) {
+ for (var i=0;i<data.object.length;i++) {
+ // var PIDataObj = {};
+ // var d = {};
+ // PIDataObj.author = data.object[i].author
+ // PIDataObj.premaryRecipient = data.object[i].premaryRecipient
+ // PIDataObj.cc = data.object[i].cc
+ // d[data.object[i].dataId] = PIDataObj
+ // PIDataObjList.push(d)
+ var PIDataObj = {};
+ PIDataObj.author = data.object[i].author
+ PIDataObj.premaryRecipient = data.object[i].premaryRecipient
+ PIDataObj.cc = data.object[i].cc
+ PIDataObjList[data.object[i].dataId] = PIDataObj;
+ }
+ }
+ unblockUI();
+ };
+ document.body.onload = function(){
+ blockme();
+ console.log('appendToOnloadQueue');
+ let searchPayload = new Object();
+ searchPayload.dataIds = mailList;
+ AWSService.search(staticResourceMailMerge.searchUrl,JSON.stringify(searchPayload),queryBack,staticResourceMailMerge.token);
+ }
+ </script>
</apex:form>
--
Gitblit v1.9.1