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/lexVOCCheck/lexVOCCheck.js | 31 +++++++++++++++++++++++--------
1 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/force-app/main/default/lwc/lexVOCCheck/lexVOCCheck.js b/force-app/main/default/lwc/lexVOCCheck/lexVOCCheck.js
index d95e89e..5d71c9b 100644
--- a/force-app/main/default/lwc/lexVOCCheck/lexVOCCheck.js
+++ b/force-app/main/default/lwc/lexVOCCheck/lexVOCCheck.js
@@ -8,6 +8,8 @@
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import getUserIdByName from '@salesforce/apex/ReportController.getUserIdByName';
import getProfileIdByName from '@salesforce/apex/ReportController.getProfileIdByName';
+import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
+import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexVOCCheck extends LightningElement {
@api recordId;
@@ -39,6 +41,9 @@
connectedCallback(){
+ Promise.all([
+ loadStyle(this, lwcCSS)
+ ]);
console.log(this.recordId);
init({
recordId: this.recordId
@@ -68,14 +73,24 @@
updateRecord({fields: { Id: recordId }});
}
- showToast(msg, type) {
- const event = new ShowToastEvent({
- title: "",
- message: msg,
- variant: type
- });
- this.dispatchEvent(event);
- }
+ showToast(msg,type) {
+ 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());
+ }
+ }
getUserId(userName){
getUserIdByName({
name : userName
--
Gitblit v1.9.1