Browse Source

Merge branch 'dev' of http://192.168.2.236:10080/zhouna/ai-admin into dev

mfmf 3 years ago
parent
commit
43f1ebf48c

+ 14 - 6
src/components/BlockLossManage/index.js

@@ -1,6 +1,6 @@
 import React, { useState, useEffect, useRef } from 'react';
 import { useSelector, useDispatch } from 'react-redux';
-import { Form, Input, Button, Table, Row, Col, Select, Modal, DatePicker, Space, message } from 'antd';
+import { Form, Input, Button, Table, Row, Col, Select, Modal, DatePicker, Space, message, Spin } from 'antd';
 import moment from "moment";
 import "moment/locale/zh-cn"
 import '@common/common.less';
@@ -12,12 +12,13 @@ import { getValueFromEvent, disabledDate, getDaysBetween } from '@utils/index'
 const { post, api, xPost } = apiObj;
 const { Option } = Select;
 function BlockLossManage() {
-    
+
     const [blockList, setBlockList] = useState([]);
     const [total, setTotal] = useState(0);
     const [title, setTitle] = useState(0);
     const [visible, setVisible] = useState(false);
     const [size, setSize] = useState(15);
+    const [loading, setLoading] = useState(false);
     const [current, setCurrent] = useState(1);
     const [type, setType] = useState(null);
     const [blockData, setBlockData] = useState({});
@@ -46,21 +47,27 @@ function BlockLossManage() {
         endDate: getCurrentData().split('/').join('-') + ' 23:59:59'
     }
     const { lossNum } = useSelector((state) => {
-		return state.userInfo;
-	});
+        return state.userInfo;
+    });
     useEffect(() => {
+        setCurrent(1)
+        setParams(data)
         form.resetFields();
-        getBlockLossPage();
+        getBlockLossPage(data);
         blockLossTypeGather(date)
     }, [lossNum]);
     //表格数据
     function getBlockLossPage(param) {
+        const hide = message.loading('加载中...', 0);
         post(api.getBlockLossPage, param || params).then((res) => {
+            hide()
             if (res.data.code === 200) {
                 const data = res.data.data;
                 setBlockList(data.records);
                 setTotal(data.total)
-            }
+            } 
+        }).catch((err) => {
+            hide()
         })
     }
     //丢失量分类汇总
@@ -383,6 +390,7 @@ function BlockLossManage() {
                         onChange: (page, pageSize) => changePage(page, pageSize),//点击页码事件
                         total: total
                     }} />
+
             </div>
             {visible && blockDetail ?
                 <Modal

+ 1 - 0
src/components/DiagManager/index.js

@@ -72,6 +72,7 @@ function DiagManager() {
 		setloading(false)
       }
     })
+     
   }
   function showDelModal(id){
 	setDelvisible(true);

+ 23 - 16
src/components/FieldProblem/index.js

@@ -1,6 +1,6 @@
 import React, { useState, useEffect, useRef } from 'react';
 import { useSelector, useDispatch } from 'react-redux';
-import { Form, Input, Button, Table, Row, Col, Select, Modal, DatePicker, Space, message } from 'antd';
+import { Form, Input, Button, Table, Row, Col, Select, Modal, DatePicker, Space, message, Spin } from 'antd';
 import '@common/common.less';
 import moment from "moment";
 import "moment/locale/zh-cn"
@@ -12,13 +12,14 @@ import { getValueFromEvent, disabledDate, getDaysBetween } from '@utils/index'
 const { post, api, xPost } = apiObj;
 const { Option } = Select;
 function FieldProblem() {
-    
+
     const [logList, setLogList] = useState([]);
     const [total, setTotal] = useState(0);
     const [type, setType] = useState(0);//1新增 2修改
     const [visible, setVisible] = useState(false);
     const [size, setSize] = useState(15);
     const [current, setCurrent] = useState(1);
+    const [loading, setLoading] = useState(false);
     const [probleData, setProbleData] = useState({});
     const [problemDetail, setProblemDetail] = useState(null);//详情数据
     const [title, setTitle] = useState();//正则式数据
@@ -47,22 +48,29 @@ function FieldProblem() {
         behospitalEndDate: getCurrentData().split('/').join('-') + ' 23:59:59'
     }
     const { problemNum } = useSelector((state) => {
-		return state.userInfo;
-	});
+        return state.userInfo;
+    });
     useEffect(() => {
+        setCurrent(1)
+        setParams(data)
         form.resetFields();
-        getColumnResultPage();
+        getColumnResultPage(data);
         getColumnResultNumber(date)
         getModeName()
     }, [problemNum]);
     //表格数据
     function getColumnResultPage(param) {
+        const hide = message.loading('加载中...', 0);
         post(api.getColumnResultPage, param || params).then((res) => {
+            hide()
             if (res.data.code === 200) {
                 const data = res.data.data;
                 setLogList(data.records);
                 setTotal(data.total)
+                setLoading(false)
             }
+        }).catch((err) => {
+            hide()
         })
     }
     function getColumnResultNumber(param) {
@@ -258,17 +266,15 @@ function FieldProblem() {
                                 <Input placeholder="请输入" autoComplete='off' allowClear maxLength='30' />
                             </Form.Item>
                         </Col>
-                        <Col span={5} key={4}>
-                            <Form.Item label="质控模块名称" name="modeName" >
-                                <Select showSearch allowClear onSearch={onSearch} placeholder="请选择">
-                                    {modeList.map((item, i) => {
-                                        return (
-                                            <Option value={item} key={i}>{item}</Option>
-                                        )
-                                    })}
-                                </Select>
-                            </Form.Item>
-                        </Col>
+                        <Form.Item label="质控模块名称" name="modeName" >
+                            <Select showSearch allowClear onSearch={onSearch} placeholder="请选择" style={{ width: '159px' }}>
+                                {modeList.map((item, i) => {
+                                    return (
+                                        <Option value={item} key={i}>{item}</Option>
+                                    )
+                                })}
+                            </Select>
+                        </Form.Item>
                         <Col span={4} key={5}>
                             <Form.Item label="问题类型" name="type">
                                 <Select
@@ -370,6 +376,7 @@ function FieldProblem() {
                         onChange: (page, pageSize) => changePage(page, pageSize),//点击页码事件
                         total: total
                     }} />
+
             </div>
 
             {visible && problemDetail ?

+ 18 - 6
src/components/FieldRules/index.js

@@ -1,6 +1,6 @@
 import React, { useState, useEffect, useRef } from 'react';
 import { useSelector, useDispatch } from 'react-redux';
-import { Form, Input, Button, Table, Row, Col, Select, Modal, DatePicker, Space, message } from 'antd';
+import { Form, Input, Button, Table, Row, Col, Select, Modal, Spin, Space, message } from 'antd';
 import { PlusOutlined } from '@ant-design/icons';
 import '@common/common.less';
 import apiObj from '@api/index';
@@ -18,6 +18,7 @@ function FieldRules() {
     const [visible, setVisible] = useState(false);
     const [size, setSize] = useState(15);
     const [current, setCurrent] = useState(1);
+    const [loading, setLoading] = useState(false);
     const [regularList, setRegularList] = useState([]);//正则式数据
     const [selectedRowKeys, setSelectedRowKeys] = useState([]);
     const [tableList, setTableList] = useState([]);//表名称
@@ -43,20 +44,28 @@ function FieldRules() {
         return state.userInfo;
     });
     useEffect(() => {
+        setCurrent(1)
+        setParams(data)
         form.resetFields();
         getRegular()
         getTableName()
         getColumnName('', '', '', '')
-        getColumnVerifyPage();
+        getColumnVerifyPage(data);
+        setSelectedRowKeys([])
+        setDisable(true)
     }, [rulerNum]);
     //表格数据
     function getColumnVerifyPage(param) {
+        const hide = message.loading('加载中...', 0);
         post(api.getColumnVerifyPage, param || params).then((res) => {
+            hide()
             if (res.data.code === 200) {
                 const data = res.data.data;
                 setLogList(data.records);
                 setTotal(data.total)
             }
+        }).catch((err) => {
+            hide()
         })
     }
     //获取正则式名称
@@ -233,7 +242,9 @@ function FieldRules() {
         getColumnName('', '', value, '')
         if (value) {
             form.setFieldsValue({
-                tableEname: option.val
+                tableEname: option.val,
+                columnCname: undefined,
+                columnEname: undefined,
             });
             setDisable(false)
         } else {
@@ -252,7 +263,9 @@ function FieldRules() {
         getColumnName('', '', '', value)
         if (value) {
             form.setFieldsValue({
-                tableCname: option.val
+                tableCname: option.val,
+                columnCname: undefined,
+                columnEname: undefined,
             });
             setDisable(false)
         } else {
@@ -321,7 +334,6 @@ function FieldRules() {
         getColumnVerifyPage(data);
         setSelectedRowKeys([])
         setDisable(true)
-
     };
     const columns = [
         { title: '序号', dataIndex: 'index', render: (text, record, index) => (current - 1) * params.size + index + 1, width: 60 },
@@ -466,7 +478,6 @@ function FieldRules() {
                     </Space>
 
                 </div>
-
                 <Table
                     columns={columns}
                     rowSelection={rowSelection}
@@ -484,6 +495,7 @@ function FieldRules() {
                         onChange: (page, pageSize) => changePage(page, pageSize),//点击页码事件
                         total: total
                     }} />
+
             </div>
             <Modal
                 title="删除字段校验规则"

+ 14 - 6
src/components/RegularManage/index.js

@@ -1,6 +1,6 @@
 import React, { useState, useEffect, useRef } from 'react';
 import { useSelector } from 'react-redux';
-import { Form, Input, Button, Table, Row, Col, Select, Modal, DatePicker, Space } from 'antd';
+import { Form, Input, Button, Table, Row, Col, Spin, Modal, Space } from 'antd';
 import { PlusOutlined } from '@ant-design/icons';
 import { getValueFromEvent } from '@utils/index'
 import '@common/common.less';
@@ -10,12 +10,13 @@ import RegularContext from './regular-context';
 import { message } from "antd/lib/index";
 const { post, api, xPost } = apiObj;
 function RegularManage() {
-    
+
     const [regularList, setRegularList] = useState([]);
     const [total, setTotal] = useState(0);
     const [title, setTitle] = useState();
     const [tip, setTip] = useState();
     const [flag, setFlag] = useState(0);
+    const [loading, setLoading] = useState(false);
     const [type, setType] = useState(0);//1新增 2修改
     const [visible, setVisible] = useState(false);
     const [delvisible, setDelVisible] = useState(false);
@@ -37,20 +38,28 @@ function RegularManage() {
         desc: ['dri.gmt_create']
     }
     const { regularNum } = useSelector((state) => {
-		return state.userInfo;
-	});
+        return state.userInfo;
+    });
     useEffect(() => {
+        setCurrent(1)
+        setParams(data)
         form.resetFields();
-        getRegularPage();
+        setSelectedRowKeys([])
+        getRegularPage(data);
     }, [regularNum]);
     //表格数据
     function getRegularPage(param) {
+        setLoading(true)
+        const hide = message.loading('加载中...', 0);
         post(api.getRegularPage, param || params).then((res) => {
+            hide()
             if (res.data.code === 200) {
                 const data = res.data.data;
                 setRegularList(data.records);
                 setTotal(data.total)
             }
+        }).catch((err) => {
+            hide()
         })
     }
     //判断正则是否关联
@@ -232,7 +241,6 @@ function RegularManage() {
                     </Space>
 
                 </div>
-
                 <Table
                     columns={columns}
                     rowSelection={rowSelection}