From 01ce9b5788c4369c150e57577cc4ea03b4fc5ee1 Mon Sep 17 00:00:00 2001
From: chenjingwu <chenjingwu@prec-tech.com>
Date: 星期五, 19 四月 2024 17:28:49 +0800
Subject: [PATCH] 123

---
 force-app/main/default/lwc/lexSpecSubmit/lexSpecSubmit.js |   30 ++++++++++++++++++++++--------
 1 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/force-app/main/default/lwc/lexSpecSubmit/lexSpecSubmit.js b/force-app/main/default/lwc/lexSpecSubmit/lexSpecSubmit.js
index 72a5821..287722e 100644
--- a/force-app/main/default/lwc/lexSpecSubmit/lexSpecSubmit.js
+++ b/force-app/main/default/lwc/lexSpecSubmit/lexSpecSubmit.js
@@ -4,7 +4,7 @@
  * @Author: chen jing wu
  * @Date: 2023-06-06 15:41:32
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-09-01 09:33:28
+ * @LastEditTime: 2023-10-10 17:41:40
  */
 import { api, wire,LightningElement, track } from 'lwc';
 import { CurrentPageReference } from "lightning/navigation";
@@ -16,6 +16,8 @@
 import LightningConfirm from 'lightning/confirm';
 import STATUS_FIELD from "@salesforce/schema/OpportunitySpecialApply__c.Status__c";
 import { refreshApex } from '@salesforce/apex';
+import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
+import {loadStyle} from 'lightning/platformResourceLoader';
 export default class LexSpecSubmit extends LightningElement {
     @wire(getRecord, { recordId: '$recordId', fields: [STATUS_FIELD] })
     record;
@@ -40,13 +42,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());
+        }   
     }
 
 
@@ -55,6 +66,9 @@
     }
 
     connectedCallback(){
+        Promise.all([
+            loadStyle(this, lwcCSS)
+           ]);
         init({
             recordId: this.recordId
         }).then(result=>{

--
Gitblit v1.9.1