Browse Source

日志管理

wyq 3 years ago
parent
commit
ca12f85ba8

+ 2 - 1
src/api/request.js

@@ -64,7 +64,8 @@ const request = {
 
     //日志管理
     getOperationLog: '/security-center/logManage/getOperationLog',//操作日志
-    
+    getLoginLog: '/security-center/logManage/getLoginLog',//登录日志
+    getAbnormalLog: '/security-center/logManage/getAbnormalLog',//异常日志
 }
 
 export default request;

+ 7 - 0
src/common/common.less

@@ -114,4 +114,11 @@ body{
 .menuItem:hover{
   color: #1690FF;
   background: #DBEEFF;
+}
+.record{
+  width: 150px;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  display: block;
 }

+ 5 - 2
src/components/AMenu/index.js

@@ -10,6 +10,8 @@ import InpaManager from "../InpaManager"
 import NullPage from "../NullPage";
 import FuncManager from "../FuncManager";
 import OperationLog from "../OperationLog";
+import LoginLog from "../LoginLog";
+import ExceptionLog from "../ExceptionLog";
 import apiObj from '@api/index';
 
 const { xPost, api } = apiObj;
@@ -25,7 +27,8 @@ const pageMap = {
     '病区管理': <InpaManager />,
     '功能管理': <FuncManager />,
     '操作日志': <OperationLog />,
-    
+    '登录日志': <LoginLog />,
+    '异常日志': <ExceptionLog />,
 }
 
 let firstMenuPage = null;         //第一个菜单,自动激活时用
@@ -58,7 +61,7 @@ function AMenu() {
                 const data = res.data.data;
                 const menuData = data.showMenuInfo;
                 setMenuList(menuData);
-                firstMenuPage = menuData[0].children[0]
+                firstMenuPage = menuData[0].children ? menuData[0].children[0] : menuData[0]
                 
             } else {
                 message.error(res.data.msg || '获取菜单失败');

+ 3 - 1
src/components/DataManager/index.js

@@ -23,6 +23,7 @@ function DataManager() {
   const [total, setTotal] = useState(0);
   const [tag, setTag] = useState([[]]);
   const [val, setVal] = useState([]);
+  const [size, setSize] = useState(15);
   const [form] = Form.useForm();
   const tipText = {
     1: '确定要删除该数据权限?',
@@ -264,6 +265,7 @@ function DataManager() {
   function onSizeChange(current, pageSize) {
     params.current = current
     params.size = pageSize
+    setSize(pageSize)
     getDataAuthPage()
   }
   function changePage(page, pageSize) {
@@ -335,7 +337,7 @@ function DataManager() {
           rowKey={record => record.id + record.roleName}
           pagination={{
             pageNo: 1,
-            pageSize: params.size,
+            size,
             pageSizeOptions: ['15', '30', '60', '120'],
             showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条数据`,
             onShowSizeChange: (current, pageSize) => onSizeChange(current, pageSize), // 改变每页数量时更新显示

+ 135 - 0
src/components/ExceptionLog/index.js

@@ -0,0 +1,135 @@
+import React, { useState, useEffect, useRef } from 'react';
+import { Form, Input, Button, Table, Select, Pagination, Space, Menu, Dropdown, Modal, Breadcrumb, message, Row, Col, Tooltip } from 'antd';
+import { DownOutlined, PlusOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
+import '@common/common.less';
+import { useSelector } from 'react-redux'
+import apiObj from '@api/index';
+const { post, api, xPost } = apiObj;
+const { Option } = Select;
+function ExceptionLog() {
+  useEffect(() => {
+    getAbnormalLog();
+    console.log(123);
+    
+  }, []);
+  const [logList, setLogList] = useState([]);
+  const [total, setTotal] = useState(0);
+  const [size, setSize] = useState(15);
+  const [form] = Form.useForm();
+
+  let list = []
+  let params = {
+    pages: 1,
+    current: 1,
+    size: 15
+  }
+  //表格数据
+  function getAbnormalLog() {
+    post(api.getAbnormalLog, params).then((res) => {
+      if (res.data.code === 200) {
+        const data = res.data.data;
+        console.log(data);
+        
+        setLogList(data.records);
+        setTotal(data.total)
+      }
+    })
+  }
+
+  function onSizeChange(current, pageSize) {
+    params.current = current
+    params.size = pageSize
+    setSize(pageSize)
+    getAbnormalLog()
+  }
+  function changePage(page, pageSize) {
+    params.current = page
+    params.size = pageSize
+    getAbnormalLog()
+  }
+  const onFinish = (value) => {
+    params = {
+      ...params,
+      ...value
+    }
+    getAbnormalLog();
+  };
+  const onReset = () => {
+    form.resetFields();
+    getAbnormalLog();
+  };
+
+  const columns = [
+    { title: '编号', dataIndex: 'operationId', key: 'index' },
+    { title: '请求URL', dataIndex: 'operationUrl', key: 'index' },
+    { title: '请求方式', dataIndex: 'operationWay', key: 'index' },
+    {
+      title: '请求参数', key: 'index', render: (text, record) => (
+        <Tooltip placement="top" title={record.operationParam}>
+          <span className="record">{record.operationParam}</span>
+        </Tooltip>
+
+      )
+    },
+    { title: 'IP地址', dataIndex: 'operationIp', key: 'index' },
+    { title: '用户代理', dataIndex: 'operationName', key: 'index' },
+    { title: '创建时间', dataIndex: 'gmtCreate', key: 'index' },
+  ]
+  return (
+    <div className="wrapper">
+      <div className="filter-box">
+        <Form
+          form={form}
+          name="normal_login"
+          onFinish={onFinish}
+          initialValues={{ status: '' }}
+        >
+          <Row gutter={24}>
+            <Col span={5} key={0}>
+              <Form.Item label="请求方式" name="operationWay">
+                <Input placeholder="请求方式" />
+              </Form.Item>
+            </Col>
+            <Col span={5} key={1}>
+              <Form.Item label="IP地址" name="operationIp">
+                <Input placeholder="IP地址" />
+              </Form.Item>
+            </Col>
+            <Col span={6} key={3}>
+              <Form.Item>
+                <Button type="primary" htmlType="submit">
+                  查询
+                </Button>
+                <Button onClick={onReset}>
+                  重置
+                </Button>
+              </Form.Item>
+            </Col>
+          </Row>
+        </Form>
+      </div>
+
+      <div className="table">
+        <div className="table-header">
+          <h2 className="table-title">异常日志</h2>
+        </div>
+
+        <Table
+          columns={columns}
+          dataSource={logList}
+          rowKey={record => record.operationId}
+          pagination={{
+            pageNo: 1,
+            pageSize: 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
+          }} />
+      </div>
+    </div >
+  )
+}
+
+export default ExceptionLog;

+ 3 - 1
src/components/InpaManager/index.js

@@ -27,6 +27,7 @@ function InpaManager() {
   const [formData, setFormData] = useState(null);
   const [username, setUsername] = useState(null);
   const [total, setTotal] = useState(0);
+  const [size, setSize] = useState(15);
   const { user, sysName } = useSelector((state) => {
     return state.userInfo;
   });
@@ -173,6 +174,7 @@ function InpaManager() {
   function onSizeChange(current, pageSize) {
     params.current = current
     params.size = pageSize
+    setSize(pageSize)
     getRegion()
   }
   function changePage(page, pageSize) {
@@ -294,7 +296,7 @@ function InpaManager() {
           rowKey={record => record.id}
           pagination={{
             pageNo: 1, 
-            pageSize: params.size,
+            size,
             pageSizeOptions: ['15', '30', '60', '120'],
             showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条数据`,
             onShowSizeChange: (current, pageSize) => onSizeChange(current, pageSize), // 改变每页数量时更新显示

+ 123 - 0
src/components/LoginLog/index.js

@@ -0,0 +1,123 @@
+import React, { useState, useEffect, useRef } from 'react';
+import { Form, Input, Button, Table, Select, Pagination, Space, Menu, Dropdown, Modal, Breadcrumb, message, Row, Col, Tooltip } from 'antd';
+import { DownOutlined, PlusOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
+import '@common/common.less';
+import { useSelector } from 'react-redux'
+import apiObj from '@api/index';
+const { post, api, xPost } = apiObj;
+const { Option } = Select;
+function LoginLog() {
+  useEffect(() => {
+    getLoginLog();
+  }, []);
+  const [logList, setLogList] = useState([]);
+  const [total, setTotal] = useState(0);
+  const [size, setSize] = useState(15);
+  const [form] = Form.useForm();
+
+  let list = []
+  let params = {
+    pages: 1,
+    current: 1,
+    size: 15
+  }
+  //表格数据
+  function getLoginLog() {
+    post(api.getLoginLog, params).then((res) => {
+      if (res.data.code === 200) {
+        const data = res.data.data;
+        setLogList(data.records);
+        setTotal(data.total)
+      }
+    })
+  }
+
+  function onSizeChange(current, pageSize) {
+    params.current = current
+    params.size = pageSize
+    setSize(pageSize)
+    getLoginLog()
+  }
+  function changePage(page, pageSize) {
+    params.current = page
+    params.size = pageSize
+    getLoginLog()
+  }
+  const onFinish = (value) => {
+    params = {
+      ...params,
+      ...value
+    }
+    getLoginLog();
+  };
+  const onReset = () => {
+    form.resetFields();
+    getLoginLog();
+  };
+
+  const columns = [
+    { title: '编号', dataIndex: 'loginId', key: 'index' },
+    { title: '登录名', dataIndex: 'loginName', key: 'index' },
+    { title: '登录日期', dataIndex: 'loginDate', key: 'index' },
+    { title: 'IP地址', dataIndex: 'loginIp', key: 'index' },
+    { title: '地区', dataIndex: 'loginAddress', key: 'index' },
+    { title: '浏览器', dataIndex: 'loginBrowser', key: 'index' },
+  ]
+  return (
+    <div className="wrapper">
+      <div className="filter-box">
+        <Form
+          form={form}
+          name="normal_login"
+          onFinish={onFinish}
+          initialValues={{ status: '' }}
+        >
+          <Row gutter={24}>
+            <Col span={5} key={0}>
+              <Form.Item label="登录名" name="loginName">
+                <Input placeholder="登录名" />
+              </Form.Item>
+            </Col>
+            <Col span={5} key={1}>
+              <Form.Item label="IP地址" name="loginIp">
+                <Input placeholder="IP地址" />
+              </Form.Item>
+            </Col>
+            <Col span={6} key={3}>
+              <Form.Item>
+                <Button type="primary" htmlType="submit">
+                  查询
+                </Button>
+                <Button onClick={onReset}>
+                  重置
+                </Button>
+              </Form.Item>
+            </Col>
+          </Row>
+        </Form>
+      </div>
+
+      <div className="table">
+        <div className="table-header">
+          <h2 className="table-title">登录日志</h2>
+        </div>
+
+        <Table
+          columns={columns}
+          dataSource={logList}
+          rowKey={record => record.operationDate}
+          pagination={{
+            pageNo: 1,
+            pageSize: 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
+          }} />
+      </div>
+    </div >
+  )
+}
+
+export default LoginLog;

+ 34 - 237
src/components/OperationLog/index.js

@@ -1,165 +1,42 @@
 import React, { useState, useEffect, useRef } from 'react';
-import { Form, Input, Button, Table, Select, Pagination, Space, Menu, Dropdown, Modal, Breadcrumb, message, Row, Col } from 'antd';
+import { Form, Input, Button, Table, Pagination, Row, Col, Tooltip, DatePicker } from 'antd';
 import { DownOutlined, PlusOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
 import '@common/common.less';
-import { useSelector } from 'react-redux'
 import apiObj from '@api/index';
+import moment from "moment";
+import "moment/locale/zh-cn"
 const { post, api, xPost } = apiObj;
-const { Option } = Select;
+const { RangePicker } = DatePicker;
 function OperationLog() {
   useEffect(() => {
     getOperationLog();
   }, []);
-  const [userList, setUserList] = useState([]);
-  const [title, setTitle] = useState("");
-  const [visible, setVisible] = useState(false);
-  const [userId, setUserId] = useState("");
-  const [msvisible, setMsvisible] = useState(false);
-  const [modalType, setModalType] = useState("");
-  const [type, setType] = useState("");
-  const [formData, setFormData] = useState(null);
-  const [username, setUsername] = useState(null);
-  const [roleList, setRoleList] = useState([]);
+  const [logList, setLogList] = useState([]);
   const [total, setTotal] = useState(0);
+  const [size, setSize] = useState(15);
   const [form] = Form.useForm();
-  const tipText = {
-    1: '确定要删除该用户?',
-    2: '禁用后该用户将无法登录,确定要禁用该用户?',
-    3: '确定要重置该用户密码?',
-  };
-  const staticInfo = useSelector(state => {
-    return state.staticInfo;
-  });
+
   let list = []
   let params = {
     pages: 1,
     current: 1,
     size: 15
   }
-  const { statusList } = staticInfo;
-  //新增弹窗
-  const showModal = (name, type, flag, userId) => {
-    setVisible(type);
-    setTitle(name);
-    setType(flag)
-    setUserId(userId)
-    if (flag == 1) {
-      setFormData({
-        status: '1'
-      })
-    }
-    if (flag == 3 || flag == 2) {
-      getUserById(userId)
-    }
-  }
   //表格数据
   function getOperationLog() {
     post(api.getOperationLog, params).then((res) => {
       if (res.data.code === 200) {
         const data = res.data.data;
-        setUserList(data.records);
+        setLogList(data.records);
         setTotal(data.total)
       }
     })
   }
-  //查看用户
-  function getUserById(userId) {
-    xPost(api.getUserById, { userId: userId }).then((res) => {
-      if (res.data.code === 200) {
-        const data = res.data.data;
-        let roles = []
-        data.roles.forEach(item => {
-          roles.push(item.roleId)
-        })
-        const arr = {
-          username: data.username,
-          mobilePhone: data.mobilePhone,
-          password: data.password,
-          againpassword: data.password,
-          name: data.name,
-          idcard: data.idcard,
-          addHospitalTreeVO: getHospitals(data.hospitals),
-          titleId: data.titleId,
-          jobNo: data.jobNo,
-          roles: roles,
-          orderNo: data.orderNo,
-          status: data.status,
-        }
-        setRoleList(data.roles)
-        setFormData(arr)
-      }
-    })
-  }
-  // 处理组织结构数据回显
-  function getHospitals(arr) {
-    arr.forEach((item, i, array) => {
-      item.value = item.hospitalId
-      item.title = item.hospitalName
-      if (!item.children && item.depts) {
-        item.depts.forEach(it => {
-          it.value = item.parentId + '-' + it.deptId
-          if (it.relation == 1) {
-            list.push(it.value)
-          }
-        })
-      }
-      if (item.type != 0 && item.relation == 1) {
-        list.push(item.value)
-        console.log(list)
-      }
-      if (item.children) {
-        getHospitals(item.children)
-      }
-    })
-    return list
-  }
-  // 禁用/启用接口
-  function disableUser(userId, status) {
-    const param = { userId: userId, status: status };
-    xPost(api.disableUser, param).then((res) => {
-      if (res.data.code === 200) {
-        getOperationLog();
-        setMsvisible(false);
-        message.success((status ? '启用' : '禁用') + "成功");
-      } else {
-        message.warning(res.data.msg || '操作失败');
-      }
-    }).catch(() => {
-      message.error("接口出错");
-    });
-  }
-  //重置密码
-  function onResetPsd(userId) {
-    const param = { userId: userId };
-    xPost(api.resetPasswordUser, param).then((res) => {
-      if (res.data.code === 200) {
-        getOperationLog();
-        message.success("重置成功");
-      } else {
-        message.warning(res.data.msg || '操作失败');
-      }
-    }).catch(() => {
-      message.error("接口出错");
-    });
-  }
-  //删除
-  function deleteUser() {
-    const param = { userId: userId };
-    xPost(api.deleteUser, param).then((res) => {
-      if (res.data.code === 200) {
-        getOperationLog();
-        setMsvisible(false);
-        message.success("删除成功");
-      } else {
-        message.warning(res.data.msg || '操作失败');
-      }
-    }).catch(() => {
-      message.error("接口出错");
-    });
-  }
+
   function onSizeChange(current, pageSize) {
     params.current = current
     params.size = pageSize
+    setSize(pageSize)
     getOperationLog()
   }
   function changePage(page, pageSize) {
@@ -167,10 +44,13 @@ function OperationLog() {
     params.size = pageSize
     getOperationLog()
   }
+
   const onFinish = (value) => {
+    value.startDate = moment(value.time[0]).format('YYYY-MM-DD HH:mm:ss') 
+    value.endDate = moment(value.time[1]).format('YYYY-MM-DD HH:mm:ss') 
     params = {
       ...params,
-      ...value
+      ...value,
     }
     getOperationLog();
   };
@@ -178,82 +58,20 @@ function OperationLog() {
     form.resetFields();
     getOperationLog();
   };
-  const messageBox = (type, id) => {
-    setMsvisible(true)
-    setUserId(id)
-    setModalType(type)
-  }
-
-  //提示框确认事件
-  function handleOk() {
-    if (modalType == 1) {
-      deleteUser(userId)
-    } else if (modalType == 2) {
-      disableUser(userId, 0)
-    } else if (modalType == 3) {
-      onResetPsd(userId);
-    }
-  }
-  //提示框取消
-  function handleCancel() {
-    setMsvisible(false);
-  }
-  function cancel() {
-    setVisible(false)
-    setFormData(null)
-  }
-  function userChange() {
-    setVisible(false)
-  }
   const columns = [
-    { title: '用户名', dataIndex: 'username', key: 'index' },
-    { title: '姓名', dataIndex: 'name', key: 'index' },
-    { title: '所属组织', dataIndex: 'hospitalName', key: 'index' },
-    { title: '工号', dataIndex: 'jobNo', key: 'index' },
+    { title: '编号', dataIndex: 'operationId', key: 'index' },
+    { title: '操作人', dataIndex: 'operationName', key: 'index' },
+    { title: '操作日期', dataIndex: 'operationDate', key: 'index' },
+    { title: 'IP地址', dataIndex: 'operationIp', key: 'index' },
     {
-      title: '状态', dataIndex: 'status', key: 'status', render: (text, record) => (
-        <Space size="middle">
-          {record.status == 1 ?
-            <span className="Enable">启用</span>
-            :
-            <span className="Disable">禁用</span>
-          }
-        </Space>
+      title: '操作记录', dataIndex: 'status', key: 'status', render: (text, record) => (
+        <Tooltip placement="top" title={record.jsonResult}>
+          <span className="record">{record.jsonResult}</span>
+        </Tooltip>
+
       )
     },
-    {
-      title: '操作', dataIndex: 'key', render: (text, record) => (
-        <Space size="middle">
-          <a onClick={e => showModal('查看用户', true, 3, record.userId)}>查看</a>
-          <a onClick={e => showModal('修改用户', true, 2, record.userId)} >修改</a>
-          <Dropdown overlay={menu.bind(this, record)} record={record}>
-            <a className="ant-dropdown-link" onClick={e => e.preventDefault()}>
-              更多 <DownOutlined />
-            </a>
-          </Dropdown>
-        </Space>
-      )
-    }
   ]
-  const menu = (record) => {
-    return (
-      <Menu>
-        <Menu.Item key="0" className="menuItem" >
-          <a onClick={() => messageBox(3, record.userId)}>
-            重置密码
-          </a>
-        </Menu.Item>
-        <Menu.Item key="1" className="menuItem" >
-          {record.status === '1' ? (<a onClick={() => messageBox(2, record.userId)}>禁用</a>) : (<a onClick={() => disableUser(record.userId, 1)}>启用</a>)}
-        </Menu.Item>
-        <Menu.Item key="2" className="menuItem" >
-          <a onClick={() => messageBox(1, record.userId)}>
-            删除
-          </a>
-        </Menu.Item>
-      </Menu>
-    )
-  }
   return (
     <div className="wrapper">
       <div className="filter-box">
@@ -265,26 +83,17 @@ function OperationLog() {
         >
           <Row gutter={24}>
             <Col span={5} key={0}>
-              <Form.Item label="用户名" name="username">
+              <Form.Item label="操作人" name="operationName">
                 <Input placeholder="用户名" />
               </Form.Item>
             </Col>
             <Col span={5} key={1}>
-              <Form.Item label="姓名" name="name">
-                <Input placeholder="姓名" />
-              </Form.Item>
-            </Col>
-            <Col span={5} key={2}>
-              <Form.Item name="status" label="当前状态">
-                <Select
-                  allowClear
-                >
-                  {statusList.map((item) => {
-                    return (
-                      <Option value={item.name} key={item.name}>{item.val}</Option>
-                    )
-                  })}
-                </Select>
+              <Form.Item name="time">
+                <RangePicker
+                  showTime={{ format: 'HH:mm' }}
+                  format="YYYY-MM-DD HH:mm"
+                  placeholder={['开始时间', '结束时间']} 
+                />
               </Form.Item>
             </Col>
             <Col span={6} key={3}>
@@ -303,17 +112,16 @@ function OperationLog() {
 
       <div className="table">
         <div className="table-header">
-          <h2 className="table-title">用户管理</h2>
-          <Button type="primary" icon={<PlusOutlined />} onClick={e => showModal('新增用户', true, 1)}>新增用户</Button>
+          <h2 className="table-title">操作日志</h2>
         </div>
 
         <Table
           columns={columns}
-          dataSource={userList}
-          rowKey={record => record.userId + record.hospitalName}
+          dataSource={logList}
+          rowKey={record => record.operationDate}
           pagination={{
             pageNo: 1,
-            pageSize: params.size,
+            pageSize: size,
             pageSizeOptions: ['15', '30', '60', '120'],
             showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条数据`,
             onShowSizeChange: (current, pageSize) => onSizeChange(current, pageSize), // 改变每页数量时更新显示
@@ -321,17 +129,6 @@ function OperationLog() {
             total: total
           }} />
       </div>
-      <Modal
-        title="提示"
-        okText='确定'
-        cancelText='取消'
-        width={400}
-        visible={msvisible}
-        onOk={handleOk}
-        onCancel={handleCancel}
-      >
-        <p>{tipText[modalType]}</p>
-      </Modal>
     </div >
   )
 }

+ 3 - 1
src/components/RoleManager/index.js

@@ -26,6 +26,7 @@ function RoleManager(){
     const [modalType,setModalType] = useState(1);
     const [operId,setOperId] = useState('');    //当前操作的角色id
     const [total, setTotal] = useState(0);
+    const [size, setSize] = useState(15);
     //从state中取出状态、类型列表
     const staticInfo =useSelector(state => {
         return state.staticInfo;
@@ -167,6 +168,7 @@ function RoleManager(){
     function onSizeChange(current, pageSize) {
         params.current = current
         params.size = pageSize
+        setSize(pageSize)
         getTableData()
     }
     function changePage(page, pageSize) {
@@ -202,7 +204,7 @@ function RoleManager(){
                 dataSource={dataSource}
                 pagination={{
                     pageNo: 1,
-                    pageSize: params.size,
+                    size,
                     pageSizeOptions: ['15', '30', '60', '120'],
                     showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条数据`,
                     onShowSizeChange: (current, pageSize) => onSizeChange(current, pageSize), // 改变每页数量时更新显示

+ 3 - 1
src/components/UserManager/index.js

@@ -22,6 +22,7 @@ function UserManager() {
   const [formData, setFormData] = useState(null);
   const [username, setUsername] = useState(null);
   const [roleList, setRoleList] = useState([]);
+  const [size, setSize] = useState(15);
   const [total, setTotal] = useState(0);
   const [form] = Form.useForm();
   const tipText = {
@@ -162,6 +163,7 @@ function UserManager() {
   function onSizeChange(current, pageSize) {
     params.current = current
     params.size = pageSize
+    setSize(pageSize)
     getUserPage()
   }
   function changePage(page, pageSize) {
@@ -315,7 +317,7 @@ function UserManager() {
           rowKey={record => record.userId + record.hospitalName}
           pagination={{
             pageNo: 1,
-            pageSize: params.size,
+            size,
             pageSizeOptions: ['15', '30', '60', '120'],
             showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条数据`,
             onShowSizeChange: (current, pageSize) => onSizeChange(current, pageSize), // 改变每页数量时更新显示

+ 0 - 0
src/components/UserManager/index.less