Kaynağa Gözat

问题修改

1178232204@qq.com 3 yıl önce
ebeveyn
işleme
c69121a29f

+ 25 - 26
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,Spin } 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';
@@ -50,24 +50,24 @@ function BlockLossManage() {
         return state.userInfo;
     });
     useEffect(() => {
+        setCurrent(1)
+        setParams(data)
         form.resetFields();
-        getBlockLossPage();
+        getBlockLossPage(data);
         blockLossTypeGather(date)
     }, [lossNum]);
     //表格数据
     function getBlockLossPage(param) {
-        setLoading(true)
+        const hide = message.loading('加载中...', 0);
         post(api.getBlockLossPage, param || params).then((res) => {
+            hide()
             if (res.data.code === 200) {
                 const data = res.data.data;
-                setLoading(false)
                 setBlockList(data.records);
                 setTotal(data.total)
-            }else {
-                setLoading(false)
-            }
+            } 
         }).catch((err) => {
-            setLoading(false)
+            hide()
         })
     }
     //丢失量分类汇总
@@ -374,24 +374,23 @@ function BlockLossManage() {
                         </Col>
                     </Row>
                 </div>
-                <Spin tip="加载中..." spinning={loading}>
-                    <Table
-                        columns={columns}
-                        scroll={{ y: 'calc(100vh - 520px)' }}
-                        dataSource={blockList}
-                        rowKey={record => record.id}
-                        pagination={{
-                            pageSize: size,
-                            size: 'small',
-                            current: current,
-                            showSizeChanger: true,
-                            pageSizeOptions: ['15', '30', '60', '120'],
-                            showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条数据`,
-                            onShowSizeChange: (current, pageSize) => onSizeChange(current, pageSize), // 改变每页数量时更新显示
-                            onChange: (page, pageSize) => changePage(page, pageSize),//点击页码事件
-                            total: total
-                        }} />
-                </Spin>
+                <Table
+                    columns={columns}
+                    scroll={{ y: 'calc(100vh - 520px)' }}
+                    dataSource={blockList}
+                    rowKey={record => record.id}
+                    pagination={{
+                        pageSize: size,
+                        size: 'small',
+                        current: current,
+                        showSizeChanger: true,
+                        pageSizeOptions: ['15', '30', '60', '120'],
+                        showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条数据`,
+                        onShowSizeChange: (current, pageSize) => onSizeChange(current, pageSize), // 改变每页数量时更新显示
+                        onChange: (page, pageSize) => changePage(page, pageSize),//点击页码事件
+                        total: total
+                    }} />
+
             </div>
             {visible && blockDetail ?
                 <Modal

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

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

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

@@ -51,25 +51,26 @@ function FieldProblem() {
         return state.userInfo;
     });
     useEffect(() => {
+        setCurrent(1)
+        setParams(data)
         form.resetFields();
-        getColumnResultPage();
+        getColumnResultPage(data);
         getColumnResultNumber(date)
         getModeName()
     }, [problemNum]);
     //表格数据
     function getColumnResultPage(param) {
-        setLoading(true)
+        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)
-            } else {
-                setLoading(false)
             }
         }).catch((err) => {
-            setLoading(false)
+            hide()
         })
     }
     function getColumnResultNumber(param) {
@@ -359,24 +360,23 @@ function FieldProblem() {
                         </Col>
                     </Row>
                 </div>
-                <Spin tip="加载中..." spinning={loading}>
-                    <Table
-                        columns={columns}
-                        scroll={{ y: 'calc(100vh - 570px)' }}
-                        dataSource={logList}
-                        rowKey={record => record.id}
-                        pagination={{
-                            pageSize: size,
-                            size: 'small',
-                            current: current,
-                            showSizeChanger: true,
-                            pageSizeOptions: ['15', '30', '60', '120'],
-                            showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条数据`,
-                            onShowSizeChange: (current, pageSize) => onSizeChange(current, pageSize), // 改变每页数量时更新显示
-                            onChange: (page, pageSize) => changePage(page, pageSize),//点击页码事件
-                            total: total
-                        }} />
-                </Spin>
+                <Table
+                    columns={columns}
+                    scroll={{ y: 'calc(100vh - 570px)' }}
+                    dataSource={logList}
+                    rowKey={record => record.id}
+                    pagination={{
+                        pageSize: size,
+                        size: 'small',
+                        current: current,
+                        showSizeChanger: true,
+                        pageSizeOptions: ['15', '30', '60', '120'],
+                        showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条数据`,
+                        onShowSizeChange: (current, pageSize) => onSizeChange(current, pageSize), // 改变每页数量时更新显示
+                        onChange: (page, pageSize) => changePage(page, pageSize),//点击页码事件
+                        total: total
+                    }} />
+
             </div>
 
             {visible && problemDetail ?

+ 26 - 26
src/components/FieldRules/index.js

@@ -44,26 +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) {
-        setLoading(true)
+        const hide = message.loading('加载中...', 0);
         post(api.getColumnVerifyPage, param || params).then((res) => {
+            hide()
             if (res.data.code === 200) {
                 const data = res.data.data;
-                setLoading(false)
                 setLogList(data.records);
                 setTotal(data.total)
-            } else {
-                setLoading(false)
             }
         }).catch((err) => {
-            setLoading(false)
+            hide()
         })
     }
     //获取正则式名称
@@ -332,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 },
@@ -477,25 +478,24 @@ function FieldRules() {
                     </Space>
 
                 </div>
-                <Spin tip="加载中..." spinning={loading}>
-                    <Table
-                        columns={columns}
-                        rowSelection={rowSelection}
-                        scroll={{ y: 'calc(100vh - 430px)' }}
-                        dataSource={logList}
-                        rowKey={record => record.columnId}
-                        pagination={{
-                            pageSize: size,
-                            size: 'small',
-                            current: current,
-                            showSizeChanger: true,
-                            pageSizeOptions: ['15', '30', '60', '120'],
-                            showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条数据`,
-                            onShowSizeChange: (current, pageSize) => onSizeChange(current, pageSize), // 改变每页数量时更新显示
-                            onChange: (page, pageSize) => changePage(page, pageSize),//点击页码事件
-                            total: total
-                        }} />
-                </Spin>
+                <Table
+                    columns={columns}
+                    rowSelection={rowSelection}
+                    scroll={{ y: 'calc(100vh - 430px)' }}
+                    dataSource={logList}
+                    rowKey={record => record.columnId}
+                    pagination={{
+                        pageSize: size,
+                        size: 'small',
+                        current: current,
+                        showSizeChanger: true,
+                        pageSizeOptions: ['15', '30', '60', '120'],
+                        showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条数据`,
+                        onShowSizeChange: (current, pageSize) => onSizeChange(current, pageSize), // 改变每页数量时更新显示
+                        onChange: (page, pageSize) => changePage(page, pageSize),//点击页码事件
+                        total: total
+                    }} />
+
             </div>
             <Modal
                 title="删除字段校验规则"

+ 24 - 24
src/components/RegularManage/index.js

@@ -41,23 +41,25 @@ function RegularManage() {
         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;
-                setLoading(false)
                 setRegularList(data.records);
                 setTotal(data.total)
-            } else {
-                setLoading(false)
             }
         }).catch((err) => {
-            setLoading(false)
+            hide()
         })
     }
     //判断正则是否关联
@@ -239,25 +241,23 @@ function RegularManage() {
                     </Space>
 
                 </div>
-                <Spin tip="加载中..." spinning={loading}>
-                    <Table
-                        columns={columns}
-                        rowSelection={rowSelection}
-                        scroll={{ y: 'calc(100vh - 380px)' }}
-                        dataSource={regularList}
-                        rowKey={record => record.id + '-' + record.relation}
-                        pagination={{
-                            pageSize: size,
-                            size: 'small',
-                            current: current,
-                            showSizeChanger: true,
-                            pageSizeOptions: ['15', '30', '60', '120'],
-                            showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条数据`,
-                            onShowSizeChange: (current, pageSize) => onSizeChange(current, pageSize), // 改变每页数量时更新显示
-                            onChange: (page, pageSize) => changePage(page, pageSize),//点击页码事件
-                            total: total
-                        }} />
-                </Spin>
+                <Table
+                    columns={columns}
+                    rowSelection={rowSelection}
+                    scroll={{ y: 'calc(100vh - 380px)' }}
+                    dataSource={regularList}
+                    rowKey={record => record.id + '-' + record.relation}
+                    pagination={{
+                        pageSize: size,
+                        size: 'small',
+                        current: current,
+                        showSizeChanger: true,
+                        pageSizeOptions: ['15', '30', '60', '120'],
+                        showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条数据`,
+                        onShowSizeChange: (current, pageSize) => onSizeChange(current, pageSize), // 改变每页数量时更新显示
+                        onChange: (page, pageSize) => changePage(page, pageSize),//点击页码事件
+                        total: total
+                    }} />
             </div>
 
             {visible && regularDetail ?