From bdb1a98b64a2cf59bcfd575c579aa0742e0de954 Mon Sep 17 00:00:00 2001
From: chenjingwu <chenjingwu@prec-tech.com>
Date: 星期五, 24 五月 2024 17:21:32 +0800
Subject: [PATCH] 1

---
 force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js |   35 ++++++++++++++++++++++++-----------
 1 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js b/force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js
index 23ea464..c8b1eba 100644
--- a/force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js
+++ b/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 @@
         });
         }
     }
-}
+}
\ No newline at end of file

--
Gitblit v1.9.1