From 19f3491cd91e0c863eb13f0c6c69aca5634ed1d9 Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期二, 23 五月 2023 16:59:03 +0800
Subject: [PATCH] backup2023

---
 force-app/main/default/lwc/lexLookup/lexLookup.js |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/force-app/main/default/lwc/lexLookup/lexLookup.js b/force-app/main/default/lwc/lexLookup/lexLookup.js
index 2fe1df5..7d2ef23 100644
--- a/force-app/main/default/lwc/lexLookup/lexLookup.js
+++ b/force-app/main/default/lwc/lexLookup/lexLookup.js
@@ -26,6 +26,7 @@
     @api newRecordOptions = [];
     @api minSearchTermLength = 2;
     @api isDisabledForDealerText = false;
+    @api accountValue = '';
 
     // Template properties
     searchResultsLocalState = [];
@@ -138,6 +139,7 @@
 
     @api
     getSelection() {
+        console.log('get selection:' +this._curSelection);
         return this._curSelection;
     }
 
@@ -155,6 +157,7 @@
     }
 
     connectedCallback(){
+        console.log('LexLookup accountValue = ' + this.accountValue);
         console.log('isDisabledForDealerText = ' + this.isDisabledForDealerText);
     }
 
@@ -262,6 +265,7 @@
             // If the user presses enter, and the box is open, and we have used arrows,
             // treat this just like a click on the listbox item
             const selectedId = this._searchResults[this._focusedResultIndex].id;
+            console.log('selectedid:'+selectedId);
             this.template.querySelector(`[data-recordid="${selectedId}"]`).click();
             event.preventDefault();
         }
@@ -333,6 +337,7 @@
     handleClearSelection() {
         this._curSelection = [];
         this._hasFocus = false;
+        this.accountValue = '';
         // Process selection update
         this.processSelectionUpdate(true);
     }
@@ -445,6 +450,8 @@
     }
 
     get getSelectIconName() {
+        if(this._curSelection[0])
+            console.log('this._curSelection[0].icon = ' + this._curSelection[0].icon);
         return this.hasSelection() ? this._curSelection[0].icon : 'standard:default';
     }
 
@@ -456,6 +463,9 @@
         if (this.isMultiEntry) {
             return this._searchTerm;
         }
+        if(this.accountValue != ''){
+            return this.accountValue;
+        }
         return this.hasSelection() ? this._curSelection[0].title : this._searchTerm;
     }
 

--
Gitblit v1.9.1