import React from 'react'; import { connect } from 'react-redux'; import { unhoverMetric } from '../actions/app-actions'; import { availableMetricsSelector } from '../selectors/node-metric'; import MetricSelectorItem from './metric-selector-item'; class MetricSelector extends React.Component { constructor(props, context) { super(props, context); this.onMouseOut = this.onMouseOut.bind(this); } onMouseOut() { this.props.unhoverMetric(); } render() { const { availableMetrics } = this.props; const hasMetrics = !availableMetrics.isEmpty(); //默认选中第一个指标,Apdex 方式2 // let defaultMetric; // hasMetrics && availableMetrics.map(metric => { // if (!defaultMetric) { // defaultMetric = metric.get('label') // } // }) return (