import { BasicColumn } from '/@/components/Table';
import moment from 'moment';

export const columns: BasicColumn[] = [
  {
    title: 'ID',
    dataIndex: 'id',
    editComponentProps: {
      prefix: '$',
    },
    width: 100,
  },
  {
    title: '资金增减',
    dataIndex: 'type',
    width: 130,
    customRender({ record }) {
      const options = ['减少', '增加'];
      return options[record.type];
    },
  },
  {
    title: '资金变化数额',
    dataIndex: 'money',
    width: 130,
  },
  {
    title: '类型名称',
    dataIndex: 'typename',
    width: 130,
  },
  {
    title: '相关会员',
    dataIndex: 'member',
    width: 130,
  },
  {
    title: '操作者',
    dataIndex: 'manager',
    width: 130,
  },
  {
    title: '创建日期',
    dataIndex: 'createtime',
    width: 200,
    customRender({ record }) {
      return moment(record.createtime).format('YYYY-MM-DD');
    },
  },
];
