Commit 806f0d0e authored by 陈龙's avatar 陈龙

fix: 同期对比不允许清空时间选择框

parent 1bdaf0fe
...@@ -290,6 +290,7 @@ const handleBatchTime = (arr, cOption) => { ...@@ -290,6 +290,7 @@ const handleBatchTime = (arr, cOption) => {
return newArr; return newArr;
}; };
const handleFakeData = (dateRange, deviceParams) => { const handleFakeData = (dateRange, deviceParams) => {
if (!dateRange?.length) return;
let dateFrom = dateRange[0].dateFrom; let dateFrom = dateRange[0].dateFrom;
let dateTo = dateRange[0].dateTo; let dateTo = dateRange[0].dateTo;
return deviceParams.reduce((final, cur) => { return deviceParams.reduce((final, cur) => {
...@@ -420,7 +421,7 @@ const HistoryView = (props) => { ...@@ -420,7 +421,7 @@ const HistoryView = (props) => {
let _dateArr = shortcutsValue ? shortcutsDatePickerArr : datePickerArr; let _dateArr = shortcutsValue ? shortcutsDatePickerArr : datePickerArr;
return handleBatchTime(_dateArr, contrastOption); return handleBatchTime(_dateArr, contrastOption);
} }
}, [contrastOption, customerChecked, customerTime, datePickerArr, timeValue, shortcutsValue,shortcutsDatePickerArr]); }, [contrastOption, customerChecked, customerTime, datePickerArr, timeValue, shortcutsValue, shortcutsDatePickerArr]);
useEffect(() => { useEffect(() => {
let _diffDays = moment(dateRange[0].dateTo).diff(dateRange[0].dateFrom, 'days'); let _diffDays = moment(dateRange[0].dateTo).diff(dateRange[0].dateFrom, 'days');
if (_diffDays > 7 && dataThinKey === '1min') { if (_diffDays > 7 && dataThinKey === '1min') {
...@@ -747,6 +748,7 @@ const HistoryView = (props) => { ...@@ -747,6 +748,7 @@ const HistoryView = (props) => {
<div key={child.key} className={classNames(`${prefixCls}-contrast-list`)}> <div key={child.key} className={classNames(`${prefixCls}-contrast-list`)}>
<div className={classNames(`${prefixCls}-contrast-wrap`)}> <div className={classNames(`${prefixCls}-contrast-wrap`)}>
<DatePicker <DatePicker
allowClear={false}
getPopupContainer={(trigger) => trigger.parentElement} getPopupContainer={(trigger) => trigger.parentElement}
key={child.key} key={child.key}
picker={contrastOption === 'day' ? undefined : contrastOption} picker={contrastOption === 'day' ? undefined : contrastOption}
......
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