import { LightningElement,wire,track,api} from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; import { CloseActionScreenEvent } from 'lightning/actions'; import { NavigationMixin } from 'lightning/navigation'; import { updateRecord } from 'lightning/uiRecordApi'; import { refreshPage } from 'lightning/navigation'; import { ShowToastEvent } from 'lightning/platformShowToastEvent'; export default class lexNewOnCall extends LightningElement { @api recordId; resultId; @track messages = []; isLoading = false; activeSections = ['special', 'newmod', 'assinfo', 'descr', 'createinfo', 'info']; btntable; // EditButton(isDisabled){ // if (isDisabled) { // this.btntable = true; // }else { // this.btntable = false; // } // } get hasMessages() { return this.messages.length > 0; } handleSuccess(event){ console.log('成功啦'); this.resultId = event.detail.id; console.log('this.resultId='+this.resultId); if (this.resultId !=null) { this.isLoading = false; } } handleSubmit(event) { console.log('提交啦'); this.isLoading = true; event.preventDefault(); const fields = event.detail.fields; this.template.querySelector('lightning-record-edit-form').submit(fields); } handleError(event) { console.log('出错啦'); const error = event.detail; const toastEvent = new ShowToastEvent({ title: 'Error', message: error.body.message, variant: 'error', }); this.dispatchEvent(toastEvent); // this.isLoading = false; } // saveOnCallProcess(saveMode) { // EditButton(true); // redirectMode = saveMode; // console.log('redirectMode' + redirectMode); // this.messages = []; // //1. Get onCall Information from Form // let onCallJson = getOnCallInformation(); // //3. Prepare the payload for New PI API To AWS - To Do // let payloadForNewPI = getPIPayload(onCallJson); // //4. onCall to AWS // ProcessPI(onCallJson, payloadForNewPI); // } }