Bladeren bron

用户管理

wyq 3 jaren geleden
bovenliggende
commit
0a7e5fa9f8

+ 10 - 2
src/api/request.js

@@ -24,10 +24,18 @@ const request = {
 
 
     //用户管理相关接口
-    getHospitalTree:"/security-center/userManage/getHospitalTree",
+    getUserPage: '/security-center/userManage/getUserPage',//用户列表
+    getHospitalTree: "/security-center/userManage/getHospitalTree",
     addUser: '/security-center/userManage/addUser',//添加用户
+    updateUser: '/security-center/userManage/updateUser',//修改用户
     getUserById: '/security-center/userManage/getUserById',//查看用户
     disableUser: '/security-center/userManage/disableUser',//禁用用户
+    deleteUser: '/security-center/userManage/deleteUser',//删除用户
+
+
+    //数据权限相关接口
     getDataAuthPage: '/security-center/dataAuthManage/getDataAuthPage',//数据权限列表
-};
+    disableAuth: '/security-center/dataAuthManage/disableAuth',//禁用
+    getDoctorPage: '/security-center/dataAuthManage/getDoctorPage',//医生列表
+}
 export default request;

+ 8 - 6
src/components/PageLayout/index.js

@@ -5,7 +5,7 @@ import AHeader from '../AHeader'
 import AMenu from '../AMenu'
 import ATabs from '../ATabs'
 import apiObj from '@api/index';
-import { setStatusList, setHisTypeList} from '@reducers/staticInfo';
+import { setStatusList, setHisTypeList, setTitleList, setDataList} from '@reducers/staticInfo';
 
 const {  Content, Sider } = Layout;
 const {post,api,xPost} = apiObj;
@@ -19,16 +19,18 @@ function PageLayout(){
     const staticInfo =useSelector(state => {
         return state.staticInfo;
     });
-    function getStaticInfos(){
-        const {hisTypeList,statusList} = staticInfo;
-        if([...hisTypeList,...statusList].length>0){
+    function getStaticInfos() {
+        const { hisTypeList, statusList, titleList, dataList } = staticInfo;
+        if ([...hisTypeList, ...statusList, ...titleList, ...dataList].length > 0) {
             return;
         }
-        post(api.getManagerBoxInfo).then((res)=>{
-            if(res.data.code===200){
+        post(api.getManagerBoxInfo).then((res) => {
+            if (res.data.code === 200) {
                 const data = res.data.data;
                 dispatch(setHisTypeList(data[43]));
                 dispatch(setStatusList(data[47]));
+                dispatch(setTitleList(data[40]));
+                dispatch(setDataList(data[48]));
             }
         })
     }

+ 125 - 81
src/components/UserManager/addUser.js

@@ -1,87 +1,53 @@
 import React, {
-  useState, useEffect, useRef, useImperativeHandle, forwardRef
+  useState, useEffect, useContext
 } from 'react';
-import { Modal, Form, Input, Select, Button, Switch, TreeSelect, message } from 'antd';
+import { Modal, Form, Input, Select, Button, Switch, TreeSelect, message, Space } from 'antd';
 import apiObj from '@api/index';
-const { post, api } = apiObj;
+import utils from '@utils/index'
+import UserContext from './user-context';
+import { useSelector } from 'react-redux'
+import Item from 'antd/lib/list/Item';
+const { post, api, xPost } = apiObj;
+const { organizationData } = utils;
 const { Option, OptGroup } = Select;
 const { SHOW_PARENT } = TreeSelect;
-
-const formItemLayout = {
-  labelCol: {
-    xs: { span: 36 },
-    sm: { span: 8 },
-  },
-  wrapperCol: {
-    xs: { span: 24 },
-    sm: { span: 16 },
-  },
-};
-const tailFormItemLayout = {
-  wrapperCol: {
-    xs: {
-      span: 24,
-      offset: 0,
-    },
-    sm: {
-      span: 16,
-      offset: 8,
-    },
-  },
-};
-function NormalPlayer(props, parentRef) {
-  const { title, visible, type } = props
-  const inputRef = useRef();
+function AddUser(props) {
+  useEffect(() => {
+    getHospitalTree();
+    getCreateRoles()
+  }, []);
+  const [form] = Form.useForm();
+  const { userId, type, formData } = useContext(UserContext);
   const [treeData, setTreeData] = useState([]);
   const [treeRloe, setTreeRloe] = useState([]);
   const [addHospitalTreeVO, setAddHospitalTreeVO] = useState({
     depts: [],
     hospitals: []
   });
-  const [form] = Form.useForm();
-  useEffect(() => {
-    getHospitalTree();
-    getCreateRoles()
-  }, []);
-  // 父组件获取的值
-  useImperativeHandle(parentRef, () => {
-    return {
-      form: form.getFieldsValue(),
-      addHospitalTreeVO
-    }
-  })
-  const hideModal = () => {
-    form.resetFields();
-  };
+  const staticInfo = useSelector(state => {
+    return state.staticInfo;
+  });
+  const { titleList } = staticInfo;
+  const initialValues = formData;
+  console.log(initialValues)
   //获取当前用户组织
   function getHospitalTree() {
     post(api.getHospitalTree).then((res) => {
       if (res.data.code === 200) {
         const data = res.data.data;
-        let arr = data[0].children ? data[0].children[0].children : []
+        let arr = data[0].children ? data[0].children : []
+        arr = organizationData(arr)
         setTreeData(arr)
       }
     })
   }
-  // 处理组织结构数据
-  function organizationData(arr) {
-    let list = []
-    arr.forEach(item => {
-      list.push({
-        children: item.depts,
-        title: item.hospitalName,
-        value: item.parentId + '-' + item.hospitalId
-      })
-      item.depts.forEach(its => {
-        its.value = item.parentId + '-' + item.hospitalId + '-' + its.deptId
-      })
-    })
-    arr = JSON.parse(JSON.stringify(list).replaceAll(/deptName/g, 'title').replaceAll(/deptId/g, 'value'))
-    return arr
-  }
+
   //获取当前用于所属角色
   function getCreateRoles() {
-    post(api.getCreateRoles).then((res) => {
+    const params = {
+      softwareId: ''
+    }
+    xPost(api.getCreateRoles, params).then((res) => {
       if (res.data.code === 200) {
         const data = res.data.data;
         let arr = JSON.parse(JSON.stringify(data).replaceAll(/name/g, 'title').replaceAll(/id/g, 'value'))
@@ -89,6 +55,12 @@ function NormalPlayer(props, parentRef) {
       }
     })
   }
+  // 去重
+  function unique(arr) {
+    return arr.filter(function (item, index, arr) {
+      return arr.indexOf(item, 0) === index;
+    });
+  }
   function swichChange(val) {
     form.setFieldsValue({ status: val ? 1 : 0 })
   }
@@ -105,17 +77,33 @@ function NormalPlayer(props, parentRef) {
       hospitals: []
     }
     value.forEach(it => {
-      let arr = it.split('-')
-      let len = arr.length
-      if (len == 3) {
-        addHospitalTreeVO.depts.push(arr[2])
-        addHospitalTreeVO.hospitals.push(arr[1])
+      if (JSON.stringify(it).indexOf("-") != -1) {
+        let arr = it.split('-')
+        let len = arr.length
+        if (len == 3) {
+          addHospitalTreeVO.depts.push(arr[2])
+          addHospitalTreeVO.hospitals.push(arr[1])
+        } else {
+          addHospitalTreeVO.hospitals.push(arr[1])
+          treeData.forEach(item => {
+            item.children && item.children.forEach(tit => {
+              if (tit.value.split('-')[1] == arr[1]) {
+                tit.children.forEach(its => {
+                  addHospitalTreeVO.depts.push(its.value.split('-')[2])
+                })
+              }
+            })
+          })
+        }
       } else {
-        addHospitalTreeVO.hospitals.push(arr[1])
-        organizationData(treeData).forEach(item => {
-          if (item.value.split('-')[1] == arr[1]) {
-            item.children.forEach(its => {
-              addHospitalTreeVO.depts.push(its.value.split('-')[2])
+        addHospitalTreeVO.hospitals.push(it)
+        treeData.forEach(item => { 
+          if (item.value == it){
+            item.children && item.children.forEach(its => {
+              addHospitalTreeVO.hospitals.push(its.value.split('-')[1])
+              its.children && its.children.forEach(lit => {
+                addHospitalTreeVO.depts.push(lit.value.split('-')[2])
+              })
             })
           }
         })
@@ -123,18 +111,59 @@ function NormalPlayer(props, parentRef) {
     })
     setAddHospitalTreeVO(addHospitalTreeVO)
   };
+  const onChangeRloe = value => {
+    form.setFieldsValue({ roles: value })
+  };
+  const onFinish = values => {
+    let params = values
+    addHospitalTreeVO.hospitals = unique(addHospitalTreeVO.hospitals)
+    params.addHospitalTreeVO = addHospitalTreeVO
+    if (type == 2) {
+      params.id = userId
+      editUser(params)
+    } else {
+      addUser(params)
+    }
+
+  };
+  function addUser(param) {
+    post(api.addUser, param).then((res) => {
+      if (res.data.code === 200) {
+        props.userChange()
+        message.success(res.data.message);
+        form.resetFields();
+      } else {
+        message.error(res.data.message);
+      }
+    })
+  }
+  function editUser(param) {
+    post(api.updateUser, 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
-        {...formItemLayout}
+        labelCol={{ span: 6 }}
+        wrapperCol={{ span: 16 }}
         form={form}
         name="register"
-        scrollToFirstError
+        onFinish={onFinish}
+        initialValues={initialValues}
       >
         <Form.Item
           name="username"
           label="用户名"
-
           rules={[
             {
               required: true,
@@ -142,6 +171,7 @@ function NormalPlayer(props, parentRef) {
             },
           ]}
         >
+
           <Input placeholder="用户名是组织中唯一标识,请勿重复" disabled={type == 3 ? true : false} />
         </Form.Item>
         <Form.Item
@@ -211,7 +241,7 @@ function NormalPlayer(props, parentRef) {
         >
           <TreeSelect
             showSearch={false}
-            treeData={organizationData(treeData)}
+            treeData={treeData}
             onChange={onChange}
             treeCheckable
             showCheckedStrategy={SHOW_PARENT}
@@ -225,9 +255,11 @@ function NormalPlayer(props, parentRef) {
           label="职称"
         >
           <Select placeholder="请选择职称" disabled={type == 3 ? true : false}>
-            <Option value="male">Male</Option>
-            <Option value="female">Female</Option>
-            <Option value="other">Other</Option>
+            {titleList.map((item) => {
+              return (
+                <Option value={item.name} key={item.name}>{item.val}</Option>
+              )
+            })}
           </Select>
         </Form.Item>
         <Form.Item
@@ -245,8 +277,9 @@ function NormalPlayer(props, parentRef) {
             showSearch={false}
             treeData={treeRloe}
             treeCheckable
+            onChange={onChangeRloe}
             showCheckedStrategy={SHOW_PARENT}
-            placeholder="请选择组织"
+            placeholder="请选择角色"
             style={{ width: '100%' }}
             disabled={type == 3 ? true : false}
           />
@@ -265,8 +298,19 @@ function NormalPlayer(props, parentRef) {
         >
           <Switch onChange={swichChange} disabled={type == 3 ? true : false} />
         </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 forwardRef(NormalPlayer);
+
+export default AddUser;

+ 89 - 86
src/components/UserManager/index.js

@@ -1,13 +1,15 @@
 import React, { useState, useEffect, useRef } from 'react';
-import { Form, Input, Button, Table, Select, Pagination, Space, Menu, Dropdown, Modal, Row, Col, message } from 'antd';
+import { Form, Input, Button, Table, Select, Pagination, Space, Menu, Dropdown, Modal, Breadcrumb, message, Row, Col } from 'antd';
 import { DownOutlined, PlusOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
-import NormalPlayer from './addUser'
+import AddUser from './addUser'
 import '@common/common.less';
 import apiObj from '@api/index';
+import utils from '@utils/index'
+import UserContext from './user-context';
 const { post, api, xPost } = apiObj;
+const { organizationData } = utils;
 const { Option } = Select;
 function UserManager() {
-  const parentRef = useRef();
   useEffect(() => {
     getUserPage();
   }, []);
@@ -18,32 +20,32 @@ function UserManager() {
   const [msvisible, setMsvisible] = useState(false);
   const [modalType, setModalType] = useState("");
   const [type, setType] = useState("");
+  const [formData, setFormData] = useState(null);
+  const [username, setUsername] = useState(null);
+
   const [form] = Form.useForm();
   const tipText = {
     1: '确定要删除该用户?',
     2: '禁用后该用户将无法登录,确定要禁用该用户?',
     3: '确定要重置该用户密码?',
   };
-  const ChildrenChange = (val) => {
-    setVisible(false);
-    getUserPage()
-  }
-  const getChildrenMsg = (result, msg) => {
-    // console.log(result, msg)
-    // 很奇怪这里的result就是子组件那bind的第一个参数this,msg是第二个参数
-  }
   //新增弹窗
-  const showModal = (name, type, flag) => {
+  const showModal = (name, type, flag, userId) => {
     setVisible(type);
     setTitle(name);
     setType(flag)
-    if (flag == 3) {
-      getUserById()
+    setUserId(userId)
+    if (flag == 1) {
+      setFormData({
+        status: '1'
+      })
+    }
+    if (flag == 3 || flag == 2) {
+      getUserById(userId)
     }
   }
   //表格数据
   function getUserPage(param = {}) {
-    //const param = filterData;
     post(api.getUserPage, param).then((res) => {
       if (res.data.code === 200) {
         const data = res.data.data;
@@ -52,12 +54,29 @@ function UserManager() {
     })
   }
   //查看用户
-  function getUserById() {
-    xPost(api.getUserById, { userId: 39 }).then((res) => {
+  function getUserById(userId) {
+    xPost(api.getUserById, { userId: userId }).then((res) => {
       if (res.data.code === 200) {
         const data = res.data.data;
-        // let arr = JSON.parse(JSON.stringify(data).replaceAll(/name/g, 'title').replaceAll(/id/g, 'value'))
-        // setTreeRloe(arr)
+        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: organizationData(data.hospitals[0].children[0].children),
+          titleId: data.titleId,
+          jobNo: data.jobNo,
+          roles: roles,
+          orderNo: data.orderNo,
+          status: data.status,
+        }
+        setFormData(arr)
       }
     })
   }
@@ -76,10 +95,6 @@ function UserManager() {
       message.error("接口出错");
     });
   }
-  // 启用/禁用用户
-  function enable(userId, status) {
-    disableUser(userId, status)
-  }
   //重置密码
   function onResetPsd() {
     // const param = { HospitalId: operId };
@@ -95,9 +110,9 @@ function UserManager() {
     // });
   }
   //删除
-  function onDelete() {
+  function deleteUser() {
     const param = { userId: userId };
-    xPost(api.deleteHospital, param).then((res) => {
+    xPost(api.deleteUser, param).then((res) => {
       if (res.data.code === 200) {
         getUserPage();
         message.success("删除成功");
@@ -108,16 +123,7 @@ function UserManager() {
       message.error("接口出错");
     });
   }
-  // 确定按钮
-  function addUser(param = {}) {
-    //const param = filterData;
-    post(api.addUser, param).then((res) => {
-      if (res.data.code === 200) {
-        message.success(res.data.message);
-        form.resetFields();
-      }
-    })
-  }
+
   const onFinish = (value) => {
     getUserPage(value);
   };
@@ -130,31 +136,11 @@ function UserManager() {
     setUserId(id)
     setModalType(type)
   };
-  // 新增
-  const submit = () => {
-    console.log(parentRef.current)
-    form
-      .validateFields()
-      .then((values) => {
-        let params = parentRef.current.form
-        parentRef.current.addHospitalTreeVO.hospitals = unique(parentRef.current.addHospitalTreeVO.hospitals)
-        params.addHospitalTreeVO = parentRef.current.addHospitalTreeVO
-        addUser(params)
-      })
-      .catch((info) => {
-        console.log('Validate Failed:', info);
-      });
-  }
-  // 去重
-  function unique(arr) {
-    return arr.filter(function (item, index, arr) {
-      return arr.indexOf(item, 0) === index;
-    });
-  }
+
   //提示框确认事件
   function handleOk() {
-    if (modalType == 2) {
-      disableUser(userId, 0)
+    if (modalType == 1) {
+      deleteUser(userId)
     } else if (modalType == 2) {
       disableUser(userId, 0)
     } else if (modalType == 3) {
@@ -165,6 +151,13 @@ function UserManager() {
   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' },
@@ -184,8 +177,8 @@ function UserManager() {
     {
       title: '操作', dataIndex: 'key', render: (text, record) => (
         <Space size="middle">
-          <a onClick={e => showModal('查看用户', true, 3)}>查看</a>
-          <a onClick={e => showModal('修改用户', true, 2)} >修改</a>
+          <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 />
@@ -204,10 +197,10 @@ function UserManager() {
           </a>
         </Menu.Item>
         <Menu.Item key="1">
-          {record.status === '1' ? (<a onClick={() => messageBox(2, record.userId)}>禁用</a>) : (<a onClick={() => enable(record.userId, 1)}>启用</a>)}
+          {record.status === '1' ? (<a onClick={() => messageBox(2, record.userId)}>禁用</a>) : (<a onClick={() => disableUser(record.userId, 1)}>启用</a>)}
         </Menu.Item>
         <Menu.Item key="2">
-          <a target="_blank" rel="noopener noreferrer" href="https://www.aliyun.com">
+          <a target="_blank" onClick={() => messageBox(1, record.userId)}>
             删除
           </a>
         </Menu.Item>
@@ -216,7 +209,7 @@ function UserManager() {
   }
   return (
     <div className="wrapper">
-        <div className="filter-box">
+      <div className="filter-box">
         <Form
           form={form}
           name="normal_login"
@@ -224,16 +217,16 @@ function UserManager() {
           onFinish={onFinish}
           initialValues={{ status: '' }}
         >
-            <Row gutter={24}>
-              <Col span={6} key={0}>
-                <Form.Item label="用户名" name="username">
-                  <Input placeholder="用户名" />
-                </Form.Item>
-              </Col>
-              <Col span={6} key={1}>
-                <Form.Item label="姓名" name="name">
-                  <Input placeholder="姓名" />
-                </Form.Item>
+          <Row gutter={24}>
+            <Col span={6} key={0}>
+              <Form.Item label="用户名" name="username">
+                <Input placeholder="用户名" />
+              </Form.Item>
+            </Col>
+            <Col span={6} key={1}>
+              <Form.Item label="姓名" name="name">
+                <Input placeholder="姓名" />
+              </Form.Item>
             </Col>
             <Col span={8} key={2}>
               <Form.Item label="当前状态" name="status">
@@ -253,7 +246,7 @@ function UserManager() {
                   <Button type="primary" htmlType="submit">
                     查询
                 </Button>
-                <Button onClick={onReset}>
+                  <Button onClick={onReset}>
                     重置
                 </Button>
                 </Space>
@@ -262,9 +255,12 @@ function UserManager() {
           </Row>
         </Form>
       </div>
+
       <div className="table">
         <div className="table-header">
-            <h2 className="table-title">组织管理</h2>
+          <Breadcrumb>
+            <Breadcrumb.Item>用户管理</Breadcrumb.Item>
+          </Breadcrumb>
           <Button type="primary" icon={<PlusOutlined />} onClick={e => showModal('新增用户', true, 1)}>新增用户</Button>
         </div>
 
@@ -278,17 +274,24 @@ function UserManager() {
             pageSize: 5,
           }} />
       </div>
-      <Modal
-        title="提示"
-        okText='确定'
-        cancelText='取消'
-        width={400}
-        visible={visible}
-        onOk={submit}
-        onCancel={handleCancel}
-      >
-        <NormalPlayer title={title} visible={visible} type={type} ref={parentRef}></NormalPlayer>
-      </Modal>
+      {visible && formData ?
+        <Modal
+          title={title}
+          okText='确定'
+          cancelText='取消'
+          width={'45%'}
+          height={'50%'}
+          visible={visible}
+          onCancel={cancel}
+          footer={null}
+          forceRender={true}
+        >
+          <UserContext.Provider value={{ userId: userId, type: type, formData: formData }}>
+            <AddUser userChange={userChange} />
+          </UserContext.Provider>
+
+        </Modal>
+        : ''}
       <Modal
         title="提示"
         okText='确定'

+ 9 - 1
src/store/reducers/staticInfo.js

@@ -5,6 +5,8 @@ export const slice = createSlice({
     initialState: {
         hisTypeList:[],        //医院类型列表
         statusList:[],      //启/禁用状态列表
+        titleList:[],    //职称数据
+        dataList: [],    //数据范围
     },
     reducers: {
         setStatusList: (state,action) => {
@@ -13,9 +15,15 @@ export const slice = createSlice({
         setHisTypeList: (state,action) => {
             state.hisTypeList = action.payload;
         },
+        setTitleList: (state, action) => {
+            state.titleList = action.payload;
+        },
+        setDataList: (state, action) => {
+            state.dataList = action.payload;
+        },
     },
 });
 
-export const { setStatusList, setHisTypeList} = slice.actions;
+export const { setStatusList, setHisTypeList, setTitleList, setDataList} = slice.actions;
 
 export default slice.reducer;

+ 38 - 17
src/utils/index.js

@@ -1,35 +1,56 @@
-import {message} from 'antd';
+import { message } from 'antd';
 //统一处理请求成功、失败
 
-function handleResponse(res,callback,error){
-    if(res.data.code===200){
+function handleResponse(res, callback, error) {
+    if (res.data.code === 200) {
         callback()
-    }else{
-        message.warning('操作失败'||res.data.msg);
+    } else {
+        message.warning('操作失败' || res.data.msg);
         error();
     }
 }
 
-function pickCheckedTreeIds(data,menuIds=[],resourceIds=[]){
+function pickCheckedTreeIds(data, menuIds = [], resourceIds = []) {
     let arr = data.children;
-    if(data.relation==='1'){
-        data.softwareMenuId&&menuIds.push(data.softwareMenuId);
-        data.softwareResourceId&&resourceIds.push(data.softwareResourceId);
+    if (data.relation === '1') {
+        data.softwareMenuId && menuIds.push(data.softwareMenuId);
+        data.softwareResourceId && resourceIds.push(data.softwareResourceId);
     }
-    if(arr){
-        arr.map((it)=>{
-            pickCheckedTreeIds(it,menuIds,resourceIds);
+    if (arr) {
+        arr.map((it) => {
+            pickCheckedTreeIds(it, menuIds, resourceIds);
         });
     }
     return {
-        id:data.softwareId,
-        name:data.softwareName,
-        softwareMenuIds:menuIds,
-        softwareResourceIds:resourceIds
+        id: data.softwareId,
+        name: data.softwareName,
+        softwareMenuIds: menuIds,
+        softwareResourceIds: resourceIds
     }
 }
+// 处理组织结构数据
+function organizationData(arr) {
+    let list = []
+    arr.forEach(it => {
+        it.value = it.hospitalId
+        it.title = it.hospitalName
+        it.children && it.children.forEach(item => {
+            list.push({
+                children: item.depts,
+                title: item.hospitalName,
+                value: item.parentId + '-' + item.hospitalId
+            })
+            item.depts.forEach(its => {
+                its.value = item.parentId + '-' + item.hospitalId + '-' + its.deptId
+            })
+            it.children = JSON.parse(JSON.stringify(list).replaceAll(/deptName/g, 'title').replaceAll(/deptId/g, 'value'))
+        })
+    })
+    return arr
+}
 const obj = {
     handleResponse,
-    pickCheckedTreeIds
+    pickCheckedTreeIds,
+    organizationData
 };
 export default obj;