Notify-Admin/src/pages/DutyTable.tsx

25 lines
586 B
TypeScript

import { Button, Upload } from 'antd';
import { UploadOutlined } from '@ant-design/icons';
import { FC } from 'react';
import { readExcelFile } from '../utils/excel';
const DutyTablePage: FC = () => {
return (
<Upload
name='file'
action=''
beforeUpload={(file) => {
let data = readExcelFile(file, 0);
data
.then((d) => console.log('read data', d))
.catch((e) => console.log('got error', e));
return false;
}}
>
<Button icon={<UploadOutlined />} />
</Upload>
);
};
export default DutyTablePage;