|
@@ -1,4 +1,4 @@
|
|
|
-import {useEffect} from 'react';
|
|
|
+import {useEffect,useState} from 'react';
|
|
|
import { useDispatch,useSelector } from 'react-redux'
|
|
|
import { Table, Badge, Menu, Dropdown, Space, Form, Input, Button, Row, Col, Select } from 'antd';
|
|
|
import { DownOutlined } from '@ant-design/icons';
|
|
@@ -10,110 +10,60 @@ const { Option } = Select;
|
|
|
function OrgManager(){
|
|
|
useEffect(() => {
|
|
|
getTableData();
|
|
|
- });
|
|
|
+ },[]);
|
|
|
+
|
|
|
+ const [dataSource, setDataSource] = useState([]);
|
|
|
+ const [filterData, setFilterData] = useState({});
|
|
|
+
|
|
|
function getTableData(){
|
|
|
- post(api.getHospitalListInfo).then((res)=>{
|
|
|
- console.log(res)
|
|
|
+ const param = filterData;
|
|
|
+ post(api.getHospitalListInfo,{}).then((res)=>{
|
|
|
+ if(res.data.code===200){
|
|
|
+ const data = res.data.data;
|
|
|
+ setDataSource(data[0].hospitalDTOS);
|
|
|
+ }
|
|
|
+
|
|
|
})
|
|
|
}
|
|
|
- const menu = (
|
|
|
- <Menu>
|
|
|
- <Menu.Item>Action 1</Menu.Item>
|
|
|
- <Menu.Item>Action 2</Menu.Item>
|
|
|
- </Menu>
|
|
|
- );
|
|
|
+ function RenderTable(){
|
|
|
+ const menu = (
|
|
|
+ <Menu>
|
|
|
+ <Menu.Item key="0">重置密码</Menu.Item>
|
|
|
+ <Menu.Item key="1">禁用</Menu.Item>
|
|
|
+ <Menu.Item key="3">删除</Menu.Item>
|
|
|
+ </Menu>
|
|
|
+ );
|
|
|
|
|
|
- const expandedRowRender = () => {
|
|
|
const columns = [
|
|
|
- { title: 'Date', dataIndex: 'date', key: 'date' },
|
|
|
- { title: 'Name', dataIndex: 'name', key: 'name' },
|
|
|
- {
|
|
|
- title: 'Status',
|
|
|
- key: 'state',
|
|
|
- render: () => (
|
|
|
- <span>
|
|
|
- <Badge status="success" />
|
|
|
- Finished
|
|
|
- </span>
|
|
|
- ),
|
|
|
- },
|
|
|
- { title: 'Upgrade Status', dataIndex: 'upgradeNum', key: 'upgradeNum' },
|
|
|
- {
|
|
|
- title: 'Action',
|
|
|
- dataIndex: 'operation',
|
|
|
- key: 'operation',
|
|
|
- render: () => (
|
|
|
- <Space size="middle">
|
|
|
- <a>Pause</a>
|
|
|
- <a>Stop</a>
|
|
|
- <Dropdown overlay={menu}>
|
|
|
- <a>
|
|
|
- More <DownOutlined />
|
|
|
- </a>
|
|
|
- </Dropdown>
|
|
|
- </Space>
|
|
|
- ),
|
|
|
- },
|
|
|
+ { title: '组织机构层级', dataIndex: 'hospitalName', key: 'hospitalName' },
|
|
|
+ { title: '类型', dataIndex: 'type', key: 'type' },
|
|
|
+ { title: '状态', dataIndex: 'status', key: 'status' },
|
|
|
+ { title: '创建时间', dataIndex: 'gmtCreate', key: 'gmtCreate' },
|
|
|
+ { title: '操作', key: 'operation', render: () => (<Space size="middle">
|
|
|
+ <a>修改</a>
|
|
|
+ <a>启用</a>
|
|
|
+ <Dropdown overlay={menu} trigger={['click']}>
|
|
|
+ <a className="ant-dropdown-link">
|
|
|
+ 更多 <DownOutlined />
|
|
|
+ </a>
|
|
|
+ </Dropdown>
|
|
|
+ </Space>) },
|
|
|
];
|
|
|
-
|
|
|
- const data = [];
|
|
|
- for (let i = 0; i < 3; ++i) {
|
|
|
- data.push({
|
|
|
- key: i,
|
|
|
- date: '2014-12-24 23:12:00',
|
|
|
- name: 'This is production name',
|
|
|
- upgradeNum: 'Upgraded: 56',
|
|
|
- });
|
|
|
- }
|
|
|
- return <Table columns={columns} dataSource={data} pagination={false} />;
|
|
|
- };
|
|
|
- const moreOper = (
|
|
|
- <Menu>
|
|
|
- <Menu.Item key="0">重置密码</Menu.Item>
|
|
|
- <Menu.Item key="1">禁用</Menu.Item>
|
|
|
- <Menu.Item key="3">删除</Menu.Item>
|
|
|
- </Menu>
|
|
|
- );
|
|
|
- const columns = [
|
|
|
- { title: '组织机构层级', dataIndex: 'name', key: 'name' },
|
|
|
- { title: '类型', dataIndex: 'platform', key: 'platform' },
|
|
|
- { title: '状态', dataIndex: 'version', key: 'version' },
|
|
|
- { title: '创建时间', dataIndex: 'upgradeNum', key: 'upgradeNum' },
|
|
|
- { title: '操作', key: 'operation', render: () => (<Space size="middle">
|
|
|
- <a>修改</a>
|
|
|
- <a>启用</a>
|
|
|
- <Dropdown overlay={moreOper} trigger={['click']}>
|
|
|
- <a className="ant-dropdown-link">
|
|
|
- 更多 <DownOutlined />
|
|
|
-
|
|
|
- </a>
|
|
|
- </Dropdown>
|
|
|
- </Space>) },
|
|
|
- ];
|
|
|
-
|
|
|
- const data = [];
|
|
|
- for (let i = 0; i < 3; ++i) {
|
|
|
- data.push({
|
|
|
- key: i,
|
|
|
- name: 'Screem',
|
|
|
- platform: 'iOS',
|
|
|
- version: '10.3.4.5654',
|
|
|
- upgradeNum: 500,
|
|
|
- creator: 'Jack',
|
|
|
- createdAt: '2014-12-24 23:12:00',
|
|
|
- });
|
|
|
+ return (
|
|
|
+ <Table
|
|
|
+ className="components-table-demo-nested"
|
|
|
+ rowKey={record => record.hospitalId}
|
|
|
+ columns={columns}
|
|
|
+ dataSource={dataSource}
|
|
|
+ />
|
|
|
+ )
|
|
|
}
|
|
|
- const layout = {
|
|
|
- labelCol: { span: 8 },
|
|
|
- wrapperCol: { span: 16 },
|
|
|
- };
|
|
|
- const tailLayout = {
|
|
|
- wrapperCol: { offset: 8, span: 16 },
|
|
|
- };
|
|
|
+
|
|
|
const [form] = Form.useForm();
|
|
|
|
|
|
const onFinish = (values: any) => {
|
|
|
- console.log(values);
|
|
|
+ setFilterData(values);
|
|
|
+ console.log('筛选项:',values);
|
|
|
};
|
|
|
|
|
|
const onReset = () => {
|
|
@@ -123,37 +73,37 @@ function OrgManager(){
|
|
|
return (
|
|
|
<div className='container'>
|
|
|
<div className="filter-box">
|
|
|
- <Form {...layout} form={form} name="control-hooks" onFinish={onFinish}>
|
|
|
+ <Form form={form} name="control-hooks" onFinish={onFinish}>
|
|
|
<Row gutter={24}>
|
|
|
<Col span={5} key={0}>
|
|
|
- <Form.Item name="组织名称" label="组织名称">
|
|
|
+ <Form.Item name="hospitalName" label="组织名称">
|
|
|
<Input placeholder='组织名称'/>
|
|
|
</Form.Item>
|
|
|
</Col>
|
|
|
<Col span={5} key={1}>
|
|
|
- <Form.Item name="类型" label="类型">
|
|
|
+ <Form.Item name="type" label="类型">
|
|
|
<Select
|
|
|
allowClear
|
|
|
>
|
|
|
- <Option value="male">全部</Option>
|
|
|
+ <Option value="">全部</Option>
|
|
|
<Option value="female">集团医院</Option>
|
|
|
<Option value="other">医共体</Option>
|
|
|
</Select>
|
|
|
</Form.Item>
|
|
|
</Col>
|
|
|
<Col span={5} key={2}>
|
|
|
- <Form.Item name="当前状态" label="当前状态">
|
|
|
+ <Form.Item name="status" label="当前状态">
|
|
|
<Select
|
|
|
allowClear
|
|
|
>
|
|
|
- <Option value="male">全部</Option>
|
|
|
- <Option value="female">启用</Option>
|
|
|
- <Option value="other">禁用</Option>
|
|
|
+ <Option value="">全部</Option>
|
|
|
+ <Option value="1">启用</Option>
|
|
|
+ <Option value="0">禁用</Option>
|
|
|
</Select>
|
|
|
</Form.Item>
|
|
|
</Col>
|
|
|
<Col span={9} key={3}>
|
|
|
- <Form.Item {...tailLayout}>
|
|
|
+ <Form.Item>
|
|
|
<Button type="primary" htmlType="submit">
|
|
|
查询
|
|
|
</Button>
|
|
@@ -165,12 +115,7 @@ function OrgManager(){
|
|
|
</Row>
|
|
|
</Form>
|
|
|
</div>
|
|
|
- <Table
|
|
|
- className="components-table-demo-nested"
|
|
|
- columns={columns}
|
|
|
- expandable={{ expandedRowRender }}
|
|
|
- dataSource={data}
|
|
|
- />
|
|
|
+ <RenderTable />
|
|
|
</div>
|
|
|
)
|
|
|
}
|