/* eslint-disable */
/* eslint-disable prefer-destructuring */
/**
 * Created by mar105 on 2019-03-27.
 */
import React, { Component } from 'react';
import { Modal, message } from 'antd-v4';
import * as commonUtils from '../../utils/utils'; /* 通用方法 */
import * as commonFunc from './commonFunc'; /* 通用单据方法 */
import commonConfig from '../../utils/config';
import * as commonServices from '../../services/services';
import * as commonBusiness from './commonBusiness';

const { confirm } = Modal;

export default (ChildComponent) => {
  return class extends Component {
    constructor(props) {
      super(props);
      this.state = {};
      this.loadingCount = 0;
    }

    componentWillMount() {
      /* 获取配置 */
      this.mounted = true;
      const {
        slaveData, slaveSelectedRowKeys, formRoute, app, sModelsType,
      } = this.props;
      const { currentPane } = app;
      /* 选择合版部件 slaveConfig,slaveColumn,slaveData有值 会将值存储到state中 */
      if (currentPane.name === 'combineParts' || currentPane.name === 'logView' || currentPane.name === 'sisColor' || currentPane.name === 'commonPopup') {
        const bFilterProName = currentPane.bFilterProName;
        const bFilterProValue = currentPane.bFilterProValue;
        this.props.onSaveState({
          slaveData, formRoute, pageLoading: false, slaveSelectedRowKeys, selectedRowKeys: slaveSelectedRowKeys, sModelsType, bFilterProName, bFilterProValue,
        });
      } else if (currentPane.name === 'chooseProductProcess') { /* 选择成品工序 */
        const { slaveFinalConfig, slaveFinalColumn, slaveFinalData } = this.props;
        this.props.onSaveState({
          slaveData,
          formRoute,
          pageLoading: false,
          slaveSelectedRowKeys,
          sModelsType,
          slaveFinalConfig, /* 成品工序 对应的工单从表配置 */
          slaveFinalColumn, /* 成品工序 对应的工单从表表头 */
          slaveFinalData, /* 成品工序 对应的工单从表数据源 */
        });
      }
    }

    async componentWillReceiveProps(nextProps) {
      const {
        app, formData, currentId, searchSolution, masterData, sGroupByList, formRoute, sModelsType,
      } = nextProps;
      let { slaveConfig: slaveConfigOld } = nextProps;
      // nextProps.onSaveState({ realizeHeight: nextProps.realizeHeight });
      let { iPageSize } = nextProps;
      // formRoute === '/indexOee'为oee报产页面;
      if (nextProps.customConfig) {
        let slaveColumn = commonFunc.getHeaderConfig({gdsconfigformslave: nextProps.customConfig});
        if (JSON.stringify(slaveColumn) !== JSON.stringify(nextProps.slaveColumn)) {
          this.props.onSaveState({slaveColumn});
        }
      }
      if (commonUtils.isEmptyObject(slaveConfigOld) && formData.length > 0 && (formRoute.indexOf('/indexOee') > -1 || searchSolution !== undefined)) {
        const sId = currentId || nextProps.masterData?.sId || '';
        /* 数据Id */
        const slaveConfig = formData[0];
        let addState = {};
        let addOtherState = {};
        const config = {};
        let onlySlave = true;
        let onlySlave0 = false;
        let onlySlave1 = false;
        let onlyslave2 = false;
        let onlyslave3 = false;
        let onlyslave4 = false;
        let slave0Column = [];
        let slave1Column = [];
        let slave2Column = [];
        let slave3Column = [];
        let slave4Column = [];


        let onlyChart0 = false;
        let onlyChart1 = false;
        let onlyChart2 = false;
        let onlyChart3 = false;
        let onlyChart4 = false;
        let onlyChart5 = false;
        let onlyChart6 = false;
        let onlyChart7 = false;
        let onlyChart8 = false;
        let onlyChart9= false;
        let onlyChart10= false;
        let onlyChart11= false;
        let onlyChart12= false;
        let onlyChart13= false;
        let onlyChart14= false;
        let onlyChart15= false;
        let onlyChart16= false;

        let slaveColumn = commonFunc.getHeaderConfig(slaveConfig);
        if (commonUtils.isNotEmptyObject(slaveConfig) && commonUtils.isNotEmptyArr(slaveConfig.gdsconfigformslave)) {
          const iIndexSlave = slaveConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'tbSlave');
          if (iIndexSlave > -1) {
            onlySlave = slaveConfig.gdsconfigformslave[iIndexSlave].bVisible;
          }
        }
        /* 选择工序选中表-拷贝slave配置 */
        const slaveFilterConfig = formData[0];
        const slaveFilterColumn = commonFunc.getHeaderConfig(slaveFilterConfig);
        let filterCondition = [];
        if (commonUtils.isNotEmptyObject(masterData) && !commonUtils.isEmpty(masterData.sSearchSolutionId) && commonUtils.isNotEmptyArr(searchSolution)) {
          const iIndex = searchSolution.findIndex(item => item.sId === masterData.sSearchSolutionId);
          if (iIndex > -1 && !commonUtils.isEmpty(searchSolution[iIndex].sCondition)) {
            filterCondition = JSON.parse(searchSolution[iIndex].sCondition);
          }
        }
        let slaveInfoColumn = {};
        let slaveInfoConfig;
        let iOeePageSize = iPageSize;/* OEE没有分页组件 只需要根据后台设定页数分页 */
        if (commonUtils.isNotEmptyNumber(formData[0].iPageSize) && formData[0].iPageSize !== 0) {
          iOeePageSize = formData[0].iPageSize;
        }

        const slave0Config = formData.length > 0 ? formData[1] : {};
        if(!commonUtils.isEmptyObject(slave0Config) && commonUtils.isNotEmptyObject(slave0Config.sCharType)) { /* 配置为图表 */
          addOtherState.onlyChart0 = true;
          onlySlave0 = true;
        }else if (!commonUtils.isEmptyObject(slave0Config) && slave0Config.bGrdVisible) {
          config.slave0Config = slave0Config;
          slave0Column = commonFunc.getHeaderConfig(slave0Config);
          onlySlave0 = true;
          const slave0PageSize = commonUtils.isNotEmptyObject(slave0Config) && commonUtils.isNotEmptyNumber(slave0Config.iPageSize) && slave0Config.iPageSize !== 0 ?
            slave0Config.iPageSize : commonConfig.pageSize;
          addState.slave0PageSize = slave0PageSize;

        }
        const slave1Config = formData.length > 1 ? formData[2] : {};
        if(!commonUtils.isEmptyObject(slave1Config) && commonUtils.isNotEmptyObject(slave1Config.sCharType)) { /* 配置为图表 */
          addOtherState.onlyChart1 = true;
          onlySlave1 = true;
        }else if (!commonUtils.isEmptyObject(slave1Config) && slave1Config.bGrdVisible) {
          config.slave1Config = slave1Config;
          slave1Column = commonFunc.getHeaderConfig(slave1Config);
          onlySlave1 = true;
          const slave1PageSize = commonUtils.isNotEmptyObject(slave1Config) && commonUtils.isNotEmptyNumber(slave1Config.iPageSize) && slave1Config.iPageSize !== 0 ?
            slave1Config.iPageSize : commonConfig.pageSize;
          addState.slave0PageSize = slave1PageSize;
        }
        const slave2Config = formData.length > 2 ? formData[3] : {};
        if(!commonUtils.isEmptyObject(slave2Config) && commonUtils.isNotEmptyObject(slave2Config.sCharType)) { /* 配置为图表 */
          addOtherState.onlyChart2 = true;
          onlyslave2 = true;
        }else if (!commonUtils.isEmptyObject(slave2Config) && slave2Config.bGrdVisible) {
          config.slave2Config = slave2Config;
          slave2Column = commonFunc.getHeaderConfig(slave2Config);
          onlyslave2 = true;
          const slave2PageSize = commonUtils.isNotEmptyObject(slave2Config) && commonUtils.isNotEmptyNumber(slave2Config.iPageSize) && slave2Config.iPageSize !== 0 ?
            slave2Config.iPageSize : commonConfig.pageSize;
          addState.slave2PageSize = slave2PageSize;
        }
        const slave3Config = formData.length > 3 ? formData[4] : {};
        if(!commonUtils.isEmptyObject(slave3Config) && commonUtils.isNotEmptyObject(slave3Config.sCharType)) { /* 配置为图表 */
          addOtherState.onlyChart3 = true;
          onlyslave3 = true;
        }else if (!commonUtils.isEmptyObject(slave3Config) && slave3Config.bGrdVisible) {
          config.slave3Config = slave3Config;
          slave3Column = commonFunc.getHeaderConfig(slave3Config);
          onlyslave3 = true;
          const slave3PageSize = commonUtils.isNotEmptyObject(slave3Config) && commonUtils.isNotEmptyNumber(slave3Config.iPageSize) && slave3Config.iPageSize !== 0 ?
            slave3Config.iPageSize : commonConfig.pageSize;
          addState.slave3PageSize = slave3PageSize;
        }
        const slave4Config = formData.length > 4 ? formData[5] : {};
        if(!commonUtils.isEmptyObject(slave4Config) && commonUtils.isNotEmptyObject(slave4Config.sCharType)) { /* 配置为图表 */
          addOtherState.onlyChart4 = true;
          onlyslave4 = true;
        }else if (!commonUtils.isEmptyObject(slave4Config) && slave4Config.bGrdVisible) {
          config.slave4Config = slave4Config;
          slave4Column = commonFunc.getHeaderConfig(slave4Config);
          onlyslave4 = true;
          const slave4PageSize = commonUtils.isNotEmptyObject(slave4Config) && commonUtils.isNotEmptyNumber(slave4Config.iPageSize) && slave4Config.iPageSize !== 0 ?
            slave4Config.iPageSize : commonConfig.pageSize;
          addState.slave4PageSize = slave4PageSize;
        }
        /* commonNewBill 可以一带N表  */
        const tableConfigArr =  formData.filter(item => item.bGrd && item.bGrdVisible);
        const slaveOtherConfigArr =  [];
        if(commonUtils.isNotEmptyArr(tableConfigArr)) {
          tableConfigArr.forEach((item, iIndex) => {
            if(iIndex > 4) {
              let iSlaveTag = iIndex;
              if(formData[0].bGrd && formData[0].bGrdVisible) { /* 防止从表没有勾选显示 错一位 */
                iSlaveTag = iIndex - 1;
              }
              item.slaveNameTag = iSlaveTag;
              slaveOtherConfigArr.push(item);
              const slaveOtherConfigName =  'slave' + iSlaveTag + 'Config';
              let slaveOtherColumnName =  'slave' + iSlaveTag + 'Column';
              const onlyslaveTag= 'onlyslave' + iSlaveTag;
              const slavePageSizeTag =  'slave' + iSlaveTag + 'PageSize';
              const slaveOtherColumn = commonFunc.getHeaderConfig(item);
              addOtherState[slaveOtherConfigName] = item;
              addOtherState[slaveOtherColumnName] = slaveOtherColumn;
              addOtherState[onlyslaveTag] = true;
              const slavePageSize = commonUtils.isNotEmptyObject(item) && commonUtils.isNotEmptyNumber(item.iPageSize) && item.iPageSize !== 0 ?
                item.iPageSize : commonConfig.pageSize;
              if(!commonUtils.isEmptyObject(item) && commonUtils.isNotEmptyObject(item.sCharType)) { /* 配置为图表 */
                const onlyChartTag= 'onlyChart' + iSlaveTag;
                addOtherState[onlyChartTag] = true;
              }
              addOtherState[slavePageSizeTag] = slavePageSize;
            }
          });
          addOtherState.slaveOtherConfigArr = slaveOtherConfigArr;
        }
        if (sModelsType !== '/indexOee/wagesSearch' && sModelsType !== '/indexOee/processReportList') { /* 该分支用于除OEE外的列表再次获取时执行 */
          /* 首先以下拉页数为准 否则以后台页数为准 如果以上都没有设置 则依照config配置的页码设置 */
          if (commonUtils.isNotEmptyNumber(formData[0].iPageSize) && formData[0].iPageSize !== 0) {
            iPageSize = formData[0].iPageSize;
          }
           this.handleGetData(slaveConfig, filterCondition, 1, commonUtils.isNotEmptyNumber(iPageSize) && iPageSize !== 0 ? iPageSize : commonConfig.pageSize, '', false, sGroupByList,
            undefined, undefined,  slave0Config, slave1Config, slave2Config, slave3Config, slave4Config,
             commonUtils.isNotEmptyObject(addOtherState)? addOtherState.slave5Config : null,
             commonUtils.isNotEmptyObject(addOtherState)? addOtherState.slave6Config : null,
             commonUtils.isNotEmptyObject(addOtherState)? addOtherState.slave7Config : null,
             commonUtils.isNotEmptyObject(addOtherState)? addOtherState.slave8Config : null,
             commonUtils.isNotEmptyObject(addOtherState)? addOtherState.slave9Config : null,
             commonUtils.isNotEmptyObject(addOtherState)? addOtherState.slave10Config : null,
             commonUtils.isNotEmptyObject(addOtherState)? addOtherState.slave11Config : null,
             commonUtils.isNotEmptyObject(addOtherState)? addOtherState.slave12Config : null,
             commonUtils.isNotEmptyObject(addOtherState)? addOtherState.slave13Config : null,
             commonUtils.isNotEmptyObject(addOtherState)? addOtherState.slave14Config : null,
             commonUtils.isNotEmptyObject(addOtherState)? addOtherState.slave15Config : null,
           );

          /* 判断是否要加载过滤树数据 */
          const filterTreeConfigArr = slaveConfig.gdsconfigformslave.filter(item => item.bTree);
          if (commonUtils.isNotEmptyArr(filterTreeConfigArr)) {
            const filterTreeConfig = filterTreeConfigArr[0];
            await this.handleGetFilterTreeData(filterTreeConfig, filterCondition, 1);
          }
          const iIndexBtnFirst = slaveConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'BtnFirst');
          if (iIndexBtnFirst < 0) {
            slaveConfig.gdsconfigformslave.push({
              sId: commonUtils.createSid(), bVisible: false, sName: '', showName: 'BtnFirst', sControlName: 'BtnFirst',
            });
          }
          const iIndexBtnPrior = slaveConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'BtnPrior');
          if (iIndexBtnPrior < 0) {
            slaveConfig.gdsconfigformslave.push({
              sId: commonUtils.createSid(), bVisible: false, sName: '', showName: 'BtnPrior', sControlName: 'BtnPrior',
            });
          }
          const iIndexBtnNext = slaveConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'BtnNext');
          if (iIndexBtnNext < 0) {
            slaveConfig.gdsconfigformslave.push({
              sId: commonUtils.createSid(), bVisible: false, sName: '', showName: 'BtnNext', sControlName: 'BtnNext',
            });
          }
          const iIndexBtnLast = slaveConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'BtnLast');
          if (iIndexBtnLast < 0) {
            slaveConfig.gdsconfigformslave.push({
              sId: commonUtils.createSid(), bVisible: false, sName: '', showName: 'BtnLast', sControlName: 'BtnLast',
            });
          }
          const iIndexBtnSave = slaveConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'BtnSave');
          if (iIndexBtnSave < 0) {
            slaveConfig.gdsconfigformslave.push({
              sId: commonUtils.createSid(), bVisible: false, sName: '', showName: 'BtnSave', sControlName: 'BtnSave',
            });
          }
          const iIndexBtnCancel = slaveConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'BtnCancel');
          if (iIndexBtnCancel < 0) {
            slaveConfig.gdsconfigformslave.push({
              sId: commonUtils.createSid(), bVisible: false, sName: '', showName: 'BtnCancel', sControlName: 'BtnCancel',
            });
          }
          const iIndexBtnCopyFrom = slaveConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'BtnCopyFrom');
          if (iIndexBtnCopyFrom < 0) {
            slaveConfig.gdsconfigformslave.push({
              sId: commonUtils.createSid(), bVisible: false, sName: '', showName: 'BtnCopyFrom', sControlName: 'BtnCopyFrom',
            });
          }
        }
        this.props.onSaveState({
          masterConfig: slaveConfig,
          slaveConfig,
          slaveColumn,
          slaveInfoConfig,
          slaveInfoColumn,
          sId,
          pageLoading: false,
          slaveFilterColumn,
          slaveFilterConfig,
          slave0Config,
          slave0Column,
          slave1Config,
          slave1Column,
          slave2Config,
          slave2Column,
          slave3Config,
          slave3Column,
          slave4Config,
          slave4Column,
          onlySlave,
          onlySlave0,
          onlySlave1,
          onlyslave2,
          onlyslave3,
          onlyslave4,
          ...addOtherState,
          ...addState,
        });
      } else if (JSON.stringify(app.currentPane.conditonValues) !== JSON.stringify(this.props.app.currentPane.conditonValues)) {
        const { slaveConfig, slaveFilterCondition } = nextProps;
        this.handleGetData(slaveConfig, slaveFilterCondition, 1, commonUtils.isNotEmptyNumber(iPageSize) && iPageSize !== 0 ? iPageSize : commonConfig.pageSize, undefined, undefined, undefined, nextProps);
      } else if (JSON.stringify(nextProps.id) !== JSON.stringify(this.props.id)) {
        this.props.onSaveState({ slaveSelectedRowKeys: [] });
      } else if (!commonUtils.isEmpty(this.props.pageNum) && this.props.pageNum !== nextProps.pageNum) {
        const {
          slaveConfig, slaveFilterCondition, sGroupByList, treeFilterCondition, slavePagination, slaveOrderBy,
        } = this.props;
        if (this.props.pageNum >= Math.ceil(slavePagination.total / slavePagination.pageSize)) {
          this.props.onToFirst();
        } else if (commonUtils.isNotEmptyArr(treeFilterCondition)) { /* 判断是否有树过滤条件 */
          this.handleGetData(slaveConfig, slaveFilterCondition, nextProps.pageNum, slavePagination.pageSize, slaveOrderBy, '', sGroupByList, '', treeFilterCondition);
        } else {
          this.handleGetData(slaveConfig, slaveFilterCondition, nextProps.pageNum, slavePagination.pageSize, slaveOrderBy, '', sGroupByList);
        }
      }
    }

    shouldComponentUpdate(nextProps) {
      const { slaveColumn } = nextProps;
      return commonUtils.isNotEmptyArr(slaveColumn);
    }

    /**   获取表数据   */
    handleGetData = async (slaveConfig, slaveFilterCondition, page, pageSize, slaveOrderBy, clearSelectData, sGroupByListNew, nextProps, treeFilterCondition,
                           slave0Config, slave1Config, slave2Config, slave3Config, slave4Config, slave5Config, slave6Config, slave7Config, slave8Config, slave9Config, slave10Config, slave11Config, slave12Config,  slave13Config, slave14Config, slave15Config) => {
      const {
        app,
        name,
        formRoute,
        slavePagination,
        selectedRowKeys,
        fatherModelsType,
        slaveSelectedRowKeys,
        iPageSize,
        sModelsId,
        token,
      } = commonUtils.isEmpty(nextProps) ? this.props : nextProps;
      let { sModelsType } = app.currentPane; /* 特殊处理 选择工序不分页s */
      const sGroupByList = sGroupByListNew !== undefined ? commonUtils.isEmptyArr(sGroupByListNew) ? null : sGroupByListNew : this.props.sGroupByList;
      const conditonValues = app.currentPane.conditonValues;
      const filterCondition = app.currentPane.filterCondition;
      const bFilter = [];
      const pageNum = commonUtils.isEmpty(page) ? 1 : page;
      if (!commonUtils.isEmptyArr(slaveFilterCondition)) {
        bFilter.push(...slaveFilterCondition);
      }
      if (!commonUtils.isEmptyArr(filterCondition)) {
        bFilter.push(...filterCondition);
      }
      if (!commonUtils.isEmptyArr(treeFilterCondition)) {
        bFilter.push(...treeFilterCondition);
      }
      if (formRoute === '/indexOee/commonListTab') {
        bFilter.push({
          bFilterName: 'sMachineGuid_pro',
          bFilterCondition: '=',
          bFilterValue: app.sMachineNameSId,
        });
      }
      pageSize = commonUtils.isEmpty(pageSize) ? commonUtils.isEmpty(slavePagination) || commonUtils.isEmpty(slavePagination.pageSize) ? iPageSize : slavePagination.pageSize : pageSize;

      let addStateSlave = {};
      let addStateSlave0 = {};
      addStateSlave0.slave0Data = [];
      let addStateSlave1 = {};
      let addStateSlave2 = {};
      let addStateSlave3 = {};
      let addStateSlave4 = {};
      let addStateSlave5 = {};
      let addStateSlave6 = {};
      let addStateSlave7 = {};
      let addStateSlave8 = {};
      let addStateSlave9 = {};
      let addStateSlave10 = {};
      let addStateSlave11 = {};
      let addStateSlave12 = {};
      let addStateSlave13 = {};
      let addStateSlave14 = {};
      let addStateSlave15 = {};
      if (!commonUtils.isEmptyObject(slaveConfig)) {
        addStateSlave = await this.props.handleGetDataSet({
          name: 'slave',
          configData: slaveConfig,
          condition: {
            pageNum,
            pageSize,
            bFilter,
            sFilterOrderBy: slaveOrderBy,
            sSqlCondition: conditonValues,
            sGroupList: sGroupByList,
          },
          flag: true,
          isWait: true,
          clearSelectData,
        });
      }
      // if(commonUtils.isNotEmptyObject(addStateSlave) && commonUtils.isNotEmptyArr(addStateSlave.slaveData)) {
      //   addStateSlave.slaveSelectedRowKeys = [addStateSlave.slaveData[0].sSlaveId];
      // }
      const { masterConfig = {} } = this.props;
      const { bDefaultCheck } = masterConfig;
      const bSpecialCheck = sModelsId ==='12710101117356137370500' || sModelsId ==='12710101117253309349270' ? true : false;
      /* 除了第一张表之外的其他所有表格数据 都从第一张表的选中行数据作为查询条件 */
      if(commonUtils.isNotEmptyArr(addStateSlave) && commonUtils.isNotEmptyArr(addStateSlave.slaveData) && (bDefaultCheck || bSpecialCheck)) {
        addStateSlave.slaveSelectedRowKeys = bSpecialCheck? [] : [addStateSlave.slaveData[0].sSlaveId];
        let record =  addStateSlave.slaveData[0]; /* 从表选中行 没有选中行时 取第一行 */
        if (!commonUtils.isEmptyObject(slave0Config)) {
          let conditonValues0 = {};
          const sSqlCondition0 = slave0Config.sSqlCondition;
          if (commonUtils.isNotEmptyObject(sSqlCondition0)) {
            conditonValues0 = this.props.getSqlCondition(slave0Config, 'slave', record);
          }
          const bFilterNew = [];
          if(sModelsId ==='12710101117356137370500' || sModelsId ==='12710101117253309349270') { /* 机台工单追踪单独处理,增加搜索组件的条件 */
            if (!commonUtils.isEmptyArr(bFilter)) {
              bFilterNew.push(...bFilter);
            }
            if(commonUtils.isNotEmptyArr(bFilterNew)) {
              const iIndex= bFilterNew.findIndex(item => item.bFilterName ==='bSelected');
              if(iIndex > -1) {
                bFilterNew.splice(iIndex,1);
              }
            }
            if(commonUtils.isNotEmptyArr(bFilterNew)) {
              if( commonUtils.isEmptyArr(slaveSelectedRowKeys)) {
                const addState ={};
                addState.bFilterName ='bSelected';
                addState.bFilterCondition ='=';
                addState.bFilterValue = false;
                bFilterNew.push(addState);
              } else {
                const addState = {};
                addState.bFilterName ='bSelected';
                addState.bFilterCondition ='=';
                addState.bFilterValue = true;
                bFilterNew.push(addState);
              }
            }
          }

          if( commonUtils.isNotEmptyObject(slave0Config.sCharType)) { /* 加载图表 */
            let charConfigAndData = {};
            const value = { sProName: slave0Config.sTbName, paramsMap: conditonValues };
            const url = `${commonConfig.server_host}business/getProData?sModelsId=${sModelsId}&sName=${formRoute}`;
            const { data: returnData } = await commonServices.postValueService(token, value, url);
            if (returnData.code === 1) {
              const { dataset } = returnData;
              if (commonUtils.isNotEmptyObject(dataset)) {
                const outData = returnData.dataset.rows[0].dataSet.outData[0];
                if (outData.sCode === -1) {
                  message.error(outData.sReturn);
                } else {
                  const xyData = commonUtils.isEmpty(outData.sReturn) ? [] : JSON.parse(outData.sReturn);
                  charConfigAndData = xyData;
                  this.props.onSaveState({charConfigAndData});
                }
              }
            }
          } else {
            if (['proc'].includes(slave0Config?.sType) && !bSpecialCheck) {
              addStateSlave0 = await this.handleGetProData({ tableConfig: slave0Config, conditonValues: conditonValues0, sModelsId, formRoute, token });
            } else {
              addStateSlave0 = await  this.props.handleGetDataSet({
                name: 'slave0', configData: slave0Config, condition: { pageNum, pageSize, bFilter:bFilterNew, sFilterOrderBy:'', sSqlCondition: conditonValues0, sGroupList:sGroupByList }, isWait: true,
              });
            }
          }

        }

        // if (!commonUtils.isEmptyObject(slave1Config)) {
        //   let conditonValues1 = {};
        //   const sSqlCondition1 = slave1Config.sSqlCondition;
        //   if (commonUtils.isNotEmptyObject(sSqlCondition1)) {
        //     conditonValues1 = this.props.getSqlCondition(slave1Config, 'slave', record);
        //   }
        //   this.props.handleGetDataSet({
        //     name: 'slave1', configData: slave1Config, condition: { pageNum, pageSize,  bFilter:[], sFilterOrderBy:slaveOrderBy, sSqlCondition: conditonValues1, sGroupList:sGroupByList },
        //   });
        // }
        //
        //
        // if (!commonUtils.isEmptyObject(slave2Config)) {
        //   let conditonValues2 = {};
        //   const sSqlCondition2 = slave2Config.sSqlCondition;
        //   if (commonUtils.isNotEmptyObject(sSqlCondition2)) {
        //     conditonValues2 = this.props.getSqlCondition(slave2Config, 'slave', record);
        //   }
        //   this.props.handleGetDataSet({
        //     name: 'slave2', configData: slave2Config, condition: { pageNum, pageSize, bFilter:[], sFilterOrderBy:slaveOrderBy, sSqlCondition: conditonValues2, sGroupList:sGroupByList },
        //   });
        // }
        //
        // if (!commonUtils.isEmptyObject(slave3Config)) {
        //   let conditonValues3 = {};
        //   const sSqlCondition3 = slave3Config.sSqlCondition;
        //   if (commonUtils.isNotEmptyObject(sSqlCondition3)) {
        //     conditonValues3 = this.props.getSqlCondition(slave3Config, 'slave', record);
        //   }
        //   this.props.handleGetDataSet({
        //     name: 'slave3', configData: slave3Config, condition: { pageNum, pageSize, bFilter:[], sFilterOrderBy:slaveOrderBy, sSqlCondition: conditonValues3, sGroupList:sGroupByList },
        //   });
        // }
        //
        // if (!commonUtils.isEmptyObject(slave4Config)) {
        //   let conditonValues4 = {};
        //   const sSqlCondition1 = slave4Config.sSqlCondition;
        //   if (commonUtils.isNotEmptyObject(sSqlCondition1)) {
        //     conditonValues4 = this.props.getSqlCondition(slave4Config, 'slave', record);
        //   }
        //   this.props.handleGetDataSet({
        //     name: 'slave4', configData: slave4Config, condition: { pageNum, pageSize, bFilter:[], sFilterOrderBy:slaveOrderBy, sSqlCondition: conditonValues4, sGroupList:sGroupByList },
        //   });
        // }
        //
        // if (!commonUtils.isEmptyObject(slave5Config)) {
        //   let conditonValues5 = {};
        //   const sSqlCondition1 = slave5Config.sSqlCondition;
        //   if (commonUtils.isNotEmptyObject(sSqlCondition1)) {
        //     conditonValues5 = this.props.getSqlCondition(slave5Config, 'slave', record);
        //   }
        //    this.props.handleGetDataSet({
        //     name: 'slave5', configData: slave5Config, condition: { pageNum, pageSize, bFilter:[], sFilterOrderBy:slaveOrderBy, sSqlCondition: conditonValues5, sGroupList:sGroupByList },
        //   });
        // }
        //
        // if (!commonUtils.isEmptyObject(slave6Config)) {
        //   let conditonValues6 = {};
        //   const sSqlCondition1 = slave6Config.sSqlCondition;
        //   if (commonUtils.isNotEmptyObject(sSqlCondition1)) {
        //     conditonValues6 = this.props.getSqlCondition(slave6Config, 'slave', record);
        //   }
        //    this.props.handleGetDataSet({
        //     name: 'slave6', configData: slave6Config, condition: { pageNum, pageSize, bFilter:[], sFilterOrderBy:slaveOrderBy, sSqlCondition: conditonValues6, sGroupList:sGroupByList },
        //   });
        // }
        //
        // if (!commonUtils.isEmptyObject(slave7Config)) {
        //   let conditonValues7 = {};
        //   const sSqlCondition1 = slave7Config.sSqlCondition;
        //   if (commonUtils.isNotEmptyObject(sSqlCondition1)) {
        //     conditonValues7 = this.props.getSqlCondition(slave7Config, 'slave', record);
        //   }
        //    this.props.handleGetDataSet({
        //     name: 'slave7', configData: slave7Config, condition: { pageNum, pageSize, bFilter:[], sFilterOrderBy:slaveOrderBy, sSqlCondition: conditonValues7, sGroupList:sGroupByList },
        //   });
        // }
        //
        // if (!commonUtils.isEmptyObject(slave8Config)) {
        //   let conditonValues8 = {};
        //   const sSqlCondition8 = slave8Config.sSqlCondition;
        //   if (commonUtils.isNotEmptyObject(sSqlCondition8)) {
        //     conditonValues8 = this.props.getSqlCondition(slave8Config, 'slave', record);
        //   }
        //    this.props.handleGetDataSet({
        //     name: 'slave8', configData: slave8Config, condition: { pageNum, pageSize, bFilter:[], sFilterOrderBy:slaveOrderBy, sSqlCondition: conditonValues8, sGroupList:sGroupByList },
        //   });
        // }
        //
        // if (!commonUtils.isEmptyObject(slave9Config)) {
        //   let conditonValues9 = {};
        //   const sSqlCondition1 = slave9Config.sSqlCondition;
        //   if (commonUtils.isNotEmptyObject(sSqlCondition1)) {
        //     conditonValues9 = this.props.getSqlCondition(slave9Config, 'slave', record);
        //   }
        //    this.props.handleGetDataSet({
        //     name: 'slave9', configData: slave9Config, condition: { pageNum, pageSize, bFilter:[], sFilterOrderBy:slaveOrderBy, sSqlCondition: conditonValues9, sGroupList:sGroupByList },
        //   });
        // }
        //
        // if (!commonUtils.isEmptyObject(slave10Config)) {
        //   let conditonValues10 = {};
        //   const sSqlCondition10 = slave10Config.sSqlCondition;
        //   if (commonUtils.isNotEmptyObject(sSqlCondition10)) {
        //     conditonValues10 = this.props.getSqlCondition(slave10Config, 'slave', record);
        //   }
        //    this.props.handleGetDataSet({
        //     name: 'slave10', configData: slave10Config, condition: { pageNum, pageSize, bFilter:[], sFilterOrderBy:slaveOrderBy, sSqlCondition: conditonValues10, sGroupList:sGroupByList },
        //   });
        // }
        // if (!commonUtils.isEmptyObject(slave11Config)) {
        //   let conditonValues11 = {};
        //   const sSqlCondition11 = slave11Config.sSqlCondition;
        //   if (commonUtils.isNotEmptyObject(sSqlCondition11)) {
        //     conditonValues11 = this.props.getSqlCondition(slave11Config, 'slave', record);
        //   }
        //   this.props.handleGetDataSet({
        //     name: 'slave11', configData: slave11Config, condition: { pageNum, pageSize, bFilter:[], sFilterOrderBy:slaveOrderBy, sSqlCondition: conditonValues11, sGroupList:sGroupByList },
        //   });
        // }
        // if (!commonUtils.isEmptyObject(slave12Config)) {
        //   let conditonValues12 = {};
        //   const sSqlCondition12 = slave12Config.sSqlCondition;
        //   if (commonUtils.isNotEmptyObject(sSqlCondition12)) {
        //     conditonValues12 = this.props.getSqlCondition(slave12Config, 'slave', record);
        //   }
        //    this.props.handleGetDataSet({
        //     name: 'slave12', configData: slave12Config, condition: { pageNum, pageSize, bFilter:[], sFilterOrderBy:slaveOrderBy, sSqlCondition: conditonValues12, sGroupList:sGroupByList },
        //   });
        // }
        // if (!commonUtils.isEmptyObject(slave13Config)) {
        //   let conditonValues13 = {};
        //   const sSqlCondition13 = slave13Config.sSqlCondition;
        //   if (commonUtils.isNotEmptyObject(sSqlCondition13)) {
        //     conditonValues13 = this.props.getSqlCondition(slave13Config, 'slave', record);
        //   }
        //   this.props.handleGetDataSet({
        //     name: 'slave13', configData: slave13Config, condition: { pageNum, pageSize, bFilter:[], sFilterOrderBy:slaveOrderBy, sSqlCondition: conditonValues13, sGroupList:sGroupByList },
        //   });
        // }
        // if (!commonUtils.isEmptyObject(slave14Config)) {
        //   let conditonValues14 = {};
        //   const sSqlCondition12 = slave14Config.sSqlCondition;
        //   if (commonUtils.isNotEmptyObject(sSqlCondition12)) {
        //     conditonValues14 = this.props.getSqlCondition(slave14Config, 'slave', record);
        //   }
        //   this.props.handleGetDataSet({
        //     name: 'slave14', configData: slave14Config, condition: { pageNum, pageSize, bFilter:[], sFilterOrderBy:slaveOrderBy, sSqlCondition: conditonValues14, sGroupList:sGroupByList },
        //   });
        // }
        // if (!commonUtils.isEmptyObject(slave15Config)) {
        //   let conditonValues15 = {};
        //   const sSqlCondition12 = slave15Config.sSqlCondition;
        //   if (commonUtils.isNotEmptyObject(sSqlCondition12)) {
        //     conditonValues15 = this.props.getSqlCondition(slave15Config, 'slave', record);
        //   }
        //   this.props.handleGetDataSet({
        //     name: 'slave15', configData: slave15Config, condition: { pageNum, pageSize, bFilter:[], sFilterOrderBy:slaveOrderBy, sSqlCondition: conditonValues15, sGroupList:sGroupByList },
        //   });
        // }
      }

      // this.props.onSaveState({
      //   pageLoading: false, ...addStateSlave, ...addStateSlave0, ...addStateSlave1,  ...addStateSlave2, ...addStateSlave3, ...addStateSlave4,
      //   ...addStateSlave5, ...addStateSlave6, ...addStateSlave7, ...addStateSlave8, ...addStateSlave9, ...addStateSlave10,...addStateSlave11,...addStateSlave12,
      // });

      this.props.onSaveState({
        pageLoading: false, ...addStateSlave, ...addStateSlave0,
      });

    };

    handleEachChar = async (each, name) => {
      const { token, sModelsId, charConfigAndData, formRoute } = this.state;
      const value = { sProName: each.sProcedureName, paramsMap: each.prodParamsMap };
      const url = `${commonConfig.server_host}business/getProData?sModelsId=${sModelsId}&sName=${formRoute}`;
      const { data: returnData } = await commonServices.postValueService(token, value, url);
      if (returnData.code === 1) {
        const { dataset } = returnData;
        if (commonUtils.isNotEmptyObject(dataset)) {
          const outData = returnData.dataset.rows[0].dataSet.outData[0];
          if (outData.sCode === -1) {
            message.error(outData.sReturn);
          } else {
            const xyData = commonUtils.isEmpty(outData.sReturn) ? [] : JSON.parse(outData.sReturn);
            const index = charConfigAndData.findIndex(item => item.sProcedureName === each.sProcedureName && item.sId === each.sId);
            if (index > -1) {
              charConfigAndData[index].child = xyData;
            }
          }
        }
      } else {
        message.error(returnData.msg);
      }
      this.setState({ charConfigAndData });
    };
    /* 查询后调用的方法 查第一张从表Tab所在表 */
    handleGetSearchData = async (slaveConfig, slaveFilterCondition, page, pageSize, slaveOrderBy, clearSelectData, sGroupByListNew, nextProps, treeFilterCondition) => {
      const { app, slavePagination,  iPageSize, activeKey, sModelsId, token, formRoute, sModelsType, slave0Config } = this.props;
      let tabName = ''; /* 页签所在表 */
      if(commonUtils.isEmptyObject(activeKey)) { /* 默认查从表与slave0表 */
        tabName = 'slave0';
      }else {
         if(activeKey === '2') {
          tabName = 'slave0';
        } else if(activeKey === '3') {
           tabName = 'slave1';
        }else if(activeKey === '4') {
           tabName = 'slave2';
        }else if(activeKey === '5') {
           tabName = 'slave3';
        }else if(activeKey === '6') {
           tabName = 'slave4';
        }else if(activeKey === '7') {
           tabName = 'slave5';
        }else if(activeKey === '8') {
           tabName = 'slave6';
        }else if(activeKey === '9') {
           tabName = 'slave7';
        }else if(activeKey === '10') {
           tabName = 'slave8';
        }else if(activeKey === '11') {
           tabName = 'slave9';
        }else if(activeKey === '12') {
           tabName = 'slave10';
        }else if(activeKey === '13') {
           tabName = 'slave11';
        }else if(activeKey === '14') {
           tabName = 'slave12';
        }else if(activeKey === '15') {
           tabName = 'slave13';
        }else if(activeKey === '16') {
           tabName = 'slave14';
         }else if(activeKey === '17') {
           tabName = 'slave15';
         }else if(activeKey === '18') {
           tabName = 'slave16';
         }else if(activeKey === '19') {
           tabName = 'slave17';
         }else if(activeKey === '20') {
           tabName = 'slave18';
         }else if(activeKey === '21') {
           tabName = 'slave19';
         }else if(activeKey === '22') {
           tabName = 'slave20';
         }
      }
      const sGroupByList = sGroupByListNew !== undefined ? commonUtils.isEmptyArr(sGroupByListNew) ? null : sGroupByListNew : this.props.sGroupByList;
      const conditonValues = app.currentPane.conditonValues;
      const filterCondition = app.currentPane.filterCondition;
      const bFilter = [];
      const pageNum = commonUtils.isEmpty(page) ? 1 : page;
      if (!commonUtils.isEmptyArr(slaveFilterCondition)) {
        bFilter.push(...slaveFilterCondition);
      }
      if (!commonUtils.isEmptyArr(filterCondition)) {
        bFilter.push(...filterCondition);
      }
      if (!commonUtils.isEmptyArr(treeFilterCondition)) {
        bFilter.push(...treeFilterCondition);
      }
      pageSize = commonUtils.isEmpty(pageSize) ? commonUtils.isEmpty(slavePagination) || commonUtils.isEmpty(slavePagination.pageSize) ? iPageSize : slavePagination.pageSize : pageSize;

      let addStateSlave = {};
      let addStateSlave0 = {};
      if (!commonUtils.isEmptyObject(slaveConfig)) {
        addStateSlave = await this.props.handleGetDataSet({
          name: 'slave',
          configData: slaveConfig,
          condition: {
            pageNum,
            pageSize,
            bFilter,
            sFilterOrderBy: slaveOrderBy,
            sSqlCondition: conditonValues,
            sGroupList: sGroupByList,
          },
          flag: true,
          isWait: true,
          clearSelectData,
        });
      }
      /* 除了第一张表之外的其他所有表格数据 都从第一张表的选中行数据作为查询条件 */
      if(commonUtils.isNotEmptyObject(tabName)) {
        const { masterConfig, [`${tabName}Config`] : tableConfig,  [`${tabName}FilterCondition`]: tableFilterCondition, slaveOrderBy, [`${tabName}Pagination`] : tablePagination,
        } = this.props;
        addStateSlave.slave0Data = [];
        addStateSlave.slave1Data = [];
        addStateSlave.slave2Data = [];
        addStateSlave.slave3Data = [];
        addStateSlave.slave4Data = [];
        addStateSlave.slave5Data = [];
        addStateSlave.slave6Data = [];
        addStateSlave.slave7Data = [];
        addStateSlave.slave8Data = [];
        addStateSlave.slave9Data = [];
        addStateSlave.slave10Data = [];
        addStateSlave.slave11Data = [];
        addStateSlave.slave12Data = [];
        addStateSlave.slave13Data = [];
        addStateSlave.slave14Data = [];
        addStateSlave.slave15Data = [];
        addStateSlave.slave16Data = [];
        addStateSlave.slave17Data = [];
        addStateSlave.slave18Data = [];
        addStateSlave.slave19Data = [];
        addStateSlave.slave20Data = [];
        const { bDefaultCheck } = masterConfig;
        /* 这两个模块单独处理 不勾选但是查询 */
        const bSpecialCheck = sModelsId ==='12710101117356137370500' || sModelsId ==='12710101117253309349270' ? true : false;
        if(commonUtils.isNotEmptyObject(addStateSlave) && commonUtils.isNotEmptyArr(addStateSlave.slaveData) && (bDefaultCheck || bSpecialCheck)) {
          addStateSlave.slaveSelectedRowKeys = bSpecialCheck ? [] : [addStateSlave.slaveData[0].sSlaveId];
          let record =  addStateSlave.slaveData[0]; /* 从表选中行 没有选中行时 取第一行 */
          if (!commonUtils.isEmptyObject(tableConfig)) {
            let conditonValues0 = {};
            let sSqlCondition0 = tableConfig.sSqlCondition;
            if(sModelsType === 'commonListTab/tabColor') {
              sSqlCondition0 = slave0Config.sSqlCondition;
              if (commonUtils.isNotEmptyObject(sSqlCondition0)) {
                conditonValues0 = this.props.getSqlCondition(slave0Config, 'slave', record);
              }
            }else {
              if (commonUtils.isNotEmptyObject(sSqlCondition0)) {
                conditonValues0 = this.props.getSqlCondition(tableConfig, 'slave', record);
              }
            }
            if( commonUtils.isNotEmptyObject(tableConfig.sCharType)) { /* 加载图表 */
              const value = { sProName: tableConfig.sTbName, paramsMap: conditonValues };
              const url = `${commonConfig.server_host}business/getProData?sModelsId=${sModelsId}&sName=${formRoute}`;
              const { data: returnData } = await commonServices.postValueService(token, value, url);
              if (returnData.code === 1) {
                const { dataset } = returnData;
                if (commonUtils.isNotEmptyObject(dataset)) {
                  const outData = returnData.dataset.rows[0].dataSet.outData[0];
                  if (outData.sCode === -1) {
                    message.error(outData.sReturn);
                  } else {
                    const xyData = commonUtils.isEmpty(outData.sReturn) ? [] : JSON.parse(outData.sReturn);
                    addStateSlave0.charConfigAndData = xyData;
                  }
                }
              }
            } else{ /* 加载表格*/
              if (['proc'].includes(tableConfig?.sType)) {
                addStateSlave0 = await this.handleGetProData({ tableConfig, conditonValues:conditonValues0, sModelsId, formRoute, token });
              } else {
                if(sModelsType === 'commonListTab/tabColor') {
                  addStateSlave0 = await  this.props.handleGetDataSet({
                    name: 'slave0', configData: slave0Config, condition: { pageNum, pageSize, bFilter:[], sFilterOrderBy:'', sSqlCondition: conditonValues0, sGroupList:sGroupByList }, isWait: true,
                  });

                }else {
                  addStateSlave0 = await  this.props.handleGetDataSet({
                    name: tabName, configData: tableConfig, condition: { pageNum, pageSize, bFilter:[], sFilterOrderBy:'', sSqlCondition: conditonValues0, sGroupList:sGroupByList }, isWait: true,
                  });
                }

              }
            }
          }
        }
      }
      this.props.onSaveState({
        pageLoading: false, ...addStateSlave, ...addStateSlave0,
      });

    };

    handleGetProData = async (param) => {
      const { tableConfig, conditonValues, sModelsId, formRoute, token, page, pageSize } = param;
      const name = commonUtils.isNotEmptyObject(tableConfig?.sGrd) ? tableConfig?.sGrd : 'slave0';
      const pageNum = commonUtils.isEmpty(page) ? 1 : page;
      const pageTableSize = tableConfig.bPagination ? commonUtils.isNull(tableConfig.iPageSize,10000)  : 10000;
      const value = { sProName: tableConfig.sTbName, paramsMap: conditonValues, pageNum, pageSize:pageTableSize };
      const url = `${commonConfig.server_host}business/getProData?sModelsId=${sModelsId}&sName=${formRoute}`;
      const { data: returnData } = await commonServices.postValueService(token, value, url);
      if (returnData.code === 1) {
        const {dataset} = returnData;
        if (commonUtils.isNotEmptyObject(dataset)) {
          const proData = returnData.dataset.rows?.[0]?.dataSet?.proData;
          if (Array.isArray(proData)) {
            return ({[`${name}Data`]: proData})
          }
        }
      }else if(returnData.code === -8){
        Modal.info({
          title: '温馨提示:',
          content: (
            <div>
              {this.handleGetMsg(returnData.msg)}
            </div>
          ),
          okText: '确认',
          onOk() {},
        });
      } else { /*   失败   */
        this.props.getServiceError(returnData);
      }
      return ({ [`${name}Data`]: [] })
    }
    /* 解析消息 */
    handleGetMsg = (str) => {
      const msgArr = commonUtils.isNotEmptyObject(str) ? str.split('xpm'): '';
      const divStr = [];
      if(commonUtils.isNotEmptyArr(msgArr)) {
        for (let i = 0; i < msgArr.length; i ++) {
          divStr.push(<p>{msgArr[i]}</p>);
        }
      }
      return divStr;
    }
    /**   获取过滤树数据数据   */
    handleGetFilterTreeData= (slaveConfig, slaveFilterCondition, page, slaveOrderBy, props) => {
      const { app } = props === undefined ? this.props : props;
      const conditonValues = app.currentPane.conditonValues;
      const pageNum = commonUtils.isEmpty(page) ? 1 : page;
      this.props.handleGetTreeDataSet({
        name: 'slave',
        configData: slaveConfig,
        condition: {
          pageNum, pageSize: commonConfig.pageSize, bFilter: slaveFilterCondition, sFilterOrderBy: slaveOrderBy, sSqlCondition: conditonValues,
        },
        flag: true,
        clearSelectData: true,
      });
    };

    /**   获取表详情数据   */
    handleGetDataInfo = (slaveInfoConfig, slaveFilterCondition, page, slaveOrderBy, props) => {
      const { app } = props === undefined ? this.props : props;
      const conditonValues = app.currentPane.conditonValues;
      const pageNum = commonUtils.isEmpty(page) ? 1 : page;
      this.props.handleGetDataSet({
        name: 'slaveInfo',
        configData: slaveInfoConfig,
        condition: {
          pageNum, pageSize: commonConfig.pageSize, bFilter: [], sFilterOrderBy: '', sSqlCondition: conditonValues,
        },
        flag: true,
        clearSelectData: true,
      });
    };

    /* 查询单表数据 */
    handleGetDataOne = async (name, slaveInfoConfig, slaveFilterCondition, page, pageSize, slaveOrderBy, props, isWait) => {
      const { slaveData, slaveSelectedRowKeys, sModelsId } = props === undefined ? this.props : props;
      if (commonUtils.isNotEmptyArr(slaveData) && commonUtils.isNotEmptyObject(slaveInfoConfig)) {
        let record = {}; /* 从表选中行 没有选中行时 取第一行 */
        if(commonUtils.isNotEmptyArr(slaveSelectedRowKeys)) {
          const iIndex = slaveData.findIndex(item => item.sSlaveId === slaveSelectedRowKeys[0]);
          if (iIndex > -1) {
            record = slaveData[iIndex];
          }
        }
        let conditonValues = {};
        const sSqlCondition0 = slaveInfoConfig.sSqlCondition;
        if (commonUtils.isNotEmptyObject(sSqlCondition0)) {
          conditonValues = this.props.getSqlCondition(slaveInfoConfig, 'slave', record);
        }
        const pageNum = commonUtils.isEmpty(page) ? 1 : page;
        const pageTableSize = commonUtils.isNotEmptyNumber(pageSize) ? pageSize : commonConfig.pageSize;
        const sFilterOrderBy = name === 'slave' ? slaveOrderBy : '';
        const bFilter = [];
        if(name === 'slave') {
          if (!commonUtils.isEmptyArr(slaveFilterCondition)) {
            bFilter.push(...slaveFilterCondition);
          }
        }else  { /* 不等于从表的页签 */
          if(sModelsId ==='12710101117356137370500' || sModelsId ==='12710101117253309349270') { /* 机台工单追踪单独处理,增加搜索组件的条件 */
            if (!commonUtils.isEmptyArr(this.props?.slaveFilterCondition)) {
              bFilter.push(...this.props?.slaveFilterCondition);
            }
            if(commonUtils.isNotEmptyArr(bFilter)) {
              const iIndex= bFilter.findIndex(item => item.bFilterName ==='bSelected');
              console.log('要删除已存在的bSelected', iIndex);
              if(iIndex > -1) {
                bFilter.splice(iIndex,1);
              }
            }
            if(commonUtils.isNotEmptyArr(bFilter)) {
              if( commonUtils.isEmptyArr(slaveSelectedRowKeys)) {
                const addState ={};
                addState.bFilterName ='bSelected';
                addState.bFilterCondition ='=';
                addState.bFilterValue = false;
                bFilter.push(addState);
              } else {
                const addState = {};
                addState.bFilterName ='bSelected';
                addState.bFilterCondition ='=';
                addState.bFilterValue = true;
                bFilter.push(addState);
              }
            }
          }
        }
        let addState = await this.props.handleGetDataSet({
          name,
          configData: slaveInfoConfig,
          condition: {
            pageNum, pageSize: pageTableSize, bFilter, sFilterOrderBy, sSqlCondition: conditonValues,
          },
          flag: true,
          clearSelectData: true,
          isWait:true,
        });

        if (name === 'slave') {
          addState.slaveSelectedRowKeys = slaveSelectedRowKeys
        }

        if(isWait) {
          if(commonUtils.isEmptyObject(addState)) {
            addState = {};
          }
          addState.pageLoading = false;
          return addState;
        } else {
          this.props.onSaveState({ pageLoading: false, ...addState });
        }
      }
    };

    /* 查询单表图表 */
    handleGetCharOne = async (name, slaveInfoConfig, slaveFilterCondition, page, pageSize, slaveOrderBy, props, isWait, sourceRecord) => {
      const { slaveData,token, sModelsId, slaveSelectedRowKeys, charConfigAndData, formRoute } = props === undefined ? this.props : props;
      if (commonUtils.isNotEmptyArr(slaveData) && commonUtils.isNotEmptyObject(slaveInfoConfig)) {
        let record =  slaveData[0]; /* 从表选中行 没有选中行时 取第一行 */
        console.log('选中行:', slaveSelectedRowKeys);
        if(commonUtils.isNotEmptyArr(slaveSelectedRowKeys)) {
          const iIndex = slaveData.findIndex(item => item.sSlaveId === slaveSelectedRowKeys[0]);
          if (iIndex > -1) {
            record = slaveData[iIndex];
          }
          /* sourceRecord：当前选中行slaveSelectedRowKeys比selectedRowKeys慢一拍, 所有要通过传参的方式传入 */
          if (commonUtils.isNotEmptyObject(sourceRecord)) {
            record = sourceRecord;
          }
        } else if(commonUtils.isNotEmptyObject(sourceRecord)) {
          console.log('slaveSelectedRowKeys为空：', record);
          record = sourceRecord;
        }
        console.log('选中行-record', record);
        let conditonValues = {};
        const sSqlCondition0 = slaveInfoConfig.sSqlCondition;
        if (commonUtils.isNotEmptyObject(sSqlCondition0)) {
          conditonValues = this.props.getSqlCondition(slaveInfoConfig, 'slave', record);
        }
        let addState = {};
        const value = { sProName: slaveInfoConfig.sTbName, paramsMap: conditonValues };
        const url = `${commonConfig.server_host}business/getProData?sModelsId=${sModelsId}&sName=${formRoute}`;
        const { data: returnData } = await commonServices.postValueService(token, value, url);
        if (returnData.code === 1) {
          const { dataset } = returnData;
          if (commonUtils.isNotEmptyObject(dataset)) {
            const outData = returnData.dataset.rows[0].dataSet.outData[0];
            if (outData.sCode === -1) {
              message.error(outData.sReturn);
            } else {
              const xyData = commonUtils.isEmpty(outData.sReturn) ? [] : JSON.parse(outData.sReturn);
              addState = xyData;
              // const index = charConfigAndData.findIndex(item => item.sProcedureName === each.sProcedureName && item.sId === each.sId);
              // if (index > -1) {
              //   addState = xyData;
              // }
            }
          }
        } else {
          message.error(returnData.msg);
        }
        if(isWait) {
          if(commonUtils.isEmptyObject(addState)) {
            addState = {};
          }
          addState.pageLoading = false;
          return addState;
        } else {
          this.props.onSaveState({ pageLoading: false, ...addState });
        }
      }
    };


    /* 获取commonGantte列表数据集 */
    handleGanttChar = async (ganttChart, slaveFilterCondition) => {
      const {
        token, sModelsId, formRoute,
      } = this.props;
      const char = {};
      if (commonUtils.isNotEmptyObject(ganttChart)) {
        char.sProcedureName = ganttChart.sProcedureName;
        char.paramsMap = {};
      }
      let charGanttData = {};
      const value = {
        sProName: char.sProcedureName,
        paramsMap: char.prodParamsMap,
        bFilter: slaveFilterCondition,
      };
      const url = `${commonConfig.server_host}business/getProData?sModelsId=${sModelsId}&sName=${formRoute}`;
      const { data: returnData } = await commonServices.postValueService(token, value, url);
      if (returnData.code === 1) {
        const { dataset } = returnData;
        if (commonUtils.isNotEmptyObject(dataset)) {
          const outData = returnData.dataset.rows[0].dataSet.outData[0];
          if (outData.sCode === -1) {
            message.error(outData.sReturn);
          } else {
            charGanttData = commonUtils.isEmpty(outData.sReturn) ? [] : JSON.parse(outData.sReturn);
            this.props.onSaveState({ charGanttData });
          }
        }
      } else {
        message.error(returnData.msg);
      }
    };


    handleTitleChange = (name, slavePagination, filters, sorter) => {
      this.props.onSaveState({ [`${name}Pagination`]: slavePagination });
      const {
        slaveConfig, slaveFilterCondition, sGroupByList,[`${name}Config`] : tableConfig, [`${name}FilterCondition`]: tableFilterCondition,
      } = this.props;
      let bGetData = true;
      if (commonUtils.isNotEmptyObject(filters)) {
        for (const key of Object.keys(filters)) {
          if (commonUtils.isNotEmptyArr(filters[key])) {
            bGetData = false;
            break;
          }
        }
      }
      if (!bGetData) return;
      const { treeFilterCondition } = this.props;/* 树过滤条件 */
      const sort = sorter.order === 'ascend' ? 'asc' : 'desc';
      const slaveOrderBy = Object.keys(sorter).length > 0 ? { [sorter.columnKey]: sort } : ''; // 后端未支持空对象， 先用空表示
      if (commonUtils.isNotEmptyArr(treeFilterCondition)) { /* 判断是否有树过滤条件 */
        this.handleGetData(slaveConfig, slaveFilterCondition, slavePagination.current, slavePagination.pageSize, slaveOrderBy, '', sGroupByList, '', treeFilterCondition);
      } else {
        this.handleGetDataOne(name, tableConfig, slaveFilterCondition, slavePagination.current, slavePagination.pageSize, slaveOrderBy);
        // this.handleGetData(slaveConfig, slaveFilterCondition, slavePagination.current, slavePagination.pageSize, slaveOrderBy, '', sGroupByList, '', treeFilterCondition,
        //   slave0Config, slave1Config, slave2Config, slave3Config, slave4Config, slave5Config, slave6Config, slave7Config, slave8Config, slave9Config, slave10Config,
        //   slave11Config, slave12Config,  slave13Config, slave14Config, slave15Config);
      }
    };

    handleDoubleClick = async (record) => {
      const {
        slaveConfig,
        slaveData,
        dispatch,
        slaveFilterCondition,
        slavePagination,
        slaveOrderBy,
        sModelsType,
        formRoute,
        treeFilterCondition,
        app,
        iPageSize,
        // slaveSelectedData,
        // masterData,
        // employeeConfig,
      } = this.props;
      // oee双击查看开工任务
      // if (formRoute.indexOf('indexOee') > -1) {
      //   if (slaveSelectedData[0].sCompleteCheck !== 'bCompleteCheck' && commonUtils.isNotEmptyArr(slaveSelectedData)) {
      //     this.props.changePage(false, 'startWork', '2', false);
      //     this.props.onSaveState({
      //       masterData: slaveSelectedData[0],
      //     });
      //     if (commonUtils.isNotEmptyObject(record)) {
      //       const bFilter1 = [];
      //       bFilter1.push({
      //         bFilterName: 'sParentId',
      //         bFilterCondition: '=',
      //         bFilterValue: record.sId,
      //       });
      //       const employeeData = (await this.props.handleGetDataSet({
      //         name: 'employee',
      //         configData: employeeConfig,
      //         condition: { bFilter: bFilter1 },
      //         isWait: true,
      //       }));
      //       this.props.onSaveState({
      //         ...employeeData,
      //       });
      //     }
      //   }
      // } else {}
      const picArr = slaveConfig.gdsconfigformslave.filter(item => (item.sName === 'picArr'));
      const getData = this.handleGetData;
      if (picArr.length > 0) {
        let sActiveId = '';
        if (picArr[0].sName === 'picArr' && picArr[0].sDropDownType === 'picArr' && sModelsType !== 'commonList/msg') {
          [{ sActiveId }] = picArr;
          if (sActiveId === '1') {
            sActiveId = sActiveId === '1' ? commonUtils.isEmpty(record.sFormId) ? record.sSrcFormId : record.sFormId : sActiveId;
          }
        } else if (picArr[0].sName === 'picArr' && picArr[0].sDropDownType === 'picArr' && sModelsType === 'commonList/msg' && (record.sType === '消息' || record.sType === '1')) {
          [{ sActiveId }] = picArr;
        } else if (sModelsType === 'commonList/msg' && (record.sType !== '消息' || record.sType !== '1')) {
          sActiveId = '19211681019715633459786050';
        }
        /* 消息列表双击打开时 调用获取websocket消息 */
        if (sModelsType === 'commonList/msg') {
          const { webSocket, userinfo } = app;
          webSocket.onmessageTmp = async (msg) => {
            const rtmsg = JSON.parse(msg.data);
            if (rtmsg.action === 'showImg') {
              const msgData = JSON.parse(msg.data);
              dispatch({ type: 'app/saveMsgCount', payload: { msgCount: msgData.msg } });
            }
          };
          this.props.handleSendSocketMessage('reflush', 'showImg', record.sId, userinfo.sId, '您有消息待审核', null);
          if (this.props.app.currentPane.refresh !== undefined) {
            this.props.app.currentPane.refresh();
          }
        }
        const sNameUrl = `${commonConfig.server_host}gdsmodule/getGdsmoduleById/${sActiveId}?sModelsId=${sActiveId}&sName=${formRoute}`;
        dispatch({
          type: 'content/onRouter',
          payload: {
            refresh: getData.bind(this, slaveConfig, slaveFilterCondition, commonUtils.isEmpty(slavePagination) ? 0 : slavePagination.current, slavePagination.pageSize, slaveOrderBy, undefined, undefined, undefined, treeFilterCondition), /*   刷新方法   */
            url: sNameUrl,
            sTabId: commonUtils.createSid(),
            sParentId: this.state.sTabId,
            urlDataType: 'newPane',
            checkedId: record.sId,
            bFilter: slaveFilterCondition,
            pageSize: commonUtils.isNotEmptyNumber(iPageSize) && iPageSize !== 0 ? iPageSize : commonConfig.pageSize,
            pages: slavePagination,
            currentData: slaveData,
            sListFormmasterId: slaveConfig.sId,
            newKey: record.sId,
            currentIndex: slaveData.findIndex(item => item.sId === record.sId),
            sSrcModelsId: this.props.sModelsId,
          },
        });
      }
    };

    /**   表单回带   */
    handleForm = (form) => {
      this.form = form;
    };

    /**  点击新增按钮   */
    handleAdd = (extendsParams) => {
      const {
        slaveConfig, slaveData, dispatch, slaveFilterCondition, slavePagination, slaveOrderBy, formRoute, treeFilterCondition, iPageSize,
      } = this.props;
      const picArr = slaveConfig.gdsconfigformslave.filter(item => (item.sName === 'picArr'));
      const getData = this.handleGetData;
      if (picArr.length > 0) {
        let sActiveId = '';
        if (picArr[0].sName === 'picArr' && picArr[0].sDropDownType === 'picArr') {
          [{ sActiveId }] = picArr;
        }
        const sNameUrl = `${commonConfig.server_host}gdsmodule/getGdsmoduleById/${sActiveId}?sModelsId=${sActiveId}&sName=${formRoute}`;
        dispatch({
          type: 'content/onRouter',
          payload: {
            refresh: getData.bind(this, slaveConfig, slaveFilterCondition, commonUtils.isEmpty(slavePagination) ? 0 : slavePagination.current, commonUtils.isEmpty(slavePagination) ? iPageSize : slavePagination.pageSize, slaveOrderBy, undefined, undefined, undefined, treeFilterCondition), /*   刷新方法   */
            url: sNameUrl,
            sTabId: commonUtils.createSid(),
            sParentId: this.state.sTabId,
            urlDataType: 'newPane',
            bFilter: slaveFilterCondition,
            pageSize: iPageSize,
            pages: slavePagination,
            currentData: slaveData,
            sListFormmasterId: slaveConfig.sId,
            ...extendsParams,
            sSrcModelsId: this.props.sModelsId,
          },
        });
      }
    };

    /* 确定要删除 */
    handleOkDel = async (props) => {
      /*   数据参数   */
      const {
        token, sModelsId, slaveConfig, slaveData, slaveSelectedRowKeys, slaveFilterCondition, slavePagination, slaveOrderBy, formRoute, app, iPageSize,
      } = props;
      const allId = [];
      slaveSelectedRowKeys.forEach((key) => {
        const iIndex = slaveData.findIndex(item => item.sSlaveId === key);
        if (iIndex > -1) {
          if (allId.indexOf(slaveData[iIndex].sId) === -1) {
            allId.push(slaveData[iIndex].sId);
          }
        }
      });
      if (commonUtils.isNotEmptyArr(allId)) {
        const value = {
          sClientType: '1',
          data: {
            sMasterTable: slaveConfig.sTbName,
            sId: allId,
            sSlaveTable: 'commonList',
          },
        };
        const { sBillNo, sId } = props.masterData || {};
        const url = `${commonConfig.server_host}business/delMasSlaBusinessData?sModelsId=${sModelsId}&sName=${formRoute}&sBillNo=${sBillNo}&sSysLogSrcId=${sId}`;
        /*   接收返回值   */
        const { data } = await commonServices.postValueService(token, value, url);
        if (data.code === 1) {
          /*   数据删除成功   */
          const oeeCurrentStateFilter = [];
          if (formRoute === '/indexOee/oeeCurrentState') {
            oeeCurrentStateFilter.push({
              bFilterName: 'sMachineId',
              bFilterCondition: '=',
              bFilterValue: app.sMachineNameSId,
            });
          }
          message.success(data.msg);
          this.props.handleGetDataSet({
            name: 'slave',
            configData: slaveConfig,
            condition: {
              pageNum: formRoute === '/indexOee/oeeCurrentState' ? '' : slavePagination.current,
              pageSize: formRoute === '/indexOee/oeeCurrentState' ? '' : commonUtils.isNotEmptyNumber(iPageSize) && iPageSize !== 0 ? iPageSize : commonConfig.pageSize,
              bFilter: formRoute === '/indexOee/oeeCurrentState' ? oeeCurrentStateFilter : slaveFilterCondition,
              slaveOrderBy: formRoute === '/indexOee/oeeCurrentState' ? '' : slaveOrderBy,
            },
            clearSelectData: true,
          });
        } else { /*   失败   */
          this.props.getServiceError(data);
        }
      }
    };

    handleDel = () => {
      const onOkDel = this.handleOkDel;
      const props = this.props;
      confirm({
        title: commonFunc.showMessage(props.app.commonConst, 'SureDel'),
        onOk() {
          onOkDel(props);
        },
        onCancel() {},
      });
    };
    // 销售订单明细获取订单号
    handleGetGoods = () => {
      this.props.onSaveState({ visibleGetGoods: true });
    };

    handleGetGoodsValue = async (value) => {
      const { sModelsId, token, formRoute } = this.props;
      const url = `${commonConfig.server_host}erpOrderProcurement/getPlatOrderOne?sModelsId=${sModelsId}&sName=${formRoute}`;
      const values = { orderHeaderId: value };

      const masterReturn = (await commonServices.postValueService(token, values, url)).data;
      if (masterReturn.code === 1) {
        message.success(masterReturn.msg);
        this.handleButtonClick('BtnRefresh');
      } else {
        this.props.getServiceError(masterReturn);
      }

      this.props.onSaveState({
        visibleGetGoods: false,
      });
    }
    handleGetGoodsCancle = () => {
      this.props.onSaveState({
        visibleGetGoods: false,
      });
    }

    /* 导出Excel */
    handleOut = async (name) => {
      const slaveConfig = this.props[`${name}Config`];
      const slaveData = this.props[`${name}Data`];
      const slaveFilterCondition = this.props[`${name}FilterCondition`];
      const slaveOrderBy = this.props[`${name}OrderBy`];
      const slaveSelectedRowKeys = this.props[`${name}SelectedRowKeys`];
      const { formRoute, sGroupByList, app, masterData, slaveData: _slaveData } = this.props;
      const { currentPane } = app;
      const slaveFilterConditionNew = slaveFilterCondition === undefined ? [] : [...slaveFilterCondition];

      if (commonUtils.isEmptyArr(slaveData)) {
        return;
      }

      let sids = '';
      let bMutiSelect = false; /* 默认单选或不选  true ：多选 */
      if (commonUtils.isNotEmptyArr(slaveConfig)) {
        bMutiSelect = slaveConfig.bMutiSelect;
      }
      if (commonUtils.isNotEmptyArr(slaveSelectedRowKeys) && bMutiSelect) { /* 导出Excel 只有多选情况下 导出时是根据勾选行 否则导出全部 */
        slaveSelectedRowKeys.forEach((item, i) => {
          if (i === slaveSelectedRowKeys.length - 1) {
            sids = `${sids}${item}`;
          } else {
            sids = `${sids}${item},`;
          }
        });
        const addFilter = {};
        addFilter.bFilterName = 'sSlaveId';
        addFilter.bFilterCondition = 'in';
        addFilter.bFilterValue = sids;
        slaveFilterConditionNew.push(addFilter);
      }

      let slaveRow = {};
      if(commonUtils.isNotEmptyArr(slaveData)) {
        if(commonUtils.isNotEmptyArr(slaveSelectedRowKeys)) {
          slaveRow = slaveData.find(item => slaveSelectedRowKeys.includes(item.sSlaveId));
        }else {
          slaveRow = slaveData[0];
        }
      }

      /* 如果列表是别的界面弹窗进来，则需要加当前界面的条件 */
      let conditionValues = {};
      const { sSqlCondition } = slaveConfig;
      if (sSqlCondition) {
        const tableType = sSqlCondition.split('.')[0];
        const record = tableType === 'slave' ? _slaveData[0] : masterData;
        conditionValues = this.props.getSqlCondition(slaveConfig, tableType, record);
      } else if(commonUtils.isNotEmptyObject(currentPane) && !commonUtils.isEmpty(currentPane.conditonValues)) {
        conditionValues = currentPane.conditonValues;
      }

      /* 导出使用Post提交 */
      const url = `${commonConfig.server_host}excel/export/${slaveConfig.sId}?sModelsId=${slaveConfig.sParentId}&sName=${formRoute}&token=${encodeURIComponent(this.props.app.token)}`;
      const bFilter = JSON.stringify(slaveFilterConditionNew);
      const sFilterOrderBy = JSON.stringify(slaveOrderBy);
      const sGroupList = JSON.stringify(sGroupByList);
      const conditionValuesStr = JSON.stringify(conditionValues);
      const sRowData = JSON.stringify(slaveRow)
      this.handleOpenOut(url, bFilter, sFilterOrderBy, sGroupList, conditionValuesStr, sRowData);
    };

    /* Get提交地址栏参数过多,更改Get提交为Post提交 */
    handleOpenOut= (url, bFilter, slaveOrderBy, sGroupByList, conditionValues, sRowData) => {
      const newWin = window.open();
      let formStr = '';
      // 设置样式为隐藏，打开新标签再跳转页面前，如果有可现实的表单选项，用户会看到表单内容数据
      formStr = `<form style="visibility:hidden;" method="POST" action="${url}">` +
        `<input type="hidden" name="bFilter" value='${bFilter}' />`;
      if (commonUtils.isNotEmptyObject(slaveOrderBy)) {
        formStr += `<input type="hidden" name="sFilterOrderBy" value='${slaveOrderBy}' />`;
      }
      if (commonUtils.isNotEmptyObject(sGroupByList)) {
        formStr += `<input type="hidden" name="sGroupList" value='${sGroupByList}' />`;
      }
      if (commonUtils.isNotEmptyObject(conditionValues)) {
        formStr += `<input type="hidden" name="sSqlCondition" value='${conditionValues}' />`;
      }
      if (commonUtils.isNotEmptyObject(sRowData)) {
        formStr += `<input type="hidden" name="sRowData" value='${sRowData}' />`;
      }
      formStr += '</form>';
      newWin.document.body.innerHTML = formStr;
      newWin.document.forms[0].submit();
      return newWin;
    }

    /* 批量审核 */
    handleBatchExamine = () => {
      this.handleAudit(1);
    };

    /* 批量消审 */
    handleBatchCancelExamine = () => {
      this.handleAudit(0);
    };

    deteleObject = (obj) => {
      // eslint-disable-next-line camelcase
      const replace_data = obj;
      const result = []; // 去重后的数组对象集合
      const hash = {};
      // eslint-disable-next-line no-plusplus
      for (let i = 0; i < replace_data.length; i++) {
        const elem = replace_data[i].sId;
        if (!hash[elem]) {
          result.push(replace_data[i]);
          hash[elem] = true;
        }
      }
      return result;
    }
    /**   toolbar批量审核(消审)   */
    handleAudit = async (flag) => {
      /*   待用数据声明   */
      const {
        slaveSelectedData, app, slaveConfig, slavePagination, slaveFilterCondition, slaveOrderBy,
      } = this.props;
      /*   作废订单不能审核   */
      if (commonUtils.isNotEmptyArr(slaveSelectedData)) {
        const slaveSelectedDataNew = this.deteleObject(slaveSelectedData); // 删除sid重复的数据
        let allMsg = '';
        let allErrorMsg = '';
        let dataAuditProcessValue = 0;
        const dataAuditProcessMaxValue = slaveSelectedDataNew.length;
        for (const child of slaveSelectedDataNew) {
          if (child.bInvalid) {
            message.warning(`已作废的单据${child.sBillNo}不能审核！`);
            return '';
          }
          /**   数据审核   */
          const strMsgs = await this.dataAudit(flag, `${child.sId}_${child.sFormId}`, child.sBillNo);
          if (commonUtils.isNotEmptyStr(strMsgs.strMsg)) {
            allMsg += `${strMsgs.strMsg} \n `;
          } else {
            allMsg += '';
          }
          if (commonUtils.isNotEmptyStr(strMsgs.strErrorMsg)) {
            allErrorMsg += `${strMsgs.strErrorMsg} \n `;
          } else {
            allErrorMsg += '';
          }
          dataAuditProcessValue += 1;
          this.props.onSaveState({ bDataAuditProgress: true, dataAuditProcessValue, dataAuditProcessMaxValue });
        }
        if (commonUtils.isNotEmptyStr(allMsg)) {
          message.info(allMsg);
        }
        if (allErrorMsg !== undefined && commonUtils.isNotEmptyStr(allErrorMsg)) {
          message.error(allErrorMsg);
        }
        this.handleGetData(slaveConfig, slaveFilterCondition, slavePagination.current, slavePagination.pageSize, slaveOrderBy, true); /*   刷新方法   */
        this.props.onSaveState({ bDataAuditProgress: false });
      } else {
        message.error(commonFunc.showMessage(app.commonConst, 'pleaseChooseData'));/* 请选择一条数据 */
      }
    };

    /**   数据审核   */
    dataAudit = async (flag, sId_sFormId, sBillNo, tmpCheck, isWait) => {
      const [sId, sFormId] = sId_sFormId.split('_');
      /*   待用数据声明   */
      const {
        sModelsId, app, slaveConfig, formRoute,
      } = this.props;
      /*   数据参数   */
      const picArr = slaveConfig.gdsconfigformslave.filter(item => (item.sName === 'picArr'));
      const value = {
        sClientType: '1',
        paramsMap: {
          iFlag: flag,
          iTmpCheck: commonUtils.isEmptyNumber(tmpCheck) ? 0 : tmpCheck,
          sFormGuid: commonUtils.isEmptyArr(picArr) ? sFormId : picArr[0].sActiveId,
          sGuid: sId,
        },
      };
      /*   数据审核   */
      const url = `${commonConfig.server_host}business/doExamine?sModelsId=${sModelsId}&sName=${formRoute}`;
      const returnData = (await commonServices.postValueService(app.token, value, url)).data;
      const msgs = {};
      if (isWait) {
        return returnData;
      } else {
        /*   接收返回值   */
        if (returnData.code === 1) { /*   成功   */
          if (flag === 1) {
            /*   审核   */
            const { outData } = returnData.dataset.rows[0].dataSet;
            if (commonUtils.isNotEmptyStr(outData[0].sReturn)) {
              msgs.strMsg = commonUtils.isNotEmptyObject(sBillNo) ? `${sBillNo}${outData[0].sReturn}` : `${outData[0].sReturn}`;
              // if (outData[0].sReturn.split('-').length < 2) {
              //   // 正常业务提示，非审核模板
              //   if (this.props.app.currentPane.refresh !== undefined) {
              //     this.props.app.currentPane.refresh();
              //   }
              //   msgs.strMsg = `${sBillNo}审核${outData[0].sReturn}`;
              //   return msgs;
              // }
              // const sReturnArray = outData[0].sReturn.split('|');
              // const sCheckModelId = sReturnArray[0].split('-')[1];
              // if (commonUtils.isNotEmptyStr(sCheckModelId)) {
              //   msgs.strMsg = `${sBillNo}审核失败`;
              // }
            } else {
              // this.handleGetData(slaveConfig, slaveFilterCondition, slavePagination.current, slavePagination.pageSize, slaveOrderBy, true); /*   刷新方法   */
              // message.destroy();
              msgs.strMsg = commonUtils.isNotEmptyObject(sBillNo) ? `${sBillNo}${returnData.msg}` : `${returnData.msg}`;
            }
          } else {
            /*   消审   */
            const { outData } = returnData.dataset.rows[0].dataSet;
            if (commonUtils.isNotEmptyStr(outData[0].sReturn)) {
              msgs.strMsg = commonUtils.isNotEmptyObject(sBillNo) ? `${sBillNo}${outData[0].sReturn}` : `$${outData[0].sReturn}`;
            } else {
              // this.handleGetData(slaveConfig, slaveFilterCondition, slavePagination.current, slavePagination.pageSize, slaveOrderBy, true); /*   刷新方法   */
              msgs.strMsg = commonUtils.isNotEmptyObject(sBillNo) ? `${sBillNo}${returnData.msg}` : `${returnData.msg}`;
            }
          }
        } else { /*   失败   */
          msgs.strErrorMsg = returnData.msg;
          // this.props.getServiceError(returnData);
        }
        return msgs;
      }
    };

    /** 按钮操作事件 */
    handleButtonClick = (name, isFresh) => {
      if (name.split('.')[0] === 'BtnOut') {
        const tableName = commonUtils.isNotEmptyObject(name.split('.')[1]) ? name.split('.')[1] : 'slave' ;
        this.handleOut(tableName);
      } else if (name === 'BtnDesignFunction') {
        this.handleDesignFunction();
      } else if (name === 'BtnRefresh') {
        const {
          slaveConfig, slavePagination, slaveFilterCondition, slaveOrderBy,
        } = this.props;
        this.props.onSaveState({
          clearArray: [], searchText: '', slaveSelectedRowKeys: [], slaveSelectedData: [], slaveInfoSelectedRowKeys: [], slaveInfoSelectedData: [], treeSelectedKeys: [], treeFilterCondition: [], loading: false, pageLoading: true, isFresh,
        });
        if (slavePagination === undefined) return;
        this.handleGetData(slaveConfig, slaveFilterCondition, slavePagination.current, slavePagination.pageSize, slaveOrderBy, true); /*   刷新方法   */
        // if (formRoute === '/indexPage/materialRequirementsPlanning') {
        //   if (commonUtils.isNotEmptyObject(slaveInfoConfig)) {
        //     this.handleGetDataInfo(slaveInfoConfig, slaveFilterCondition, 1);
        //   }
        // }
        /* 判断是否要加载过滤树数据 */
        const filterTreeConfigArr = slaveConfig.gdsconfigformslave.filter(item => item.bTree);
        if (commonUtils.isNotEmptyArr(filterTreeConfigArr)) {
          const filterTreeConfig = filterTreeConfigArr[0];
          this.handleGetFilterTreeData(filterTreeConfig, slaveFilterCondition, 1);
        }
        const { clearArray } = this.props;
        if (!commonUtils.isEmpty(clearArray)) {
          for (const item of clearArray) {
            const { confirm, clearFilters } = item;
            confirm();
            clearFilters();
          }
        }
      } else if (name === 'BtnSelect') {
        const { slaveSelectedData, app } = this.props;
        if (commonUtils.isNotEmptyArr(slaveSelectedData)) {
          this.props.app.currentPane.select(this.props.app.currentPane.name, this.props.app.currentPane.config, slaveSelectedData);
        } else {
          message.error(commonFunc.showMessage(app.commonConst, 'pleaseChooseData')); /* 请选择一条数据 */
        }
      } else if (name === 'BtnSelectCancel') {
        this.props.app.currentPane.selectCancel(this.props.app.currentPane.name);
      } else if (name === 'BtnBatchExamine') {
        this.handleBatchExamine();
      } else if (name === 'BtnBatchCancelExamine') {
        this.handleBatchCancelExamine();
      } else if (name === 'BtnNoForceComplete') {
        this.handleNoForceComplete();
      } else if (name === 'BtnSettleAccounts') {
        this.handleToSettlement(1);
      } else if (name === 'BtnReverseCheckout') {
        this.handleToSettlement(2);
      } else if (name === 'BtnBatchWorkListPriceUpdate') { /* 工单列表价格批量更新 */
        this.handleBatchWorkListsPriceUpdate();
      }
    };
    /* OEE机台任务 点击开工执行的逻辑 */
    handleOeeCopyTo = async (name) => {
      const {
        token, app, sModelsId, slaveSelectedData, slaveConfig, slaveDelData,
      } = this.props;
      const newCopyTo = {};
      const slaveData = [];
      if (commonUtils.isNotEmptyArr(slaveSelectedData)) {
        // 验证是否单据是否使用
        const sMachineId = app.sMachineNameSId;
        const creatId = commonUtils.createSid();
        const dataUrl = `${commonConfig.server_host}bill/billCopyToCheckWork?sModelsId=${sModelsId}`;
        const values = { sMachineId };
        const dataReturn = (await commonServices.postValueService(token, values, dataUrl)).data;
        if (dataReturn.code === 1) {
          const copyToConfig = commonUtils.isNotEmptyObject(slaveConfig) ? slaveConfig.gdsconfigformslave.filter(item => item.sControlName === name) : '';
          const slaveAssignField = commonUtils.isNotEmptyObject(copyToConfig) ? copyToConfig[0].sAssignField : '';
          slaveSelectedData.forEach((slaveItem) => {
            newCopyTo.slave = slaveItem;
            let colorRow = commonFunc.getDefaultData(slaveConfig, newCopyTo); // 取默认值
            colorRow = { ...colorRow, ...commonFunc.getAssignFieldValue(slaveAssignField, slaveItem, newCopyTo) }; // 取赋值字段
            colorRow.handleType = 'add';
            colorRow.sStatus = 'adjustment'; /* 点击开工进来是调机中，原来是生产中 */
            colorRow.sId = creatId;
            colorRow.sTeamId = app.sTeamNameSId;
            colorRow.sMachineId = app.sMachineNameSId;
            colorRow.sParentId = colorRow.sId;
            colorRow.tCreateDate = new Date();
            slaveData.push(colorRow);
          });
          const params = {};
          params.data = [];
          params.data.push(commonBusiness.mergeData('slave', 'plc_machinedata', slaveData, slaveDelData));
          // params.data = slaveData;
          const BtnSave = commonFunc.showMessage(app.commonConst, 'BtnSave');/* 保存 */
          params.optName = BtnSave;
          params.sClientType = '1';
          const returnData = await commonBusiness.saveData({ token, value: params, sModelsId });
          if (commonUtils.isNotEmptyObject(returnData)) {
            if (returnData.code === 1) {
              // const copyTo = {};
              // copyTo.name = name;
              // copyTo.config = commonUtils.isNotEmptyArr(copyToConfig) ? copyToConfig[0] : {};
              // copyTo.slaveData = slaveData;
              // copyTo.copyOtherData = [];
              // dispatch({
              //   type: 'content/onRouter',
              //   payload: {
              //     url: `${commonConfig.server_host}gdsmodule/getGdsmoduleById/${sActiveId}?sModelsId=${sActiveId}&sName=${formRoute}`, /*   接口地址   */
              //     copyTo,
              //   },
              // });
              // 改变indexOee中的activeKey,
              this.props.onSaveCurrentState(slaveData, true, undefined, undefined, 1);
            }
          }
        } else {
          this.props.getServiceError(dataReturn);
        }
      }
    }
    handleOeeLabelCopyTo = async (name, sActiveId) => {
      const {
        slaveSelectedData, dispatch,
      } = this.props;
      if (commonUtils.isNotEmptyArr(slaveSelectedData)) {
        const formRouteNew = '/indexOee/labelPrint';
        dispatch({
          type: 'content/onRouter',
          payload: {
            url: `${commonConfig.server_host}gdsmodule/getGdsmoduleById/${sActiveId}?sModelsId=${sActiveId}&sName=${formRouteNew}`, /*   接口地址   */
            sSrcModelsId: this.props.sModelsId,
          },
        });
      }
    }

    /*   单据页复制到   */
    handleCopyTo = async (name, sActiveId) => {
      /*   待用数据声明   */
      const {
        slaveConfig, slaveSelectedData, token, app, sModelsId, formRoute, slaveInfoConfig, slaveInfoSelectedData, slaveFilterCondition,
        slavePagination, slaveOrderBy, treeFilterCondition, dispatch,
      } = this.props;

      // 从表有sCopyToCondition则不能复制，并提示
      if (commonUtils.isNotEmptyArr(slaveSelectedData) && name.includes('.')) {
        const sCopyToConditionIndex = slaveSelectedData.findIndex(item => item.sCopyToCondition);
        if (sCopyToConditionIndex !== -1) {
          message.warning(slaveSelectedData[sCopyToConditionIndex].sCopyToCondition);
          return;
        }
      }

      let isRefresh = true;
      const copyTo = {};
      if (commonUtils.isNotEmptyArr(slaveSelectedData)) {
        const copyToConfig = slaveConfig.gdsconfigformslave.filter(item => item.sControlName.includes(name));
        let copyToData = JSON.parse(JSON.stringify(slaveSelectedData || []));
        const addcopyOther = [];
        let tbSuffix = '';
        if (formRoute === '/indexPage/materialRequirementsPlanning') {
          if (name === 'BtnCopyTo.ActPurchaseOrder') {
            const detailCopy = {};
            detailCopy.name = 'detail';
            detailCopy.config = slaveInfoConfig;
            detailCopy.data = slaveInfoSelectedData;
            addcopyOther.push(detailCopy);
            tbSuffix = 'detail';
            isRefresh = true;
          } else {
            copyToData = slaveInfoSelectedData;
            isRefresh = true;
          }
          /* 物料需求计划生成采购申请、采购订单去重处理 */
          if (commonUtils.isNotEmptyArr(copyToData)) {
            const copyToDataNew = [];
            copyToData.forEach((item) => {
              const iIndex = copyToDataNew.findIndex(child => child.sWorkOrderMaterialId === item.sWorkOrderMaterialId);
              if (iIndex < 0) {
                copyToDataNew.push(item);
              }
            });
            copyToData = copyToDataNew;
          }
        } else if (name === 'BtnCopyTo.ActProduceReport') { /* 若机台中点击暂停 则待产量上报中点击上报提示”工序已暂停，无法上报 */
          if (commonUtils.isNotEmptyArr(copyToData) && copyToData[0].sState === '3') {
            message.warn('工序已暂停，无法开工！');
            return;
          }
        } else if (commonUtils.isNotEmptyObject(name) && name.includes('ActOutsideProcessTemp')) { /* 根据配置下拉sql获取数据源 */
          const tmpInfoConfig = slaveConfig.gdsconfigformslave.filter(item => item.sControlName.includes('gettempinfosql')); /* 自定义数据源按钮配置 */
          if(commonUtils.isNotEmptyArr(tmpInfoConfig)) {
            const slaveDataRow = slaveSelectedData[0];
            let sSqlConditonStr = '';
            if(commonUtils.isNotEmptyArr(slaveSelectedData)) {
              slaveSelectedData.forEach((slaveItem) => {  /*   opsoutsideprocessslave 发外多条时取最后一条的表 */
                sSqlConditonStr  +=  this.props.getSqlCondition(tmpInfoConfig[0], 'slave', slaveItem).sControlProcessId + ',';
              });
            }
            sSqlConditonStr = commonUtils.isNotEmptyObject(sSqlConditonStr) ? sSqlConditonStr.substr(0, sSqlConditonStr.length - 1) : '';
            slaveDataRow.sControlProcessId = sSqlConditonStr;
            const sqlDropDownData = await this.props.getSqlDropDownData(sModelsId, 'slave', tmpInfoConfig[0], slaveDataRow);
            if(commonUtils.isNotEmptyArr(sqlDropDownData)) {
              /* Opsoutsidematerials  发外带料表       opsoutsideprocessslave 发外多条时取最后一条的表                       Opsoutsideinstoredetail 未清勾选过去的表 */
              copyTo.slaveData = sqlDropDownData; /* Opsoutsidematerials  发外带料表 */
            }
            if(commonUtils.isNotEmptyArr(slaveSelectedData)) {
              const groupMap ={};
              slaveSelectedData.sort((g1, g2) => {
                let  sPartOrder1 = commonUtils.isEmpty(g1.rowNum) ? 0 : g1.rowNum;
                let  sPartOrder2 = commonUtils.isEmpty(g2.rowNum) ? 0 : g2.rowNum;
                return sPartOrder1  - sPartOrder2;
              });
              slaveSelectedData.forEach((slaveItem) => {  /*   opsoutsideprocessslave 发外多条时取最后一条的表 */
                const sKey = slaveItem.sWorkorderNo + '-' + slaveItem.sControlId;
                groupMap[sKey] = slaveItem;
              });
              if(commonUtils.isNotEmptyObject(groupMap)) {
                const slave0Data = [];
                for (const key of Object.keys(groupMap)) {
                  if(commonUtils.isNotEmptyObject(groupMap[key])) {
                    slave0Data.push(groupMap[key]);
                  }
                }
                if(commonUtils.isNotEmptyArr(slave0Data)) {
                  copyTo.slave0Data = slave0Data
                }
              }
              copyTo.slave1Data = slaveSelectedData; /*  Opsoutsideinstoredetail 未清勾选过去的表 */
            }
          }
        }
        // 不重复字段处理 例如 复制到时只能同一客户复制到
        const iIndex = copyToConfig.findIndex(item => item.sControlName === name);
        if (iIndex > -1 && !commonUtils.isEmpty(copyToConfig[iIndex].sNotRepeatColumn)) {
          const sNotRepeatColumn = copyToConfig[iIndex].sNotRepeatColumn.trim();
          const sNotRepeatValue = copyToData[0][sNotRepeatColumn];
          const iCount = copyToData.filter(item => item[sNotRepeatColumn] === sNotRepeatValue).length;
          if (iCount !== copyToData.length) {
            const iConfigIndex = slaveConfig.gdsconfigformslave.findIndex(item => item.sName === sNotRepeatColumn);
            const sNotRepeatShowName = iConfigIndex > -1 ? slaveConfig.gdsconfigformslave[iConfigIndex].showName : '';
            message.warn(commonFunc.showMessage(app.commonConst, 'pleaseChooseSame') + sNotRepeatShowName); // 请选择相同
            return;
          }
        }
        const { userinfo } = app;
        const sIdArray = [];
        copyToData.forEach((item) => {
          if (formRoute === '/indexPage/materialRequirementsPlanning') {
            sIdArray.push(item.sWorkOrderMaterialId); /* 物料需求计划生成用sWorkOrderMaterialId作为唯一键 */
          } else {
            sIdArray.push(item.sSlaveId);
          }
        });
        const tempData = JSON.parse(JSON.stringify(copyToData || []));
        this.props.app.webSocket.onmessageTmp = (msg) => {
          const rtmsg = JSON.parse(msg.data);
          if (rtmsg.action === 'execute') {
            if (rtmsg.msg === 'continue') {
              const { formRoute } = this.state;
              if (commonUtils.isNotEmptyArr(tempData)) {
                copyTo.name = name;
                copyTo.config = copyToConfig;
                if(name !== 'ActOutsideProcessTemp') {
                  copyTo.masterData = tempData[0];
                  copyTo.slaveData = tempData;
                  copyTo.copyOtherData = addcopyOther;
                }
                copyTo.srcFormRoute = this.props.formRoute; /* 未清来源路由 */
                dispatch({
                  type: 'content/onRouter',
                  payload: {
                    url: `${commonConfig.server_host}gdsmodule/getGdsmoduleById/${sActiveId}?sModelsId=${sActiveId}&sName=${formRoute}`, /*   接口地址   */
                    copyTo,
                    refresh: getData.bind(this, slaveConfig, slaveFilterCondition, commonUtils.isEmpty(slavePagination) ? 0 : slavePagination.current, slavePagination.pageSize, slaveOrderBy, isRefresh, undefined, undefined, treeFilterCondition),
                    sSrcModelsId: this.props.sModelsId,
                  },
                });
              } else {
                message.warn(commonFunc.showMessage(app.commonConst, 'pleaseChooseData')); // 请选择数据
              }
            } else {
              message.warning(rtmsg.handlers + commonFunc.showMessage(app.commonConst, 'InOperation'));/* 在操作,请稍后再操作! */
            }
          }
        };
        const sId = sIdArray.toString();
        const getData = this.handleGetData;
        const dataUrl = `${commonConfig.server_host}bill/billCopyToCheck/?sModelsId=${sModelsId}&sActiveId=${sActiveId}&tbSuffix=${tbSuffix}&sName=${formRoute}`;
        const values = { sSlaveId: sId };
        const dataReturn = (await commonServices.postValueService(token, values, dataUrl)).data;
        if (dataReturn.code === 1) {
          const sendSocketMessage = this.props.handleSendSocketMessage;
          if (dataReturn.dataset.rows.length > 0) {
            confirm({
              title: commonFunc.showMessage(app.commonConst, 'beUsedToNew'), /* 单据已存在，是否填写新单据 */
              onOk() {
                sendSocketMessage('copy', 'execute', sId, userinfo.sId, null, null);
              },
              onCancel() {
              },
            });
          } else {
            sendSocketMessage('copy', 'execute', sId, userinfo.sId, null, null);
          }
        } else {
          this.props.getServiceError(dataReturn);
        }
      } else {
        message.warn(commonFunc.showMessage(app.commonConst, 'pleaseChooseData')); // 请选择数据
      }
    };


    handleBillCopyTo = async (name, sActiveId, copyToBillConfig, callBack) => {
      /*   待用数据声明   */
      const {
        slaveConfig, slaveSelectedData, token, app, sModelsId, slaveInfoConfig, slaveInfoSelectedData, slaveFilterCondition,
        slavePagination, slaveOrderBy, treeFilterCondition, dispatch,
      } = this.props;
      let isRefresh = true;
      const formRoute = '/indexOee/commonOeeBill';

      if (commonUtils.isNotEmptyArr(slaveSelectedData)) {
        const copyToConfig = slaveConfig.gdsconfigformslave.filter(item => item.sControlName.includes(name));
        let copyToData = slaveSelectedData;
        const addcopyOther = [];
        let tbSuffix = '';
        if (formRoute === '/indexPage/materialRequirementsPlanning') {
          if (name === 'BtnCopyTo.ActPurchaseOrder') {
            const detailCopy = {};
            detailCopy.name = 'detail';
            detailCopy.config = slaveInfoConfig;
            detailCopy.data = slaveInfoSelectedData;
            addcopyOther.push(detailCopy);
            tbSuffix = 'detail';
            isRefresh = true;
          } else {
            copyToData = slaveInfoSelectedData;
            isRefresh = true;
          }
          /* 物料需求计划生成采购申请、采购订单去重处理 */
          if (commonUtils.isNotEmptyArr(copyToData)) {
            const copyToDataNew = [];
            copyToData.forEach((item) => {
              const iIndex = copyToDataNew.findIndex(child => child.sWorkOrderMaterialId === item.sWorkOrderMaterialId);
              if (iIndex < 0) {
                copyToDataNew.push(item);
              }
            });
            copyToData = copyToDataNew;
          }
        } else if (name === 'BtnCopyTo.ActProduceReport') { /* 若机台中点击暂停 则待产量上报中点击上报提示”工序已暂停，无法上报 */
          if (commonUtils.isNotEmptyArr(copyToData) && copyToData[0].sState === '3') {
            message.warn('工序已暂停，无法开工！');
            return;
          }
        }
        // 不重复字段处理 例如 复制到时只能同一客户复制到
        const iIndex = copyToConfig.findIndex(item => item.sControlName === name);
        if (iIndex > -1 && !commonUtils.isEmpty(copyToConfig[iIndex].sNotRepeatColumn)) {
          const sNotRepeatColumn = copyToConfig[iIndex].sNotRepeatColumn.trim();
          const sNotRepeatValue = copyToData[0][sNotRepeatColumn];
          const iCount = copyToData.filter(item => item[sNotRepeatColumn] === sNotRepeatValue).length;
          if (iCount !== copyToData.length) {
            const iConfigIndex = slaveConfig.gdsconfigformslave.findIndex(item => item.sName === sNotRepeatColumn);
            const sNotRepeatShowName = iConfigIndex > -1 ? slaveConfig.gdsconfigformslave[iConfigIndex].showName : '';
            message.warn(commonFunc.showMessage(app.commonConst, 'pleaseChooseSame') + sNotRepeatShowName); // 请选择相同
            return;
          }
        }
        const { userinfo } = app;
        const sIdArray = [];
        copyToData.forEach((item) => {
          if (formRoute === '/indexPage/materialRequirementsPlanning') {
            sIdArray.push(item.sWorkOrderMaterialId); /* 物料需求计划生成用sWorkOrderMaterialId作为唯一键 */
          } else if (formRoute === '/indexOee/commonOeeBill') {
            const activeKey = commonUtils.isNotEmptyObject(copyToBillConfig) ? copyToBillConfig.sActiveKey : 'sWorkOrderSlaveId';
            sIdArray.push(item[activeKey]); /* 物料需求计划生成用sWorkOrderMaterialId作为唯一键 */
          } else {
            sIdArray.push(item.sSlaveId);
          }
        });
        this.props.app.webSocket.onmessageTmp = (msg) => {
          const rtmsg = JSON.parse(msg.data);
          if (rtmsg.action === 'execute') {
            if (rtmsg.msg === 'continue') {
              const { formRoute } = this.state;
              if (commonUtils.isNotEmptyArr(copyToData)) {
                const copyTo = {};
                copyTo.name = name;
                copyTo.config = copyToConfig;
                copyTo.masterData = copyToData[0];
                copyTo.slaveData = copyToData;
                copyTo.copyOtherData = addcopyOther;
                copyTo.srcFormRoute = this.props.formRoute; /* 未清来源路由 */
                dispatch({
                  type: 'content/onRouter',
                  payload: {
                    url: `${commonConfig.server_host}gdsmodule/getGdsmoduleById/${sActiveId}?sModelsId=${sActiveId}&sName=${formRoute}`, /*   接口地址   */
                    copyTo,
                    refresh: getData.bind(this, slaveConfig, slaveFilterCondition, commonUtils.isEmpty(slavePagination) ? 0 : slavePagination.current, slavePagination.pageSize, slaveOrderBy, isRefresh, undefined, undefined, treeFilterCondition),
                    sSrcModelsId: this.props.sModelsId,
                  },
                });
              } else {
                message.warn(commonFunc.showMessage(app.commonConst, 'pleaseChooseData')); // 请选择数据
              }
            } else {
              message.warning(rtmsg.handlers + commonFunc.showMessage(app.commonConst, 'InOperation'));/* 在操作,请稍后再操作! */
            }
          }
        };
        const sId = sIdArray.toString();
        const getData = this.handleGetData;

        const dataUrl = `${commonConfig.server_host}bill/billCopyToCheck/?sModelsId=${sModelsId}&sActiveId=${sActiveId}&tbSuffix=${tbSuffix}&sName='/indexOee/commonOeeBill'`;
        const values = { sSlaveId: sId };
        const dataReturn = (await commonServices.postValueService(token, values, dataUrl)).data;
        if (dataReturn.code === 1) {
          const sendSocketMessage = this.props.handleSendSocketMessage;
          if (dataReturn.dataset.rows.length > 0) {
            const { sId } = dataReturn.dataset.rows[0];
            if (commonUtils.isNotEmptyObject(sId)) { /* 查看 */
              sendSocketMessage('copy', 'execute', sId, userinfo.sId, null, null);
              this.props.onSaveOeeState({ checkedId: sId });
            }
            // confirm({
            //   title: commonFunc.showMessage(app.commonConst, 'beUsedToNew'), /* 单据已存在，是否填写新单据 */
            //   onOk() {
            //     sendSocketMessage('copy', 'execute', sId, userinfo.sId, null, null);
            //   },
            //   onCancel() {
            //   },
            // });
          } else {
            sendSocketMessage('copy', 'execute', sId, userinfo.sId, null, null);
          }
        } else {
          this.props.getServiceError(dataReturn);
        }
        if (callBack) {
          callBack();
        }
      } else {
        message.warn(commonFunc.showMessage(app.commonConst, 'pleaseChooseData')); // 请选择数据
      }
    };

    // CopyTo = (refresh, copyToData, name, copyToConfig, sActiveId, dispatch, app, copyOther) => {
    //   const { formRoute } = this.state;
    //   if (commonUtils.isNotEmptyArr(copyToData)) {
    //     const copyTo = {};
    //     copyTo.name = name;
    //     copyTo.config = copyToConfig;
    //     copyTo.masterData = copyToData[0];
    //     copyTo.slaveData = copyToData;
    //     copyTo.copyOtherData = copyOther;
    //     dispatch({
    //       type: 'content/onRouter',
    //       payload: {
    //         url: `${commonConfig.server_host}gdsmodule/getGdsmoduleById/${sActiveId}?sModelsId=${sActiveId}&sName=${formRoute}`, /*   接口地址   */
    //         copyTo,
    //         refresh,
    //       },
    //     });
    //   } else {
    //     message.warn(commonFunc.showMessage(app.commonConst, 'pleaseChooseData')); // 请选择数据
    //   }
    // };
    // handleForceComplete = (name) => {
    //   const { slaveSelectedRowKeys, app, masterConfig } = this.props;
    //   if (commonUtils.isEmptyArr(slaveSelectedRowKeys)) {
    //     message.warn(commonFunc.showMessage(app.commonConst, 'pleaseChooseData')); // 请选择记录
    //   } else {
    //     const slaveMemoConfigOld = [];
    //     let btnConfigNameArr = [];
    //     if (name.indexOf('BtnRepair') > -1) {
    //       const btnConfig = masterConfig.gdsconfigformslave.filter(item => item.sControlName === name)[0];// sButtonEnabled  sButtonParam
    //       if (!commonUtils.isEmpty(btnConfig.sActiveKey)) {
    //         btnConfigNameArr = btnConfig.sActiveKey.split(',');
    //       }
    //       if (commonUtils.isNotEmptyArr(btnConfigNameArr)) {
    //         // eslint-disable-next-line array-callback-return
    //         btnConfigNameArr.map((i) => {
    //           const singleConfig = this.props.slaveConfig.gdsconfigformslave.filter(item => (item.sName === i))[0];
    //           slaveMemoConfigOld.push(singleConfig);
    //         });
    //       }
    //     }
    //     const sysLogData = { sId: slaveSelectedRowKeys.toString() };
    //     this.props.onSaveState({
    //       slaveMemoConfig: slaveMemoConfigOld,
    //       sCurrMemoProps: {
    //         bVisibleMemo: true,
    //         sMemoField: 'sReason',
    //         sRecord: sysLogData,
    //         dataSource: sysLogData,
    //         btnName: name,
    //       },
    //     });
    //   }
    // }

    handleNoForceComplete = async () => {
      const {
        sModelsId, slaveSelectedRowKeys, slaveConfig, app, formRoute,
      } = this.props;
      const { token } = this.props.app;
      if (commonUtils.isEmptyArr(slaveSelectedRowKeys)) {
        message.warn(commonFunc.showMessage(app.commonConst, 'pleaseChooseData')); // 请选择记录
      } else {
        const iIndex = slaveConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'BtnNoForceComplete');
        const btnConfig = slaveConfig.gdsconfigformslave[iIndex];
        const sRelation = btnConfig.sRelation;
        const url = `${commonConfig.server_host}bill/billForceComplete?sModelsId=${sModelsId}&sName=${formRoute}`;
        const values = { sqlParam: sRelation, sId: slaveSelectedRowKeys.toString(), sType: 'noforce' };

        const dataReturn = (await commonServices.postValueService(token, values, url)).data;
        if (dataReturn.code === 1) {
          message.success(dataReturn.msg);
          this.handleButtonClick('BtnRefresh');
        } else {
          this.props.getServiceError(dataReturn);
        }
      }
    }

    // /* 双击弹出Memo */
    // handleGetMemo = (name, sValue, sMemoFiled, sRecord) => {
    //   const { sCurrMemoProps } = this.props;
    //   sCurrMemoProps.bVisibleMemo = false;
    //   sRecord[sMemoFiled] = sValue;
    //   this.props.onSaveState({ sCurrMemoProps });
    //   this.handleToForceComplete(sValue);
    // };

    /* 设计报表功能 */
    handleDesignFunction = () => {
      this.props.onSaveState({ visibleStatement: true });
    };
    handleBtnPrint = (sActiveId, checked, key) => {
      const {
        app,
        sModelsId,
        masterConfig,
        menuChildData,
        reportData,
        slaveFilterCondition,
        slaveSelectedRowKeys,
        slaveSelectedData,
        formRoute,
        treeFilterCondition,
        slaveData,
      } = this.props;
      const { token } = app;
      const slaveFilterConditionNew = slaveFilterCondition === undefined ? [] : [...slaveFilterCondition];
      // const queryFilter = {};
      // queryFilter[masterConfig.sId] = { sId: masterData.sId };
      // queryFilter[slaveConfig.sId] = { sSqlCondition: { sParentId: masterData.sId } };

      let sids = '';
      slaveSelectedRowKeys.forEach((item, i) => {
        if (commonUtils.isNotEmptyArr(slaveData)) {
          const iIndex = slaveData.findIndex(child => child.sSlaveId === item);
          if (iIndex > -1) {
            if (i === slaveSelectedRowKeys.length - 1) {
              sids = `${sids}${item}`;
            } else {
              sids = `${sids}${item},`;
            }
          }
        }
      });
      if (sids !== '') {
        const addFilter = {};
        addFilter.bFilterName = 'sSlaveId';
        addFilter.bFilterCondition = 'in';
        addFilter.bFilterValue = sids;
        slaveFilterConditionNew.push(addFilter);
      }
      // 将过滤数的赛选条件塞入打印中
      if (key.indexOf('BtnPrint.') > -1 && commonUtils.isNotEmptyArr(treeFilterCondition)) {
        // eslint-disable-next-line array-callback-return
        treeFilterCondition.map((item) => {
          slaveFilterConditionNew.push(item);
        });
      }
      const queryFilter = {};

      queryFilter[masterConfig.sId] = { bFilter: slaveFilterConditionNew };
      const queryFilterJson = encodeURIComponent(JSON.stringify(queryFilter));
      /* 拿到打印报表名称 */
      let printReportName = 'report';
      let slaveOneData = commonUtils.isNotEmptyArr(slaveSelectedData) ? JSON.stringify(slaveSelectedData) : '[]';
      slaveOneData = slaveOneData.replace("'", '');
      if (key.indexOf('BtnPrint.') > -1) {
        if (commonUtils.isNotEmptyArr(reportData)) {
          const iIndex = reportData.findIndex(item => item.sId === sActiveId);
          if (iIndex > -1) {
            printReportName = reportData[iIndex].sReportName;
          }
        }
        const urlPrint = `${commonConfig.file_host}printReport/printPdf/${sActiveId}/${printReportName}.pdf?${checked ? 'fileType=.xlsx&' : ''}queryFilter=${queryFilterJson}&sModelsId=${sModelsId}&sMaintableId=${masterConfig.sId}&token=${encodeURIComponent(token)}&sName=${formRoute}`;
        window.open(urlPrint);
      } else if (key.indexOf('BtnPrintCus.') > -1) {
        if (commonUtils.isNotEmptyArr(menuChildData)) {
          const iIndex = menuChildData.findIndex(item => item.sId === sActiveId);
          if (iIndex > -1) {
            printReportName = menuChildData[iIndex].sReportName;
          }
        }
        // const urlPrint = `${commonConfig.file_host}printReport/printPdf/${printReportName}?${checked ? 'fileType=.xlsx&' : ''}sModelsId=${sModelsId}&printType=noquery&slaveOneData=${slaveOneData}`;
        // window.open(`${encodeURI(`${urlPrint}&queryFilter=${queryFilterJson}`)}&token=${encodeURIComponent(token)}`);

        /* Get提交地址栏参数过多,更改Get提交为Post提交 */
        const url = `${commonConfig.file_host}printReport/printPdf/${printReportName}?${checked ? 'fileType=.xlsx&' : ''}sModelsId=${sModelsId}&printType=noquery&token=${encodeURIComponent(token)}`;
        const param = slaveOneData;
        this.handleOpenPost(url, param);
      }
    };
    /* 工单列表价格批量更新 */
    handleBatchWorkListsPriceUpdate = () => {
      const { slaveData, slaveSelectedRowKeys, app } = this.props;
      if (commonUtils.isEmptyStr(slaveSelectedRowKeys)) {
        return message.warning(commonFunc.showMessage(app.commonConst, 'selectedRowKeysNo'));/* 请选择一条数据进行操作 */
      } else {
        const batchPriceWorkListUpdateData = slaveData.filter(item => slaveSelectedRowKeys.includes(item.sId));
        this.props.onSaveState({ batchPriceWorkListUpdateData, visibleBatchWorkListPriceUpdate: true });
      }
    };

    handleOpenPost= (url, params) => {
      const newWin = window.open();
      let formStr = '';
      // 设置样式为隐藏，打开新标签再跳转页面前，如果有可现实的表单选项，用户会看到表单内容数据
      formStr = `<form style="visibility:hidden;" method="POST" action="${url}">` +
        `<input type="hidden" name="slaveOneData" value='${params}' />` +
        '</form>';
      newWin.document.body.innerHTML = formStr;
      newWin.document.forms[0].submit();
      return newWin;
    }

    // handleGetMemoCancel = () => {
    //   const sCurrMemoProps = { bVisibleMemo: false };
    //   this.props.onSaveState({ sCurrMemoProps });
    // };

    // handleToForceComplete = async (sValue) => {
    //   const {
    //     app, slaveSelectedRowKeys, slaveConfig, sModelsId, slaveInfoSelectedRowKeys, formRoute,
    //   } = this.props;
    //
    //   const { token } = app;
    //   const iIndex = slaveConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'BtnForceComplete' || item.sControlName === 'BtnNoPurchase');
    //   const btnConfig = slaveConfig.gdsconfigformslave[iIndex];
    //   const sRelation = btnConfig.sRelation;
    //
    //   let selectedRowKeys = '';
    //   if (formRoute === '/materialRequirementsPlanning') {
    //     selectedRowKeys = slaveInfoSelectedRowKeys.toString();
    //   } else {
    //     selectedRowKeys = slaveSelectedRowKeys.toString();
    //   }
    //
    //   const url = `${commonConfig.server_host}bill/billForceComplete?sModelsId=${sModelsId}&sName=${formRoute}`;
    //   const values = { sqlParam: sRelation, sId: selectedRowKeys, sReason: sValue };
    //
    //   const masterReturn = (await commonServices.postValueService(token, values, url)).data;
    //   if (masterReturn.code === 1) {
    //     message.success(masterReturn.msg);
    //     this.handleButtonClick('BtnRefresh');
    //   } else {
    //     this.props.getServiceError(masterReturn);
    //   }
    // }

    handleToSettlement = async (sType) => {
      const {
        app, sModelsId, slaveSelectedRowKeys, slaveData, formRoute,
      } = this.props;
      let continueFlag = true;
      let msg = '';

      const selectedData = slaveData.filter(item => slaveSelectedRowKeys.includes(item.sId));
      const point = commonUtils.convertStrToNumber(selectedData[0].sPeriodId);
      if (sType === 1) {
        for (const item of slaveData) {
          const curr = commonUtils.convertStrToNumber(item.sPeriodId);
          if (curr > point && item.bFrozen) {
            continueFlag = false;
            msg = `${item.sPeriodId}已结账`;
            break;
          } else if (curr < point && !item.bFrozen) {
            continueFlag = false;
            msg = `${item.sPeriodId}未结账`;
            break;
          }
        }
      } else if (sType === 2) {
        for (const item of slaveData) {
          const curr = commonUtils.convertStrToNumber(item.sPeriodId);
          if (curr < point && item.bFrozen) {
            continueFlag = false;
            msg = `${item.sPeriodId}已结账`;
            break;
          } else if (curr > point && !item.bFrozen) {
            continueFlag = false;
            msg = `${item.sPeriodId}未结账`;
            break;
          }
        }
      }
      // tStartDate: "2017-01-02 16:00:00"  tEndDate: "2017-02-01 16:00:00"  tStartDate, tEndDate,
      if (continueFlag) {
        const value = {
          sProName: 'Sp_System_AutoMaterialsPriceSingle',
          paramsMap: { tStartDate: selectedData[0].tStartDate, tEndDate: selectedData[0].tEndDate },
        };
        const url = `${commonConfig.server_host}business/getProData?sModelsId=${sModelsId}&sName=${formRoute}`;
        const returnData = (await commonServices.postValueService(app.token, value, url)).data;
        if (returnData.code === 1) {
          const outData = returnData.dataset.rows[0].dataSet.outData[0];
          if (outData.sCode === -1) {
            message.error(outData.sReturn);
          }
        } else {
          this.props.getServiceError(returnData);
        }
      } else {
        message.warn(msg);
      }
    }
    handleTreeSelect = (name, selectedKeys, e) => {
      const { slaveFilterCondition, slaveConfig, slavePagination,slave0Config } = this.props;
      const slaveFilterConditionNew = {};
      let ids = '';
      const treeFilterCondition = [];
      this.props.onSaveState({ pageLoading:true });
      this.props.onTreeSelect(name, selectedKeys, e);
      /* 加过滤条件 */
      for (const sId of selectedKeys) {
        const searchId = sId.split('_')[1];
        const searchName = sId.split('_')[0];
        ids = slaveFilterConditionNew[`${searchName}`];
        if (commonUtils.isNotEmptyObject(ids)) {
          ids += `,${searchId}`;
        } else {
          ids = searchId;
        }
        slaveFilterConditionNew[`${searchName}`] = ids;
      }
      if (commonUtils.isNotEmptyObject(slaveFilterConditionNew)) {
        Object.keys(slaveFilterConditionNew).forEach((item) => {
          if (commonUtils.isNotEmptyObject(slaveFilterConditionNew[item])) {
            treeFilterCondition.push({
              bFilterName: item,
              bFilterCondition: 'in',
              bFilterValue: slaveFilterConditionNew[item],
              bFilterType: 'tree',
            });
          }
        });
        if (commonUtils.isNotEmptyArr(treeFilterCondition)) {
          this.props.onSaveState({
            treeFilterCondition,
          });
        }
      }
      this.handleGetData(slaveConfig, slaveFilterCondition, 1, slavePagination.pageSize, '', false, '', '', treeFilterCondition, slave0Config);
      /* 如果有选中树节点，则展开选中节点的父节点，否则默认展开第一个父节点 */
      if (commonUtils.isNotEmptyArr(selectedKeys) && selectedKeys.length > 0) {
        const { treeData } = this.props;
        const expandedKeys = [];
        const len = selectedKeys.length;
        const iIndex = treeData.findIndex(item => item.key === selectedKeys[len - 1] || item.sName === selectedKeys[len - 1].split('_')[0]);
        if (iIndex > -1) { /* 选中的是父节点 */
          expandedKeys.push(treeData[iIndex].key);
        }
        this.props.onSaveState({
          expandedKeys, activeKey:'2'
        });
      }
    };
    handleTableSelectRowChange = async (name, selectedRowKeys, changeValue) => {
      if (name === 'slave' || name === 'master' || (name.includes('slave')) ) {
        const {
          token, sModelsId, [`${name}Total`]: totalData, [`${name}AllTotal`]: totalAllData, [`${name}Config`]: tableConfig, [`${name}Data`]: tableData, formData, app,
          slaveFilterCondition,
        } = this.props;
        const { dNetMoney, dNetPrice } = app.decimals;
        const selectedTotalData = [];
        let addStateSlave0 = {};
        let bMutiSelect = false; /* 默认单选或不选  true ：多选 */
        if (commonUtils.isNotEmptyObject(tableConfig)) {
          bMutiSelect =tableConfig.bMutiSelect;
        }
        if (commonUtils.isNotEmptyArr(tableData) && commonUtils.isNotEmptyArr(selectedRowKeys)) {
          let url = '';
          if (sModelsId === '19211681019715326709731800') {
            let sProcessId = '';
            if (name === 'master') {
              sProcessId = changeValue.sProcessClassifyId;
            } else if (name === 'slave') {
              const sProcessIdIndex = tableData.findIndex(item => item.sSlaveId === selectedRowKeys[0]);
              if (sProcessIdIndex > -1) {
                sProcessId = tableData[sProcessIdIndex].sProcessClassifyId;
              }
            }
            if (commonUtils.isNotEmptyObject(sProcessId)) {
              url = `${commonConfig.file_host_ebc}printReport/getReportByProcessId/${sProcessId}?sModelsId=${sModelsId}`;
              const values = {};
              const masterReturn = (await commonServices.postValueService(token, values, url)).data;
              if (masterReturn.code === 1) {
                const menuChildData = masterReturn.dataset.rows;
                this.props.onSaveState({ menuChildData });
              }
            }
          }
          /* 从表切换选中行时 从新查询数据 */
          // if(name === 'slave') {
          //   const {  slaveConfig, slaveFilterCondition, slavePagination, page, pageSize, slaveOrderBy, clearSelectData, sGroupByListNew, treeFilterCondition,
          //     slave0Config, slave1Config, slave2Config, slave3Config, slave4Config, slave5Config, slave6Config, slave7Config, slave8Config, slave9Config, slave10Config } = this.props;
          //      await this.handleGetData(slaveConfig, slaveFilterCondition, slavePagination.current, slavePagination.pageSize, slaveOrderBy, true,
          //     undefined, undefined, undefined,
          //     slave0Config, slave1Config, slave2Config, slave3Config, slave4Config, slave5Config, slave6Config, slave7Config, slave8Config, slave9Config, slave10Config); /*   刷新方法   */
          // }
          /* 只有多选情况下 汇总勾选行字段 */
          if (commonUtils.isNotEmptyArr(totalData)) {
            if (commonUtils.isNotEmptyObject(tableConfig) && tableConfig.gdsconfigformslave && bMutiSelect) {
              const tableConfigSum = tableConfig.gdsconfigformslave.filter(item => commonUtils.isNotEmptyObject(item.sName) && item.bSum && item.bVisible);
              const tableFilterData = tableData.filter(item => selectedRowKeys.includes(item.sSlaveId));
              if (commonUtils.isNotEmptyArr(tableConfigSum) && commonUtils.isNotEmptyArr(tableFilterData)) {
                const selectedTotal = {};
                selectedTotal.bSum = true;
                selectedTotal.key = '0000';
                tableConfigSum.forEach((itemConfig) => {
                  const sName = itemConfig.sName;
                  if (commonUtils.isNotEmptyObject(sName)) {
                    tableFilterData.forEach((child) => {
                      if (commonUtils.isNotEmptyNumber(child[sName])) {
                        /* 金额、单价 保留系统设置小数位 */
                        if (sName.toLowerCase().endsWith('price')) { /*   价格   */
                          selectedTotal[sName] = commonUtils.convertFixNum(commonUtils.convertFixNum(commonUtils.isNull(child[sName], 0),dNetPrice) + commonUtils.convertFixNum(commonUtils.isNull(selectedTotal[sName], 0),dNetPrice),dNetPrice);
                        } else if (sName.toLowerCase().endsWith('money')) { /*   金额   */
                          selectedTotal[sName] = commonUtils.convertFixNum(commonUtils.convertFixNum(commonUtils.isNull(child[sName], 0),dNetMoney) + commonUtils.convertFixNum(commonUtils.isNull(selectedTotal[sName], 0),dNetMoney),dNetMoney);
                        } else{
                          selectedTotal[sName] = commonUtils.convertFixNum(commonUtils.convertFixNum(commonUtils.isNull(child[sName], 0),dNetMoney) + commonUtils.convertFixNum(commonUtils.isNull(selectedTotal[sName], 0),dNetMoney),dNetMoney);
                        }

                      }
                    });
                  }
                });
                if (commonUtils.isNotEmptyObject(selectedTotal)) {
                  selectedTotalData.push(selectedTotal);
                }
              }
            }
          }

          /* 从表行切换时 查询页签所在表 除了第一张表之外的其他所有表格数据 都从第一张表的选中行数据作为查询条件 */
          if(name === 'slave') {
            const {activeKey } = this.props;
            let tabName = ''; /* 页签所在表 */
            if(commonUtils.isEmptyObject(activeKey)) { /* 默认查从表与slave0表 */
              tabName = 'slave0';
            }else {
              if(activeKey === '2') {
                tabName = 'slave0';
              } else if(activeKey === '3') {
                tabName = 'slave1';
              }else if(activeKey === '4') {
                tabName = 'slave2';
              }else if(activeKey === '5') {
                tabName = 'slave3';
              }else if(activeKey === '6') {
                tabName = 'slave4';
              }else if(activeKey === '7') {
                tabName = 'slave5';
              }else if(activeKey === '8') {
                tabName = 'slave6';
              }else if(activeKey === '9') {
                tabName = 'slave7';
              }else if(activeKey === '10') {
                tabName = 'slave8';
              }else if(activeKey === '11') {
                tabName = 'slave9';
              }else if(activeKey === '12') {
                tabName = 'slave10';
              }else if(activeKey === '13') {
                tabName = 'slave11';
              }else if(activeKey === '14') {
                tabName = 'slave12';
              }else if(activeKey === '15') {
                tabName = 'slave13';
              }else if(activeKey === '16') {
                tabName = 'slave14';
              }else if(activeKey === '17') {
                tabName = 'slave15';
              }else if(activeKey === '18') {
                tabName = 'slave16';
              }else if(activeKey === '19') {
                tabName = 'slave17';
              }else if(activeKey === '20') {
                tabName = 'slave18';
              }else if(activeKey === '21') {
                tabName = 'slave19';
              }else if(activeKey === '22') {
                tabName = 'slave20';
              }
            }
            const sGroupByList = this.props.sGroupByList;
            /* 除了第一张表之外的其他所有表格数据 都从第一张表的选中行数据作为查询条件 */
            if(commonUtils.isNotEmptyObject(tabName)) {
              const { [`${tabName}Config`] : tableConfig,  [`${tabName}FilterCondition`]: tableFilterCondition, slaveOrderBy, [`${tabName}Pagination`] : tablePagination,
                sModelsType, slave0Config,
              } = this.props;
              const iPageSize =  tableConfig.bPagination ? tableConfig.iPageSize : 10000 ; /* 根据后台主表配置bPagination判断 是否分页, 不分页默认10000，分页根据分页来  */
              if(commonUtils.isNotEmptyArr(selectedRowKeys)) {
                let record =  tableData[0]; /* 从表选中行 没有选中行时 取第一行 */
                const iIndex = tableData.findIndex(item => item.sSlaveId === selectedRowKeys[0]);
                if (iIndex > -1) {
                  record = tableData[iIndex];
                }
                if (!commonUtils.isEmptyObject(tableConfig)) {
                  let conditonValues0 = {};
                  let sSqlCondition0 = tableConfig.sSqlCondition;
                  if(sModelsType === 'commonListTab/tabColor') {
                    sSqlCondition0 = slave0Config.sSqlCondition;
                    if (commonUtils.isNotEmptyObject(sSqlCondition0)) {
                      conditonValues0 = this.props.getSqlCondition(slave0Config, 'slave', record);
                    }
                  }else {
                    if (commonUtils.isNotEmptyObject(sSqlCondition0)) {
                      conditonValues0 = this.props.getSqlCondition(tableConfig, 'slave', record);
                    }
                  }
                  let bFilterArr = [];
                  if(sModelsId === '12710101117356137370500' || sModelsId === '12710101117253309349270' ) { /* 台工单跟踪表增加搜索组件的条件 */
                    bFilterArr = slaveFilterCondition;
                    if(commonUtils.isNotEmptyArr(bFilterArr) ) {
                      const iIndex= bFilterArr.findIndex(item => item.bFilterName === 'bSelected');
                      console.log('iIndex', iIndex);
                      if(iIndex > -1) {
                        bFilterArr.splice(iIndex,1);
                      }
                      const addState ={};
                      addState.bFilterName ='bSelected';
                      addState.bFilterCondition ='=';
                      addState.bFilterValue = true;
                      bFilterArr.push(addState);
                    }
                  }
                  if( commonUtils.isNotEmptyObject(tableConfig.sCharType)) { /* 加载图表 */
                    addStateSlave0.charConfigAndData = await this.handleGetCharOne(tabName, tableConfig, tableFilterCondition, commonUtils.isEmpty(tablePagination) ? 1 : tablePagination.current,
                      commonUtils.isEmpty(tablePagination) ? iPageSize : tablePagination.pageSize, slaveOrderBy, undefined, true, record);
                  } else {
                    if(sModelsType === 'commonListTab/tabColor') {
                      addStateSlave0 = await  this.props.handleGetDataSet({
                        name: 'slave0', configData: slave0Config, condition: { pageNum: 1, pageSize: iPageSize, bFilter:[], sFilterOrderBy:'', sSqlCondition: conditonValues0, sGroupList:sGroupByList }, isWait: true,
                      });

                    }else {
                      addStateSlave0 = await  this.props.handleGetDataSet({
                        name: tabName, configData: tableConfig, condition: {  pageNum: 1, pageSize: iPageSize, bFilter:bFilterArr, sFilterOrderBy:'', sSqlCondition: conditonValues0, sGroupList:sGroupByList }, isWait: true,
                      });
                    }
                  }
                }
              }
            }
          }

        } else if (commonUtils.isEmptyArr(selectedRowKeys)) {
          const menuChildData = [];
          this.props.onSaveState({ menuChildData });
        }
        this.props.onSaveState({ [`${name}Total`]: commonUtils.isNotEmptyArr(selectedRowKeys) && bMutiSelect ? selectedTotalData : totalAllData, ...addStateSlave0 });
      }
      this.props.onTableSelectRowChange(name, selectedRowKeys);
    }


    // OEE自定义按钮调用存储过程
    handleOEEProcedureCall = async (btnConfig, proName, proInParam) => {
      const { app, sModelsId } = this.props;
      const value = {
        sProName: proName,
        paramsMap: {
          sMachineId: app.sMachineNameSId,
          sProInParam: proInParam,
        },
      };
      const url = `${commonConfig.server_host}business/getProData?sModelsId=${sModelsId}`;
      const returnData = (await commonServices.postValueService(app.token, value, url)).data;
      if (returnData.code === 1) {
        message.success(returnData.msg);
        this.handleButtonClick('BtnRefresh');
        this.props.onSaveState({ oeeBtnStatus: true }); /* oeeBtnStatus 按钮点击时置灰 执行数据完成后按钮回置 */
      } else {
        this.props.onSaveState({ loading: false, oeeBtnStatus: true });
        this.props.getServiceError(returnData);
      }
    }
    // 根据配置解析拼接具体参数
    handleProParams = (sKey, arr) => {
      const { [`${sKey}Data`]: tableData, [`${sKey}SelectedRowKeys`]: selectedRowKeys } = this.props;
      const keyData = commonUtils.isNotEmptyArr(tableData) ? tableData.filter(item => selectedRowKeys.includes(item.sId) || selectedRowKeys.includes(item.sSlaveId)) : [];
      if (commonUtils.isNotEmptyArr(keyData)) {
        const addState = {};
        addState.key = sKey;
        const val = [];
        keyData.forEach((currData) => {
          const currVal = {};
          arr.forEach((filed) => {
            currVal[`${filed}`] = currData[`${filed}`];
          });
          val.push(currVal);
        });
        addState.value = val;
        return addState;
      } else {
        return undefined;
      }
    };
    // 进行存储过程按钮存储过程参数解析拼接 根据存储过程按钮参数配置进行解析，配置是json格式 {"sproName":"cal_sss","inMap":"master.sSlaveId,slave.sId"}
    handleOeeBtnEent = (btnConfig) => {
      const { masterData } = this.props;
      const { sButtonParam } = btnConfig;
      const btn = JSON.parse(sButtonParam);
      const sProName = btn.sproName;
      const inParams = [];
      const { inMap } = btn;
      const inlist = inMap.split(',');
      const masterArr = [];
      const slaveArr = [];

      if (inlist.length > 0) {
        inlist.forEach((item) => {
          const itemArr = item.split('.');
          if (itemArr.length > 0) {
            const sname = itemArr[0];
            const stype = itemArr[1];
            if (commonUtils.isNotEmptyStr(sname) && sname === 'master') {
              masterArr.push(stype);
            }
            if (commonUtils.isNotEmptyStr(sname) && sname === 'slave') {
              slaveArr.push(stype);
            }
          }
        });

        if (commonUtils.isNotEmptyArr(masterArr) && commonUtils.isNotEmptyObject(masterData)) {
          const addState = {};
          addState.key = 'master';
          const val = [];
          const currVal = {};
          masterArr.forEach((filed) => {
            currVal[`${filed}`] = masterData[`${filed}`];
          });
          val.push(currVal);
          addState.value = val;
          inParams.push({ ...addState });
        }
        if (commonUtils.isNotEmptyArr(slaveArr)) {
          const addState = this.handleProParams('slave', slaveArr);
          if (commonUtils.isNotEmptyObject(addState)) {
            inParams.push({ ...addState });
          }
        }
      }
      /* OEE模块调用OEE自定义按钮存储过程 */
      if (location.pathname.toLowerCase().indexOf('oee') > -1) {
        this.handleOEEProcedureCall(btnConfig, sProName, JSON.stringify({ params: inParams }));
      }
    };


    // 进行存储过程按钮存储过程参数解析拼接 根据存储过程按钮参数配置进行解析，配置是json格式 {"sproName":"cal_sss","inMap":"master.sSlaveId,slave.sId"}
    // handleBtnEent = (btnConfig, name, sValue) => {
    //   const { masterData, sCurrMemoProps } = this.props;
    //   if (commonUtils.isNotEmptyObject(sCurrMemoProps) && name.indexOf('BtnRepair') > -1) {
    //     sCurrMemoProps.bVisibleMemo = false;
    //     this.props.onSaveState({ sCurrMemoProps });
    //   }
    //   const sButtonParam = btnConfig.sButtonParam;
    //   const btn = JSON.parse(sButtonParam);
    //   const sProName = btn.sproName;
    //   const inParams = [];
    //   const inMap = btn.inMap;
    //   const inlist = inMap.split(',');
    //
    //   const masterArr = [];
    //   const slaveArr = [];
    //   const slaveInfoArr = [];
    //   const controlArr = [];
    //   const materialsArr = [];
    //   const processArr = [];
    //
    //   if (inlist.length > 0) {
    //     inlist.forEach((item) => {
    //       const itemArr = item.split('.');
    //       if (itemArr.length > 0) {
    //         const sname = itemArr[0];
    //         const stype = itemArr[1];
    //         if (commonUtils.isNotEmptyStr(sname) && sname === 'master') {
    //           masterArr.push(stype);
    //         }
    //         if (commonUtils.isNotEmptyStr(sname) && sname === 'slave') {
    //           slaveArr.push(stype);
    //         }
    //         if (commonUtils.isNotEmptyStr(sname) && sname === 'slaveInfo') {
    //           slaveInfoArr.push(stype);
    //         }
    //         if (commonUtils.isNotEmptyStr(sname) && sname === 'control') {
    //           controlArr.push(stype);
    //         }
    //         if (commonUtils.isNotEmptyStr(sname) && sname === 'materials') {
    //           materialsArr.push(stype);
    //         }
    //         if (commonUtils.isNotEmptyStr(sname) && sname === 'process') {
    //           processArr.push(stype);
    //         }
    //       }
    //     });
    //
    //     if (commonUtils.isNotEmptyArr(masterArr) && commonUtils.isNotEmptyObject(masterData)) {
    //       const addState = {};
    //       addState.key = 'master';
    //       const val = [];
    //       const currVal = {};
    //       masterArr.forEach((filed) => {
    //         currVal[`${filed}`] = masterData[`${filed}`];
    //       });
    //       val.push(currVal);
    //       addState.value = val;
    //       inParams.push({ ...addState });
    //     }
    //     if (commonUtils.isNotEmptyArr(slaveArr)) {
    //       const addState = this.handleProParams('slave', slaveArr);
    //       if (commonUtils.isNotEmptyObject(addState)) {
    //         inParams.push({ ...addState });
    //       }
    //     }
    //     if (commonUtils.isNotEmptyArr(slaveInfoArr)) {
    //       const addState = this.handleProParams('slaveInfo', slaveInfoArr);
    //       if (commonUtils.isNotEmptyObject(addState)) {
    //         inParams.push({ ...addState });
    //       }
    //     }
    //     if (commonUtils.isNotEmptyArr(controlArr)) {
    //       const addState = this.handleProParams('control', controlArr);
    //       if (commonUtils.isNotEmptyObject(addState)) {
    //         inParams.push({ ...addState });
    //       }
    //     }
    //     if (commonUtils.isNotEmptyArr(materialsArr)) {
    //       const addState = this.handleProParams('materials', materialsArr);
    //       if (commonUtils.isNotEmptyObject(addState)) {
    //         inParams.push({ ...addState });
    //       }
    //     }
    //     if (commonUtils.isNotEmptyArr(processArr)) {
    //       const addState = this.handleProParams('process', processArr);
    //       if (commonUtils.isNotEmptyObject(addState)) {
    //         inParams.push({ ...addState });
    //       }
    //     }
    //   }
    //
    //   this.handleProcedureCall(btnConfig, sProName, JSON.stringify({ params: inParams, changeValue: sValue }));
    // };
    // 根据配置解析拼接具体参数
    // handleProParams = (sKey, arr) => {
    //   const { [`${sKey}Data`]: tableData, [`${sKey}SelectedRowKeys`]: selectedRowKeys } = this.props;
    //   const keyData = tableData.filter(item => selectedRowKeys.includes(item.sId) || selectedRowKeys.includes(item.sSlaveId));
    //   if (commonUtils.isNotEmptyArr(keyData)) {
    //     const addState = {};
    //     addState.key = sKey;
    //     const val = [];
    //     keyData.forEach((currData) => {
    //       const currVal = {};
    //       arr.forEach((filed) => {
    //         currVal[`${filed}`] = currData[`${filed}`];
    //       });
    //       val.push(currVal);
    //     });
    //     addState.value = val;
    //     return addState;
    //   } else {
    //     return undefined;
    //   }
    // };
    // 存储过程按钮调用存储过程
    // handleProcedureCall = async (btnConfig, proName, proInParam) => {
    //   const { app, sModelsId } = this.props;
    //   const value = { sProName: proName, sProInParam: proInParam };
    //   const url = `${commonConfig.server_host}procedureCall/doGenericProcedureCall?sModelsId=${sModelsId}`;
    //   const returnData = (await commonServices.postValueService(app.token, value, url)).data;
    //   if (returnData.code === 1) {
    //     message.success(returnData.msg);
    //     this.handleButtonClick('BtnRefresh');
    //   } else {
    //     this.props.onSaveState({ loading: false });
    //     this.props.getServiceError(returnData);
    //   }
    // }
    /* 点击展开图标时，调用接口获取嵌套字表数据 */
    handleOnExpand = async (expanded, record) => {
      const { expKeys } = this.props;
      /* 添加移除展开的sId */
      const { formRoute } = this.props;
      let newExp = commonUtils.isNotEmptyArr(expKeys) ? expKeys : [];
      let rowKeyId = '';
      if (formRoute === '/indexPage/materialRequirementsPlanning') {
        rowKeyId = record.sMaterialsGS;
      }
      if (expanded) {
        if (commonUtils.isNotEmptyObject(rowKeyId)) {
          newExp.push(rowKeyId);
        }
      } else {
        newExp = newExp.filter(item => item !== rowKeyId);
      }
      this.props.onSaveState({ expKeys: newExp });
    }
    handleTableAdd = (name, isWait) => {
      const { formRoute } = this.props;
      if (commonUtils.isNotEmptyObject(formRoute) && formRoute.indexOf('/indexOee') > -1 && name === 'employee') { // oee开工页面人员表点击增加弹窗人员选择框
        this.props.onSaveState({ employeeVisble: true });
      } else if (isWait) { /*  报表设计新增 */
        const tableDataRow = this.props.onDataRowAdd(name, isWait);
        return tableDataRow;
      }
    }

    /* 操作日志点击链接弹出Modal呈现日志明细 */
    handleGetLogDetail=(record) => {
      const { sModelsType } = this.props;
      let { logColumn } = this.props;
      /* 操作日志明细弹窗功能 */
      if (sModelsType === 'commonList/logdetail') {
        const { sDetailMemo } = record;
        let JsonData = [];
        const logData = [];
        const logConfig = {};
        if (commonUtils.isNotEmptyObject(sDetailMemo)) {
          const addState = {};
          addState.logVisible = true;
          if (commonUtils.isEmptyArr(logColumn)) {
            logConfig.sId = commonUtils.createSid();
            logConfig.gdsconfigformslave = [{
              bVisible: false,
              sName: 'sId',
              bNotEmpty: true,
              showName: '表sId',
              bFind: false,
            }, {
              bVisible: false,
              sName: 'sSlaveId',
              bNotEmpty: true,
              showName: '表主键',
              bFind: false,
            }, {
              bVisible: true,
              sName: 'sTableName',
              bNotEmpty: true,
              showName: '表名称',
              bFind: false,
            }, {
              bVisible: true,
              sName: 'sTableType',
              bReadOnly: true,
              showName: '表类型',
              iTag: 1,
              bFind: false,
            }, {
              bVisible: true,
              sName: 'handleType',
              bReadOnly: true,
              showName: '状态',
              iTag: 1,
              bFind: false,
            }, {
              bVisible: true,
              sName: 'sFieldName',
              bReadOnly: true,
              showName: '字段名',
              iTag: 1,
              bFind: false,
            }, {
              bVisible: true,
              sName: 'sFieldValue',
              bReadOnly: true,
              showName: '字段值',
              iTag: 1,
              bFind: false,
            }];
            logColumn = [{
              title: '表名称',
              dataIndex: 'sTableName',
              width: 200,
              bFind: true,
            }, {
              title: '表类型',
              dataIndex: 'sTableType',
              width: 100,
              bFind: true,
            }, {
              title: '状态',
              dataIndex: 'handleType',
              width: 100,
              bFind: true,
            }, {
              title: '字段名',
              dataIndex: 'sFieldName',
              width: 200,
              bFind: true,
            }, {
              title: '字段值',
              dataIndex: 'sFieldValue',
              width: 200,
              bFind: true,
            }];
            addState.logColumn = logColumn;
            addState.logConfig = logConfig;
          }
          try {
            JsonData = JSON.parse(sDetailMemo);
            /* 弹窗字段取值 */
            JsonData.forEach((item) => {
              const columnArr = item.column;
              if (commonUtils.isNotEmptyArr(columnArr)) {
                columnArr.forEach((column) => {
                  // eslint-disable-next-line guard-for-in
                  for (const property in column) {
                    const logObj = {};
                    logObj.sTableName = item.sTable;
                    logObj.sTableType = item.name;
                    logObj.sFieldName = property;
                    logObj.sFieldValue = column[property];
                    const newId = commonUtils.createSid();
                    logObj.sId = newId;
                    logObj.sSlaveId = newId;
                    const handleType = column.handleType;
                    switch (handleType) {
                      case 'add':
                        logObj.handleType = '新增';
                        break;
                      case 'update':
                        logObj.handleType = '修改';
                        break;
                      case 'del':
                        logObj.handleType = '删除';
                        break;
                      default:
                        break;
                    }
                    logData.push(logObj);
                  }
                });
              }
            });
            addState.logData = logData;
          } catch (e) {
            JsonData = [];
          }
          this.props.onSaveState({
            ...addState,
          });
        }
      }
    }

    handleViewClick = (name, sName, record, index, myConfig) => {
      /* 操作日志明细链接弹出Modal */
      if (sName === 'sDetailMemoview') {
        this.handleGetLogDetail(record);
      } else {
        if (sName === 'myTableConfig') {
          this.handleQuickViewClick(name, sName, record, index, myConfig);
        } else {
          this.props.onViewClick(name, sName, record, index, myConfig);
        }
      }
    }

    handleQuickViewClick = async (name, sName, record, index, myConfigArr) => {
      const {
        slaveConfig,
        slaveData,
        dispatch,
        slaveFilterCondition,
        slavePagination,
        slaveOrderBy,
        sModelsType,
        formRoute,
        treeFilterCondition,
        app,
        iPageSize,
        sModelsId,
        // slaveSelectedData,
        // masterData,
        // employeeConfig,
      } = this.props;

      let picArr = slaveConfig.gdsconfigformslave.filter(item => (item.sName === sName));
      if (commonUtils.isNotEmptyArr(myConfigArr)) {
        picArr = myConfigArr;
      }

      if (picArr.length > 0) {
        const getConfig = this.handleGetTableConfig;
        const tableDataRow = record;
        const iIndex = index;
        const [{sActiveId}] = picArr;
        let [{sActiveKey}] = picArr;
        const sFormId = sActiveId === '1' ? commonUtils.isEmpty(tableDataRow.sFormId) ? tableDataRow.sSrcFormId : tableDataRow.sFormId : sActiveId;
        if (commonUtils.isNotEmptyObject(sActiveKey) && sActiveKey.includes('.')) { /* 接口按钮跳转 如果有slave.对应字段 则需要取出对应字段 */
          const index = sActiveKey.lastIndexOf('.');
          sActiveKey = sActiveKey.substring(index + 1, sActiveKey.length);
        }
        const sNameUrl = `${commonConfig.server_host}gdsmodule/getGdsmoduleById/${sFormId}?sModelsId=${sFormId}&sName=${formRoute}`;
        const filterCondition = [];
        const conditionValues = this.props.getSqlCondition(picArr[0], name, tableDataRow);
        if (!commonUtils.isEmpty(conditionValues)) {
          Object.keys(conditionValues).forEach((item) => {
            if ((item === 'tStartDate_pro' || item.substring(0, 1) === 'p')) {
              if (!commonUtils.isEmpty(conditionValues[item]) && conditionValues[item].length >= 2) {
                const tStartDate = moment(conditionValues[item][0]).format(this.sDateFormat);
                const tEndDate = moment(conditionValues[item][1]).add(1, 'days').format(this.sDateFormat);
                filterCondition.push({
                  bFilterName: item,
                  bFilterCondition: '=',
                  bFilterValue: `${tStartDate},${tEndDate}`,
                });
              }
            } else if ((item === 'mStartDate_pro' || item.substring(0, 1) === 'm')) {
              if (!commonUtils.isEmpty(conditionValues[item])) {
                const tStartDate = moment(conditionValues[item]).startOf('month').format(this.sDateFormat);
                const tEndDate = moment(conditionValues[item]).endOf('month').add(1, 'days').format(this.sDateFormat);
                filterCondition.push({
                  bFilterName: `t${item.substring(1, item.length)}`,
                  bFilterCondition: '=',
                  bFilterValue: `${tStartDate},${tEndDate}`,
                });
              }
            } else if (item.substring(0, 1) === 't') {
              filterCondition.push({
                bFilterName: item,
                bFilterCondition: '=',
                bFilterValue: moment(conditionValues[item]).format(this.sDateFormat),
              });
            } else {
              filterCondition.push({
                bFilterName: item,
                bFilterCondition: '=',
                bFilterValue: conditionValues[item],
              });
            }
          });
        }

        this.props.dispatch({
          type: 'content/onRouter',
          payload: {
            url: sNameUrl,
            refresh: getConfig.bind(this, name, sModelsId), /*   刷新方法   */
            sTabId: commonUtils.createSid(),
            sParentId: this.state.sTabId,
            urlDataType: 'newPane',
            checkedId: myConfigArr[0].sId,
            sName: myConfigArr[0].sName,
            bFilter: slaveFilterCondition,
            pageSize: commonConfig.pageSize,
            pages: slavePagination,
            currentData: slaveData,
            conditonValues: conditionValues,
            newKey: tableDataRow[sActiveKey],
            currentIndex: iIndex,
            filterCondition,
            sSrcModelsId: this.props.sModelsId,
          },
        });
      }
    };

    handleGetTableConfig = async (name, sModelsId) => {
      if (commonUtils.isNotEmptyObject(sModelsId)) {
        const newConfig = await this.props.onGetTableConfig(name, sModelsId);
        if (commonUtils.isNotEmptyObject(newConfig)) {
          let slaveColumn = commonFunc.getHeaderConfig(newConfig);
          this.props.onSaveState({[`${[name]}Config`]: newConfig, slaveColumn })
        }
      }
    }
    handlePartNameClick =(sName, showConfig, record) => {
      if (commonUtils.isNotEmptyObject(sName) && commonUtils.isNotEmptyObject(showConfig) && commonUtils.isNotEmptyObject(record)) {
        this.props.onSaveState({ workScheduleConfig: showConfig, workScheduleRecord: record, workScheduleVisible: true });
      }
    }
    handleCloseModel = (modelVisible) => {
      this.props.onSaveState({ [modelVisible]: false });
    };

    /* 获取树形slaveTreeData数据 */
    handleGetSlaveTreeData = (slaveData) => {
      const slaveTreeData = []; /* 用于界面树形展示的slaveData */
      const expKeys = [];
      const addState = {};
      if (commonUtils.isNotEmptyArr(slaveData)) {
        slaveData.forEach((tableDataRow) => {
          const tableDataRowNew = JSON.parse(JSON.stringify(tableDataRow));
          if (commonUtils.isEmpty(tableDataRow.sParentId)) { /* 一级分类 */
            const childrenData = this.handleGetChildData(slaveData, tableDataRowNew.sId); /* 获取子数据 */
            if (commonUtils.isNotEmptyArr(childrenData)) {
              expKeys.push(tableDataRow.sSlaveId);
              tableDataRowNew.children = childrenData;
            }
            slaveTreeData.push(tableDataRowNew);
          } else { /* 搜索后的数据集 若没有完整的树形结构 没有父级时 挂载当层 */
            const sParentId = tableDataRow.sParentId;
            /* 层级里去查sParentId的层级 */
            const slaveFilterData = slaveData.filter(item => item.sId === sParentId); /* 查找该节点的父级 */
            if (slaveFilterData.length === 0) { /* 没有父级 代表搜索后零散数据 */
              const childrenData = this.handleGetChildData(slaveData, tableDataRowNew.sId); /* 获取子数据 */
              if (commonUtils.isNotEmptyArr(childrenData)) {
                expKeys.push(tableDataRow.sSlaveId);
                tableDataRowNew.children = childrenData;
              }
              slaveTreeData.push(tableDataRowNew);
            }
          }
        });
      }
      addState.slaveTreeData = slaveTreeData;
      addState.expKeys = expKeys;
      return addState;
    }
    /* 获取子节点数据 */
    handleGetChildData = (data, sId) => {
      if (commonUtils.isNotEmptyArr(data)) {
        const filterData = data.filter(item => item.sParentId === sId);
        if (commonUtils.isNotEmptyArr(filterData)) {
          filterData.forEach((child, index) => {
            const filterChildData = this.handleGetChildData(data, child.sId);
            if (commonUtils.isNotEmptyArr(filterChildData)) {
              filterData[index].children = filterChildData;
            }
          });
        }
        return filterData;
      }
    }


    render() {
      return (
        <ChildComponent
          {...this.props}
          {...this.state}
          onReturnForm={this.handleForm}
          onGetData={this.handleGetData}
          onGetDataInfo={this.handleGetDataInfo}
          onTableSelectRowChange={this.handleTableSelectRowChange}
          onGetFilterTreeData={this.handleGetFilterTreeData}
          onTitleChange={this.handleTitleChange}
          onDoubleClick={this.handleDoubleClick}
          onAdd={this.handleAdd}
          onDel={this.handleDel}
          onButtonClick={this.handleButtonClick}
          onCopyTo={this.handleCopyTo}
          // onGetMemo={this.handleGetMemo}
          // onGetMemoCancel={this.handleGetMemoCancel}
          onGetGoods={this.handleGetGoods}
          onGetGoodsValue={this.handleGetGoodsValue}
          onGetGoodsCancle={this.handleGetGoodsCancle}
          onBtnPrint={this.handleBtnPrint}
          onCheck={this.handleTreeCheck}
          onSelect={this.handleTreeSelect}
          onExpand={this.handleOnExpand}
          onOeeCopyTo={this.handleOeeCopyTo}
          onOeeLabelCopyTo={this.handleOeeLabelCopyTo}
          onOeeBillCopyTo={this.handleBillCopyTo}
          onDataRowAdd={this.handleTableAdd}
          onViewClick={this.handleViewClick}
          onDataChange={this.props.onDataChange}
          onPartNameClick={this.handlePartNameClick}
          onCloseModel={this.handleCloseModel}
          // onBtnEent={this.handleBtnEent}
          onOeeBtnEent={this.handleOeeBtnEent} // onBtnEent={this.handleBtnEent}
          onGetSlaveTreeData={this.handleGetSlaveTreeData}
          onGetDataOne ={this.handleGetDataOne}
          onGetCharOne ={this.handleGetCharOne}
          onGetSearchData ={this.handleGetSearchData}
        />
      );
    }
  };
};
