|
@@ -1,5 +1,5 @@
|
|
import React, { useState, useEffect, useRef } from 'react';
|
|
import React, { useState, useEffect, useRef } from 'react';
|
|
-import { Form, Input, Button, Table, Select, TreeSelect, Pagination, Space, Menu, Dropdown, Modal, Breadcrumb, message, Row, Col } from 'antd';
|
|
|
|
|
|
+import { Form, Input, Button, Table, Select, TreeSelect, Pagination, Space, Menu, Dropdown, Modal, Breadcrumb, message, Row, Col, Spin } from 'antd';
|
|
import { DownOutlined, PlusOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
|
|
import { DownOutlined, PlusOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
|
|
import AddUser from './AddPara'
|
|
import AddUser from './AddPara'
|
|
import '@common/common.less';
|
|
import '@common/common.less';
|
|
@@ -13,7 +13,7 @@ const { Option } = Select;
|
|
function DictManager() {
|
|
function DictManager() {
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
getHospitalSet();
|
|
getHospitalSet();
|
|
- getHospitalTree();
|
|
|
|
|
|
+ getHospitalNames();
|
|
}, []);
|
|
}, []);
|
|
const [dictList, setDictList] = useState([]);
|
|
const [dictList, setDictList] = useState([]);
|
|
const [title, setTitle] = useState("");
|
|
const [title, setTitle] = useState("");
|
|
@@ -22,6 +22,7 @@ function DictManager() {
|
|
const [val, setParaVal] = useState("");
|
|
const [val, setParaVal] = useState("");
|
|
const [hospitalName, setHospitalName] = useState([]);
|
|
const [hospitalName, setHospitalName] = useState([]);
|
|
const [code, setParaCode] = useState("");
|
|
const [code, setParaCode] = useState("");
|
|
|
|
+ const [status, setParaStatus] = useState("");
|
|
const [remark, setParaRemark] = useState("");
|
|
const [remark, setParaRemark] = useState("");
|
|
const [msvisible, setMsvisible] = useState(false);
|
|
const [msvisible, setMsvisible] = useState(false);
|
|
const [modalType, setModalType] = useState("");
|
|
const [modalType, setModalType] = useState("");
|
|
@@ -30,7 +31,7 @@ function DictManager() {
|
|
const [username, setUsername] = useState(null);
|
|
const [username, setUsername] = useState(null);
|
|
const [roleList, setRoleList] = useState([]);
|
|
const [roleList, setRoleList] = useState([]);
|
|
const [size, setSize] = useState(15);
|
|
const [size, setSize] = useState(15);
|
|
- const [treeData, setTreeData] = useState([]);
|
|
|
|
|
|
+ const [HospitalNamesList, setHospitalNamesList] = useState([]);
|
|
const [total, setTotal] = useState(0);
|
|
const [total, setTotal] = useState(0);
|
|
const [current, setCurrent] = useState(1);
|
|
const [current, setCurrent] = useState(1);
|
|
const { organizationData } = utils;
|
|
const { organizationData } = utils;
|
|
@@ -48,8 +49,7 @@ function DictManager() {
|
|
code: ''
|
|
code: ''
|
|
});
|
|
});
|
|
const [query, setQuery] = useState({
|
|
const [query, setQuery] = useState({
|
|
- hospitalName: '',
|
|
|
|
- code: ''
|
|
|
|
|
|
+ hospitalName: ''
|
|
});
|
|
});
|
|
const [form] = Form.useForm();
|
|
const [form] = Form.useForm();
|
|
const tipText = {
|
|
const tipText = {
|
|
@@ -74,15 +74,16 @@ function DictManager() {
|
|
}
|
|
}
|
|
|
|
|
|
//新增弹窗
|
|
//新增弹窗
|
|
- const showModal = (name, type, flag, id, hospitalName, val, code, remark) => {
|
|
|
|
|
|
+ const showModal = (title, type, flag, id, hospitalName, name, val, code, remark, status) => {
|
|
setVisible(type);
|
|
setVisible(type);
|
|
- setTitle(name);
|
|
|
|
setType(flag)
|
|
setType(flag)
|
|
setParaId(id)
|
|
setParaId(id)
|
|
- setParaVal(val)
|
|
|
|
setHospitalName(hospitalName)
|
|
setHospitalName(hospitalName)
|
|
|
|
+ setParaVal(val)
|
|
|
|
+ setTitle(title);
|
|
setParaCode(code)
|
|
setParaCode(code)
|
|
setParaRemark(remark)
|
|
setParaRemark(remark)
|
|
|
|
+ setParaStatus(status)
|
|
if (flag == 1) {
|
|
if (flag == 1) {
|
|
setFormData({
|
|
setFormData({
|
|
status: '1'
|
|
status: '1'
|
|
@@ -90,13 +91,13 @@ function DictManager() {
|
|
}
|
|
}
|
|
if ( flag == 2) {
|
|
if ( flag == 2) {
|
|
setFormData({
|
|
setFormData({
|
|
- status: '1',
|
|
|
|
id: id,
|
|
id: id,
|
|
hospitalName: hospitalName,
|
|
hospitalName: hospitalName,
|
|
name: name,
|
|
name: name,
|
|
val: val,
|
|
val: val,
|
|
code: code,
|
|
code: code,
|
|
- remark: remark
|
|
|
|
|
|
+ remark: remark,
|
|
|
|
+ status: '1',
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -114,12 +115,17 @@ function DictManager() {
|
|
}
|
|
}
|
|
|
|
|
|
//获取当前所属组织
|
|
//获取当前所属组织
|
|
- function getHospitalTree() {
|
|
|
|
- post(api.getHospitalTree).then((res) => {
|
|
|
|
|
|
+ function getHospitalNames() {
|
|
|
|
+ xPost(api.getHospitalNames, query).then((res) => {
|
|
|
|
+ console.log('所属组织??', res);
|
|
if (res.data.code === 200) {
|
|
if (res.data.code === 200) {
|
|
const data = res.data.data;
|
|
const data = res.data.data;
|
|
- const treeData = organizationData(data)
|
|
|
|
- setTreeData(treeData)
|
|
|
|
|
|
+ console.log('所属组织??', data);
|
|
|
|
+ let HospitalNamesList = []
|
|
|
|
+ HospitalNamesList = data.map(item => {
|
|
|
|
+ return item.hospitalName
|
|
|
|
+ })
|
|
|
|
+ setHospitalNamesList(HospitalNamesList)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -130,7 +136,7 @@ function DictManager() {
|
|
addHospitalTreeVOs.depts.push(it.split('-')[1])
|
|
addHospitalTreeVOs.depts.push(it.split('-')[1])
|
|
} else {
|
|
} else {
|
|
addHospitalTreeVOs.hospitals.push(it)
|
|
addHospitalTreeVOs.hospitals.push(it)
|
|
- gethospitals(treeData, it)
|
|
|
|
|
|
+ gethospitals(HospitalNamesList, it)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
setAddHospitalTreeVO(addHospitalTreeVOs)
|
|
setAddHospitalTreeVO(addHospitalTreeVOs)
|
|
@@ -328,7 +334,8 @@ function DictManager() {
|
|
{ title: '参数名', dataIndex: 'name', key: 'index' },
|
|
{ title: '参数名', dataIndex: 'name', key: 'index' },
|
|
{ title: '参数值', dataIndex: 'val', key: 'index' },
|
|
{ title: '参数值', dataIndex: 'val', key: 'index' },
|
|
{ title: '参数说明', dataIndex: 'code', key: 'index' },
|
|
{ title: '参数说明', dataIndex: 'code', key: 'index' },
|
|
- {title: '参数描述', dataIndex: 'remark', key: 'status'},
|
|
|
|
|
|
+ {title: '参数描述', dataIndex: 'remark', key: 'index'},
|
|
|
|
+ {title: '状态', dataIndex: 'status', key: 'status'},
|
|
{
|
|
{
|
|
title: '操作', dataIndex: 'key', render: (text, record) => (
|
|
title: '操作', dataIndex: 'key', render: (text, record) => (
|
|
<Space size="middle">
|
|
<Space size="middle">
|
|
@@ -340,7 +347,8 @@ function DictManager() {
|
|
record.name,
|
|
record.name,
|
|
record.val,
|
|
record.val,
|
|
record.code,
|
|
record.code,
|
|
- record.remark
|
|
|
|
|
|
+ record.remark,
|
|
|
|
+ record.status,
|
|
)} >修改</a>
|
|
)} >修改</a>
|
|
<a className='delete' onClick={() => messageBox(1, record.id)}>删除</a>
|
|
<a className='delete' onClick={() => messageBox(1, record.id)}>删除</a>
|
|
</Space>
|
|
</Space>
|
|
@@ -360,21 +368,17 @@ function DictManager() {
|
|
>
|
|
>
|
|
<Row gutter={24}>
|
|
<Row gutter={24}>
|
|
<Col span={5} key={0}>
|
|
<Col span={5} key={0}>
|
|
- <Form.Item
|
|
|
|
- name="addHospitalTreeVO"
|
|
|
|
- label="所属组织"
|
|
|
|
- >
|
|
|
|
- <TreeSelect
|
|
|
|
- showSearch={false}
|
|
|
|
- treeData={treeData}
|
|
|
|
- onChange={onChange}
|
|
|
|
- maxTagCount={1}
|
|
|
|
- treeCheckable
|
|
|
|
- showCheckedStrategy={SHOW_PARENT}
|
|
|
|
- placeholder="请选择组织"
|
|
|
|
- style={{ width: '100%' }}
|
|
|
|
- />
|
|
|
|
- </Form.Item>
|
|
|
|
|
|
+ <Form.Item name="hospitalName" label="所属组织">
|
|
|
|
+ <Select
|
|
|
|
+ allowClear
|
|
|
|
+ >
|
|
|
|
+ {HospitalNamesList.map((item) => {
|
|
|
|
+ return (
|
|
|
|
+ <Option value={item} key={item}>{item}</Option>
|
|
|
|
+ )
|
|
|
|
+ })}
|
|
|
|
+ </Select>
|
|
|
|
+ </Form.Item>
|
|
</Col>
|
|
</Col>
|
|
<Col span={5} key={1}>
|
|
<Col span={5} key={1}>
|
|
<Form.Item label="参数名" name="name" getValueFromEvent={getValueFromEvent}>
|
|
<Form.Item label="参数名" name="name" getValueFromEvent={getValueFromEvent}>
|