22 lines
1.0 KiB
JavaScript
22 lines
1.0 KiB
JavaScript
import { Avatar, List } from 'antd';
|
|
import dayjs from 'dayjs';
|
|
import { ToYuan, ThousandCont } from "oak-domain/lib/utils/money";
|
|
export default function Render(props) {
|
|
const { accountOpers, t } = props;
|
|
return (<List itemLayout="horizontal" dataSource={accountOpers} renderItem={(item, index) => {
|
|
const { $$createAt$$, type, totalPlus, availPlus } = item;
|
|
const plus = ToYuan(totalPlus || availPlus);
|
|
const sign = plus > 0 ? '+' : '';
|
|
const d = dayjs($$createAt$$);
|
|
return (<List.Item key={index}>
|
|
<List.Item.Meta avatar={<Avatar>{t(`accountOper:v.type.${type}`).at(0)}</Avatar>} title={t(`accountOper:v.type.${type}`)} description={d.format('M月D日 HH时mm分')}/>
|
|
<div style={{
|
|
fontSize: 'x-large',
|
|
color: sign ? 'gold' : 'rosybrown'
|
|
}}>
|
|
{sign}{ThousandCont(plus, 2)}
|
|
</div>
|
|
</List.Item>);
|
|
}}/>);
|
|
}
|