From f66abb6dad1b8caa18aca9d65dceb34a34c022b6 Mon Sep 17 00:00:00 2001
From: KKbes <1620284052@qq.com>
Date: 星期五, 11 八月 2023 11:42:16 +0800
Subject: [PATCH] review

---
 force-app/main/default/lwc/lexUpdateTimeReply/lexUpdateTimeReply.js |   21 +++++----------------
 1 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/force-app/main/default/lwc/lexUpdateTimeReply/lexUpdateTimeReply.js b/force-app/main/default/lwc/lexUpdateTimeReply/lexUpdateTimeReply.js
index 35cfe5f..6bc992a 100644
--- a/force-app/main/default/lwc/lexUpdateTimeReply/lexUpdateTimeReply.js
+++ b/force-app/main/default/lwc/lexUpdateTimeReply/lexUpdateTimeReply.js
@@ -1,7 +1,4 @@
 import { LightningElement, track, wire,api } from 'lwc';
-import { getRecord } from 'lightning/uiRecordApi';
-import USER_ID from '@salesforce/user/Id';
-import USERPROFILE_ID from '@salesforce/schema/User.ProfileId';
 import { ShowToastEvent } from 'lightning/platformShowToastEvent';
 import { CurrentPageReference } from "lightning/navigation";
 import { CloseActionScreenEvent } from 'lightning/actions';
@@ -22,7 +19,6 @@
 	@api recordId;
 	IsLoading=true;
 	Campaign;
-	currentUserProfileId;
 
 	@wire(CurrentPageReference)
     getStateParameters(currentPageReference) {
@@ -35,15 +31,7 @@
         }
     }
 
-	@wire(getRecord, { recordId: USER_ID, fields: [USERPROFILE_ID]}) 
-    userDetails({error, data}) {
-        if (data) {
-        	this.currentUserProfileId =data.fields.ProfileId.value;
-        	console.log(data.fields);          
-        } else if (error) {
-            this.error = error ;
-        }
-    }
+
 
 
 
@@ -53,7 +41,6 @@
         }).then(result => {
             if (result != null) {
                 this.Campaign = result;
-                console.log(this.Campaign);
                 this.UpdateTimeReply().then(result=>{
                	this.IsLoading=false;
             	this.dispatchEvent(new CloseActionScreenEvent());
@@ -66,7 +53,7 @@
 	            variant : 'error'
         	});
         	this.dispatchEvent(eventInItError);
-        });
+        });   
 
     }
 
@@ -74,8 +61,9 @@
     	var ProfileId= await getProfileIdByName({Name : "绯荤粺绠$悊鍛�"}); 
 		var cstatus = this.Campaign.Status_Service__c;
 		var Service = this.Campaign.ServiceDesignDep__c;
+		var  userProfileId = await getProfileId();
 		if (cstatus =='寮�鐝澶囦腑' || cstatus =='寮�鐝腑' || Service == USER_ID ||
-		this.currentUserProfileId == ProfileId
+		userProfileId == ProfileId
 		){
 			window.open("/apex/DateModify?id=" + this.Campaign.Id,'鏃堕棿淇敼鐢宠椤甸潰','height=500, width=900, top=0, left=0');
 		} else if(cstatus =='鍟嗚皥涓�') {
@@ -86,5 +74,6 @@
 			this.dispatchEvent(event2);
 			return;
 		}
+		setInterval
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1