import React from 'react'; import {Menu, Segment, Table, Header, Label} from 'semantic-ui-react'; import {convertTime} from '../../../tools'; import IOPanelListItem from './IOPanelListItem'; class IOPanel extends React.Component { state = { tabIdx: '1' } tabItemClick = (e, el) => { this.setState({ tabIdx: el.name }, ()=>{ this.props.getStatus({id: this.props.data.uid || '', type: this.state.tabIdx}); }); } componentWillReceiveProps(nprops) { if(nprops.data && nprops.data.uid) { if(this.props.data && this.props.data.uid){ if(this.props.data.uid != nprops.data.uid) { this.props.getStatus({id: nprops.data.uid, type: this.state.tabIdx}); } }else{ this.props.getStatus({id: nprops.data.uid, type: this.state.tabIdx}); } } } render(){ let {i18n, show, data, ioModal, delIOList, showAIOSet} = this.props; if(!show) return null; let iolist = data.iolist || []; let ios = iolist.filter(t => { if(t.type == this.state.tabIdx) return t; }); let status = data.status || {}; let ss = status[this.state.tabIdx] || []; return (