Commit 307217a9 authored by 陈龙's avatar 陈龙

feat: 修改loading时期

parent 9d4d7d52
...@@ -1131,6 +1131,7 @@ const HistoryView = (props) => { ...@@ -1131,6 +1131,7 @@ const HistoryView = (props) => {
const getDefaultOptions = async () => { const getDefaultOptions = async () => {
// 非单曲线、单指标不执行 // 非单曲线、单指标不执行
if (deviceParams?.length !== 1 || (deviceParams?.length === 1 && deviceParams?.[0]?.sensors?.split(',')?.length > 1)) return setCompleteInit(true); if (deviceParams?.length !== 1 || (deviceParams?.length === 1 && deviceParams?.[0]?.sensors?.split(',')?.length > 1)) return setCompleteInit(true);
setLoading(true);
await getDictionaryInfoAll({ await getDictionaryInfoAll({
level: '组件_ec_historyview' level: '组件_ec_historyview'
}).then(res => { }).then(res => {
...@@ -1148,6 +1149,8 @@ const HistoryView = (props) => { ...@@ -1148,6 +1149,8 @@ const HistoryView = (props) => {
}); });
setCheckboxData(_checkboxData); setCheckboxData(_checkboxData);
} }
}).catch(err=>{
setLoading(false);
}) })
setCompleteInit(true); setCompleteInit(true);
}; };
...@@ -1176,13 +1179,10 @@ const HistoryView = (props) => { ...@@ -1176,13 +1179,10 @@ const HistoryView = (props) => {
}, [loading]) }, [loading])
return ( return (
<div className={classNames(prefixCls, 'wkt-scroll-light')}> <div className={classNames(prefixCls, 'wkt-scroll-light')}>
{/*<Spin spinning={loading} wrapperClassName={classNames(`${prefixCls}-spin`)}>*/}
<div className={classNames(`${prefixCls}-spin`)} style={{position: "relative"}}> <div className={classNames(`${prefixCls}-spin`)} style={{position: "relative"}}>
{ {
(loading || percent !== 0) ? <div className={classNames(`${prefixCls}-progressWrapper`)}> (loading || percent !== 0) ? <div className={classNames(`${prefixCls}-progressWrapper`)}>
{/*<div className={classNames(`${prefixCls}-header`)}/>*/}
<div className={classNames(`${prefixCls}-contentWrapper`)}> <div className={classNames(`${prefixCls}-contentWrapper`)}>
{console.log(dateRange)}
{ {
lineDataType === '原始曲线' || lineDataType === '特征曲线'&& moment(dateRange?.[0]?.dateTo).diff(moment(dateRange?.[0]?.dateFrom), 'days') >= 30? <><Progress percent={percent} lineDataType === '原始曲线' || lineDataType === '特征曲线'&& moment(dateRange?.[0]?.dateTo).diff(moment(dateRange?.[0]?.dateFrom), 'days') >= 30? <><Progress percent={percent}
steps={20} steps={20}
...@@ -1228,7 +1228,6 @@ const HistoryView = (props) => { ...@@ -1228,7 +1228,6 @@ const HistoryView = (props) => {
</Tabs> </Tabs>
)} )}
</div> </div>
{/*</Spin>*/}
</div> </div>
); );
}; };
......
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