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