buli
2023-07-11 0c4796706fc9473d069b620321a54b20a119906c
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
37
38
/*
 * @Description: 
 * @version: 
 * @Author: chen jing wu
 * @Date: 2023-04-19 10:07:12
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-04-20 09:38:37
 */
import { LightningElement,wire } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import getIsOverLimit from '@salesforce/apex/lexXinSearchVisitorPlaceController.getIsOverLimit';
import getResults from '@salesforce/apex/lexXinSearchVisitorPlaceController.getResults';
import search from '@salesforce/apex/lexXinSearchVisitorPlaceController.search';
export default class LexXinSearchVisitorPlace extends LightningElement {
    IsOverLimit;
    results;
    @wire(CurrentPageReference) pageRef;
    getParamValue(param){
        return new URLSearchParams(this.pageRef.state.c_-param).get(param);
    }
 
    connectedCallback(){
        const queryParam = this.getParamValue('q');
        const reporterStateParam = this.getParamValue('r');
        console.log("start");
        search({
            query: queryParam,
            reporterState: reporterStateParam
        }).then(()=>{
            getIsOverLimit().then(result=>{
                this.IsOverLimit = result;
            });
            getResults().then(result=>{
                this.results = result;
            });
        });
    }
}