import React, { Component } from 'react'; import IceContainer from '@icedesign/container'; import { Table } from '@icedesign/base'; import './LiteTable.scss'; const styles = { processing: { color: '#5485F7', }, finish: { color: '#64D874', }, terminated: { color: '#999999', }, pass: { color: '#FA7070', }, }; const generatorMockStatus = () => { const random = parseInt(Math.random() * 10, 10); if (random < 3) { return 'processing'; } else if (random >= 3 && random < 6) { return 'finish'; } else if (random >= 6 && random < 8) { return 'terminated'; } else if (random >= 8) { return 'pass'; } }; const generatorData = () => { return Array.from({ length: 10 }).map((item, index) => { return { project: `这里是字数不能太长的项目名 ${index}`, owner: `开发者 ${index}`, status: generatorMockStatus(), }; }); }; const statusComponents = { processing: 进行中, finish: 已完成, terminated: 已终止, pass: 未通过, }; export default class LiteTable extends Component { static displayName = 'LiteTable'; static propTypes = {}; static defaultProps = {}; constructor(props) { super(props); this.state = { tableData: generatorData(), }; } renderStatus = (value) => { return statusComponents[value]; }; render() { const { tableData } = this.state; return (