| | |
| | | <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(); |
| | |
| | | } |
| | | 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(); |
| | | } |
| | |
| | | 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> |
| | |
| | | <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> |
| | | |
| | |
| | | </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> |