From 3affb8b01f55f90cc047d3048e4ec04aad249e9d Mon Sep 17 00:00:00 2001
From: chenjingwu <chenjingwu@prec-tech.com>
Date: 星期二, 23 四月 2024 09:56:47 +0800
Subject: [PATCH] 123

---
 force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js |   37 +++++++++++++++++++++++++++++--------
 1 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js b/force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js
index a5bfcfb..c8b1eba 100644
--- a/force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js
+++ b/force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js
@@ -1,3 +1,11 @@
+/*
+ * @Description: 
+ * @version: 
+ * @Author: chen jing wu
+ * @Date: 2023-09-09 13:31:12
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-10-10 17:35:45
+ */
 import { api, wire,LightningElement } from 'lwc';
 import { CurrentPageReference } from "lightning/navigation";
 import { CloseActionScreenEvent } from 'lightning/actions';
@@ -5,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) {
@@ -27,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;

--
Gitblit v1.9.1