123
chenjingwu
2024-04-12 032b9eb2ee198505c7cd2ec546b0a001ba52ab4e
force-app/main/default/lwc/lexOCSMToReport/lexOCSMToReport.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-04-07 09:02:03
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-11 13:53:04
 * @LastEditTime: 2023-10-10 17:37:58
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -14,6 +14,8 @@
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import LightningConfirm from 'lightning/confirm';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexOCSMToReport extends LightningElement {
    @api recordId;
    IsLoading = true;
@@ -73,6 +75,9 @@
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        console.log(this.recordId);
        init({
            recordId: this.recordId
@@ -92,13 +97,22 @@
    showToast(msg,type) {
        const event = new ShowToastEvent({
            title: ' ',
            message: msg,
            variant: type,
            mode: 'sticky'
        });
        this.dispatchEvent(event);
        if(type == 'success'){
            const event = new ShowToastEvent({
                message: msg,
                variant: type,
            });
            this.dispatchEvent(event);
            this.dispatchEvent(new CloseActionScreenEvent());
        }else{
            const event = new ShowToastEvent({
                message: msg,
                variant: type,
                mode: 'sticky'
            });
            this.dispatchEvent(event);
            this.dispatchEvent(new CloseActionScreenEvent());
        }
    }