const customHeaderCellExtra = (
  item: any,
  { TCOShowIcon, TCOPopoverVisible }: any
) => {
  // 标记原来的方法
  const originCustomHeaderCell = item.customHeaderCell;
  item.customHeaderCell = (column: any) => {
    const {
      onmouseover: _onmouseover,
      onmouseleave: _onmouseleave,
      ...rest
    } = originCustomHeaderCell?.(column) || {};
    return {
      onmouseover: (event: any) => {
        TCOShowIcon[column.dataIndex] = true;
        // 执行原方法
        _onmouseover?.(event);
      },
      onmouseleave: (event: any) => {
        if (!TCOPopoverVisible[column.dataIndex])
          TCOShowIcon[column.dataIndex] = false;
        // 执行原方法
        _onmouseleave?.(event);
      },
      ...rest
    };
  };
};

export default customHeaderCellExtra;
