buli
2022-05-09 0953b3b5fcf19c627c6479a6b86648df653c40db
force-app/main/default/pages/QuoteExcelImport.page
@@ -1,4 +1,4 @@
<apex:page standardController="Quote" id="page11" showHeader="false" sidebar="false" pageStyle="Quote" >
<apex:page standardController="Quote" showHeader="false" sidebar="false" pageStyle="Quote" >
    <script type="text/javascript">
        function closeMe() {
            top.window.close();
@@ -10,23 +10,10 @@
            top.window.close();
        }
      function setCB() {
            var userAgent = navigator.userAgent;
            var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1;
            var isEdge = userAgent.indexOf("Edge") > -1 && !isIE;
            var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1;
            if (isIE|| isIE11 ){
          //txt = document.forms['{!$Component.mainForm}']['{!$Component.mainForm.page1.exceltext}'].value;
          txt = window.clipboardData.getData("text");
          document.forms['{!$Component.mainForm}']['{!$Component.mainForm.page1.exceltext}'].value = txt;
            }else{
                try{
                    navigator.clipboard.readText().then(function(text){
                        document.getElementById('page11:mainForm:page1:exceltext').value =text ;
                    });
                }catch(err){
                    alert('粘贴失败!');
                }
            }
        }
      }
    </script>
    <apex:form id="mainForm">
        <apex:pageBlock id="page1">
@@ -37,7 +24,7 @@
                </tr>
                <tr>
                    <td colspan="2"><apex:outputLabel value="{!$Label.Tab_Text}"/></td>
                    <td><apex:commandButton onclick="setCB();return false;" style="width:100px" value="{!$Label.Paste_IE}" /></td>
                    <td>&nbsp;<!-- <apex:commandButton onclick="setCB()" style="width:100px" value="{!$Label.Paste_IE}" /> --></td>
                </tr>
                <tr>
                    <td colspan="3"><apex:inputTextarea style="width:350px;height:100px" id="exceltext"/></td>