/* eslint-disable no-undef */
import { extendInclude, extendRule, initFilter, getRandomCode } from "../../utils/common";

/**
 * @return {string}
 */
//工艺线路明细
export default {

  onBeforeEdit: ({ isNew, stateData, getFieldValue, data, setFieldValueByBatch, dispatch, login, setFieldEditable, setFieldVisibleByBatch }) => {

  },
  onSubChange: ({ value, colInfo, pageCode, record, setRowFieldVisible, setFieldValueByBatch, setFieldEditable, dispatch, saveRowRecord }) => {
    // if (colInfo.FIELD_NAME == 'FIELD_TYPE') {
    //   const temps = [];
    //   temps.push({ field: 'NAME', value: '' })
    //   temps.push({ field: 'FIELD_NAME', value: '' })
    //   temps.push({ field: 'TREE_NAME', value: '' })
    //   setFieldValueByBatch(temps);
    //   record.NAME = '';
    //   saveRowRecord(record);
    //   // if (value == 0) {
    //   //   setRowFieldVisible(pageCode, { "TREE_NAME": true, 'FIELD_NAME': false })
    //   // } else {
    //   //   setRowFieldVisible(pageCode, { "TREE_NAME": false, 'FIELD_NAME': true })
    //   // }
    // }
    if(colInfo.FIELD_NAME == 'FIELD_NAME'){
      record.TREE_NAME = '';
      record.NAME=value;
      saveRowRecord(record);
    }
    if(colInfo.FIELD_NAME == 'TREE_NAME'){
      record.FIELD_NAME = '';
      record.NAME=value;
      saveRowRecord(record);
    }
  },
  onAfterAddSubRow: ({ srcRecord, colInfo, pageCode, record, setRowFieldVisible }) => {

  },

}
