|
@@ -1,4 +1,4 @@
|
|
|
-import React, { useState, useEffect, useContext, componentWillReceiveProps } from 'react';
|
|
|
+import React, { useState, useEffect, useContext } from 'react';
|
|
|
import { Form, Input, Button, Table, Select, Pagination, Space, TreeSelect, Tag } from 'antd';
|
|
|
import { DownOutlined, PlusOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
|
|
|
import apiObj from '@api/index';
|
|
@@ -22,6 +22,7 @@ function DoctorList(props) {
|
|
|
const [phone, setPhone] = useState("");
|
|
|
const [treeData, setTreeData] = useState([]);
|
|
|
const [total, setTotal] = useState(0);
|
|
|
+ const [size, setSize] = useState(10);
|
|
|
// const [selectedRowKeys, setSelectedRowKeys] = useState();
|
|
|
const [addHospitalTreeVO, setAddHospitalTreeVO] = useState({
|
|
|
depts: [],
|
|
@@ -32,7 +33,7 @@ function DoctorList(props) {
|
|
|
asc: ["id"],
|
|
|
pages: 1,
|
|
|
current: 1,
|
|
|
- size: 5
|
|
|
+ size: 10
|
|
|
}
|
|
|
//获取可看医生列表
|
|
|
function getDoctorPage() {
|
|
@@ -114,6 +115,12 @@ function DoctorList(props) {
|
|
|
params.size = pageSize
|
|
|
getDoctorPage()
|
|
|
}
|
|
|
+ function onSizeChange(current, pageSize) {
|
|
|
+ params.current = current
|
|
|
+ params.size = pageSize
|
|
|
+ setSize(pageSize)
|
|
|
+ getDoctorPage()
|
|
|
+ }
|
|
|
function onSelectChange(selectedRowKeys) {
|
|
|
checkDoct(selectedRowKeys)
|
|
|
}
|
|
@@ -173,14 +180,17 @@ function DoctorList(props) {
|
|
|
selectedRowKeys,
|
|
|
onChange: onSelectChange,
|
|
|
}}
|
|
|
+ scroll={{ y: '260px' }}
|
|
|
className='doctorTable'
|
|
|
columns={columns}
|
|
|
dataSource={doctorList}
|
|
|
rowKey={record => record.id + '-' + record.name}
|
|
|
pagination={{
|
|
|
pageNo: 1,
|
|
|
- pageSize: 5,
|
|
|
+ size,
|
|
|
+ pageSizeOptions: ['15', '30', '60', '120'],
|
|
|
showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条数据`,
|
|
|
+ onShowSizeChange: (current, pageSize) => onSizeChange(current, pageSize), // 改变每页数量时更新显示
|
|
|
onChange: (page, pageSize) => changePage(page, pageSize),//点击页码事件
|
|
|
total: total
|
|
|
}} />
|