From 04a2d035b87a9aa8836ef84705aec1b3415b1671 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@prec-tech.com>
Date: 星期三, 19 七月 2023 13:42:53 +0800
Subject: [PATCH] 试用表按钮
---
force-app/main/default/lwc/lexConsumTrialPDF/lexConsumTrialPDF.html | 5 ++
force-app/main/default/lwc/lexConsumTrialPDF/lexConsumTrialPDF.js-meta.xml | 11 +++++
force-app/main/default/lwc/lexConsumTrialPDF/lexConsumTrialPDF.js | 50 +++++++++++++++++++++++++
3 files changed, 66 insertions(+), 0 deletions(-)
diff --git a/force-app/main/default/lwc/lexConsumTrialPDF/lexConsumTrialPDF.html b/force-app/main/default/lwc/lexConsumTrialPDF/lexConsumTrialPDF.html
new file mode 100644
index 0000000..ae58c6c
--- /dev/null
+++ b/force-app/main/default/lwc/lexConsumTrialPDF/lexConsumTrialPDF.html
@@ -0,0 +1,5 @@
+<template>
+ <div class="dispatchOCSMQARAHolder" if:true={IsLoading}>
+ <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+ </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexConsumTrialPDF/lexConsumTrialPDF.js b/force-app/main/default/lwc/lexConsumTrialPDF/lexConsumTrialPDF.js
new file mode 100644
index 0000000..60fe109
--- /dev/null
+++ b/force-app/main/default/lwc/lexConsumTrialPDF/lexConsumTrialPDF.js
@@ -0,0 +1,50 @@
+import { LightningElement,wire,track,api} from 'lwc';
+import { CurrentPageReference, NavigationMixin} from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+
+// 鑰楁潗 璇曠敤琛�
+export default class LexConsumTrialPDF extends LightningElement {
+
+ @api recordId;
+ IsLoading = true;
+
+ @wire(CurrentPageReference)
+ getStateParameters(currentPageReference) {
+ console.log(111);
+ console.log(currentPageReference);
+
+ if (currentPageReference) {
+ const urlValue = currentPageReference.state.recordId;
+ if (urlValue) {
+ let str = `${urlValue}`;
+ console.log("str");
+ console.log(str);
+ this.recordId = str;
+ }
+ }
+ }
+
+ connectedCallback(){
+ this.IsLoading = false;
+ console.log("pdf---",this.recordId,this.IsLoading);
+ if(this.recordId){
+ window.open('/apex/ConsumTrialPDF?id='+this.recordId);
+ }
+ setTimeout(()=>{
+ this.dispatchEvent(new CloseActionScreenEvent());
+ })
+
+ }
+
+ showToast(message, type) {
+ const evt = new ShowToastEvent({
+ // title: '',
+ message: message,
+ variant: type
+ });
+ this.dispatchEvent(evt);
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
+
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexConsumTrialPDF/lexConsumTrialPDF.js-meta.xml b/force-app/main/default/lwc/lexConsumTrialPDF/lexConsumTrialPDF.js-meta.xml
new file mode 100644
index 0000000..b36ef00
--- /dev/null
+++ b/force-app/main/default/lwc/lexConsumTrialPDF/lexConsumTrialPDF.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+ <apiVersion>56.0</apiVersion>
+ <isExposed>true</isExposed>
+ <targets>
+ <target>lightning__AppPage</target>
+ <target>lightning__RecordPage</target>
+ <target>lightning__HomePage</target>
+ <target>lightning__RecordAction</target>
+ </targets>
+</LightningComponentBundle>
\ No newline at end of file
--
Gitblit v1.9.1