From e6a0a7f9ffb463c5ce78d6770b09eac739f88b15 Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期三, 24 五月 2023 16:57:53 +0800
Subject: [PATCH] 优化确认框以及修改页面
---
force-app/main/default/lwc/lexLoseBid/lexLoseBid.js | 45 +++++++++++++++++++++++++++++++--------------
1 files changed, 31 insertions(+), 14 deletions(-)
diff --git a/force-app/main/default/lwc/lexLoseBid/lexLoseBid.js b/force-app/main/default/lwc/lexLoseBid/lexLoseBid.js
index a42f54f..ae2da8e 100644
--- a/force-app/main/default/lwc/lexLoseBid/lexLoseBid.js
+++ b/force-app/main/default/lwc/lexLoseBid/lexLoseBid.js
@@ -4,7 +4,7 @@
* @Author: chen jing wu
* @Date: 2023-05-08 14:36:33
* @LastEditors: chen jing wu
- * @LastEditTime: 2023-05-11 14:48:31
+ * @LastEditTime: 2023-05-24 16:24:28
*/
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -14,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;
@@ -31,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(){
@@ -66,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