From bdb1a98b64a2cf59bcfd575c579aa0742e0de954 Mon Sep 17 00:00:00 2001
From: chenjingwu <chenjingwu@prec-tech.com>
Date: 星期五, 24 五月 2024 17:21:32 +0800
Subject: [PATCH] 1
---
force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js | 41 +++++++++++++++++++++++++++++++----------
1 files changed, 31 insertions(+), 10 deletions(-)
diff --git a/force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js b/force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js
index b0deed5..c8b1eba 100644
--- a/force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js
+++ b/force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js
@@ -1,3 +1,11 @@
+/*
+ * @Description:
+ * @version:
+ * @Author: chen jing wu
+ * @Date: 2023-09-09 13:31:12
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-10-10 17:35:45
+ */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
@@ -5,8 +13,9 @@
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { NavigationMixin } from 'lightning/navigation';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
-
-export default class LexNewAgencyHospital extends LightningElement {
+import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
+import {loadStyle} from 'lightning/platformResourceLoader';
+export default class LexNewAgencyHospital extends NavigationMixin(LightningElement) {
@wire(CurrentPageReference)
getStateParameters(currentPageReference) {
console.log(111);
@@ -27,15 +36,27 @@
}
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());
+ }
}
-
connectedCallback(){
+ Promise.all([
+ loadStyle(this, lwcCSS)
+ ]);
var doubleFlg = false;
if(!doubleFlg) {
doubleFlg = true;
@@ -56,4 +77,4 @@
});
}
}
-}
+}
\ No newline at end of file
--
Gitblit v1.9.1