123
chenjingwu
2024-04-23 3affb8b01f55f90cc047d3048e4ec04aad249e9d
force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js
@@ -2,9 +2,9 @@
 * @Description: 
 * @version: 
 * @Author: chen jing wu
 * @Date: 2023-06-15 09:52:50
 * @Date: 2023-09-09 13:31:12
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-07-25 09:16:27
 * @LastEditTime: 2023-10-10 17:35:45
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -13,7 +13,8 @@
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { NavigationMixin } from 'lightning/navigation';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexNewAgencyHospital extends NavigationMixin(LightningElement) {
    @wire(CurrentPageReference)
    getStateParameters(currentPageReference) {
@@ -35,15 +36,27 @@
    }
    showToast(msg,type) {
        const event = new ShowToastEvent({
            title: '',
            message: msg,
            variant: type
        });
        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());
        }
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        var doubleFlg = false;
        if(!doubleFlg) {
        doubleFlg = true;
@@ -64,4 +77,4 @@
        });
        }
    }
}
}