|
@@ -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
|