import React from 'react'; import {Link} from 'react-router-dom'; import {Icon, Table, Label, Message, Button} from 'semantic-ui-react' import Pagination from 'util/pagination/index.jsx' import './index.css'; function Bubble(props) { if (props.num <= 0) { return null; } let className = props.name + 'IconClassName'; return ( ); } //todo // function TrendCell(trend) { // const isNull = !list; // const isEmpty = !isNull && !list.length; // let improvedIconClassName = trend.improved > 0 ? 'improved' : 'anonymous' // let quoIconClassName = trend.quo > 0 ? 'quo' : 'anonymous' // let regressiveIconClassName = trend.regressive > 0 ? 'regressive' : 'anonymous' // if (!trend.is_first) { // return ( // // first report // // ); // } else { // return ( //
// // // // // // // // // // // // //
// ); // } // // } // general basic table class BasicTable extends React.Component { constructor(props) { super(props); this.state = { isFirstLoading: true, total: this.props.total, currentPage: 1, } } onPageNumChange(current) { this.setState({ currentPage: current }, () => { this.props.loadfunc(current); }); console.log('current:' + this.state.currentPage) } render() { // let branch = record.pg_info.pg_branch; let _list = this.props.list || [] let style = { display: 'show' }; let listBody = _list.map((record, index) => { let machine = record.machine_info; let system = machine.os_name + ' ' + machine.os_version + ' ' + machine.comp_name + ' ' + machine.comp_version; let alias = machine.alias; let trend = record.trend let improvedIconClassName = trend.improved > 0 ? 'improved' : 'anonymous' let quoIconClassName = trend.quo > 0 ? 'quo' : 'anonymous' let regressiveIconClassName = trend.regressive > 0 ? 'regressive' : 'anonymous' return ( {/*alias*/} {alias} {/*system*/} {system} {/*branch*/} {/*{branch}*/} {/*trending-data*/} Link {/*date*/} {record.add_time} ); }); return ( {/**/} {/*Branch: 10_STABLE*/} {/**/} Alias System {/*Branch*/} Trending Detail Date improvement status quo regression {listBody} {/**/} {/**/} {/**/} {/**/} {/*1*/} {/*2*/} {/*3*/} {/*4*/} {/**/} {/**/} {/**/} {/**/} this.onPageNumChange(current)} pageSize={2} current={this.state.currentPage} total={this.props.total}/>
); } } export default BasicTable;