From e4e82928f141bd7b580e33289412dfd9bea821f8 Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期二, 25 七月 2023 15:24:22 +0800
Subject: [PATCH] review修改以及修改附件

---
 force-app/main/default/lwc/lexLoseBid/lexLoseBid.js |   51 ++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 38 insertions(+), 13 deletions(-)

diff --git a/force-app/main/default/lwc/lexLoseBid/lexLoseBid.js b/force-app/main/default/lwc/lexLoseBid/lexLoseBid.js
index db1b2da..ae2da8e 100644
--- a/force-app/main/default/lwc/lexLoseBid/lexLoseBid.js
+++ b/force-app/main/default/lwc/lexLoseBid/lexLoseBid.js
@@ -1,3 +1,11 @@
+/*
+ * @Description: 
+ * @version: 
+ * @Author: chen jing wu
+ * @Date: 2023-05-08 14:36:33
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-05-24 16:24:28
+ */
 import { api, wire,LightningElement } from 'lwc';
 import { CurrentPageReference } from "lightning/navigation";
 import { CloseActionScreenEvent } from 'lightning/actions';
@@ -6,6 +14,7 @@
 import init  from '@salesforce/apex/OpportunityLightingButtonController.initForLoseBidButton';
 import updateForLoseBidButton  from '@salesforce/apex/OpportunityLightingButtonController.updateForLoseBidButton';
 import queryForLexLoseBidButton  from '@salesforce/apex/OpportunityLightingButtonController.queryForLoseBidButton';
+import LightningConfirm from 'lightning/confirm';
 export default class LexLoseBid extends LightningElement {
     @api recordId;
     ifOpenBid;
@@ -23,6 +32,34 @@
             console.log(str);
             this.recordId = str;
           }
+        }
+    }
+    async handleConfirmClick(msg) {
+        const result = await LightningConfirm.open({
+            message: msg,
+            variant: 'headerless',
+            label: 'this is the aria-label value',
+        });
+        console.log(result);
+        if(result){
+            try {
+                updateForLoseBidButton({
+                    recordId: this.recordId
+                }).then(result=>{
+                    if (result) {
+                        this.showToast(result,"error");
+                    }else{
+                        this.IsLoading = false;
+                        this.updateRecordView(this.recordId);
+                        this.showToast("鎿嶄綔鎴愬姛锛�","success");
+                        this.dispatchEvent(new CloseActionScreenEvent());
+                    }
+                })
+                } catch(e) {
+                   console.log(e); 
+                }
+        }else{
+            this.dispatchEvent(new CloseActionScreenEvent());
         }
     }
     connectedCallback(){
@@ -58,19 +95,7 @@
             if(flag){
                 this.showToast("鏉′欢涓嶇鍚堬紝涓嶅彲鎿嶄綔","error");
             }else{
-                if (window.confirm('鏄惁纭绔炰簤瀵规墜涓爣锛�')) {
-                    updateForLoseBidButton({
-                        recordId: this.recordId
-                    }).then(result=>{
-                        if (result) {
-                            this.showToast(result,"error");
-                        }else{
-                            this.IsLoading = false;
-                            this.updateRecordView(this.recordId);
-                            this.showToast("鎿嶄綔鎴愬姛锛�","success");
-                        }
-                    })  
-                }
+                this.handleConfirmClick('鏄惁纭绔炰簤瀵规墜涓爣锛�');
             }
         });    
     }

--
Gitblit v1.9.1