| | |
| | | <apex:page id="page" controller="ReportExportClass"> |
| | | <apex:page id="page" controller="RentalReportExportController" lightningStylesheets="true"> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}" /> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}" /> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}" /> |
| | |
| | | <script> |
| | | // sforce.connection.sessionId = '{!GETSESSIONID()}'; |
| | | var awsList = []; |
| | | var staticResources = JSON.parse('{!staticResource}'); |
| | | var fieldSize = '{!fieldSize}'; |
| | | var staticResources = JSON.parse('{!staticResourceContact}'); |
| | | |
| | | function remove() { |
| | | |
| | | window.onload = function isVisibility() { |
| | | var reportAll = document.getElementById('exportAllData'); |
| | | var isContactAll = {!isContactAll}; |
| | | if(isContactAll){ |
| | | reportAll.classList.remove("hideshow") |
| | | } |
| | | } |
| | | |
| | | function getPIPayload() { |
| | |
| | | dict['value'] = valuesField.value; |
| | | } |
| | | } |
| | | console.log('size: ' + fieldSize); |
| | | console.log(dict); |
| | | awsList.push(dict); |
| | | |
| | | |
| | | // for (let index = 0; index < fieldsInputList.length; index++) { |
| | | // let dict = {}; |
| | | // let namesField = document.getElementById("page:form:repeatBlock:repeat:"+index+":chooseField"); |
| | | // let optionsField = document.getElementById("page:form:repeatBlock:repeat:"+index+":chooseOperation"); |
| | | // let valuesField = document.getElementById("page:form:repeatBlock:repeat:"+index+":inputText"); |
| | | // if (namesField) { |
| | | // dict['name'] = namesField.value.toLowerCase(); |
| | | // } |
| | | // if (optionsField) { |
| | | // dict['operator'] = optionsField.value; |
| | | // } |
| | | // if (valuesField) { |
| | | // dict['value'] = valuesField.value; |
| | | // } |
| | | // console.log(dict); |
| | | // } |
| | | return JSON.stringify(awsList); |
| | | } |
| | | |
| | | function exportsAllData(){ |
| | | |
| | | let requestAllSearchPayload = []; |
| | | console.log('requestSearchPayload ' + requestAllSearchPayload); |
| | | let queryBackContactName = function queryBackContactName(result){ |
| | |
| | | var blob = new Blob(["\ufeff", result]); |
| | | var link = document.createElement('a'); |
| | | link.href = window.URL.createObjectURL(blob); |
| | | // let csvContent = "data:text/csv;charset=utf-8,\ufeff" |
| | | // +result; |
| | | // let encodedUri = encodeURI(csvContent); |
| | | // let link = document.createElement("a"); |
| | | // link.setAttribute("href", encodedUri); |
| | | link.setAttribute("download", "contactAll.csv"); |
| | | document.body.appendChild(link); // Required for FF |
| | | document.body.appendChild(link); |
| | | unblockUI(); |
| | | |
| | | link.click(); // This will download the data file named "my_data.csv". |
| | | link.click(); |
| | | }; |
| | | blockme(); |
| | | AWSService.search(staticResources.reportUrl,requestAllSearchPayload,queryBackContactName,staticResources.token); |
| | |
| | | var blob = new Blob(["\ufeff", result]); |
| | | var link = document.createElement('a'); |
| | | link.href = window.URL.createObjectURL(blob); |
| | | // let csvContent = "data:text/csv;charset=utf-8,\ufeff" |
| | | // +result; |
| | | // let encodedUri = encodeURI(csvContent); |
| | | // let link = document.createElement("a"); |
| | | // link.setAttribute("href", encodedUri); |
| | | link.setAttribute("download", "contact.csv"); |
| | | document.body.appendChild(link); // Required for FF |
| | | document.body.appendChild(link); |
| | | unblockUI(); |
| | | |
| | | link.click(); // This will download the data file named "my_data.csv". |
| | | link.click(); |
| | | }; |
| | | blockme(); |
| | | AWSService.search(staticResources.reportUrl,requestSearchPayload,queryBackContactName,staticResources.token); |
| | |
| | | 报表对象: |
| | | <br/> |
| | | <apex:selectList id="chooseObject" value="{!selectedObject}" size="1"> |
| | | <apex:selectOptions value="{!objectOptions}"/> |
| | | <apex:selectOptions value="{!contactOptions}"/> |
| | | </apex:selectList> |
| | | <apex:pageBlock id="repeatBlock"> |
| | | <apex:repeat id="repeat" value="{!fieldInputList}" var="fieldInput"> |
| | | <!-- <apex:selectOption value = "{!filedOptions}"/> --> |
| | | <apex:selectList id="chooseField" value="{!fieldInput.fieldAPI}" size="1"> |
| | | <apex:selectOptions value="{!filedOptions}"/> |
| | | </apex:selectList> |
| | | <!-- <apex:selectOption value = "{!operationSelectOptions}"/> --> |
| | | <apex:selectList id="chooseOperation" value="{!fieldInput.operation}" size="1"> |
| | | <!-- <apex:selectOptions value="{!operationSelectOptions}"/> --> |
| | | <apex:selectOptions value="{!operationSelectOptions}"/> |
| | | </apex:selectList> |
| | | <apex:inputTextarea id="inputText" value="{!fieldInput.value}" rows="20" cols="35" /> |
| | | <!-- - + --> |
| | | <br /> |
| | | </apex:repeat> |
| | | <!-- <apex:commandButton id="addFilter" value="添加筛选器" action="{!addFilter}" reRender="repeatBlock" /> |
| | | <apex:commandButton id="removeFilter" value="删除筛选器" action="{!removeFilter}" reRender="repeatBlock" /> --> |
| | | </apex:pageBlock> |
| | | <input class="btn" type="Button" id="exportData" value="导出" onclick="exportsData()" /> |
| | | <input class="btn" type="Button" id="exportData" value="导出全部数据" onclick="exportsAllData()" /> |
| | | <input class="btn hideshow " type="Button" id="exportAllData" value="导出全部数据" onclick="exportsAllData()" /> |
| | | </apex:form> |
| | | </body> |
| | | </apex:page> |