buli
2023-05-23 19f3491cd91e0c863eb13f0c6c69aca5634ed1d9
force-app/main/default/lwc/lexInputPickListCell/lexInputPickListCell.js
@@ -4,29 +4,43 @@
 * @Author: chen jing wu
 * @Date: 2023-04-27 11:15:23
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-04-27 13:24:21
 * @LastEditTime: 2023-05-08 11:39:23
 */
import { LightningElement, track,wire, api } from 'lwc';
import getPickList from '@salesforce/apex/lexPCLLostReportLwcController.getPickList';
import searchBrands from '@salesforce/apex/lexPCLLostReportLwcController.searchBrands';
export default class LexInputPickListCell extends LightningElement {
    @api options=[];
    value;
    @track options=[];
    @api value;
    @api record;
    @api field;
    @api fieldType;
    @api objectName;
    value;
    @api readOnly;
    @api required;
    value1;
    label;
    connectedCallback() {
        this.value = this.record[this.field];
        this.value1 = this.record[this.field];
        this.label = this.field;
        if(this.objectName!==undefined && this.isPickList)
        {
            this.getPicklist(this.objectName,this.field);
            if(this.label!= 'LostBrandName__c'){
                this.getPicklist(this.objectName,this.field);
            }else{
                this.getSearchBrands();
            }
        }
    }
    get isRequired(){
        return this.required;
    }
    getSearchBrands(){
        searchBrands().then(result=>{
            this.options = JSON.parse(result);
        });
    }
    getPicklist(obj,field)
    {
        getPickList({ objectName : obj, fieldName :field})
@@ -55,6 +69,13 @@
        }
        return false;
    }
    get isReadOnly(){
        if(this.readOnly == true){
            return true;
        }else{
            return false;
        }
    }
    
    @api
    inputValue() {