/* * @Description: * @version: * @Author: chen jing wu * @Date: 2023-09-12 15:42:24 * @LastEditors: chen jing wu * @LastEditTime: 2023-09-12 15:43:23 */ import { LightningElement,api,wire } from 'lwc'; import { CloseActionScreenEvent } from "lightning/actions"; import { CurrentPageReference } from "lightning/navigation"; import Sample_OrderList_Report from "@salesforce/label/c.Sample_OrderList_Report"; import init from '@salesforce/apex/lexAccountController.init'; export default class LexSampleOrderListReport extends LightningElement { @api recordId; name; @wire(CurrentPageReference) getStateParameters(currentPageReference) { if (currentPageReference) { this.url = currentPageReference.state.backgroundContext; const urlValue = currentPageReference.state.recordId; if (urlValue) { let str = `${urlValue}`; this.recordId = str; } } } connectedCallback() { init({ recordId: this.recordId }).then(result=>{ this.name = result.name; window.open('/lightning/r/Report/' + Sample_OrderList_Report + '/view?fv0=' + this.name,'_blank'); this.closeAction(); }); } closeAction() { this.dispatchEvent(new CloseActionScreenEvent()); return; } }