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/SearchMemberPage.page | 152 +++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 142 insertions(+), 10 deletions(-)
diff --git a/force-app/main/default/pages/SearchMemberPage.page b/force-app/main/default/pages/SearchMemberPage.page
index 4767d57..447e4d6 100644
--- a/force-app/main/default/pages/SearchMemberPage.page
+++ b/force-app/main/default/pages/SearchMemberPage.page
@@ -4,15 +4,132 @@
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
<apex:includeScript value="{!URLFOR($Resource.connection20)}"/>
<apex:includeScript value="{!URLFOR($Resource.apex20)}"/>
+ <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" />
<style type="text/css">
-
+ td{line-height: 32px;}
+ [aws-api] {
+ position: relative;
+ }
+ [aws-api] .decrypt{
+ position: absolute;
+ top: 50%;left: 0;
+ display: none;
+ text-align: left;
+ /* padding-left: 5px; */
+ }
+ /* [aws-api]:hover .decrypt{display: block;width: 100px} */
</style>
<script>
+ AWSService.sfSessionId = '{!GETSESSIONID()}';
+ var staticResource = JSON.parse('{!staticResource}');
+
+ var aws_data = {};
+
+ //zhj 2022-04-22 PIPL start
+ //js hover
+ function jsHover(){
+ var encrypts = document.getElementsByClassName('encrypt');
+ for(var i = 0;i<encrypts.length;i++){
+ encrypts[i].onmouseover = (function close(j) {
+ return function () {
+ //鏄剧ずName
+ encrypts[j].children[1].children[0].innerText = encrypts[j].children[1].children[1].innerText
+ //鏄剧ずEmail
+ encrypts[j].children[2].children[0].innerText = encrypts[j].children[2].children[1].innerText
+ }
+ })(i);
+ }
+ }
+ //zhj 2022-04-22 PIPL end
+
+ function Decrypt(r,dataIds,callback){
+ if (!(dataIds && dataIds.length)) {
+ if(callback)callback();
+ return;
+ }
+
+ let Foo = function(){
+ for (const id of dataIds) {
+ if (aws_data.hasOwnProperty(id)) {
+ let d = aws_data[id];
+ let $e =j$("[aws-id='"+d.dataId+ "']");
+ $e.each((i,e)=>{
+ j$(e).find(".decrypt").html(d[j$(e).attr("aws-api")]);
+ })
+
+ }
+ }
+ if(callback)callback();
+ jsHover();
+ }
+ let ids = [];
+ for (const id of dataIds) {
+ if (!aws_data.hasOwnProperty(id)) {
+ ids.push(id);
+ }
+ }
+ if (ids.length > 0) {
+
+ AWSService.search(r.searchUrl,JSON.stringify({
+ "dataIds":ids
+ }),function(data){
+
+ if(data.object && data.object.length > 0){
+
+ for(let d of data.object){
+ if(d.dataId){
+ aws_data[d.dataId] = d;
+ }
+ }
+ Foo();
+ }else{
+ if(callback)callback();
+ }
+ },r.token);
+ }else{
+ Foo();
+ }
+ }
+
+ function DecryptAll(callback){
+ let dataIds = [];
+ j$('[aws-id][aws-obj="Contact"]').each((i,e)=>{
+ let v = j$(e).attr('aws-id');
+ if (v) {
+ dataIds.push(v);
+ }
+ });
+ Decrypt(staticResource,dataIds,callback);
+ }
+
+ j$(function(){
+ //DecryptAll();
+
+ })
+
function doSearchJS(){
blockme();
var searchByName = j$(escapeVfId("searchByName")).value();
var searchByAccount = j$(escapeVfId("searchByAccount")).value();
- DoSearch(searchByName,searchByAccount);
+ var searchByAWSDataIds = j$(escapeVfId("searchByAWSDataIds")).value();
+ var memberType = j$(escapeVfId('Page:allData:memberType')).value();
+ if (memberType == "Contact" && searchByName) {
+ AWSService.search(staticResource.searchUrl,JSON.stringify({
+ contactName:searchByName
+ }),function(data){
+ if (data && data.object && data.object.length) {
+ let ids = data.object.map(m=>m.dataId);
+ DoSearch(searchByName,searchByAccount,ids.join(','));
+ }else{
+ unblockUI();
+ }
+
+ },staticResource.token);
+ }else{
+ DoSearch(searchByName,searchByAccount,[]);
+ }
+
+
}
function saveJS(){
blockme();
@@ -26,8 +143,8 @@
}
var lineNum = j$(escapeVfId("lineNum")).value();
var memberId = j$(escapeVfId("memberId")).value();
- var memberName = j$(escapeVfId("memberName")).value();
- var memberEmail = j$(escapeVfId("memberEmail")).value();
+ var memberName = aws_data[j$(escapeVfId("aws_data_id")).value()].lastName;
+ var memberEmail = aws_data[j$(escapeVfId("aws_data_id")).value()].email;
window.opener.refreshPage(lineNum,memberId,memberName,memberEmail);
window.close();
}
@@ -47,23 +164,28 @@
j$(escapeVfId("dataAccount")).attr("style","display:block");
}
}
+
+
+
</script>
<div style="width: 100%;height: 100%;">
<apex:outputPanel id="message1">
<apex:messages styleClass="editListError"/>
</apex:outputPanel>
<apex:form id="allData">
- <apex:actionFunction action="{!SearchMember}" name="DoSearch" reRender="result" oncomplete="unblockUI();">
+ <apex:actionFunction action="{!SearchMember}" name="DoSearch" reRender="result" oncomplete="DecryptAll(unblockUI);">
<apex:param assignTo="{!searchByName}" name="searchByName" value=""></apex:param>
<apex:param assignTo="{!searchByAccount}" name="searchByAccount" value=""></apex:param>
+ <apex:param assignTo="{!searchByAWSDataIds}" name="searchByAWSDataIds" value=""></apex:param>
</apex:actionFunction>
- <apex:actionFunction action="{!save}" name="save" reRender="allData,message1" oncomplete="unblockUI();refreshPage();closeJS();">
+ <apex:actionFunction action="{!save}" name="save" reRender="allData,message1" oncomplete="DecryptAll(()=>{unblockUI();refreshPage();closeJS();});">
</apex:actionFunction>
<input type="hidden" id="isError" value="{!isError}" />
<input type="hidden" id="lineNum" value="{!lineNum}" />
<input type="hidden" id="memberId" value="{!memberId}" />
<input type="hidden" id="memberName" value="{!memberName}" />
<input type="hidden" id="memberEmail" value="{!memberEmail}" />
+ <input type="hidden" id="aws_data_id" value="{!aws_data_id}" />
<table style="width: 100%;">
<colgroup>
@@ -83,7 +205,7 @@
<tr>
<th style="text-align:center;"><apex:commandButton value="Search" onclick="doSearchJS();return false;" /> <apex:commandButton value="Save" onclick="saveJS();return false;"/></th>
- <th id="nameLable" style="text-align:center;">Name锛�<input id="searchByName" type="text" value="{!searchByName}" /></th>
+ <th id="nameLable" style="text-align:center;"><input id="searchByAWSDataIds" type="hidden" value="{!searchByAWSDataIds}" /> Name锛�<input id="searchByName" type="text" value="{!searchByName}" /></th>
<th style="text-align:center;"><div id="accountLable">Account锛�<input id="searchByAccount" type="text" value="{!searchByAccount}" /></div></th>
@@ -117,12 +239,22 @@
</apex:outputPanel> -->
</tr>
<apex:repeat value="{!lineList}" var="line">
- <tr>
+ <tr class="encrypt">
<td style="text-align:right;">
<apex:inputCheckbox id="checkbox" value="{!line.check}" />
</td>
- <td><apex:outputText value="{!line.name}"></apex:outputText></td>
- <td><apex:outputText value="{!line.email}"></apex:outputText></td>
+ <td aws-obj="Contact" aws-api="lastName" aws-id="{!line.aws_data_id}">
+ <!-- 20220222 PI鏀归�� by Bright start -->
+ <span>{!line.name}</span>
+ <span class="decrypt"></span>
+ <!-- 20220222 PI鏀归�� by Bright end -->
+ </td>
+ <td aws-obj="Contact" aws-api="email" aws-id="{!line.aws_data_id}">
+ <!-- 20220222 PI鏀归�� by Bright start -->
+ <span>{!line.email}</span>
+ <span class="decrypt"></span>
+ <!-- 20220222 PI鏀归�� by Bright end -->
+ </td>
<td><apex:outputText value="{!line.account}"></apex:outputText></td>
</tr>
</apex:repeat>
--
Gitblit v1.9.1