FeeModal.tsx
1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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>
);
}