From dd004276162a2bf9d042ff0aaa569dc30a95d827 Mon Sep 17 00:00:00 2001
From: binxie <137736985@qq.com>
Date: 星期一, 26 六月 2023 14:23:26 +0800
Subject: [PATCH] newbackup0626
---
force-app/main/default/lwc/lexLicenceReminder/lexLicenceReminder.js | 80 ++++++++++++++++++++++++----------------
1 files changed, 48 insertions(+), 32 deletions(-)
diff --git a/force-app/main/default/lwc/lexLicenceReminder/lexLicenceReminder.js b/force-app/main/default/lwc/lexLicenceReminder/lexLicenceReminder.js
index f154617..404f38f 100644
--- a/force-app/main/default/lwc/lexLicenceReminder/lexLicenceReminder.js
+++ b/force-app/main/default/lwc/lexLicenceReminder/lexLicenceReminder.js
@@ -1,4 +1,4 @@
-import { LightningElement,track} from 'lwc';
+import { LightningElement, track } from 'lwc';
import initReminder from '@salesforce/apex/LexLicenceReminderController.initReminder';
export default class LexLicenceReminder extends LightningElement {
@@ -6,47 +6,63 @@
@track isShowReminder = false;
@track msg = '';
- connectedCallback(){
+ connectedCallback() {
initReminder()
- .then(result=>{
- if (result.result == 'Success') {
- this.days = result.days;
- this.isShowReminder = result.isShowReminder;
- if(this.days > 0){
- this.msg = '鎮ㄧ殑鍖荤枟鍣ㄦ缁忚惀浼佷笟璁稿彲璇佽繕鏈�'+this.days+'澶╁氨鍒版湡浜嗭紒';
- }else if(this.days == 0){
- this.msg = '鎮ㄧ殑鍖荤枟鍣ㄦ缁忚惀浼佷笟璁稿彲璇佷粖澶╁氨鍒版湡浜嗭紒';
- }else if(this.days < 0){
- var days = this.days * -1
- this.msg = '鎮ㄧ殑鍖荤枟鍣ㄦ缁忚惀浼佷笟璁稿彲璇佸凡缁忚繃鏈�'+days+'澶╀簡锛�';
+ .then((result) => {
+ if (result.result == 'Success') {
+ this.days = result.days;
+ this.isShowReminder = result.isShowReminder;
+ if (this.days > 0) {
+ this.msg =
+ '鎮ㄧ殑鍖荤枟鍣ㄦ缁忚惀浼佷笟璁稿彲璇佽繕鏈�' +
+ this.days +
+ '澶╁氨鍒版湡浜嗭紒';
+ } else if (this.days == 0) {
+ this.msg = '鎮ㄧ殑鍖荤枟鍣ㄦ缁忚惀浼佷笟璁稿彲璇佷粖澶╁氨鍒版湡浜嗭紒';
+ } else if (this.days < 0) {
+ var days = this.days * -1;
+ this.msg =
+ '鎮ㄧ殑鍖荤枟鍣ㄦ缁忚惀浼佷笟璁稿彲璇佸凡缁忚繃鏈�' +
+ days +
+ '澶╀簡锛�';
+ }
+ } else {
+ console.log('Error:' + result.errorMsg);
+ this.showMyToast(result.errorMsg, '', 'error');
}
- } else {
- console.log("Error:" + result.errorMsg);
- this.showMyToast(result.errorMsg, '', 'error');
- }
- })
- .catch(error => {
- console.log("Error:" + JSON.stringify(error));
- this.showMyToast('鍒濆鍖栨彁閱掑け璐�', JSON.stringify(error), 'error');
- })
+ })
+ .catch((error) => {
+ console.log('Error:' + JSON.stringify(error));
+ this.showMyToast(
+ '鍒濆鍖栨彁閱掑け璐�',
+ JSON.stringify(error),
+ 'error'
+ );
+ });
}
showMyToast(title, message, variant) {
console.log('show custom message');
var iconName = '';
var content = '';
- if(variant == 'success'){
- iconName = 'utility:check';
- }else{
- iconName = 'utility:error';
+ if (variant == 'success') {
+ iconName = 'utility:check';
+ } else {
+ iconName = 'utility:error';
}
- if(message != ''){
- content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
- }else{
- content = '<h2><strong>'+title+'<strong/></h2>';
+ if (message != '') {
+ content =
+ '<h2><strong>' +
+ title +
+ '<strong/></h2><h5>' +
+ message +
+ '</h5>';
+ } else {
+ content = '<h2><strong>' + title + '<strong/></h2>';
}
- this.template.querySelector('c-common-toast').
- showToast(variant,content,iconName,10000);
+ this.template
+ .querySelector('c-common-toast')
+ .showToast(variant, content, iconName, 10000);
// var mode;
// if(this.isNoteStay){
// mode ='sticky';
--
Gitblit v1.9.1