123
chenjingwu
2024-04-11 673fd6648381bb301577ebde009eaf731138c197
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<apex:page showHeader="false" sidebar="false" id="ImprovedForecastTimeApp" title="预测日期改变">
    <apex:includeLightning />
    <div style="width:100%;height:100%;" id="ImprovedForecastTimeApp" />
 
    <script>
        $Lightning.use("c:ImprovedForecastTimeAura", function () {
            $Lightning.createComponent("c:ImprovedForecastTime",
                {
                    "recordId": getParam('id')
                },
                "ImprovedForecastTimeAura",
                function (cmp) {
                    console.log('Component created, do something cool here');
                });
        });
 
        var interval = setInterval(()=>{
            var hrefStr = window.location.href;
            if (hrefStr.indexOf("Refresh") != -1) {
                var arr = hrefStr.split("==");
                window.opener.parent.location.href = "/"+arr[1];
                top.window.close();
                clearInterval(interval);
            }
        },1000);
        function getParam(paramName) {
        paramValue = "", isFound = !1;
        if (this.location.search.indexOf("?") == 0 && this.location.search.indexOf("=") > 1) {
            arrSource = decodeURI(this.location.search).substring(1, this.location.search.length).split("&"), i = 0;
            while (i < arrSource.length && !isFound) arrSource[i].indexOf("=") > 0 && arrSource[i].split("=")[0].toLowerCase() == paramName.toLowerCase() && (paramValue = arrSource[i].split("=")[1], isFound = !0), i++
                }
        return paramValue == "" && (paramValue = null), paramValue;
        }
    </script>
 
</apex:page>