Commit 00b32cee authored by 涂茜's avatar 涂茜

fix: bug

parent 954f1766
Pipeline #29083 failed with stages
in 15 seconds
...@@ -3,7 +3,8 @@ import PropTypes from 'prop-types'; ...@@ -3,7 +3,8 @@ import PropTypes from 'prop-types';
import classNames from 'classnames'; import classNames from 'classnames';
import Highcharts from 'highcharts/highstock'; import Highcharts from 'highcharts/highstock';
import HighchartsReact from 'highcharts-react-official'; import HighchartsReact from 'highcharts-react-official';
import { Tabs, Select, Radio, Checkbox, ConfigProvider, DatePicker } from 'antd'; import HighchartsBoost from 'highcharts/modules/boost';
import { Tabs, Select, Radio, Checkbox, ConfigProvider, DatePicker, Spin } from 'antd';
import { PlusCircleOutlined, CloseCircleFilled } from '@ant-design/icons'; import { PlusCircleOutlined, CloseCircleFilled } from '@ant-design/icons';
import TimeRangePicker from '@wisdom-components/timerangepicker'; import TimeRangePicker from '@wisdom-components/timerangepicker';
import BasicTable from '@wisdom-components/basictable'; import BasicTable from '@wisdom-components/basictable';
...@@ -11,6 +12,8 @@ import Empty from '@wisdom-components/empty'; ...@@ -11,6 +12,8 @@ import Empty from '@wisdom-components/empty';
import moment from 'moment'; import moment from 'moment';
import './index.less'; import './index.less';
HighchartsBoost(Highcharts);
const { TabPane } = Tabs; const { TabPane } = Tabs;
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
const { Option } = Select; const { Option } = Select;
...@@ -115,6 +118,9 @@ const DefaultOptions = (color, contrastOption) => ({ ...@@ -115,6 +118,9 @@ const DefaultOptions = (color, contrastOption) => ({
zoomType: 'x', zoomType: 'x',
backgroundColor: 'rgba(255, 255, 255, 0.5)', backgroundColor: 'rgba(255, 255, 255, 0.5)',
}, },
boost: {
useGPUTranslations: true,
},
colors: color, colors: color,
title: null, title: null,
credits: false, credits: false,
...@@ -202,6 +208,7 @@ const HistoryInfo = (props) => { ...@@ -202,6 +208,7 @@ const HistoryInfo = (props) => {
defaultChecked, defaultChecked,
} = props; } = props;
const [loading, setLoading] = useState(false);
const [activeTabKey, setActiveTabKey] = useState('curve'); const [activeTabKey, setActiveTabKey] = useState('curve');
const [timeValue, setTimeValue] = useState('customer'); const [timeValue, setTimeValue] = useState('customer');
const [contrastOption, setContrastOption] = useState('day'); const [contrastOption, setContrastOption] = useState('day');
...@@ -344,6 +351,7 @@ const HistoryInfo = (props) => { ...@@ -344,6 +351,7 @@ const HistoryInfo = (props) => {
}; };
requestArr.push(historyInfoService(param)); requestArr.push(historyInfoService(param));
}); });
setLoading(true);
Promise.all(requestArr).then((values) => { Promise.all(requestArr).then((values) => {
if (values.length) { if (values.length) {
let data = []; let data = [];
...@@ -352,6 +360,7 @@ const HistoryInfo = (props) => { ...@@ -352,6 +360,7 @@ const HistoryInfo = (props) => {
data = data.concat(res.data); data = data.concat(res.data);
} }
}); });
setLoading(false);
handleTableData(data); handleTableData(data);
handleSeries(data); handleSeries(data);
} }
...@@ -770,34 +779,36 @@ const HistoryInfo = (props) => { ...@@ -770,34 +779,36 @@ const HistoryInfo = (props) => {
<div className={classNames(`${prefixCls}-content`)}> <div className={classNames(`${prefixCls}-content`)}>
{renderOptions(item)} {renderOptions(item)}
{!tableData.length && <Empty />} {!tableData.length && <Empty />}
{!!tableData.length && ( <Spin spinning={loading}>
<div className={classNames(`${prefixCls}-wrap`)}> {!!tableData.length && (
<div className={classNames(`${prefixCls}-main`)}> <div className={classNames(`${prefixCls}-wrap`)}>
{item.key === 'curve' && ( <div className={classNames(`${prefixCls}-main`)}>
<div className={classNames(`${prefixCls}-chart`)} ref={container}> {item.key === 'curve' && (
<HighchartsReact <div className={classNames(`${prefixCls}-chart`)} ref={container}>
immutable={true} <HighchartsReact
highcharts={Highcharts} immutable={true}
constructorType={'stockChart'} highcharts={Highcharts}
options={options} constructorType={'stockChart'}
allowChartUpdate={true} options={options}
allowChartUpdate={true}
/>
</div>
)}
{item.key === 'table' && (
<BasicTable
dataSource={tableData}
columns={columns}
{...tableProps}
pagination={{ pageSize, showQuickJumper: true, showSizeChanger: true }}
onChange={(value) => {
setPageSize(value.pageSize);
}}
/> />
</div> )}
)} </div>
{item.key === 'table' && (
<BasicTable
dataSource={tableData}
columns={columns}
{...tableProps}
pagination={{ pageSize, showQuickJumper: true, showSizeChanger: true }}
onChange={(value) => {
setPageSize(value.pageSize);
}}
/>
)}
</div> </div>
</div> )}
)} </Spin>
</div> </div>
</TabPane> </TabPane>
))} ))}
......
...@@ -14,9 +14,20 @@ ...@@ -14,9 +14,20 @@
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
padding: 10px 0 0 0; padding: 10px 0 0 0;
.ant-spin-nested-loading {
display: flex;
flex: 1;
}
.ant-spin-container {
display: flex;
flex: 1;
}
} }
&-wrap { &-wrap {
display: flex;
flex: 1; flex: 1;
overflow: hidden; overflow: hidden;
} }
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
.@{ec-quota-select-prefix-cls} { .@{ec-quota-select-prefix-cls} {
&-btn-wrap { &-btn-wrap {
overflow: auto; overflow: auto;
white-space: nowrap;
button { button {
margin-right: 20px; margin-right: 20px;
margin-bottom: 10px;
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment