From d77b6353ca9b59a6398df3eae9912f9fd766946d Mon Sep 17 00:00:00 2001
From: zhangzhengmei <zhangzhengmei@prec-tech.com>
Date: 星期六, 05 八月 2023 17:04:22 +0800
Subject: [PATCH] fix: lightning 页面确认
---
force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.js | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 45 insertions(+), 0 deletions(-)
diff --git a/force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.js b/force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.js
new file mode 100644
index 0000000..1ac6018
--- /dev/null
+++ b/force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.js
@@ -0,0 +1,45 @@
+import {
+ LightningElement,
+ wire,
+ api
+} from 'lwc';
+import {
+ CurrentPageReference
+} from "lightning/navigation";
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+
+export default class LexAccessory_Add extends LightningElement {
+ @api recordId;
+ IsLoading = true;
+
+ @wire(CurrentPageReference)
+ getStateParameters(currentPageReference) {
+ if (currentPageReference) {
+ const urlValue = currentPageReference.state.recordId;
+ if (urlValue) {
+ let str = `${urlValue}`;
+ this.recordId = str;
+ }
+ }
+ }
+
+ connectedCallback(){
+ this.IsLoading = false;
+ if (this.recordId.length == 0) {
+ this.ShowToastEvent("璇烽�夋嫨涓�涓�熷嚭澶囧搧閰嶅涓�瑙堟槑缁嗕俊鎭�", "warning");
+ } else {
+ window.open("/apex/AccessoryAdd?recid=" + this.recordId, "_top");
+ }
+ }
+
+ //寮规
+ ShowToastEvent(msg,type) {
+ const event = new ShowToastEvent({
+ title: '',
+ message: msg,
+ variant: type
+ });
+ this.dispatchEvent(event);
+ }
+
+}
--
Gitblit v1.9.1