FeeModal.tsx 1.11 KB
import React from 'react';
import {Modal, Table, Button} from 'antd';
import * as API from '../api';

interface Props {
  visiable: boolean;
  setVisiable: (value: boolean) => any;
  current: API.Item;
}

export default function Index(props: Props) {
  const {visiable, setVisiable, current} = props;
  const data = [current];

  return (
    <Modal
      title="餐费补贴"
      width={600}
      visible={visiable}
      maskClosable={false}
      onCancel={() => setVisiable(false)}
      footer={[
        <Button onClick={() => setVisiable(false)}>取消</Button>
      ]}
    >
      <Table
        dataSource={data}
        pagination={false}
        rowKey={r => `${r.id}`}
      >
        <Table.Column title="早餐(元)" dataIndex="breakfast" render={(text: any, record: any) => (text ? `${text}元/次` : "")} />
        <Table.Column title="午餐(元)" dataIndex="lunch" render={(text: any, record: any) => (text ? `${text}元/次` : "")} />
        <Table.Column title="晚餐(元)" dataIndex="dinner" render={(text: any, record: any) => (text ? `${text}元/次` : "")} />
      </Table>
    </Modal>
  );
}