|
|
|
|
1
|
import React, { useRef, useState } from 'react'
|
1
|
import React, { useRef, useState } from 'react'
|
2
|
-import { Button, Spin, Table, notification } from 'antd'
|
|
|
|
|
2
|
+import { Button, Spin, Table, Icon, notification } from 'antd'
|
3
|
import router from 'umi/router'
|
3
|
import router from 'umi/router'
|
4
|
import { fetch, apis } from '@/utils/request'
|
4
|
import { fetch, apis } from '@/utils/request'
|
5
|
|
5
|
|
|
|
|
|
27
|
const input = document.createElement('input')
|
27
|
const input = document.createElement('input')
|
28
|
input.setAttribute('type', 'file')
|
28
|
input.setAttribute('type', 'file')
|
29
|
input.addEventListener('input', e => {
|
29
|
input.addEventListener('input', e => {
|
30
|
- const files = t.target.files
|
|
|
|
|
30
|
+ const files = e.target.files
|
31
|
if (files && files[0]) {
|
31
|
if (files && files[0]) {
|
32
|
excelRef.current = files[0]
|
32
|
excelRef.current = files[0]
|
33
|
const formData = new FormData()
|
33
|
const formData = new FormData()
|
|
|
|
|
72
|
return (
|
72
|
return (
|
73
|
<div>
|
73
|
<div>
|
74
|
<div style={{ marginBottom: '24px' }}>
|
74
|
<div style={{ marginBottom: '24px' }}>
|
75
|
- <Button type="primary" onClick={downloadExcel}>下载模板</Button>
|
|
|
76
|
- <Button type="primary" onClick={importExcel} style={spaceStyle}>选取文件并预览</Button>
|
|
|
|
|
75
|
+ <Button onClick={downloadExcel}><Icon type="download" />下载模板</Button>
|
|
|
76
|
+ <Button onClick={importExcel} style={spaceStyle}><Icon type="upload" />选取文件并预览</Button>
|
77
|
<Button type="primary" onClick={submitExcel} style={spaceStyle}>提交</Button>
|
77
|
<Button type="primary" onClick={submitExcel} style={spaceStyle}>提交</Button>
|
78
|
<Button style={spaceStyle} onClick={() => router.go(-1)}>取消</Button>
|
78
|
<Button style={spaceStyle} onClick={() => router.go(-1)}>取消</Button>
|
79
|
</div>
|
79
|
</div>
|
80
|
|
80
|
|
81
|
- <Spin spinning={loading}>
|
|
|
82
|
- <Table dataSource={dataList} pagination={pagenavi}>
|
|
|
83
|
- <Column key="phaseName" title="期/区" dataIndex="phaseName" />
|
|
|
84
|
- <Column key="buildingName" title="栋" dataIndex="buildingName" />
|
|
|
85
|
- <Column key="unitName" title="单元" dataIndex="unitName" />
|
|
|
86
|
- <Column key="levelName" title="楼层" dataIndex="levelName" />
|
|
|
87
|
- <Column key="roomNoName" title="户号" dataIndex="roomNoName" />
|
|
|
88
|
- <Column key="ownerName" title="户主姓名" dataIndex="ownerName" />
|
|
|
89
|
- <Column key="roleName" title="身份" dataIndex="roleName" />
|
|
|
90
|
- <Column key="ownerTel" title="手机号" dataIndex="ownerTel" />
|
|
|
91
|
- </Table>
|
|
|
92
|
- </Spin>
|
|
|
|
|
81
|
+ <Table dataSource={dataList} pagination={pagenavi} loading={loading}>
|
|
|
82
|
+ <Column key="phaseName" title="期/区" dataIndex="phaseName" />
|
|
|
83
|
+ <Column key="buildingName" title="栋" dataIndex="buildingName" />
|
|
|
84
|
+ <Column key="unitName" title="单元" dataIndex="unitName" />
|
|
|
85
|
+ <Column key="levelName" title="楼层" dataIndex="levelName" />
|
|
|
86
|
+ <Column key="roomNoName" title="户号" dataIndex="roomNoName" />
|
|
|
87
|
+ </Table>
|
93
|
</div>
|
88
|
</div>
|
94
|
)
|
89
|
)
|
95
|
|
90
|
|