|
@@ -1,5 +1,5 @@
|
|
|
import {useEffect,useState} from 'react';
|
|
|
-/*import { useDispatch,useSelector } from 'react-redux'*/
|
|
|
+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 AddSubOrg from './AddSubOrg';
|
|
@@ -11,14 +11,12 @@ const {post,api,xPost} = apiObj;
|
|
|
const { Option } = Select;
|
|
|
function OrgManager(){
|
|
|
useEffect(() => {
|
|
|
- getFilterList();
|
|
|
+ //getFilterList();
|
|
|
getTableData();
|
|
|
},[]);
|
|
|
|
|
|
const [dataSource, setDataSource] = useState([]); //列表数据
|
|
|
const [orgDetail, setOrgDetail] = useState([]); //组织详情数据
|
|
|
- const [typeList,setTypeList] = useState([]); //组织类型
|
|
|
- const [statusList,setStatusList] = useState([]); //状态
|
|
|
const [visible,setVisible] = useState(false); //删除禁用确认弹窗显示
|
|
|
const [addVisible,setAddVisible] = useState(false); //新增页面显示
|
|
|
const [confirmLoading, setConfirmLoading] = useState(false);
|
|
@@ -27,6 +25,11 @@ function OrgManager(){
|
|
|
const [operId,setOperId] = useState(''); //当前操作的组织id
|
|
|
const [orgId,setOrgId] = useState(''); //上级组织id
|
|
|
const [orgName,setOrgName] = useState(''); //上级组织名称,新增修改用
|
|
|
+ //从state中取出状态、类型列表
|
|
|
+ const staticInfo =useSelector(state => {
|
|
|
+ return state.staticInfo;
|
|
|
+ });
|
|
|
+ const {hisTypeList,statusList} = staticInfo;
|
|
|
|
|
|
const tipText={
|
|
|
1:'确定要删除该组织?',
|
|
@@ -36,16 +39,6 @@ function OrgManager(){
|
|
|
5:'确定要重置该组织密码?',
|
|
|
};
|
|
|
|
|
|
- //获取筛选下拉数据
|
|
|
- function getFilterList(){
|
|
|
- post(api.getManagerBoxInfo).then((res)=>{
|
|
|
- if(res.data.code===200){
|
|
|
- const data = res.data.data;
|
|
|
- setTypeList(data[43]);
|
|
|
- setStatusList(data[47]);
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
//获取表格数据
|
|
|
function getTableData(param={}){
|
|
|
post(api.getHospitalListInfo,param).then((res)=>{
|
|
@@ -226,7 +219,7 @@ function OrgManager(){
|
|
|
};
|
|
|
if(addVisible){
|
|
|
return (
|
|
|
- <OrgContext.Provider value={{orgId,orgName,typeList,save:addSubOrg}}>
|
|
|
+ <OrgContext.Provider value={{orgId,orgName,hisTypeList,save:addSubOrg}}>
|
|
|
<AddSubOrg back={goBack}/>
|
|
|
</OrgContext.Provider>
|
|
|
)
|
|
@@ -247,7 +240,7 @@ function OrgManager(){
|
|
|
<Select
|
|
|
allowClear
|
|
|
>
|
|
|
- {typeList.map((item)=>{
|
|
|
+ {hisTypeList.map((item)=>{
|
|
|
return (
|
|
|
<Option value={item.name} key={item.name}>{item.val}</Option>
|
|
|
)
|