wyq 3 gadi atpakaļ
vecāks
revīzija
54f0514e1b

+ 8 - 0
src/api/request.js

@@ -50,6 +50,14 @@ const request = {
     checkSolveRegion: '/security-center/regionManage/checkSolveRegion',//禁用启用
     deleteRegion: '/security-center/regionManage/deleteRegion',//删除病区
     updateRegion: '/security-center/regionManage/updateRegion',//修改病区
+
+    //功能管理
+    getMenusTree: '/security-center/funcManage/getMenusTree',//列表
+    addMenu: '/security-center/funcManage/addMenu',//添加
+    disableMenu: '/security-center/funcManage/disableMenu',//禁用启用
+    deleteMenu: '/security-center/funcManage/deleteMenu',//删除
+    getMenuById: '/security-center/funcManage/getMenuById',//获取详情
+    updateMenu: '/security-center/funcManage/updateMenu',//修改
 }
 
 export default request;

+ 1 - 1
src/components/AHeader/index.js

@@ -31,7 +31,7 @@ function AHeader({ history,hideName }){
         localStorage.removeItem("token");
         localStorage.removeItem("systemId");
         localStorage.removeItem("hospitalId");
-        dispatch(panesNow());
+        dispatch(panesNow([]));
         history.push('/login');
     }
     //获取组织列表

+ 28 - 26
src/components/AMenu/index.js

@@ -1,5 +1,5 @@
-import { Menu,message } from 'antd';
-import { useState,useEffect } from 'react';
+import { Menu, message } from 'antd';
+import { useState, useEffect } from 'react';
 import { useDispatch, useSelector } from 'react-redux'
 import { add, active } from '@reducers/tabPanes'
 import OrgManager from "../OrgManager";
@@ -8,9 +8,10 @@ import UserManager from "../UserManager";
 import DataManager from "../DataManager";
 import InpaManager from "../InpaManager"
 import NullPage from "../NullPage";
+import FuncManager from "../FuncManager";
 import apiObj from '@api/index';
 
-const { xPost,api } = apiObj;
+const { xPost, api } = apiObj;
 const { SubMenu } = Menu;
 const propTypes = {};
 const defaultProps = {};
@@ -20,15 +21,16 @@ const pageMap = {
     '角色管理': <RoleManager />,
     '用户管理': <UserManager />,
     '数据权限': <DataManager />,
-    '病区管理': <InpaManager />
+    '病区管理': <InpaManager />,
+    '功能管理': <FuncManager />
 }
 
-let firstMenuPage=null;         //第一个菜单,自动激活时用
+let firstMenuPage = null;         //第一个菜单,自动激活时用
 function AMenu() {
-    const [menuList,setMenuList] = useState([]);        //菜单列表数据
+    const [menuList, setMenuList] = useState([]);        //菜单列表数据
     const dispatch = useDispatch();
     //当前选中的菜单
-    const {activeTab ,panes} = useSelector(state => {
+    const { activeTab, panes } = useSelector(state => {
         return state.tabPanes;
     });
     //切换菜单、增加tab
@@ -45,49 +47,49 @@ function AMenu() {
         )
     }
     //获取菜单数据
-    function getUserMenus(){
-        xPost(api.getUserShowMemuTree).then((res)=>{
-            if(res.data.code===200){
-                const data =  res.data.data;
+    function getUserMenus() {
+        xPost(api.getUserShowMemuTree).then((res) => {
+            if (res.data.code === 200) {
+                const data = res.data.data;
                 const menuData = data.showMenuInfo;
                 setMenuList(menuData);
-            }else{
-                message.error(res.data.msg||'获取菜单失败');
+            } else {
+                message.error(res.data.msg || '获取菜单失败');
             }
         })
     }
-    function getSubMenu(data){
-        return data.map((it)=>{
-            if(it.menuType==='1'){
-                if(!firstMenuPage){
-                    firstMenuPage=it;
+    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>
                 )
-            }else if(it.menuType==='0'){
+            } else if (it.menuType === '0') {
                 return (
                     <SubMenu key={it.menuId} title={it.menuName}>
-                        {getSubMenu(it.children)}
+                        {it.children ? getSubMenu(it.children) : ''}
                     </SubMenu>
                 )
-            }else{
+            } else {
                 return ''
             }
         })
     }
-    useEffect(()=>{
+    useEffect(() => {
         getUserMenus();
-        const timeO = setTimeout(()=>{
+        const timeO = setTimeout(() => {
             dispatch(
                 add({ title: firstMenuPage.menuName, content: pageMap[firstMenuPage.menuName] || <NullPage />, key: firstMenuPage.menuName })
             );
-        },500);
-        return function clearOut(){
+        }, 500);
+        return function clearOut() {
             clearTimeout(timeO);
         }
 
-    },[]);
+    }, []);
     return (
         <Menu
             /*defaultSelectedKeys={[menuList[0].menuName]}

+ 231 - 0
src/components/FuncManager/AddFunc.js

@@ -0,0 +1,231 @@
+import React, {
+  useState, useEffect, useContext
+} from 'react';
+import { Modal, Form, Input, Select, Button, Switch, TreeSelect, message, Space } from 'antd';
+import apiObj from '@api/index';
+import utils from '@utils/index'
+import FuncContext from './func-context';
+import { useSelector } from 'react-redux'
+import Item from 'antd/lib/list/Item';
+const { post, api, xPost } = apiObj;
+const { Option, OptGroup } = Select;
+const { organizationData } = utils;
+const { SHOW_PARENT } = TreeSelect;
+const { TextArea } = Input;
+function AddUser(props) {
+  useEffect(() => {
+    getHospitalTree();
+  }, []);
+  const [form] = Form.useForm();
+  const { type,id,detail } = useContext(FuncContext);
+  const [treeData, setTreeData] = useState([]);
+  const [treeFunc, setTreeFunc] = useState([]);
+  const staticInfo = useSelector(state => {
+    return state.staticInfo;
+  });
+  const { titleList } = staticInfo;
+  const initialValues = detail
+  //所属系统
+  function getHospitalTree() {
+    xPost(api.getUserHospitals).then((res) => {
+      if (res.data.code === 200) {
+        const data = res.data.data.software
+        const treeFunc = organizationData(data)
+        setTreeFunc(treeFunc)
+      } else {
+        message.warning(res.data.msg || '获取医院列表失败');
+      }
+    })
+  }
+  function organizationData(arr) {
+    
+    arr.forEach(item => {
+      item.value = item.id
+      item.title = item.name
+    })
+    return arr
+  }
+  function addAttr(data) {
+    for (var j = 0; j < data.length; j++) {
+      data[j].title = data[j].name //添加title属性
+      data[j].key = data[j].code //添加key属性
+      if (data[j].children.length > 0) {
+        addAttr(data[j].children)
+      }
+    }
+    return data
+  }
+  function swichChange(val) {
+    form.setFieldsValue({ status: val ? 1 : 0 })
+  }
+  const onChangeRloe = value => {
+    form.setFieldsValue({ roles: value })
+  };
+  const onFinish = values => {
+    const formData = form.getFieldValue()
+    let params = values
+    params.parentId = formData.parentId
+    if (type == 2) {
+      params.id = id
+      updateMenu(params)
+    } else {
+      addMenu(params)
+    }
+  };
+  function addMenu(param) {
+    post(api.addMenu, param).then((res) => {
+      if (res.data.code === 200) {
+        props.userChange()
+        message.success(res.data.message);
+        form.resetFields();
+      } else {
+        message.error(res.data.message);
+      }
+    })
+  }
+  function updateMenu(param) {
+    post(api.updateMenu, param).then((res) => {
+      if (res.data.code === 200) {
+        props.userChange()
+        message.success(res.data.message);
+        form.resetFields();
+      } else {
+        message.error(res.data.message);
+      }
+    })
+  }
+  function cancel() {
+    props.userChange()
+  }
+  return (
+    <>
+      <Form
+        labelCol={{ span: 6 }}
+        wrapperCol={{ span: 16 }}
+        form={form}
+        name="register"
+        onFinish={onFinish}
+        initialValues={initialValues}
+      >
+        <Form.Item
+          name="softwares"
+          label="所属系统"
+          rules={[
+            {
+              required: true,
+              message: '请选择所属系统',
+            },
+          ]}
+        >
+          <TreeSelect
+            showSearch={false}
+            treeData={treeFunc}
+            treeCheckable
+            onChange={onChangeRloe}
+            showCheckedStrategy={SHOW_PARENT}
+            placeholder="请选择所属系统"
+            style={{ width: '100%' }}
+          />
+
+        </Form.Item>
+        <Form.Item
+          name="parentName"
+          label="上级菜单"
+        >
+          <Input disabled />
+        </Form.Item>
+        <Form.Item
+          name="name"
+          label="功能名称"
+          rules={[
+            {
+              required: true,
+              message: '请填写功能名称',
+            },
+          ]}
+          hasFeedback
+        >
+          <Input placeholder="请填写功能名称" />
+        </Form.Item>
+        <Form.Item
+          name="type"
+          label="类型"
+          hasFeedback
+          rules={[
+            {
+              required: true,
+              message: '请选择类型',
+            }
+          ]}
+        >
+          <Select
+            allowClear
+          >
+            <Option value="0">目录</Option>
+            <Option value="1">菜单</Option>
+            <Option value="2">按钮</Option>
+            <Option value="3">功能</Option>
+          </Select>
+        </Form.Item>
+        <Form.Item
+          name="permissions"
+          label="链接地址"
+        >
+          <Input placeholder="请填写链接地址" />
+
+        </Form.Item>
+        <Form.Item
+          name="code"
+          label="权限标识"
+          rules={[
+            {
+              required: true,
+              message: '请填写权限标识',
+            }
+          ]}
+        >
+          <Input placeholder="请填写权限标识" />
+        </Form.Item>
+        <Form.Item
+          name="orderNo"
+          label="排序"
+        >
+          <Input placeholder="大于0的整数" />
+        </Form.Item>
+        <Form.Item
+          name="menuDescribe"
+          label="功能描述"
+        >
+          <TextArea rows={4} />
+        </Form.Item>
+        <Form.Item
+          name="remark"
+          label="备注"
+        >
+          <TextArea rows={4} />
+        </Form.Item>
+        <Form.Item
+          name="status"
+          valuePropName="checked"
+          label="当前状态"
+          rules={[{ required: true, message: '请选择状态' }]}
+        >
+          <Switch onChange={swichChange} />
+        </Form.Item>
+        <Form.Item wrapperCol={{ offset: 8, span: 16 }}>
+          <Space size="middle">
+            <Button htmlType="button" onClick={e => cancel()}>
+              取消
+            </Button>
+            <Button type="primary" htmlType="submit">
+              保存
+            </Button>
+          </Space>
+        </Form.Item>
+
+      </Form>
+    </>
+  );
+}
+
+export default AddUser;

+ 4 - 0
src/components/FuncManager/func-context.js

@@ -0,0 +1,4 @@
+import { createContext } from 'react';
+const FuncContext = createContext(null);
+
+export default FuncContext;

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

@@ -0,0 +1,262 @@
+import { useEffect, useState } from 'react';
+import { useSelector } from 'react-redux'
+import { Table, Modal, message, Menu, Breadcrumb, Dropdown, Space, Form, Input, Button, Row, Col, Select } from 'antd';
+import { DownOutlined, PlusOutlined } from '@ant-design/icons';
+import AddFunc from './AddFunc';
+// import './index.less';
+import apiObj from '@api/index';
+import FuncContext from './func-context';
+import utils from '@utils/index'
+const { pickCheckedTreeIds } = utils;
+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);
+  const [id, setId] = useState('');    //当前操作功能id
+  const [funcDetail, setFuncDetail] = useState(null);
+  const [typeId, setTypeId] = useState('');
+  const [title, setTitle] = useState('');
+  const [type, setType] = useState('');
+  //从state中取出状态、类型列表
+  const userInfo = useSelector(state => {
+    return state.userInfo;
+  });
+  const { sysId, sysName } = userInfo;
+  const tipText = {
+    1: '确定要删除该功能?',
+    2: '确定要禁用该功能?',
+  };
+  //获取表格数据
+  function getMenusTree(param = {}) {
+    post(api.getMenusTree, param).then((res) => {
+      if (res.data.code === 200) {
+        const data = res.data.data;
+        setDataSource(data);
+      }
+
+    })
+  }
+  //启用/禁用
+  function enable(flag, id, type) {
+    const param = { id: id, status: flag };
+    xPost(api.disableMenu, param).then((res) => {
+      if (res.data.code === 200) {
+        getMenusTree();
+        setVisible(false);
+        message.success((flag ? '启用' : '禁用') + "成功");
+      } else {
+        message.warning(res.data.msg || '操作失败');
+      }
+    }).catch(() => {
+      message.error("接口出错");
+    });
+  }
+  //删除
+  function onDelete() {
+    const param = { id: id };
+    xPost(api.deleteMenu, param).then((res) => {
+      if (res.data.code === 200) {
+        getMenusTree();
+        setVisible(false);
+        message.success("删除成功");
+      } else {
+        message.warning(res.data.msg || '操作失败');
+      }
+    }).catch(() => {
+      message.error("接口出错");
+    });
+  }
+  //显示弹窗
+  function showModal(name, type, flag, id) {
+    setTitle(name);
+    setAddVisible(type)
+    setType(flag)
+    setId(id)
+    if (flag == 2) {
+      getMenuById(id)
+    }else if(flag == 1){
+      setFuncDetail({
+        status: 1,
+        parentId: 0,
+        parentName: sysName
+      })
+    }
+  }
+  //新增子功能
+  function addSubFunc(name, type, flag, id, parentName) {
+    setTitle(name);
+    setAddVisible(type)
+    setType(flag)
+    setFuncDetail({
+      status: 1,
+      parentId: id,
+      parentName: parentName,
+    })
+  }
+  //弹窗确认事件
+  function handleOk() {
+    if (modalType == 1) {
+      onDelete();
+    } else if (modalType == 2) {
+      enable(0, id);
+    }
+
+  }
+  const messageBox = (type, id) => {
+    setVisible(true)
+    setId(id)
+    setModalType(type)
+  }
+  //弹窗取消
+  function handleCancel() {
+    setVisible(false);
+  }
+  function getMenuById(id) {
+    xPost(api.getMenuById, { id: id, softwareId: sysId }).then((res) => {
+      const { data, code } = res.data;
+      if (code === 200) {
+        const detail = data
+        detail.softwares = [detail.softwareId]
+        setFuncDetail(detail)
+      } else {
+        message.warning(res.data.msg || '获取详情失败')
+      }
+    });
+  }
+  function cancel() {
+    setAddVisible(false)
+    setFuncDetail(null)
+  }
+  //表格渲染
+  function RenderTable() {
+    const columns = [
+      { title: '组织机构层级', dataIndex: 'name', key: 'name' },
+      {
+        title: '类型', key: 'type', render: (row) => {
+          if (row.children) {
+            return '-'
+          } else {
+            return row.name;
+          }
+        }
+      },
+      {
+        title: '链接地址', key: 'type', render: (row) => {
+          if (row.children) {
+            return '-'
+          } else {
+            return row.permission;
+          }
+        }
+      },
+      { title: '权限标识', dataIndex: 'code', key: 'code' },
+      {
+        title: '状态', key: 'status', render: (row) => {
+          return (<span className={(row.status === '1') ? 'Enable' : 'Disable'}>{row.statusName}</span>);
+        }
+      },
+      { title: '排序', dataIndex: 'orderNo', key: 'orderNo' },
+      {
+        title: '操作', width: 240, key: 'operation', render: (row) => {
+          if (row.rootFlag) {
+            return '-'
+          }
+          const menu = (
+            <Menu>
+              <Menu.Item key="0" >
+                {row.status === '1' ? (<a onClick={() => messageBox(2, row.id)}>禁用</a>) : (<a onClick={() => enable(1, row.id)}>启用</a>)}
+              </Menu.Item>
+              <Menu.Item key="1" onClick={() => messageBox(1, row.id)}>删除</Menu.Item>
+            </Menu>
+          );
+          return (<Space size="middle">
+            <a onClick={() => addSubFunc('新增子功能', true, 3, row.id, row.name)}>新增子功能</a>
+            <a onClick={() => showModal('修改功能', true, 2, row.id, row.softwareId)}>修改</a>
+            <Dropdown overlay={menu} trigger={['click']}>
+              <a className="ant-dropdown-link">
+                更多 <DownOutlined />
+              </a>
+            </Dropdown>
+          </Space>)
+        }
+      },
+    ];
+    return (
+      <Table
+        scroll={{ y: tableHt }}
+        pagination={false}
+        className="components-table-demo-nested"
+        rowKey={record => record.id}
+        columns={columns}
+        dataSource={dataSource}
+      />
+    )
+  }
+  const onFinish = (values: any) => {
+    getMenusTree(values);
+    console.log('筛选项:', values);
+  };
+  function userChange() {
+    setAddVisible(false)
+    setFuncDetail(null)
+  }
+  return (
+    <div className='wrapper'>
+      <div className="table">
+        <div className="table-header">
+          <h2 className="table-title">功能管理</h2>
+          <Button type="primary" icon={<PlusOutlined />} onClick={e => showModal('新增一级功能', true, 1)}>新增一级功能</Button>
+        </div>
+        <RenderTable />
+      </div>
+      {addVisible && funcDetail ?
+        <Modal
+          title={title}
+          okText='确定'
+          cancelText='取消'
+          width={'45%'}
+          visible={addVisible}
+          onCancel={cancel}
+          footer={null}
+          forceRender={true}
+        >
+          <FuncContext.Provider value={{ type: type, id: id, detail: funcDetail }}>
+            <AddFunc userChange={userChange} />
+          </FuncContext.Provider>
+
+        </Modal>
+        : ''}
+      <Modal
+        title="提示"
+        okText='确定'
+        cancelText='取消'
+        width={400}
+        visible={visible}
+        onOk={handleOk}
+        onCancel={handleCancel}
+      >
+        <p>{tipText[modalType]}</p>
+      </Modal>
+    </div>
+  )
+}
+
+export default OrgManager;

+ 9 - 2
src/components/OrgManager/AddSubOrg.js

@@ -95,6 +95,7 @@ function StepContent(props){
     //数据转换为树形结构所需字段
     function structureTreeData(data){
         const arr = [];
+        const checks = []
         let obj={};
         data.map((it,i)=>{
             obj =JSON.stringify(it.children).replace(/softwareMenuId/g,"key").replace(/menuName/g,'title');
@@ -103,8 +104,10 @@ function StepContent(props){
                 key:it.softwareId,
                 children:JSON.parse(obj)
             }
+            checks[i] = it.softwareId
         });
         setSysCheckeds(arr[0]?[arr[0].key]:[]);
+
         //form.setFieldsValue({softwares:[{id:arr[0]?[arr[0].key]:''}]});   //默认选中第一个
         return arr;
     }
@@ -130,10 +133,12 @@ function StepContent(props){
     }
     //树形结构选中事件
     function checkTreeEvent(i,idsArr,sourceIds){
+        console.log(activeTab);
+        
         const formData=form.getFieldsValue();
         const arr=formData.softwares;
         arr[i]={
-            id:activeTab,
+            id: activeTab,
             name:name,
             softwareMenuIds:idsArr,
             softwareResourceIds:sourceIds
@@ -144,6 +149,8 @@ function StepContent(props){
         
     }
     function onTabChange(activeTab){
+        console.log(activeTab);
+        
         setName(activeTab.split('-')[0])
         setActiveTab(activeTab.split('-')[1])
     }
@@ -292,7 +299,7 @@ function StepContent(props){
                     {
                         tabDatas.map((it,i)=>{
                             return (
-                                <TabPane tab={it.title} key={it.title+'-'+i}>
+                                <TabPane tab={it.title} key={it.title + '-' + it.key}>
                                     <Form.Item key={i} name={['softwares', i, 'softwareMenuIds']} noStyle>
                                         <MenuTree data={it} checkeds={form.getFieldValue().softwares ? form.getFieldValue().softwares[i] : []} checkEv={(checkedKeys,sourceIds)=>checkTreeEvent(i,checkedKeys,sourceIds)}/>
                                     </Form.Item>

+ 11 - 6
src/components/OrgManager/index.js

@@ -36,6 +36,8 @@ function OrgManager() {
     const [orgId, setOrgId] = useState('');      //上级组织id
     const [orgName, setOrgName] = useState('');      //上级组织名称,新增修改用
     const [orgDetail, setOrgDetail] = useState(null);
+    const [typeId, setTypeId] = useState('');
+    
     const [type, setType] = useState('');
     //从state中取出状态、类型列表
     const staticInfo = useSelector(state => {
@@ -64,8 +66,8 @@ function OrgManager() {
         })
     }
     //启用/禁用
-    function enable(flag, id) {
-        const param = { HospitalId: id || operId, status: flag };
+    function enable(flag, id, type) {
+        const param = { HospitalId: id || operId, status: flag, type: type || typeId };
         xPost(api.disableHospital, param).then((res) => {
             if (res.data.code === 200) {
                 getTableData();
@@ -95,7 +97,7 @@ function OrgManager() {
     }
     //删除
     function onDelete() {
-        const param = { HospitalId: operId };
+        const param = { HospitalId: operId, type:typeId  };
         xPost(api.deleteHospital, param).then((res) => {
             if (res.data.code === 200) {
                 getTableData();
@@ -109,10 +111,11 @@ function OrgManager() {
         });
     }
     //显示弹窗
-    function showModal(type, id) {
+    function showModal(type, id, flag) {
         setModalType(type);
         setOperId(id);
         setVisible(true);
+        setTypeId(flag)
     }
     //弹窗确认事件
     function handleOk() {
@@ -182,7 +185,9 @@ function OrgManager() {
             if (res.data.code === 200) {
                 getTableData();
                 setAddVisible(false);
+                setOrgDetail(null)
                 message.success("添加成功");
+                
             } else {
                 message.warning(res.data.msg || '操作失败');
             }
@@ -226,12 +231,12 @@ function OrgManager() {
                     const menu = (
                         <Menu>
                             <Menu.Item key="0" onClick={() => showModal(5, row.hospitalId)}>重置密码</Menu.Item>
-                            <Menu.Item key="1" onClick={() => showModal((row.hasUserFlag || row.hasHospitalFlag ? 2 : 1), row.hospitalId)}>删除</Menu.Item>
+                            <Menu.Item key="1" onClick={() => showModal((row.hasUserFlag || row.hasHospitalFlag ? 2 : 1), row.hospitalId, row.type)}>删除</Menu.Item>
                         </Menu>
                     );
                     return (<Space size="middle">
                         <a onClick={() => editSubOrg(row.hospitalId, row.type)}>修改</a>
-                        {row.status === '1' ? (<a onClick={() => showModal(row.hasUserFlag || row.hasHospitalFlag ? 4 : 3, row.hospitalId)}>禁用</a>) : (<a onClick={() => enable(1, row.hospitalId)}>启用</a>)}
+                        {row.status === '1' ? (<a onClick={() => showModal(row.hasUserFlag || row.hasHospitalFlag ? 4 : 3, row.hospitalId, row.type)}>禁用</a>) : (<a onClick={() => enable(1, row.hospitalId, row.type)}>启用</a>)}
                         <Dropdown overlay={menu} trigger={['click']}>
                             <a className="ant-dropdown-link">
                                 更多 <DownOutlined />

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

@@ -379,7 +379,7 @@ function AddUser(props) {
         {type == 3 ?
           <Form.Item wrapperCol={{ offset: 10, span: 16 }}>
             <Space size="middle">
-              <Button type="primary" htmlType="submit">
+              <Button type="primary" onClick={e => cancel()}>
                 返回
             </Button>
             </Space>

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

@@ -179,7 +179,7 @@ function UserManager() {
     setMsvisible(true)
     setUserId(id)
     setModalType(type)
-  };
+  }
 
   //提示框确认事件
   function handleOk() {
@@ -286,11 +286,11 @@ function UserManager() {
             </Col>
             <Col span={6} key={3}>
               <Form.Item>
-                  <Button type="primary" htmlType="submit">
-                    查询
+                <Button type="primary" htmlType="submit">
+                  查询
                 </Button>
-                  <Button onClick={onReset}>
-                    重置
+                <Button onClick={onReset}>
+                  重置
                 </Button>
               </Form.Item>
             </Col>
@@ -300,14 +300,14 @@ function UserManager() {
 
       <div className="table">
         <div className="table-header">
-            <h2 className="table-title">用户管理</h2>
+          <h2 className="table-title">用户管理</h2>
           <Button type="primary" icon={<PlusOutlined />} onClick={e => showModal('新增用户', true, 1)}>新增用户</Button>
         </div>
 
         <Table
           columns={columns}
           dataSource={userList}
-          rowKey={record => record.userId}
+          rowKey={record => record.userId + record.hospitalName}
           pagination={{
             pageNo: 1,
             pageSize: 15,

+ 0 - 1
src/utils/index.js

@@ -44,7 +44,6 @@ function organizationData(arr) {
             organizationData(item.children)
         }
     })
-    console.log()
     return arr
 }