|
@@ -1,5 +1,5 @@
|
|
|
import React, { useState, useEffect } from 'react';
|
|
|
-import { Form, Input, Button, Table, Select, Space, Modal, message, Row, Col } from 'antd';
|
|
|
+import { Spin,Form, Input, Button, Table, Select, Space, Modal, message, Row, Col } from 'antd';
|
|
|
import { PlusOutlined } from '@ant-design/icons';
|
|
|
import AddDiag from './addDiag'
|
|
|
import { getCookie } from '@utils/index'
|
|
@@ -19,6 +19,7 @@ function DiagManager() {
|
|
|
const [visible, setVisible] = useState(false);//新增修改 弹窗
|
|
|
const [flag, setFlag] = useState(false);//新增1或修改3
|
|
|
const [delvisible, setDelvisible] = useState(false);//删除 弹窗
|
|
|
+ const [loading, setloading] = useState(true);//是否显示加载中
|
|
|
const [formData, setFormData] = useState({});//当前行数据
|
|
|
const [size, setSize] = useState(15);//每页显示条数
|
|
|
const [total, setTotal] = useState(0);
|
|
@@ -52,11 +53,13 @@ function DiagManager() {
|
|
|
//表格数据
|
|
|
function getDiseasePage(param) { //type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作
|
|
|
const hospitalId = getCookie('hospitalId')
|
|
|
+ setloading(true)
|
|
|
post(api.getTermPage, {...(param || params),type:4,hospitalId:hospitalId}).then((res) => {
|
|
|
if (res.data.code === 200) {
|
|
|
const data = res.data.data;
|
|
|
setDiagList(data.records);
|
|
|
setTotal(data.total)
|
|
|
+ setloading(false)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -140,7 +143,6 @@ function DiagManager() {
|
|
|
message.warning(error.message || "接口出错,请重试",);
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
const columns = [
|
|
|
{ title: '序号', dataIndex: 'index', render: (text, record, index) => (current - 1) * params.size + index + 1 },
|
|
|
{ title: '操作时间', dataIndex: 'gmtModified', },
|
|
@@ -148,7 +150,7 @@ function DiagManager() {
|
|
|
{ title: 'ICD-10编码', dataIndex: 'code', },
|
|
|
{ title: '标准诊断名称', dataIndex: 'uniqueName', },
|
|
|
{ title: '标准术语状态', dataIndex: 'status',render: (text, record) => {
|
|
|
- return record.status===1?'启用':'禁用';
|
|
|
+ return record.status===1?'启用':record.status?'禁用':'';
|
|
|
}},
|
|
|
{ title: '是否匹配', dataIndex: 'isMatch',render: (text, record) => {
|
|
|
return record.isMatch===1?'已匹配':'未匹配';
|
|
@@ -237,7 +239,7 @@ function DiagManager() {
|
|
|
</Col>
|
|
|
</Row>
|
|
|
</div>
|
|
|
-
|
|
|
+ <Spin tip="加载中..." spinning={loading}>
|
|
|
<Table
|
|
|
/*rowSelection={{ type: 'checkbox', ...rowSelection, }}*/
|
|
|
columns={columns}
|
|
@@ -255,6 +257,7 @@ function DiagManager() {
|
|
|
onChange: (page, pageSize) => changePage(page, pageSize),//点击页码事件
|
|
|
total: total
|
|
|
}} />
|
|
|
+ </Spin>
|
|
|
</div>
|
|
|
{/*<DiagContext.Provider value={{ formData }}>*/}
|
|
|
<AddDiag formData={formData} termSType={100} termType={4} onOk={saveMatching} title={title} visible={visible} cancel={cancel} flag={flag}/>
|