wyq 3 anni fa
parent
commit
0b1547aba5

+ 29 - 11
src/components/AHeader/index.js

@@ -66,17 +66,29 @@ function AHeader({ history, hideName }) {
             setDateTime(getTimeDetail())
         }, 1000);
     }
-    function cancel() { }
+    function cancel() {
+        setVisible(false)
+        form.resetFields();
+    }
     const onFinish = values => {
-        console.log(values);
         const params = values
-        post(api.midifyPassword,params).then((res) => {
+        post(api.midifyPassword, params).then((res) => {
             if (res.data.code === 200) {
 
             }
         })
     }
-
+    const validateToNextPassword = (rule, value, callback) => {
+        // 校验密码强度
+        // 1. 必须同时包含大写字母、小写字母和数字,三种组合
+        // 2. 长度在8-30之间
+        if (value) {
+            if (value.length < 8 || value.length > 12) {
+                return Promise.reject(new Error('密码长度8-12位'));
+            }
+        }
+        callback();
+    };
     useEffect(() => {
         countTime();
         if (!user.name) {
@@ -137,12 +149,7 @@ function AHeader({ history, hideName }) {
                         <Form.Item
                             name="password"
                             label="原密码"
-                            rules={[
-                                {
-                                    required: true,
-                                    message: '8-12位大小写字母、数字、特殊字符',
-                                },
-                            ]}
+                            required
                             hasFeedback
                         >
                             <Input.Password placeholder="8-12位大小写字母、数字、特殊字符" />
@@ -156,7 +163,18 @@ function AHeader({ history, hideName }) {
                                 {
                                     required: true,
                                     message: '8-12位大小写字母、数字、特殊字符',
-                                }
+                                },
+                                ({ getFieldValue }) => ({
+                                    validator(_, value) {
+                                        const passwordReg = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).*$/;
+                                        if (!passwordReg.test(value)) {
+                                            return Promise.reject(new Error('密码必须同时包含大写字母、小写字母和数字'));
+                                        }
+                                        if (value.length < 8 || value.length > 12) {
+                                            return Promise.reject(new Error('密码长度8-12位'));
+                                        }
+                                    },
+                                }),
                             ]}
                         >
                             <Input.Password placeholder="8-12位大小写字母、数字、特殊字符" />

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

@@ -33,6 +33,8 @@ function AMenu() {
     const { activeTab, panes } = useSelector(state => {
         return state.tabPanes;
     });
+    
+    
     //切换菜单、增加tab
     function changeMenu(val) {
         const idName = val.key.split("-");
@@ -53,6 +55,8 @@ function AMenu() {
                 const data = res.data.data;
                 const menuData = data.showMenuInfo;
                 setMenuList(menuData);
+                firstMenuPage = menuData[0].children[0]
+                
             } else {
                 message.error(res.data.msg || '获取菜单失败');
             }
@@ -61,9 +65,6 @@ function AMenu() {
     function getSubMenu(data) {
         return data.map((it) => {
             if (it.menuType === '1') {
-                if (!firstMenuPage) {
-                    firstMenuPage = it;
-                }
                 return (
                     <Menu.Item key={it.menuName}>{it.menuName}</Menu.Item>
                 )
@@ -80,7 +81,7 @@ function AMenu() {
     }
     useEffect(() => {
         getUserMenus();
-        const timeO = setTimeout(() => {
+        const timeO = setTimeout(() => { 
             dispatch(
                 add({ title: firstMenuPage.menuName, content: pageMap[firstMenuPage.menuName] || <NullPage />, key: firstMenuPage.menuName })
             );

+ 48 - 45
src/components/DataManager/AddData.js

@@ -117,7 +117,6 @@ function AddData(props) {
             setTags([...tags])
           })
         }
-
       } else {
         message.warning(res.data.msg || '获取医院列表失败');
       }
@@ -176,7 +175,6 @@ function AddData(props) {
     });
     tags[index].splice(i)
     setTags([...tags])
-    console.log(form.getFieldsValue())
   }
   function callback(key) {
     setKey(key.split('-')[0])
@@ -189,7 +187,6 @@ function AddData(props) {
     form.setFieldsValue({
       softwareVOS: arr
     });
-    console.log(form.getFieldsValue())
   }
   // 去重
   function unique(arr) {
@@ -253,6 +250,7 @@ function AddData(props) {
     getTags()
   }
   //获取已选中标签
+
   function getTags() {
     const formData = form.getFieldsValue();
     let tag = []
@@ -305,14 +303,14 @@ function AddData(props) {
 
         <Form labelCol={{ span: 4 }} wrapperCol={{ span: 18 }} form={form} name="nest-messages" onFinish={onFinish} initialValues={initialValues} validateMessages={validateMessages}>
           <Form.Item name="name" label="数据权限名称" rules={[{ required: true }]}>
-            <Input placeholder="请填写数据权限名称" />
+            <Input placeholder="请填写数据权限名称" style={{ width: 300 }} />
           </Form.Item>
           <Form.Item label="权限范围" rules={[{ required: true }]} >
             <Tabs type="card" onChange={callback}>
               {
                 orgList.map((it, i) => {
                   return (
-                    <TabPane tab={it.name} key={it.id + "-" + i} forceRender={type == 3 ? true : false}>
+                    <TabPane tab={it.name} key={it.id + "-" + i} forceRender={type == 3 && form.getFieldValue().softwareVOS[i] ? true : false}>
                       <Form.Item
                         key={i}
                         name={['softwareVOS', i, 'datatype']} noStyle>
@@ -333,6 +331,9 @@ function AddData(props) {
                       <Form.Item key={i + "b"} hidden={true} name={['softwareVOS', i, 'dataAuthDetails']} noStyle>
                         <Input />
                       </Form.Item>
+                      <Form.Item key={i + "e"} hidden={true} name={['softwareVOS', i, 'roles']} noStyle>
+                        <Input />
+                      </Form.Item>
                       <Form.Item key={i + "c"} style={{ display: value[index] == 7 && it.id == key ? 'block' : 'none' }}>
                         <Card title="已选中" extra={<a href="#">More</a>} >
                           {tags[index].map((tag, i) => {
@@ -344,17 +345,15 @@ function AddData(props) {
                       </Form.Item>
                       <Form.Item key={i + "d"} style={{ display: value[index] == 7 && it.id == key ? 'block' : 'none' }}>
                         <Tabs defaultActiveKey="0">
-                          <TabPane tab="可看医生" key="0">
+                          <TabPane tab="可看医生" key="0" forceRender={type == 3 && form.getFieldValue().softwareVOS[i] ? true : false}>
                             <Form.Item
-                              key={i}
                               name={['softwareVOS', i, 'selectedRowKeys']}
                             >
                               <DoctorList checkeds={form.getFieldValue().softwareVOS ? form.getFieldValue().softwareVOS[i] : []} checkDoct={(selectedRowKeys) => checkDoctEvent(selectedRowKeys)} />
                             </Form.Item>
                           </TabPane>
-                          <TabPane tab="可看科室" key="1">
+                          <TabPane tab="可看科室" key="1" forceRender={type == 3 && form.getFieldValue().softwareVOS[i] ? true : false}>
                             <Form.Item
-                              key={i}
                               name={['softwareVOS', i, 'softwareMenuIds']}
                             >
                               <MenuTree data={treeData} checkeds={form.getFieldValue().softwareVOS ? form.getFieldValue().softwareVOS[i] : []} checkEv={(checkedKeys) => checkTreeEvent(checkedKeys)} />
@@ -371,52 +370,56 @@ function AddData(props) {
           <Form.Item label="所属角色" required >
             {
               orgList.map((it, i) => {
-
                 return (
                   <Form.Item
                     key={i}
+                    style={{ display:i == index ? 'block' : 'none'}}
                   >
-                    {index == i ?
-                      <Form.Item key={i + "b"}
-                        name={['softwareVOS', i, 'roles']} rules={[
-                          {
-                            required: true,
-                            message: '请选择所属角色',
-                          },
-                        ]}>
-                        <TreeSelect
-                          showSearch={false}
-                          treeData={treeRloe}
-                          onChange={treeChange}
-                          maxTagCount={1}
-                          treeCheckable
-                          showCheckedStrategy={SHOW_PARENT}
-                          placeholder="请选择角色"
-                          style={{ width: '100%' }}
-                        />
-                      </Form.Item>
-                      : null}
-
+                  { index == i ?
+                  <Form.Item key={i + "b"}
+                    name={['softwareVOS', i, 'roles']}
+                    rules={[
+                      {
+                        required: true,
+                        message: '请选择所属角色',
+                      },
+                    ]}>
+                    <TreeSelect
+                      style={{ width: 300 }}
+                      showSearch={false}
+                      treeData={treeRloe}
+                      onChange={treeChange}
+                      maxTagCount={1}
+                      treeCheckable
+                      showCheckedStrategy={SHOW_PARENT}
+                      placeholder="请选择角色"
+                    />
                   </Form.Item>
+                  : null}
+
+          </Form.Item>
                 )
               })
             }
           </Form.Item>
-          <Form.Item
-            name="status"
-            valuePropName="checked"
-            label="当前状态"
-            rules={[{ required: true, message: '请选择状态' }]}
-          >
-            <Switch onChange={swichChange} />
-          </Form.Item>
-          <Form.Item wrapperCol={{ span: 20, offset: 8 }}>
-            <Button type="primary" htmlType="submit">
-              Submit
-        </Button>
-          </Form.Item>
+        <Form.Item
+          name="status"
+          valuePropName="checked"
+          label="当前状态"
+          rules={[{ required: true, message: '请选择状态' }]}
+        >
+          <Switch onChange={swichChange} />
+        </Form.Item>
+        <Form.Item wrapperCol={{ span: 6, offset: 21 }}>
+          <Button className='but' onClick={back}>
+            取消
+            </Button>
+          <Button type="primary" htmlType="submit">
+            保存
+            </Button>
+        </Form.Item>
         </Form>
-      </div>
+    </div>
     </>
   )
 }

+ 1 - 2
src/components/DataManager/MenuTree.js

@@ -13,8 +13,7 @@ function MenuTree(props) {
 
   }
   const treeData = data ? data : null;
-  const defaultCheckedKeys = checkeds.softwareMenuIds ? checkeds.softwareMenuIds.slice() : []
-  console.log(defaultCheckedKeys)
+  const defaultCheckedKeys = checkeds && checkeds.softwareMenuIds ? checkeds.softwareMenuIds.slice() : []
   return (
     <Tree
       checkable

+ 36 - 19
src/components/DataManager/doctorList.js

@@ -20,31 +20,36 @@ function DoctorList(props) {
   const [doctorList, setDoctorList] = useState([]);
   const [name, setName] = useState("");
   const [phone, setPhone] = useState("");
-  const [pages, setPages] = useState("1");
-  const [current, setCurrent] = useState("5");
   const [treeData, setTreeData] = useState([]);
+  const [total, setTotal] = useState(0);
   // const [selectedRowKeys, setSelectedRowKeys] = useState();
   const [addHospitalTreeVO, setAddHospitalTreeVO] = useState({
     depts: [],
     hospitals: []
   });
-  const selectedRowKeys = checkeds.selectedRowKeys ? checkeds.selectedRowKeys.slice() : []
-  console.log(selectedRowKeys);
-
+  const selectedRowKeys = checkeds && checkeds.selectedRowKeys ? checkeds.selectedRowKeys.slice() : []
+  let params = {
+    asc: ["id"],
+    pages: 1,
+    current: 1,
+    size: 5
+  }
   //获取可看医生列表
   function getDoctorPage() {
-    const param = {
-      pages: pages,
-      current: current,
-      mobilePhone: phone,
-      name: name,
-      depts: addHospitalTreeVO.depts,
-      hospitals: unique(addHospitalTreeVO.hospitals)
-    }
-    post(api.getDoctorPage, param).then((res) => {
+    // const param = {
+    //   asc: ["id"],
+    //   pages: pages,
+    //   size: current,
+    //   mobilePhone: phone,
+    //   name: name,
+    //   depts: addHospitalTreeVO.depts,
+    //   hospitals: unique(addHospitalTreeVO.hospitals)
+    // }
+    post(api.getDoctorPage, params).then((res) => {
       if (res.data.code === 200) {
         const data = res.data.data;
         setDoctorList(data.records);
+        setTotal(data.total)
       }
     })
   }
@@ -65,9 +70,6 @@ function DoctorList(props) {
       return arr.indexOf(item, 0) === index;
     });
   }
-  const onFinish = (value) => {
-    getDoctorPage(value);
-  };
   const onReset = () => {
     form.resetFields();
     getDoctorPage();
@@ -107,10 +109,22 @@ function DoctorList(props) {
     })
     setAddHospitalTreeVO(addHospitalTreeVO)
   };
+  function changePage(page, pageSize) {
+    params.current = page
+    params.size = pageSize
+    getDoctorPage()
+  }
   function onSelectChange(selectedRowKeys) {
     checkDoct(selectedRowKeys)
   }
   function submit() {
+    params = {
+      ...params,
+      mobilePhone: phone,
+      name: name,
+      depts: addHospitalTreeVO.depts,
+      hospitals: unique(addHospitalTreeVO.hospitals)
+    }
     getDoctorPage()
   }
   return (
@@ -159,13 +173,16 @@ function DoctorList(props) {
             selectedRowKeys,
             onChange: onSelectChange,
           }}
+          className='doctorTable'
           columns={columns}
           dataSource={doctorList}
           rowKey={record => record.id + '-' + record.name}
           pagination={{
-            showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条数据`,
-            pageSizeOptions: ['15', '30', '60', '120'],
+            pageNo: 1,
             pageSize: 5,
+            showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条数据`,
+            onChange: (page, pageSize) => changePage(page, pageSize),//点击页码事件
+            total: total
           }} />
       </div>
     </div>

+ 18 - 9
src/components/DataManager/index.js

@@ -147,8 +147,6 @@ function DataManager() {
             })
             softwareMenuIds[i].push(item.id + '-' + item.name)
           })
-
-
           arr.softwareVOS[i].roles = roles[i]
           arr.softwareVOS[i].dataAuthDetails = dataAuthDetails[i] && dataAuthDetails[i].length > 0 ? dataAuthDetails[i] : [{ dataType: it.dataType }]
           arr.softwareVOS[i].selectedRowKeys = selectedRowKeys[i]
@@ -165,22 +163,24 @@ function DataManager() {
         setTag(tag)
         setVal(val)
         setFormData(arr)
-  
       }
     })
   }
   //保存
   function addData(formData) {
     let url = api.addAuth;
-    let roles = formData.roles
     delete formData.roles
     let param = {
       addDataAuthVO: formData,
-      roles: roles
     }
     if (type == 3) {
       url = api.updateAuth
-      param.id = id
+      param = {
+        updateDataAuthVO: {
+          ...formData,
+          id: id
+        },
+      }
     }
     post(url, param).then((res) => {
       if (res.data.code === 200) {
@@ -195,7 +195,11 @@ function DataManager() {
     });
   }
   const onFinish = (value) => {
-    getDataAuthPage(value);
+    params = {
+      ...value,
+      ...params
+    }
+    getDataAuthPage();
   };
   const onReset = () => {
     form.resetFields();
@@ -251,6 +255,11 @@ function DataManager() {
     setFormData(null)
     getDataAuthPage()
   }
+  function onSizeChange(current, pageSize) {
+    params.current = current
+    params.size = pageSize
+    getDataAuthPage()
+  }
   function changePage(page, pageSize) {
     params.current = page
     params.size = pageSize
@@ -320,10 +329,10 @@ function DataManager() {
           rowKey={record => record.id + record.roleName}
           pagination={{
             pageNo: 1,
-            pageSize: 15,
+            pageSize: params.size,
             pageSizeOptions: ['15', '30', '60', '120'],
             showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条数据`,
-            onShowSizeChange: (current, pageSize) => this.pageSize = pageSize, // 改变每页数量时更新显示
+            onShowSizeChange: (current, pageSize) => onSizeChange(current, pageSize), // 改变每页数量时更新显示
             onChange: (page, pageSize) => changePage(page, pageSize),//点击页码事件
             total: total
           }} />

+ 10 - 0
src/components/DataManager/index.less

@@ -25,3 +25,13 @@
   height: calc(100vh - 180px);
   overflow-y: auto;
 }
+
+.but{
+  margin-right: 20px;
+}
+.doctorTable{
+  height: 400px!important;
+  .ant-pagination-options{
+    display: none;
+  }
+}

+ 0 - 11
src/components/FuncManager/index.js

@@ -12,21 +12,11 @@ const { post, api, xPost } = apiObj;
 const { Option } = Select;
 function OrgManager() {
   useEffect(() => {
-    //监听resize事件
-    setTableHt(window.innerHeight - 260);
-    window.addEventListener('resize', () => {
-      setTableHt(window.innerHeight - 260);
-    });
     //刷新列表
     getMenusTree();
-    //解绑事件
-    return function clear() {
-      window.removeEventListener("resize");
-    }
   }, []);
   const [form] = Form.useForm();
   const [dataSource, setDataSource] = useState([]);   //列表数据
-  const [tableHt, setTableHt] = useState(300);   //表格滚动高度
   const [visible, setVisible] = useState(false);   //删除禁用确认弹窗显示
   const [addVisible, setAddVisible] = useState(false);         //新增页面显示
   const [modalType, setModalType] = useState(1);
@@ -201,7 +191,6 @@ function OrgManager() {
     ];
     return (
       <Table
-        scroll={{ y: tableHt }}
         pagination={false}
         className="components-table-demo-nested"
         rowKey={record => record.id}

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

@@ -170,6 +170,11 @@ function InpaManager() {
   // function onSearch(val) {
   //   getDeptList({ deptName: val })
   // }
+  function onSizeChange(current, pageSize) {
+    params.current = current
+    params.size = pageSize
+    getRegion()
+  }
   function changePage(page, pageSize) {
     params.current = page
     params.size = pageSize
@@ -288,11 +293,11 @@ function InpaManager() {
           dataSource={userList}
           rowKey={record => record.id}
           pagination={{
-            pageNo: 1,
-            pageSize: 15,
+            pageNo: 1, 
+            pageSize: params.size,
             pageSizeOptions: ['15', '30', '60', '120'],
             showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条数据`,
-            onShowSizeChange: (current, pageSize) => this.pageSize = pageSize, // 改变每页数量时更新显示
+            onShowSizeChange: (current, pageSize) => onSizeChange(current, pageSize), // 改变每页数量时更新显示
             onChange: (page, pageSize) => changePage(page, pageSize),//点击页码事件
             total: total
           }} />

+ 11 - 5
src/components/OrgManager/AddSubOrg.js

@@ -77,7 +77,7 @@ function StepContent(props) {
             number: '${label} is not a valid number!',
         },
     };
-
+    
     //获取菜单数据
     function getTreeData() {
         xPost(api.getUserMenuResourceTree, { type: 0 }).then((res) => {
@@ -253,15 +253,21 @@ function StepContent(props) {
                     hidden={current !== 1}
                     name={['addHospitalUserVO', 'username']}
                     rules={[{ required: true }]}>
-                    <Input placeholder='请输入用户名' autoComplete='off' disabled={type == 2 ? true : false} />
+                    <Input placeholder='用户名是组织中唯一标识,请勿重复' autoComplete='off' disabled={type == 2 ? true : false} />
                 </Form.Item>
                 <Form.Item
                     label="初始密码"
                     type="password"
                     hidden={current !== 1}
                     name={['addHospitalUserVO', 'password']}
-                    rules={[{ required: true }]}>
-                    <Input placeholder='请输入初始密码' autoComplete='off' disabled={type == 2 ? true : false} />
+                    rules={[{ required: true }, ({ getFieldValue }) => ({
+                        validator(_, value) {
+                            if (value.length < 8 || value.length > 12) {
+                                return Promise.reject(new Error('密码长度8-12位'));
+                            }
+                        },
+                    })]}>
+                    <Input placeholder='8-12位大小写字母、数字、特殊字符' autoComplete='off' disabled={type == 2 ? true : false} />
                 </Form.Item>
                 <Form.Item
                     label="确认密码"
@@ -277,7 +283,7 @@ function StepContent(props) {
                             return Promise.reject(new Error('两次密码输入不一致!'));
                         },
                     }),]}>
-                    <Input placeholder='请输入确认密码' autoComplete='off' disabled={type == 2 ? true : false} />
+                    <Input placeholder='8-12位大小写字母、数字、特殊字符' autoComplete='off' disabled={type == 2 ? true : false} />
                 </Form.Item>
                 <Form.Item
                     label="开放系统"

+ 8 - 9
src/components/OrgManager/index.js

@@ -13,20 +13,20 @@ const { Option } = Select;
 function OrgManager() {
     useEffect(() => {
         //监听resize事件
-        setTableHt(window.innerHeight - 260);
-        window.addEventListener('resize', () => {
-            setTableHt(window.innerHeight - 260);
-        });
+        // setTableHt(window.innerHeight - 260);
+        // window.addEventListener('resize', () => {
+        //     setTableHt(window.innerHeight - 260);
+        // });
         //刷新列表
         getTableData();
         //解绑事件
-        return function clear() {
-            window.removeEventListener("resize");
-        }
+        // return function clear() {
+        //     window.removeEventListener("resize");
+        // }
     }, []);
 
     const [dataSource, setDataSource] = useState([]);   //列表数据
-    const [tableHt, setTableHt] = useState(300);   //表格滚动高度
+    // const [tableHt, setTableHt] = useState(300);   //表格滚动高度
     const [visible, setVisible] = useState(false);   //删除禁用确认弹窗显示
     const [addVisible, setAddVisible] = useState(false);         //新增页面显示
     const [confirmLoading, setConfirmLoading] = useState(false);
@@ -251,7 +251,6 @@ function OrgManager() {
         ];
         return (
             <Table
-                scroll={{ y: tableHt }}
                 pagination={false}
                 className="components-table-demo-nested"
                 rowKey={record => record.hospitalId}

+ 3 - 3
src/components/PageLayout/index.js

@@ -21,9 +21,9 @@ function PageLayout(){
     });
     function getStaticInfos() {
         const { hisTypeList, statusList, titleList, dataList } = staticInfo;
-        if ([...hisTypeList, ...statusList, ...titleList, ...dataList].length > 0) {
-            return;
-        }
+        // if ([...hisTypeList, ...statusList, ...titleList, ...dataList].length > 0) {
+        //     return;
+        // }
         post(api.getManagerBoxInfo).then((res) => {
             if (res.data.code === 200) {
                 const data = res.data.data;

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

@@ -166,6 +166,11 @@ function RoleManager(){
         setAddVisible(false);
         setRoleDetail(null)
     } 
+    function onSizeChange(current, pageSize) {
+        params.current = current
+        params.size = pageSize
+        getTableData()
+    }
     function changePage(page, pageSize) {
         params.current = page
         params.size = pageSize
@@ -199,10 +204,10 @@ function RoleManager(){
                 dataSource={dataSource}
                 pagination={{
                     pageNo: 1,
-                    pageSize: 15,
+                    pageSize: params.size,
                     pageSizeOptions: ['15', '30', '60', '120'],
                     showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条数据`,
-                    onShowSizeChange: (current, pageSize) => this.pageSize = pageSize, // 改变每页数量时更新显示
+                    onShowSizeChange: (current, pageSize) => onSizeChange(current, pageSize), // 改变每页数量时更新显示
                     onChange: (page, pageSize) => changePage(page, pageSize),//点击页码事件
                     total: total
                 }}
@@ -212,7 +217,11 @@ function RoleManager(){
     //筛选项渲染
     const [form] = Form.useForm();
     const onFinish = (values) => {
-        getTableData(values);
+        params = {
+            ...values,
+            ...params
+        }
+        getTableData();
     };
     const onReset = () => {
         form.resetFields();

+ 3 - 0
src/components/SysChoose/index.js

@@ -53,6 +53,9 @@ function SysChoose({history}) {
                 dispatch(setUser(userInfo));
                 //默认显示第一个系统的组织
                 setHisList(software[0]?software[0].hospitals:[]);
+                if (data.jump){
+                    getIn(software[0].hospitals.hospitalId)
+                }
             }else{
                 message.warning(res.data.msg||'获取医院列表失败');
             }

+ 9 - 1
src/components/UserManager/addUser.js

@@ -172,6 +172,7 @@ function AddUser(props) {
   function cancel() {
     props.userChange()
   }
+
   return (
     <>
       <Form
@@ -223,7 +224,14 @@ function AddUser(props) {
             {
               required: true,
               message: '8-12位大小写字母、数字、特殊字符',
-            },
+            }, 
+            ({ getFieldValue }) => ({
+              validator(_, value) {
+                if (value.length < 8 || value.length > 12) {
+                  return Promise.reject(new Error('密码长度8-12位'));
+                }
+              },
+            }),
           ]}
           hasFeedback
         >

+ 7 - 2
src/components/UserManager/index.js

@@ -159,6 +159,11 @@ function UserManager() {
       message.error("接口出错");
     });
   }
+  function onSizeChange(current, pageSize) {
+    params.current = current
+    params.size = pageSize
+    getUserPage()
+  }
   function changePage(page, pageSize) {
     params.current = page
     params.size = pageSize
@@ -310,10 +315,10 @@ function UserManager() {
           rowKey={record => record.userId + record.hospitalName}
           pagination={{
             pageNo: 1,
-            pageSize: 15,
+            pageSize: params.size,
             pageSizeOptions: ['15', '30', '60', '120'],
             showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条数据`,
-            onShowSizeChange: (current, pageSize) => this.pageSize = pageSize, // 改变每页数量时更新显示
+            onShowSizeChange: (current, pageSize) => onSizeChange(current, pageSize), // 改变每页数量时更新显示
             onChange: (page, pageSize) => changePage(page, pageSize),//点击页码事件
             total: total
           }} />