From ac49e658cf9674065476431a5deb81a93d1bc25a Mon Sep 17 00:00:00 2001
From: 黄千龙 <huangqianlong@prec-tech.com>
Date: 星期三, 24 五月 2023 10:45:54 +0800
Subject: [PATCH] 0524LightningConfirm框修改

---
 force-app/main/default/lwc/lexOCSMToReportLighting/lexOCSMToReportLighting.js |   37 +++++++++++++++++++++++--------------
 1 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/force-app/main/default/lwc/lexOCSMToReportLighting/lexOCSMToReportLighting.js b/force-app/main/default/lwc/lexOCSMToReportLighting/lexOCSMToReportLighting.js
index fe89267..87b1ad1 100644
--- a/force-app/main/default/lwc/lexOCSMToReportLighting/lexOCSMToReportLighting.js
+++ b/force-app/main/default/lwc/lexOCSMToReportLighting/lexOCSMToReportLighting.js
@@ -2,6 +2,7 @@
 import { CurrentPageReference } from "lightning/navigation";
 import { CloseActionScreenEvent } from 'lightning/actions';
 import { NavigationMixin } from 'lightning/navigation';
+import LightningConfirm from 'lightning/confirm';
 import { ShowToastEvent } from 'lightning/platformShowToastEvent';
 import init  from '@salesforce/apex/QISReportController.initForlexOCSMToReportLightingButton';
 import updateQis  from '@salesforce/apex/QISReportController.updateQisForlexOCSMToReportLighting';
@@ -38,22 +39,30 @@
                 this.OCSMAdministrativeReportStatus = result.oCSMAdministrativeReportStatus;
                 this.qisReportId = result.Id;
                 this.Awaredate = result.awaredate;
-                if (!confirm("涓嶈鎶ュ憡鍚庢棤娉曟挙鍥烇紝鏄惁缁х画锛�")) {
-            		this.dispatchEvent(new CloseActionScreenEvent());
-                    return;
-        		}
-        		if (this.OCSMAdministrativeReportStatus == null && this.Awaredate!=null) {
-	         		this.updateQisSubmit();
-	         	}else{
-	         		const evt = new ShowToastEvent({
-                            title : '娌℃湁AwareDate鎴栧凡缁廜CSM琛屾斂鎶ュ憡锛岃纭',
-                            message: '',
-                            variant: 'error'
-                        });
-                        this.dispatchEvent(evt);
+                LightningConfirm.open({
+                    message: '鎶ュ憡鍚庢棤娉曟挙鍥烇紝鏄惁缁х画锛�',
+                    variant: 'headerless',
+                    label: 'this is the aria-label value',
+                }).then(res=>{
+                    if(res) {
+                        if (this.OCSMAdministrativeReportStatus == null && this.Awaredate!=null) {
+                            this.updateQisSubmit();
+                        }else{
+                            const evt = new ShowToastEvent({
+                                    title : '娌℃湁AwareDate鎴栧凡缁廜CSM琛屾斂鎶ュ憡锛岃纭',
+                                    message: '',
+                                    variant: 'error'
+                                });
+                                this.dispatchEvent(evt);
+                                this.dispatchEvent(new CloseActionScreenEvent());
+                                return;
+                        }
+                    }else{
                         this.dispatchEvent(new CloseActionScreenEvent());
                         return;
-	         	}
+                    }
+                    
+                 });
         }).catch(error => {
             console.log(error);
         }).finally(() => {

--
Gitblit v1.9.1