/* eslint-disable no-undef */
import {extendFilterGroup, extendGroupRule, extendInclude, extendRule, initFilterGroup} from "../../utils/common";

/**
 * @return {string}
 */
//BOM 编辑
export default {
  onChange: ({value,colInfo,getFieldValue,setFieldValue,setFieldEditable}) => {


  },
  onFetchAutoFilter:({colInfo,params,getFieldValue,pageCode})=>{
    if(colInfo.FIELD_NAME=='Nav_Product.CODE'){
      let group=initFilterGroup(false);
      extendGroupRule(group,'PRODUCT_TYPE',1,0);
      extendGroupRule(group,'PRODUCT_TYPE',1,1);
      extendFilterGroup(params,group);
    }

  },
  onFetchAutoFilterDetail:({colInfo,params,getFieldValue,pageCode})=>{
    if(colInfo.FIELD_NAME=='Nav_Product.CODE'){
      let group=initFilterGroup(false);
      extendGroupRule(group,'PRODUCT_TYPE',1,0);
      extendGroupRule(group,'PRODUCT_TYPE',1,1);
      extendGroupRule(group,'PRODUCT_TYPE',1,2);
      extendFilterGroup(params,group);
    }

  },
  onBeforeEdit:({isNew,getFieldValue,setFieldValueByBatch,setFieldEditable})=>{
    if(isNew){
      const temps=[];
      temps.push({field:'TYPE',value:0})
      setFieldValueByBatch(temps);
    }

  },
  onBeforeSave:({data,getFieldValue,setFieldValue})=>{
  },
}
