import { Card,Pagination } from 'antd'; import {WeaPopoverHrm,WeaLocaleProvider} from 'ecCom' import equals from 'deep-equal' const getLabel = WeaLocaleProvider.getLabel; class ExchangeLogs extends React.Component{ constructor(props) { super(props); this.state={ page:props.page || 1 } } shouldComponentUpdate(nextProps,nextState) { if(!equals(this.props.data, nextProps.data)){ this.setState({page:1}) } return !equals(this.props.data, nextProps.data)|| !equals(this.state.page,nextState.page); } render(){ const {page} = this.state; const {data=[],totalSize=0} = this.props; return (
{this.getCards(page)} { Number(totalSize)>0 ?
:
{getLabel(83320,"没有可显示的数据")}
}
) } getCards(page){ const {data} = this.props; let cards = []; data.map((item,index)=>{ if(index>=(10*Number(page)-10) && index<= (10*Number(page)-1)){ cards.push(
  {item.createdate} {item.createtime}
{item.docids &&
{getLabel(857,"相关文档")}: 
} {item.requestids &&
{getLabel(1044,"相关流程")}: 
} {item.crmids &&
{getLabel(783,"相关客户")}: 
} {item.projectids &&
{getLabel(782,"相关项目")}: 
} {item.tskids &&
{getLabel(33414,"相关任务")}: 
} {item.accessory &&
{getLabel(22194,"相关附件")}: 
}
) } }); return cards; } changePageSize=(page)=>{ this.setState({page:page}); typeof this.props.onChange === 'function' && this.props.onChange(page); } } export default ExchangeLogs;