From 988f9735377909b6310301e582c15804e004783f Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期六, 07 十月 2023 10:36:13 +0800
Subject: [PATCH] 近期修改cjw

---
 force-app/main/default/lwc/tEnquiry/tEnquiry.js |  101 +++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 74 insertions(+), 27 deletions(-)

diff --git a/force-app/main/default/lwc/tEnquiry/tEnquiry.js b/force-app/main/default/lwc/tEnquiry/tEnquiry.js
index 5b368af..768845f 100644
--- a/force-app/main/default/lwc/tEnquiry/tEnquiry.js
+++ b/force-app/main/default/lwc/tEnquiry/tEnquiry.js
@@ -17,8 +17,8 @@
 
 import SearchAccountById from '@salesforce/apex/InspectCheckController.SearchAccountById';
 
-
-
+import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
+import {loadStyle} from 'lightning/platformResourceLoader'
 import GetInspectById from '@salesforce/apex/InspectCheckController.GetInspectById';
 export default class test02 extends LightningElement {
 
@@ -33,22 +33,56 @@
     TongzhiIcon = 'standard:account' //鎻愮ず妗嗙殑鍥炬爣
     IsLeftStyle = "" //鎻愮ず妗嗙殑鏍峰紡
     BgColorStyle = "" 
+    toastTime = null;
+    isSuccess = false;
+    message;
+    visible;
+    closeAction(){
+        this.visible = false;
+    }
+    showToast(msg,type) {
+        try {
+            if(type == 'success'){
+                this.isSuccess = true;
+            }else{
+                this.isSuccess = false;
+            }
+            this.message = msg;
+            this.visible = true;
+            let delay = 5000;
+            console.log(this.message);
+            console.log('1');
+            // setTimeout(() => {
+            //     this.visible = false;
+            // }, delay ); 
+        } catch (error) {
+            console.log(error);
+        }
+
+        
+    }
     Alert(content,error = false,left = false){
+        this.Tongzhishow = false
+        clearTimeout(this.toastTime)
         this.SaveShowText = content;
         this.Tongzhishow = true;
         
         if (error) {
-            this.TongzhiIcon = "standard:first_non_empty";
-            this.BgColorStyle = "background-color:#f88568";
+            this.TongzhiIcon = "utility:error";
+            this.BgColorStyle = "background-color:#ba0517 !important;padding: 9px 9px 9px 18px;";
         }else{
-            this.TongzhiIcon = "standard:account";
-            this.BgColorStyle = "background-color:#69e669";
+            this.TongzhiIcon = "utility:success";
+            this.BgColorStyle = "background-color:rgb(46, 132, 74)!important;padding: 9px 9px 9px 18px;";
+            toastTime = setTimeout(() => {
+               this.Tongzhishow = false
+            },3000)
         }
-        if (left) {
-            this.IsLeftStyle = "left: 0.25rem;"
-        }else{
-            this.IsLeftStyle = ""
-        }
+        // if (left) {
+        //     // this.IsLeftStyle = "left: 0.25rem;"
+            this.IsLeftStyle = "width: 100%;top: 14%;display: flex;justify-content: center;"
+        // }else{
+        //     this.IsLeftStyle = "color:#fff"
+        // }
     }
     CloseAlert()
     {
@@ -74,7 +108,9 @@
         return(false);
     }
     connectedCallback(){
-              
+        Promise.all([
+            loadStyle(this, lwcCSS)
+        ]);
        var paramId =  this.getQueryVariable('id');
        if (paramId == null || paramId == '') {
            return ;
@@ -145,7 +181,8 @@
                 if (isloading == 2) {
                     this.OnLoading(false);
                     if (flag) {
-                        this.Alert("淇濆瓨鎴愬姛",false,true);
+                        // this.Alert("淇濆瓨鎴愬姛",false);
+                        this.showToast('淇濆瓨鎴愬姛','success');
                     }
                 }
             })
@@ -165,7 +202,8 @@
                 if (isloading == 2) {
                     this.OnLoading(false);
                     if (flag) {
-                        this.Alert("淇濆瓨鎴愬姛",false,true);
+                        // this.Alert("淇濆瓨鎴愬姛",false);
+                        this.showToast('淇濆瓨鎴愬姛','success');
                     }
                 }
                
@@ -178,6 +216,11 @@
     //table 鍒楄〃鐨勬暟鎹�
     @track  optionsdata=[
         {
+            label:"鐘舵��1",
+            props:"StageName__c",
+            Type:"text",
+        },
+        {
             label:"璇环鍚嶇О",
             props:"Name",
             url:"Id",
@@ -187,12 +230,6 @@
             label:"璇环缂栫爜",
             props:"Opportunity_No__c",
             Type:"text",
-        },
-        {
-            label:"瀹㈡埛鍚�",
-            props:"Account_Name_F__c",
-            url:"Id",
-            Type:"url",
         },
         {
             label:"璇环闃舵",
@@ -205,10 +242,14 @@
             Type:"text",
         },
         {
-            label:"鐘舵��1",
-            props:"StageName__c",
-            Type:"text",
+            label:"瀹㈡埛鍚�",
+            props:"Account_Name_F__c",
+            url:"Id",
+            Type:"url",
         },
+        
+        
+        
        
     ]
 
@@ -302,7 +343,8 @@
             isloading ++;
             if (isloading == 2) {
                 this.OnLoading(false);
-                this.Alert("淇濆瓨鎴愬姛",false,true);
+                // this.Alert("淇濆瓨鎴愬姛",false);
+                this.showToast('淇濆瓨鎴愬姛','success');
             }
         })
         
@@ -314,7 +356,8 @@
             isloading ++;
             if (isloading == 2) {
                 this.OnLoading(false);
-                this.Alert("淇濆瓨鎴愬姛",false,true);
+                // this.Alert("淇濆瓨鎴愬姛",false);
+                this.showToast('淇濆瓨鎴愬姛','success');
             }
         })
     }
@@ -328,7 +371,8 @@
         var flag =  this.compareSelected();
         if (flag == false) {
             this.OnLoading(false);
-            this.Alert("鍖婚櫌涓嶅尮閰嶏紝淇濆瓨澶辫触锛�",true);
+            // this.Alert("鍖婚櫌涓嶅尮閰嶏紝淇濆瓨澶辫触锛�",true);
+            this.showToast('鍖婚櫌涓嶅尮閰嶏紝淇濆瓨澶辫触锛�','error');
             return;
         }
         debugger;
@@ -345,9 +389,12 @@
                 this.UpdateDatas(this.notselected);
                 window.location.hash = "Refresh"+"=="+this.ParamIdStr;
                 this.OnLoading(false);
+                // this.Alert('淇濆瓨鎴愬姛',false);
+                this.showToast('淇濆瓨鎴愬姛','success');
             }else{
                 this.OnLoading(false);
-                this.Alert(response,true,false);
+                // this.Alert(response,true);
+                this.showToast(response,'error');
             }
      
         });

--
Gitblit v1.9.1