From 87861ae5f1ed5456685f97f8a8e7625e47b9576d Mon Sep 17 00:00:00 2001
From: KKbes <1620284052@qq.com>
Date: 星期四, 13 四月 2023 11:12:26 +0800
Subject: [PATCH] Merge branch 'LEX_dev' of http://47.92.229.245:8089/r/lightningupdate into LEX_dev
---
force-app/main/default/lwc/lexInsPageBtn/lexInsPageBtn.js | 62 +++++++++++++++++++++++++++++++
1 files changed, 62 insertions(+), 0 deletions(-)
diff --git a/force-app/main/default/lwc/lexInsPageBtn/lexInsPageBtn.js b/force-app/main/default/lwc/lexInsPageBtn/lexInsPageBtn.js
new file mode 100644
index 0000000..e0c1dbd
--- /dev/null
+++ b/force-app/main/default/lwc/lexInsPageBtn/lexInsPageBtn.js
@@ -0,0 +1,62 @@
+import {
+ LightningElement,
+ wire,
+ api
+} from 'lwc';
+import {
+ CurrentPageReference
+} from "lightning/navigation";
+import {
+ CloseActionScreenEvent
+} from 'lightning/actions';
+import init from '@salesforce/apex/otherButtonSpotInspectionReportCtl.init';
+
+export default class LexInsPageBtn extends LightningElement {
+ @api recordId;
+ str;
+ IsLoading = true;
+ Id;
+ RecordTypeId;
+
+ @wire(CurrentPageReference)
+ getStateParameters(currentPageReference) {
+ if (currentPageReference) {
+ const urlValue = currentPageReference.state.recordId;
+ if (urlValue) {
+ let str = `${urlValue}`;
+ this.recordId = str;
+ }
+ }
+ }
+
+ connectedCallback() {
+ init({
+ recordId: this.recordId
+ }).then(result => {
+ console.log(result);
+ if (result != null) {
+ this.IsLoading = false;
+ this.Id = result.Id;
+ this.RecordTypeId = result.RecordTypeId;
+
+ this.insPageBtn();
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
+ }).catch(error => {
+ console.log(error);
+ }).finally(() => {
+
+ });
+ }
+
+ // 鎶ュ憡涔︽槑缁嗙紪杈�
+ insPageBtn() {
+ var url;
+ if (this.RecordTypeId == '01210000000aLii') {
+ url = '/apex/OFSInsReportLayoutForVm';
+ } else {
+ url = '/apex/OFSInsReportLayout';
+ }
+ window.open(url += '?id=' + this.Id)
+ }
+}
\ No newline at end of file
--
Gitblit v1.9.1