From d29f75b84fccd06917fb8e2c2ee70e9d76f868cd Mon Sep 17 00:00:00 2001
From: chenjingwu <chenjingwu@prec-tech.com>
Date: 星期四, 11 四月 2024 20:15:54 +0800
Subject: [PATCH] 123
---
force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.js | 31 +++++++++++++++++++++++--------
1 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.js b/force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.js
index db99c83..e8f0a73 100644
--- a/force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.js
+++ b/force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.js
@@ -4,7 +4,7 @@
* @Author: chen jing wu
* @Date: 2023-04-13 15:55:45
* @LastEditors: chen jing wu
- * @LastEditTime: 2023-04-13 16:04:14
+ * @LastEditTime: 2023-10-10 17:30:18
*/
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -13,7 +13,8 @@
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import selectCommonSequence from '@salesforce/apex/ControllerUtil.selectCommonSequence';
import addReportOPWithEvaluationPDF from '@salesforce/apex/Add_Report.addReportOPWithEvaluationPDF';
-
+import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
+import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexBeforeOPDPDFBtnSIS extends LightningElement {
@api recordId;
accountId;
@@ -35,6 +36,9 @@
}
}
connectedCallback(){
+ Promise.all([
+ loadStyle(this, lwcCSS)
+ ]);
init({
recordId: this.recordId
}).then(result=>{
@@ -87,11 +91,22 @@
}
}
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());
+ }
}
+
}
\ No newline at end of file
--
Gitblit v1.9.1